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 DE13E3858D33 for ; Thu, 23 Nov 2023 13:47:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DE13E3858D33 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 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DE13E3858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=85.10.215.148 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700747279; cv=none; b=FzXUgeFwK0W+r8SjZORJomkhSYl9J13jkkt0AqtatRhXgZPfKK8YTuVj3UBcEgNmxcCChg05q3Ns9V2/n6zU+LVT1m9M7E889hlVw/ScC81/F/v8WU8ge0mrisCAFtC1d61PcPcIyxZLEhGqJp0b//yx/lQfB6PnT+sAWxGf33M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700747279; c=relaxed/simple; bh=popRNJtHMPLEL0jjC0xZCPxeI0aXlo897WmOzShFp18=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=RINfTQ4551yPzRrYrso9nSTsJek/dB0gkI6pEJ9FVOtZCNv1OthNDHcFqnc4X1P1GEiPnxzmRobcuxsW6A1DmX2vOiFTf0Tv9XEr8oCHuLAonMKlN+g2R+Zrhh7CCIjr3mtAcG+H42EMarMbixK8XJyWRWIovDakTzLU2HPR5Vc= ARC-Authentication-Results: i=1; server2.sourceware.org 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 1r6A3f-0006Lb-RN; Thu, 23 Nov 2023 14:47:56 +0100 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 1r6A3f-000TD3-NW; Thu, 23 Nov 2023 14:47:55 +0100 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 55D6748015C; Thu, 23 Nov 2023 14:47:55 +0100 (CET) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10032) with ESMTP id yKx7QvNBNzL9; Thu, 23 Nov 2023 14:47:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 07E99480193; Thu, 23 Nov 2023 14:47:55 +0100 (CET) X-Virus-Scanned: amavis at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10026) with ESMTP id wbmX6nbEWCgb; Thu, 23 Nov 2023 14:47:54 +0100 (CET) Received: from zimbra.eb.localhost (unknown [10.10.171.18]) by mail.embedded-brains.de (Postfix) with ESMTPSA id C4F0F48015C; Thu, 23 Nov 2023 14:47:54 +0100 (CET) From: Sebastian Huber To: gcc-patches@gcc.gnu.org Cc: Richard Biener Subject: [PATCH] gcov: No atomic ops for -fprofile-update=single Date: Thu, 23 Nov 2023 14:47:51 +0100 Message-Id: <20231123134751.25302-1-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldi-networks.de X-Virus-Scanned: Clear (ClamAV 0.103.10/27102/Thu Nov 23 09:42:42 2023) X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,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 List-Id: gcc/ChangeLog: PR tree-optimization/112678 * tree-profile.cc (tree_profiling): Do not use atomic operations for -fprofile-update=3Dsingle. --- gcc/tree-profile.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gcc/tree-profile.cc b/gcc/tree-profile.cc index 1ac0fdb3bc98..9c8fdb8b18f4 100644 --- a/gcc/tree-profile.cc +++ b/gcc/tree-profile.cc @@ -767,6 +767,7 @@ tree_profiling (void) =3D HAVE_sync_compare_and_swapsi || HAVE_atomic_compare_and_swapsi; bool have_atomic_8 =3D HAVE_sync_compare_and_swapdi || HAVE_atomic_compare_and_swapdi; + bool needs_split =3D gcov_type_size =3D=3D 8 && !have_atomic_8 && have= _atomic_4; if (!can_support_atomic) { if (gcov_type_size =3D=3D 4) @@ -775,6 +776,9 @@ tree_profiling (void) can_support_atomic =3D have_atomic_8; } =20 + if (flag_profile_update !=3D PROFILE_UPDATE_SINGLE && needs_split) + counter_update =3D COUNTER_UPDATE_ATOMIC_PARTIAL; + if (flag_profile_update =3D=3D PROFILE_UPDATE_ATOMIC && !can_support_atomic) { @@ -788,13 +792,11 @@ tree_profiling (void) =20 if (flag_profile_update =3D=3D PROFILE_UPDATE_ATOMIC) { - if (gcov_type_size =3D=3D 8 && !have_atomic_8 && have_atomic_4) + if (needs_split) counter_update =3D COUNTER_UPDATE_ATOMIC_SPLIT; else counter_update =3D COUNTER_UPDATE_ATOMIC_BUILTIN; } - else if (gcov_type_size =3D=3D 8 && have_atomic_4) - counter_update =3D COUNTER_UPDATE_ATOMIC_PARTIAL; =20 /* This is a small-ipa pass that gets called only once, from cgraphunit.cc:ipa_passes(). */ --=20 2.35.3