+2026-05-27 Bruno Haible <bruno@clisp.org>
+
+ fma: Work around glibc 2.43 regression.
+ * m4/fma.m4 (gl_FUNC_FMA_WORKS): Check against glibc 2.43 bug.
+ * doc/posix-functions/fma.texi: Mention glibc 2.43 as being buggy.
+
2026-05-26 Paul Eggert <eggert@cs.ucla.edu>
libgmp-mpz: pacify -Wuseless-cast
FreeBSD 5.2.1, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, Solaris 9, MSVC 9.
@item
This function produces wrong results on some platforms:
-glibc 2.11, Mac OS X 10.5, FreeBSD 6.4/x86, NetBSD 8.0, OpenBSD 7.4/arm64, Cygwin 1.5, mingw.
+@c https://sourceware.org/bugzilla/show_bug.cgi?id=34183
+glibc 2.43,
+Mac OS X 10.5, FreeBSD 6.4/x86, NetBSD 8.0, OpenBSD 7.4/arm64, Cygwin 1.5, mingw.
@end itemize
Portability problems not fixed by Gnulib:
# fma.m4
-# serial 9
+# serial 10
dnl Copyright (C) 2011-2026 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_SUBST([FMA_LIBM])
])
-dnl Test whether fma() has any of the 7 known bugs of glibc 2.11.3 on x86_64.
+dnl Test whether fma() has any of the 7 known bugs of glibc 2.11.3 on x86_64
+dnl and the 1 known bug of glibc 2.43 on x86_64.
AC_DEFUN([gl_FUNC_FMA_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
therefore the rounding must round down and produce (2^53 - 2^0). */
volatile double expected = ldexp (1.0, DBL_MANT_DIG) - 1.0;
volatile double result = my_fma (x, y, z);
+ if (result != expected)
+ failed_tests |= 8;
+ }
+ /* This test fails on glibc 2.43 on x86_64.
+ <https://sourceware.org/bugzilla/show_bug.cgi?id=34183> */
+ {
+ volatile double x = 1.0 + 1.0 / (double) (1U << 21); /* 2^0 + 2^-21 */
+ volatile double y = x; /* 2^0 + 2^-21 */
+ volatile double z = (double) (1U << 11); /* 2^11 */
+ /* x * y + z with infinite precision: 2^11 + 2^0 + 2^-20 + 2^-42.
+ Lies between (2^11 + 2^0 + 2^-20) and (2^11 + 2^0 + 2^-20 + 2^-41).
+ By the round-to-even rule, the rounding must round down and produce
+ (2^11 + 2^0 + 2^-20). */
+ volatile double expected = 2049.00000095367431640625;
+ volatile double result = my_fma (x, y, z);
if (result != expected)
failed_tests |= 16;
}