re PR rtl-optimization/38711 (ira should not be using df-lr except at -O1.)
authorSteven Bosscher <steven@gcc.gnu.org>
Sun, 28 Oct 2012 11:52:11 +0000 (11:52 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Sun, 28 Oct 2012 11:52:11 +0000 (11:52 +0000)
PR rtl-optimization/38711
* ira.c (ira): Remove DF_LIVE if the problem is in the stack.
(do_reload): Add it back at the end for -O2 and higher.

* function.c (thread_prologue_and_epilogue_insns): Use
REG_SET_TO_HARD_REG_SET instead of CLEAR_HARD_REG_SET and
reg_set_to_hard_reg_set.

From-SVN: r192890

gcc/ChangeLog
gcc/function.c
gcc/ira.c

index 1e6f1fd8d985960516ff5ebe461c992b7aa7015f..3ed5d44aca49b4b982714d046e037559894c1554 100644 (file)
@@ -1,3 +1,13 @@
+2012-10-28  Steven Bosscher  <steven@gcc.gnu.org>
+
+       PR rtl-optimization/38711
+       * ira.c (ira): Remove DF_LIVE if the problem is in the stack.
+       (do_reload): Add it back at the end for -O2 and higher.
+
+       * function.c (thread_prologue_and_epilogue_insns): Use
+       REG_SET_TO_HARD_REG_SET instead of CLEAR_HARD_REG_SET and
+       reg_set_to_hard_reg_set.
+
 2012-10-28  Jan Hubicka  <jh@suse.cz>
 
        * ipa-inline.c (edge_badness): Reduce precision; use scc hints.
index 9efbc3ad27061ce3555440276f089bec56ada909..e23ac91daf31ae37dcfc6a21b9f80743d7dd9692 100644 (file)
@@ -6176,8 +6176,7 @@ thread_prologue_and_epilogue_insns (void)
          CLEAR_HARD_REG_BIT (prologue_clobbered, STACK_POINTER_REGNUM);
          if (frame_pointer_needed)
            CLEAR_HARD_REG_BIT (prologue_clobbered, HARD_FRAME_POINTER_REGNUM);
-         CLEAR_HARD_REG_SET (live_on_edge);
-         reg_set_to_hard_reg_set (&live_on_edge,
+         REG_SET_TO_HARD_REG_SET (live_on_edge,
                                   df_get_live_in (entry_edge->dest));
          if (hard_reg_set_intersect_p (live_on_edge, prologue_clobbered))
            {
index 9a8b098cf4846b305eb36c08502ad7a799cfd927..8dcdbf57549d265e4875bf4feaaaecdbd3bdfc81 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -4399,6 +4399,16 @@ ira (FILE *f)
   setup_prohibited_mode_move_regs ();
 
   df_note_add_problem ();
+
+  /* DF_LIVE can't be used in the register allocator, too many other
+     parts of the compiler depend on using the "classic" liveness
+     interpretation of the DF_LR problem.  See PR38711.
+     Remove the problem, so that we don't spend time updating it in
+     any of the df_analyze() calls during IRA/LRA.  */
+  if (optimize > 1)
+    df_remove_problem (df_live);
+  gcc_checking_assert (df_live == NULL);
+
 #ifdef ENABLE_CHECKING
   df->changeable_flags |= DF_VERIFY_SCHEDULED;
 #endif
@@ -4678,6 +4688,12 @@ do_reload (void)
   df_scan_alloc (NULL);
   df_scan_blocks ();
 
+  if (optimize > 1)
+    {
+      df_live_add_problem ();
+      df_live_set_all_dirty ();
+    }
+
   if (optimize)
     df_analyze ();