[Patch, Fortran] More coarray fixes
Tobias Burnus
burnus@net-b.de
Mon Jun 23 06:31:00 GMT 2014
The test case of this patch requires the trans*.c changes of
https://gcc.gnu.org/ml/gcc-patches/2014-06/msg01662.html
At least for "coarray(:)[i] = coarray2(:)[j]" the library must handle
string padding/trimming (previously implemented) and numeric-type and
character-kind conversion. And instead of generating a temporary array
for those in the compiler for the assignment case, I now also push the
type conversion task always to the library.
The attached patch case implements the character-kind conversion and the
numeric type conversion, it adds an extensive test case for the
character handling. On the compiler side:
- resolve.c: We avoid a temporary for "var = caf[i]" and transform it
into "caf_send(var, caf[i])"; however, this patch avoids this for "array
= scalar_caf[i]" â leaving it to the normal code path (temporary +
scalarizer)
- trans-intrinsic.c: If we assign a scalar (caf_send), there is no
reason not to do the numeric type conversion in the compiler. Thus, this
patch now does so. (Well, only if the RHS is neither a string nor coindexed)
Build and regtested on x86-64-gnu-linux.
OK for the trunk?
Tobias
PS: The follow up patch(es) will add a test case for numeric type
conversion and handle (and test) vector subscripts in the library.
Afterward, I want to look into some issues with polymorphic coarrays;
some are pre-existing, but I have the feeling the trunk port might have
regressed compared with the fortran-caf version in some corner cases.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: caf.diff
Type: text/x-patch
Size: 67655 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140623/e9035f9b/attachment.bin>
More information about the Fortran
mailing list