aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-06-03 07:57:03 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1996-06-03 07:57:03 -0400
commit02eb6e90226abb0fe921a2d24e9874ae943ed003 (patch)
tree5db635f0ad67c6d7c433ff6a72e1071ed618ac81 /gcc
parent9fa0af71f68c9f248755d9d9d1f72cf64ec29479 (diff)
downloadgcc-02eb6e90226abb0fe921a2d24e9874ae943ed003.zip
gcc-02eb6e90226abb0fe921a2d24e9874ae943ed003.tar.gz
gcc-02eb6e90226abb0fe921a2d24e9874ae943ed003.tar.bz2
(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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-decl.c7
1 files changed, 5 insertions, 2 deletions
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)