diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c7bd7c78949..45a686c03c7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-06-24 Jeff Law + + * flow.c (propagate_one_insn): When removing an insn + with a REG_LIBCALL note but not the entire libcall sequence, + delete the associated REG_RETVAL note. + Mon Jun 24 21:05:09 2002 J"orn Rennecke * lib1funcs.asm (sdivsi3): Add optimized SH64 implementations. diff --git a/gcc/flow.c b/gcc/flow.c index 48016cef781..aad646af0f6 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -1650,22 +1650,38 @@ propagate_one_insn (pbi, insn) else { + /* If INSN contains a RETVAL note and is dead, but the libcall + as a whole is not dead, then we want to remove INSN, but + not the whole libcall sequence. + + However, we need to also remove the dangling REG_LIBCALL + note so that we do not have mis-matched LIBCALL/RETVAL + notes. In theory we could find a new location for the + REG_RETVAL note, but it hardly seems worth the effort. + + NOTE at this point will be the RETVAL note if it exists. */ if (note) { - /* If INSN contains a RETVAL note and is dead, but the libcall - as a whole is not dead, then we want to remove INSN, but - not the whole libcall sequence. - - However, we need to also remove the dangling REG_LIBCALL - note so that we do not have mis-matched LIBCALL/RETVAL - notes. In theory we could find a new location for the - REG_RETVAL note, but it hardly seems worth the effort. */ rtx libcall_note; libcall_note = find_reg_note (XEXP (note, 0), REG_LIBCALL, NULL_RTX); remove_note (XEXP (note, 0), libcall_note); } + + /* Similarly if INSN contains a LIBCALL note, remove the + dnagling REG_RETVAL note. */ + note = find_reg_note (insn, REG_LIBCALL, NULL_RTX); + if (note) + { + rtx retval_note; + + retval_note + = find_reg_note (XEXP (note, 0), REG_RETVAL, NULL_RTX); + remove_note (XEXP (note, 0), retval_note); + } + + /* Now delete INSN. */ propagate_block_delete_insn (insn); }