aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2013-10-21 15:51:48 +0000
committerBernd Edlinger <edlinger@gcc.gnu.org>2013-10-21 15:51:48 +0000
commit5dfd32cddaa43eeda595dba8dff86ae1794f0830 (patch)
tree3cbd330a92a954d9c4e588c3b77ef68400c5ae80 /gcc/expr.c
parent0bff3610402612ce2d9c7bd136ee36fb4ab977b6 (diff)
downloadgcc-5dfd32cddaa43eeda595dba8dff86ae1794f0830.zip
gcc-5dfd32cddaa43eeda595dba8dff86ae1794f0830.tar.gz
gcc-5dfd32cddaa43eeda595dba8dff86ae1794f0830.tar.bz2
Fix DECL_BIT_FIELD depencency on flag_strict_volatile_bitfields and...
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. From-SVN: r203898
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 76ee9e0..e672e45 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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);
}