diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2013-10-21 15:51:48 +0000 |
---|---|---|
committer | Bernd Edlinger <edlinger@gcc.gnu.org> | 2013-10-21 15:51:48 +0000 |
commit | 5dfd32cddaa43eeda595dba8dff86ae1794f0830 (patch) | |
tree | 3cbd330a92a954d9c4e588c3b77ef68400c5ae80 /gcc/expr.c | |
parent | 0bff3610402612ce2d9c7bd136ee36fb4ab977b6 (diff) | |
download | gcc-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.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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); } |