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

            Bug ID: 97021
           Summary: [OpenMP] copy out of allocatable scalars does not
                    work.
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: openmp, wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

The following program stops with "STOP 7" – as no copy out of the data from the
target region happens, i.e. a1 is still 99 and p1 is still 123.

 * * *

implicit none
integer, pointer :: p1
integer, allocatable :: a1

allocate(p1)
a1 = 99
p1 = 123

!$omp target data map(p1, a1)
  if (.not.associated(p1)) stop 1
  if (.not.allocated(a1)) stop 2
  if (a1 /= 99) stop 3
  if (p1 /= 123) stop 4
  a1 = -3
  p1 = -22
!$omp end target data

if (.not.associated(p1)) stop 5
if (.not.allocated(a1)) stop 6
if (a1 /= -3) stop 7
if (p1 /= 22) stop 8
end

Reply via email to