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 : > Le 17/05/2016 22:20, Alessandro Fanfarillo a écrit : >> >> 2016-05-17 13:46 GMT-06:00 Mikael Morin : >> >>> 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. > > >