aboutsummaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2002-06-24 14:20:52 -0600
committerJeff Law <law@gcc.gnu.org>2002-06-24 14:20:52 -0600
commitb0ac73f8bee1674aa6ceae9897e5e644fdf07d74 (patch)
treeb52454698fe2836ed4844210c201bdc8945cfaac /gcc/flow.c
parent9e96203da46840cd22092cc60d23bab2eeee9ff5 (diff)
downloadgcc-b0ac73f8bee1674aa6ceae9897e5e644fdf07d74.zip
gcc-b0ac73f8bee1674aa6ceae9897e5e644fdf07d74.tar.gz
gcc-b0ac73f8bee1674aa6ceae9897e5e644fdf07d74.tar.bz2
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
Diffstat (limited to 'gcc/flow.c')
-rw-r--r--gcc/flow.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index 48016ce..aad646a 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);
}