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


>>>>> "Andi" == Andi Kleen <ak@muc.de> writes:

    Andi> On Mon, Nov 27, 2000 at 05:25:45PM +0100, Jeffrey A Law
    Andi> 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.

    Andi> Well, I think Fergus' whole point of the extension was to
    Andi> use gcc as a backend for language compilers that have this
    Andi> requirement.

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                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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