https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94018
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2020-03-04 CC| |aoliva at gcc dot gnu.org Version|unknown |10.0 Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Similar to that other bug there's no program state at line 5 before the execution of the l = 0 assignment so gdb breaks after that assignment has taken place. There's also the assignment to b on the same line which probably "tricks" gdb to place the breakpoint there. Again 00000000 v000000000000002 v000000000000000 location view pair 00000002 v000000000000001 v000000000000000 location view pair 00000004 v000000000000002 v000000000000000 views at 00000000 for: 0000000000400472 0000000000400474 (DW_OP_lit2; DW_OP_stack_value) 00000018 v000000000000001 v000000000000000 views at 00000002 for: 0000000000400474 0000000000400487 (DW_OP_addr: 601034) 00000033 <End of list> and the breakpoint is at Dump of assembler code for function main: 0x0000000000400472 <+0>: jmp 0x400487 <main+21> => 0x0000000000400474 <+2>: movl $0x1,0x200bb2(%rip) # 0x601030 <b> 0x000000000040047e <+12>: add $0x1,%eax you see the point where l == 2 is earlier (the jump to the loop header). Line Number Statements: [0x0000010d] Set column to 12 [0x0000010f] Extended opcode 2: set Address to 0x400472 [0x0000011a] Special opcode 6: advance Address by 0 to 0x400472 and Line by 1 to 2 [0x0000011b] Set column to 3 [0x0000011d] Special opcode 6: advance Address by 0 to 0x400472 and Line by 1 to 3 (view 1) [0x0000011e] Special opcode 6: advance Address by 0 to 0x400472 and Line by 1 to 4 (view 2) [0x0000011f] Set column to 5 [0x00000121] Extended opcode 4: set Discriminator to 2 [0x00000125] Special opcode 34: advance Address by 2 to 0x400474 and Line by 1 to 5 [0x00000126] Set column to 7 [0x00000128] Extended opcode 4: set Discriminator to 2 [0x0000012c] Set is_stmt to 0 [0x0000012d] Copy (view 1) [0x0000012e] Set column to 17 [0x00000130] Extended opcode 4: set Discriminator to 2 [0x00000134] Set is_stmt to 1 I also think we can't really represent this "correctly" since the second time arriving at the desired line 5 break point l would be zero. Guess debug stmts don't really capture the before/after execution in the abstract machine.