diff options
Diffstat (limited to 'gcc/cse.c')
-rw-r--r-- | gcc/cse.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -7049,11 +7049,11 @@ delete_trivially_dead_insns (rtx_insn *insns, int nreg) timevar_push (TV_DELETE_TRIVIALLY_DEAD); /* First count the number of times each register is used. */ - if (MAY_HAVE_DEBUG_INSNS) + if (MAY_HAVE_DEBUG_BIND_INSNS) { counts = XCNEWVEC (int, nreg * 3); for (insn = insns; insn; insn = NEXT_INSN (insn)) - if (DEBUG_INSN_P (insn)) + if (DEBUG_BIND_INSN_P (insn)) count_reg_usage (INSN_VAR_LOCATION_LOC (insn), counts + nreg, NULL_RTX, 1); else if (INSN_P (insn)) @@ -7111,12 +7111,15 @@ delete_trivially_dead_insns (rtx_insn *insns, int nreg) if (! live_insn && dbg_cnt (delete_trivial_dead)) { if (DEBUG_INSN_P (insn)) - count_reg_usage (INSN_VAR_LOCATION_LOC (insn), counts + nreg, - NULL_RTX, -1); + { + if (DEBUG_BIND_INSN_P (insn)) + count_reg_usage (INSN_VAR_LOCATION_LOC (insn), counts + nreg, + NULL_RTX, -1); + } else { rtx set; - if (MAY_HAVE_DEBUG_INSNS + if (MAY_HAVE_DEBUG_BIND_INSNS && (set = single_set (insn)) != NULL_RTX && is_dead_reg (SET_DEST (set), counts) /* Used at least once in some DEBUG_INSN. */ @@ -7156,10 +7159,10 @@ delete_trivially_dead_insns (rtx_insn *insns, int nreg) } } - if (MAY_HAVE_DEBUG_INSNS) + if (MAY_HAVE_DEBUG_BIND_INSNS) { for (insn = get_last_insn (); insn; insn = PREV_INSN (insn)) - if (DEBUG_INSN_P (insn)) + if (DEBUG_BIND_INSN_P (insn)) { /* If this debug insn references a dead register that wasn't replaced with an DEBUG_EXPR, reset the DEBUG_INSN. */ |