https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81863
--- Comment #3 from Arnd Bergmann <arnd at linaro dot org> --- The __builtin_prefetch() that caused the problem in the test case from comment 2 might be a red herring, I already noticed earlier that the bug shows up both in configurations that use a built-in function and an inline assembler version of the same. I reduced the other one as well now, coming to almost the same reduced source: int a, e, f, g, h; struct ww_class { int stamp; } c; struct stress { int locks; int nlocks; } d; void *i; int fn1(int *p1) { void *b = p1; __asm__("" ::"p"(b)); return a; } void fn2(int *p1) { int *v = p1; fn1(v); } void fn3(struct ww_class *p1) { fn2(&p1->stamp); } void fn4(); void fn5() { struct stress *j = i; int k = j->nlocks; int *l = &j->locks; do { fn3(&c); retry: for (g = 0; g < k;) fn4(l[e], d); f = g; if (h) goto retry; } while (!0); }