(jump_optimize): When searching for a LOOP_END note to move,
stop if we find a LOOP_BEG note first. From-SVN: r8885
This commit is contained in:
parent
4f2d367490
commit
ca188f1679
35
gcc/jump.c
35
gcc/jump.c
@ -1878,24 +1878,31 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
|
|||||||
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 the LOOP_END note to where the
|
||||||
loop really ends now, or we will confuse loop
|
loop really ends now, or we will confuse loop
|
||||||
optimization. */
|
optimization. Stop if we find a LOOP_BEG note
|
||||||
|
first, since we don't want to move the LOOP_END
|
||||||
|
note 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)
|
||||||
&& (NOTE_LINE_NUMBER (range2after)
|
|
||||||
== NOTE_INSN_LOOP_END))
|
|
||||||
{
|
{
|
||||||
NEXT_INSN (PREV_INSN (range2after))
|
if (NOTE_LINE_NUMBER (range2after)
|
||||||
= rangenext;
|
== NOTE_INSN_LOOP_END)
|
||||||
PREV_INSN (rangenext)
|
{
|
||||||
= PREV_INSN (range2after);
|
NEXT_INSN (PREV_INSN (range2after))
|
||||||
PREV_INSN (range2after)
|
= rangenext;
|
||||||
= PREV_INSN (range1beg);
|
PREV_INSN (rangenext)
|
||||||
NEXT_INSN (range2after) = range1beg;
|
= PREV_INSN (range2after);
|
||||||
NEXT_INSN (PREV_INSN (range1beg))
|
PREV_INSN (range2after)
|
||||||
= range2after;
|
= PREV_INSN (range1beg);
|
||||||
PREV_INSN (range1beg) = range2after;
|
NEXT_INSN (range2after) = range1beg;
|
||||||
|
NEXT_INSN (PREV_INSN (range1beg))
|
||||||
|
= range2after;
|
||||||
|
PREV_INSN (range1beg) = range2after;
|
||||||
|
}
|
||||||
|
else if (NOTE_LINE_NUMBER (range2after)
|
||||||
|
== NOTE_INSN_LOOP_BEG)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
changed = 1;
|
changed = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user