aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-tail-merge.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2016-10-13 10:06:35 +0000
committerMartin Liska <mliska@suse.cz>2016-10-13 10:06:35 +0000
commitbf031034852a38c17aaab28ad09875c121dccfba (patch)
tree0329ecc6fcb3f9d33cdd52bdf732c067b11528d4 /gcc/tree-ssa-tail-merge.c
parent568940ba2fc6f7248c1263a01507b06ffaad50f5 (diff)
Do not merge BBs with a different EH landing pads (PR
PR tree-optimization/77943 * g++.dg/tree-ssa/pr77943.C: New test. PR tree-optimization/77943 * tree-ssa-tail-merge.c (merge_stmts_p): Do not merge BBs with a different EH landing pads. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@241090 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-tail-merge.c')
-rw-r--r--gcc/tree-ssa-tail-merge.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c
index 5e815ec582a..c292ee776c2 100644
--- a/gcc/tree-ssa-tail-merge.c
+++ b/gcc/tree-ssa-tail-merge.c
@@ -204,6 +204,7 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "tree-ssa-sccvn.h"
#include "cfgloop.h"
+#include "tree-eh.h"
/* Describes a group of bbs with the same successors. The successor bbs are
cached in succs, and the successor edge flags are cached in succ_flags.
@@ -1222,6 +1223,10 @@ merge_stmts_p (gimple *stmt1, gimple *stmt2)
if (is_tm_ending (stmt1))
return false;
+ /* Verify EH landing pads. */
+ if (lookup_stmt_eh_lp_fn (cfun, stmt1) != lookup_stmt_eh_lp_fn (cfun, stmt2))
+ return false;
+
if (is_gimple_call (stmt1)
&& gimple_call_internal_p (stmt1))
switch (gimple_call_internal_fn (stmt1))