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.