X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Fircfscc.c;h=c643afad3fc3a68d5a17365b2946e124ab7a674e;hb=45ecc187cee7107c83c1f9618a1e1e586df73644;hp=8feda3aa3477a486f9a89a8c31e16e2b5ae8c91c;hpb=84eb51069f9b6daf39f78c37d56df2fb0d2397b0;p=libfirm diff --git a/ir/ana/ircfscc.c b/ir/ana/ircfscc.c index 8feda3aa3..c643afad3 100644 --- a/ir/ana/ircfscc.c +++ b/ir/ana/ircfscc.c @@ -163,6 +163,12 @@ static INLINE void init_stack(void) { tos = 0; } +static void finish_stack(void) +{ + DEL_ARR_F(stack); + stack = NULL; +} + /** * Push a node n onto the IR-node stack. */ @@ -296,6 +302,11 @@ static INLINE void init_scc(ir_graph *irg, struct obstack *obst) { irg_walk_graph(irg, init_node, NULL, obst); } +static INLINE void finish_scc(void) +{ + finish_stack(); +} + #ifdef INTERPROCEDURAL_VIEW /** * Initializes the scc algorithm for the interprocedural case. @@ -335,6 +346,7 @@ static int is_outermost_StartBlock(ir_node *n) { static int is_head(ir_node *n, ir_node *root) { int i, arity; int some_outof_loop = 0, some_in_loop = 0; + (void) root; assert(is_Block(n)); @@ -370,6 +382,7 @@ static int is_head(ir_node *n, ir_node *root) { static int is_endless_head(ir_node *n, ir_node *root) { int i, arity; int none_outof_loop = 1, some_in_loop = 0; + (void) root; assert(is_Block(n)); /* Test for legal loop header: Block, Phi, ... */ @@ -524,8 +537,7 @@ static void cfscc(ir_node *n) { assert(is_Block(n)); - if (irn_visited(n)) return; - mark_irn_visited(n); + if (irn_visited_else_mark(n)) return; /* Initialize the node */ set_irn_dfn(n, current_dfn); /* Depth first number for this node */ @@ -655,6 +667,7 @@ int construct_cf_backedges(ir_graph *irg) { if (is_Block(el)) cfscc(el); } + finish_scc(); obstack_free(&temp, NULL); assert(head_rem == current_loop);