http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58165
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Alexander Ivchenko from comment #4) > I firstly did something like that: > > diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c > index 9b6186e..5862ebf 100644 > --- a/gcc/tree-call-cdce.c > +++ b/gcc/tree-call-cdce.c > @@ -771,6 +771,9 @@ shrink_wrap_one_built_in_call (gimple bi_call) > join_tgt_in_edge_fall_thru = make_edge (guard_bb0, join_tgt_bb, > EDGE_FALSE_VALUE); > > + if (!gimple_call_nothrow_p (bi_call)) > + make_eh_edges (bi_call); > + > bi_call_in_edge0->probability = REG_BR_PROB_BASE * ERR_PROB; > bi_call_in_edge0->count = > apply_probability (guard_bb0->count, > > which also helped.. but now I see that we shouldn't split the block Well, that wouldn't be sufficient, you'd need to also remove the EH edges from the other bb. But not splitting the block means you don't have to bother with that. Though, thinking about it again, my patch might be problematic for -fcompare-debug, because we could be not splitting without -g and for -g if a call is followed by some debug stmts, we could be splitting. So, I need to use stmt_ends_bb_p instead.