https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70177
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Perhaps better testcase (-O2 again): int b[128]; void foo (int i, int j) { int c, f, g, h; for (g = 0; g < 64; g++) for (h = g, f = 0; f <= i; f++, h++) for (c = 0; c < j; c++) b[h] = 0; } This one is well defined if ((j <= 0 && i <= INT_MAX - 63) || i <= 64) and numbers of loop iterations are 64, min (i >= 0 ? i + 1 : 0, INT_MAX - 62), max (j, 0).