OSDN Git Service

(get_unwidened): Don't crash if FIELD_DECL not layed out.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 18 Jan 1997 20:58:48 +0000 (20:58 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 18 Jan 1997 20:58:48 +0000 (20:58 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13508 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/tree.c

index f8b1a6e..d9b5abe 100644 (file)
@@ -4181,7 +4181,9 @@ get_unwidened (op, for_type)
 
   if (TREE_CODE (op) == COMPONENT_REF
       /* Since type_for_size always gives an integer type.  */
-      && TREE_CODE (type) != REAL_TYPE)
+      && TREE_CODE (type) != REAL_TYPE
+      /* Don't crash if field not layed out yet.  */
+      && DECL_SIZE (TREE_OPERAND (op, 1)) != 0)
     {
       unsigned innerprec = TREE_INT_CST_LOW (DECL_SIZE (TREE_OPERAND (op, 1)));
       type = type_for_size (innerprec, TREE_UNSIGNED (TREE_OPERAND (op, 1)));