integer*8 parsing problem

David Edelsohn dje@watson.ibm.com
Fri Aug 27 03:29:00 GMT 2004


	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



More information about the Fortran mailing list