This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFA:] config/fpu-glibc.h (set_fpu): Only call fedisableexcept for nonzero FE_ALL_EXCEPT.
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Cc: fxcoudert at gcc dot gnu dot org
- Date: Sat, 12 Nov 2005 01:51:47 +0100
- Subject: [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