https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87664
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- This is because the last invariant motion pass happens before register allocation, and at that point this single expression is represented by a pseudo register (reg/f: DI 19 frame), and that isn't considered to be something that should be hoisted before the loop. During register allocation the frame pseudo gets replaced by something different, like %rsp + constant or %rbp + constant, and at that point we might need to reconsider that. On the other side, we might hoist frame + constant even if in the and that ends up being say %rbp itself or %rsp. I think we have a dup for this somewhere.