Message ID | 20240610090747.1557638-15-poulhies@adacore.com |
---|---|
State | New |
Headers | show
Return-Path: <gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=MGm6iRI+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VyR0m5tw2z20V0 for <incoming@patchwork.ozlabs.org>; Mon, 10 Jun 2024 19:12:56 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5EFBC385332C for <incoming@patchwork.ozlabs.org>; Mon, 10 Jun 2024 09:12:53 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id EEA9D385B52B for <gcc-patches@gcc.gnu.org>; Mon, 10 Jun 2024 09:08:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EEA9D385B52B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EEA9D385B52B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::431 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718010498; cv=none; b=ROU9OyY3Xg59HGr3CmsaBqxs9ugCwoBVycwC2b3jsEmoiSoCv0FrGY2VJLryVYcDuHjNwfqIQMO4lrvAQNoMP0qI90U8jTO+jLCv++xhlAm7oRbftQqqkSoucJ1LO4mikmomLK4eMZkooqiq8m+F/ogWMG99oc5J2X16m34mnEI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718010498; c=relaxed/simple; bh=/eD/v5B40rHaEeJRbfUOsslDGpqkbfnSrAL8a4Hj/ys=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WoaUdumTk4nQM6PFhUGvO1AMZkU35ogfpvQ53MG8m/+xrHU9qghY3KI71t8spa6G/lkYFQZ+IO3ORgkQud7dZfnU4M853bf017KuWsx95BGwSFK+0i7KE0ACThaWPznT/rEwiXb6k1LryLU7150ZFtRKLv50pMxXiPgE2fyk2T0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-35ef3a037a0so2517882f8f.0 for <gcc-patches@gcc.gnu.org>; Mon, 10 Jun 2024 02:08:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1718010494; x=1718615294; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UNjYuBy/tyNSAi7Yy8BgTlH5Rgwtdzh7rXirTjatpms=; b=MGm6iRI+SmKEf0hnRp4Qwe/kp0mzcUjXN1Iwsl0elDzP9WRHcb7jWjdAIjTPdXzje+ 8GRLbDvx14fewCScC8OdSC7ji2PQswBRAYBu6Sx85FKpziAHygEvOSjYyMY0DJD8k6Y6 sNSIK8ss12uWLpWlgbWCa+KOfQ7eYHGjIXGl7MSLDoZF02DGFOe2Ke73CnjIdU2V3Vas iOXdQ8gTXddaEQXGs2GOlE8nA3jZmUtDuHp10mG+04NUVVaQ2eGudzwIHMz3s1H95iUo ytSdHnLhHdtNUQxB+bJWVqcwkKyc1oIjlGoxOtW2DcYPbm9DTiwZSUnQgeoVWDMWxvHN BSpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718010494; x=1718615294; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UNjYuBy/tyNSAi7Yy8BgTlH5Rgwtdzh7rXirTjatpms=; b=LnNPBVbTt6vEkNQmdqZjhZ8Qdsh8aoGMIvGXzxDCIOftX9KXcAFyh+xVuSdLxr6/82 lLfaETknil4ppPICmaF1LomKo8P3ypkXTPQDVvjLTgip6rWR7keeGOe461coXlg9As1j 4IT4bBdh4b0n11IFLofclxGZjwiRwJvD9mrvXYpxd2kUhYvSzsM541+eXFVn8vUfK8C4 SxKwpI125O0xeCPO+QOBcJlNTkTN6fAJpXDmYjiHcPVqAly4odb9c6HEfw9rFZaAPzKq h9JjgDi0rTLxhquIavC81SHBDmmYKF5nWcTss5jUp0dP2A5uQO0506cZcuEkhgsWM1LJ aW2w== X-Gm-Message-State: AOJu0YwHZky3x5tkUa360wrr1KE6EAmQaTrJ6OhnHppc/Fmk2ChWAt44 jocKl7rR6XNpVlg18afAhB/6/OGuzUDHUJsH+BFvQdlnX7nV0ff9xZCnxQtDtvHJTxUsekQuHcg = X-Google-Smtp-Source: AGHT+IH+pBvGPCe+aMxk3JSFrQuL2ItPpFxzTbkhR+cMzLRtAxV3OxI2fW/X1QkEJFa0tJQnxpfmfA== X-Received: by 2002:a5d:6ace:0:b0:35d:bd7e:70bd with SMTP id ffacd0b85a97d-35efea5f362mr8080295f8f.28.1718010493630; Mon, 10 Jun 2024 02:08:13 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f0f551c20sm6454970f8f.69.2024.06.10.02.08.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 02:08:13 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques <desplanques@adacore.com> Subject: [COMMITTED 15/30] ada: Fix usage of SetThreadIdealProcessor Date: Mon, 10 Jun 2024 11:07:31 +0200 Message-ID: <20240610090747.1557638-15-poulhies@adacore.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240610090747.1557638-1-poulhies@adacore.com> References: <20240610090747.1557638-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.7 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org |
Series |
[COMMITTED,01/30] ada: Refactor checks for Refined_Global in generic instances
|
expand
|
diff --git a/gcc/ada/libgnarl/s-taprop__mingw.adb b/gcc/ada/libgnarl/s-taprop__mingw.adb index 3a124ba78d0..38e281cb721 100644 --- a/gcc/ada/libgnarl/s-taprop__mingw.adb +++ b/gcc/ada/libgnarl/s-taprop__mingw.adb @@ -1308,7 +1308,13 @@ package body System.Task_Primitives.Operations is Result := SetThreadIdealProcessor (T.Common.LL.Thread, ProcessorId (T.Common.Base_CPU) - 1); - pragma Assert (Result = 1); + + -- The documentation for SetThreadIdealProcessor states: + -- + -- If the function fails, the return value is (DWORD) - 1. + -- + -- That should map to DWORD'Last in Ada. + pragma Assert (Result /= DWORD'Last); -- Task_Info @@ -1317,7 +1323,10 @@ package body System.Task_Primitives.Operations is Result := SetThreadIdealProcessor (T.Common.LL.Thread, T.Common.Task_Info.CPU); - pragma Assert (Result = 1); + + -- See the comment above about the return value of + -- SetThreadIdealProcessor. + pragma Assert (Result /= DWORD'Last); end if; -- Dispatching domains
From: Ronan Desplanques <desplanques@adacore.com> This patches fixes the way the run-time library checks the return value of SetThreadIdealProcessor. gcc/ada/ * libgnarl/s-taprop__mingw.adb (Set_Task_Affinity): Fix usage of SetThreadIdealProcessor. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnarl/s-taprop__mingw.adb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)