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


Fergus Henderson <fjh@cs.mu.oz.au> writes:
> 
> *******************************************************************************
> MATERIAL FOR LANGUAGE STANDARD
> *******************************************************************************
> 
> Syntax:
> 	Add a new statement production:
> 
> 		/* tail call statement */
> 		statement --> GOTO primary "(" exprlist ")" ";"

I would prefer not to use goto, but a new keyword here. Overloading makes for worse
syntax error recovery/reporting for the normal case when your extension is not
used. gcc's syntax error messages are already hard to grok for newbies, no need
to make it even harder. For example if I would typo goto label(); for some reason
in an ANSI-C program and that extension was enabled I would probably get a weird
error message that would be hard to make sense of it that new extension wasn't 
know. With a new __builtin_ prefixed keyword it would be less likely to get into
such an error situation. If you don't like the __ you can always define it to 
something else.


Except for that your proposal looks useful to me.


-Andi

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