]> Savannah Git Hosting - gnulib.git/commitdiff
fpe-tracking: Remove module.
authorBruno Haible <bruno@clisp.org>
Sun, 5 Nov 2023 13:27:47 +0000 (14:27 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 5 Nov 2023 13:33:55 +0000 (14:33 +0100)
* modules/fpe-tracking: Remove file.
* m4/fpe.m4 (gl_FPE_TRACKING): Remove macro.
(gl_FPE_TRAPPING): Require gl_FENV_EXCEPTIONS_TRACKING instead of
gl_FPE_TRACKING. Use FENV_EXCEPTIONS_TRACKING_LIBM instead of
FPE_TRACKING_LIBM.
* modules/nan-tests (Depends-on): Add fenv-exceptions-tracking-c99.
Remove fpe-tracking.
(Makefile.am): Use FENV_EXCEPTIONS_TRACKING_LIBM instead of
FPE_TRACKING_LIBM.
* modules/snan-tests (Depends-on): Add fenv-exceptions-tracking-c99.
Remove fpe-tracking.
(Makefile.am): Use FENV_EXCEPTIONS_TRACKING_LIBM instead of
FPE_TRACKING_LIBM.
* tests/test-nan-1.c: Assume HAVE_FE_INVALID is 1.
* tests/test-snan-1.c: Likewise.

ChangeLog
m4/fpe.m4
modules/fpe-tracking [deleted file]
modules/nan-tests
modules/snan-tests
tests/test-nan-1.c
tests/test-snan-1.c

index 09555677758fd90f834aeb8060517e4b9cfd0e8c..3b2951ff6e9939ab4e553f8b8cc6f304aa0173b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2023-11-05  Bruno Haible  <bruno@clisp.org>
+
+       fpe-tracking: Remove module.
+       * modules/fpe-tracking: Remove file.
+       * m4/fpe.m4 (gl_FPE_TRACKING): Remove macro.
+       (gl_FPE_TRAPPING): Require gl_FENV_EXCEPTIONS_TRACKING instead of
+       gl_FPE_TRACKING. Use FENV_EXCEPTIONS_TRACKING_LIBM instead of
+       FPE_TRACKING_LIBM.
+       * modules/nan-tests (Depends-on): Add fenv-exceptions-tracking-c99.
+       Remove fpe-tracking.
+       (Makefile.am): Use FENV_EXCEPTIONS_TRACKING_LIBM instead of
+       FPE_TRACKING_LIBM.
+       * modules/snan-tests (Depends-on): Add fenv-exceptions-tracking-c99.
+       Remove fpe-tracking.
+       (Makefile.am): Use FENV_EXCEPTIONS_TRACKING_LIBM instead of
+       FPE_TRACKING_LIBM.
+       * tests/test-nan-1.c: Assume HAVE_FE_INVALID is 1.
+       * tests/test-snan-1.c: Likewise.
+
 2023-11-05  Bruno Haible  <bruno@clisp.org>
 
        fenv-exceptions-trapping: Avoid test failure on NetBSD/sparc.
index f8a81030a6176a5f0f588ffd85269b9b4de67b77..94ca0d5cc170528e056ee1737a74a607c2a053ea 100644 (file)
--- a/m4/fpe.m4
+++ b/m4/fpe.m4
@@ -1,50 +1,9 @@
-# fpe.m4 serial 1
+# fpe.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,
 dnl with or without modifications, as long as this notice is preserved.
 
-# Prerequisites for tracking FE_INVALID exceptions.
-AC_DEFUN_ONCE([gl_FPE_TRACKING],
-[
-  AC_CACHE_CHECK([whether FE_INVALID exceptions can be tracked],
-    [gl_cv_fenv_invalid_api],
-    [AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-          [[#include <fenv.h>
-          ]],
-          [[feclearexcept (FE_INVALID);
-          ]])
-       ],
-       [gl_cv_fenv_invalid_api=yes],
-       [gl_cv_fenv_invalid_api=no])
-    ])
-  if test $gl_cv_fenv_invalid_api = yes; then
-    AC_DEFINE([HAVE_FE_INVALID], [1],
-      [Define if FE_INVALID exceptions can be programmatically tracked.])
-    AC_CACHE_CHECK([whether feclearexcept can be used without linking with libm],
-      [gl_cv_func_feclearexcept_no_libm],
-      [AC_LINK_IFELSE(
-         [AC_LANG_PROGRAM(
-            [[#include <fenv.h>
-            ]],
-            [[feclearexcept (FE_INVALID);
-            ]])
-         ],
-         [gl_cv_func_feclearexcept_no_libm=yes],
-         [gl_cv_func_feclearexcept_no_libm=no])
-      ])
-    if test $gl_cv_func_feclearexcept_no_libm != yes; then
-      FPE_TRACKING_LIBM=-lm
-    else
-      FPE_TRACKING_LIBM=
-    fi
-  else
-    FPE_TRACKING_LIBM=
-  fi
-  AC_SUBST([FPE_TRACKING_LIBM])
-])
-
 # Prerequisites for turning FE_INVALID exceptions into a SIGFPE signal.
 AC_DEFUN_ONCE([gl_FPE_TRAPPING],
 [
@@ -109,7 +68,7 @@ AC_DEFUN_ONCE([gl_FPE_TRAPPING],
       fi
     fi
   fi
-  AC_REQUIRE([gl_FPE_TRACKING])
-  FPE_TRAPPING_LIBM="$FPE_TRAPPING_LIBM $FPE_TRACKING_LIBM"
+  AC_REQUIRE([gl_FENV_EXCEPTIONS_TRACKING])
+  FPE_TRAPPING_LIBM="$FPE_TRAPPING_LIBM $FENV_EXCEPTIONS_TRACKING_LIBM"
   AC_SUBST([FPE_TRAPPING_LIBM])
 ])
diff --git a/modules/fpe-tracking b/modules/fpe-tracking
deleted file mode 100644 (file)
index d1afcf9..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Description:
-Tracking floating-point exceptions, i.e. determining whether
-a floating-point exception has occurred during a certain computation.
-
-Files:
-m4/fpe.m4
-
-Depends-on:
-
-configure.ac:
-gl_FPE_TRACKING
-
-Makefile.am:
-
-Include:
-#if HAVE_FE_INVALID
-# include <fenv.h>
-#endif
-
-Link:
-$(FPE_TRACKING_LIBM)
-
-License:
-GPL
-
-Maintainer:
-all
index 607e35f63be20490f501f3a0a7a11cf6203ca7a1..ec549b8919e42922bf161932265d93133a50b56d 100644 (file)
@@ -4,7 +4,7 @@ tests/test-nan-2.c
 tests/macros.h
 
 Depends-on:
-fpe-tracking
+fenv-exceptions-tracking-c99
 fpe-trapping
 
 configure.ac:
@@ -12,5 +12,5 @@ configure.ac:
 Makefile.am:
 TESTS += test-nan-1 test-nan-2
 check_PROGRAMS += test-nan-1 test-nan-2
-test_nan_1_LDADD = $(LDADD) @FPE_TRACKING_LIBM@
+test_nan_1_LDADD = $(LDADD) $(FENV_EXCEPTIONS_TRACKING_LIBM)
 test_nan_2_LDADD = $(LDADD) @FPE_TRAPPING_LIBM@
index 91210d2ea5ee725962c30685005ea2798671c7ad..6779f6c0bf62a63114b75c51e81c4e45416dca6f 100644 (file)
@@ -6,7 +6,7 @@ tests/macros.h
 m4/math_h.m4
 
 Depends-on:
-fpe-tracking
+fenv-exceptions-tracking-c99
 fpe-trapping
 
 configure.ac:
@@ -15,5 +15,5 @@ AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
 Makefile.am:
 TESTS += test-snan-1 test-snan-2.sh
 check_PROGRAMS += test-snan-1 test-snan-2
-test_snan_1_LDADD = $(LDADD) @FPE_TRACKING_LIBM@
+test_snan_1_LDADD = $(LDADD) $(FENV_EXCEPTIONS_TRACKING_LIBM)
 test_snan_2_LDADD = $(LDADD) @FPE_TRAPPING_LIBM@
index 4ebe013e3c3debda9e220a0eeb9d8b096c77b71b..9b48a6853f506751706655d293ac7e6d110c18fa 100644 (file)
 /* Specification.  */
 #include "nan.h"
 
-#include <stdio.h>
+#if defined __GLIBC__ && defined __arm__ && defined __SOFTFP__
 
-#if HAVE_FE_INVALID
-
-# if defined __GLIBC__ && defined __arm__ && defined __SOFTFP__
+# include <stdio.h>
 
 /* The arm software floating-point emulation (used e.g. on armv5) does not set
    the floating-point exception bits.  */
@@ -37,11 +35,11 @@ main ()
   return 77;
 }
 
