The insn shuffling in one of my patches for PR48866 shook out some latent problems in DCE. One of the issues was that DCE removed an insn that set a REG in a certain mode, without adjusting a debug use of that REG. This was in libstdc++, but I failed to take note of the affected file. DF later attached that debug use to another SET to the same REG in a different, incompatible mode. When that one was found to be dead by DF, we ended up ICEing as we attempted to emit the invalid SUBREGs. I reused some of the infrastructure to propagate dead DEFs into debug uses in DF to get DCE to emit debug temps and adjust debug uses as well, fixing this issue. While at that, I improved the handling of unused DEFs in DF, that previously resulted in loss of debug information, so as to retain it as much as possible. The changes above ended up exposing another latent problem in regstack, by which a debug insn referenced a stack register that wasn't available. I adjusted the code to tolerate this possibility. This is the patch I ended up with. Regstrapped on x86_64-linux-gnu and i686-linux-gnu. Ok to install?