https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104763
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- Note that the case of an endless loop is somewhat special since the store is dead there since there is no way to reach a load from that point with C standard methods. So one could also argue the optimization is valid and this bug is invalid. How did you end up with this case?