This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fwd: [Patch, Fortran,4.6] Coarray 3/n: Codimension declaration support


Tobias Burnus wrote:
An ordinary array has the indexes 0 to (rank-1) and a coarray has the
indexes (rank) to (rank+corank-1).

Assume
   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!

Daniel

--
Done:  Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]