aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1996-04-04 09:46:09 -0800
committerJim Wilson <wilson@gcc.gnu.org>1996-04-04 09:46:09 -0800
commitbdc49177fdcd9df5063329dcfb5a617c2233ecab (patch)
treef9be5f25df02bc30e4c5435a19d7c6d94cb844d3 /gcc
parent489c81a38f2af4baeebb45f7835f8945ced1fb2f (diff)
downloadgcc-bdc49177fdcd9df5063329dcfb5a617c2233ecab.zip
gcc-bdc49177fdcd9df5063329dcfb5a617c2233ecab.tar.gz
gcc-bdc49177fdcd9df5063329dcfb5a617c2233ecab.tar.bz2
(push_init_level): When output alignment for structure
field, add check to verify it is the next field to be output. From-SVN: r11667
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-typeck.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 683c15e..06ef493 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -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,