diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-02-24 08:36:16 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-02-24 08:36:16 +0000 |
commit | f0e92ef1f9bd7460afac502d5b114e32833294d5 (patch) | |
tree | f97d67ca1002d6df826f5c5fa36b27dee372f699 /gcc/expr.c | |
parent | 6907286f253db0e629deec479fc81166cdecfcca (diff) |
PR middle-end/69909
* expr.c (expand_expr_real_1) <normal_inner_ref>: Avoid
set_mem_attributes if tem is SSA_NAME which got expanded
as a MEM.
* gcc.dg/torture/pr69909.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233656 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index 1b89a632017..29d22b07256 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)); |