summaryrefslogtreecommitdiff
path: root/gcc/caller-save.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/caller-save.c')
-rw-r--r--gcc/caller-save.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index c5ba0c55bc5..028705b4389 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -685,6 +685,8 @@ insert_restore (struct insn_chain *chain, int before_p, int regno,
&& save_mode [regno] != GET_MODE (mem)
&& numregs == (unsigned int) hard_regno_nregs[regno][save_mode [regno]])
mem = adjust_address (mem, save_mode[regno], 0);
+ else
+ mem = copy_rtx (mem);
pat = gen_rtx_SET (VOIDmode,
gen_rtx_REG (GET_MODE (mem),
regno), mem);
@@ -757,6 +759,8 @@ insert_save (struct insn_chain *chain, int before_p, int regno,
&& save_mode [regno] != GET_MODE (mem)
&& numregs == (unsigned int) hard_regno_nregs[regno][save_mode [regno]])
mem = adjust_address (mem, save_mode[regno], 0);
+ else
+ mem = copy_rtx (mem);
pat = gen_rtx_SET (VOIDmode, mem,
gen_rtx_REG (GET_MODE (mem),
regno));