aboutsummaryrefslogtreecommitdiff
path: root/gcc/jump.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1999-11-02 07:22:47 +0000
committerJeff Law <law@gcc.gnu.org>1999-11-02 00:22:47 -0700
commita5a06a788d52cfc83553ad958da3af4c3e195f0d (patch)
tree5eb217c3af7375b25d382b4824a74159c1092318 /gcc/jump.c
parentd269eb53b15547297d21c9499744084a1c042b06 (diff)
downloadgcc-a5a06a788d52cfc83553ad958da3af4c3e195f0d.zip
gcc-a5a06a788d52cfc83553ad958da3af4c3e195f0d.tar.gz
gcc-a5a06a788d52cfc83553ad958da3af4c3e195f0d.tar.bz2
jump.c (jump_optimize_1): Also move LOOP_VTOP and LOOP_CONT notes when presented with "if (foo) break...
* jump.c (jump_optimize_1): Also move LOOP_VTOP and LOOP_CONT notes when presented with "if (foo) break; end_of_loop" and the break sequence gets moved out of the loop. From-SVN: r30338
Diffstat (limited to 'gcc/jump.c')
-rw-r--r--gcc/jump.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 1867de1..2315689 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -2084,23 +2084,25 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
NEXT_INSN (range1end) = range2after;
PREV_INSN (range2after) = range1end;
- /* Check for a loop end note between the end of
+ /* Check for loop notes between the end of
range2, and the next code label. If there is one,
then what we have really seen is
if (foo) break; end_of_loop;
and moved the break sequence outside the loop.
- We must move the LOOP_END note to where the
- loop really ends now, or we will confuse loop
- optimization. Stop if we find a LOOP_BEG note
- first, since we don't want to move the LOOP_END
- note in that case. */
+ We must move LOOP_END, LOOP_VTOP and LOOP_CONT
+ notes (in order) to where the loop really ends now,
+ or we will confuse loop optimization. Stop if we
+ find a LOOP_BEG note first, since we don't want to
+ move the notes in that case. */
for (;range2after != label2; range2after = rangenext)
{
rangenext = NEXT_INSN (range2after);
if (GET_CODE (range2after) == NOTE)
{
- if (NOTE_LINE_NUMBER (range2after)
- == NOTE_INSN_LOOP_END)
+ int kind = NOTE_LINE_NUMBER (range2after);
+ if (kind == NOTE_INSN_LOOP_END
+ || kind == NOTE_INSN_LOOP_VTOP
+ || kind == NOTE_INSN_LOOP_CONT)
{
NEXT_INSN (PREV_INSN (range2after))
= rangenext;