aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-eh.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2012-01-26 15:50:33 +0000
committerMichael Matz <matz@suse.de>2012-01-26 15:50:33 +0000
commit889906f7deac37750150879104323925cc81e9f2 (patch)
tree808bb0980b8187c2584ca18d2cc1712638bdbd79 /gcc/tree-eh.c
parenta5e51012b894329fc1ba6c43570dee0a2d49e8a1 (diff)
PR tree-optimization/46590
* cfgexpand.c: Revert last change (r183305). * gimplify.c (gimplify_bind_expr): Add clobbers for all non-gimple regs. * tree-eh.c (cleanup_empty_eh): Try to optimize clobbers before checking for emptiness. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@183566 138bc75d-0d04-0410-961f-82ee72b054a4
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 2064d51b952..521e2f7f44a 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))