https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120491
Bug ID: 120491 Summary: Wrong line coverage for C++ constructor with multiline initialization list 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/lzma/9.22-2.2/CPP/7zip/Compress/LzmaDecoder.cpp/#L27 The original report includes function _ZN9NCompress5NLzma8CDecoderC2Ev called 3 returned 100% blocks executed 100% 6: 27:CDecoder::CDecoder(): _inBuf(0), _propsWereSet(false), _outSizeDefined(false), 3: 28: _inBufSize(1 << 20), 3: 29: _outBufSize(1 << 22), 3: 30: FinishStream(false) call 0 returned 3 call 1 returned 3 call 2 returned 3 call 3 returned 3 call 4 returned 3 call 5 returned 3 call 6 returned 3 call 7 returned 3 -: 31:{ 3: 32: _inSizeProcessed = 0; 3: 33: _inPos = _inSize = 0; 3: 34: LzmaDec_Construct(&_state); 3: 35:} Line coverage at line 27 is wrong and should not be 6, as evidenced by the lines that follow and "function [...] called 3". The triggering condition is (1) C++ constructor for a class that inherits from another base class, and (2) the initialization list is written in multiple lines. I will provide a reproducible reduced example soon.