https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96787
Bill Schmidt <wschmidt at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amodra at gcc dot gnu.org --- Comment #6 from Bill Schmidt <wschmidt at gcc dot gnu.org> --- Ah, I can't read. These really are at the end(s) of the function, so it does appear to be a tail call optimization that we've decided is legitimate. It looks like the problem is that we don't set up r12 prior to the tail call. Unlike the usual case, here we have "mtctr 9" to set up the CTR and r12 still points to the previously called function. That can't be good. This is exposed by my recent patch to allow more tail calls in rs6000_decl_ok_for_sibcall, but it's not clear to me where we need to fix things up so that r12 gets set.