From patchwork Thu Jun 27 08:52:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1953074 Return-Path: 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=RKE9tWkK; 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 4W8sr44CMQz20XB for ; Thu, 27 Jun 2024 18:56:36 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B2F90383600F for ; Thu, 27 Jun 2024 08:56:34 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 3FB703838A1B for ; Thu, 27 Jun 2024 08:52:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3FB703838A1B 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 3FB703838A1B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719478377; cv=none; b=iUBoRTWXQHcQSAp0pAVvvpoQsP7swk/I4Df92qfU/6KpbXGH/r52cUTkdT5KhyAh7Df/ecJjfbZMoBiM5aDatcS71kSCoJcR9+RMNWiwDucpiZVAOP3FrcEvo5jv0lSWtGPXUnJ7FFuLgRKo25TtPlUluQdStAnoY9pWaWyDjpE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719478377; c=relaxed/simple; bh=LNaxmJr5Pbbz1TXazoXqNj3y0VaFNiWWjX5L12tv130=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=sQSthqsCHAFdvnYzUFdP/N6iUbq6j/PHN90haZYEk534vCjub2PuKtODclLJt22sZPZH2y+5kVcWzZ57o3Vz1S/Rqp1TXKsAxzAMXoMJwRU0mKSSJlC7y8otS9Mq7pcMy9pDl3sQw0c3GT3csa+SipWWt5XVIvIYMX8Qn4tbTek= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-35f090093d8so5013539f8f.0 for ; Thu, 27 Jun 2024 01:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1719478366; x=1720083166; 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=ooNpRkwCSk9sY5qKaNpX8BWpE+7KCugZ5+T9QKvlvsU=; b=RKE9tWkKLiREt9FJiI8nAeSbUWbn1Sf2OSeRH7u/StH/YZpznra2qcPdGjk3PqkOOc ArFOJAGGje3bOoNS11P1vvwn39IGl84L0/LKuztkZjH3Tq33ypHmm4zCBlIf1fveu4k2 34Fe6aJvRqQ0URoykMxANiUBpHXqP4x+YR5RW4nXskWDm95dlFcAQUVEX13UziQbYYVF ScdUZY03vhK6LS1AxJTNzBj0zkTKlCEMdjsqLBdUcJE+eb+Wc9OiJA0TyhDLZ0IiWue6 RoG0BIHfiW1VhKJbHB2yhPKD+GkIOkQWVMcYoZcHNUFO4ZQyh/7GmAzKoA6noYGSmuwK ru0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719478366; x=1720083166; 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=ooNpRkwCSk9sY5qKaNpX8BWpE+7KCugZ5+T9QKvlvsU=; b=oSuaDlT/QWEEEmx40l/G99m+Kkcxd+HEr7WmtfvTRsr+ozNpk7sJ5sh81s8Gz8WSyX 6eEwT+fjk39r9R2U7zbcbu9P/bvkj0X9Kv79ZSAJyjCOaDxTbh7yTTuuuPsidxLg1W3V f3zUK3iU0wsNfggJc6j0qDSD67/yAx7tbZNSiGGy+83ynqHWiTgRR5GVcbdmtGjjqNLy w2XvNjbf/YAIwCEIWGJcaGBpzEWrM4yoGAcILUDZVm8X+EPZpnhU/98/9oeZQ1gyHiq4 kjdlKgirmgXnYVsnX3smKpe9LkC2QhC47I8RUGOWJpGzaiFSUCxXTlHyeQXP/TaEBsbD Yhhg== X-Gm-Message-State: AOJu0YyjTLVYrv4RmIPBlvjF1M+1Wv0i1ZzQCiQurt6I3GrPVhLej9zZ ILSVJ08Lo0C5fFJXWtj7yTpl2KnNKZo6OOwwD/77qG6yfn4AQrVWQc7fmUCJb37/ST0hm+CvvCo = X-Google-Smtp-Source: AGHT+IEqoxQlpfSLB3gjBKjstvWCn6dIWLEqJXeDLxY8sThPsWvRnpr8yBxHxVzdifmxaNl+2t+GJw== X-Received: by 2002:a5d:68d2:0:b0:362:41a4:974d with SMTP id ffacd0b85a97d-366e7a56ecfmr8713784f8f.46.1719478366061; Thu, 27 Jun 2024 01:52:46 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:2a5d:d7ee:58d:fee4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3674357c14fsm1149133f8f.16.2024.06.27.01.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 01:52:45 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 5/7] ada: Add missing dimension information for target names Date: Thu, 27 Jun 2024 10:52:28 +0200 Message-ID: <20240627085232.226541-5-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627085232.226541-1-poulhies@adacore.com> References: <20240627085232.226541-1-poulhies@adacore.com> MIME-Version: 1.0 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org From: Eric Botcazou It is computed from the Etype of N_Target_Name nodes. gcc/ada/ * sem_ch5.adb (Analyze_Target_Name): Call Analyze_Dimension on the node once the Etype is set. * sem_dim.adb (OK_For_Dimension): Set to True for N_Target_Name. (Analyze_Dimension): Call Analyze_Dimension_Has_Etype for it. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch5.adb | 1 + gcc/ada/sem_dim.adb | 2 ++ 2 files changed, 3 insertions(+) diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index b92ceb17b1b..644bd21ce93 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -4201,6 +4201,7 @@ package body Sem_Ch5 is if Current = Expression (Context) then pragma Assert (Context = Current_Assignment); Set_Etype (N, Etype (Name (Current_Assignment))); + Analyze_Dimension (N); else Report_Error; end if; diff --git a/gcc/ada/sem_dim.adb b/gcc/ada/sem_dim.adb index 45a0f2ab922..39c36332497 100644 --- a/gcc/ada/sem_dim.adb +++ b/gcc/ada/sem_dim.adb @@ -219,6 +219,7 @@ package body Sem_Dim is N_Real_Literal => True, N_Selected_Component => True, N_Slice => True, + N_Target_Name => True, N_Type_Conversion => True, N_Unchecked_Type_Conversion => True, @@ -1179,6 +1180,7 @@ package body Sem_Dim is | N_Qualified_Expression | N_Selected_Component | N_Slice + | N_Target_Name | N_Unchecked_Type_Conversion => Analyze_Dimension_Has_Etype (N);