aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-03-20 06:50:18 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-03-20 06:50:18 -0500
commit11147ebea5ed7ad858ed0e403e0cd47525eb8177 (patch)
treef9eb63eb1a68355b330b56647ffd88b098e61920
parente048778fca6e205cf73e02a3a4d2d8df0f54a614 (diff)
downloadgcc-11147ebea5ed7ad858ed0e403e0cd47525eb8177.zip
gcc-11147ebea5ed7ad858ed0e403e0cd47525eb8177.tar.gz
gcc-11147ebea5ed7ad858ed0e403e0cd47525eb8177.tar.bz2
(try_split): Rename third parameter as LAST.
(try_split): Rename third parameter as LAST. Recursively call try_split for each new insn created. From-SVN: r6832
-rw-r--r--gcc/emit-rtl.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 7b9187d..91d5714 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1965,16 +1965,16 @@ prev_cc0_setter (insn)
/* Try splitting insns that can be split for better scheduling.
PAT is the pattern which might split.
TRIAL is the insn providing PAT.
- BACKWARDS is non-zero if we are scanning insns from last to first.
+ LAST is non-zero if we should return the last insn of the sequence produced.
If this routine succeeds in splitting, it returns the first or last
- replacement insn depending on the value of BACKWARDS. Otherwise, it
+ replacement insn depending on the value of LAST. Otherwise, it
returns TRIAL. If the insn to be returned can be split, it will be. */
rtx
-try_split (pat, trial, backwards)
+try_split (pat, trial, last)
rtx pat, trial;
- int backwards;
+ int last;
{
rtx before = PREV_INSN (trial);
rtx after = NEXT_INSN (trial);
@@ -2017,6 +2017,14 @@ try_split (pat, trial, backwards)
delete_insn (trial);
if (has_barrier)
emit_barrier_after (tem);
+
+ /* Recursively call try_split for each new insn created; by the
+ time control returns here that insn will be fully split, so
+ set LAST and continue from the insn after the one returned.
+ We can't use next_active_insn here since AFTER may be a note. */
+ for (tem = NEXT_INSN (before); tem != after;
+ tem = NEXT_INSN (tem))
+ tem = try_split (PATTERN (tem), tem, 1);
}
/* Avoid infinite loop if the result matches the original pattern. */
else if (rtx_equal_p (seq, pat))
@@ -2025,11 +2033,12 @@ try_split (pat, trial, backwards)
{
PATTERN (trial) = seq;
INSN_CODE (trial) = -1;
+ try_split (seq, trial, last);
}
- /* Set TEM to the insn we should return. */
- tem = backwards ? prev_active_insn (after) : next_active_insn (before);
- return try_split (PATTERN (tem), tem, backwards);
+ /* Return either the first or the last insn, depending on which was
+ requested. */
+ return last ? prev_active_insn (after) : next_active_insn (before);
}
return trial;