This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PR java/25535: gcj broken on 64-bit big-endian systems
- From: Tom Tromey <tromey at redhat dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: 10 Jan 2006 14:27:27 -0700
- Subject: Re: PR java/25535: gcj broken on 64-bit big-endian systems
- References: <17322.57607.853894.581996@zapata.pink>
- Reply-to: tromey at redhat dot com
>>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:
Andrew> BC-compiled code doesn't work on a big-endian 64-bit box
Andrew> because of a silly mistake initializing entries in the
Andrew> constant pool. In all cases the initializer must appear as
Andrew> the first 32-bit integer of a machine word stored in memory.
Andrew> - jword temp = outgoing_cpool->data[i].w;
Andrew> + unsigned HOST_WIDE_INT temp = outgoing_cpool->data[i].w;
Andrew> +
Andrew> + /* Make sure that on a 64-bit big-endian machine this 32-bit
Andrew> + jint appears in the first word. */
Andrew> + if (BYTES_BIG_ENDIAN && BITS_PER_WORD > 32)
Andrew> + temp <<= BITS_PER_WORD - 32;
This is related to PR 18148 -- internally gcj has the wrong type for
itable and some other fields of Class. It seems like it would be more
robust (though more painful) to have the proper declarations inside
gcj and to generate a real union constructor here.
For 4.1 I think the current patch would be appropriate. What do you
think?
Tom