From patchwork Thu Sep 29 09:10:21 2022 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: 1519 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f2ce:0:0:0:0:0 with SMTP id d14csp583687wrp; Thu, 29 Sep 2022 02:11:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6YEbll2cPWqDTYlZQidi11Q/2sNk9JYXQF54B1Dni5URst7G8lynU8pLIBrC3mAibIciYP X-Received: by 2002:a17:907:80d:b0:73d:a576:dfbd with SMTP id wv13-20020a170907080d00b0073da576dfbdmr1889219ejb.402.1664442696843; Thu, 29 Sep 2022 02:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664442696; cv=none; d=google.com; s=arc-20160816; b=RVb9C30RgAJgDueQ8/3yEmbSWczJpQXlMztl0Oq/pS1P33KOV/F6IoT3zqEHGUKq0A 9L46rxQYy5RyWZXLybKq1XkdfcrQSLn7a4HiIhgO1RcKu9sHTL0ldJ8UK70qrQS+8Gai ALZO26HyG8pkWyudTaVZh2vkKZNa3yTKihOCJ6B19JNmYsluQDzYMgJLjti51Bod+mOf tX4d3nZBE0L9WXvkNr0eQFjdTODtOs4iaIokavwkTkXllAtNfoBYesE5NeG1FgYuTRkH Li9QAenKCS8x8HOUkMl2P2v7zBYj6Mu0T4qN243mzHPzepCS/CMjDokWZ8MWyFbdlTH9 Rmtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=wslPC0Jkrxu2kDIPWsA7Bzw2SVn8bEFKR5GFNIm8Kbk=; b=bMwaGjiBPhJubr4vQMTHtC1BJ2kzyOmGiKBSEPgGtg1CIqWYLGoQO8rKqXHte49K9B HkeIqX0gVf6UjLddWKzpfgRhTeY90lnqaI0ImFSzlExVQAJ5LBO27Y9pG5lIz18OMxYo +Sh4bBFJTX82eblJqAmNUalWgLOEW7WJEhf1BDJeDpPBn5nOmtCTh+8g8cxkOpQEIrFc yQHh5ot9FGYJisIHDTPBCiJKAAe3DVy/vBnAKQMAPpbTSV+1nQtM9n8mLtq9f5MY4Yxo 7PCHhv27a+Bduy2uT83uN8DUdkX1R6hLyJIkTntJbHqqmn/qVvBNhj9Aj0p1XaQuHl9l YKiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oE4x1F5b; 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 sh44-20020a1709076eac00b00783a9ea980dsi6784409ejc.811.2022.09.29.02.11.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 02:11:36 -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=oE4x1F5b; 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 0FC003857C52 for ; Thu, 29 Sep 2022 09:11:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FC003857C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664442685; bh=wslPC0Jkrxu2kDIPWsA7Bzw2SVn8bEFKR5GFNIm8Kbk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=oE4x1F5bWkHqQW2vx/1npXLW+Wanaqrton/l5dwvc3Hce18tLwhy77oj+eg+Q3AQ8 p06G5DsgwP06b4FE0YgOk7z1u/OOzylJL6aGE1Ff/Z0EuBA95steEbzxUKhtqgeBXL kO+1l08Mb/Vr+vmgEUAoE7kOrWjetBW1uOsmHGaw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id F1DF43858D28 for ; Thu, 29 Sep 2022 09:10:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F1DF43858D28 Received: by mail-wm1-x331.google.com with SMTP id fn7-20020a05600c688700b003b4fb113b86so412056wmb.0 for ; Thu, 29 Sep 2022 02:10:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=wslPC0Jkrxu2kDIPWsA7Bzw2SVn8bEFKR5GFNIm8Kbk=; b=zKnbhkwuQQpG6BYdF+yfaxzzu3AJsV0k65e143lw9gaAo/1B3vPc9+LrTNVlAQniDW vVGZwbsDnZ6ruhYUq/XqYRikdmNMq+sHOJhby1HvrmjaeT2EyxdpziDiL3xXhsfxu8BZ Aapj6RIpMulJAhiJZOJJ6U2OqabJdkbEUQcTTT3ZdHbiiCmoCmIvhRR+XlJICN/x4HCZ XK7jjfmn2DqLn8uzSLxttqZNDfhMwo6PttgmP+nZtCMLGkRFfAfIHK6Sb3+jZm16h0aJ EALWZPNH49GS7ejS73PClK5MBsWzn9q9qLPeD/+m8x13y3gYA5iUTg9KQT+Usju+EOIm 9Yaw== X-Gm-Message-State: ACrzQf38qoKl5YJ5IHqEdyMjVJN6nZTgJi+DtF2rbqmw6O2TO1vtTm4K U+s3tzbE4adZK9sGB9qGogu1k6LMipOOyg== X-Received: by 2002:a7b:c00d:0:b0:3b4:6331:2fc5 with SMTP id c13-20020a7bc00d000000b003b463312fc5mr9666495wmb.11.1664442639016; Thu, 29 Sep 2022 02:10:39 -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 z8-20020a1cf408000000b003b56be51313sm3296148wma.44.2022.09.29.02.10.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 02:10:38 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [COMMITED] ada: Fix checking of Refined_State with nested package renamings Date: Thu, 29 Sep 2022 11:10:21 +0200 Message-Id: <20220929091021.359477-1-poulhies@adacore.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.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.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?= Cc: Piotr Trojanek 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?1745294665168605252?= X-GMAIL-MSGID: =?utf-8?q?1745294665168605252?= From: Piotr Trojanek When collecting package state declared in package body, we should only recursively examine the visible part of nested packages while ignoring other entities related to packages (e.g. package bodies or package renamings). gcc/ada/ * sem_util.adb (Collect_Visible_States): Ignore package renamings. 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 9ae082ca2e1..25e886e1ca1 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -6018,8 +6018,11 @@ package body Sem_Util is Append_New_Elmt (Item_Id, States); -- Recursively gather the visible states of a nested package + -- except for nested package renamings. - elsif Ekind (Item_Id) = E_Package then + elsif Ekind (Item_Id) = E_Package + and then No (Renamed_Entity (Item_Id)) + then Collect_Visible_States (Item_Id, States); end if;