diff options
Diffstat (limited to 'gcc/dce.c')
-rw-r--r-- | gcc/dce.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/gcc/dce.c b/gcc/dce.c index 3e1dd47f3a4..b937dd44a19 100644 --- a/gcc/dce.c +++ b/gcc/dce.c @@ -79,13 +79,7 @@ deletable_insn_p_1 (rtx body) return false; default: - if (volatile_refs_p (body)) - return false; - - if (flag_non_call_exceptions && may_trap_p (body)) - return false; - - return true; + return !volatile_refs_p (body); } } @@ -99,6 +93,14 @@ deletable_insn_p (rtx insn, bool fast, bitmap arg_stores) rtx body, x; int i; + /* Don't delete jumps, notes and the like. */ + if (!NONJUMP_INSN_P (insn)) + return false; + + /* Don't delete insns that can throw. */ + if (!insn_nothrow_p (insn)) + return false; + if (CALL_P (insn) /* We cannot delete calls inside of the recursive dce because this may cause basic blocks to be deleted and this messes up @@ -113,13 +115,6 @@ deletable_insn_p (rtx insn, bool fast, bitmap arg_stores) && !RTL_LOOPING_CONST_OR_PURE_CALL_P (insn))) return find_call_stack_args (insn, false, fast, arg_stores); - if (!NONJUMP_INSN_P (insn)) - return false; - - /* Similarly, we cannot delete other insns that can throw either. */ - if (df_in_progress && flag_non_call_exceptions && can_throw_internal (insn)) - return false; - body = PATTERN (insn); switch (GET_CODE (body)) { |