diff options
author | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-02-07 00:29:31 +0000 |
---|---|---|
committer | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-02-07 00:29:31 +0000 |
commit | 64abc69984d95fe24e3aa395af40a50c90c14547 (patch) | |
tree | 252290a972873b5e3f00f1a607d1a01b5de9c135 /gcc/jump.c | |
parent | 56351df3b4aae67d9cb88129b767f2dfec07fa60 (diff) | |
download | gcc-64abc69984d95fe24e3aa395af40a50c90c14547.tar.gz |
(jump_optimize): When searching for a LOOP_END note to move,
stop if we find a LOOP_BEG note first.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8885 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/gcc/jump.c b/gcc/jump.c index 9cabf4145b7..ff267298948 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -1878,24 +1878,31 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan) 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. */ + 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) { rangenext = NEXT_INSN (range2after); - if (GET_CODE (range2after) == NOTE - && (NOTE_LINE_NUMBER (range2after) - == NOTE_INSN_LOOP_END)) + if (GET_CODE (range2after) == NOTE) { - NEXT_INSN (PREV_INSN (range2after)) - = rangenext; - PREV_INSN (rangenext) - = PREV_INSN (range2after); - PREV_INSN (range2after) - = PREV_INSN (range1beg); - NEXT_INSN (range2after) = range1beg; - NEXT_INSN (PREV_INSN (range1beg)) - = range2after; - PREV_INSN (range1beg) = range2after; + if (NOTE_LINE_NUMBER (range2after) + == NOTE_INSN_LOOP_END) + { + NEXT_INSN (PREV_INSN (range2after)) + = rangenext; + PREV_INSN (rangenext) + = PREV_INSN (range2after); + PREV_INSN (range2after) + = PREV_INSN (range1beg); + 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; |