OSDN Git Service

(push_init_level): When output alignment for structure
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Apr 1996 17:46:09 +0000 (17:46 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Apr 1996 17:46:09 +0000 (17:46 +0000)
field, add check to verify it is the next field to be output.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11667 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/c-typeck.c

index 683c15e..06ef493 100644 (file)
@@ -5331,10 +5331,12 @@ push_init_level (implicit)
        break;
     }
 
-  /* Structure elements may require alignment.  Do this now
-     if necessary for the subaggregate.  */
+  /* Structure elements may require alignment.  Do this now if necessary
+     for the subaggregate, and if it comes next in sequence.  Don't do
+     this for subaggregates that will go on the pending list.  */
   if (constructor_incremental && constructor_type != 0
-      && TREE_CODE (constructor_type) == RECORD_TYPE && constructor_fields)
+      && TREE_CODE (constructor_type) == RECORD_TYPE && constructor_fields
+      && constructor_fields == constructor_unfilled_fields)
     {
       /* Advance to offset of this element.  */
       if (! tree_int_cst_equal (constructor_bit_index,