/
githubmirror
/
mpfr
Обзор
Документация
Войти
/
githubmirror
/
mpfr
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
doc/workarounds
149 строк
6 KB
Vincent Lefevre
New doc/workarounds file about workarounds for toolchain bugs, etc.
05 июл 2023, 16:37
05 июл 2023, 16:37
68aa9d5
Код
Авторство
О чём код?
GNU MPFR may contain workarounds for toolchain bugs and portability issues. When these issues disappeared (by a fix or code removal) a long time ago, such workarounds may be removed in order to make the code cleaner. To keep some trace, information on these bugs should be mentioned in this file. Current workarounds may also be listed here in order to remember to check whether they are still needed. ------------------------------------------------------------------------ Bug in GCC 2.95.2 on 32-bit SPARC. Affected files: tests/tadd.c tests/tmul.c Workaround: commit c0bac2275a9d7ee12cc2706c812090c356a95ee8 (2002-06-08) Removed in: commit 51a9638d47d006b4895517445ee9e96d5e0d990d (2009-11-26) ------------------------------------------------------------------------ LDBL_MAX and LDBL_MANT_DIG are incorrect on some i386 GCC. Affected files: set_ld.c Workaround: commit 2df47fbe565cacd0afe03a9f696cd4bdf5e1a2aa (2003-01-14) Removed in: commit 761222785afe36f284740e4da9688ee90208b7d6 (2020-04-02) ------------------------------------------------------------------------ On m68040-unknown-netbsd1.4.1, DBL_MIN gives (1-2^(-52))/2^1022. Affected files: tests/tget_d.c Workaround: commit 4e386e7512de2ec3182151d6994bcc7134db027c (2003-01-23) Removed in: commit f0f3fd57aef8c621a00e4871b695b62a70ce5408 (2009-11-26) ------------------------------------------------------------------------ On FreeBSD/Alpha, LONG_MIN/1 produces an exception (code from NetBSD). Affected files: strtofr.c Workaround: commit 3a0e4a337cc3915f3cd6303d66468c8d811933d9 (2004-09-21) Removed in: commit a6109ba189f1dcde8d2a3cc917b7b34ba19b1aa9 (2009-11-26) https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=72024 reported on 2004-09-23, closed on 2004-12-08. Fixed in FreeBSD on 2004-11-27: https://cgit.freebsd.org/src/commit/?id=2909df69164fdc42a2144977c11bedb4031b35e1 Alpha support completely removed from FreeBSD on 2006-08-22: https://cgit.freebsd.org/src/commit/?id=2b46c64c9c1bf1cb194e0f2b7c478f61a0e10cd9 Fixed in NetBSD on 2002-01-24: https://github.com/NetBSD/src/commit/e31435237d4901e810eae5789d70fdacd0c13471 ------------------------------------------------------------------------ -Wmaybe-uninitialized warning from GCC in sub1sp.c Affected files: src/sub1sp.c Workaround: commit d6f09b205f0679f3dd8a80d08bce4202f840dc69 (2016-07-04) Warning silenced with the INITIALIZED() macro. Note: the code has been copied in commit 20f1a2e7b5e3eee59eca3fba3378f209674776cb commit 1ee5442215fd75999db7ebef4f9fb5e019d4714b ("git blame" gives the wrong commit 89690bc1c6 for the last one). A comment was added at the beginning of the file in 2023-01: /* Note: The 3 "INITIALIZED(sh)" occurrences below are necessary to avoid a maybe-uninitialized warning or error, e.g. when configuring MPFR with ./configure --enable-assert CFLAGS="-O2 -Werror=maybe-uninitialized" (a --enable-assert or --enable-assert=full is needed to reproduce the issue). This occurs with GCC 4.9.4, 5.5.0, 6.5.0, 8.4.0, 9.5.0, 10.4.0, 11.3.0 and 12.2.0 under Linux (Debian/unstable). Bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108467 */ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108467 reported on 2023-01-19. ------------------------------------------------------------------------ GCC bug on Sparc, at least when using TLS. Affected files: tests/tests.c (workaround in tests/mpfr-test.h) Workaround: commit 567bc267ed2c8c1c36f1058f8a585c4699747490 (2020-06-29) /* Avoid a GCC bug on Sparc, at least when using TLS. The MPFR library * itself is not affected, only a particular test. Normal code using * the MPFR library should not be affected either, as the bug occurs * when accessing __gmpfr_flags directly (and the public mpfr.h header * file does not provide any macro that accesses an internal variable * directly). So a workaround for the tests is the best solution. * * This bug, which could be observed under Debian with GCC 4.5.3 and * sparc-sun-solaris2.10 with GCC 5.5.0 when TLS and optimizations * are used[*], makes test programs using bad_cases() crash (SIGSEGV) * in this function at: * * if (mpfr_nanflag_p () || mpfr_overflow_p () || mpfr_underflow_p ()) * * Debugging shows that any attempt to access __gmpfr_flags directly * in the loop makes the program crash at this moment. This bug is not * present in the assembly code generated by -S, but is visible after a * normal compilation + link, when tracing the assembly code with gdb. * The workaround is to disable the macros from mpfr-impl.h that access * __gmpfr_flags directly. This bug may have been fixed in more recent * GCC versions, but it is safe to enable this workaround in all GCC * versions. * * [*] This is the default. Disabling TLS or recompiling the tests * without optimizations (-O0) makes the crash disappear. * * Mentions of these crashes: * https://sympa.inria.fr/sympa/arc/mpfr/2011-10/msg00045.html [Debian] * https://sympa.inria.fr/sympa/arc/mpfr/2011-10/msg00055.html [Debian] * https://sympa.inria.fr/sympa/arc/mpfr/2011-12/msg00000.html [Solaris 10] * https://sympa.inria.fr/sympa/arc/mpfr/2011-12/msg00001.html [Solaris 10] * https://sympa.inria.fr/sympa/arc/mpfr/2011-12/msg00002.html * https://sympa.inria.fr/sympa/arc/mpfr/2016-03/msg00061.html [Solaris 10] * https://sympa.inria.fr/sympa/arc/mpfr/2016-03/msg00063.html * https://sympa.inria.fr/sympa/arc/mpfr/2020-06/msg00015.html [Solaris 10] * https://sympa.inria.fr/sympa/arc/mpfr/2020-06/msg00020.html */ #if defined(__GNUC__) && defined (__sparc__) # undef mpfr_underflow_p # undef mpfr_overflow_p # undef mpfr_nanflag_p # undef mpfr_inexflag_p # undef mpfr_erangeflag_p # undef mpfr_divby0_p #endif ------------------------------------------------------------------------ -Wmaybe-uninitialized warning from GCC in tests/tfpif.c Affected files: tests/tfpif.c Workaround: commit 58bfad5b7d98fb55c93e29688cea913c4cd9e595 (2023-06-26) Warning silenced with the INITIALIZED() macro. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106155 reported on 2022-07-01. ------------------------------------------------------------------------