https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65627
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So you think GCC should kind of JIT the loop and evaluate all iterations? IMNSHO, just use sanitizers to catch bugs like that, -fsanitize=undefined should catch that.