From patchwork Thu May 25 08:06:06 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: 98875 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp204696vqr; Thu, 25 May 2023 01:30:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4YUnHqT2Ya9zX4pXtMom2gPxbW6j69dRtSSoY3/+CvNIkH6Aw5gA44cXbI/PxxPsWbJJHz X-Received: by 2002:a17:907:6d1d:b0:968:1e8:a754 with SMTP id sa29-20020a1709076d1d00b0096801e8a754mr762582ejc.72.1685003451818; Thu, 25 May 2023 01:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685003451; cv=none; d=google.com; s=arc-20160816; b=pAH9PFNmG1EEu4NneZF+uc9R+y6jMii+JucyFV7boP4J25RmAebEXatU8ruMhV8sFi GaePPd1HyjvNcJc5NfVlAJXjvgTI2Ep3rqmFLpjmb/J3/VzzQoUVK2pVc7q14RMBeql/ yq2J6uKBGjq6aOvNhjLLPkiANVDXgKfBxebnBX4A0JlnhNGmug2RBbPs/sNc4FUQRFpZ IhCK8K2hM63NXqoKsw9IfeCM4PxRI3ztLUErYcLPMnFVQnc9tytk2lhxO9xjRBjB8kzA OoFzp/dNdwxIt9Qg9p3eQiwMj6WSvg5bTHx+NjfZr75HXOC/bmO+iyxLG1ZnNwDDtXu4 nzGg== 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=Kq6DTWPRVPrlp7jGnoZR0J/i8um6YEhv3sgbQj+DKCM=; b=IqNnzgoJj9z/9/f5/msnBUi+B0m1cQVCIrSDWIfuXlzdGXgh4UFR1Cbt8+zb19/O37 EaAfxE7AKBHaLgKj+htWrzlY714yY/u4xxQAf0adhnev9B18IFl0ra7J/4c1Y4BewIAN PU5c0+BrvBD2cmDbEQd4BBm9Bwl/vQdhWlir4jiwmmqhK7zYu084CTwYW6ygVD28cFMT QP0LXQCrYK3kzbP2e5+9ysimEkQAhbCKqVXZVcaC+KBT0tobt5AxpjTTD5iaiMtsyXtk vhSGgTUaqBztMkhoBsoaHqiYiVUxEiAwLg0I28bHT3ZOem1fvekUi994g0+dhjRQWHjp kCjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=eK8iarhL; 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=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id c17-20020a056402121100b0050bc744171fsi612927edw.345.2023.05.25.01.30.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:30:51 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b=eK8iarhL; 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C57AF3ACBCAD for ; Thu, 25 May 2023 08:20:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C57AF3ACBCAD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685002806; bh=Kq6DTWPRVPrlp7jGnoZR0J/i8um6YEhv3sgbQj+DKCM=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=eK8iarhLkFcRZWK2Cn/5NBvGmYZyPShB2LueLI36w+Ejqx4DgnswG+fLRtpHdsr5C mt6wV+HWX0sQT93Q1ffbnA9QyHLaI+iXTZbIs7mUuLz2FpOGfn7qsm9yAbOX22A2Yd Gj2JSmwtHJP2I8AT0cBu/kG/YfAEWIHcRW8WdfEE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id EF64A3857721 for ; Thu, 25 May 2023 08:06:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF64A3857721 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f607059b4eso1979315e9.0 for ; Thu, 25 May 2023 01:06:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685001968; x=1687593968; 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=Kq6DTWPRVPrlp7jGnoZR0J/i8um6YEhv3sgbQj+DKCM=; b=IqI6+k7NJhzFqVWEjN+dPm7NJeOgT56V0/LwKhC86ZU/vzhICYPMprMUdc5raA9iQD 731mN36PH+cX/OIgdJNcWgXN0evDlzWEYEVa+Z37ycsR5WF5geih43YAmzv7mKMYelvq sdT3UI1lYxB3D6WKBgmpnf8S+zLXz4N3Eboj6mnkgpqdRd1oDSCfeRiLhmEgnDv8bSe8 8EDO+u/JH5S2SQKit8/IvU114v2U9bOUUVaSHQQh+VLIHhS/6s038MH4kDMIIr+LiBaa DYnTveAH36lJXSv68z5Dl2tXVTp6uFI9zhsDO3+C1YqqDsoYAWAbAUfbcJPLbki8vJdt P7lg== X-Gm-Message-State: AC+VfDyc7Voannp8BuKc7q65ewaE+skodO0iwMl3KNo+5Wf5Mbe+k6Gv JCOtliAlJ4rxKRGk/Bm7qOhq8Or488fllAm/ooQELw== X-Received: by 2002:adf:e2c7:0:b0:306:26d7:3805 with SMTP id d7-20020adfe2c7000000b0030626d73805mr1426684wrj.63.1685001967862; Thu, 25 May 2023 01:06:07 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id r15-20020a056000014f00b00309382eb047sm834459wrx.112.2023.05.25.01.06.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:06:07 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Fix copying of quantified expressions Date: Thu, 25 May 2023 10:06:06 +0200 Message-Id: <20230525080606.1957110-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.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.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?1766854179144098328?= X-GMAIL-MSGID: =?utf-8?q?1766854179144098328?= From: Piotr Trojanek While visiting the AST as part of routine New_Copy_Tree we maintain an EWA_Level variable in a stack-like fashion. This worked fine for expression with actions nodes but not for quantified expressions. gcc/ada/ * sem_util.adb (Visit_Node): Decrement EWA_Level with the same condition as when it was incremented. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index b83c75939c7..c9aa76707a5 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -24383,7 +24383,10 @@ package body Sem_Util is then EWA_Inner_Scope_Level := EWA_Inner_Scope_Level - 1; - elsif Nkind (N) = N_Expression_With_Actions then + elsif Nkind (N) = N_Expression_With_Actions + or else + (Nkind (N) = N_Quantified_Expression and then Expander_Active) + then EWA_Level := EWA_Level - 1; end if; end Visit_Node;