predict.c (pass_strip_predict_hints::execute): Cleanup CFG if some statements was...
authorJan Hubicka <hubicka@ucw.cz>
Wed, 8 Jun 2016 09:39:33 +0000 (11:39 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 8 Jun 2016 09:39:33 +0000 (09:39 +0000)
* predict.c (pass_strip_predict_hints::execute): Cleanup CFG if
some statements was removed.

From-SVN: r237199

gcc/ChangeLog
gcc/predict.c

index 087d9f9f72ccf2d7aaa70c0f6e8b5cd85ddcc657..ea8186b04188bfc4910075fe2be0ae65aa079855 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-07  Jan Hubicka  <hubicka@ucw.cz>
+
+       * predict.c (pass_strip_predict_hints::execute): Cleanup CFG if
+       some statements was removed.
+
 2016-06-08  Alan Hayward  <alan.hayward@arm.com>
 
        * tree-vect-data-refs.c (vect_analyze_data_refs): Remove debug newline.
index 6f81b537989b8e98819b5bdc6fc671681786165e..837c2f3274ffa6baf2caa7679c53942dfc4a3bd2 100644 (file)
@@ -3166,6 +3166,7 @@ pass_strip_predict_hints::execute (function *fun)
   basic_block bb;
   gimple *ass_stmt;
   tree var;
+  bool changed = false;
 
   FOR_EACH_BB_FN (bb, fun)
     {
@@ -3177,6 +3178,7 @@ pass_strip_predict_hints::execute (function *fun)
          if (gimple_code (stmt) == GIMPLE_PREDICT)
            {
              gsi_remove (&bi, true);
+             changed = true;
              continue;
            }
          else if (is_gimple_call (stmt))
@@ -3191,6 +3193,7 @@ pass_strip_predict_hints::execute (function *fun)
                      && gimple_call_internal_fn (stmt) == IFN_BUILTIN_EXPECT))
                {
                  var = gimple_call_lhs (stmt);
+                 changed = true;
                  if (var)
                    {
                      ass_stmt
@@ -3207,7 +3210,7 @@ pass_strip_predict_hints::execute (function *fun)
          gsi_next (&bi);
        }
     }
-  return 0;
+  return changed ? TODO_cleanup_cfg : 0;
 }
 
 } // anon namespace