https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78911
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Testcase for likely the same bug, at least hang starts at r221983. -fPIC -O2 -m32 -march=i686 -fno-omit-frame-pointer rh1406093.i long long *a, *b, c; int d, e; int baz (void); static inline long long foo (long long *x) { return __sync_val_compare_and_swap (x, 0, 0); } void bar () { int f = baz (); c = foo (&a[f]); if (c) e = d; a = b; }