aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>1999-03-22 13:55:22 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>1999-03-22 13:55:22 +0000
commit50270076bd7e9aaca337ab7dd944268082b25b42 (patch)
tree045960825668bbe5af325ff84fcd9499618b32a4 /gcc/cse.c
parentce9d4c6d80126b0d4549e80ddd92bfab017d22f4 (diff)
downloadgcc-50270076bd7e9aaca337ab7dd944268082b25b42.zip
gcc-50270076bd7e9aaca337ab7dd944268082b25b42.tar.gz
gcc-50270076bd7e9aaca337ab7dd944268082b25b42.tar.bz2
* cse.c (cse_insn): Don't change the result register of a libcall.
From-SVN: r25898
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index bc22df9..e632d4b 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -7802,7 +7802,11 @@ cse_insn (insn, libcall_insn)
then be used in the sequel and we may be changing a two-operand insn
into a three-operand insn.
- Also do not do this if we are operating on a copy of INSN. */
+ Also do not do this if we are operating on a copy of INSN.
+
+ Also don't do this if INSN ends a libcall; this would cause an unrelated
+ register to be set in the middle of a libcall, and we then get bad code
+ if the libcall is deleted. */
if (n_sets == 1 && sets[0].rtl && GET_CODE (SET_DEST (sets[0].rtl)) == REG
&& NEXT_INSN (PREV_INSN (insn)) == insn
@@ -7810,7 +7814,8 @@ cse_insn (insn, libcall_insn)
&& REGNO (SET_SRC (sets[0].rtl)) >= FIRST_PSEUDO_REGISTER
&& REGNO_QTY_VALID_P (REGNO (SET_SRC (sets[0].rtl)))
&& (qty_first_reg[reg_qty[REGNO (SET_SRC (sets[0].rtl))]]
- == REGNO (SET_DEST (sets[0].rtl))))
+ == REGNO (SET_DEST (sets[0].rtl)))
+ && ! find_reg_note (insn, REG_RETVAL, NULL_RTX))
{
rtx prev = PREV_INSN (insn);
while (prev && GET_CODE (prev) == NOTE)