diff options
author | Olivier Hainque <hainque@adacore.com> | 2017-10-08 08:20:25 +0000 |
---|---|---|
committer | Olivier Hainque <hainque@gcc.gnu.org> | 2017-10-08 08:20:25 +0000 |
commit | a9f3126aad1238959612daf004c45f139a9737c0 (patch) | |
tree | e8a4e61ea29b5b8197d0881261439174e6d54fb1 /gcc | |
parent | 221ebb39af8e3c015a2aed2fa6e6001669cf9e29 (diff) | |
download | gcc-a9f3126aad1238959612daf004c45f139a9737c0.zip gcc-a9f3126aad1238959612daf004c45f139a9737c0.tar.gz gcc-a9f3126aad1238959612daf004c45f139a9737c0.tar.bz2 |
arm.c (arm_set_return_address): Use MEM_VOLATILE_P on the target mem instead of RTX_FRAME_RELATED_P on the insn...
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.
From-SVN: r253522
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 25 |
2 files changed, 20 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b44775c..c4a7c62 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 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): Handle DWARF2_UNWIND_INFO. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index bece1f7..622218c 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -26859,7 +26859,7 @@ arm_set_return_address (rtx source, rtx scratch) { arm_stack_offsets *offsets; HOST_WIDE_INT delta; - rtx addr; + rtx addr, mem; unsigned long saved_regs; offsets = arm_get_frame_offsets (); @@ -26889,11 +26889,12 @@ arm_set_return_address (rtx source, rtx scratch) 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); } } @@ -26905,7 +26906,7 @@ thumb_set_return_address (rtx source, rtx scratch) HOST_WIDE_INT delta; HOST_WIDE_INT limit; int reg; - rtx addr; + rtx addr, mem; unsigned long mask; emit_use (source); @@ -26945,11 +26946,11 @@ thumb_set_return_address (rtx source, rtx scratch) 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); |