[Patch, Fortran] Coarray fixes for select type/associate and type of derived components

Tobias Burnus burnus@net-b.de
Sun Jun 29 12:03:00 GMT 2014


This patch fixes some issues with polymorphic coarrays. I still have to 
fix at least one issue.

Fixed by the patch:

a) The temporary pointer generated with SELECT TYPE has to be a coarray. 
That's fixed with the resolve.c patch. The comment is also bogus: The 
comment is correct – and gfortran correctly detects coindexed variables 
as selector. However, in the code in question, the selector is not 
coindexed but the variable in the coindexed section is.

b) It doesn't make sense to try to initialize the temporary pointer of 
SELECT TYPE (or ASSOCIATE), thus we have to exclude it also in trans-decl.c

c) As the temporary variable is internally a pointer, the assert in 
trans-array.c also has to accept a pointer – even though coarrays with 
token in the descriptor can only be allocatable. But for code like 
"a(1)[1])", "a(1)" is not longer a pointer – and one ends up having an 
akind of unknown. Instead of adding all kind of values, I simply removed 
the assert.

d) In trans-intrinsic.c, one has a similar issue. We now avoid an ICE by 
checking whether the variable is set before accessing it.

e) For caf(:)[i]%a, we had the dtype of the descriptor of "caf" instead 
of "...%a". That's now fixed.

Build and regtested on x86-64-gnu-linux.
OK for the trunk?

Tobias

PS: Still to be done for coarrays: Nonallocatable polymorphic coarray 
dummies. For those, the offset and the token is passed as additional 
argument – but that's not yet correctly handled with ASSOCIATE/SELECT TYPE.
Also to be done are more type-conversion checks (beyond those which are 
implicitly checked by this patch) – and the handling of vector subscripts.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: caf.diff
Type: text/x-patch
Size: 9247 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140629/e7ab7299/attachment.bin>


More information about the Fortran mailing list