From 977a7752c7617d388cf14b72606e36fa5ddcc6f7 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Fri, 26 Apr 1996 06:38:48 -0400 Subject: [PATCH] (layout_decl): Turn off DECL_BIT_FIELD for BLKmode that's properly aligned and a multiple of a byte. From-SVN: r11892 --- gcc/stor-layout.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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)); -- 2.30.2