i386.c (optimization_options): Make -fno-math-errno the default on Darwin.
authorDale Johannesen <dalej@apple.com>
Fri, 10 Jun 2005 01:16:52 +0000 (01:16 +0000)
committerDale Johannesen <dalej@gcc.gnu.org>
Fri, 10 Jun 2005 01:16:52 +0000 (01:16 +0000)
2005-06-09  Dale Johannesen  <dalej@apple.com>

        * config/i386/i386.c (optimization_options):  Make -fno-math-errno
        the default on Darwin.
        * config/rs6000/rs6000.c (optimization_options):  Ditto.
        * doc/invoke.texi (-fno-math-errno): Document.

2005-06-09  Dale Johannesen  <dalej@apple.com>

        * config/rs6000/rs6000.c (TARGET_INSN_VALID_WITHIN_DOLOOP):
        Change to TARGET_INVALID_WITHIN_DOLOOP.

From-SVN: r100813

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/rs6000/rs6000.c
gcc/doc/invoke.texi

index d41db885477cfc6c34686530f4c67122c8141ec6..b91d5d064bfded06942f3695d937255cfcc45aa8 100644 (file)
@@ -1,3 +1,15 @@
+2005-06-09  Dale Johannesen  <dalej@apple.com>
+
+       * config/i386/i386.c (optimization_options):  Make -fno-math-errno
+       the default on Darwin.
+       * config/rs6000/rs6000.c (optimization_options):  Ditto.
+       * doc/invoke.texi (-fno-math-errno): Document.
+
+2005-06-09  Dale Johannesen  <dalej@apple.com>
+
+       * config/rs6000/rs6000.c (TARGET_INSN_VALID_WITHIN_DOLOOP):
+       Change to TARGET_INVALID_WITHIN_DOLOOP.
+
 2005-06-09  David Edelsohn  <edelsohn@gnu.org>
 
        * config/rs6000/rs6000.md (eq): Convert to define_insn_and_split.
index 0ff50ec9f4b12376951dfc83c011ff220539a9b5..8dd2d152dc77df2bf0006bd17fc45d91c73add6d 100644 (file)
@@ -1636,6 +1636,11 @@ optimization_options (int level, int size ATTRIBUTE_UNUSED)
     flag_schedule_insns = 0;
 #endif
 
+  if (TARGET_MACHO)
+    /* The Darwin libraries never set errno, so we might as well
+       avoid calling them when that's the only reason we would.  */
+    flag_errno_math = 0;
+
   /* The default values of these switches depend on the TARGET_64BIT
      that is not known at this moment.  Mark these values with 2 and
      let user the to override these.  In case there is no command line option
index 732ccbbee603fc1e9d66cbd66e808dbf88bc57f8..5aa2558d0fb1e7885d588e238cfd0200f3356068 100644 (file)
@@ -906,8 +906,8 @@ static const char alt_reg_names[][8] =
 #undef TARGET_FUNCTION_OK_FOR_SIBCALL
 #define TARGET_FUNCTION_OK_FOR_SIBCALL rs6000_function_ok_for_sibcall
 
-#undef TARGET_INSN_VALID_WITHIN_DOLOOP
-#define TARGET_INSN_VALID_WITHIN_DOLOOP rs6000_invalid_within_doloop
+#undef TARGET_INVALID_WITHIN_DOLOOP
+#define TARGET_INVALID_WITHIN_DOLOOP rs6000_invalid_within_doloop
 
 #undef TARGET_RTX_COSTS
 #define TARGET_RTX_COSTS rs6000_rtx_costs
@@ -1543,6 +1543,10 @@ rs6000_parse_tls_size_option (void)
 void
 optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
 {
+  if (DEFAULT_ABI == ABI_DARWIN)
+    /* The Darwin libraries never set errno, so we might as well
+       avoid calling them when that's the only reason we would.  */
+    flag_errno_math = 0;
 }
 
 /* Implement TARGET_HANDLE_OPTION.  */
index 95846f162739c5639802a04a54ca0c06ab8b8250..8b12244b828d17f1f976b7b5d65b9687c0fc4d6e 100644 (file)
@@ -5331,6 +5331,10 @@ math functions.
 
 The default is @option{-fmath-errno}.
 
+On Darwin 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.
+
 @item -funsafe-math-optimizations
 @opindex funsafe-math-optimizations
 Allow optimizations for floating-point arithmetic that (a) assume