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

            Bug ID: 100902
           Summary: pointer attachment issues
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

On:

void
foo (int *ptr)
{
  #pragma omp target map (ptr, ptr[:4])
  #pragma omp parallel master
  ptr[0] = 1;
}

void
bar (int *ptr)
{
  #pragma omp target parallel map (ptr[:4], ptr)
  #pragma omp master
  ptr[0] = 1;
}

foo is compiled fine, but bar ICEs because c_omp_adjust_map_clauses isn't
called
on the combined constructs.

Another bug is that
void
baz (int *ptr)
{
  #pragma omp target map (ptr[:4], ptr)
  #pragma omp parallel master
  ptr[0] = 1;
}

void
qux (int *ptr)
{
  #pragma omp target parallel map (ptr, ptr[:4])
  #pragma omp master
  ptr[0] = 1;
}

is rejected by both C and C++ pointers twice with
‘ptr’ appears both in data and map clauses
The user ordering of clauses (which is reversed for the non-combined cases in
the implementation) should not matter.

I'll deal with the bar issue for now.

Reply via email to