[RFA:] config/fpu-glibc.h (set_fpu): Only call fedisableexcept for nonzero FE_ALL_EXCEPT.

Hans-Peter Nilsson hans-peter.nilsson@axis.com
Sat Nov 12 00:51:00 GMT 2005


For targets without floating-point-exception support glibc emits
warnings at link-time for certain library calls that are not
implemented.  The patch below avoids confusion like in PR 24342
where the bug presumably has nothing to do with floating-point
exceptions by helping GCC to discard completely of the function
call when it wouldn't do anything anyway for any target.  Tested
cross to cris-axis-linux-gnu.

Ok to commit?

libgfortran/:
	* config/fpu-glibc.h (set_fpu): Only call fedisableexcept for
	nonzero FE_ALL_EXCEPT.

Index: config/fpu-glibc.h
===================================================================
--- config/fpu-glibc.h	(revision 106481)
+++ config/fpu-glibc.h	(working copy)
@@ -39,7 +39,8 @@ Boston, MA 02110-1301, USA.  */
 
 void set_fpu (void)
 {
-  fedisableexcept (FE_ALL_EXCEPT);
+  if (FE_ALL_EXCEPT != 0)
+    fedisableexcept (FE_ALL_EXCEPT);
 
   if (options.fpe & GFC_FPE_INVALID)
 #ifdef FE_INVALID

brgds, H-P



More information about the Fortran mailing list