+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.
+
2012-04-13 Alexandre Oliva <aoliva@redhat.com>
PR debug/48866
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
memloc = assign_temp (nt, 1, 1, 1);
emit_move_insn (memloc, op0);
op0 = memloc;
+ mem_attrs_from_type = true;
}
if (offset)
emit_move_insn (new_rtx, op0);
op0 = copy_rtx (new_rtx);
PUT_MODE (op0, BLKmode);
- set_mem_attributes (op0, exp, 1);
}
return op0;
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));