]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/33135 ([SH] -ffinite-math-only should not be on by default)
authorOleg Endo <olegendo@gcc.gnu.org>
Sun, 22 Jul 2012 23:49:56 +0000 (23:49 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Sun, 22 Jul 2012 23:49:56 +0000 (23:49 +0000)
PR target/33135
* config/sh/sh.opt (mieee): Use Var instead of Mask.  Correct
description.
* config/sh/sh.c (sh_option_override): Do not change
flag_finite_math_only.  Set TARGET_IEEE to complement of
flag_finite_math_only.
* doc/invoke.texi (SH options): Add mno-ieee.  Correct
description of mieee and mno-ieee behavior.

From-SVN: r189762

gcc/ChangeLog
gcc/config/sh/sh.c
gcc/config/sh/sh.opt
gcc/doc/invoke.texi

index f055a9547d775e8363025c7cc0d072140843c49e..6abd1c4c25a6027f2de0887e26dd2d8aed36b12c 100644 (file)
@@ -1,3 +1,14 @@
+2012-07-22  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       PR target/33135
+       * config/sh/sh.opt (mieee): Use Var instead of Mask.  Correct
+       description.
+       * config/sh/sh.c (sh_option_override): Do not change 
+       flag_finite_math_only.  Set TARGET_IEEE to complement of
+       flag_finite_math_only.
+       * doc/invoke.texi (SH options): Add mno-ieee.  Correct
+       description of mieee and mno-ieee behavior.
+
 2012-07-16  Steven Bosscher  <steven@gcc.gnu.org>
 
        Backported from trunk:
index 39ef00d265c272943e161d52cf0fe8e20778cca9..11e537b1f297ede46138e218cf1033d3db69708c 100644 (file)
@@ -763,11 +763,6 @@ sh_option_override (void)
   SUBTARGET_OVERRIDE_OPTIONS;
   if (optimize > 1 && !optimize_size)
     target_flags |= MASK_SAVE_ALL_TARGET_REGS;
-  if (flag_finite_math_only == 2)
-    flag_finite_math_only
-      = !flag_signaling_nans && TARGET_SH2E && ! TARGET_IEEE;
-  if (TARGET_SH2E && !flag_finite_math_only)
-    target_flags |= MASK_IEEE;
   sh_cpu = PROCESSOR_SH1;
   assembler_dialect = 0;
   if (TARGET_SH2)
@@ -1007,6 +1002,11 @@ sh_option_override (void)
        align_functions = min_align;
     }
 
+  /* If the -mieee option was not explicitly set by the user, turn it on
+     unless -ffinite-math-only was specified.  See also PR 33135.  */
+  if (! global_options_set.x_TARGET_IEEE)
+    TARGET_IEEE = ! flag_finite_math_only;
+
   if (sh_fixed_range_str)
     sh_fix_range (sh_fixed_range_str);
 
index 99a6373e20e6d0b3dcef2a78bdcbec3e49a3f42e..8464bd75fa06d13c32a271a9d18f277a2625fd49 100644 (file)
@@ -270,8 +270,8 @@ Target Report RejectNegative Mask(HITACHI)
 Follow Renesas (formerly Hitachi) / SuperH calling conventions
 
 mieee
-Target Report Mask(IEEE)
-Increase the IEEE compliance for floating-point code
+Target Var(TARGET_IEEE)
+Increase the IEEE compliance for floating-point comparisons
 
 mindexed-addressing
 Target Report Mask(ALLOW_INDEXED_ADDRESS) Condition(SUPPORT_ANY_SH5_32MEDIA)
index 4ed31b6656eea598c921f685e0ecdc676f5af1ed..9cd24ad778961191f1e2d07c7626c44f0b7d0f44 100644 (file)
@@ -853,8 +853,8 @@ See RS/6000 and PowerPC Options.
 -m5-compact  -m5-compact-nofpu @gol
 -mb  -ml  -mdalign  -mrelax @gol
 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
--mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
--mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
+-mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
+-mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
 -maccumulate-outgoing-args -minvalid-symbols}
@@ -16938,13 +16938,15 @@ Mark the @code{MAC} register as call-clobbered, even if
 @option{-mhitachi} is given.
 
 @item -mieee
+@item -mno-ieee
 @opindex mieee
-Increase IEEE-compliance of floating-point code.
-At the moment, this is equivalent to @option{-fno-finite-math-only}.
-When generating 16 bit SH opcodes, getting IEEE-conforming results for
-comparisons of NANs / infinities incurs extra overhead in every
-floating point comparison, therefore the default is set to
-@option{-ffinite-math-only}.
+@opindex mnoieee
+Control the IEEE compliance of floating-point comparisons, which affects the
+handling of cases where the result of a comparison is unordered.  By default
+@option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
+enabled @option{-mno-ieee} is implicitly set, which results in faster
+floating-point greater-equal and less-equal comparisons.  The implcit settings
+can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
 
 @item -minline-ic_invalidate
 @opindex minline-ic_invalidate