If UREGNO is referenced by any entry in DEBUG, emit a debug insn
before or after INSN (depending on WHERE), that binds a (possibly
global) debug temp to the widest-mode use of UREGNO, if WHERE is
*_WITH_REG, or the value stored in UREGNO by INSN otherwise, and
replace all uses of UREGNO in DEBUG with uses of the debug temp.
INSN must be where UREGNO dies, if WHERE is *_BEFORE_*, or where it
is set otherwise. Return the number of debug insns emitted.
Move all uses of uregno from debug->head to uses, setting mode to
the widest referenced mode.
If this loc has been changed e.g. to debug_expr already
as part of a multi-register use, just drop it.
We may have dangling bits in debug->used for registers that were part
of a multi-register use, one component of which has been reset.
Recover the expression INSN stores in REG.
Lose if the REG-setting insn is a CALL.
??? Should we try to extract it from a PARALLEL?
Cool, it's the same REG, we can use SRC.
Hmm... Something's fishy, we should be setting REG here.
If we're not overwriting all the hardware registers that
setting REG in its mode would, we won't know what to bind
the debug temp to. ??? We could bind the debug_expr to a
CONCAT or PARALLEL with the split multi-registers, and
replace them as we found the corresponding sets.
Ok, it's the same (hardware) REG, but with a different
mode, so SUBREG it.
We should be setting REG here. Lose.
Lose if we're setting something other than the lowpart of
REG.
If we're not overwriting all the hardware registers that
setting REG in its mode would, we won't know what to bind
the debug temp to.
Yay, we can use SRC, just adjust its mode.
Oh well, we're out of luck.
We couldn't figure out the value stored in REG, so reset all
of its pending debug uses.
If there's a single (debug) use of an otherwise unused REG, and
the debug use is not part of a larger expression, then it
probably doesn't make sense to introduce a new debug temp.
Create DEBUG_EXPR (and DEBUG_EXPR_DECL).
Emit a debug bind insn before the insn in which reg dies.
Adjust all uses.
??? Should we simplify subreg of subreg?
References dead_debug_use::next, and dead_debug_use::use.
Referenced by df_create_unused_note().