This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: forcing tail/sibling call optimization
Fergus --
You're definitely right -- the transformation you have to do to make
the code safe for tailcalls from the point of view of the C compiler
are more severe than I thought. Addressing parameters is particularly
deadly. On the other hand, as you say, we're talking about
machine-generated code anyhow -- so ugliness probably doesn't matter
as much as speed and correctness.
I think we're going to have to agree to disagree here. It's still
my position that we shouldn't introduce an extension for the tail-call
stuff, because I don't view the translation of functional languages
into C as fundamentally the right way to go. It would be so much
better to write a Scheme front-end for GCC -- and I would totally
support, then, providing a bit on CALL_EXPRs to force tailcalls.
Presumably, the Scheme front-end would set this bit.
I know that you, and Mike Stump, disagree with me -- and that's
cool. We'll see what happens from here.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com