From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id A4B2B385042D for ; Tue, 6 Sep 2022 07:16:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A4B2B385042D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x32f.google.com with SMTP id j26so6389781wms.0 for ; Tue, 06 Sep 2022 00:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date; bh=NAcPAvHk+J2Q4mxrF07u9WwYTX3Wyj93WnpLhU8gyNw=; b=lNNyksmmP7UPOWhvsJQDCaMFkq9zO5pHZw1M4drylCXlzPVAjVmba4ZJUM2KqDSdS/ yeOYEaaJJdRmOXZG5R7giFeCHBYyp2dy5Gn85YyqWAISIY1okuNh7FcuszBMX6BA+PgT HuyrHYOPMOEnRsm2DAp4u6HopDfi52JCvyWaLraScIs5WEicd0m7laAKcO1HLGbe9dQx 6KFPcwGp5vjEuheoazbLCzt69U52NP2i0/32ZaKOfFjydxJedvp1WmNuWBoh0DW6ewGq CmkFLKEpMiIbt5Bo+IK66l/OqWZG3Y7WY542VKCEWilGgJ//LctK1UyUkE+7SQ2W/aWq bFhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=NAcPAvHk+J2Q4mxrF07u9WwYTX3Wyj93WnpLhU8gyNw=; b=wmFqs2k+jVkFt5+u/2wtpMFDUP4xTewAsRnp9ddt4ZZrT8BYK0pT4lWTLfDIiady4i WVK8p2jfjBiQxYYcwYbBwanhraNJ7cO1/U785wdaBGiuKpWj0xLlEazuq9yMGuuSNCLi /p47xReRquaZ9FPL3vpXklNOxbId8X6T4Tcudp2n4qYyy5QnzlB+dNrF+TV+tVEoAGWj 6mixXq+A6L1t7qkBF2TSGz5n1nHuK5qxkFFULV5PcORoSEGaiq4BLP//KPpYNmHYpYbI nO/R/o15I+9SWEGXK/NGirCtq8w2kHfpuKokAN7JyA/OFWAXQSLmeOX6177H5GYqrijL +QUQ== X-Gm-Message-State: ACgBeo3cyxCngaOWJ1WFxqrcoVvkXddhnnkloY9P/rpWb52ZGNfFVEiz 8mD22taEXBvUggQdnYzLpfmcovyPLIO35g== X-Google-Smtp-Source: AA6agR6eU1MXzLf41DoIGs8GnF/hCdBwZq2SfUbb6U9tnT5k7gURXUk8R7dc1ylTyiBtlZEVk/rnWQ== X-Received: by 2002:a05:600c:a49:b0:3a6:673a:2a9b with SMTP id c9-20020a05600c0a4900b003a6673a2a9bmr12480914wmq.3.1662448563339; Tue, 06 Sep 2022 00:16:03 -0700 (PDT) Received: from poulhies-Precision-5550 (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id o24-20020a1c7518000000b003a83ca67f73sm13640912wmc.3.2022.09.06.00.16.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 00:16:02 -0700 (PDT) Date: Tue, 6 Sep 2022 09:16:02 +0200 From: Marc =?iso-8859-1?Q?Poulhi=E8s?= To: gcc-patches@gcc.gnu.org Cc: Steve Baird Subject: [Ada] Disable lock free protected implementation if target lacks support Message-ID: <20220906071602.GA1280530@poulhies-Precision-5550> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="TB36FDmn/VVEgNH/" Content-Disposition: inline X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,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: --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Do not select a lock free implementation if Targparm.Support_Atomic_Primitives is False (which indicates that the target cannot support it). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch9.adb (Allows_Lock_Free_Implementation): Return False if Support_Atomic_Primitives is False. --TB36FDmn/VVEgNH/ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -64,6 +64,7 @@ with Sinfo; use Sinfo; with Sinfo.Nodes; use Sinfo.Nodes; with Sinfo.Utils; use Sinfo.Utils; with Style; +with Targparm; use Targparm; with Tbuild; use Tbuild; with Uintp; use Uintp; @@ -649,6 +650,10 @@ package body Sem_Ch9 is -- Start of processing for Satisfies_Lock_Free_Requirements begin + if not Support_Atomic_Primitives_On_Target then + return False; + end if; + -- Get the number of errors detected by the compiler so far if Lock_Free_Given then --TB36FDmn/VVEgNH/--