Message ID | 20240621085819.2485987-3-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=O4rXC8te; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4W5BCf2SgNz20X8 for <incoming@patchwork.ozlabs.org>; Fri, 21 Jun 2024 19:00:46 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 98FF53899072 for <incoming@patchwork.ozlabs.org>; Fri, 21 Jun 2024 09:00:44 +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 4525E3895FC2 for <gcc-patches@gcc.gnu.org>; Fri, 21 Jun 2024 08:58:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4525E3895FC2 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 4525E3895FC2 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=1718960314; cv=none; b=hzu6MEI1sVyVpQj5frlnIqm23syF1NhkYhHdgJ38UOQznkNvTIVMGTvGBoICFqBwYdb1zPSsAH6evPlZiVnEfMtjy4LUj9zn+zodPk4obJwh78yFsTvp3b2GNgjRYVO09Ap0FfqtHhdpYQOn3ALuCzKMCBE2ckbsDDDIzxs8asY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718960314; c=relaxed/simple; bh=m9Xwcm3Ngpf1oz6fC+/sRpFep0VxO8oN3V/ji4CybFA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lypOtlJj/nGeGXOiilm4GpCGahwUqT8Gpagaa59w1rSWQdczGpiIXG6Q/ewAv4pkIl8XYymHit5BzMgnNMnCZgWIbiI0186aNRC5/2B5kIW6B38l+qeOuho7DjqykkpYvlAyVOWZP3H9A+DgT8oXj6T5joV/P4+iPXXa6S6pWkI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-362f62ae4c5so1014329f8f.1 for <gcc-patches@gcc.gnu.org>; Fri, 21 Jun 2024 01:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1718960312; x=1719565112; 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=wWRlNC7tGLT0rGfeUFG/33Hzw4/SWlx37Br/PuCORSE=; b=O4rXC8temF9B4aaRr/134p37KfV6f7QPJl5fRRzNixoHfXZGsUCJkap22jbxi7BQeb 1Z5CfOmJ1vETttsX1rgjzNQnH3nUJPw7rSQ1XTK9pPR8+cwE7AYfulTSBol73EygJ1UB cYzrJj2dndrW3iEu8+eP0NphZN6bwiBADMuC2rj+1H+zl044gq19nufH68g2imkgMScu qGMpYlrzyUULS6uDUAdqYFZb6b9xHCU+l+0fzlgy4ynSqkCAfC46RIXTb5C4V1MJrV25 108xgFHNqPgMbyhhtHRpA5yql5/9lCGgZlS4ApwBizlJ70fmY3bP2hQXfxisOHq0DJWJ jyWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718960312; x=1719565112; 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=wWRlNC7tGLT0rGfeUFG/33Hzw4/SWlx37Br/PuCORSE=; b=uLDIrFZ0OkPK8M1YjUD7YuQppHzOAyho9T15+svbQ7IYLY+ZbKET/n4A5Bje0IZroT 1CRSdFhsiUtTfXksMz927IGXDOMe1KbapN+pBU6oOwg3yoYq78yXdi09l9wbQLRmgPCm 4warUonNNavsY9QPB/YkK1u/EGgc8mgxvNufX2ycf/9mAlNyKfFm83lIoMVpSrb82NGv BZ4ViXZHDsQYvnzb47wi6XOcaiFuwORBTXXSbBxZXaHl0FG314PnfG8YPcamdsnoAyeh CGg6ffz/yOxkrJctax+wEUUfHruFWpBD2Y0iGsxPH2RqjOIAOi61Vcoa3E51OFL5VVfH Z81Q== X-Gm-Message-State: AOJu0YwKXESCrseH6uwWVVJG7iTSVoyjCjcUo4MdDcwhYi15v6+foqYa uX5oL5Ka7jgdpRFZrLk2xN2pmxEGprUs6uq4lTH1kgQuxn4hsHIs+C3aR9D2YMkJjsrm5gWecMc = X-Google-Smtp-Source: AGHT+IG8cxD1U0t1BS5dEiYAE1Wzh6T0ZQj4x8hBAQR5j9lf6GZjrszOXPkC6uimulosEckdLlT7zg== X-Received: by 2002:adf:f4d1:0:b0:362:1d6c:b867 with SMTP id ffacd0b85a97d-3621d6cb9c6mr10315911f8f.3.1718960312095; Fri, 21 Jun 2024 01:58:32 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:a589:2704:bfe1:5d92]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4247d0c5485sm55322375e9.21.2024.06.21.01.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 01:58:31 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou <ebotcazou@adacore.com> Subject: [COMMITTED 03/22] ada: Fix assertion failure on predicate involving access parameter Date: Fri, 21 Jun 2024 10:57:59 +0200 Message-ID: <20240621085819.2485987-3-poulhies@adacore.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240621085819.2485987-1-poulhies@adacore.com> References: <20240621085819.2485987-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 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/22] ada: Spurious style error with mutiple square brackets
|
expand
|
diff --git a/gcc/ada/accessibility.adb b/gcc/ada/accessibility.adb index da4d1d9ce2e..298103377a7 100644 --- a/gcc/ada/accessibility.adb +++ b/gcc/ada/accessibility.adb @@ -398,7 +398,7 @@ package body Accessibility is -- Local variables - E : Node_Id := Original_Node (Expr); + E : Node_Id; Pre : Node_Id; -- Start of processing for Accessibility_Level @@ -409,6 +409,17 @@ package body Accessibility is if Present (Param_Entity (Expr)) then E := Param_Entity (Expr); + + -- Use the original node unless it is an unanalyzed identifier, as we + -- don't want to reason on unanalyzed expressions from predicates. + + elsif Nkind (Original_Node (Expr)) /= N_Identifier + or else Analyzed (Original_Node (Expr)) + then + E := Original_Node (Expr); + + else + E := Expr; end if; -- Extract the entity
From: Eric Botcazou <ebotcazou@adacore.com> The assertion fails because the Original_Node of the expression has no Etype since its an unanalyzed identifier. gcc/ada/ * accessibility.adb (Accessibility_Level): Apply the processing to Expr when its Original_Node is an unanalyzed identifier. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/accessibility.adb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)