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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
There are *two* independent issues:

(A) Predefined firstprivate does not find mappings done in the same
    directive, e.g.

  int a[100];
  int *p = &a[0];
  #pragma omp target teams distribute map(a)
    p[0] = 5;


(B) The base pointer is not stored, hence, the following fails:

  int a[100];
  int *p = &a[0];
  //   #pragma omp target enter data map(a[10:])  /* same result */
  #pragma omp target teams distribute map(a[10:])
    p[15] = 5;

Here,
   map(a[10:])  /* or: map(a[start:n])  */
gives:
   map(tofrom:a[start] [len: _7])
      map(firstprivate:a [pointer assign, bias: D.2943])

But then the basepointer is gone. Thus, any later lookup of an address that
falls between basepointer and first mapped storage location is not found.

Reply via email to