This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81863] [7 regression] -mword-relocations is unreliable
- From: "arnd at linaro dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 17 Aug 2017 09:17:16 +0000
- Subject: [Bug target/81863] [7 regression] -mword-relocations is unreliable
- Auto-submitted: auto-generated
- References: <bug-81863-4@http.gcc.gnu.org/bugzilla/>
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);
}