From 925d5bbfe9aab62d196da3cc1afb238c6d8b5b4c Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Sat, 18 Sep 1993 02:36:30 +0000 Subject: (output_init_element): Update constructor_bit_index for union types. From-SVN: r5350 --- gcc/c-typeck.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 9e463cd..f363420 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -5987,8 +5987,10 @@ output_init_element (value, type, field, pending) output_constant (digest_init (type, value, 0, 0), int_size_in_bytes (type)); - /* For a record, keep track of end position of last field. */ - if (TREE_CODE (constructor_type) == RECORD_TYPE) + /* For a record or union, + keep track of end position of last field. */ + if (TREE_CODE (constructor_type) == RECORD_TYPE + || TREE_CODE (constructor_type) == UNION_TYPE) { tree temp = size_binop (PLUS_EXPR, DECL_FIELD_BITPOS (constructor_fields), -- cgit v1.1