This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] Tail recursion improvement


Hello,

>  >Index: tree-optimize.c
>  >===================================================================
>  >RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
>  >retrieving revision 1.1.4.130
>  >diff -c -3 -p -r1.1.4.130 tree-optimize.c
>  >*** tree-optimize.c	25 Feb 2004 03:22:47 -0000	1.1.4.130
>  >--- tree-optimize.c	25 Feb 2004 07:43:11 -0000
>  >*************** init_tree_optimization_passes (void)
>  >*** 286,291 ****
>  >--- 286,292 ----
>  >    NEXT_PASS (DUP_PASS (pass_dce));
>  >    NEXT_PASS (pass_forwprop);
>  >    NEXT_PASS (pass_phiopt);
>  >+   NEXT_PASS (pass_tail_recursion);
>  >    NEXT_PASS (pass_ch);
>  >    NEXT_PASS (pass_may_alias);
>  >    NEXT_PASS (pass_del_pta);
>  >*************** init_tree_optimization_passes (void)
>  >*** 298,304 ****
>  >    NEXT_PASS (pass_dse);
>  >    NEXT_PASS (DUP_PASS (pass_forwprop));
>  >    NEXT_PASS (DUP_PASS (pass_phiopt));
>  >-   NEXT_PASS (pass_tail_recursion);
>  >    NEXT_PASS (pass_loop);
>  >    NEXT_PASS (pass_ccp);
>  >    NEXT_PASS (DUP_PASS (pass_redundant_phi));
>  >--- 299,304 ----
> BTW, the tree-optimize.c change is part of the problem with this patch
> not bootstrapping.

oops... I have made an "obvious" one line change after the testing (at
other piece in the patch, not this one) and apparently forgot to retest
it :-( Sorry :-(((

> You've moved tail recursion to a point before we've got aliasing information,
> which means that we haven't computed virtual uses/defs.  This ultimately lead
> to transforming tail recursive calls that ought to be left alone.
> 
> I'm going to do some testing without the tree-optimize.c hunk.  It's clearly
> wrong.

The purpose of the change was to get the tail recursion elimination
before the loop header copying.  I will try to test the patch with both
passes moved after the alias analysis.

Zdenek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]