From: J"orn Rennecke Date: Mon, 22 Mar 1999 13:55:22 +0000 (+0000) Subject: * cse.c (cse_insn): Don't change the result register of a libcall. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=50270076bd7e9aaca337ab7dd944268082b25b42;p=gcc.git * cse.c (cse_insn): Don't change the result register of a libcall. From-SVN: r25898 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b44745a3414..00bc658356d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Mon Mar 22 21:51:57 1999 J"orn Rennecke + + * cse.c (cse_insn): Don't change the result register of a libcall. + Mon Mar 22 21:08:59 1999 J"orn Rennecke * rtl.h (shallow_copy_rtx): Declare. diff --git a/gcc/cse.c b/gcc/cse.c index bc22df9e2c8..e632d4bd174 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)