aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-06-29 19:21:25 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-06-29 19:21:25 +0000
commit3ba358bf20a292e277df4de02b2f57c203e627cc (patch)
tree55e1d6b786135609443047541d2d9148636913b0 /gcc/expr.c
parent74582a3e2e01068437410fb75f2f9282ee4923e3 (diff)
downloadgcc-3ba358bf20a292e277df4de02b2f57c203e627cc.zip
gcc-3ba358bf20a292e277df4de02b2f57c203e627cc.tar.gz
gcc-3ba358bf20a292e277df4de02b2f57c203e627cc.tar.bz2
expr.c (expand_expr): When testing for unaligned objects...
* expr.c (expand_expr) <normal_inner_ref>: When testing for unaligned objects, take into account only the alignment of 'op0' and 'mode1' if 'op0' is a MEM. From-SVN: r249811
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 0a52a3d..0e8216b 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -10639,11 +10639,11 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
/* If the field isn't aligned enough to fetch as a memref,
fetch it as a bit field. */
|| (mode1 != BLKmode
- && (((TYPE_ALIGN (TREE_TYPE (tem)) < GET_MODE_ALIGNMENT (mode)
- || (bitpos % GET_MODE_ALIGNMENT (mode) != 0)
- || (MEM_P (op0)
- && (MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode1)
- || (bitpos % GET_MODE_ALIGNMENT (mode1) != 0))))
+ && (((MEM_P (op0)
+ ? MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode1)
+ || (bitpos % GET_MODE_ALIGNMENT (mode1) != 0)
+ : TYPE_ALIGN (TREE_TYPE (tem)) < GET_MODE_ALIGNMENT (mode)
+ || (bitpos % GET_MODE_ALIGNMENT (mode) != 0))
&& modifier != EXPAND_MEMORY
&& ((modifier == EXPAND_CONST_ADDRESS
|| modifier == EXPAND_INITIALIZER)