Hi PA,

Tobias Burnus wrote:
First, the following applies to Fortran and C/C++:

int a[10][10];

void f(int n) {
  #pragma omp target update to(a[1][::-2])
}

This is accepted but violates:

* The stride must evaluate to a positive integer.

For C++, this is one is definitely rejected with your current patch:


foo.c:11:42: error: negative or zero stride in array section in ‘to’ clause
   11 |   #pragma omp target update to(dummy) to(a[: : m])

with int constexpr m = -1

However, in C it seems to be still accepted. I seem to have the original
C patch (2/3) and the follow-up fix for 2/3 applied, but there does not
seem to be any C patch to handle it - also
0001-OpenMP-Further-fix-strided-and-shaped-array-update-i.patch

is only a second C++ patch that does no cover C and seems to be
incorporated in the v2 C++ patch.


Thus, I withdraw my comment regarding C++, but for C either there patch
is missing completely - or you have it only locally (or I missed it).

* * *

Except for this stride < 1 issue in C and non-issue for C++, I think my
comments still should apply and, hopefully, make sense - if not, tell me.

Tobias

Reply via email to