This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [OpenCoarrays] RFC patch: Dependency/alias analysis wir same-image coarray access
- From: Tobias Burnus <burnus at net-b dot de>
- To: Alessandro Fanfarillo <alessandro dot fanfarillo at gmail dot com>
- Cc: gfortran <fortran at gcc dot gnu dot org>, opencoarrays at googlegroups dot com
- Date: Wed, 27 Aug 2014 21:29:03 +0200
- Subject: Re: [OpenCoarrays] RFC patch: Dependency/alias analysis wir same-image coarray access
- Authentication-results: sourceware.org; auth=none
- References: <53FD7DDA dot 4020808 at net-b dot de> <CAKT_9NUMbUFypmerL0aATRUhGZneFObFMtWpihTKegxQMPmqMw at mail dot gmail dot com>
Alessandro Fanfarillo wrote:
The compiler participation could be useful for performance purposes.
The idea is:
1) the library checks if source and destination are the same and if
the compiler finds an aliasing.
I assume you mean: source and target are on the same image. (Which for
caf_sendget might be not the executing one.)
2) If the compiler does not find anything, the library just applies memmove.
Ditto if memory source and destination are contiguous. That's in line
with the current compiler check but can in general only be done at run
time - and, for performance reasons, this check is already done. (One
could also check more as the compiler cannot do all checks at compile
time; one could also support walking the array in reverse order etc.
However, I don't think that's worthwhile.)
3) If the compiler find an aliasing, the library does not do anything.
I do not understand your 3: If the library doesn't do anything, you get
wrong results for
a(5:1:-1)[1] = a(1:5:1)
I think what one wants is the following: The library creates a temporary
array and first assigns to it - before assigning from the temporary to
the target variable.
Tobias