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


The formal definition seems quite reasonable here, but I must say
I dislike the syntax, and it is unnecessarily provocative, since
this really is not semantically a goto at all (e.g. the formal
denmotational semantics would have nothing to do with the semantics
of goto). Why not something like "tail return" or perhaps better 
simply a compiler directive.

The real point here is that the semantics is identical to return. What
the declaration (in whatever form it exists) is doing is to say that
the semanjtics of execution will be undefined if there are any subsequent
references to local variables of the caller. That's *all* that needs to
be said semantically.

In Ada, one would provide this capability by simply having a pragma
e.g. pragma Tail_Return; which has no effect on the semantics of the
program if it is correct.

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