aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-eh.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r--gcc/tree-eh.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 2064d51..521e2f7 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -4056,6 +4056,7 @@ cleanup_empty_eh (eh_landing_pad lp)
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. */
@@ -4070,6 +4071,16 @@ cleanup_empty_eh (eh_landing_pad lp)
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. */
@@ -4081,9 +4092,9 @@ cleanup_empty_eh (eh_landing_pad lp)
{
/* 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
@@ -4096,7 +4107,7 @@ cleanup_empty_eh (eh_landing_pad lp)
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. */
@@ -4172,7 +4183,7 @@ cleanup_empty_eh (eh_landing_pad lp)
return true;
}
- return false;
+ return ret;
succeed:
if (dump_file && (dump_flags & TDF_DETAILS))