Commit edd6ede7 by J"orn Rennecke Committed by Joern Rennecke

final.c (shorten_branches): Don't add an alignment for loops that have no label inside.

	* final.c (shorten_branches): Don't add an alignment for loops
	that have no label inside.

From-SVN: r28517
parent 45fa5f9f
Wed Aug 4 20:45:04 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* final.c (shorten_branches): Don't add an alignment for loops
that have no label inside.
Wed Aug 4 16:39:24 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Wed Aug 4 16:39:24 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* builtins.c (expand_builtin_memcmp, expand_builtin_strcmp): Wrap * builtins.c (expand_builtin_memcmp, expand_builtin_strcmp): Wrap
......
...@@ -1113,9 +1113,22 @@ shorten_branches (first) ...@@ -1113,9 +1113,22 @@ shorten_branches (first)
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG) && NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
{ {
rtx label; rtx label;
int nest = 0;
/* Search for the label that starts the loop.
Don't skip past the end of the loop, since that could
lead to putting an alignment where it does not belong.
However, a label after a nested (non-)loop would be OK. */
for (label = insn; label; label = NEXT_INSN (label)) for (label = insn; label; label = NEXT_INSN (label))
if (GET_CODE (label) == CODE_LABEL) {
if (GET_CODE (label) == NOTE
&& NOTE_LINE_NUMBER (label) == NOTE_INSN_LOOP_BEG)
nest++;
else if (GET_CODE (label) == NOTE
&& NOTE_LINE_NUMBER (label) == NOTE_INSN_LOOP_END
&& --nest == 0)
break;
else if (GET_CODE (label) == CODE_LABEL)
{ {
log = LOOP_ALIGN (insn); log = LOOP_ALIGN (insn);
if (max_log < log) if (max_log < log)
...@@ -1126,6 +1139,7 @@ shorten_branches (first) ...@@ -1126,6 +1139,7 @@ shorten_branches (first)
break; break;
} }
} }
}
else else
continue; continue;
} }
......
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