]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/ra-rewrite.c
backport: basic-block.h: Include vec.h, errors.h.
[thirdparty/gcc.git] / gcc / ra-rewrite.c
index 23c26ba9c3f09a8f4364958a7b6109247fa55e8b..fa00e3706482d6bd4181b494c0f78ba4f9b8bf7b 100644 (file)
@@ -1350,13 +1350,17 @@ rewrite_program2 (bitmap new_deaths)
          int in_ir = 0;
          edge e;
          int num = 0;
+         edge_iterator ei;
          bitmap_iterator bi;
 
          HARD_REG_SET cum_colors, colors;
          CLEAR_HARD_REG_SET (cum_colors);
-         for (e = bb->pred; e && num < 5; e = e->pred_next, num++)
+         FOR_EACH_EDGE (e, ei, bb->preds)
            {
              int j;
+
+             if (num >= 5)
+               break;
              CLEAR_HARD_REG_SET (colors);
              EXECUTE_IF_SET_IN_BITMAP (live_at_end[e->src->index], 0, j, bi)
                {
@@ -1366,6 +1370,7 @@ rewrite_program2 (bitmap new_deaths)
                    update_spill_colors (&colors, web, 1);
                }
              IOR_HARD_REG_SET (cum_colors, colors);
+             num++;
            }
          if (num == 5)
            in_ir = 1;