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 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.

bye
schani

-- 
Mark Probst
Student, Programmer, Juggler
http://www.complang.tuwien.ac.at/~schani/

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