OSDN Git Service

gcc:
[pf3gnuchains/gcc-fork.git] / gcc / ra-colorize.c
index eecea50..121cd1b 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "config.h"
 #include "system.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "rtl.h"
 #include "tm_p.h"
 #include "function.h"
@@ -336,7 +338,7 @@ build_worklists (df)
      backed by a new pseudo, but conceptually can stand for a stackslot,
      i.e. it doesn't really matter if they get a color or not), on
      the SELECT stack first, those with lowest cost first.  This way
-     they will be colored last, so do not contrain the coloring of the
+     they will be colored last, so do not constrain the coloring of the
      normal webs.  But still those with the highest count are colored
      before, i.e. get a color more probable.  The use of stackregs is
      a pure optimization, and all would work, if we used real stackslots
@@ -532,13 +534,14 @@ merge_moves (u, v)
      struct web *u, *v;
 {
   regset seen;
-  struct move_list *ml;
+  struct move_list *ml, *ml_next;
 
   seen = BITMAP_XMALLOC ();
   for (ml = u->moves; ml; ml = ml->next)
     bitmap_set_bit (seen, INSN_UID (ml->move->insn));
-  for (ml = v->moves; ml; ml = ml->next)
+  for (ml = v->moves; ml; ml = ml_next)
     {
+      ml_next = ml->next;
       if (! bitmap_bit_p (seen, INSN_UID (ml->move->insn)))
         {
          ml->next = u->moves;
@@ -1285,7 +1288,6 @@ colorize_one_web (web, hard)
   int c = -1;
   int bestc = -1;
   int neighbor_needs= 0;
-  struct web *fat_neighbor = NULL;
   struct web *fats_parent = NULL;
   int num_fat = 0;
   int long_blocks = 0;
@@ -1293,6 +1295,8 @@ colorize_one_web (web, hard)
   HARD_REG_SET fat_colors;
   HARD_REG_SET bias;
 
+  CLEAR_HARD_REG_SET (fat_colors);
+  
   if (web->regno >= max_normal_pseudo)
     hard = 0;
 
@@ -1318,7 +1322,6 @@ colorize_one_web (web, hard)
                && w->add_hardregs >= neighbor_needs)
              {
                neighbor_needs = w->add_hardregs;
-               fat_neighbor = w;
                fats_parent = ptarget;
                num_fat++;
              }
@@ -1347,7 +1350,7 @@ colorize_one_web (web, hard)
       HARD_REG_SET call_clobbered;
 
       /* Here we choose a hard-reg for the current web.  For non spill
-         temporaries we first search in the hardregs for it's prefered
+         temporaries we first search in the hardregs for it's preferred
         class, then, if we found nothing appropriate, in those of the
         alternate class.  For spill temporaries we only search in
         usable_regs of this web (which is probably larger than that of
@@ -1367,10 +1370,9 @@ colorize_one_web (web, hard)
       else
        COPY_HARD_REG_SET (colors,
                           usable_regs[reg_preferred_class (web->regno)]);
-#ifdef CLASS_CANNOT_CHANGE_MODE
+#ifdef CANNOT_CHANGE_MODE_CLASS
       if (web->mode_changed)
-        AND_COMPL_HARD_REG_SET (colors, reg_class_contents[
-                                 (int) CLASS_CANNOT_CHANGE_MODE]);
+        AND_COMPL_HARD_REG_SET (colors, invalid_mode_change_regs);
 #endif
       COPY_HARD_REG_SET (call_clobbered, colors);
       AND_HARD_REG_SET (call_clobbered, call_used_reg_set);
@@ -1401,10 +1403,9 @@ colorize_one_web (web, hard)
          else
            IOR_HARD_REG_SET (colors, usable_regs
                              [reg_alternate_class (web->regno)]);
-#ifdef CLASS_CANNOT_CHANGE_MODE
+#ifdef CANNOT_CHANGE_MODE_CLASS
          if (web->mode_changed)
-           AND_COMPL_HARD_REG_SET (colors, reg_class_contents[
-                                     (int) CLASS_CANNOT_CHANGE_MODE]);
+           AND_COMPL_HARD_REG_SET (colors, invalid_mode_change_regs);
 #endif
          COPY_HARD_REG_SET (call_clobbered, colors);
          AND_HARD_REG_SET (call_clobbered, call_used_reg_set);
@@ -1509,7 +1510,7 @@ colorize_one_web (web, hard)
              struct web *aw = alias (w);
              /* If we are a spill-temp, we also look at webs coalesced
                 to precolored ones.  Otherwise we only look at webs which
-                themself were colored, or coalesced to one.  */
+                themselves were colored, or coalesced to one.  */
              if (aw->type == PRECOLORED && w != aw && web->spill_temp
                  && flag_ra_optimistic_coalescing)
                {
@@ -1558,7 +1559,7 @@ colorize_one_web (web, hard)
                    set_cand (6, aw);
                  /* For boehm-gc/misc.c.  If we are a difficult spilltemp,
                     also coalesced neighbors are a chance, _even_ if they
-                    too are spilltemps.  At least their coalscing can be
+                    too are spilltemps.  At least their coalescing can be
                     broken up, which may be reset usable_regs, and makes
                     it easier colorable.  */
                  if (web->spill_temp != 2 && aw->is_coalesced
@@ -1669,9 +1670,7 @@ assign_colors ()
 
   while (WEBS(SELECT))
     {
-      struct web *web;
       d = pop_list (&WEBS(SELECT));
-      web = DLIST_WEB (d);
       colorize_one_web (DLIST_WEB (d), 1);
     }
 
@@ -1749,7 +1748,7 @@ try_recolor_web (web)
        }
       /* Mark colors for which some wide webs are involved.  For
         those the independent sets are not simply one-node graphs, so
-        they can't be recolored independ from their neighborhood.  This
+        they can't be recolored independent from their neighborhood.  This
         means, that our cost calculation can be incorrect (assuming it
         can avoid spilling a web because it thinks some colors are available,
         although it's neighbors which itself need recoloring might take
@@ -2027,7 +2026,7 @@ check_colors ()
        if (!TEST_HARD_REG_BIT (web->usable_regs, aweb->color + c))
          abort ();
       /* Search the original (pre-coalesce) conflict list.  In the current
-        one some inprecise conflicts may be noted (due to combine() or
+        one some imprecise conflicts may be noted (due to combine() or
         insert_coalesced_conflicts() relocating partial conflicts) making
         it look like some wide webs are in conflict and having the same
         color.  */
@@ -2723,7 +2722,7 @@ ra_colorize_free_all ()
     put_web (DLIST_WEB (d), INITIAL);
   while ((d = pop_list (&WEBS(INITIAL))) != NULL)
     {
-      struct web *web =DLIST_WEB (d);
+      struct web *web = DLIST_WEB (d);
       struct web *wnext;
       web->orig_conflict_list = NULL;
       web->conflict_list = NULL;