Problem: -------- - Test of gmp fails for t_import, because of bad loop-optimizations from gcc --- PASS: t-io_raw PASS: t-import wrong result data at data[0] align=0 src "0" src=0x0 order=1 size=1 endian=1 nail=0 want count 0 got count 0 want got /bin/sh: line 4: 31526 Aborted ${dir}$tst FAIL: t-export PASS: t-pprime_p ================================== 1 of 56 tests failed Please report to gmp-bugs@swox.com ================================== make[4]: *** [check-TESTS] Error 1 make[4]: Leaving directory `/var/tmp/portage/dev-libs/gmp-4.2.1-r1/work/gmp-4.2.1/tests/mpz' make[3]: *** [check-am] Error 2 make[3]: Leaving directory `/var/tmp/portage/dev-libs/gmp-4.2.1-r1/work/gmp-4.2.1/tests/mpz' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/var/tmp/portage/dev-libs/gmp-4.2.1-r1/work/gmp-4.2.1/tests' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/dev-libs/gmp-4.2.1-r1/work/gmp-4.2.1' make: *** [check] Error 2 !!! ERROR: dev-libs/gmp-4.2.1-r1 failed. Call stack: ebuild.sh, line 1621: Called dyn_test ebuild.sh, line 1033: Called qa_call 'src_test' ebuild.sh, line 44: Called src_test ebuild.sh, line 655: Called die !!! Make check failed. See above for details. --- Steps to reproduce: ------------------- - use "-funroll-loops" or "-O3" in your CFLAGS->make.conf - FEATURES="test" emerge gmp
Fix: ---- Use the Warning of gcc for unsafe loop optimizations in CFLAGS->make.conf, one of my CFLAGS looks like: "-floop-optimize2 -fomit-frame-pointer -funroll-loops -march=pentium3 -msse -O3 -pipe -Wunsafe-loop-optimizations" from "man gcc": --- -funsafe-loop-optimizations If given, the loop optimizer will assume that loop indices do not overflow, and that the loops with nontrivial exit condition are not infinite. This enables a wider range of loop optimizations even if the loop optimizer itself cannot prove that these assumptions are valid. Using -Wunsafe-loop-optimizations, the compiler will warn you if it finds this kind of loop." ---