Backported from mainline
2016-04-13 Jakub Jelinek <jakub@redhat.com>
+ PR c++/70641
+ * ipa-pure-const.c (pass_nothrow::execute): Call maybe_clean_eh_stmt
+ on all recursive call stmts. Return TODO_cleanup_cfg if any dead
+ eh edges have been purged.
+
PR middle-end/70633
* gimplify.c (gimplify_init_constructor): Clear TREE_STATIC if
gimplification turns some element into non-constant.
}
node->set_nothrow_flag (true);
+
+ bool cfg_changed = false;
+ if (self_recursive_p (node))
+ FOR_EACH_BB_FN (this_block, cfun)
+ if (gimple g = last_stmt (this_block))
+ if (is_gimple_call (g))
+ {
+ tree callee_t = gimple_call_fndecl (g);
+ if (callee_t
+ && recursive_call_p (current_function_decl, callee_t)
+ && maybe_clean_eh_stmt (g)
+ && gimple_purge_dead_eh_edges (this_block))
+ cfg_changed = true;
+ }
+
if (dump_file)
fprintf (dump_file, "Function found to be nothrow: %s\n",
current_function_name ());
- return 0;
+ return cfg_changed ? TODO_cleanup_cfg : 0;
}
} // anon namespace