aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2003-07-02 15:05:08 +0000
committerMichael Matz <matz@suse.de>2003-07-02 15:05:08 +0000
commit0b47c8857a7b0c10733402bdf7eeff57d169207a (patch)
tree4064c7295633037e5f46533c769d5f7d4de1c950
parent82da6aebe9d4077240f404c732d5a4bc52c1a99f (diff)
http://gcc.gnu.org/ml/gcc-patches/2003-07/msg00195.html
Don't recursively recolor the same webs. * ra-colorize.c (webs_in_recoloring): New. (colorize_one_web): Check, set and reset it. (ra_colorize_init): Allocate it. (ra_colorize_free_all): Free it. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/new-regalloc-branch@68836 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.RA8
-rw-r--r--gcc/ra-colorize.c15
2 files changed, 22 insertions, 1 deletions
diff --git a/gcc/ChangeLog.RA b/gcc/ChangeLog.RA
index d5b9aed5c1c..5e91428b52d 100644
--- a/gcc/ChangeLog.RA
+++ b/gcc/ChangeLog.RA
@@ -1,4 +1,12 @@
2003-06-30 Michael Matz <matz@suse.de>
+ Don't recursively recolor the same webs.
+
+ * ra-colorize.c (webs_in_recoloring): New.
+ (colorize_one_web): Check, set and reset it.
+ (ra_colorize_init): Allocate it.
+ (ra_colorize_free_all): Free it.
+
+2003-06-30 Michael Matz <matz@suse.de>
* ra-build.c: Include obstack.h.
(add_earlyclobber_conflicts): New.
(check_conflict_numbers): Comment out.
diff --git a/gcc/ra-colorize.c b/gcc/ra-colorize.c
index b86fd8d45ef..f7f2fcc0361 100644
--- a/gcc/ra-colorize.c
+++ b/gcc/ra-colorize.c
@@ -1309,6 +1309,10 @@ lose:
return 0;
}
+/* A bitmap of web IDs which currently are in the process of becoming
+ recolored (i.e. difficult webs which were spilled). */
+static bitmap webs_in_recoloring;
+
/* Try to assign a color to WEB. If HARD if nonzero, we try many
tricks to get it one color, including respilling already colored
neighbors.
@@ -1579,7 +1583,12 @@ colorize_one_web (web, hard)
set_cand (6, w);
continue;
}
- if (aw->type != COLORED)
+ if (aw->type != COLORED
+ /* And don't spill neighbors which are in the process of
+ becoming recolored higher up in the recursion stack.
+ This would screw up the roll back of the neighbors
+ of _that_ web, when some got a color in between. */
+ || bitmap_bit_p (webs_in_recoloring, aw->id))
continue;
else
{
@@ -1701,6 +1710,7 @@ colorize_one_web (web, hard)
neighbors. */
ra_debug_msg (DUMP_COLORIZE, " trying to spill %d\n", try->id);
colorize_one_web (web, hard);
+ bitmap_set_bit (webs_in_recoloring, web->id);
if (web->type != COLORED)
{
/* We tried recursively to spill all already colored
@@ -1723,6 +1733,7 @@ colorize_one_web (web, hard)
else
colorize_one_web (try, hard - 1);
}
+ bitmap_clear_bit (webs_in_recoloring, web->id);
}
}
else
@@ -3048,6 +3059,7 @@ void ra_colorize_init ()
{
/* FIXME: Choose spill heuristic for platform if we have one */
spill_heuristic = default_spill_heuristic;
+ webs_in_recoloring = BITMAP_XMALLOC ();
}
/* Free all memory. (Note that we don't need to free any per pass
@@ -3057,6 +3069,7 @@ void
ra_colorize_free_all ()
{
struct dlist *d;
+ BITMAP_XFREE (webs_in_recoloring);
while ((d = pop_list (&WEBS(FREE))) != NULL)
put_web (DLIST_WEB (d), INITIAL);
while ((d = pop_list (&WEBS(INITIAL))) != NULL)