On Wed, 7 Dec 2022 17:13:42 +0100 Tobias Burnus wrote: > I think we need to distinguish: > > #pragma omp target enter data map(to: s.w[:10]) > > from > > #pragma omp target map(tofrom: s.arr[:20]) > s.arr[0] = 5; > > As in the latter case 's' gets implicitly mapped and then applies to > the base pointer 's.arr' of 's.arr[:20]'. While in the former case, > only the pointee gets mapped without the pointer 's.arr' (and, hence, > there is also no pointer attachment). Here's an incremental patch that fixes the mapping behaviour in that case. This is to be applied on top of the approved (but not committed) parent patch: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603792.html and also the unreviewed patch posted here (ping?): https://gcc.gnu.org/pipermail/gcc-patches/2022-November/607543.html though it might actually make more sense to commit the three patches squashed together. Tested with offloading to NVPTX. OK? Thanks, Julian