On Wed, Jun 4, 2014 at 2:00 AM, Cesar Philippidis <ce...@codesourcery.com> wrote: > One item on my to do list is adding support for subarrays in openacc in > fortran. So far I've got Ilmir's patch > <https://gcc.gnu.org/ml/gcc-patches/2014-05/msg01832.html> to work with > some local arrays, but not with allocatable arrays. I saw some chatter > on IRC this morning regarding array pointers and allocatable arrays. I'm > curious about how aliasing is going to be detected. Is that going to be > handled inside libgomp or by the compiler? Eg, consider a subroutine > which takes in to allocatable arrays as parameters, a and b. What > happens when a == b? We don't want to have two different copies of > whatever a and b point to on the target.
Fortran does not allow aliasing of dummy arguments, so a compiler is allowed to optimize assuming aliasing does not occur. The exception is dummy arguments with the POINTER attribute, those can alias with other variables having the POINTER or TARGET attributes. So an ALLOCATABLE variable can not alias with any other variable, unless it has the TARGET attribute. > > Thanks, > Cesar -- Janne Blomqvist