https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119376
--- Comment #34 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to lucier from comment #33) > Sorry, I screwed up and fired off my comment before it was finished. Here's > the rest: > > (c) With today's GCC mainline head, those tail calls *are* optimized, as > confirmed with the musttail attribute. > > It is my understanding that with the set of patches related to this PR, GCC > 15 with -foptimize-tail-calls will optimize some tail calls that GCC 14 with > -foptimize-tail-calls will not optimize. This is somewhat independent of > the fact that GCC 15 has the musttail attribute. > > Is my description of the change in behavior between GCC 15 and 14 and > -foptimize-sibling-calls accurate? Yes. Though some changes are done only for calls with musttail attribute (a few with the intention to extend that to all tail calls in GCC 16, but most of them only when the attribute is present). > If so, will these changes be backported to earlier versions of GCC when > using the -foptimize-sibling-calls flag? No, those changes aren't regression fixes and are too risky to be backported.