(get_unwidened): Don't crash if FIELD_DECL not layed out.
authorRichard Kenner <kenner@gcc.gnu.org>
Sat, 18 Jan 1997 20:58:48 +0000 (15:58 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Sat, 18 Jan 1997 20:58:48 +0000 (15:58 -0500)
From-SVN: r13508

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)));