gmp compile bug

Torbjorn Granlund tege at
Tue Apr 25 13:07:27 CEST 2006

Eric Bonnet <eric.bonnet at> writes:

  I got an error while trying to compile the latest gmp library on a 
  sun20z AMD Opteron system (gcc version is showed below)
  Linux  2.4.21-40.ELsmp #1 SMP Thu Feb 2 22:13:55 EST 2006 x86_64 x86_64
  x86_64 GNU/Linux
  Thanks for yout help,
  -- Eric
  PASS: t-cmp_d
  mpf_cmp_si wrong on data[6]
     a=-0.1e1 (-1)
     b=1 (1)
  FAIL: t-cmp_si

  [root at werewulf gmp-4.2]$ gcc -v
  Reading specs from /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/specs
  Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
  --infodir=/usr/share/info --enable-shared --enable-threads=posix 
  --disable-checking --with-system-zlib --enable-__cxa_atexit 
  Thread model: posix
  gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-54)

This is almost surely a compiler bug.  I cannot verify that, since I
don't have the compiler version used.

Please either iterate over GCC releases until you find one that works,
or iterate over optimization options with the used compiler.

The GMP 4.2 testsuite should catch almost all miscompilations, but
some GMP-related miscompilations happen in user code, in the context
of inlined GMP functions.

I've found it necessary to keep many GCC releases installed in
parallel.  The first thing I do when seeing unexpected behaviour from
a program, is trying a different compiler.

(This particular GCC bug should not be blamed on the GCC team; the
x86_64 wasn't even supported in 3.2.3.  Apparently, Red Hat is


More information about the gmp-bugs mailing list