https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94145
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Alan Modra from comment #8) > (In reply to Richard Biener from comment #7) > > OTOH CSEing the load from the PLT once it is resolved _would_ be an > > optimization. > > Possibly. Sometimes making the call sequence seem more efficient runs into > stalls particularly when the called function is short. > > > Asks for loop peeling I guess? > > Yeah, that might be one way to get the first call of a function inside a > loop over and done with. And so you'd know the PLT entry was resolved and > thus no longer volatile. I suppose there's no (portable) way to "speculate" the call, thus _just_ eventually resolve the PLT? That way we could do such hoisted PLT loads as load PTL + speculate call load PTL or rather always do resolve-and-load-PLT since the times we want to lazily load the PLT with resolving later are scarce?