From 5d1cbc1db397a6325dc16e56c0d0d10725e0fce3 Mon Sep 17 00:00:00 2001
From: mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 1 Nov 1999 04:08:54 +0000
Subject: [PATCH] 	* expr.c (readonly_fields_p): Ignore everything except
 FIELD_DECLs.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30306 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog | 4 ++++
 gcc/expr.c    | 7 ++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9d6da58fec43..5815eb44d9da 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+Sun Oct 31 20:25:42 1999  Mark P. Mitchell  <mark@codesourcery.com>
+
+	* expr.c (readonly_fields_p): Ignore everything except FIELD_DECLs.
+
 Sun Oct 31 20:42:17 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
 	* hard-reg-set.h (reg_names): Constify a char*.
diff --git a/gcc/expr.c b/gcc/expr.c
index 59ae687c5d87..69c6f56bced1 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5573,9 +5573,10 @@ readonly_fields_p (type)
   tree field;
 
   for (field = TYPE_FIELDS (type); field != 0; field = TREE_CHAIN (field))
-    if (TREE_READONLY (field)
-	|| (TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE
-	    && readonly_fields_p (TREE_TYPE (field))))
+    if (TREE_CODE (field) == FIELD_DECL 
+	&& (TREE_READONLY (field)
+	    || (TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE
+		&& readonly_fields_p (TREE_TYPE (field)))))
       return 1;
 
   return 0;
-- 
GitLab