|author||Ori Bernstein <email@example.com>||2013-02-06 00:42:58 -0500|
|committer||Ori Bernstein <firstname.lastname@example.org>||2013-02-06 00:43:04 -0500|
Document decdegree()'s subtlety.
It's tricky, the way that we use worklists as sets, but only here.
1 files changed, 12 insertions, 0 deletions
@@ -556,6 +556,18 @@ static void decdegree(Isel *s, regid m)
for (n = 0; adjiter(s, m, &n); n++)
+ /* Subtle:
+ * If this code is being called from coalesce(),
+ * then the degree could have been bumped up only
+ * temporarily. This means that the node can already
+ * be on wlfreeze or wlsimp.
+ * Therefore, if we don't find it on wlspill, we assert
+ * that the node is already on the list that we'd be
+ * moving it to.
found = wlhas(s->wlspill, s->nwlspill, m, &idx);
ldel(&s->wlspill, &s->nwlspill, idx);