* stor-layout.c (layout_decl): Turn bitfields into ordinary
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Dec 2003 19:49:59 +0000 (19:49 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Dec 2003 19:49:59 +0000 (19:49 +0000)
fields, even if they are the first field in a structure.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75242 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/stor-layout.c

index 20ca93e..b84f4cf 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-30  Mark Mitchell  <mark@codesourcery.com>
+
+       * stor-layout.c (layout_decl): Turn bitfields into ordinary
+       fields, even if they are the first field in a structure.
+
 2003-12-30  Roger Sayle  <roger@eyesopen.com>
 
        * fold-const.c (fold) <COND_EXPR>: Don't require strict type
index e8c7ba4..1272a0c 100644 (file)
@@ -435,7 +435,9 @@ layout_decl (tree decl, unsigned int known_align)
              enum machine_mode xmode
                = mode_for_size_tree (DECL_SIZE (decl), MODE_INT, 1);
 
-             if (xmode != BLKmode && known_align >= GET_MODE_ALIGNMENT (xmode))
+             if (xmode != BLKmode 
+                 && (known_align == 0
+                     || known_align >= GET_MODE_ALIGNMENT (xmode)))
                {
                  DECL_ALIGN (decl) = MAX (GET_MODE_ALIGNMENT (xmode),
                                           DECL_ALIGN (decl));