How to default to -fno-math-errno on all FreeBSD targets

Gerald Pfeifer gerald@pfeifer.com
Wed Feb 16 00:39:00 GMT 2011


[ gcc -> gcc-patches ]

On Mon, 7 Feb 2011, Richard Guenther wrote:
> A new target macro/hook would be needed for that I think.  But see
> also recent discussion about frontends wanting to change these defaults
> (and that not working anymore).

For the time being, and understanding the malloc() issue, how about a 
change like the following for the time being so that we are at least
on par with Darwin here?  This really is an efficiency killer.

This also brings upstream GCC in line with the system compiler, at
least on x86.

Gerald

PS: Passes bootstrap and testing, and I'll add a ChangeLog if approved.

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 170202)
+++ config/i386/i386.c	(working copy)
@@ -5156,6 +5156,11 @@
        avoid calling them when that's the only reason we would.  */
     opts->x_flag_errno_math = 0;
 
+#ifdef __FreeBSD__
+  /* FreeBSD libm never sets errno, so we do not need to bother, too.  */
+  opts->x_flag_errno_math = 0;
+#endif
+
   opts->x_flag_pcc_struct_return = 2;
   opts->x_flag_asynchronous_unwind_tables = 2;
   opts->x_flag_vect_cost_model = 1;




More information about the Gcc-patches mailing list