aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-10-26 06:41:41 +0000
committerRichard Stallman <rms@gnu.org>1993-10-26 06:41:41 +0000
commite700c8ecce6471bb5fce4be69d49c8e1df0366d6 (patch)
tree6671a0b1755598e71334724b221f8d021cd19bd3
parente174accc45d14735a11d8c7abd37c674b2f4f431 (diff)
downloadgcc-e700c8ecce6471bb5fce4be69d49c8e1df0366d6.zip
gcc-e700c8ecce6471bb5fce4be69d49c8e1df0366d6.tar.gz
gcc-e700c8ecce6471bb5fce4be69d49c8e1df0366d6.tar.bz2
(push_init_level): Align here for element of record.
(process_init_element): Not here (was before call to push_init_level). From-SVN: r5891
-rw-r--r--gcc/c-typeck.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 249311a..3c6f08b 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -5018,6 +5018,24 @@ push_init_level (implicit)
break;
}
+ /* Structure elements may require alignment. Do this now
+ if necessary for the subaggregate. */
+ if (constructor_incremental && TREE_CODE (constructor_type) == RECORD_TYPE)
+ {
+ /* Advance to offset of this element. */
+ if (! tree_int_cst_equal (constructor_bit_index,
+ DECL_FIELD_BITPOS (constructor_fields)))
+ {
+ int next = (TREE_INT_CST_LOW
+ (DECL_FIELD_BITPOS (constructor_fields))
+ / BITS_PER_UNIT);
+ int here = (TREE_INT_CST_LOW (constructor_bit_index)
+ / BITS_PER_UNIT);
+
+ assemble_zeros (next - here);
+ }
+ }
+
p = (struct constructor_stack *) xmalloc (sizeof (struct constructor_stack));
p->type = constructor_type;
p->fields = constructor_fields;
@@ -5831,23 +5849,6 @@ process_init_element (value)
&& (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE
|| fieldcode == UNION_TYPE))
{
- /* Structure elements may require alignment. Do this now
- if necessary for the subaggregate. */
- if (constructor_incremental)
- {
- /* Advance to offset of this element. */
- if (! tree_int_cst_equal (constructor_bit_index,
- DECL_FIELD_BITPOS (constructor_fields)))
- {
- int next = (TREE_INT_CST_LOW
- (DECL_FIELD_BITPOS (constructor_fields))
- / BITS_PER_UNIT);
- int here = (TREE_INT_CST_LOW (constructor_bit_index)
- / BITS_PER_UNIT);
-
- assemble_zeros (next - here);
- }
- }
push_init_level (1);
continue;
}