aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E Wilson <wilson@specifixinc.com>2004-02-18 06:49:58 +0000
committerJim Wilson <wilson@gcc.gnu.org>2004-02-17 22:49:58 -0800
commitce7b36a482a89e8f016645630d6461ba94a1f654 (patch)
tree5889b804107ce1b2e15ee91100dee56d0c492b8e
parent4d0bdcd6e134eb0528577abdc446d12d94762ae2 (diff)
downloadgcc-ce7b36a482a89e8f016645630d6461ba94a1f654.zip
gcc-ce7b36a482a89e8f016645630d6461ba94a1f654.tar.gz
gcc-ce7b36a482a89e8f016645630d6461ba94a1f654.tar.bz2
Fix rtl sharing problem reported by Daniel Bayer on gcc list.
* caller-save.c (insert_restore): Pass mem through copy_rtx. (insert_save): Likewise. From-SVN: r78010
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/caller-save.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2b15336..00f6eff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-17 James E Wilson <wilson@specifixinc.com>
+
+ * caller-save.c (insert_restore): Pass mem through copy_rtx.
+ (insert_save): Likewise.
+
2004-02-17 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (h8300_emit_stack_adjustment): Fix a
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index c5ba0c5..028705b 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));