Commit 8e90e273 by Joern Rennecke

(ADJUST_INSN_LENGTH): don't break from loop when only a LOOP_BEG is found.

Calculate padding in new variable pad.

From-SVN: r13261
parent cc3af271
...@@ -1650,27 +1650,34 @@ extern int pragma_interrupt; ...@@ -1650,27 +1650,34 @@ extern int pragma_interrupt;
LENGTH += 2; \ LENGTH += 2; \
if (! TARGET_SMALLCODE) \ if (! TARGET_SMALLCODE) \
{ \ { \
/* After the folowing loop, PAD will be an upper bound \
for the number of padding bytes the alignment will \
require. */ \
rtx aip; \ rtx aip; \
int pad = 0; \
for (aip = PREV_INSN (X); aip; aip = PREV_INSN (aip)) \ for (aip = PREV_INSN (X); aip; aip = PREV_INSN (aip)) \
{ \ { \
if (GET_CODE (aip) == BARRIER) \ if (GET_CODE (aip) == BARRIER) \
{ \ { \
if (TARGET_SH3 || TARGET_SH3E) \ if (TARGET_SH3 || TARGET_SH3E) \
LENGTH += 14; \ pad = 14; \
else \ else \
LENGTH += 2; \ pad = 2; \
break; \ break; \
} \ } \
else if ((GET_CODE (aip) == NOTE \ else if ((GET_CODE (aip) == NOTE \
&& NOTE_LINE_NUMBER (aip) == NOTE_INSN_LOOP_BEG)) \ && NOTE_LINE_NUMBER (aip) == NOTE_INSN_LOOP_BEG)) \
{ \ { \
LENGTH += 2; \ pad = 2; \
break; \ /* Don't break here, because there might be a \
preceding BARRIER, which requires mores \
alignment for SH3[E] . */ \
} \ } \
else if (GET_CODE (aip) != NOTE \ else if (GET_CODE (aip) != NOTE \
&& GET_CODE (aip) != CODE_LABEL) \ && GET_CODE (aip) != CODE_LABEL) \
break; \ break; \
} \ } \
LENGTH += pad; \
} }
/* Enable a bug fix for the shorten_branches pass. */ /* Enable a bug fix for the shorten_branches pass. */
......
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