From 8e90e2734ed1211709aa2aaf828b7bad1a91eaaf Mon Sep 17 00:00:00 2001 From: Joern Rennecke Date: Tue, 10 Dec 1996 18:47:02 +0000 Subject: [PATCH] (ADJUST_INSN_LENGTH): don't break from loop when only a LOOP_BEG is found. Calculate padding in new variable pad. From-SVN: r13261 --- gcc/config/sh/sh.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index 217ce5ad939..8408bc64597 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. */ -- 2.30.2