Don't terminate location ranges for register-described variables
at the end of machine basic block if this register is never modified
in the function body (except for the frame setup and the last machine
basic block).
This patch is mostly targeted to fix non-trivial debug locations for
variables addressed via stack and frame pointers (%rsp, %rbp).
It is not really a generic fix. We can still produce poor debug info
for register-described variables if this register *is* modified somewhere
in the function, but in unrelated places. This might be the case for the debug
info in optimized binaries (e.g. for local variables in inlined functions).
However, proper fix requires a control-flow analysis and should probably be
done in a different place (register allocator) and actually modify DBG_VALUE
instructions to keep AsmPrinter straightforward.
I'd like to try and proceed with a fix in this patch, as it is simple
and helps in many important cases, e.g. it is intended to fix completely
broken debug info with AddressSanitizer and fix PR19307 (missing debug info
for by-value std::string arguments at -O0).