public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "roland.illig at gmx dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug gcov-profile/96622] gcov misses to count break statement
Date: Sat, 15 Aug 2020 02:13:45 +0000	[thread overview]
Message-ID: <bug-96622-4-vsl4ybkIwi@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96622-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96622

--- Comment #1 from Roland Illig <roland.illig at gmx dot de> ---
In my own code coverage measurer for Go programs, I took the approach of
creating a coverage counter for every true and false branch of a boolean
condition.

https://github.com/rillig/gobco/blob/6be01424/instrumenter.go#L126

I had expected gcov to work in the same way, but it seems to me that gcov takes
a different approach.

Or is it that the break statement is converted to a direct jump too early to be
seen by the --coverage option, discarding the basic block for it?  That reminds
me of what I consider a bug in the OpenJDK Java compiler (as well as the
Eclipse Java compiler):

https://mail.openjdk.java.net/pipermail/compiler-dev/2020-February/014290.html

  reply	other threads:[~2020-08-15  2:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15  1:15 [Bug gcov-profile/96622] New: " roland.illig at gmx dot de
2020-08-15  2:13 ` roland.illig at gmx dot de [this message]
2020-08-17  8:21 ` [Bug gcov-profile/96622] " marxin at gcc dot gnu.org
2020-08-19  6:26 ` roland.illig at gmx dot de
2020-08-19 10:36 ` marxin at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-96622-4-vsl4ybkIwi@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).