From bf031034852a38c17aaab28ad09875c121dccfba Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 13 Oct 2016 10:06:35 +0000 Subject: 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 --- gcc/tree-ssa-tail-merge.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/tree-ssa-tail-merge.c') 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)) -- cgit v1.2.3