This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: optimising recursive functions
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Robert Dewar <dewar at adacore dot com>, skaller <skaller at users dot sourceforge dot net>, GCC <gcc at gcc dot gnu dot org>
- Date: Sat, 27 Oct 2007 16:25:43 +0200
- Subject: Re: optimising recursive functions
- References: <84fc9c000710270354p5c0e9e73m58eb8b661558677d@mail.gmail.com>
Hi,
> > > So I am guessing the Felix version is lucky there are
> > > no gratuitous temporaries to be saved when this happens,
> > > and the C code is unlucky and there are.
> > >
> > > Maybe someone who knows how the optimiser works can comment?
> >
> > One problem with departing from the ABI even on a local level
> > like this is that it wipes out lots of tools that depend on
> > ABI compliance for the entire call chain. I suspect the overall
> > gain is too small to be worth this hit.
>
> If you make the function static then gcc can chose ABI-incompatible
> calling conventions.
alternatively, you can use -fwhole-program to get the same effect.
Zdenek