flow.c (propagate_one_insn): When removing an insn with a REG_LIBCALL note but not the entire libcall...

* 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.

From-SVN: r54966
This commit is contained in:
Jeff Law 2002-06-24 14:20:52 -06:00 committed by Jeff Law
parent 9e96203da4
commit b0ac73f8be
2 changed files with 30 additions and 8 deletions

View file

@ -1,3 +1,9 @@
2002-06-24 Jeff Law <law@redhat.com>
* 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 <joern.rennecke@superh.com>
* lib1funcs.asm (sdivsi3): Add optimized SH64 implementations.

View file

@ -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);
}