This is the mail archive of the
mailing list for the GCC project.
Re: forcing tail/sibling call optimization
- To: gcc at gcc dot gnu dot org
- Subject: Re: forcing tail/sibling call optimization
- From: Mark Probst <schani at mips dot complang dot tuwien dot ac dot at>
- Date: Sun, 26 Nov 2000 14:21:36 +0100
- References: <20001126225556.A30696@hg.cs.mu.oz.au>
On Sun, Nov 26, 2000 at 10:55:56PM +1100, Fergus Henderson wrote:
> The basic idea is to provide a way for the programmer to tell
> the C compiler that a particular call should be treated as
> a sibling call or tail call, even if the compiler can't prove
> that the storage for the locals is no longer live.
> This feature is important for compilers of high-level functional and
> logic programming languages that target C. For such languages,
> recursion is the primary form of iteration, and it is important that
> sibling calls be optimized. Often the high-level language compiler
> has more information about when it is safe to do tail calls than gcc
> has, but currently there is no way for the high-level language
> compiler to communicate that to gcc.
> The language C-- (see <www.cminusminus.org>), which is designed to be
> ideal as a target language, provides this feature. I would like
> GNU C to provide it too.
i am already working on this. in fact, it already works for small test
programs on alpha and i386. there are still some small issues to
resolve and the implementation probably isn't very clean, but it's
clear that it can be done. i'd be happy to provide you with additional
information if you like.
Student, Programmer, Juggler