summaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-24 20:20:52 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-24 20:20:52 +0000
commite4341699e7d8de2658d81a8ac1af02510d47f5c3 (patch)
treeb52454698fe2836ed4844210c201bdc8945cfaac /gcc/flow.c
parent0c63e844d26dc1c3d060e2c3d10df627323f7311 (diff)
downloadgcc-e4341699e7d8de2658d81a8ac1af02510d47f5c3.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54966 138bc75d-0d04-0410-961f-82ee72b054a4
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 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);
}