]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2013-10-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
authoredlinger <edlinger@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 Oct 2013 15:51:48 +0000 (15:51 +0000)
committeredlinger <edlinger@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 Oct 2013 15:51:48 +0000 (15:51 +0000)
        Fix DECL_BIT_FIELD depencency on flag_strict_volatile_bitfields
        and get_inner_reference returning different pmode for non-volatile
        bit-field members dependent on flag_strict_volatile_bitfields.
        * stor-layout.c (layout_decl): Remove special handling of
        flag_strict_volatile_bitfields.
        * expr.c (get_inner_reference): Don't use DECL_BIT_FIELD
        if flag_strict_volatile_bitfields > 0 and TREE_THIS_VOLATILE.

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

gcc/ChangeLog
gcc/expr.c
gcc/stor-layout.c

index 06a31ad3cd26cd2c3e478a1a923ae494c9975dc1..fd9123f6ae0cb75a03edbe1b5b1715f68ca06ab7 100644 (file)
@@ -1,3 +1,13 @@
+2013-10-21  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+
+       Fix DECL_BIT_FIELD depencency on flag_strict_volatile_bitfields
+       and get_inner_reference returning different pmode for non-volatile
+       bit-field members dependent on flag_strict_volatile_bitfields.
+       * stor-layout.c (layout_decl): Remove special handling of
+       flag_strict_volatile_bitfields.
+       * expr.c (get_inner_reference): Don't use DECL_BIT_FIELD
+       if flag_strict_volatile_bitfields > 0 and TREE_THIS_VOLATILE.
+
 2013-10-21  Paulo Matos  <pmatos@broadcom.com>
 
        * ipa-inline.c (edge_badness): Cap edge->count at max_count for badness
index 76ee9e0ab7f0bec803ca85710a8c4410ba036312..e672e454219bf345d5d6209dfea3ff7cfa77975f 100644 (file)
@@ -6552,16 +6552,18 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize,
     {
       tree field = TREE_OPERAND (exp, 1);
       size_tree = DECL_SIZE (field);
-      if (!DECL_BIT_FIELD (field))
-       mode = DECL_MODE (field);
-      else if (DECL_MODE (field) == BLKmode)
-       blkmode_bitfield = true;
-      else if (TREE_THIS_VOLATILE (exp)
-              && flag_strict_volatile_bitfields > 0)
+      if (flag_strict_volatile_bitfields > 0
+         && TREE_THIS_VOLATILE (exp)
+         && DECL_BIT_FIELD_TYPE (field)
+         && DECL_MODE (field) != BLKmode)
        /* Volatile bitfields should be accessed in the mode of the
             field's type, not the mode computed based on the bit
             size.  */
        mode = TYPE_MODE (DECL_BIT_FIELD_TYPE (field));
+      else if (!DECL_BIT_FIELD (field))
+       mode = DECL_MODE (field);
+      else if (DECL_MODE (field) == BLKmode)
+       blkmode_bitfield = true;
 
       *punsignedp = DECL_UNSIGNED (field);
     }
index 20e577d848269e16194ce00ff9760a842242f5fa..4619d6e427b3d9cf33b5f94659a4c5feb79217eb 100644 (file)
@@ -606,14 +606,10 @@ layout_decl (tree decl, unsigned int known_align)
 
          /* See if we can use an ordinary integer mode for a bit-field.
             Conditions are: a fixed size that is correct for another mode,
-            occupying a complete byte or bytes on proper boundary,
-            and not -fstrict-volatile-bitfields.  If the latter is set,
-            we unfortunately can't check TREE_THIS_VOLATILE, as a cast
-            may make a volatile object later.  */
+            occupying a complete byte or bytes on proper boundary.  */
          if (TYPE_SIZE (type) != 0
              && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
-             && GET_MODE_CLASS (TYPE_MODE (type)) == MODE_INT
-             && flag_strict_volatile_bitfields <= 0)
+             && GET_MODE_CLASS (TYPE_MODE (type)) == MODE_INT)
            {
              enum machine_mode xmode
                = mode_for_size_tree (DECL_SIZE (decl), MODE_INT, 1);