/* The location of the finally is either the last stmt in the finally
block or the location of the TRY_FINALLY itself. */
- finally_loc = gimple_seq_last_stmt (tf->top_p_seq) != NULL ?
- gimple_location (gimple_seq_last_stmt (tf->top_p_seq))
- : tf_loc;
+ x = gimple_seq_last_stmt (finally);
+ finally_loc = x ? gimple_location (x) : tf_loc;
/* Lower the finally block itself. */
lower_eh_constructs_1 (state, finally);
edge_iterator ei;
edge e, e_out;
bool has_non_eh_pred;
+ bool ret = false;
int new_lp_nr;
/* There can be zero or one edges out of BB. This is the quickest test. */
default:
return false;
}
+
+ resx = last_stmt (bb);
+ if (resx && is_gimple_resx (resx))
+ {
+ if (stmt_can_throw_external (resx))
+ optimize_clobbers (bb);
+ else if (sink_clobbers (bb))
+ ret = true;
+ }
+
gsi = gsi_after_labels (bb);
/* Make sure to skip debug statements. */
{
/* For the degenerate case of an infinite loop bail out. */
if (infinite_empty_loop_p (e_out))
- return false;
+ return ret;
- return cleanup_empty_eh_unsplit (bb, e_out, lp);
+ return ret | cleanup_empty_eh_unsplit (bb, e_out, lp);
}
/* The block should consist only of a single RESX statement, modulo a
resx = gsi_stmt (gsi);
}
if (!is_gimple_resx (resx))
- return false;
+ return ret;
gcc_assert (gsi_one_before_end_p (gsi));
/* Determine if there are non-EH edges, or resx edges into the handler. */
return true;
}
- return false;
+ return ret;
succeed:
if (dump_file && (dump_flags & TDF_DETAILS))