summaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1996-04-26 10:38:48 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1996-04-26 10:38:48 +0000
commit6bf8540314b2254676e770ee281370f1fd59bff3 (patch)
tree496cf2a0d79b51de615aceb2c94c18cb8c9beeae /gcc/stor-layout.c
parent013f7fc7a3653ed691f6c7414a3cf8041214ec5f (diff)
downloadgcc-6bf8540314b2254676e770ee281370f1fd59bff3.tar.gz
(layout_decl): Turn off DECL_BIT_FIELD for BLKmode that's properly
aligned and a multiple of a byte. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11892 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index e7510fe5f6c..78d53c060aa 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -278,6 +278,14 @@ layout_decl (decl, known_align)
}
}
+ /* Turn off DECL_BIT_FIELD if we won't need it set. */
+ if (DECL_BIT_FIELD (decl) && TYPE_MODE (type) == BLKmode
+ && 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))
+ DECL_BIT_FIELD (decl) = 0;
+
/* Evaluate nonconstant size only once, either now or as soon as safe. */
if (DECL_SIZE (decl) != 0 && TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST)
DECL_SIZE (decl) = variable_size (DECL_SIZE (decl));