diff options
Diffstat (limited to 'gcc/tree-ssa-dce.cc')
-rw-r--r-- | gcc/tree-ssa-dce.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/tree-ssa-dce.cc b/gcc/tree-ssa-dce.cc index f0b0245..bbdf931 100644 --- a/gcc/tree-ssa-dce.cc +++ b/gcc/tree-ssa-dce.cc @@ -221,6 +221,14 @@ mark_stmt_if_obviously_necessary (gimple *stmt, bool aggressive) case GIMPLE_CALL: { + /* Never elide a noreturn call we pruned control-flow for. */ + if ((gimple_call_flags (stmt) & ECF_NORETURN) + && gimple_call_ctrl_altering_p (stmt)) + { + mark_stmt_necessary (stmt, true); + return; + } + tree callee = gimple_call_fndecl (stmt); if (callee != NULL_TREE && fndecl_built_in_p (callee, BUILT_IN_NORMAL)) |