Would it be feasible to implement a "musttail" statement attribute in
GCC to get a guarantee that tail call optimization will be performed?
Such an attribute has just landed in the trunk of Clang
(https://reviews.llvm.org/D99517). It makes it possible to write
algorithms that use arbitrarily long
David Malcolm via Gcc wrote:
> FWIW I implemented something like this in GCC's middle-end here:
> https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9a385c2d3d74ffed78f2ed9ad47b844d2f294105
> exposing it in API form for libgccjit:
> https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=15c671a79ca66df5
On Fri, Apr 23, 2021 at 4:34 PM Andrew Pinski wrote:
>
> On Fri, Apr 23, 2021 at 2:45 PM Josh Haberman via Gcc wrote:
> >
> > I wrote more about some motivation for guaranteed tail calls here:
> > https://blog.reverberate.org/2021/04/21/musttail-efficient-interpreters.h