aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoern Rennecke <amylaar@gcc.gnu.org>1996-12-10 18:47:02 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>1996-12-10 18:47:02 +0000
commit8e90e2734ed1211709aa2aaf828b7bad1a91eaaf (patch)
tree761d620d0e8bb49c35fdee33187e8c08caf4a7af /gcc
parentcc3af271e681b358eed6e9fbbf5971a2fdd01a84 (diff)
downloadgcc-8e90e2734ed1211709aa2aaf828b7bad1a91eaaf.zip
gcc-8e90e2734ed1211709aa2aaf828b7bad1a91eaaf.tar.gz
gcc-8e90e2734ed1211709aa2aaf828b7bad1a91eaaf.tar.bz2
(ADJUST_INSN_LENGTH): don't break from loop when only a LOOP_BEG is found.
Calculate padding in new variable pad. From-SVN: r13261
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/sh/sh.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 217ce5a..8408bc6 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -1650,27 +1650,34 @@ extern int pragma_interrupt;
LENGTH += 2; \
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; \
+ int pad = 0; \
for (aip = PREV_INSN (X); aip; aip = PREV_INSN (aip)) \
{ \
if (GET_CODE (aip) == BARRIER) \
{ \
if (TARGET_SH3 || TARGET_SH3E) \
- LENGTH += 14; \
+ pad = 14; \
else \
- LENGTH += 2; \
+ pad = 2; \
break; \
} \
else if ((GET_CODE (aip) == NOTE \
&& NOTE_LINE_NUMBER (aip) == NOTE_INSN_LOOP_BEG)) \
{ \
- LENGTH += 2; \
- break; \
+ pad = 2; \
+ /* Don't break here, because there might be a \
+ preceding BARRIER, which requires mores \
+ alignment for SH3[E] . */ \
} \
else if (GET_CODE (aip) != NOTE \
&& GET_CODE (aip) != CODE_LABEL) \
break; \
} \
+ LENGTH += pad; \
}
/* Enable a bug fix for the shorten_branches pass. */