From 180919e1721ab217f1365da6655c84dac9bb2afb Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 26 Apr 2007 14:12:09 +0000 Subject: [PATCH] moved iterator allocation outside loop delete a chunk AFTER it's number is written [r13476] --- ir/be/becopyheur4.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ir/be/becopyheur4.c b/ir/be/becopyheur4.c index 357cb0c02..5645bbaf2 100644 --- a/ir/be/becopyheur4.c +++ b/ir/be/becopyheur4.c @@ -767,13 +767,13 @@ static int change_node_color_excluded(co_mst_env_t *env, co_mst_irn_t *node, int static int recolor_nodes(co_mst_env_t *env, co_mst_irn_t *node, col_cost_t *costs, waitq *changed_ones) { int i; waitq *local_changed = new_waitq(); + void *nodes_it = be_ifg_nodes_iter_alloca(env->ifg); DBG((env->dbg, LEVEL_1, "\tRecoloring %+F with color-costs", node->irn)); DBG_COL_COST(env, LEVEL_1, costs); DB((env->dbg, LEVEL_1, "\n")); for (i = 0; i < env->n_regs; ++i) { - void *nodes_it = be_ifg_nodes_iter_alloca(env->ifg); int tgt_col = costs[i].col; int neigh_ok = 1; ir_node *neigh; @@ -1024,7 +1024,6 @@ static void color_aff_chunk(co_mst_env_t *env, aff_chunk_t *c) { } /* clear obsolete chunks and free some memory */ - delete_aff_chunk(env, c); delete_aff_chunk(env, best_chunk); bitset_free(visited); del_waitq(changed_ones); @@ -1067,8 +1066,8 @@ int co_solve_heuristic_mst(copy_opt_t *co) aff_chunk_t *chunk = pqueue_get(mst_env.chunks); color_aff_chunk(&mst_env, chunk); - DB((mst_env.dbg, LEVEL_4, "<<<====== Coloring chunk (%d) done\n", chunk->id)); + delete_aff_chunk(&mst_env, chunk); } /* apply coloring */ -- 2.20.1