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 5CF533891C0B for ; Mon, 9 Aug 2021 08:02:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5CF533891C0B 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 sslproxy02.your-server.de ([78.47.166.47]) by dedi548.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1mD0Ek-0003aK-Fg for gcc@gcc.gnu.org; Mon, 09 Aug 2021 10:02:18 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mD0Ek-000LYN-D4 for gcc@gcc.gnu.org; Mon, 09 Aug 2021 10:02:18 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 1729C2A1610 for ; Mon, 9 Aug 2021 10:02:18 +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 zjzdwqyUxjBT for ; Mon, 9 Aug 2021 10:02:17 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id A77922A165B for ; Mon, 9 Aug 2021 10:02:17 +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 3RTgqs4m-ykM for ; Mon, 9 Aug 2021 10:02:17 +0200 (CEST) Received: from shuber-nb-linux.eb.localhost (unknown [10.10.171.10]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 862302A1610 for ; Mon, 9 Aug 2021 10:02:17 +0200 (CEST) Subject: Re: get_gcov_type() vs. -fprofile-update=atomic From: Sebastian Huber To: GCC Development References: <3bee8eef-1331-5bb8-0f65-6997ea134e5f@embedded-brains.de> Message-ID: Date: Mon, 9 Aug 2021 10:02:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <3bee8eef-1331-5bb8-0f65-6997ea134e5f@embedded-brains.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.103.2/26257/Sun Aug 8 10:20:05 2021) X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Aug 2021 08:02:20 -0000 On 09/08/2021 08:51, Sebastian Huber wrote: > Hello, >=20 > I would like to use gcov for a multi-threaded program running on an SMP= =20 > machine using a 32-bit SPARC/LEON3 target. This target supports=20 > HAVE_atomic_compare_and_swapsi but not HAVE_atomic_compare_and_swapdi.=20 > Unfortunately we have: >=20 > /* Return the type node for gcov_type.=C2=A0 */ >=20 > tree > get_gcov_type (void) > { > =C2=A0 scalar_int_mode mode > =C2=A0=C2=A0=C2=A0 =3D smallest_int_mode_for_size (LONG_LONG_TYPE_SIZE= > 32 ? 64 : 32); > =C2=A0 return lang_hooks.types.type_for_mode (mode, false); > } >=20 > The long long type is 64-bit, the get_gcov_type() returns a 64-bit type= .=20 > This disables the atomic support in tree_profiling(). >=20 > For what is the gcov type used? Could we add an option to force it to=20 > 32-bit? What would be the consequences? >=20 > Another option would be to add something like an=20 > -fprofile-update=3Dforce-atomic option which would resort to libatomic.= =20 > Which would deliver bad performance, however, correct results in a=20 > multi-threaded program I guess. Here is a proposed patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-August/576947.html --=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/