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 via email to