gmp 5.1.0, gcc 4.2.4, x86_64 Linux: make check 5 of 62 tests failed

Eric Branlund eric at
Fri Jan 17 03:12:16 UTC 2014

This is likely a problem in the compiler rather than gmp.  I'm  
reporting it since it had a different pattern of test failures than  
reports I could find in a web search and might affect someone else  
trying to build gmp on an old version of Linux in order to build a  
modern version of gcc.

GMP version:
gmp 5.1.0 compiled from source without patches.

Test program:
The tests, t-fac_ui, t-mfac_uiui, t-primorial_ui, t-hamdist, and t- 
popcount, from tests/mpz in the gmp distribution failed.

What is wrong:
Ran the following to configure, compile, and check gmp 5.1.0:

		CC=/home/eric/extern/gcc-4.2.4-glibc2.3-x86_64/bin/gcc4.2 ./ 
configure \
		make check

The last step failed in tests/mpz.  The messages from the tests that  
failed were

GNU MP: Cannot allocate memory (size=6148914691236517072)
FAIL: t-fac_ui

GNU MP: Cannot allocate memory (size=6148914691236517200)
FAIL: t-mfac_uiui

mpz_primorial_ui(191) wrong
FAIL: t-primorial_ui

mpz_hamdist wrong on 2 bits pos/pos
   i    0
   j    64
   got  1
   want 2
   x   =0x1
   y   =0x10000000000000000
FAIL: t-hamdist

mpz_popcount wrong on single bit at 0
    got 72, want 1

Configure output:
I've attached it as configure_stdout.txt.

/home/eric/extern/gcc-4.2.4-glibc2.3-x86_64/bin/gcc4.2 -v reports:

Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /var/tmp/gcc-4.2.4/configure --prefix=/home/eric/ 
2.4-glibc2.3-x86_64 -program-suffix=4.2
Thread model: posix
gcc version 4.2.4

uname -a reports

Linux localhost.localdomain 2.4.21-50.EL #1 SMP Mon Jun 11 17:25:39  
EDT 2007
x86_64 x86_64 x86_64 GNU/Linux

./config.guess reports


sh configfsf.guess reports


It is the x86_64 version of CentOS 3.9 running in a virtual machine  
(Parallels Desktop 4.0 on top of Mac OS X 10.5.8).  The processor is  
an Intel Core 2 Duo.

Removing mpn/x86_64core2/popcount.asm prior to running configure,  
make, and make check allowed make check to complete with all tests  

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: configure_stdout.txt
URL: <>
-------------- next part --------------

More information about the gmp-bugs mailing list