OMP-private pointers misbehave

It looks to me like OMP-private pointers do not associate properly on thread 0 in OMP regions. I’m showing a minimal working example that demonstrates the problem.

> cat mwe.f90
program mwe
  call test
contains
  subroutine test

    real, pointer :: ptr(:)
    real, target  :: workspace(1000)
    integer       :: i
    integer       :: tid

!$  integer, external :: omp_get_thread_num

!$OMP PARALLEL DO NUM_THREADS(4) DEFAULT(NONE) &
!$OMP PRIVATE(ptr, workspace, tid)
    do i = 1, 16
       ptr => workspace
       ptr(1:1000) = 0D0
    end do
!$OMP END PARALLEL DO

  end subroutine test
end program mwe

> gfortran -fopenmp mwe.f90 -o mwe
> ./mwe
> ifort -qopenmp mwe.f90 -o mwe
> ./mwe
> nvfortran -mp mwe.f90 -o mwe
> ./mwe
Segmentation fault (core dumped)
> nvfortran --version
nvfortran 23.1-0 64-bit target on x86-64 Linux -tp haswell 

Hi j.dziedzic,

Thanks for the report. It appears that you already submitted the issue to NVBugs so I have not added a duplicate report.

-Mat