https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98780
--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> --- At final, we have: ... (note 113 30 112 2 0x7f53d1836de0 NOTE_INSN_BLOCK_BEG) (note 112 113 31 2 0x7f53d1836e40 NOTE_INSN_BLOCK_BEG) (call_insn 31 112 114 2 (call (mem:QI (symbol_ref:DI ("bar") [flags 0x41] <function_decl 0x7f53d1858000 bar>) [0 bar S1 A8]) (const_int 0 [0])) "src/gdb/testsuite/gdb.opt/inline-cmds.c":35:3 813 {*call} (nil) (nil)) (note 114 31 115 2 0x7f53d1836e40 NOTE_INSN_BLOCK_END) (note 115 114 117 2 0x7f53d1836de0 NOTE_INSN_BLOCK_END) (note 117 115 116 2 0x7f53d1836d20 NOTE_INSN_BLOCK_BEG) (note 116 117 38 2 0x7f53d1836d80 NOTE_INSN_BLOCK_BEG) (call_insn 38 116 118 2 (call (mem:QI (symbol_ref:DI ("bar") [flags 0x41] <function_decl 0x7f53d1858000 bar>) [0 bar S1 A8]) (const_int 0 [0])) "src/gdb/testsuite/gdb.opt/inline-cmds.c":35:3 813 {*call} (nil) (nil)) (note 118 38 119 2 0x7f53d1836d80 NOTE_INSN_BLOCK_END) (note 119 118 45 2 0x7f53d1836d20 NOTE_INSN_BLOCK_END) ... So if we reset last_linenum when encountering a BLOCK_END: ... diff --git a/gcc/final.c b/gcc/final.c index b037e07fca0..a5da1ce7224 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -2385,6 +2385,8 @@ final_scan_insn_1 (rtx_insn *insn, FILE *file, int optimize_p AT TRIBUTE_UNUSED, debug_hooks->end_block (high_block_linenum, n); gcc_assert (BLOCK_IN_COLD_SECTION_P (NOTE_BLOCK (insn)) == in_cold_section_p); + + last_linenum = 0; } if (write_symbols == DBX_DEBUG) { ... I get: ... Line number Starting address View Stmt 71 0x64 x 35 0x6e x 35 0x73 x 75 0x78 x ...