Make check fails with Intel C compiler

Torbjorn Granlund tege at
Fri Dec 23 11:23:08 CET 2005

Roberto Bagnara <bagnara at> writes:

  With the very last version of the Intel C compiler (9.0.30)
  make check fails for GMP 4.1.4.  The only test that fails
  is t-mul.  Here is the crucial point:
  make[3]: Leaving directory `/usr/local/distrib/objdir/tests/mpz'
  make  check-TESTS
  make[3]: Entering directory `/usr/local/distrib/objdir/tests/mpz'
  PASS: t-addsub
  PASS: t-cmp
  ERROR: incorrect plain product in test 23
  op1          = 7E000018003FFFFFFF
  op2          = 7FFFFFE0000000000FFFFFFFFE0
       product  = 3EFFFFFC401FFCFFFF6000019F07FFFFCFEF800000020
  ref_product  = 3EF82FFC3E9FFCFFFF6000019F07FFFFCFEF800000020
  /bin/sh: line 1:   963 Aborted                 ${dir}$tst
  FAIL: t-mul
  PASS: t-mul_i
  PASS: t-export
  1 of 53 tests failed
  make[3]: *** [check-TESTS] Error 1
  make[3]: Leaving directory `/usr/local/distrib/objdir/tests/mpz'
  make[2]: *** [check-am] Error 2
  make[2]: Leaving directory `/usr/local/distrib/objdir/tests/mpz'
  make[1]: *** [check-recursive] Error 1
  make[1]: Leaving directory `/usr/local/distrib/objdir/tests'
  make: *** [check-recursive] Error 1
  What could I do to help locating the cause of the problem?
  Best wishes,
It is usually possible to get a clean build at a lower optimization
level.  You may force that using "configure CFLAGS=...".
If you can include debugging information (-g?) here, it helps later.

Then you want to locate the file which is miscompiled (or buggy!).
Using a good build, by compiling suspect files at the problematic
optimization level, e.g.,

cd your-builddir
icc -O2 -I.-ISRCPATH/gmp-4.1.4 SRCPATH/gmp-4.1.4/tests/mpz/t-mul.c tests/.libs/libtests.a .libs/libgmp.a

Then run the results to see if you can reproduce the bug.  I
suspect tests/mpz/t-mul.c or mpn/generic/mul.c or
mpn/generic/mul_n.c are miscompiled.  It is the ref_product above
which is incorrect.  Fortunately, you have a vary small test case.

Once you have found the problematic file, you need to isolate the
problem.  That is best done with a debugger, if the optimization
level allowed useful debugging information.  Else you need printf.

(If you get stuck, perhaps somebody else could help you.  They
might need to know what type of system you're using.)


More information about the gmp-discuss mailing list