https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121243
Bug ID: 121243 Summary: [GCOV] [[fallthrough]] leads wrong cov for case-statement. Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: njuwy at smail dot nju.edu.cn Target Milestone: --- gcc version: gcc version 16.0.0 20250704 (experimental) (GCC) cmd: gcc --coverage -std=c2x -lm -O0 test.c -o test ./test gcov ./*.gcda -t > test.c.gcov $ cat test.c int main(void) { for ( int i = 0; i < 4; ++i) switch (i) { case 0: [[fallthrough]]; case 1: if (i % 2 == 0) break; default: break; } return 0; } $ cat test.c.gcov 1: 1:int main(void) { 5: 2: for ( int i = 0; i < 4; ++i) 4: 3: switch (i) { 2: 4: case 0: -: 5: [[fallthrough]]; -: 6: case 1: 2: 7: if (i % 2 == 0) break; -: 8: default: 3: 9: break; -: 10: } 1: 11: return 0; -: 12:} Cov of line 3 should be 1 instead of 2.