https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56727
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Yuri Gribov from comment #9) > (In reply to Alexander Monakov from comment #8) > > Well, if my argument is correct, then GCC generates wrong code for the very > > first example in comment #0. > > I believe it does (see my #5, most probly author of some pass failed to > check for interposition). Note that simple recursive factorial is expanded > to loop too which is a more impressive instance of this bug. > > > To my knowledge, that > > is the sole instance where optimization doesn't fully honor ELF > > interposition possibility. > > +1 Don't we also inline any beneficial inline functions at -O3 even if they could be interposed (definitely not suggesting we stop doing that, that would totally kill compiler performance)? I'd say we shouldn't care about the semantic interposition for self-recursion either, just make sure we don't crash on such code.