From 87597068ff74dfe667a86ad97fd39a9d95925bea Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Tue, 6 Jun 2006 13:38:04 +0000 Subject: [PATCH] BugFix: ia32_finish_irg() uses height, that uses new block walks so we push all blocks on a waitq first :-( --- ir/be/ia32/bearch_ia32.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ir/be/ia32/bearch_ia32.c b/ir/be/ia32/bearch_ia32.c index bdf1589a6..4e99b428d 100644 --- a/ir/be/ia32/bearch_ia32.c +++ b/ir/be/ia32/bearch_ia32.c @@ -31,6 +31,7 @@ #include "irgopt.h" #include "bitset.h" +#include "pdeq.h" #include "debug.h" #include "../beabi.h" /* the general register allocator interface */ @@ -818,11 +819,26 @@ static void ia32_finish_irg_walker(ir_node *block, void *env) { } } +static void ia32_push_on_queue_walker(ir_node *block, void *env) { + waitq *wq = env; + waitq_put(wq, block); +} + + /** * Add Copy nodes for not fulfilled should_be_equal constraints */ static void ia32_finish_irg(ir_graph *irg, ia32_code_gen_t *cg) { - irg_block_walk_graph(irg, NULL, ia32_finish_irg_walker, cg); + waitq *wq = new_waitq(); + + /* Push the blocks on the waitq because ia32_finish_irg_walker starts more walks ... */ + irg_block_walk_graph(irg, NULL, ia32_push_on_queue_walker, wq); + + while (! waitq_empty(wq)) { + ir_node *block = waitq_get(wq); + ia32_finish_irg_walker(block, cg); + } + del_waitq(wq); } -- 2.20.1