https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102441
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So, I see 2 changes since 7-ish. The first one is in r8-5241-g8697bf9f46f36168ddba5752db582e673e3cbe8c which added statement frontiers and therefore moved where the breakpoint is actually placed. Before/after that commit, the location info for x seems correct, first %rdi and at the insn setting %rdi changing to entry_value(%rdi). But entry_value(%rdi) doesn't seem to be usable in this case, because main tail calls foo and so main is out of the backtrace, and the outer frame is __libc_start_main which is in assembly, so the debugger can't try to reconstruct the tail call path. So, before r8-5241 the debugger prints for x at line 6 10 (#c1), at or after it it prints <optimized out>. The next change is r10-7665-g33c45e51b4914008064d9b77f2c1fc0eea1ad060 and that causes wrong-debug for this case. It isn't immediately clear to me why, because %rdi certainly isn't sp based, but I'll need to debug.