gmp-4.2 check failure with experimental gcc
martin at MPA-Garching.MPG.DE
Thu Apr 27 12:08:10 CEST 2006
when gmp-4.2 is compiled with the current experimental version of gcc 4.2
on a Pentium 4 (pentium4-pc-linux-gnu/i686-pc-linux-gnu),
the test t-mul in the mpz/ directory fails:
ERROR: incorrect plain product in test 53
op1 = -FFFFFFFFFFFFFFFFFFFFFFFFF...0000000000000000000000000 
op2 = 1FFFFFFFFFFFFFFFFFFFFFFFF...FFFFFFFFFFFFFFFFFFFFFFFFF 
product = -61EDD19F23160438880BD99C5...-6701F030DAFAEAD82176BAB51 
ref_product = -1FFFFFFFFFFFFFFFFFFFFFFFF...0000000000000000000000000 
GMP was configured and compiled with a simple "./configure; make; make check"
This problem does not occur with gcc 4.1 and the head of the gcc 4.1-branch.
It appears to be related to processor-specific optimisation; the minimum set
of optimisation flags which trigger the bug appears to be "-O1 -march=pentium4".
Since it is very likely that this is a bug in gcc and not in GMP, I filed a bug report
On the other hand, the gcc developers would like to see a standalone testcase
that demonstrates the bug, which is very hard for me to provide, since I'm not
familiar with GMP at all. Could you please give me a hint from which GMP files
this particular test case depends, so that I can try to build a single-file
testcase? Or do you have an idea how this could be done more easily?
Thanks in advance,
More information about the gmp-bugs