The FreeBSD math library doesn't support the SysV mistake of setting errno in
libm functions, and never has. As on Darwin, -fno-math-errno should be the
default.

Darwin changes the default by adding an override for every relevant machine
config. There needs to be a cleaner way to do this.

Doc changes for this and bug 37072:

Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi     (revision 181538)
+++ doc/invoke.texi     (working copy)
@@ -5677,7 +5677,8 @@

 The default is @option{-fmath-errno}.

-On Darwin systems, the math library never sets @code{errno}.  There is
therefore
+On Darwin and FreeBSD systems, the math library never sets @code{errno}.
+There is therefore
 no reason for the compiler to consider the possibility that it might,
 and @option{-fno-math-errno} is the default.

@@ -9507,7 +9508,7 @@
 @opindex mno-fancy-math-387
 Some 387 emulators do not support the @code{sin}, @code{cos} and
 @code{sqrt} instructions for the 387.  Specify this option to avoid
-generating those instructions.  This option is the default on FreeBSD,
+generating those instructions.  This option is the default on
 OpenBSD and [EMAIL PROTECTED]  This option is overridden when @option{-march}
 indicates that the target cpu will always have an FPU and so the
 instruction will not need emulation.  As of revision 2.6.1, these


-- 
           Summary: -fno-math-errno should be the default on FreeBSD
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: das at FreeBSD dot ORG
 GCC build triplet: amd64-undermydesk-freebsd
  GCC host triplet: amd64-undermydesk-freebsd
GCC target triplet: amd64-undermydesk-freebsd


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37073

Reply via email to