OSDN Git Service

(layout_decl): Don't turn off DECL_BIT_FIELD if DECL's alignment is
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Oct 1996 11:01:47 +0000 (11:01 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Oct 1996 11:01:47 +0000 (11:01 +0000)
less than its type.

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

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.  */