This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]