https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116776
--- Comment #1 from Matthew Malcomson <matmal01 at gcc dot gnu.org> --- N.b. from experimentation it seems that gcc 11 didn't move any part of the condition outside of the loop, and since gcc 12 part of the condition has been moved outside the loop. I don't think this hoisting has ever happened.