diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1996-06-03 07:57:30 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1996-06-03 07:57:30 -0400 |
commit | 3a369acd31a93c6f3f2d8e3f93f1f5dcca5de4d0 (patch) | |
tree | 76306cb77e7e010febd1548a8d761b94389c5054 /gcc | |
parent | 02eb6e90226abb0fe921a2d24e9874ae943ed003 (diff) | |
download | gcc-3a369acd31a93c6f3f2d8e3f93f1f5dcca5de4d0.zip gcc-3a369acd31a93c6f3f2d8e3f93f1f5dcca5de4d0.tar.gz gcc-3a369acd31a93c6f3f2d8e3f93f1f5dcca5de4d0.tar.bz2 |
(layout_decl): Test DECL_PACKED and TYPE_PACKED instead of
flag_pack_struct.
From-SVN: r12141
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/stor-layout.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 78d53c0..0a152d7 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -254,7 +254,7 @@ layout_decl (decl, known_align) DECL_BIT_FIELD_TYPE (decl) = DECL_BIT_FIELD (decl) ? type : 0; if (maximum_field_alignment != 0) DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), maximum_field_alignment); - else if (flag_pack_struct) + else if (DECL_PACKED (decl)) DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), BITS_PER_UNIT); } @@ -391,7 +391,7 @@ layout_record (rec) int type_align = TYPE_ALIGN (TREE_TYPE (field)); if (maximum_field_alignment != 0) type_align = MIN (type_align, maximum_field_alignment); - else if (flag_pack_struct) + else if (TYPE_PACKED (rec)) type_align = MIN (type_align, BITS_PER_UNIT); record_align = MAX (record_align, type_align); @@ -433,9 +433,7 @@ layout_record (rec) && TREE_TYPE (field) != error_mark_node && DECL_BIT_FIELD_TYPE (field) && !DECL_PACKED (field) - /* If #pragma pack is in effect, turn off this feature. */ && maximum_field_alignment == 0 - && !flag_pack_struct && !integer_zerop (DECL_SIZE (field))) { int type_align = TYPE_ALIGN (TREE_TYPE (field)); @@ -470,7 +468,7 @@ layout_record (rec) if (maximum_field_alignment != 0) type_align = MIN (type_align, maximum_field_alignment); - else if (flag_pack_struct) + else if (TYPE_PACKED (rec)) type_align = MIN (type_align, BITS_PER_UNIT); /* A bit field may not span the unit of alignment of its type. |