[flang-commits] [flang] [Flang][OpenMP] : Compilation error involving Cray pointers and data sharing attributes (PR #82481)

Michael Klemm via flang-commits flang-commits at lists.llvm.org
Wed Feb 21 07:47:51 PST 2024


https://github.com/mjklemm requested changes to this pull request.

I think the PR is not yet sufficient, as it resolves the issue of Flang issuing a fatal diagnostic about the pointee, but it does not seem to properly inherit the data-sharing attribute of the pointer.

In fact, the compiler segfaults for a case like this:

```Fortran
program test_crayptr
  implicit none
  real*8 var(*)
  pointer(ivar,var)
  real*8 pointee(8)

  pointee(1) = 42.0
  ivar = loc(pointee)

  !$omp parallel num_threads(2) default(none) shared(ivar)
    print *, var(1)
  !$omp end parallel

  !$omp parallel num_threads(2) default(none) private(ivar)
    print *, var(1)
  !$omp end parallel

  !$omp parallel num_threads(2) default(private) shared(ivar)
    print *, var(1)
  !$omp end parallel

  !$omp parallel num_threads(2) default(firstprivate) shared(ivar)
    print *, var(1)
  !$omp end parallel
end program test_crayptr
```




https://github.com/llvm/llvm-project/pull/82481


More information about the flang-commits mailing list