From 02eb6e90226abb0fe921a2d24e9874ae943ed003 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 3 Jun 1996 07:57:03 -0400 Subject: (start_struct): Set TYPE_PACKED from flag_pack_struct. (start_enum): Likewise but from flag_short_enums. (finish_enum): Test TYPE_PACKED, not flag_short_enums. From-SVN: r12140 --- gcc/c-decl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 0eaf981..c89ee1d 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -5435,6 +5435,7 @@ start_struct (code, name) ref = make_node (code); pushtag (name, ref); C_TYPE_BEING_DEFINED (ref) = 1; + TYPE_PACKED (ref) = flag_pack_struct; return ref; } @@ -5862,6 +5863,9 @@ start_enum (name) enum_next_value = integer_zero_node; enum_overflow = 0; + if (flag_short_enums) + TYPE_PACKED (enumtype) = 1; + return enumtype; } @@ -5918,8 +5922,7 @@ finish_enum (enumtype, values, attributes) highprec = min_precision (maxnode, TREE_UNSIGNED (enumtype)); precision = MAX (lowprec, highprec); - if (flag_short_enums || TYPE_PACKED (enumtype) - || precision > TYPE_PRECISION (integer_type_node)) + if (TYPE_PACKED (enumtype) || precision > TYPE_PRECISION (integer_type_node)) { tree narrowest = type_for_size (precision, 1); if (narrowest == 0) -- cgit v1.1