OSDN Git Service

* regclass.c (init_reg_sets): Move init of move cost tables...
authorraeburn <raeburn@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 26 Feb 1998 13:45:45 +0000 (13:45 +0000)
committerraeburn <raeburn@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 26 Feb 1998 13:45:45 +0000 (13:45 +0000)
(init_reg_sets_1): ...to here.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18273 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/regclass.c

index a8f9195..ccd60ef 100644 (file)
@@ -1,3 +1,8 @@
+1998-02-26  Ken Raeburn  <raeburn@cygnus.com>
+
+       * regclass.c (init_reg_sets): Move init of move cost tables...
+       (init_reg_sets_1): ...to here.
+
 Thu Feb 26 00:13:21 1998  Ian Lance Taylor  <ian@cygnus.com>
 
        * choose-temp.c: Fix handling of sys/file.h to work in libiberty.
index 1f369a7..d43940d 100644 (file)
@@ -318,38 +318,6 @@ init_reg_sets ()
        }
     }
 
-  /* Initialize the move cost table.  Find every subset of each class
-     and take the maximum cost of moving any subset to any other.  */
-
-  for (i = 0; i < N_REG_CLASSES; i++)
-    for (j = 0; j < N_REG_CLASSES; j++)
-      {
-       int cost = i == j ? 2 : REGISTER_MOVE_COST (i, j);
-       enum reg_class *p1, *p2;
-
-       for (p2 = &reg_class_subclasses[j][0]; *p2 != LIM_REG_CLASSES; p2++)
-         if (*p2 != i)
-           cost = MAX (cost, REGISTER_MOVE_COST (i, *p2));
-
-       for (p1 = &reg_class_subclasses[i][0]; *p1 != LIM_REG_CLASSES; p1++)
-         {
-           if (*p1 != j)
-             cost = MAX (cost, REGISTER_MOVE_COST (*p1, j));
-
-           for (p2 = &reg_class_subclasses[j][0];
-                *p2 != LIM_REG_CLASSES; p2++)
-             if (*p1 != *p2)
-               cost = MAX (cost, REGISTER_MOVE_COST (*p1, *p2));
-         }
-
-       move_cost[i][j] = cost;
-
-       if (reg_class_subset_p (i, j))
-         cost = 0;
-
-       may_move_cost[i][j] = cost;
-      }
-
   /* Do any additional initialization regsets may need */
   INIT_ONCE_REG_SET ();
 }
@@ -360,7 +328,7 @@ init_reg_sets ()
 static void
 init_reg_sets_1 ()
 {
-  register int i;
+  register int i, j;
 
   /* This macro allows the fixed or call-used registers
      to depend on target flags.  */
@@ -393,6 +361,38 @@ init_reg_sets_1 ()
       if (CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (i)))
        SET_HARD_REG_BIT (losing_caller_save_reg_set, i);
     }
+
+  /* Initialize the move cost table.  Find every subset of each class
+     and take the maximum cost of moving any subset to any other.  */
+
+  for (i = 0; i < N_REG_CLASSES; i++)
+    for (j = 0; j < N_REG_CLASSES; j++)
+      {
+       int cost = i == j ? 2 : REGISTER_MOVE_COST (i, j);
+       enum reg_class *p1, *p2;
+
+       for (p2 = &reg_class_subclasses[j][0]; *p2 != LIM_REG_CLASSES; p2++)
+         if (*p2 != i)
+           cost = MAX (cost, REGISTER_MOVE_COST (i, *p2));
+
+       for (p1 = &reg_class_subclasses[i][0]; *p1 != LIM_REG_CLASSES; p1++)
+         {
+           if (*p1 != j)
+             cost = MAX (cost, REGISTER_MOVE_COST (*p1, j));
+
+           for (p2 = &reg_class_subclasses[j][0];
+                *p2 != LIM_REG_CLASSES; p2++)
+             if (*p1 != *p2)
+               cost = MAX (cost, REGISTER_MOVE_COST (*p1, *p2));
+         }
+
+       move_cost[i][j] = cost;
+
+       if (reg_class_subset_p (i, j))
+         cost = 0;
+
+       may_move_cost[i][j] = cost;
+      }
 }
 
 /* Compute the table of register modes.