From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id 2B1B93857C5B for ; Tue, 12 Jul 2022 14:05:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2B1B93857C5B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de Received: from sslproxy01.your-server.de ([78.46.139.224]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oBGVh-000476-Hr; Tue, 12 Jul 2022 16:05:09 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBGVh-000Qjt-Nq; Tue, 12 Jul 2022 16:05:09 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 6DD44480051; Tue, 12 Jul 2022 16:05:09 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id WV3Lo2W8q_5L; Tue, 12 Jul 2022 16:05:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 232E5480052; Tue, 12 Jul 2022 16:05:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id CGhHJuwo1yKY; Tue, 12 Jul 2022 16:05:09 +0200 (CEST) Received: from [10.10.171.6] (unknown [10.10.171.6]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 7FA76480051; Tue, 12 Jul 2022 16:05:08 +0200 (CEST) Message-ID: Date: Tue, 12 Jul 2022 16:05:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] Add condition coverage profiling Content-Language: en-US To: =?UTF-8?Q?J=c3=b8rgen_Kvalsvik?= , gcc-patches@gcc.gnu.org References: <20220711100237.22030-1-jorgen.kvalsvik@woven-planet.global> From: Sebastian Huber In-Reply-To: <20220711100237.22030-1-jorgen.kvalsvik@woven-planet.global> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.103.6/26599/Tue Jul 12 10:00:48 2022) X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2022 14:05:17 -0000 Hello J=C3=B8rgen, thanks for the updated patch. I used it for a test suite run and the=20 results look quite good. Could you please add this hunk to your patch set: diff --git a/libgcc/libgcov-merge.c b/libgcc/libgcov-merge.c index 89741f637e1..9e3e8ee5657 100644 --- a/libgcc/libgcov-merge.c +++ b/libgcc/libgcov-merge.c @@ -33,6 +33,11 @@ void __gcov_merge_add (gcov_type *counters=20 __attribute__ ((unused)), unsigned n_counters __attribute__ ((unused))) {} #endif +#ifdef L_gcov_merge_ior +void __gcov_merge_ior (gcov_type *counters __attribute__ ((unused)), + unsigned n_counters __attribute__ ((unused))) {} +#endif + #ifdef L_gcov_merge_topn void __gcov_merge_topn (gcov_type *counters __attribute__ ((unused)), unsigned n_counters __attribute__ ((unused))) {} It is necessary to use gcov in freestanding environments (inhibit_libc=20 is defined). The condition profiling found one spot for which we have insufficient=20 condition coverage: function _Leap_year called 227 returned 100% blocks executed 100% 227: 54:static bool _Leap_year( -: 55: uint32_t year -: 56:) -: 57:{ 227: 58: return (((year % 4) =3D=3D 0) && ((year % 100) !=3D 0)= ) ||=20 ((year % 400) =3D=3D 0); branch 0 taken 19% (fallthrough) branch 1 taken 81% branch 2 taken 16% (fallthrough) branch 3 taken 84% branch 4 taken 4% (fallthrough) branch 5 taken 96% conditions covered 5/6 condition 1 not covered (false) -: 59:} This is because we don't test with the year 2100 for example. This value=20 would result in: year % 4 =3D=3D 0: true year % 100 !=3D 0: false year % 400 =3D=3D 0: false It was not immediately clear to me what the "conditions covered 5/6 condition 1 not covered (false)" is supposed to tell me. I guess a reasonable interpretation is:=20 condition 1 (which is "(year % 100) !=3D 0" should be false and determine= =20 the outcome of the decision. What could be a bit confusing is that we have "conditions covered 5/6",=20 however, there are only three conditions (0: (year % 4) =3D=3D 0, 1: (yea= r %=20 100) !=3D 0, 2: (year % 400) =3D=3D 0). Maybe it would be more clear if t= he=20 report says "condition variants covered 5/6" or something like this. --=20 embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.huber@embedded-brains.de phone: +49-89-18 94 741 - 16 fax: +49-89-18 94 741 - 08 Registergericht: Amtsgericht M=C3=BCnchen Registernummer: HRB 157899 Vertretungsberechtigte Gesch=C3=A4ftsf=C3=BChrer: Peter Rasmussen, Thomas= D=C3=B6rfler Unsere Datenschutzerkl=C3=A4rung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/