This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR java/25535: gcj broken on 64-bit big-endian systems
- From: Andrew Haley <aph at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 11 Jan 2006 10:03:51 +0000
- Subject: Re: PR java/25535: gcj broken on 64-bit big-endian systems
- References: <17322.57607.853894.581996@zapata.pink> <m3wth73ha8.fsf@localhost.localdomain>
Tom Tromey writes:
> >>>>> "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.
It can't be done: AFAIK a constructor for a union can only initialize
the first element of the union.
Andrew.