[Fortran] Help with intrinsic function returning array
Alessandro Fanfarillo
fanfarillo.gcc@gmail.com
Thu May 19 17:57:00 GMT 2016
Thanks! I changed the function name from failed_images to
_gfortran_caf_failed_images and modified OpenCoarrays accordingly.
The attached test case named testFailedImages.f90 works perfectly; the
temporary is recognized by the scalarizer an printed correctly.
On the other hand, the scalarizer doesn't recognize as array an
allocatable array not explicitly allocated (testFailedImages_3.f90).
2016-05-18 14:10 GMT-06:00 Mikael Morin <mikael.morin@sfr.fr>:
> Le 17/05/2016 22:20, Alessandro Fanfarillo a écrit :
>>
>> 2016-05-17 13:46 GMT-06:00 Mikael Morin <mikael.morin@sfr.fr>:
>>
>>> Well, what I was telling was aiming at producing something more like
>>> that:
>>> _gfortran_caf_failed_images(&failed);
>>> It's probably doable that way, but there might be some problems indeed
>>> with
>>> the scalarizer. Most existing intrinsics functions calling the library
>>> can
>>> have their result shape inferred before the call.
>>
>>
>> I think it would be much more easy to use a subroutine rather than a
>> function. Is there an easy way to
>> transform the intrinsic function in a subroutine invocation?
>>
> Well, all the infrastructure is already there.
> You just need to tell that the function returns a non-scalar result.
> I attach an incremental patch, whose result I have only visually inspected.
> The code generated is not very neat, and does some strange things, but it
> has the essential parts.
> The setting of the bounds probably need more investigation.
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testFailedImages_3.f90
Type: text/x-fortran
Size: 183 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160519/2ffc9371/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testFailedImages_3.f90.003t.original
Type: application/octet-stream
Size: 1607 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160519/2ffc9371/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testFailedImages.f90
Type: text/x-fortran
Size: 220 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160519/2ffc9371/attachment-0001.bin>
More information about the Fortran
mailing list