bug in t-perfpow for mingw64
tg at gmplib.org
Mon Sep 13 18:21:46 CEST 2010
Alexander Maly <a.a.maly at gmail.com> writes:
gmp-5.0.1 "Current performance release"
Test program is tests/mpz/t-perfpow.c in the source tree.
It reports "n was destroyed, but perfpow_p still believes n is a perfect
N is really the perfect power. What is wrong - when function 'check_random'
tries to "destroy" n,
that is to make powers for primes to be with gcd=1, it calls internal
function 'mpn_gcd_1', giving it (as the first argument) pointer to the
variable g, that is defined to be unsigned long int. But mpn_gcd_1 requies a
pointer to the mp_limb_t, that is 64-bit wide. So I guess in mingw64 long is
32-bit wide, that is quite unusual for 64-bit ABI. Correcting the variable g
type definition to mp_limb_t makes the test pass well.
Please try the patch from the status section of the GMP webpage:
More information about the gmp-bugs