This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: forcing tail/sibling call optimization
- To: dewar at gnat dot com, law at redhat dot com
- Subject: Re: forcing tail/sibling call optimization
- From: dewar at gnat dot com (Robert Dewar)
- Date: Mon, 27 Nov 2000 13:04:14 -0500 (EST)
- Cc: freitag at alancoxonachip dot com, gcc at gcc dot gnu dot org
<<In contrast, dependence on this kind of transformation in other languages
might be quite reasonable (and I believe there are languages which explicitly
require these transformations). Typically those languages have conventions
which significantly ease these kinds of transformations.
We're apparently not communicating well.
>>
Definitely not!
We have a *functional* requirement in the source language to use O(1)
space in these cases.
We want to buidl a translator that translates into a language similar
to C (C-- was mentioned in this context).
GNU-C is *almost* usable as a target, but not quite, because of the
lack of control over sibling call "optimization".
Yes, of course it is terrible for a user program to depend on optimization,
but that has nothing at all to do with the situation here.
It seems quite reasonable to me to consider adding functionality to
GNU-C to support this requirement. Of course it would never be appropriate
for a programmer writing in C to use this feature directly in C code (well
almost never).
I don't see what the big deal is in implementing something useful here,
and it definitely does meet a need.
<<Optimizations can occur across several axis -- execution speed, code density,
stack space, etc etc etc. This transformation is an optimization in stack
space and sometimes code speed.
>>
No, it is NOT an optimization in stack space, it is a functional feature
that is needed to ensure proper translation of the source program.