[Patch, fortran] PR24862 IO for arrays of derived type.

Janne Blomqvist jblomqvi@cc.hut.fi
Thu Nov 17 21:42:00 GMT 2005


On Thu, Nov 17, 2005 at 10:01:21PM +0100, Paul Thomas wrote:
> Janne,
> 
> I have not had time to try your patch, yet.  However, it seems to me 
> that it will not handle the likes of
> 
> write (*, *) dt(:)%x

Yes it does handle it. The bug was that an array of derived type was
sent to the library via the transfer_array entry point. However,
transfer_array understands only intrinsic types. What the patch tries
to do is to only use transfer_array for arrays of intrinsic type that
are not part of any derived type. Everything that smells derived type
should be handled by the frontend scalarizer. For now at least, since
this is a 4.1 regression. Later on we can of course implement support
for arrays that are part of derived type, or arrays containing derived
types.

> where the derived type has more components than in your example.  You 
> are trying to implicitly alias the component array; this does not work 
> in gfortran, when and where it should.

Huh? What the patch does (or at least, what I think it should do) is
to additionally check the type field in the descriptor and only use
transfer_array if the type is not derived.

> In fact, I would say that your derived type is too trivial to be 
> acceptable because the size of the derived type matches the spacing 
> between the components.  Add a character(1) to make it more difficult.

I did. And it still works, since with the patch all the examples in
the testcase are handled by the frontend.

-- 
Janne Blomqvist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20051117/e197b1cc/attachment.sig>


More information about the Fortran mailing list