https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97776
Bug ID: 97776 Summary: [C/C++][OpenMP] 'error: array section is not contiguous in ‘map’ clause' for: map(alloc: p[i][0:C]) Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: openmp Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: cltang at gcc dot gnu.org, jakub at gcc dot gnu.org Target Milestone: --- The following is rejected by gcc/g++ with: error: array section is not contiguous in ‘map’ clause This map(alloc: p[i][0:C]) is accepted by clang/clang++ and I also do not see why it is not contiguous. Found at: https://github.com/clang-ykt/omptests/blob/master/t-array-of-ptr/test.cpp and https://github.com/clang-ykt/omptests/blob/master/t-unified-array-of-ptr/test.cpp //--------------------- #define N 640 #define C 64 #define P 10 int A[N]; int *p[P]; void foo () { #pragma omp target enter data map(alloc: p) for (int i=0; i < P; i++) { #pragma omp target enter data map(alloc: p[i][0:C]) } } //---------------------