aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-04-21 18:45:00 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-04-21 18:45:00 +0000
commite8c8470b1cfdb6d9abebf7e976317abeb8956c40 (patch)
treea75bbca9f3fbc9da9d02fb12d35775b6d16bb725 /gcc/loop.c
parent51f26c450beaa99fc55f62cfb365fb3d7ce07080 (diff)
downloadgcc-e8c8470b1cfdb6d9abebf7e976317abeb8956c40.zip
gcc-e8c8470b1cfdb6d9abebf7e976317abeb8956c40.tar.gz
gcc-e8c8470b1cfdb6d9abebf7e976317abeb8956c40.tar.bz2
flow.c (proagate_one_insn): Remove useless assignment.
* flow.c (proagate_one_insn): Remove useless assignment. * jump.c (delete_insn): Tidy. * loop.c (try_copy_prop): When deleting an instruction with a REG_RETVAL note, delete the entire libcall sequence. (loop_delete_insns): New function. * unroll.c (initial_reg_note_copy): Copy INSN_LIST notes, even if we're not substituting into them yet. From-SVN: r41486
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c45
1 files changed, 40 insertions, 5 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 3e340af..965f6ef 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -9240,17 +9240,52 @@ try_copy_prop (loop, replacement, regno)
fprintf (loop_dump_stream, " Replaced reg %d", regno);
if (store_is_first && replaced_last)
{
- PUT_CODE (init_insn, NOTE);
- NOTE_LINE_NUMBER (init_insn) = NOTE_INSN_DELETED;
- if (loop_dump_stream)
- fprintf (loop_dump_stream, ", deleting init_insn (%d)",
- INSN_UID (init_insn));
+ rtx first;
+ rtx retval_note;
+
+ /* Assume we're just deleting INIT_INSN. */
+ first = init_insn;
+ /* Look for REG_RETVAL note. If we're deleting the end of
+ the libcall sequence, the whole sequence can go. */
+ retval_note = find_reg_note (init_insn, REG_RETVAL, NULL_RTX);
+ /* If we found a REG_RETVAL note, find the first instruction
+ in the sequence. */
+ if (retval_note)
+ first = XEXP (retval_note, 0);
+
+ /* Delete the instructions. */
+ loop_delete_insns (first, init_insn);
}
if (loop_dump_stream)
fprintf (loop_dump_stream, ".\n");
}
}
+/* Replace all the instructions from FIRST up to and including LAST
+ with NOTE_INSN_DELETED notes. */
+
+static void
+loop_delete_insns (first, last)
+ rtx first;
+ rtx last;
+{
+ while (1)
+ {
+ PUT_CODE (first, NOTE);
+ NOTE_LINE_NUMBER (first) = NOTE_INSN_DELETED;
+ if (loop_dump_stream)
+ fprintf (loop_dump_stream, ", deleting init_insn (%d)",
+ INSN_UID (first));
+
+ /* If this was the LAST instructions we're supposed to delete,
+ we're done. */
+ if (first == last)
+ break;
+
+ first = NEXT_INSN (first);
+ }
+}
+
/* Try to replace occurrences of pseudo REGNO with REPLACEMENT within
loop LOOP if the order of the sets of these registers can be
swapped. There must be exactly one insn within the loop that sets