https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116497
--- Comment #4 from andi at firstfloor dot org --- The change of the subject is incorrect. The transformation has nothing to do with static function: consider LTO or someone might write an interpreter spread over multiple files. > always need to keep on changing the sources of the application rather than > ever > doing improvements to GCC that would help code that didn't even know about the > attributes. The same is true of this whole musttail attribute. It does nothing > except provide an error message. There are better ways of implementing that > inside GCC really than the attribute that was added. GCC has -fopt-info which > should have been used instead. -fopt-info is not a useful interface for checking for an transformation that is needed for correctness. > Here is another place where the attribute is just a way to hack around instead > of improving GCC for ABI for static functions. So yes the compiler might figure this out on its own for some cases, but it would need this proposed attribute semantic change anyways to do this.