(start_struct): Set TYPE_PACKED from flag_pack_struct.
authorRichard Kenner <kenner@gcc.gnu.org>
Mon, 3 Jun 1996 11:57:03 +0000 (07:57 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 3 Jun 1996 11:57:03 +0000 (07:57 -0400)
(start_enum): Likewise but from flag_short_enums.
(finish_enum): Test TYPE_PACKED, not flag_short_enums.

From-SVN: r12140

gcc/c-decl.c

index 0eaf98190d12b873f3a07937191b70ffd89db0b4..c89ee1d9fac3b094919feaee64aa78e703e1b466 100644 (file)
@@ -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)