(layout_decl): Don't turn off DECL_BIT_FIELD if DECL's alignment is
authorRichard Kenner <kenner@gcc.gnu.org>
Fri, 4 Oct 1996 11:01:47 +0000 (07:01 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 4 Oct 1996 11:01:47 +0000 (07:01 -0400)
less than its type.

From-SVN: r12896

gcc/stor-layout.c

index 5aca483..c71c473 100644 (file)
@@ -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.  */