]> 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>
Wed, 31 Jan 2024 16:47:05 +0000 (17:47 +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 f372fd14c688f5d76f90ad2ac47f781d3616a9fb..d36c0418526e443bbcc84be86cd045c7d4a65cc7 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 be1169d56dedc2807326b7ae23761303f4fafc6e..4528c9596adbd39bae46668756bb43fc35fb286b 100644 (file)
@@ -1,4 +1,4 @@
-# fenv-exceptions-state.m4 serial 2
+# fenv-exceptions-state.m4 serial 2.1
 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