From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17248 invoked by alias); 16 Jan 2015 18:21:40 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 16939 invoked by uid 48); 16 Jan 2015 18:21:30 -0000 From: "joerg.richter@pdv-fs.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug gcov-profile/64634] New: gcov reports catch(...) as not executed Date: Fri, 16 Jan 2015 18:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: gcov-profile X-Bugzilla-Version: 4.8.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joerg.richter@pdv-fs.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg01575.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64634 Bug ID: 64634 Summary: gcov reports catch(...) as not executed Product: gcc Version: 4.8.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: joerg.richter@pdv-fs.de cat > t.cc < void catchEx() { exit(0); try {} catch( int ) {} } int main() { try { throw 5; } catch(...) { catchEx(); } } EOF g++ -o t t.cc -O0 --coverage -g ./t ----- If you now call gcov like this: gcov -b t.gcda t.cc.gcov looks like this: ... =====: 18: catch(...) call 0 never executed call 1 never executed call 2 returned 100% call 3 never executed ... But if you call gcov like this: gcov -a -b t.gcda Then t.cc.gcov looks like this: ... 1: 18: catch(...) %%%%%: 18-block 0 call 0 never executed call 1 never executed 1: 18-block 1 1: 18-block 2 call 2 returned 100% %%%%%: 18-block 3 call 3 never executed ... Note that in the former case the catch(...) on line 18 is marked as not executed and in the later it is marked as executed. This results in wrong coverage information. Calling gcov always with -a is no option for us. Because gcov -a is much slower. Works with GCC 4.4.4. Fails since 4.5.