This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]