diff options
author | Richard Stallman <rms@gnu.org> | 1992-03-29 03:05:58 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1992-03-29 03:05:58 +0000 |
commit | 23ad4d413056ba518720155f304d0524e248ab0e (patch) | |
tree | d3cfd5ef45715f71502f18ac04b920fd7d3a4be6 | |
parent | 5c8bab4ab90f9dfbb65a5da313b5bba2222f2fa4 (diff) | |
download | gcc-23ad4d413056ba518720155f304d0524e248ab0e.zip gcc-23ad4d413056ba518720155f304d0524e248ab0e.tar.gz gcc-23ad4d413056ba518720155f304d0524e248ab0e.tar.bz2 |
*** empty log message ***
From-SVN: r619
-rw-r--r-- | gcc/stor-layout.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index c2aba9c..bf02800 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -188,8 +188,10 @@ layout_decl (decl, known_align) DECL_SIZE (decl) = size_int (spec_size); } /* Force alignment required for the data type. - But if the decl itself wants greater alignment, don't override that. */ - else if (TYPE_ALIGN (type) > DECL_ALIGN (decl)) + But if the decl itself wants greater alignment, don't override that. + Likewise, if the decl is packed, don't override it. */ + else if (DECL_ALIGN (decl) == 0 + || (! DECL_PACKED (decl) && TYPE_ALIGN (type) > DECL_ALIGN (decl))) DECL_ALIGN (decl) = TYPE_ALIGN (type); /* See if we can use an ordinary integer mode for a bit-field. */ @@ -302,6 +304,7 @@ layout_record (rec) record_align = MAX (record_align, desired_align); #else if (PCC_BITFIELD_TYPE_MATTERS && TREE_TYPE (field) != error_mark_node + && DECL_BIT_FIELD (field) && ! integer_zerop (TYPE_SIZE (TREE_TYPE (field)))) { /* For these machines, a zero-length field does not @@ -350,6 +353,7 @@ layout_record (rec) if (PCC_BITFIELD_TYPE_MATTERS && TREE_CODE (field) == FIELD_DECL && TREE_TYPE (field) != error_mark_node + && DECL_BIT_FIELD (field) && !DECL_PACKED (field) && !integer_zerop (DECL_SIZE (field))) { @@ -371,6 +375,7 @@ layout_record (rec) if (BITFIELD_NBYTES_LIMITED && TREE_CODE (field) == FIELD_DECL && TREE_TYPE (field) != error_mark_node + && DECL_BIT_FIELD (field) && !DECL_PACKED (field) && !integer_zerop (DECL_SIZE (field))) { @@ -499,7 +504,7 @@ layout_union (rec) #ifdef PCC_BITFIELD_TYPE_MATTERS /* On the m88000, a bit field of declare type `int' forces the entire union to have `int' alignment. */ - if (PCC_BITFIELD_TYPE_MATTERS) + if (PCC_BITFIELD_TYPE_MATTERS && DECL_BIT_FIELD (field)) union_align = MAX (union_align, TYPE_ALIGN (TREE_TYPE (field))); #endif |