]> gcc.gnu.org Git - gcc.git/commitdiff
(ADJUST_INSN_LENGTH): don't break from loop when only a LOOP_BEG is found.
authorJoern Rennecke <amylaar@gcc.gnu.org>
Tue, 10 Dec 1996 18:47:02 +0000 (18:47 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Tue, 10 Dec 1996 18:47:02 +0000 (18:47 +0000)
Calculate padding in new variable pad.

From-SVN: r13261

gcc/config/sh/sh.h

index 217ce5ad9392457b3f1f0d139ec245e7e7d0f9a8..8408bc64597f48cf3fd1a6fce05c316ffd1d3181 100644 (file)
@@ -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.  */
This page took 0.070785 seconds and 5 git commands to generate.