https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111137
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Known to fail| |11.1.0 Summary|[12/13/14 Regression] Wrong |[11/12/13/14 Regression] |code at -O2/3 since |Wrong code at -O2/3 |r12-1000-g6924b5e6bd3 | Known to work| |10.5.0 Last reconfirmed| |2023-08-24 Status|UNCONFIRMED |NEW --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Reduced a little further: ``` int b[3][8]; short d; volatile int t = 1; int main() { int g = t; for (int e = 1; e >= 0; e--) { d = 1; for (; d >= 0; d--) { b[0][d * 2 + 1] = 0; b[g - 1 + d][0] ^= 1; b[0][d * 2 + 2] = 0; b[g - 1 + d][1] ^= 1; } } if (b[0][1] != 1) __builtin_abort(); } ``` Note this fails with GCC 11.1.0 with `-O2 -ftree-vectorize` but passes with `-O3` .