https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79002
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #7) > The eh issue I posted a patch to move cleanup_eh right before tail_recusion: > https://gcc.gnu.org/pipermail/gcc-patches/2025-August/693108.html > > (In reply to Richard Biener from comment #5) > > Looking at > I posted my patch without seeing this so at least Richard B. agreed with > some of what I mentioned in my patch. Committed as r16-3443-g6750f5902c6009 . so if you use static_cast<int&>(i) instead, the call will tail recusion.