aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-12-30 19:49:59 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-12-30 19:49:59 +0000
commit9a706ec7132490bc2fe600a9410595e79319e94f (patch)
tree91c139be7ab447ab436a04b7a6e35c05db1cf016
parentb6d904612e54d55c2bbdb6751d96dc87b3c6d458 (diff)
downloadgcc-9a706ec7132490bc2fe600a9410595e79319e94f.zip
gcc-9a706ec7132490bc2fe600a9410595e79319e94f.tar.gz
gcc-9a706ec7132490bc2fe600a9410595e79319e94f.tar.bz2
stor-layout.c (layout_decl): Turn bitfields into ordinary fields...
* stor-layout.c (layout_decl): Turn bitfields into ordinary fields, even if they are the first field in a structure. From-SVN: r75242
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/stor-layout.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 20ca93e..b84f4cf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index e8c7ba4..1272a0c 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -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));