Patchwork [m32c] avoid function-cse in 16-bit mode

login
register
mail settings
Submitter DJ Delorie
Date Oct. 20, 2010, 8:39 p.m.
Message ID <201010202039.o9KKd345000874@greed.delorie.com>
Download mbox | patch
Permalink /patch/68475/
State New
Headers show

Comments

DJ Delorie - Oct. 20, 2010, 8:39 p.m.
Applied to trunk.

	* config/m32c/m32c.c (m32c_option_override): Always disable
	function-cse in 16-bit mode.  Indirect calls are always worse than
	direct calls as there is no 16-bit indirect call opcode.
	(m32c_override_options_after_change): New, likewise.

Patch

Index: config/m32c/m32c.c
===================================================================
--- config/m32c/m32c.c	(revision 165735)
+++ config/m32c/m32c.c	(working copy)
@@ -426,12 +426,27 @@  m32c_option_override (void)
   if (TARGET_A24)
     flag_ivopts = 0;
 
   /* This target defaults to strict volatile bitfields.  */
   if (flag_strict_volatile_bitfields < 0)
     flag_strict_volatile_bitfields = 1;
+
+  /* r8c/m16c have no 16-bit indirect call, so thunks are involved.
+     This is always worse than an absolute call.  */
+  if (TARGET_A16)
+    flag_no_function_cse = 1;
+}
+
+#undef TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
+#define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE m32c_override_options_after_change
+
+static void
+m32c_override_options_after_change (void)
+{
+  if (TARGET_A16)
+    flag_no_function_cse = 1;
 }
 
 /* Defining data structures for per-function information */
 
 /* The usual; we set up our machine_function data.  */
 static struct machine_function *