X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbecopyheur4.c;h=ad5ca80d0c43f429cfb6c041ab2f3cc0a055aca1;hb=5474a1c188c9d59eea2c915515980cd9cbab58d8;hp=31995381cb53caf5100077cc830e0b7cc5136392;hpb=2ebc2d3cd8d238348e733c38712dc037c2d27dd7;p=libfirm diff --git a/ir/be/becopyheur4.c b/ir/be/becopyheur4.c index 31995381c..ad5ca80d0 100644 --- a/ir/be/becopyheur4.c +++ b/ir/be/becopyheur4.c @@ -1243,7 +1243,7 @@ static void color_aff_chunk(co_mst_env_t *env, aff_chunk_t *c) */ for (i = 0; i < env->k; ++i) { int col = order[i].col; - waitq *good_starts = new_waitq(); + waitq *good_starts; aff_chunk_t *local_best; int n_succeeded; @@ -1254,6 +1254,7 @@ static void color_aff_chunk(co_mst_env_t *env, aff_chunk_t *c) DB((dbg, LEVEL_2, "\ttrying color %d\n", col)); n_succeeded = 0; + good_starts = new_waitq(); /* try to bring all nodes of given chunk to the current color. */ for (idx = 0, len = ARR_LEN(c->n); idx < len; ++idx) { @@ -1292,8 +1293,10 @@ static void color_aff_chunk(co_mst_env_t *env, aff_chunk_t *c) } /* try next color when failed */ - if (n_succeeded == 0) + if (n_succeeded == 0) { + del_waitq(good_starts); continue; + } /* fragment the chunk according to the coloring */ local_best = fragment_chunk(env, col, c, tmp_chunks);