diff --git a/gcc/gimple-ssa-split-paths.cc b/gcc/gimple-ssa-split-paths.cc index 7c5bc1d842c01d59eaf36647eecb4fd09441b0c5..9db73fdcc6d4a41332ee399e400c655868cc7888 100644 --- a/gcc/gimple-ssa-split-paths.cc +++ b/gcc/gimple-ssa-split-paths.cc @@ -160,6 +160,11 @@ poor_ifcvt_pred (basic_block pred, basic_block bb) gimple *stmt = last_and_only_stmt (pred); if (!stmt || gimple_code (stmt) != GIMPLE_ASSIGN) return true; + + /* If the statement could trap, then this is a poor ifcvt candidate. */ + if (gimple_could_trap_p (stmt)) + return true; + tree_code code = gimple_assign_rhs_code (stmt); if (poor_ifcvt_candidate_code (code)) return true;