]> Savannah Git Hosting - gnulib.git/commitdiff
fenv-exceptions-state-c99: Fix for FreeBSD/powerpc64 and NetBSD/powerpc.
authorBruno Haible <bruno@clisp.org>
Fri, 19 Jan 2024 21:34:27 +0000 (22:34 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 19 Jan 2024 21:34:27 +0000 (22:34 +0100)
* m4/fenv-exceptions-state.m4 (gl_FENV_EXCEPTIONS_STATE): On
FreeBSD/powerpc64 and NetBSD/powerpc, set REPLACE_FESETEXCEPTFLAG.
* doc/posix-functions/fesetexceptflag.texi: Mention the FreeBSD and
NetBSD bug.

ChangeLog
doc/posix-functions/fesetexceptflag.texi
m4/fenv-exceptions-state.m4

index 6901b278f13ca08fed40601c7fc9d4abd56ec4d3..04ecfec9047d7f88037e0a93ba3e647bdba40c1a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2024-01-19  Bruno Haible  <bruno@clisp.org>
 
+       fenv-exceptions-state-c99: Fix for FreeBSD/powerpc64 and NetBSD/powerpc.
+       * m4/fenv-exceptions-state.m4 (gl_FENV_EXCEPTIONS_STATE): On
+       FreeBSD/powerpc64 and NetBSD/powerpc, set REPLACE_FESETEXCEPTFLAG.
+       * doc/posix-functions/fesetexceptflag.texi: Mention the FreeBSD and
+       NetBSD bug.
+
        fenv-*: Avoid test failures on FreeBSD/powerpc64 and NetBSD/powerpc.
        On these platforms, FE_ALL_EXCEPT contains additional bits.
        * tests/test-fenv-except-tracking-1.c (FE_VXSOFT, FE_VXZDZ): Define
index 7a3971a3a595ef165063ca6626c6241f9a251ca3..065877e9ce2d4330b968fb21e31245e802c4df66 100644 (file)
@@ -23,6 +23,9 @@ This function clears too many floating-point exception flags on
 @c https://sourceware.org/bugzilla/show_bug.cgi?id=30998
 glibc 2.37/alpha.
 @item
+This function loses the @code{FE_INVALID} flag on
+FreeBSD 14.0/powerpc64, NetBSD 9.3/powerpc.
+@item
 This function is also buggy on
 @c Without the override, the unit test test-fenv-except-state-1 fails.
 AIX 7.3.1.
index 02545184960e6f24afe1fc7b768da093c400a17e..7333daf53c21b73d71fe249153153b9f18610bb6 100644 (file)
@@ -1,4 +1,4 @@
-# fenv-exceptions-state.m4 serial 3
+# fenv-exceptions-state.m4 serial 4
 dnl Copyright (C) 2023-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -195,10 +195,21 @@ changequote([,])dnl
         *yes) ;;
         *) REPLACE_FESETEXCEPTFLAG=1 ;;
       esac
+      dnl Additionally, on FreeBSD/powerpc64 and NetBSD/powerpc, the unit test
+      dnl test-fenv-except-state-2 fails if we don't override fesetexceptflag.
+      dnl The function fesetexceptflag apparently fails to restore the
+      dnl FE_INVALID flag.
+      case "$host" in
+        powerpc*-*-freebsd* | powerpc*-*-netbsd*)
+          REPLACE_FESETEXCEPTFLAG=1
+          ;;
+      esac
       dnl Additionally, on AIX, the unit test test-fenv-except-state-1 fails
       dnl if we don't override fesetexceptflag.
       case "$host" in
-        powerpc*-*-aix*) REPLACE_FESETEXCEPTFLAG=1 ;;
+        powerpc*-*-aix*)
+          REPLACE_FESETEXCEPTFLAG=1
+          ;;
       esac
       dnl Additionally, on MSVC, we want the bits in the saved state to be
       dnl identified by the FE_* macros, so that the fetestexceptflag function