This is the mail archive of the gcc@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]

Re: forcing tail/sibling call optimization


On Mon, Nov 27, 2000 at 05:25:45PM +0100, Jeffrey A Law wrote:
> 
>   In message <oupn1el760c.fsf@pigdrop.muc.suse.de>you write:
>   > Problem I see with that is diagnostics again: e.g. someone depends on a 
>   > particular call being a tail call and not allocating new storage.
> Therein lies the first problem -- programmer dependence on specific 
> optimizations in the compiler.  That's a fundamental mistake.

Well, I think Fergus' whole point of the extension was to use gcc 
as a backend for language compilers that have this requirement. 

> 
> If you _must_ have tail calls optimized to gotos, then write them that way
> or use a language which guarantees tail calls will turn into gotos.  If
> tail call optimizations are merely convenience, then write them as calls :-)

That would require putting the whole program into a single function, which
given the current gcc optimizer's runtimes is surely to end with a very
slow compile process for anything >-O0.

-Andi


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