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


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

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