Alpha vs. new ABI

Alexandre Petit-Bianco apbianco@cygnus.com
Tue Jan 30 14:24:00 GMT 2001


Jeff Sturm writes:

> Isn't that the reason gcj now enforces a minimum of ptr alignment on
> the data member of arrays?  I know Alex made that change for the new
> ABI, but I don't remember exactly why.

I didn't make that change for the new ABI. The change was made this
summer in order to fix a bug that would show up on IA64 and I believe
alpha too with arrays of double..

> > In the runtime we could implement this by putting
> > __attribute__((aligned (something))) on the `data' field.
> > `something' would be chosen to be maximal alignment for the platform.
> > Maybe just `8' would suffice for now.
> 
> That'll waste 4 bytes on x86.

And it looks like it wouldn't be possible:

As far as typeck.c:build_java_array_type() BIGGEST_FIELD_ALIGNMENT
turns out to be 32 bits on x86. But it isn't defined on Alpha. Note
that on alpha we align the `data' on 32 bits.

So maybe we should simply use __attribute ((aligned)) which goes for
the largest alignment and make sure the compiler align the same way.

./A



More information about the Java mailing list