From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 24CF53857C7B; Sat, 15 Aug 2020 02:13:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24CF53857C7B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597457625; bh=pViTO8J4OqVaoWGFOhmqSSOqumNK9H4cVbD/asyJKUA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JiSqSEre359LOrgMaHyIiLBMYrxAwo0IGDGH8BSZ6cFz+5gygZXLCjgAhjXweOt0y V1cXdzHongqXHf9cs+MT/E8JfM6L6zFdPSbz1ER6A4tRx1UYz2AJP5L0BbqVq1fNgo yKPIZ3kFPTJF3ZzWJkSyPh9MBHmG7sAExSlH2FAE= 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: Sat, 15 Aug 2020 02:13:45 +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: UNCONFIRMED X-Bugzilla-Resolution: 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: Sat, 15 Aug 2020 02:13:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96622 --- Comment #1 from Roland Illig --- 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 t= akes a different approach. Or is it that the break statement is converted to a direct jump too early t= o be seen by the --coverage option, discarding the basic block for it? That rem= inds 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.h= tml=