https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81805
Bug ID: 81805 Summary: Another libgomp.c/for-5.c failure on nvptx -- illegal memory access Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org CC: jakub at gcc dot gnu.org Target Milestone: --- Minimized from for-5.c, without simd: ... extern void abort (); #pragma omp declare target int a[1500]; #pragma omp end declare target __attribute__((noinline, noclone)) void f2_tpf_static32 (void) { unsigned long long i; #pragma omp target parallel for schedule(static, 32) for (i = 0x7fffffffffffffffLL + 4500ULL - 27; i > 0x7fffffffffffffffLL - 27ULL; i -= 3) a[(i + 26LL - 0x7fffffffffffffffLL) / 3] -= 4; } __attribute__((noinline, noclone)) int test_tpf_static32 (void) { int i, j, k; for (i = 0; i < 1500; i++) a[i] = i - 25; #pragma omp target update to(a) f2_tpf_static32 (); #pragma omp target update from(a) for (i = 0; i < 1500; i++) if (a[i] != i - 29) return 1; return 0; } int main () { if (test_tpf_static32 ()) abort (); return 0; } ... ... $ ./install/bin/gcc -fopenmp -B$(pwd -P)/install/offload-nvptx-none/libexec/gcc/x86_64-pc-linux-gnu/8.0.0 -B$(pwd -P)/install/offload-nvptx-none/bin for-5.c -O2 $ ( export LD_LIBRARY_PATH=/usr/lib/nvidia-375:$(pwd -P)/install/lib64/; ./a.out ; echo $? ) libgomp: cuCtxSynchronize error: an illegal memory access was encountered libgomp: cuMemFreeHost error: an illegal memory access was encountered libgomp: device finalization failed 1 $ gcc for-5.c && ./a.out ; echo $? 0 ...