diff options
author | Martin Jambor <mjambor@suse.cz> | 2012-04-13 19:12:33 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2012-04-13 19:12:33 +0200 |
commit | 65dc645a1506b95c45817f6b5281d975fecb9295 (patch) | |
tree | d43ec3fd9297e9086ec2e59da2e1fb04119e501e /gcc/expr.c | |
parent | 1adbb3614d87c487eb0b3c3eebbe1c6bb6e7438f (diff) | |
download | gcc-65dc645a1506b95c45817f6b5281d975fecb9295.zip gcc-65dc645a1506b95c45817f6b5281d975fecb9295.tar.gz gcc-65dc645a1506b95c45817f6b5281d975fecb9295.tar.bz2 |
expr.c (expand_expr_real_1): Pass type, not the expression, to set_mem_attributes for a memory temporary.
2012-04-13 Martin Jambor <mjambor@suse.cz>
* expr.c (expand_expr_real_1): Pass type, not the expression, to
set_mem_attributes for a memory temporary. Do not call the function
for the memory temporary created for a bitfield.
From-SVN: r186426
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -9603,6 +9603,7 @@ expand_expr_real_1 (tree exp, rtx target, enum 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; /* If we got back the original object, something is wrong. Perhaps we are evaluating an expression too early. In any event, don't @@ -9708,6 +9709,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, memloc = assign_temp (nt, 1, 1, 1); emit_move_insn (memloc, op0); op0 = memloc; + mem_attrs_from_type = true; } if (offset) @@ -9880,7 +9882,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, emit_move_insn (new_rtx, op0); op0 = copy_rtx (new_rtx); PUT_MODE (op0, BLKmode); - set_mem_attributes (op0, exp, 1); } return op0; @@ -9901,7 +9902,14 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, if (op0 == orig_op0) op0 = copy_rtx (op0); - set_mem_attributes (op0, exp, 0); + /* 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); + if (REG_P (XEXP (op0, 0))) mark_reg_pointer (XEXP (op0, 0), MEM_ALIGN (op0)); |