Compiler and C library bugs revealed by MPFR
- a bug in 32-bit sparc gcc 2.95.2, when a "double" is passed as last
argument of a C function, which produced Bus errors. Reported in
revision 1949 of MPFR by Vincent Lefèvre (files tadd.c and tmul.c)
- a bug in GCC on m68040-unknown-netbsd1.4.1, where DBL_MIN gives
(1-2^(-52))/2^1022, reported by Paul Zimmermann in revision 2218 of
MPFR (file tget_d.c)
- optimization bug of GCC 3.3 on Alpha with long double, reported by Paul Zimmermann
with revision 2542 of MPFR
- bug in LONG_MIN / 1 under FreeBSD (this is a bug of the
C library of FreeBSD 5.20 on Alpha with GCC 3.3.3), reported by
Patrick Pélissier in revision
2982 of MPFR [see also this]
- a compiler bug found on Linux/m68k with GCC 4.0.2, reported by
Vincent Lefèvre, found in revision 3945 of MPFR (file tcbrt.c)
- 27116
bug of GCC 4.2 reported by Martin
Michlmayr when compiling MPFR 2.2.0
- bug of the Sun C compiler under Solaris/x86, reported by Emil Mikulic
(affects Sun C 5.8 2005/10/13, Sun C 5.8 Patch 121016-02 2006/03/31,
and Sun C 5.8 Patch 121016-04 2006/10/18)
- 36296
bug of GCC 4.3.0 reported by Paul Zimmermann when compiling MPFR 2.3.1
(no real bug, but false positive warning)
- 36299:
a false warning issued by GCC 4.2+, reported by Vincent Lefèvre in
revision 5585 of MPFR
- 39867
bug of GCC 4.4.0 reported by Philippe Théveny when testing the MPFR
trunk (does not affect MPFR 2.4.1, but MPFR 2.4.2)
- 40757
revealed when testing MPFR 2.4.1 on some Solaris machines with GCC 4.4.0
(this is in
fact a bug of the Solaris memset function) reported by
David Kirkby
[end of story]
- bug with gcc 3.3.2 in AIX 6.1, where "make check" from mpfr 2.4.2 fails,
but succeeds with gcc 3.3.2 in AIX 5.3 [reported by Anil Kumar A. V.]
- bug with GCC 4.5.2 on powerpc-ibm-aix4.3.2.0
[reported by Daniel Richard G.]
- bug with the Sun C compiler with the -xO3 optimization level
on sparc/Solaris, reported by Maciej Blizinski on August 3, 2011
[affects Sun C 5.9 SunOS_sparc Patch 124867-16 2010/08/11]
- a bug with GCC 4.3.2 (and 4.4.1) was found while testing MPFR 3.1.0-rc1
on gcc54.fsffrance.org (UltraSparc IIe under Debian) with
--enable-thread-safe (the problem lies in the agm.c file,
and disappears with -O1 or with --disable-thread-safe.)
- a bug in the initialisation of Thread Local Storage variables in shared
libraries on FreeBSD 8.2 (still present in GCC trunk amd64-*-freebsd9.0)
was found with MPFR 3.1.0 [reported by Alex
Dupre], see #161344.
- #50683,
a bug with Thread Local Storage variables with GCC 4.6.1
on sparc64 was found with MPFR 3.1.0 on Debian [reported by Laurent
Fousse]. This appears to be a
linker bug, fixed in binutils 2.22.
- #50691,
a bug with Thread Local Storage variables with GCC 4.4.6
on hppa-unknown-linux-gnu was found with MPFR 3.1.0 [reported by
John David Anglin].
- LLVM/clang 2.9
miscompiles MPFR 3.1.0 on x86_64-apple-darwin11, the
problem disappears with --disable-thread-safe
[reported by Jack Howarth and David Fang]
- a libtool bug was found while testing MPFR 3.1.0 on HP-UX [reported by
John David Anglin]
- William Bader found a bug with TLS support on a 32 bit 2.80GHz
Intel Xeon with GNU ld version 2.15.92.0.2 20040927 while testing
MPFR 3.1.0 (this happens on RH Linux 7.1, RH Linux 9, and CentOS 4.9
(with GNU ld version 2.15.92.0.2 20040927)
not on Fedora 14, both with gcc 4.6.2 and 3.4.6, and also with -O0).
See this thread.
- Vincent Lefèvre found a bug in gcc-snapshot when trying to compile
MPFR 3.1.0-p4 on AMD64:
#650277
- Vincent Lefèvre found a bug in tcc 0.9.26~git20120104.83d57c0-4
when trying to compile MPFR 3.1.0: see
1
and 2.
He also found an issue with dependency tracking under Debian,
and also with -rpath.
- #52939:
David Binderman found
a bug in GCC snapshot 20120407-1 (internal compiler error:
Segmentation fault) when compiling set_f.c. The error is in
GCC internal function supportable_widening_operation.
See Debian bug report.
- bug 679123: Vincent Lefèvre found a bug in tcc
(Incorrect shift result type with 64-bit ABI) while testing the development
version of MPFR.
- Daniel Richard G.
found a bug in the vendor C compiler (HP92453-01 A.11.01.20, with
linker 92453-07 ld B.11.53 060322)
on hppa2.0w-hp-hpux11.00, where with +O2 the double constant
9223372036854775808 (263) is converted to the uint64_t
constant 9223372036854775807 instead of 9223372036854775808.
Also, it drops the high 32 bits of a 64-bit hexadecimal integer literal
if the ULL type suffix is not given.
- Jean-Pierre Flori found a bug in the Cygwin toolchain while
trying to compile MPFR 3.1.1 on Cygwin 1.7.15 with GCC 4.5.3.
- #686231, an internal compiler error (Segmentation fault) with the dragonegg plugin
of llvm-gcc found by Vincent Lefèvre while trying to build GNU MPFR.
- François Bissey had a failure with tset_ld with MPFR 3.1.2 using
xlc on a Power7 processor, which is using the double-double format for
the long double type. This reveals several issues:
wrong
value of LDBL_EPSILON.
- Rob (Sisyphus) found a bug in GCC _Decimal64 support on powerpc64 with
the mode32 ABI: see bug 58429
- Bug 17381:
Vincent Lefèvre found a bug in clang 3.4.1,
where -fsanitize=undefined gives a false positive [fixed]
- Vincent Lefèvre found a bug with
gcc (Debian 20141118-1) 5.0.0 20141118 (experimental)
[trunk revision 217719] while compiling tests/tget_f.c,
see bug 64016 [fixed]
- Vincent Lefèvre found a bug with
gcc (Debian 20141209-1) 5.0.0 20141209 (experimental)
[trunk revision 218514] while compiling src/set_si_2exp.c,
see bug 64255 [fixed]
- Vincent Lefèvre found a bug with
Debian's gcc-snapshot 20150722-1
while compiling src/fpif.c,
see bug 67077 [fixed]
- Vincent Lefèvre found a bug with
Debian's gcc-snapshot 20160603-1
while compiling src/get_d.c,
see bug 71433 [fixed]
- Vincent Lefèvre found a bug with gcc r244974
while compiling src/tl2b.c,
see bug 79257
- Vincent Lefèvre found a bug with gcc 8.0
while compiling src/turandom.c,
see bug 81981
- Alexander Shevchenko found in December 2015
an internal compiler error in Intel C++ (at least all ICC 2015, 2016,
and early versions of ICC 2017, before the Update 4 release)
while compiling MPFR 4.0.0-dev, see
this thread
- Alexander Shevchenko found in December 2017
a bug in MSVC 2017 with Windows 10 SDK
while testing MPFR 4.0.0-dev, see
this thread
- John Paul Adrian Glaubitz found in January 2018
a bug (ICE) in GCC for PowerPC
while compiling MPFR 4, see
this thread
- in July 2018, Vincent Lefèvre found a bug in GNU libc for the output of integers with a thousands separator [link]
- Vincent Lefèvre found a bug with gcc 9.0.0 20180908
while compiling tests/tstrtofr.c,
see bug 87276
- Vincent Lefèvre found a bug with clang-7 in Debian
while running "make check-gmp-symbols",
see bug 913213
- while testing MPFR 4.0.2,
Dennis Clarke found that the bug in the initialisation of Thread Local Storage variables in shared
libraries in FreeBSD 8.2 (found with MPFR 3.1.0, see above),
has reappeared with FreeBSD 12.0
- Vincent Lefèvre found a bug with gcc, which does not propagate
correctly non-canonical _Decimal64 and _Decimal128 constants,
see bug 91226
- Vincent Lefèvre found a bug with clang 9, where __builtin_constant_p returns 1 instead of 0 when there is a side effect,
see bug 43557
- while updating to MPFR 4.0.2-p1, John David Anglin got a test failure
which happens to be a bug in HP-UX 11.11 formatted output functions
[report]
- Vincent Lefèvre found a bug in GCC-10 analyzer while compiling the
atan.c MPFR source file,
see bug 94732
- in May 2020,
Nelson Beebe found a bug in pgcc (Portland Group compilers) 19.10-0
while testing MPFR's development version (tget_ld_2exp fails because
long double constants near the underflow region are not properly treated)
- in June 2020, Bruno Haible found an internal compiler error in the
Solaris 10 compiler while compiling const_log2.c from MPFR 4.1.0-rc1
- in June 2020, while testing MPFR 4.1.0-rc1, Vincent Lefèvre found an
inconsistency
in GCC's __builtin_constant_p.
- in June 2020, while testing MPFR 4.1.0-rc1, Nelson Beebe found a bug
in the QEMU 5.0.0 compiler for Linux/s390x: see
this and this
- in July 2020, Christian Jullien found a bug in tcc on aarch64, where
tcc uses wrong long-double macros:
bug report
- in July 2020, Christian Jullien found a bug in tcc on aarch64 for the
conversion from double subnormals to long double:
bug report
- in August 2020, Vincent Lefèvre found a bug in ICX 2021.1 Beta 20200715
with the tset_float128 test, which he reduced to the following
bug
- in October 2020, Vincent Lefèvre found a bug in GCC while configuring
MPFR with CFLAGS=-O2 -Wno-error=unused-function -Werror -fanalyzer
[link]
- still in October 2020, Vincent Lefèvre found another bug in GCC
while configuring
MPFR with -fanalyzer
[link]
- in November 2020, Vincent Lefèvre found a bug in GCC
while testing MPFR (incorrect warning due to "volatile")
[link]
- in December 2020, Vincent Lefèvre found a bug in GCC's static
analyzer
while testing MPFR (incorrect -Wanalyzer-shift-count-overflow warning)
[link]
- in June 2021, Vincent Lefèvre found a bug in ICX 2021.2.0 NaN comparison
while testing MPFR
[link]
- in December 2021, Josep Guardia Oliveras found a bug in VCPKG with a
simple MPFR program
(difference between the debug and release versions of VCPKG)
- in July 2022, Vincent Lefèvre found a spurious warning in GCC 12
while testing MPFR
[link]
- in December 2022, while testing mpfr-4.2.0-rc1, Nelson Beebe got an
error in tget_ld_2exp which appeared to be a bug in the
compiler or m68k emulator
- in January 2023, Vincent Lefèvre found a false positive warning in
gcc with -O1 or higher [link]
- some users reported a failing test (tsprintf) in MPFR 4.2.0, which
revealed a bug in GNU libc 2.37 (CVE-2023-25139)
[link]
- In May 2023, Dennis Clarke found a bug while testing MPFR 4.2.0 on an IBM Power 9, which was analyzed by Matthew Wilson and turned out to be due to an issue when
-mfull-toc is used: details
- in September 2024, Vincent Lefèvre found with MPFR configure script
an incorrect warning in
gcc with conversion from int to Decimal 64 [link]