From: Jan Hubicka Date: Wed, 8 Jun 2016 09:39:33 +0000 (+0200) Subject: predict.c (pass_strip_predict_hints::execute): Cleanup CFG if some statements was... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cd1d802aed1192b9393b519608e59b64c544db42;p=gcc.git 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 --- 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