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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Minimal example:
...
$ cat libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims.c
int
main (void)
{
  int vectors_max = -1;
#pragma acc parallel \
  num_gangs (1) \
  num_workers (1) \
  vector_length (32) \
  copy (vectors_max)
    {
#pragma acc loop gang reduction (max: vectors_max)
      for (int i = 0; i < 2; i++)
#pragma acc loop worker reduction (max: vectors_max)
        for (int j = 0; j < 2; j++)
#pragma acc loop vector reduction (max: vectors_max)
          for (int k = 0; k < 32; k++)
            vectors_max = k;
    }

  if (vectors_max != 31)
    __builtin_abort ();

  return 0;
}
...

Passes with GOMP_NVPTX_JIT=-O0, starts failing at GOMP_NVPTX_JIT=-O1.

Reply via email to