+/* Pass: fixup_cfg - IPA passes or compilation of earlier functions might've
+ changed some properties - such as marged functions nothrow. Remove now
+ redundant edges and basic blocks. */
+
+static void
+execute_fixup_cfg (void)
+{
+ basic_block bb;
+ block_stmt_iterator bsi;
+
+ if (cfun->eh)
+ FOR_EACH_BB (bb)
+ {
+ for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ {
+ tree stmt = bsi_stmt (bsi);
+ tree call = get_call_expr_in (stmt);
+
+ if (call && call_expr_flags (call) & (ECF_CONST | ECF_PURE))
+ TREE_SIDE_EFFECTS (call) = 0;
+ if (!tree_could_throw_p (stmt) && lookup_stmt_eh_region (stmt))
+ remove_stmt_from_eh_region (stmt);
+ }
+ tree_purge_dead_eh_edges (bb);
+ }
+
+ cleanup_tree_cfg ();
+}
+
+static struct tree_opt_pass pass_fixup_cfg =
+{
+ NULL, /* name */
+ NULL, /* gate */
+ execute_fixup_cfg, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ 0, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
+ 0 /* letter */
+};