From: Götz Lindenmaier Date: Mon, 10 Sep 2001 14:06:56 +0000 (+0000) Subject: another bug. allocated several start nodes. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=1b67a875ac41eaed395b5664d64224ec06ee57a5;p=libfirm another bug. allocated several start nodes. [r250] --- diff --git a/ir/ir/irgopt.c b/ir/ir/irgopt.c index dab16e209..706080bac 100644 --- a/ir/ir/irgopt.c +++ b/ir/ir/irgopt.c @@ -208,6 +208,9 @@ copy_preds (ir_node *n, void *env) { graph. */ void copy_graph () { + + ir_node *old, *new; + /* Not all nodes remembered in current_ir_graph might be reachable from the end node. Assure their link is set to NULL, so that we can test whether new nodes have been computed. */ @@ -224,13 +227,20 @@ copy_graph () { /* fix the fields in current_ir_graph */ set_irg_end (current_ir_graph, get_new_node(get_irg_end(current_ir_graph))); set_irg_end_block (current_ir_graph, get_new_node(get_irg_end_block(current_ir_graph))); - if (get_irn_link(get_irg_frame(current_ir_graph)) == NULL) - irg_walk(get_irg_frame(current_ir_graph), copy_node, copy_preds, NULL); - if (get_irn_link(get_irg_globals(current_ir_graph)) == NULL) - irg_walk(get_irg_globals(current_ir_graph), copy_node, copy_preds, NULL); - if (get_irn_link(get_irg_args(current_ir_graph)) == NULL) - irg_walk(get_irg_args(current_ir_graph), copy_node, copy_preds, NULL); + if (get_irn_link(get_irg_frame(current_ir_graph)) == NULL) { + copy_node (get_irg_frame(current_ir_graph), NULL); + copy_preds(get_irg_frame(current_ir_graph), NULL); + } + if (get_irn_link(get_irg_globals(current_ir_graph)) == NULL) { + copy_node (get_irg_globals(current_ir_graph), NULL); + copy_preds(get_irg_globals(current_ir_graph), NULL); + } + if (get_irn_link(get_irg_args(current_ir_graph)) == NULL) { + copy_node (get_irg_args(current_ir_graph), NULL); + copy_preds(get_irg_args(current_ir_graph), NULL); + } set_irg_start (current_ir_graph, get_new_node(get_irg_start(current_ir_graph))); + set_irg_start_block(current_ir_graph, get_new_node(get_irg_start_block(current_ir_graph))); set_irg_frame (current_ir_graph, get_new_node(get_irg_frame(current_ir_graph))); diff --git a/ir/ir/irvrfy.c b/ir/ir/irvrfy.c index 1deb11b1b..f74267325 100644 --- a/ir/ir/irvrfy.c +++ b/ir/ir/irvrfy.c @@ -335,5 +335,11 @@ vrfy_wrap (ir_node *node, void *env) { void irg_vrfy (ir_graph *irg) { + ir_graph *rem; + rem = current_ir_graph; + current_ir_graph = irg; + irg_walk(irg->end, vrfy_wrap, NULL, NULL); + + current_ir_graph = rem; }