This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgomp/81805] Another libgomp.c/for-5.c failure on nvptx -- illegal memory access
- From: "amonakov at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 Aug 2017 18:23:35 +0000
- Subject: [Bug libgomp/81805] Another libgomp.c/for-5.c failure on nvptx -- illegal memory access
- Auto-submitted: auto-generated
- References: <bug-81805-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81805
--- Comment #3 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
The new testcase fails on any target and not related to offloading. Simplified
further:
#define N 32ULL
int a[N];
const unsigned long long c = 0x7fffffffffffffffULL;
f2_tpf_static32 (void)
{
unsigned long long i;
#pragma omp for
for (i = c + N; i > c; i -= 1ULL)
a[i - 1ULL - c] -= 4;
}
in the .original dump we have:
{
long long unsigned int i;
long long unsigned int i;
#pragma omp for
for (i = 9223372036854775839; i < 0; i = i + 18446744073709551615)
{
a[i + 9223372036854775808] = a[i + 9223372036854775808] + -4
}
}
and soon after we deduce that loop doesn't iterate because i is unsigned. The
comparison should have read '(long long)i < 0', no idea how the cast is lost.