grokos added a comment. @ABataev:
After this patch was committed, I tried to run the following example: #include <stdio.h> int *yptr; int main() { int y[10]; y[1] = 1; yptr = &y[0]; printf("&yptr = %p\n", &yptr); printf("&y[0] = %p\n", &y[0]); #pragma omp target data map(to: yptr[0:5]) #pragma omp target { printf("y = %d\n", yptr[1]); yptr[1] = 10; printf("y = %d\n", yptr[1]); } printf("y = %d\n", yptr[1]); return 0; } The arguments clang generates are: 1) base = &y[0], begin = &yptr, size = 8, type = TARGET_PARAM | TO 2) base = &yptr, begin = &y[0], size = 8, type = PTR_AND_OBJ | TO The second argument is correct, the first argument doesn't make much sense. I believe it should have its base set to &yptr, not &y[0]. y[0] is not the base for anything, it's only the pointee object. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84182/new/ https://reviews.llvm.org/D84182 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits