On Tue, 11 May 2021 19:28:04 +0800 Chung-Lin Tang <clt...@codesourcery.com> wrote:
> This patch largely implements three pieces of functionality: > > (1) Per discussion and clarification on the omp-lang mailing list, > standards conforming behavior for mapping array sections should *NOT* > also map the base-pointer, i.e for this code: > > struct S { int *ptr; ... }; > struct S s; > #pragma omp target enter data map(to: s.ptr[:100]) > > Currently we generate after gimplify: > #pragma omp target enter data map(struct:s [len: 1]) map(alloc:s.ptr > [len: 8]) \ map(to:*_1 [len: 400]) map(attach:s.ptr [bias: 0]) > > which is deemed incorrect. After this patch, the gimplify results are > now adjusted to: #pragma omp target enter data map(to:*_1 [len: 400]) > map(attach:s.ptr [bias: 0]) (the attach operation is still generated, > and if s.ptr is already mapped prior, attachment will happen) Oh, that's not going to play nicely (eventually?) with the patch series I just posted... we probably need to clarify what the intention is for OpenACC, but IIUC "user expectation" (i.e. existing code) expects the base-pointer mapping to happen. Julian