diff options
author | Julian Brown <julian@codesourcery.com> | 2011-03-23 11:57:28 +0000 |
---|---|---|
committer | Julian Brown <jules@gcc.gnu.org> | 2011-03-23 11:57:28 +0000 |
commit | bf90208ff88549c2c200c4f60469d9ba6696c677 (patch) | |
tree | 03c32c91566610e208ad992f71e36a4c1f6fd28e /gcc/expr.c | |
parent | 3505a737fd92d93b1602ed6daa1ef702b0504462 (diff) | |
download | gcc-bf90208ff88549c2c200c4f60469d9ba6696c677.zip gcc-bf90208ff88549c2c200c4f60469d9ba6696c677.tar.gz gcc-bf90208ff88549c2c200c4f60469d9ba6696c677.tar.bz2 |
expr.c (expand_expr_real_1): Only use BLKmode for volatile accesses which are not naturally aligned.
* expr.c (expand_expr_real_1): Only use BLKmode for volatile
accesses which are not naturally aligned.
From-SVN: r171347
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -9147,8 +9147,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, && modifier != EXPAND_CONST_ADDRESS && modifier != EXPAND_INITIALIZER) /* If the field is volatile, we always want an aligned - access. */ - || (volatilep && flag_strict_volatile_bitfields > 0) + access. Only do this if the access is not already naturally + aligned, otherwise "normal" (non-bitfield) volatile fields + become non-addressable. */ + || (volatilep && flag_strict_volatile_bitfields > 0 + && (bitpos % GET_MODE_ALIGNMENT (mode) != 0)) /* If the field isn't aligned enough to fetch as a memref, fetch it as a bit field. */ || (mode1 != BLKmode |