-# else
+#else
 
-#  include <fenv.h>
+# include <fenv.h>
 
-#  include "macros.h"
+# include "macros.h"
 
 float volatile resultf;
 double volatile resultd;
@@ -80,19 +78,4 @@ main ()
   return 0;
 }
 
-# endif
-
-#else
-
-/* No <fenv.h> available.
-   We could use the various alternative approaches from
-   libgfortran/config/fpu-*.h, but that's not worth it.  */
-
-int
-main ()
-{
-  fputs ("Skipping test: feclearexcept, fetestexcept, FE_INVALID not available\n", stderr);
-  return 77;
-}
-
 #endif
index 7b71b9a57bce3a92e3154bd7ebed971ff919f569..3b1e0e94274f4abefc2f4aa300289b9ce5b468a6 100644 (file)
 /* Specification.  */
 #include "snan.h"
 
-#include <stdio.h>
+#if defined __GLIBC__ && defined __arm__ && defined __SOFTFP__
 
-#if HAVE_FE_INVALID
-
-# if defined __GLIBC__ && defined __arm__ && defined __SOFTFP__
+# include <stdio.h>
 
 /* The arm software floating-point emulation (used e.g. on armv5) does not set
    the floating-point exception bits.  */
@@ -37,11 +35,11 @@ main ()
   return 77;
 }
 
-# else
+#else
 
-#  include <fenv.h>
+# include <fenv.h>
 
-#  include "macros.h"
+# include "macros.h"
 
 float volatile resultf;
 double volatile resultd;
@@ -105,19 +103,4 @@ main ()
   return 0;
 }
 
-# endif
-
-#else
-
-/* No <fenv.h> available.
-   We could use the various alternative approaches from
-   libgfortran/config/fpu-*.h, but that's not worth it.  */
-
-int
-main ()
-{
-  fputs ("Skipping test: feclearexcept, fetestexcept, FE_INVALID not available\n", stderr);
-  return 77;
-}
-
 #endif