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

            Bug ID: 118478
           Summary: [OpenMP][5.0] Use defined assignment for FIRSTPRIVATE
                    etc., if available
           Product: gcc
           Version: 15.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: ---

While OpenMP 4.5 has:
  "2.15.3.4 firstprivate Clause"
  ...
  "If the original list item does not have the POINTER attribute,
   initialization of the new list items occurs as if by intrinsic
   assignment, unless the original list item has the allocation
   status of not currently allocated, in which case the new list
   items will have the same status."

OpenMP 5.0 changed it to, e.g.,
   "2.19.6.1 copyin Clause"
   ...
   "If the original list item does not have the POINTER attribute, each copy
    becomes defined with the value of the copy of the master thread as if by
    intrinsic assignment unless the list item has a type bound procedure as a
    defined assignment. If the original list item that does not have the
    POINTER attribute has the allocation status of unallocated, each copy will
    have the same status."

Thus, if there is a defined assignment, use it for data-sharing clauses like
copyin, firstprivate etc.

Cross ref: For 6.1, some wording discussions are done in OpenMP Issue #4371 but
it mostly boils down to
"type bound procedure as a defined assignment" → "defined assignment"

Reply via email to