From patchwork Tue Nov 7 09:20:31 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: 162332 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp111845vqo; Tue, 7 Nov 2023 01:21:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLIxb/9TA5XiuiEvb8Gp5FZWlxeidufK6Ao09euKIV6aTxtaTLhqdOMo1qLxHsPyK34MKv X-Received: by 2002:ad4:5baa:0:b0:66d:6869:5e62 with SMTP id 10-20020ad45baa000000b0066d68695e62mr32456172qvq.46.1699348901765; Tue, 07 Nov 2023 01:21:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699348901; cv=pass; d=google.com; s=arc-20160816; b=LpaZqNzi+TskAs6c/01NPovR+rfXZdmSOLGHZqGvNT2qfFVWnlyP8y91ApbgyiBCui 9GqQuNJe1Vk9+23zUQhPtwsFL9g6sALP1PAAdON09e/Z/+7kL4w0zprKpoyhqe8TtHxQ 7EMKHmFdKKs7eYu2OlDaVe0zvyDqhdNdQP+AuR2kVPduPk1SNdveRGEiRXv9xUJhCUuF tN27rwzAjak0p+9n7zR7rVqLkj4pEja1hq1JbcQgVRUCPrrXyckYmxlJeie71Z0bVlXC 1XOrQuj27RIGSRVylC4Y97TpmXrd/SPpG/ZXozV4ZmBKx0WjIKJQeo2BvLIMFEfug3gk 6GEA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=VbPYhd2qK2ZgaHzgoL8WPUMSsv1qpyV6WTkZshN2tHI=; fh=QRb7QY4BZ0mIIAPiH2G4K0PcYKRtRn2i5A6VLUA8cN4=; b=WfPm469qc3E1eXIptGQgjZQ/0Hyagoa//Gu1mf1T7kyy+KrTOxJ79ZEY3ReawZSUKL HshT++aMw+9kN2Cva4X0s7PJsZeAlT4R9KQoIz5WtNHlEyg+r8Ic7xa5gerDVXV80MJ8 4kXLhYOsVJnjshlqlCWVk1Kbcx21Yjpe73TisjvZL4gmYRAYjj/1np5ndVpV3RDdk3fV Bj5cTsHGJk81eqgELZkt+shiBbosdxa45FjIga4O7Y7BhmHDaCVUlTxS7Wm8wRRhIe2A U0BFfJ7eY0ocT+ihwEfCUFRl4MBCjjsa3AbjmjEmaBkFD6qNICsCadQNZNEs+a/1nAmO IGMg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=KlZVldl9; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id f17-20020a0cbed1000000b00668ed051a35si6878701qvj.548.2023.11.07.01.21.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 01:21:41 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=KlZVldl9; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5FE353831E2F for ; Tue, 7 Nov 2023 09:21:09 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id A86063870894 for ; Tue, 7 Nov 2023 09:20:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A86063870894 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 A86063870894 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699348837; cv=none; b=DT6O+gOQLEkfaRDON+X1g5y0twC2aCdPOkBcJcSKYCPsG+6xPXL7z8cGgKVh+Urdyuoo55p/JJGVGPg67Pqp05H1LotY+OVRBymPBd07av53ndy9vGwZkiowYbWyJLuzTe7xQJm7Nw9uhjCzOXjbjYmv3HweYKydIVsR5sjsUK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699348837; c=relaxed/simple; bh=NheaO/w4/wieAQchr4jfH6J9yA2KeP26rqtOiyQbOWU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WPRhunO7YGKj4B6FS1elZLkuYynrfBk8Cmlr30l9txV4x/UHWXHiu7QQtwEPUT7nQ67pV4qlgyQ87vvKYK1doShIxJx7VY3Nphkfvt9hmrpxWKRx7refu84p70YEf359eCRh4SWGcufCaXQU0yVcoZK3WqOO1JUDEuKY+413kGs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40806e4106dso32959165e9.1 for ; Tue, 07 Nov 2023 01:20:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1699348833; x=1699953633; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VbPYhd2qK2ZgaHzgoL8WPUMSsv1qpyV6WTkZshN2tHI=; b=KlZVldl98ZGWBvDzuvPyH6T+shjpwtuYchE0XZ0HzxXLaJDiKkOi4YWIA6/jdCX/jd oiOiIlS7yvNL2HRMLUm2bSLdb4OO2K0IkSH8lWBgtMqJtBMXHUuhFGUqjyGTzrw3raWI N6q3dDyTeq4bI3VWNpT9w1sYwYitu/arHDvMJL39pUbQaL6ktFq9tfBAzyDESW/m4xjh oYnGoHZLOS/vYJE25tiNJf2QoffS32qqmPcrhJsJqwB8vqc/ZieOaj+hM9lYNVRSAjMa ywuM6n7yQMldLSOKZTVllx4fv8Ynt1iqTAQQWp727shtCqdJwiuWrYxOPiOXWNexYxCY H6Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699348833; x=1699953633; 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=VbPYhd2qK2ZgaHzgoL8WPUMSsv1qpyV6WTkZshN2tHI=; b=UYydUoZnOWXZJYvdG/VUD55WhBxXFBTsr0xcumD/7a3Kg4NyHsVXFF7bNFY0n/8/5A gWLfGH9LPQgWG+bcX+HqIkfWjpuVEbZHK6NSxp+vBeAfxE6vAJ0mUlliZBkIYmSKfbHK 1kGDfW8jiQtdI/p5pUqtUVMU8rFBOEHTh7mDpae2cIl0a6BUGt/2NRpBBAD9YheptkTu uGSIBQynwda4thud4ua1av+MdW5gNtrcd4FGDCLWrQ18lGvRBP6mI9HiA0B/EaYPK12C naNlHRvQEOn4By0G2H6rEZ6IpOp946oTc58+eAwWgi3XBQ6X49cfihFJK9AHwo9wG+ij AoDw== X-Gm-Message-State: AOJu0Yz10humieWDMwPtB9SzxidoClO0/bT4bJyuEfUERO664GzOX4e9 21INOkJfdt8EpExAqB7uPgeIhbn77KMMiihcY08FHA== X-Received: by 2002:a05:600c:458e:b0:408:3634:b81e with SMTP id r14-20020a05600c458e00b004083634b81emr2338964wmo.13.1699348833549; Tue, 07 Nov 2023 01:20:33 -0800 (PST) Received: from localhost.localdomain ([2001:861:3382:1a90:dbc1:a1d1:2e58:4040]) by smtp.gmail.com with ESMTPSA id d8-20020a05600c34c800b0040770ec2c19sm15416096wmq.10.2023.11.07.01.20.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 01:20:33 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Fix expansion of type aspects with handling of aspects Date: Tue, 7 Nov 2023 10:20:31 +0100 Message-ID: <20231107092031.3906616-1-poulhies@adacore.com> X-Mailer: git-send-email 2.42.0 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, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781896473936495298 X-GMAIL-MSGID: 1781896473936495298 From: Piotr Trojanek The new handling of aspects stores the aspect expression as the Expression_Copy of the aspect and not as the Entity of the aspect identified. This has been changed for most of the aspects, but not for Type_Invariant and Default_Initial_Condition, which have custom expansion. Apparently this change only affects GNATprove and not GNAT. gcc/ada/ * exp_util.adb (Add_Own_DIC, Add_Own_Invariants): Store the aspect expression in Expression_Copy. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_util.adb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 3e8d5997949..730889cae3e 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -1893,7 +1893,7 @@ package body Exp_Util is -- routines. if Present (DIC_Asp) then - Set_Entity (Identifier (DIC_Asp), New_Copy_Tree (Expr)); + Set_Expression_Copy (DIC_Asp, New_Copy_Tree (Expr)); end if; -- Once the DIC assertion expression is fully processed, add a check @@ -3153,7 +3153,7 @@ package body Exp_Util is -- Check_Aspect_At_xxx routines. if Present (Prag_Asp) then - Set_Entity (Identifier (Prag_Asp), New_Copy_Tree (Expr)); + Set_Expression_Copy (Prag_Asp, New_Copy_Tree (Expr)); end if; Add_Invariant_Check (Prag, Expr, Checks);