forcing tail/sibling call optimization
Andi Kleen
ak@suse.de
Sun Nov 26 09:55:00 GMT 2000
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
More information about the Gcc
mailing list