From 20f8a22f1e106ed44122d0444d5f4bd136577c56 Mon Sep 17 00:00:00 2001 From: mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Tue, 30 Dec 2003 19:49:59 +0000 Subject: [PATCH] * stor-layout.c (layout_decl): Turn bitfields into ordinary 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 | 5 +++++ gcc/stor-layout.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 20ca93eba17..b84f4cfd38b 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 e8c7ba4dc9a..1272a0cbbcc 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)); -- GitLab