This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RX cleanup rx_option_optimization


On Fri, 15 Oct 2010, Nick Clifton wrote:

> > If not, then only the relevant flags should be
> > set, not the whole of -ffast-math.  For example, if it doesn't support
> > NaNs and infinities, set flag_finite_math_only;
> 
> This is what should be happening.  If you would care to make that change to
> your patch then that is pre-approved.

Thanks.  I've committed it in the following form.

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 165507)
+++ ChangeLog	(working copy)
@@ -1,5 +1,16 @@
 2010-10-15  Joseph Myers  <joseph@codesourcery.com>
 
+	* config/rx/rx.c (rx_option_optimization): Change to
+	rx_override_options_after_change.  Don't change
+	flag_lto_compression_level.  Don't check for changes to whether
+	FPU instructions can be used.  Check and set only
+	flag_finite_math_only, not other fast-math flags.
+	(rx_option_override): Call rx_override_options_after_change.
+	(TARGET_OPTION_OPTIMIZATION): Remove.
+	(TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): Define.
+
+2010-10-15  Joseph Myers  <joseph@codesourcery.com>
+
 	* config/rs6000/rs6000.c (rs6000_option_optimization): Don't
 	disable section anchors for lang_hooks.name[4] != 'O'.
 
Index: config/rx/rx.c
===================================================================
--- config/rx/rx.c	(revision 165507)
+++ config/rx/rx.c	(working copy)
@@ -2191,29 +2191,21 @@
   return true;
 }
 
-/* Implement TARGET_OPTION_OPTIMIZATION.  */
+/* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE.  */
 
 static void
-rx_option_optimization (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
+rx_override_options_after_change (void)
 {
   static bool first_time = TRUE;
-  static bool saved_allow_rx_fpu = TRUE;
 
   if (first_time)
     {
       /* If this is the first time through and the user has not disabled
-	 the use of RX FPU hardware then enable unsafe math optimizations,
-	 since the FPU instructions themselves are unsafe.  */
+	 the use of RX FPU hardware then enable -ffinite-math-only,
+	 since the FPU instructions do not support NaNs and infinities.  */
       if (TARGET_USE_FPU)
-	set_fast_math_flags (true);
+	flag_finite_math_only = 1;
 
-      /* FIXME: For some unknown reason LTO compression is not working,
-	 at least on my local system.  So set the default compression
-	 level to none, for now.  */
-      if (flag_lto_compression_level == -1)
-        flag_lto_compression_level = 0;
-
-      saved_allow_rx_fpu = ALLOW_RX_FPU_INSNS;
       first_time = FALSE;
     }
   else
@@ -2221,11 +2213,8 @@
       /* Alert the user if they are changing the optimization options
 	 to use IEEE compliant floating point arithmetic with RX FPU insns.  */
       if (TARGET_USE_FPU
-	  && ! fast_math_flags_set_p ())
-	warning (0, "RX FPU instructions are not IEEE compliant");
-
-      if (saved_allow_rx_fpu != ALLOW_RX_FPU_INSNS)
-	error ("Changing the FPU insns/math optimizations pairing is not supported");
+	  && !flag_finite_math_only)
+	warning (0, "RX FPU instructions do not support NaNs and infinities");
     }
 }
 
@@ -2235,6 +2224,8 @@
   /* This target defaults to strict volatile bitfields.  */
   if (flag_strict_volatile_bitfields < 0)
     flag_strict_volatile_bitfields = 1;
+
+  rx_override_options_after_change ();
 }
 
 
@@ -2834,8 +2825,8 @@
 #undef  TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE			rx_option_override
 
-#undef  TARGET_OPTION_OPTIMIZATION
-#define TARGET_OPTION_OPTIMIZATION		rx_option_optimization
+#undef  TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
+#define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE	rx_override_options_after_change
 
 #undef  TARGET_EXCEPT_UNWIND_INFO
 #define TARGET_EXCEPT_UNWIND_INFO		sjlj_except_unwind_info

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]