From cd1d802aed1192b9393b519608e59b64c544db42 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 8 Jun 2016 11:39:33 +0200 Subject: [PATCH] predict.c (pass_strip_predict_hints::execute): Cleanup CFG if some statements was removed. * predict.c (pass_strip_predict_hints::execute): Cleanup CFG if some statements was removed. From-SVN: r237199 --- gcc/ChangeLog | 5 +++++ gcc/predict.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 087d9f9f72c..ea8186b0418 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-06-07 Jan Hubicka + + * predict.c (pass_strip_predict_hints::execute): Cleanup CFG if + some statements was removed. + 2016-06-08 Alan Hayward * tree-vect-data-refs.c (vect_analyze_data_refs): Remove debug newline. diff --git a/gcc/predict.c b/gcc/predict.c index 6f81b537989..837c2f3274f 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -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 -- 2.30.2