From patchwork Tue Jun 13 07:38:04 2023 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: 107142 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp367734vqr; Tue, 13 Jun 2023 00:45:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IX5MtIoWQpCfJphl2nFXVTXllVm89tGjIYYn0uePQlNYkwrOmM5sTwoZvIJqhOAu72a7O X-Received: by 2002:ac2:4985:0:b0:4f3:a485:919a with SMTP id f5-20020ac24985000000b004f3a485919amr4912752lfl.57.1686642324223; Tue, 13 Jun 2023 00:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686642324; cv=none; d=google.com; s=arc-20160816; b=J8C8S8WgFmvJE+WCKZsnfNPjGF+fmfwcPRf1XP/DwugT32QEbw+JLYhjAeeKYdU2Nf 7B1DW+gbf523WshnwiqwjMKWAvhkM9J0KvJbryg0GdklPVTJsKi/K0orHesqgrV5aEAm R9yqwq/8QvjZbG3nOf6ibqrdqoK3cCj4j643n5EQf/ASlZCjWppQv4EK4cBd13eDbycQ rk2m70a2+E18w5NI8cqoPpueiLVPQQnLyR9NbelAFCA1zTTVVbOh/WeorT6uQMKEgFa6 XtKwSw6dygVL7zdNT70tsQlhmZGxMyW73ucFgY8opXsbysH6L0XE8LiC8aFYQ0q0qgaa GuwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=HBn2utg/YNGjZMRIzgUL1t2GGFOAGRrjqUvzDCE2Rzo=; b=uxOupg37qO4thTnolMJ+OsdLiV7sPxdfZzWnPk0vuGW1wefGpIT3Id7EDTuggT+g+K 4TcCSUwvf1k/r4MiP3bYBpOHYZRGMrsgHsPaVtDgedt6roXhCTOSd4Qvw+DwZC4NSYJu /9kUikWl4j2bToXt3R3h+yyesPO5h1nz420Qy+wooEW4TgtpnmDoV8gS5VWyW39j4TIn V946uFYeJqX1awbFz5BbPCSfmrRfLQLHshYJ968P5G58vEXfWKjW9/HY1IwpE2WT03iH 3ZLAlKT5tD7xU69dPhQZZ8BGr/e3vvW8ONSM7m7Wvwm3fEvUAwVeKveI4gBnZdQm23Em pD2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=unx7EBb4; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id u7-20020a50eac7000000b0051639d06ea4si7302022edp.473.2023.06.13.00.45.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 00:45:24 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=unx7EBb4; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F1F73887F71 for ; Tue, 13 Jun 2023 07:42:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F1F73887F71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686642120; bh=HBn2utg/YNGjZMRIzgUL1t2GGFOAGRrjqUvzDCE2Rzo=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=unx7EBb4h6arXnVO2UCifjUoXx6xGg4z9HuC8fEFvkfMZ0wKrpCxskw6hOcQiTa5U VxrqigN9uFzm9+ZRCOx/xS0aRqv8pqhekNHK8rvwrL0DGhAup+fiU/LZiahDwE3Ql9 LdjriU0sOQqG5/VLh31RmZO7bbcMfvQvGRxNUxBQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 5B9963858421 for ; Tue, 13 Jun 2023 07:38:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B9963858421 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f7e7fc9fe6so52252615e9.3 for ; Tue, 13 Jun 2023 00:38:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686641889; x=1689233889; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HBn2utg/YNGjZMRIzgUL1t2GGFOAGRrjqUvzDCE2Rzo=; b=jarEdrOzE7+LQcQ22gFl4+/4WbpQ17pCewYw6DDTrnHJsv6LAVBOIKPfRKhal988MQ pLz7YfuOThIzOfzXLDStNedVVByf0FTaejZE/1TEgGEvSmKCRUxGMY7ofy636nIP0TBY xT302CSCSctw3onk4VvPU59hsxHUIMGynauG0kuCiI/lFQUFZWrqzswyHWT4CmXJKLmw IC6CBH+3sc+u6zPvgOJ1v4wJYT70PRHO/378keVPmY622q+xWFzAG2QwFVnUJOvHvnTV 4d91SJtMhQmrNSL+Ohvw6+aiCKBIjsCUuj8b2/7sGWqFR2+2EjTsGThrN81iTjksgl4b A5tg== X-Gm-Message-State: AC+VfDy83GhVq5qI6isKJoRknLPs/jpuj0e/kh9gSP7ZjHNcl6X5pdZN XP7seaF/GDtsAIqI7sxwzSRAATnE+SuQ5PRmhCs+Gg== X-Received: by 2002:a05:600c:2242:b0:3f7:3685:1e10 with SMTP id a2-20020a05600c224200b003f736851e10mr8341472wmm.40.1686641889268; Tue, 13 Jun 2023 00:38:09 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:bfa8:5d29:40e5:cc66]) by smtp.gmail.com with ESMTPSA id v5-20020a05600c214500b003f819faff25sm6244240wml.13.2023.06.13.00.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 00:38:05 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Fix wrong expansion of limited extension aggregate Date: Tue, 13 Jun 2023 09:38:04 +0200 Message-Id: <20230613073804.239660-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768572661938247982?= X-GMAIL-MSGID: =?utf-8?q?1768572661938247982?= From: Eric Botcazou This happens when the ancestor part is itself an aggregate: in this case, the tag of the extension aggregate is wrongly set to that of the ancestor. gcc/ada/ * exp_aggr.adb (Build_Record_Aggr_Code): In the case of an extension aggregate of a limited type whose ancestor part is an aggregate, do not skip the final code assigning the tag of the extension. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 2 -- 1 file changed, 2 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index c145d79f482..15230571123 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -3039,8 +3039,6 @@ package body Exp_Aggr is and then Nkind (Unqualify (Ancestor)) in N_Aggregate | N_Extension_Aggregate then - Ancestor_Is_Expression := True; - -- Set up finalization data for enclosing record, because -- controlled subcomponents of the ancestor part will be -- attached to it.