X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=ir%2Fopt%2Ftailrec.c;h=55ea68a42d548ad9c6218827750cf4cadb10df8a;hb=6596239a5116d8b13257f7976b57c9de619a606e;hp=a5e493884077c7d33ecd89d66c828de9bae207d7;hpb=36332e717eebd9b98603a99ea24e390a1d2aa3be;p=libfirm diff --git a/ir/opt/tailrec.c b/ir/opt/tailrec.c index a5e493884..55ea68a42 100644 --- a/ir/opt/tailrec.c +++ b/ir/opt/tailrec.c @@ -263,10 +263,7 @@ static void do_opt_tail_rec(ir_graph *irg, tr_env *env) { * ok, we are here, so we have build and collected all needed Phi's * now exchange all Projs into links to Phi */ - for (p = data.proj_m; p; p = n) { - n = get_irn_link(p); - exchange(p, phis[0]); - } + exchange(data.proj_m, phis[0]); for (p = data.proj_data; p; p = n) { long proj = get_Proj_proj(p); @@ -492,7 +489,7 @@ static tail_rec_variants find_variant(ir_node *irn, ir_node *call) { return TR_BAD; case iro_Sub: - /* try additive, but return value mut be left */ + /* try additive, but return value must be left */ a = get_Sub_left(irn); if (get_irn_MacroBlock(a) != get_irn_MacroBlock(call)) { /* we are outside, ignore */ @@ -722,8 +719,10 @@ void opt_tail_recursion(void) { current_ir_graph = irg; + set_using_irn_link(irg); if (opt_tail_rec_irg(irg)) ++n_opt_applications; + clear_using_irn_link(irg); } DB((dbg, LEVEL_1, "Performed tail recursion for %d of %d graphs\n",