Message ID | 20240517083207.130391-34-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=iZ/R/1IY; 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 4VggLv2Q4bz20dJ for <incoming@patchwork.ozlabs.org>; Fri, 17 May 2024 18:37:27 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8C98938460A2 for <incoming@patchwork.ozlabs.org>; Fri, 17 May 2024 08:37:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 95D253849AF1 for <gcc-patches@gcc.gnu.org>; Fri, 17 May 2024 08:32:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 95D253849AF1 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 95D253849AF1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715934794; cv=none; b=izpozWA7aNNQaP4WeIa79qe0zgNXhIOmdk8c/rc1MqhqpfLQ9oMxhp8+ilLDrkydQG6yVpNhq39Yj/ChEDbfZ8sh3Yo1QDal8pEyKZvZqXPOCtqDyC0D4Jvav2CRglKgYK4cJ8Y6De2EfPs0cne/JyAyqHSz/wu3VldVdhTBp60= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715934794; c=relaxed/simple; bh=cLsdsa2XW8ESbxOwmyPk4QlaY+YNUufR/UtPvn50D2s=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=yAmRrblTr6DwBFptTec8OzLJUqgnQAB2CSdvI+nWT0bN800uNrv8BBdRNzWHym3sNuAH7HYKn6tYAcTnZ/YI6lMhLtG1pLAsjblZRkpZ15ib9rLg1jfG4qH9gqjWHXGs9p86giLXwXq1UbzGrtyRB8TnGmd/w3K+HjTVFgSYRyI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4200ee78f33so49690085e9.3 for <gcc-patches@gcc.gnu.org>; Fri, 17 May 2024 01:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1715934770; x=1716539570; 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=nntESivhoj0F/bgIjH68GIoijT+T+S4R7T/wLDADyVY=; b=iZ/R/1IYvANV3ZgqGkUNnST7wJIudN6/MyYC58imZIMF3h5095stbmIaRDhjTXCTSk r2WymdfWuHK4Ul5zO26ZkR0WdEsOaz5hnBObIyJelQBFQd1lYKug4OhjNPSsZCW8pj5o Lkd5n1gEnBqbCOhY1LnYOZzwhb2/oWMYhPU7k6QjmPcKTv7bTPysrJj5tFCawdbfnjuu VbguTEoN+/G3uKzCYJyOqRoXby6DeSprNirj+SyyQb6pj2hF+Z+w8/StHqG3sGsCUJWF zeZULRBQIhw8Et/TG6D6F+3dfR0pppOpdLPKUUxbxu+kpFP5+dk7tTbrjJlGmI9F3maI k31Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715934770; x=1716539570; 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=nntESivhoj0F/bgIjH68GIoijT+T+S4R7T/wLDADyVY=; b=DT1IvT9bB+cSE9jQlyzHluEiMH0/iv/tSpYf+xWR4SDtZ0GpNyd5jz7UX80Zrp+cl0 IpUX95BiY+z4A8XIEoxigWPnhW6PfVn1s51kqEuV7pH2paErBro+r8OdgdP+hvHzQJuZ H+/UZKHvFVoONtqfPC67dDN49/v42vKNmJIFjYL3CBPwyDuluZJ0e9aeSVdOrfrCMSE3 rDwBYbALCB6ZGozrOA47KXQqPE6A/B2n8ZYSCQk9tFdl/aleoOOuNipUxANAXd8pin5O tQBzG2KKYzhdqxUGFFL5kBekjkmdocomXfcFa+p2VAQrRUBerJ4jjwEap1wjiXkDF1PJ 9tBQ== X-Gm-Message-State: AOJu0Yy4iMHrGGLCTfC/M7rN8H0mSuB5e+rnHPj0M19S70YvIxMBI1N6 W+JMIhko0HsMRI509RKHtTmhc3DUGAlizfWSl2o9igb+RVMliTho9Fel/Kb9smBXpMOcBvwG2Ik = X-Google-Smtp-Source: AGHT+IE3hoS09T7/zAyz9wj+uaizORpX/PRhnCEUkEJZlN2GG8bk7Y2qWRncIM/TVLwBlzPNvlcMRA== X-Received: by 2002:a05:600c:4fc9:b0:41c:1434:f571 with SMTP id 5b1f17b1804b1-41feac59deemr160083005e9.37.1715934770386; Fri, 17 May 2024 01:32:50 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:de37:8b1c:1f33:2610]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-420273cff03sm75197045e9.26.2024.05.17.01.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 01:32:50 -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 34/35] ada: Remove outdated workaround in aggregate expansion Date: Fri, 17 May 2024 10:32:06 +0200 Message-ID: <20240517083207.130391-34-poulhies@adacore.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240517083207.130391-1-poulhies@adacore.com> References: <20240517083207.130391-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.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 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/35] ada: Add support for 'Object_Size to pragma Compile_Time_{Warning, Error}
|
expand
|
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 9c5944a917d..892f47ceb05 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -711,9 +711,10 @@ package body Exp_Aggr is return True; end if; - -- One-component aggregates are suspicious, and if the context type - -- is an object declaration with nonstatic bounds it will trip gcc; - -- such an aggregate must be expanded into a single assignment. + -- One-component named aggregates where the index constraint is not + -- known at compile time are suspicious as the user might have + -- intended to write a subtype name but wrote the name of an object + -- instead. We emit a warning if we're in such a case. if Hiv = Lov and then Nkind (Parent (N)) = N_Object_Declaration then declare @@ -741,8 +742,6 @@ package body Exp_Aggr is Error_Msg_N ("\maybe subtype name was meant??", Indx); end if; end if; - - return False; end if; end; end if;
From: Ronan Desplanques <desplanques@adacore.com> Before this patch, the compiler refrained from rewriting aggregates into purely positional form in some cases of one-component aggregates. As explained in comments, this was because the back end could not handle positional aggregates in those situations. As the back end seems to have grown more capable, this patch removes the workaround. It also extends the comments describing a warning that is emitted in the same configuration with aggregates. gcc/ada/ * exp_aggr.adb (Aggr_Size_OK): Remove workaround and extend comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)