https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87434
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- + rtx new_mem = gen_rtx_MEM (GET_MODE (mem), derived_ptr_reg); + MEM_COPY_ATTRIBUTES (new_mem, mem); I think it's dangerous to use old MEMs attributes this way, esp. MEM_EXPR and friends. You might also run into existing issues with RTL alias analysis (find-baseterm and friends, just search bugzilla) Obviously LTO has nothing to do with this, you are simply "unlucky".