diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2015-01-15 11:55:37 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2015-01-15 11:55:37 +0000 |
commit | 3aabdc00d0cdf1b4fccdb445cf3846f5d83c3981 (patch) | |
tree | 903d2ee38e433bf9d9223bc1d41f49de5d88cf89 /gcc/expr.c | |
parent | 04d8b4dcbf9f39a794614845f792f52508f19e7f (diff) | |
download | gcc-3aabdc00d0cdf1b4fccdb445cf3846f5d83c3981.zip gcc-3aabdc00d0cdf1b4fccdb445cf3846f5d83c3981.tar.gz gcc-3aabdc00d0cdf1b4fccdb445cf3846f5d83c3981.tar.bz2 |
expr.c (expand_expr_real_1): Use the expression to set the memory attributes in all cases but clear MEM_EXPR...
* expr.c (expand_expr_real_1) <normal_inner_ref>: Use the expression to
set the memory attributes in all cases but clear MEM_EXPR if need be.
From-SVN: r219648
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -10137,7 +10137,7 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode, tree tem = get_inner_reference (exp, &bitsize, &bitpos, &offset, &mode1, &unsignedp, &volatilep, true); rtx orig_op0, memloc; - bool mem_attrs_from_type = false; + bool clear_mem_expr = false; /* If we got back the original object, something is wrong. Perhaps we are evaluating an expression too early. In any event, don't @@ -10233,7 +10233,7 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode, memloc = assign_temp (TREE_TYPE (tem), 1, 1); emit_move_insn (memloc, op0); op0 = memloc; - mem_attrs_from_type = true; + clear_mem_expr = true; } if (offset) @@ -10417,17 +10417,17 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode, if (op0 == orig_op0) op0 = copy_rtx (op0); - /* If op0 is a temporary because of forcing to memory, pass only the - type to set_mem_attributes so that the original expression is never - marked as ADDRESSABLE through MEM_EXPR of the temporary. */ - if (mem_attrs_from_type) - set_mem_attributes (op0, type, 0); - else - set_mem_attributes (op0, exp, 0); + set_mem_attributes (op0, exp, 0); if (REG_P (XEXP (op0, 0))) mark_reg_pointer (XEXP (op0, 0), MEM_ALIGN (op0)); + /* If op0 is a temporary because the original expressions was forced + to memory, clear MEM_EXPR so that the original expression cannot + be marked as addressable through MEM_EXPR of the temporary. */ + if (clear_mem_expr) + set_mem_expr (op0, NULL_TREE); + MEM_VOLATILE_P (op0) |= volatilep; if (mode == mode1 || mode1 == BLKmode || mode1 == tmode || modifier == EXPAND_CONST_ADDRESS |