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: Fwd: gfortran - pointers to components of derived type arrays


Paul,

> Do I best make the strides and 'offset' pvoid_type_nodes?

No. Strides should have integer type.

Yes, I realised this after presing "send" - duuuh!


I'm not sure about the pointer itself. I suggest trying pointer-to-element.

> Also, is it OK to perform pointer arithmetic directly in
> gfc_build_array_ref, or is there some more intelligent way to do this
> that replaces the build4 (ARRAY_REF....?

I was hoping that you could use the 4th argument of NULL ARRAY_REF.
However tree.def claims this is specified "in units of the alignment of the
element type", which seems a particularly bizarre definition. Maybe we can
get it changed to be a byte offset, and always specify it as 1.

That would be nice.



Ideally we would use this as an excuse to expose proper multi-d addressing to the middle-end. I'm not sure how practical/hard work that is though. In that case we can factor out the stride multiplication and put it directly into the ARRAY_REF.

What is the advantage in doing that? Does that result in more efficient organisation of the stride multiplication or does it just make it invisible?

I recommend asking on gcc@ what the best representation would be. There's been some discussion recently about the representation of indirect references. Given we're changing things it makes sense to coordinate with the middle-end/loop optimizer folks to get the right representation.

In fact, somebody wrote to the fortran list, a while since, to say that they were contemplating doing this.

It would probably be helpful to write a C implementation of what we want, so that folks not familiar with gfortran can understand what we're trying to achieve.

OK - however, this is embarking on a road that I do not think that I have time to go down. In fact, I was trying to make a judgement as to whether I had the time to try to sort out the first part of the problem; ie. of the pointers to components of structure arrays, so that gfortran, at least, gets the missing functionality. Is anybody interested in helping?

Thanks

Paul


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