Update error message prefix in libgcov profiling.
[gcc.git] / gcc / dce.c
index ae8c478a002a8616b6fd7098fcd58bd96e58459f..7fd9c37aa445651f17de1d5959ea10230cde0efa 100644 (file)
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -108,7 +108,10 @@ deletable_insn_p (rtx_insn *insn, bool fast, bitmap arg_stores)
       /* We can delete dead const or pure calls as long as they do not
          infinite loop.  */
       && (RTL_CONST_OR_PURE_CALL_P (insn)
-         && !RTL_LOOPING_CONST_OR_PURE_CALL_P (insn)))
+         && !RTL_LOOPING_CONST_OR_PURE_CALL_P (insn))
+      /* Don't delete calls that may throw if we cannot do so.  */
+      && ((cfun->can_delete_dead_exceptions && can_alter_cfg)
+         || insn_nothrow_p (insn)))
     return find_call_stack_args (as_a <rtx_call_insn *> (insn), false,
                                 fast, arg_stores);
 
@@ -201,7 +204,9 @@ mark_insn (rtx_insn *insn, bool fast)
          && !df_in_progress
          && !SIBLING_CALL_P (insn)
          && (RTL_CONST_OR_PURE_CALL_P (insn)
-             && !RTL_LOOPING_CONST_OR_PURE_CALL_P (insn)))
+             && !RTL_LOOPING_CONST_OR_PURE_CALL_P (insn))
+         && ((cfun->can_delete_dead_exceptions && can_alter_cfg)
+             || insn_nothrow_p (insn)))
        find_call_stack_args (as_a <rtx_call_insn *> (insn), true, fast, NULL);
     }
 }