sh.c (addsubcosts): CONST is not cheap.
authorJ"orn Rennecke <amylaar@redhat.co.uk>
Mon, 18 Sep 2000 19:31:28 +0000 (19:31 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Mon, 18 Sep 2000 19:31:28 +0000 (20:31 +0100)
* sh.c (addsubcosts): CONST is not cheap.
(find_barrier): For Sh1, take alignment after jumps into account.

From-SVN: r36512

gcc/ChangeLog
gcc/config/sh/sh.c

index 4e99ee9..00b1f24 100644 (file)
@@ -1,3 +1,8 @@
+Mon Sep 18 20:26:50 2000  J"orn Rennecke <amylaar@redhat.co.uk>
+
+       * sh.c (addsubcosts): CONST is not cheap.
+       (find_barrier): For Sh1, take alignment after jumps into account.
+
 2000-09-15  Andrew Haley  <aph@redhat.com>
 
        * toplev.c (rest_of_compilation): Call purge_hard_subreg_sets to
index afc0dca..a945666 100644 (file)
@@ -1020,7 +1020,8 @@ addsubcosts (x)
      rtx x;
 {
   /* Adding a register is a single cycle insn.  */
-  if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+  if (GET_CODE (XEXP (x, 1)) == REG
+      || GET_CODE (XEXP (x, 1)) == SUBREG)
     return 1;
 
   /* Likewise for small constants.  */
@@ -2247,26 +2248,31 @@ find_barrier (num_mova, mova, from)
              inc = XVECLEN (body, 1) * GET_MODE_SIZE (GET_MODE (body));
            }
        }
+      /* For the SH1, we generate alignments even after jumps-around-jumps.  */
+      else if (GET_CODE (from) == JUMP_INSN
+              && ! TARGET_SH2
+              && ! TARGET_SMALLCODE)
+       new_align = 4;
 
       if (found_si)
        {
+         count_si += inc;
          if (new_align > si_align)
            {
              si_limit -= (count_si - 1) & (new_align - si_align);
              si_align = new_align;
            }
          count_si = (count_si + new_align - 1) & -new_align;
-         count_si += inc;
        }
       if (found_hi)
        {
+         count_hi += inc;
          if (new_align > hi_align)
            {
              hi_limit -= (count_hi - 1) & (new_align - hi_align);
              hi_align = new_align;
            }
          count_hi = (count_hi + new_align - 1) & -new_align;
-         count_hi += inc;
        }
       from = NEXT_INSN (from);
     }