aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 1b89a63..29d22b0 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -10521,7 +10521,11 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
if (op0 == orig_op0)
op0 = copy_rtx (op0);
- set_mem_attributes (op0, exp, 0);
+ /* Don't set memory attributes if the base expression is
+ SSA_NAME that got expanded as a MEM. In that case, we should
+ just honor its original memory attributes. */
+ if (TREE_CODE (tem) != SSA_NAME || !MEM_P (orig_op0))
+ set_mem_attributes (op0, exp, 0);
if (REG_P (XEXP (op0, 0)))
mark_reg_pointer (XEXP (op0, 0), MEM_ALIGN (op0));