https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116079
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- So the main issue is that we are not updating the store motion pass meta-data after applying store-motion to an outer loop and then continue to analyze inner loops. In particular the somewhat recent addition to determine if we are dealing with a single store BB. But now as we not only rewrite stmts but remove them this becomes an issue - but we can get away with this by clearing the VDEF on such stmt.