https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69619
--- Comment #1 from ktkachov at gcc dot gnu.org --- Just increasing the size of 'e' avoids undefined behaviour. The following doesn't give a warning and still shows the bug: int a, b, c, d; int e[100]; void fn1 () { int *f = &d; c = 6; for (; c; c--) { b = 0; for (; b <= 5; b++) { short g = e[(b + 2) * 9 + c]; *f = *f == a && e[(b + 2) * 9 + c]; } } }