Hi Julian, thanks for the patch and the post-review fixes. (The revised patch was committed as r279628. And I have committed a few minor follow-up improvements.) I still have an issues with the following. On 12/18/19 11:51 PM, Tobias Burnus wrote: >> +      /* Disallow duplicate bare variable references and multiple >> +         subarrays of the same array here, but allow multiple >> components of >> +         the same (e.g. derived-type) variable.  For the latter, >> duplicate >> +         components are detected elsewhere.  */ > Do we have a test case for "the latter"? Seemingly, the latter is neither tested-for nor diagnosed: type t integer, allocatable :: i end type t type(t) :: x !$acc enter data copyin(x%i, x, x%i) ! Bad: accepted !$acc data pcopy(x) pcopy(x) ! OK – rejected: Symbol 'x' present on multiple clauses at (1) !$acc end data end > Thirdly, I am not sure whether the following will work with your code: > … > !$acc data copy (x(:)%k, x(:)%j(3)) > > This data is strided; I don't quickly see whether that's rejected. (I > also > didn't check whether it is valid, but I think it is not.) For attach/detach, the crucial bit is that the sub-references are *allocatable* or *pointer* variables, otherwise it does not make sense to talk about attach/detach. — For those, already the Fortran semantic gives an error. I have attached a test case (strided-alloc-ptr.f90), which shows that this is correctly rejected. However, the other question is how component access w/o allocatables or pointers is handled (i.e. they are all in the same aggregated type). I attached a test case for this (mapping-tests.f90). In particular: * "copy(x, x%k)" – rejected by OpenMP and, hence, OpenACC for C/C++ Accepted by gfortran for OpenACC (for gfortran: missing OpenMP 4.5 feature) * "copy(y(:)%i)" – strided access, i.e. y(1)%i + y(2)%i + … Is this valid OpenACC or not? [Currently equivalent to "copy(y)"] * "copy(z(1)%cc(:)%i)" – also strided access, but gives an ICE See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93025 Tobias