forcing tail/sibling call optimization

Jeffrey A Law law@redhat.com
Mon Nov 27 09:48:00 GMT 2000


  In message < 20001127174448.A2375@fred.local >you write:
  > On Mon, Nov 27, 2000 at 05:25:45PM +0100, Jeffrey A Law wrote:
  > > 
  > >   In message < oupn1el760c.fsf@pigdrop.muc.suse.de >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.
  > 
  > Well, I think Fergus' whole point of the extension was to use gcc 
  > as a backend for language compilers that have this requirement. 
But I would claim that C is a terrible choice for the target language
of this translator because of this kind of issue.

I would think it would be better to actually write a true front-end for
the source language.


  > That would require putting the whole program into a single function, which
  > given the current gcc optimizer's runtimes is surely to end with a very
  > slow compile process for anything >-O0.
True.  But that's the price you pay when targetting a language (ie C) that
doesn't have the feature set (tail call opts) necessary to correctly 
implement the source language.

jeff



More information about the Gcc mailing list