[Patch, fortran] [01..04/14] Support coarray subreferences: Add subreferences support in gfc_conv_expr_descriptor
Mikael Morin
mikael.morin@sfr.fr
Fri Oct 7 14:39:00 GMT 2011
These patches change the descriptor initialization code in
gfc_conv_expr_descriptor introduced by the recent scalarizer patchset at
http://gcc.gnu.org/ml/fortran/2011-09/msg00056.html.
It was supposing (just like the code it was replacing) that coarrays were
always full, but a subobject of a coarray is also a coarray (if non-allocatable, non-pointer).
Thus, if `a' is a coarray of rank 2; `a', `a(1,:)' and `a(1,2)' are all valid
coarrays.
Because of the two latter ones, we have to distinguish between the full array
rank (2 in the three cases above), and the partial reference rank (respectively
2, 1, 0).
As a result:
- in patch 4, we use loop.dimen (partial rank) instead of ndim (full rank) for
accessing loop and descriptor elements.
- in patch 3, we count codimensions from 0 and add to it either ndim or
loop.dimen depending on whether we access array ref's elements or loop
elements.
Patches 1 and 2 are preliminary changes.
OK?
-------------- next part --------------
2011-10-06 Mikael Morin <mikael.morin@sfr.fr>
* trans-array.c (gfc_conv_expr_descriptor): Move ndim initialization
earlier.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr50420-1.diff
Type: text/x-diff
Size: 645 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20111007/dc7cfc19/attachment.bin>
-------------- next part --------------
2011-10-06 Mikael Morin <mikael.morin@sfr.fr>
* trans-array.c (gfc_conv_expr_descriptor): Save some horizontal space.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr50420-2.diff
Type: text/x-diff
Size: 1273 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20111007/dc7cfc19/attachment-0001.bin>
-------------- next part --------------
2011-10-06 Mikael Morin <mikael.morin@sfr.fr>
PR fortran/50420
* trans-array.c (gfc_conv_expr_descriptor): Count codimensions starting
from zero, and add then the relevant offset (either ndim or loop.dimen)
depending on context.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr50420-3.diff
Type: text/x-diff
Size: 1473 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20111007/dc7cfc19/attachment-0002.bin>
-------------- next part --------------
2011-10-06 Mikael Morin <mikael.morin@sfr.fr>
PR fortran/50420
* trans-array.c (gfc_conv_expr_descriptor): Use loop.dimen instead of
ndim for the descriptor's rank.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr50420-4.diff
Type: text/x-diff
Size: 642 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20111007/dc7cfc19/attachment-0003.bin>
More information about the Fortran
mailing list