about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog18
-rw-r--r--sysdeps/generic/math_private.h10
-rw-r--r--sysdeps/m68k/coldfire/nofpu/math_private.h8
-rw-r--r--sysdeps/microblaze/math_private.h8
-rw-r--r--sysdeps/nios2/math_private.h8
-rw-r--r--sysdeps/tile/math_private.h4
6 files changed, 31 insertions, 25 deletions
diff --git a/ChangeLog b/ChangeLog
index e1262c65f1..4a574f52c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,23 @@
 2018-02-01  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/generic/math_private.h [FE_ALL_EXCEPT == 0]
+	(feraiseexcept): New macro.
+	[FE_ALL_EXCEPT == 0] (__feraiseexcept): Likewise.
+	* sysdeps/m68k/coldfire/nofpu/math_private.h (feraiseexcept):
+	Remove macro.
+	(__feraiseexcept): Likewise.
+	(feclearexcept): Likewise.
+	* sysdeps/microblaze/math_private.h (feraiseexcept): Likewise.
+	(__feraiseexcept): Likewise.
+	(feclearexcept): Likewise.
+	* sysdeps/nios2/math_private.h (feraiseexcept): Likewise.
+	(__feraiseexcept): Likewise.
+	(feclearexcept): Likewise.
+	* sysdeps/tile/math_private.h (feraiseexcept): Likewise.
+	(__feraiseexcept): Likewise.
+	(feclearexcept): Likewise.
+	(fetestexcept): Likewise.
+
 	* sysdeps/m68k/coldfire/math-tests.h: New file.
 
 	* sysdeps/m68k/fpu/bits/fenv.h: Move to ....
diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index e4b9d8697f..acfbd9b6cc 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -644,4 +644,14 @@ libc_feresetround_noex_ctx (struct rm_ctx *ctx)
   SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround_53bit,	      \
 			     libc_feresetround_53bit)
 
+/* When no floating-point exceptions are defined in <fenv.h>, make
+   feraiseexcept ignore its argument so that unconditional
+   feraiseexcept calls do not cause errors for undefined exceptions.
+   Define it to expand to a void expression so that any calls testing
+   the result of feraiseexcept do produce errors.  */
+#if FE_ALL_EXCEPT == 0
+# define feraiseexcept(excepts) ((void) 0)
+# define __feraiseexcept(excepts) ((void) 0)
+#endif
+
 #endif /* _MATH_PRIVATE_H_ */
diff --git a/sysdeps/m68k/coldfire/nofpu/math_private.h b/sysdeps/m68k/coldfire/nofpu/math_private.h
index 879577b551..951f026eac 100644
--- a/sysdeps/m68k/coldfire/nofpu/math_private.h
+++ b/sysdeps/m68k/coldfire/nofpu/math_private.h
@@ -30,9 +30,7 @@
    success in every case.
 
    The overrides for libc_ functions must happen before we include
-   the generic math_private.h, and the overrides for regular
-   <fenv.h> functions must happen afterwards, to avoid clashing with
-   the declarations of those functions.  */
+   the generic math_private.h.  */
 
 #define libc_fesetround(rnd)                   ({ 0; })
 #define libc_fetestexcept(exc)                 ({ 0; })
@@ -45,8 +43,4 @@
 
 #include_next <math_private.h>
 
-#define feraiseexcept(excepts)                 ({ 0; })
-#define __feraiseexcept(excepts)               ({ 0; })
-#define feclearexcept(exc)                     ({ 0; })
-
 #endif
diff --git a/sysdeps/microblaze/math_private.h b/sysdeps/microblaze/math_private.h
index d82e8bf820..1a2c521c07 100644
--- a/sysdeps/microblaze/math_private.h
+++ b/sysdeps/microblaze/math_private.h
@@ -17,9 +17,7 @@
    success in every case.
 
    The overrides for libc_ functions must happen before we include
-   the generic math_private.h, and the overrides for regular
-   <fenv.h> functions must happen afterwards, to avoid clashing with
-   the declarations of those functions.  */
+   the generic math_private.h.  */
 
 #define libc_fesetround(rnd)                   ({ 0; })
 #define libc_fetestexcept(exc)                 ({ 0; })
@@ -32,8 +30,4 @@
 
 #include_next <math_private.h>
 
-#define feraiseexcept(excepts)                 ({ 0; })
-#define __feraiseexcept(excepts)               ({ 0; })
-#define feclearexcept(exc)                     ({ 0; })
-
 #endif
diff --git a/sysdeps/nios2/math_private.h b/sysdeps/nios2/math_private.h
index 373da2a621..25140416a8 100644
--- a/sysdeps/nios2/math_private.h
+++ b/sysdeps/nios2/math_private.h
@@ -16,9 +16,7 @@
    success in every case.
 
    The overrides for libc_ functions must happen before we include
-   the generic math_private.h, and the overrides for regular
-   <fenv.h> functions must happen afterwards, to avoid clashing with
-   the declarations of those functions.  */
+   the generic math_private.h.  */
 
 #define libc_fesetround(rnd)                   ({ 0; })
 #define libc_fetestexcept(exc)                 ({ 0; })
@@ -31,8 +29,4 @@
 
 #include_next <math_private.h>
 
-#define feraiseexcept(excepts)                 ({ 0; })
-#define __feraiseexcept(excepts)               ({ 0; })
-#define feclearexcept(exc)                     ({ 0; })
-
 #endif
diff --git a/sysdeps/tile/math_private.h b/sysdeps/tile/math_private.h
index 99daec4093..6dc43f4228 100644
--- a/sysdeps/tile/math_private.h
+++ b/sysdeps/tile/math_private.h
@@ -26,10 +26,6 @@
 
 #include_next <math_private.h>
 
-#define feraiseexcept(excepts)			({ 0; })
-#define __feraiseexcept(excepts)		({ 0; })
-#define feclearexcept(exc)			({ 0; })
-#define fetestexcept(exc)			({ 0; })
 extern inline int fegetenv (fenv_t *__e)	{ return 0; }
 extern inline int __fegetenv (fenv_t *__e)	{ return 0; }
 extern inline int fesetenv (const fenv_t *__e)	{ return 0; }