aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-01-21 01:52:46 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-01-21 01:52:46 +0000
commitdbaff908a0318f174bf6f3400138ac4927aef2fd (patch)
tree7721c1e1b44c86d56ff51fb211abb20ac02c6ae4
parentaa4fb101f187d86e444f337624150b034f9b03eb (diff)
downloadgcc-dbaff908a0318f174bf6f3400138ac4927aef2fd.zip
gcc-dbaff908a0318f174bf6f3400138ac4927aef2fd.tar.gz
gcc-dbaff908a0318f174bf6f3400138ac4927aef2fd.tar.bz2
cse.c (cse_insn): Avoid RTL sharing when updating the RETVAL insn's notes following a...
* cse.c (cse_insn): Avoid RTL sharing when updating the RETVAL insn's notes following a substitution inside a libcall. From-SVN: r61524
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cse.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9f4a2d6..c0ed2d3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-20 Roger Sayle <roger@eyesopen.com>
+
+ * cse.c (cse_insn): Avoid RTL sharing when updating the RETVAL
+ insn's notes following a substitution inside a libcall.
+
2003-01-20 Zack Weinberg <zack@codesourcery.com>
* configure.in: Check for system-provided 'uchar' type.
diff --git a/gcc/cse.c b/gcc/cse.c
index c9ba3c0..1a4ca2e 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -5557,6 +5557,8 @@ cse_insn (insn, libcall_insn)
/* Look for a substitution that makes a valid insn. */
else if (validate_change (insn, &SET_SRC (sets[i].rtl), trial, 0))
{
+ rtx new = canon_reg (SET_SRC (sets[i].rtl), insn);
+
/* If we just made a substitution inside a libcall, then we
need to make the same substitution in any notes attached
to the RETVAL insn. */
@@ -5565,14 +5567,12 @@ cse_insn (insn, libcall_insn)
|| GET_CODE (sets[i].orig_src) == SUBREG
|| GET_CODE (sets[i].orig_src) == MEM))
replace_rtx (REG_NOTES (libcall_insn), sets[i].orig_src,
- canon_reg (SET_SRC (sets[i].rtl), insn));
+ copy_rtx (new));
/* The result of apply_change_group can be ignored; see
canon_reg. */
- validate_change (insn, &SET_SRC (sets[i].rtl),
- canon_reg (SET_SRC (sets[i].rtl), insn),
- 1);
+ validate_change (insn, &SET_SRC (sets[i].rtl), new, 1);
apply_change_group ();
break;
}