aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-10-04 07:01:47 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1996-10-04 07:01:47 -0400
commit1fdae49c422b0984c28545888c1b69293fddef86 (patch)
tree1bc0d7d307976de7f3a1680fa1333d788571c29f
parent2d37f024c092e51c2c03665408a9db2e5f3cebb4 (diff)
downloadgcc-1fdae49c422b0984c28545888c1b69293fddef86.zip
gcc-1fdae49c422b0984c28545888c1b69293fddef86.tar.gz
gcc-1fdae49c422b0984c28545888c1b69293fddef86.tar.bz2
(layout_decl): Don't turn off DECL_BIT_FIELD if DECL's alignment is
less than its type. From-SVN: r12896
-rw-r--r--gcc/stor-layout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 5aca483..c71c473 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -284,7 +284,8 @@ layout_decl (decl, known_align)
&& known_align % TYPE_ALIGN (type) == 0
&& DECL_SIZE (decl) != 0
&& (TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST
- || (TREE_INT_CST_LOW (DECL_SIZE (decl)) % BITS_PER_UNIT) == 0))
+ || (TREE_INT_CST_LOW (DECL_SIZE (decl)) % BITS_PER_UNIT) == 0)
+ && DECL_ALIGN (decl) >= TYPE_ALIGN (type))
DECL_BIT_FIELD (decl) = 0;
/* Evaluate nonconstant size only once, either now or as soon as safe. */