From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f7e7fc9fe6so52252615e9.3 for ; Tue, 13 Jun 2023 00:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1686641889; x=1689233889; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=HBn2utg/YNGjZMRIzgUL1t2GGFOAGRrjqUvzDCE2Rzo=; b=csdSPJ0wkpX7vVBIYsdGBUh1i6p61Pq1ka9x6tTWBEBHKZ0h77TqCY9dzVUpmDyY96 08g2iiLjMCqEkIjxgWgo49wzDBNXe69oY9KBkzNkxKiR+8z3L6gfBHOe8Qed6BWwaX3s vCPygBqY2j4a3eQRt0WaEneisZz9pjLUs2kxcj09BgjTAICLhYXwEzYeV8s5FYb86DNh LxUxwpYwdalyn0OWICLVT5gnZWJhJOid+/fGqQQjpbVlGTdJG8LEUCKxptqFOhlq1JF+ sfTgT05S07gkLXCC32eyTGq1iyDsSgZfoepFVisfZz4CBZv/heLQDjKnUJreWJBcwvi8 ipKQ== 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-Google-Smtp-Source: ACHHUZ5XzqhJ/XTnO1Fsr2omGa2PoLcbdFw3xp5ltPYsQpUOU7R0mMQpRcxRk+EZCwTtCxHWAchh5A== 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) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= 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 Content-Transfer-Encoding: 8bit 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 List-Id: 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. -- 2.40.0