https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93444
--- Comment #5 from Alexander Monakov <amonakov at gcc dot gnu.org> --- The problem is lifting a conditional access. We don't have an example where lifting an invariant from an always-executed block in a loop to its preheader poses a problem. LLVM adopted an approach where hoisting must "freeze" the "poisoned" values resulting from uninitialized access so they acquire a concrete unpredictable value: https://www.cs.utah.edu/~regehr/papers/undef-pldi17.pdf