https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90017

--- Comment #2 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
This odd behavior is an artifact of the way GCC lays out the basic blocks, and
how GDB interprets the line number program.

The blocks containing the conditional calls to optimize_me_not in line 15 are
moved to the end of the function, in reverse order, while the rest of the inner
loop, with code from lines 12 to 14, remains in sequential order.

What GDB sees then is a long chunk of code all at line 15, the first of which
corresponds to the iteration l=8.  l=7 is later, with another line number mark,
then l=6 and so on, but without intervening line number changes, it takes it
all as a single line.  GDB pays no attention to the is_stmt=1 markers at each
and every one of them, let alone to the different view numbers.

So, yeah, definitely consumer issue.

Reply via email to