* ira.c (ira): Update regstat data if we deleted insns.
authorBernd Schmidt <bernds@redhat.com>
Tue, 19 Jan 2016 13:02:17 +0000 (13:02 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Tue, 19 Jan 2016 13:02:17 +0000 (13:02 +0000)
From-SVN: r232556

gcc/ChangeLog
gcc/ira.c

index 372b25d..6cf6bbc 100644 (file)
@@ -1,3 +1,7 @@
+2016-01-19  Bernd Schmidt  <bschmidt@redhat.com>
+
+       * ira.c (ira): Update regstat data if we deleted insns.
+
 2016-01-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/68955
@@ -13,7 +17,7 @@
        assume that the node has body.
        * cgraph.c (cgraph_node::get_untransformed_body): Use gimple_body_p
        check.
-       
+
 2016-01-19  Jan Hubicka  <hubicka@ucw.cz>
 
        * lto-streamer-out.c (lto_output): Do not stream instrumentation
index 7ac6a54..5259617 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -5185,19 +5185,27 @@ ira (FILE *f)
   setup_reg_equiv ();
   setup_reg_equiv_init ();
 
+  bool update_regstat = false;
+
   if (optimize && rebuild_p)
     {
       timevar_push (TV_JUMP);
       rebuild_jump_labels (get_insns ());
       if (purge_all_dead_edges ())
-       delete_unreachable_blocks ();
+       {
+         delete_unreachable_blocks ();
+         update_regstat = true;
+       }
       timevar_pop (TV_JUMP);
     }
 
   allocated_reg_info_size = max_reg_num ();
 
   if (delete_trivially_dead_insns (get_insns (), max_reg_num ()))
-    df_analyze ();
+    {
+      df_analyze ();
+      update_regstat = true;
+    }
 
   /* It is not worth to do such improvement when we use a simple
      allocation because of -O0 usage or because the function is too
@@ -5308,7 +5316,7 @@ ira (FILE *f)
     check_allocation ();
 #endif
 
-  if (max_regno != max_regno_before_ira)
+  if (update_regstat || max_regno != max_regno_before_ira)
     {
       regstat_free_n_sets_and_refs ();
       regstat_free_ri ();