https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120489
Bug ID: 120489 Summary: Wrong line coverage in loops with continue statements and dereferencing of pointer variables Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: wentaoz5 at illinois dot edu Target Milestone: --- Hit the issue when measuring coverage for https://sources.debian.org/src/lz4/1.9.4-1/programs/lz4cli.c/#L365 The original report is 3: 363: const char* argument = argv[i]; -: 364: 6*: 365: if(!argument) continue; /* Protection if argument empty */ branch 0 taken 0 (fallthrough) branch 1 taken 3 Line coverage at line 365 is wrong and should be 3, as evidenced by both line coverage at line 363 and branch coverage at 365. The triggering condition is a loop that dereferences a loop-local pointer variable and has continue statements. I will provide a reproducible reduced example soon.