[Bug middle-end/110639] [OpenMP][5.1] Predefined firstprivate for pointers - attachment missing
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Dec 6 15:43:17 GMT 2023
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.
More information about the Gcc-bugs
mailing list