From: Bruno Haible Date: Tue, 7 Nov 2023 01:04:47 +0000 (+0100) Subject: fenv-exceptions-tracking-c99: Fix test failures on OpenBSD/mips64. X-Git-Tag: v1.0~633 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=80028c70694e049f7dff9aec6888daf86d556106;p=gnulib.git fenv-exceptions-tracking-c99: Fix test failures on OpenBSD/mips64. * m4/fenv-exceptions-tracking.m4 (gl_FENV_EXCEPTIONS_TRACKING): On OpenBSD/mips, set REPLACE_FECLEAREXCEPT to 1. * doc/posix-functions/feclearexcept.texi: Mention the OpenBSD/mips64 bug. * m4/fenv-exceptions-state.m4 (gl_FENV_EXCEPTIONS_STATE): No need to set gl_cv_func_fesetexceptflag_works1 to 'no' on OpenBSD/mips. --- diff --git a/ChangeLog b/ChangeLog index 1806fe19de..7fd78a2bd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2023-11-06 Bruno Haible + + fenv-exceptions-tracking-c99: Fix test failures on OpenBSD/mips64. + * m4/fenv-exceptions-tracking.m4 (gl_FENV_EXCEPTIONS_TRACKING): On + OpenBSD/mips, set REPLACE_FECLEAREXCEPT to 1. + * doc/posix-functions/feclearexcept.texi: Mention the OpenBSD/mips64 + bug. + * m4/fenv-exceptions-state.m4 (gl_FENV_EXCEPTIONS_STATE): No need to set + gl_cv_func_fesetexceptflag_works1 to 'no' on OpenBSD/mips. + 2023-11-06 Bruno Haible nan: Defeat clang's incorrect -O2 optimization on mips64. diff --git a/doc/posix-functions/feclearexcept.texi b/doc/posix-functions/feclearexcept.texi index 4df9178c30..a553371abe 100644 --- a/doc/posix-functions/feclearexcept.texi +++ b/doc/posix-functions/feclearexcept.texi @@ -13,7 +13,7 @@ This function is missing on some platforms: FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, IRIX 6.5, Solaris 9, Cygwin 1.7.7, MSVC 9, Android 4.4. @item This function is broken on some platforms: -Minix 3.3/i386. +OpenBSD 7.4/mips64, Minix 3.3/i386. @end itemize Portability problems not fixed by Gnulib: diff --git a/m4/fenv-exceptions-state.m4 b/m4/fenv-exceptions-state.m4 index 3cd09edd11..239adedba0 100644 --- a/m4/fenv-exceptions-state.m4 +++ b/m4/fenv-exceptions-state.m4 @@ -1,4 +1,4 @@ -# fenv-exceptions-state.m4 serial 1 +# fenv-exceptions-state.m4 serial 2 dnl Copyright (C) 2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -89,7 +89,17 @@ AC_DEFUN([gl_FENV_EXCEPTIONS_STATE], ]]) ], [gl_cv_func_fesetexceptflag_works1=yes], - [gl_cv_func_fesetexceptflag_works1=no], + [dnl On OpenBSD 7.4/mips64 this test fails because feclearexcept + dnl is buggy, not because of fesetexceptflag. + case "$host" in + mips*-*-openbsd*) + gl_cv_func_fesetexceptflag_works1="guessing yes" + ;; + *) + gl_cv_func_fesetexceptflag_works1=no + ;; + esac + ], [case "$host_os" in # Guess yes or no on glibc systems, depending on CPU. *-gnu*) diff --git a/m4/fenv-exceptions-tracking.m4 b/m4/fenv-exceptions-tracking.m4 index d5c384c9cb..4861cdc0e1 100644 --- a/m4/fenv-exceptions-tracking.m4 +++ b/m4/fenv-exceptions-tracking.m4 @@ -1,4 +1,4 @@ -# fenv-exceptions-tracking.m4 serial 3 +# fenv-exceptions-tracking.m4 serial 4 dnl Copyright (C) 2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -118,6 +118,11 @@ AC_DEFUN_ONCE([gl_FENV_EXCEPTIONS_TRACKING], dnl 'fnstenv' instruction without subsequent 'fldenv' or 'fldcw'). REPLACE_FETESTEXCEPT=1 ;; + mips*-*-openbsd*) + dnl On OpenBSD 7.4/mips64, the feclearexcept function does not work: + dnl it misses to clear the "cause bits". + REPLACE_FECLEAREXCEPT=1 + ;; *86*-*-minix*) dnl On Minix 3.3, both the feclearexcept and fetestexcept functions dnl need to be overridden; otherwise we get unit test failures.