On 12/7/2021 3:38 PM, Bradley Lucier via Gcc-help wrote:
I use GCC mainly to compile Scheme code that has been translated to
large, heavily macrofied C routines by the Gambit Scheme compiler:
[ ... ]
Hi Bradley, haven't heard from you in quite some time... Your testcases
continue to be legendary for the GCC project :-)
So I've been investigating whether gcc's -foptimize-sibling-calls
option (for which I've found very little documentation) might produce
similar results.
The option has been around for probably 20+ years at this point, you
just might not have been aware of it. They try, but do not guarantee
tail call optimization. They have all kinds of checks that might cause
any particular call site to be rejected for tail call elimination. It's
enabled by default at O2 or higher.
This commit to GCC's source tree defines must_tail_call_plugin.c,
which seems (a) to be used only in some tests, and (b) to have had no
patches since first committed:
Yea. I don't think this has really gone anywhere, though I haven't
followed the state of the plugin since its introduction.
jeff