This is the mail archive of the
mailing list for the GCC project.
Re: Fwd: [Patch, Fortran,4.6] Coarray 3/n: Codimension declaration support
- From: Daniel Kraft <d at domob dot eu>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 17 Feb 2010 21:53:37 +0100
- Subject: Re: Fwd: [Patch, Fortran,4.6] Coarray 3/n: Codimension declaration support
- References: <4B751E71.email@example.com> <4B7C3A81.firstname.lastname@example.org> <4B7C5025.email@example.com>
Tobias Burnus wrote:
An ordinary array has the indexes 0 to (rank-1) and a coarray has the
indexes (rank) to (rank+corank-1).
integer :: A(5,3)
codimension :: A[1,*]
When the first line is parsed, one creates an array spec for rank = 2
(attr.dimension = 1) and the corank remains 0. If one now parses the
second line, one needs to add a corank (attr.codimension = 1) by simply
appending the coarray bounds as index 2 (= rank) to 3 (= rank + corank -1).
However, if one has:
integer :: A[1,*]
dimension :: A(5,3)
one first creates an array spec for the coarray (at that point it is
scalar) with indexes 0 and 1 (= rank+corank -1). Then one parses the
second line and has to merge in the two normal ranks. To keep the order,
one needs first to shift the coranks from (0 to 1) to (2 to 3) before
one can insert the dimension at (0 to 1).
Ok, now I get it. However, this seems to assume that as consists either
only of ordinary or only of co-dimensions, right? But that's probably
all that is needed, because of the usage as above.
If this is correct, could you add assert's or comments to clarify that?
Otherwise the patch is ok with me.
Thanks for your work here!
To go: Hea-Kni-Mon-Pri