On 6/6/19 5:43 AM, Richard Biener wrote:
>
> The following fixes debugging experience (and coverage) for cases
> where CFG construction "optimizes" the CFG by squashing labels
> into the same basic-block, defeating the regular mechanism of
> dropping labels that are not reachable as done by CFG cleanup.
>
> Writing coverage testcases is easy enough here, guality IIRC
> cannot test whether we stop at exactly a line - after the
> patch gdb when setting a breakpoint on line 4, stops at
> line 10 (stepping goes from 2 to 10 directly).
>
> Bootstrap & regtest running on x86_64-unknown-linux-gnu.
>
> The patch has no bad effects on code generation when optimizing,
> we just produce more "garbage" CFG upfront to leave optimizing
> the CFG to machinery that knows how to do it correctly. It
> does have code-generation effects when not optimizing where
> for the first testcase instead of
>
> nop
> .L2:
> cmpl $1, -4(%rbp)
> jne .L3
>
> we now emit
>
> cmpl $0, -4(%rbp)
> .L3:
> cmpl $1, -4(%rbp)
> jne .L4
>
> and CFG cleanup done after RTL expansion elides the jump
> but not the compare.
>
> Any objections?
>
> Thanks,
> Richard.
>
> 2019-06-06 Richard Biener <rguent...@suse.de>
>
> PR debug/90574
> * tree-cfg.c (stmt_starts_bb_p): Split blocks at labels
> that appear after user labels.
>
> * gcc.misc-tests/gcov-pr90574-1.c: New testcase.
> * gcc.misc-tests/gcov-pr90574-2.c: Likewise.
No objections from me.
jeff