This is the mail archive of the
mailing list for the GCC project.
Re: forcing tail/sibling call optimization
>>>>> "Andi" == Andi Kleen <firstname.lastname@example.org> writes:
Andi> On Mon, Nov 27, 2000 at 05:25:45PM +0100, Jeffrey A Law
>> In message <email@example.com>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.
Andi> Well, I think Fergus' whole point of the extension was to
Andi> use gcc as a backend for language compilers that have this
Yup. Sadly, that's an approach that just can't work in general. No
such compiler will ever be portable, and depending on the way GCC
compiles C here is a mistake.
We could do this *inside* the compiler -- i.e., but a
"make-me-a-tail-call-dang-it" bit on CALL_EXPRs. It would be
appropriate for a language front-end for Scheme, say, to set that bit.
Mark Mitchell firstname.lastname@example.org
CodeSourcery, LLC http://www.codesourcery.com