Commit a5a06a78 by Jeffrey A Law Committed by Jeff Law

jump.c (jump_optimize_1): Also move LOOP_VTOP and LOOP_CONT notes when presented…

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
parent d269eb53
Mon Nov 1 23:37:38 1999 Jeffrey A Law (law@cygnus.com) Mon Nov 1 23:37:38 1999 Jeffrey A Law (law@cygnus.com)
* 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.
* unroll.c (unroll_loop): Allocate memory for MAP using xcalloc. * unroll.c (unroll_loop): Allocate memory for MAP using xcalloc.
Remove explicit zero initializations of entries within MAP. Remove explicit zero initializations of entries within MAP.
......
...@@ -2084,23 +2084,25 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only) ...@@ -2084,23 +2084,25 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
NEXT_INSN (range1end) = range2after; NEXT_INSN (range1end) = range2after;
PREV_INSN (range2after) = range1end; 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, range2, and the next code label. If there is one,
then what we have really seen is then what we have really seen is
if (foo) break; end_of_loop; if (foo) break; end_of_loop;
and moved the break sequence outside the loop. and moved the break sequence outside the loop.
We must move the LOOP_END note to where the We must move LOOP_END, LOOP_VTOP and LOOP_CONT
loop really ends now, or we will confuse loop notes (in order) to where the loop really ends now,
optimization. Stop if we find a LOOP_BEG note or we will confuse loop optimization. Stop if we
first, since we don't want to move the LOOP_END find a LOOP_BEG note first, since we don't want to
note in that case. */ move the notes in that case. */
for (;range2after != label2; range2after = rangenext) for (;range2after != label2; range2after = rangenext)
{ {
rangenext = NEXT_INSN (range2after); rangenext = NEXT_INSN (range2after);
if (GET_CODE (range2after) == NOTE) if (GET_CODE (range2after) == NOTE)
{ {
if (NOTE_LINE_NUMBER (range2after) int kind = NOTE_LINE_NUMBER (range2after);
== NOTE_INSN_LOOP_END) if (kind == NOTE_INSN_LOOP_END
|| kind == NOTE_INSN_LOOP_VTOP
|| kind == NOTE_INSN_LOOP_CONT)
{ {
NEXT_INSN (PREV_INSN (range2after)) NEXT_INSN (PREV_INSN (range2after))
= rangenext; = rangenext;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment