summaryrefslogtreecommitdiff
path: root/gcc/caller-save.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-18 06:49:58 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-18 06:49:58 +0000
commit6f5b55f8df605d1bc15f2f0266ecb3e5957297de (patch)
tree5889b804107ce1b2e15ee91100dee56d0c492b8e /gcc/caller-save.c
parenta99f9f2127cead5fed1b5d076b240e0cf0b42ad5 (diff)
downloadgcc-6f5b55f8df605d1bc15f2f0266ecb3e5957297de.tar.gz
Fix rtl sharing problem reported by Daniel Bayer on gcc list.
* caller-save.c (insert_restore): Pass mem through copy_rtx. (insert_save): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78010 138bc75d-0d04-0410-961f-82ee72b054a4
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));