> If that is true, then why are there so many post var-tracking passes > using NONDEBUG_INSN_P and/or looking for the DEBUG_INSN code? See e.g. > shorten_branches, reorg.c, various machine reorgs, etc.
They are very likely overzealous. > For example from reorg.c:redundant_insn() in the loop "/* Scan > backwards looking for a match. */": > > 151731 nemet if (!NONDEBUG_INSN_P (trial)) > 99 kenner continue; > 151731 nemet --insns_to_search; > > This was introduced to fix PR41349. Apparently DEBUG_INSN live on > beyond var-tracking...? I think that the fix for this PR was really about NOTEs and not DEBUG_INSNs. I'm going to test the following patchlet on the SPARC: Index: reorg.c =================================================================== --- reorg.c (revision 193748) +++ reorg.c (working copy) @@ -1628,7 +1628,7 @@ redundant_insn (rtx insn, rtx target, rt if (LABEL_P (trial)) return 0; - if (!NONDEBUG_INSN_P (trial)) + if (!INSN_P (trial)) continue; --insns_to_search; @@ -1731,7 +1731,7 @@ redundant_insn (rtx insn, rtx target, rt trial && !LABEL_P (trial) && insns_to_search > 0; trial = PREV_INSN (trial)) { - if (!NONDEBUG_INSN_P (trial)) + if (!INSN_P (trial)) continue; --insns_to_search; -- Eric Botcazou