http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60508
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-03-12 CC| |jakub at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Cleaned up testcase: int a = 1, g, h = 1, d, e, *f; char b; static int c[] = { 0, 0 }; void fn2 (void); void fn1 (short x, int l) { lab: { int k, m[0]; long j = h ? 0 : 0 / 0; unsigned char n = j; unsigned char i = x >= 0 ? n : n >> x; g = i; for (;;) { if (a) goto lab; while (d) { e = b = c[l]; fn2 (); } int o = m[0]; f = &k; } } } m[0] is undefined behavior of course, but with the above global variables unchanged and x >= 0 argument the function should be just endless loop without triggering undefined behavior.