This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: integer*8 parsing problem
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: fortran at gcc dot gnu dot org
- Date: Thu, 26 Aug 2004 23:29:27 -0400
- Subject: Re: integer*8 parsing problem
- References: <20040823232516.GA27374@twiddle.net>
The change to gfc_conv_mpz_to_tree has caused the 19990313-N.f
testsuite regressions on PowerPC systems. On PowerPC, mp_limb_t is 32
bits and HOST_WIDE_INT is 64 bits. Limbs are stored little endian, but
the extraction function using mpz_getlimbn shifts the lowest numbered limb
into the most significant word for each HOST_WIDE_INT.
for (low = n = 0; n < count; ++n)
{
low <<= shift;
low |= mpz_getlimbn (i, n);
}
Did you consider using mpz_export instead of extracting the limbs
explicitly for the various cases of mp_limb_t and HWI? For example,
HOST_WIDE_INT buf[2];
mpz_export (buf, NULL, 1, HOST_BITS_PER_WIDE_INT / CHAR_BIT,
1, 0, i);
low = buf[0];
high = buf[1];
or iterating from count-1 to 0?
David