public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/104949] New: [OpenMP] omp target: firstprivate of allocatable array – only descriptor firstprivatized
@ 2022-03-16  8:45 burnus at gcc dot gnu.org
  2022-03-31 18:12 ` [Bug fortran/104949] " burnus at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-03-16  8:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104949
           Summary: [OpenMP] omp target: firstprivate of allocatable array
                    – only descriptor firstprivatized
           Product: gcc
           Version: 12.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
  Target Milestone: ---

Found via
https://github.com/SOLLVE/sollve_vv/blob/master/tests/5.0/target/test_target_defaultmap_firstprivate.F90

The line:
  !$omp target firstprivate(A)

is translated as

        .omp_data_arr.19.a = &a;
        #pragma omp target num_teams(1) thread_limit(0) firstprivate(a)
               [child fn: MAIN__._omp_fn.1 (.omp_data_arr.19,
.omp_data_sizes.20,
                                            .omp_data_kinds.21)]

Thus, it does not handle the descriptor. See also PR 90742.

 * * *

implicit none (type,external)
integer, allocatable :: A(:)
A = [1,2,3,4,5,6]

!$omp parallel firstprivate(A)
!$omp master
  if (any (A /= [1,2,3,4,5])) error stop
  A(:) = [99,88,77,66,55]
!$omp end master
!$omp end parallel

!$omp target firstprivate(A)
  if (any (A /= [1,2,3,4,5])) error stop
  A(:) = [99,88,77,66,55]
!$omp end target
if (any (A /= [1,2,3,4,5])) error stop
end

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-24 16:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16  8:45 [Bug fortran/104949] New: [OpenMP] omp target: firstprivate of allocatable array – only descriptor firstprivatized burnus at gcc dot gnu.org
2022-03-31 18:12 ` [Bug fortran/104949] " burnus at gcc dot gnu.org
2022-05-23  8:54 ` cvs-commit at gcc dot gnu.org
2022-05-23 10:05 ` burnus at gcc dot gnu.org
2023-03-24 16:16 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).