[Patch, Fortran] PR45859 - Permit array elements to coarray dummy arguments
Tobias Burnus
tobias.burnus@physik.fu-berlin.de
Fri Dec 4 12:39:00 GMT 2015
This patch permits
interface
subroutine sub (x)
real x(10)[*]
end subroutine
end interface
real :: x(100)[*]
call sub (x(10))
end
where one passes an array element ("x(10)") of a contiguous array to a
coarray dummy argument. That's permitted per interpretation request
F08/0048, which ended up in Fortran 2008's Corrigendum 2 - and is also
in the current Fortran 2015 drafts:
"If the dummy argument is an array coarray that has the CONTIGUOUS attribute
or is not of assumed shape, the corresponding actual argument shall be
simply contiguous or an element of a simply contiguous array."
the "or ..." of the last line was added in the corrigendum.
I hope and think that I got the true/false of the other users correct - in
most cases, it probably doesn't matter as the caller is only reached for
expr->rank > 0.
Build and regtested on x86-64-gnu-linux.
OK for the trunk?
Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coarray.diff
Type: text/x-diff
Size: 6163 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151204/ded8d261/attachment.bin>
More information about the Gcc-patches
mailing list