https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104422

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #3)
> Reproduces both with and without GOMP_NVPTX_JIT=-O0.

Pff, that was an artefact of having bumped the default ptx isa to 6.3.

So, let's try again ...

Reproduced with 390.147 driver on pascal card, GT 1030, gcc build from master
commit "[nvptx] Unbreak build, add PTX_ISA_SM70".  Doens't reproduce with
GOMP_NVPTX_JIT=-O0.

Minimal test-case:
...
#define N 1500

#pragma omp declare target
int a[N];

__attribute__((noinline, noclone)) void
f3_ds_normal ()
{
  volatile int s3 = 1;
#pragma omp distribute simd 
  for (int i = 0; i < N; i += s3)
    a[i] += 7;
}
#pragma omp end declare target

int
main ()
{
  for (int i = 0; i < N; i++)
    a[i] = i - 29;

#pragma omp target update to(a)

#pragma omp target teams
  f3_ds_normal ();

#pragma omp target update from(a)

  for (int i = 0; i < N; i++)
    if (a[i] != i - 22)
      __builtin_abort ();

  return 0;
}
...

Reply via email to