This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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, gfortran] Re: Cray Pointers


> > > The convention is to use byte-size increments.  I don't think it's
> > > possible to do anything else.  For example, the following is valid:
> >
> > My understanding was this this depended which machine you were using. I'm
> > sure I read that the original cray implementation used word (ie. type
> > size) addressing, but later implementations use byte addressing.
>
> That is because the first cray could not address bytes. Later versions of
> the compiler generated code to mask and shift words in the Cray to allow
> byte addressing. Even when the hardware didn't support it directly.

Ok.

> > > integer(4) buffer(1024)
> > > real(8) rarray(512)
> > > integer(4) iarray(1024)
> > > pointer (ipt, rarray)
> > > pointer (ipt, iarray)
> > > ipt = loc (buffer)
> >
> > Really? On many machines buffer might only have 4-byte alignment, so
> > accessing it as an 8-byte float will cause alignment faults.
>
> It's safer to change the first line of the previous example to read:
> integer(8) buffer(512)

But you still can't use both to access the same object, right? ie. the 
optimizers can assume that the two pointees don't alias.

It would seem rather strange if two pointees can alias but a pointee and a 
real object can't.

Paul


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