From: Eric Botcazou Date: Sat, 8 Nov 2014 09:17:23 +0000 (+0000) Subject: arm.c (arm_set_return_address): Mark the store as frame related, if any. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d1b0433b1aba81a6c3e87e867aaf24c6356e4f35;p=gcc.git arm.c (arm_set_return_address): Mark the store as frame related, if any. * config/arm/arm.c (arm_set_return_address): Mark the store as frame related, if any. (thumb_set_return_address): Likewise. From-SVN: r217251 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c2ec869d66a..6bfc320d05c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-11-08 Eric Botcazou + + * config/arm/arm.c (arm_set_return_address): Mark the store as frame + related, if any. + (thumb_set_return_address): Likewise. + 2014-11-07 Jeff Law PR tree-optimization/61515 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index cc005d6c692..05529520648 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -29012,7 +29012,11 @@ arm_set_return_address (rtx source, rtx scratch) addr = plus_constant (Pmode, addr, delta); } - emit_move_insn (gen_frame_mem (Pmode, addr), source); + /* 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)); } } @@ -29064,7 +29068,11 @@ thumb_set_return_address (rtx source, rtx scratch) else addr = plus_constant (Pmode, addr, delta); - emit_move_insn (gen_frame_mem (Pmode, addr), source); + /* 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)); } else emit_move_insn (gen_rtx_REG (Pmode, LR_REGNUM), source);