[Patch] Fix bad code in constant pool that effects MIPS n32 ABI.

David Daney ddaney@avtrex.com
Fri Nov 16 22:00:00 GMT 2007


When testing libgcj with mips64/n32 I was getting FAILures on the
majority of the -findirect-dispatch tests.  This was caused by bad code
in the constant pool that only effects big-endian targets with
BITS_PER_WORD > 32 and POINTER_SIZE == 32.  As far as I know mips64/n32
is the only ABI that fits these criteria.

The root of the problem is that we have to calculate where to place a 32
bit value in a union of a pointer and a 32 bit int.  For big-endian
systems with 64 bit pointers the value must be shifted so that it can be
read out of the 32 bit int.  The calculation that was doing this
erroneously assumed that BITS_PER_WORD == POINTER_SIZE.  The fix is to
use POINTER_SIZE for the calculation.

Spot checked on mips64/{n32/n64} and fully regression tested on
x86_64-pc-linxu-gnu with both native and -m32 ABIs.

OK to commit?

2007-11-16  David Daney  <ddaney@avtrex.com>
        Andrew Haley  <aph@redhat.com>

    * constants.c (build_constants_constructor):  Use POINTER_SIZE
    insead of BITS_PER_WORD in big-endian work around.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: java-constants.diff
Type: text/x-patch
Size: 962 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20071116/5b6f911e/attachment.bin>


More information about the Java-patches mailing list