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: "vries 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 17:32:20 +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 #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Simplified version, aborts in host code because loop has no effect:
...
#include <stdio.h>
extern void abort ();
#define N 32ULL
#pragma omp declare target
int a[N];
#pragma omp end declare target
const unsigned long long c = 0x7fffffffffffffffULL;
__attribute__((noinline, noclone)) void
f2_tpf_static32 (void)
{
unsigned long long i;
#pragma omp target parallel for schedule(static, 32)
for (i = c + N; i > c; i -= 1ULL)
a[i - 1ULL - c] -= 4;
}
__attribute__((noinline, noclone)) int
test_tpf_static32 (void)
{
int i, j, k;
for (i = 0; i < N; i++)
a[i] = i - 25;
#pragma omp target update to(a)
f2_tpf_static32 ();
#pragma omp target update from(a)
for (i = 0; i < N; i++)
printf ("%d: %d, expected: %d\n", i, a[i], i - 29);
for (i = 0; i < N; i++)
if (a[i] != i - 29)
return 1;
return 0;
}
int
main ()
{
if (test_tpf_static32 ())
abort ();
return 0;
}
...