+2017-10-08 Olivier Hainque <hainque@adacore.com>
+
+ * config/arm/arm.c (arm_set_return_address): Use MEM_VOLATILE_P
+ on the target mem instead of RTX_FRAME_RELATED_P on the insn to
+ prevent DSE.
+ (thumb_set_return_address): Likewise.
+
2017-10-08 Olivier Hainque <hainque@adacore.com>
* common/config/arm/arm-common.c (arm_except_unwind_info):
{
arm_stack_offsets *offsets;
HOST_WIDE_INT delta;
- rtx addr;
+ rtx addr, mem;
unsigned long saved_regs;
offsets = arm_get_frame_offsets ();
addr = plus_constant (Pmode, addr, delta);
}
- /* The store needs to be marked as frame related in order to prevent
- DSE from deleting it as dead if it is based on fp. */
- rtx insn = emit_move_insn (gen_frame_mem (Pmode, addr), source);
- RTX_FRAME_RELATED_P (insn) = 1;
- add_reg_note (insn, REG_CFA_RESTORE, gen_rtx_REG (Pmode, LR_REGNUM));
+
+ /* The store needs to be marked to prevent DSE from deleting
+ it as dead if it is based on fp. */
+ mem = gen_frame_mem (Pmode, addr);
+ MEM_VOLATILE_P (mem) = true;
+ emit_move_insn (mem, source);
}
}
HOST_WIDE_INT delta;
HOST_WIDE_INT limit;
int reg;
- rtx addr;
+ rtx addr, mem;
unsigned long mask;
emit_use (source);
else
addr = plus_constant (Pmode, addr, delta);
- /* The store needs to be marked as frame related in order to prevent
- DSE from deleting it as dead if it is based on fp. */
- rtx insn = emit_move_insn (gen_frame_mem (Pmode, addr), source);
- RTX_FRAME_RELATED_P (insn) = 1;
- add_reg_note (insn, REG_CFA_RESTORE, gen_rtx_REG (Pmode, LR_REGNUM));
+ /* The store needs to be marked to prevent DSE from deleting
+ it as dead if it is based on fp. */
+ mem = gen_frame_mem (Pmode, addr);
+ MEM_VOLATILE_P (mem) = true;
+ emit_move_insn (mem, source);
}
else
emit_move_insn (gen_rtx_REG (Pmode, LR_REGNUM), source);