On 01/05/15 21:01, Hans-Peter Nilsson wrote:
On Fri, 14 Nov 2014, Radovan Obradovic wrote:
index eb37bfe..ddaf8e0 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c

@@ -1605,6 +1612,11 @@ process_options (void)
    /* Save the current optimization options.  */
    optimization_default_node = build_optimization_node (&global_options);
    optimization_current_node = optimization_default_node;
+
+  /* Disable use caller save optimization if profiler is active or port
+     does not emit prologue and epilogue as RTL.  */
+  if (profile_flag || !HAVE_prologue || !HAVE_epilogue)
+    flag_use_caller_save = 0;
  }

This seems wrong.  Why disable caller-save regardless of
profile_flag; is there some long-standing bug in caller-save for
"old" targets?
It's actually -fipa-ra, use-caller-save was the initial name for the option and everyone agreed it was poorly named.

The problem is that with -fipa-ra we analyze the generated RTL to determine register usage. We later use that information to optimize register allocation in callers.

That works fine and good except for cases where we're emitting code textually rather than via RTL. That happens with profiling, textual prologue or textual epilogue. Thus the test is correct.

Jeff

Reply via email to