From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9F848384C007; Wed, 19 Aug 2020 06:26:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F848384C007 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597818370; bh=GbeXU+N8+OVGEMhDZrM+OE9+bcXrbTYHkJgmy3qsBaA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RzwwnKy7iO/tpmHab02Q9pQ6mHJBWgHOQfa85ikswTP1+ZBxWkC4iZD2Q1Nk8HfRJ yyRDYz6GHqe2ELcMV9YlFOKAsREVZYt/ovxSUZSM3ktdgzrXbM7cqDYNjk/li8nBXa vjtLEaPRuSGXB2s0bQgPZChR9Vrh9TfRc5G6HjKo= From: "roland.illig at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug gcov-profile/96622] gcov misses to count break statement Date: Wed, 19 Aug 2020 06:26:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: gcov-profile X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: roland.illig at gmx dot de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2020 06:26:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96622 --- Comment #3 from Roland Illig --- Ah, thanks for the pointer. I thought I had used -O0 in the larger project as well, but I hadn't. Just as a suggestion, would it make sense to apply the coverage at the sour= ce code level (before any optimizations) instead of optimizing first and then adding the counters? It would feel more predictable to me. https://gcc.gnu.org/onlinedocs/gcc/Gcov-Intro.html#Gcov-Intro At least for the "discover untested parts of your program", that would make sense to me since in my code, the "break" statement has an effect, independ= ent of any optimization level. https://gcc.gnu.org/onlinedocs/gcc/Invoking-Gcov.html#Invoking-Gcov In this section, the string "tim" occurs often, but only in "number of time= s", "each time", but not in "measured wall time". Therefore I think gcov is mo= re about counting that about measuring time.=