OSDN Git Service

* config/sh/sh.h (BRANCH_COST): Use sh_branch_cost variable.
[pf3gnuchains/gcc-fork.git] / gcc / config / sh / sh.c
index 1b289ad..744c49a 100644 (file)
@@ -724,8 +724,15 @@ sh_option_override (void)
   else
     sh_divsi3_libfunc = "__sdivsi3";
   if (sh_branch_cost == -1)
-    sh_branch_cost
-      = TARGET_SH5 ? 1 : ! TARGET_SH2 || TARGET_HARD_SH4 ? 2 : 1;
+    {
+      sh_branch_cost = 1;
+
+      /*  The SH1 does not have delay slots, hence we get a pipeline stall
+         at every branch.  The SH4 is superscalar, so the single delay slot
+         is not sufficient to keep both pipelines filled.  */
+      if (! TARGET_SH2 || TARGET_HARD_SH4)
+       sh_branch_cost = 2;
+    }
 
   for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
     if (! VALID_REGISTER_P (regno))