From patchwork Mon May 15 09:43:41 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: 94055 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6794646vqo; Mon, 15 May 2023 02:54:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4YTHd6LW0pIryQF4L5K3N+Q2sj3VkKZYuWkGiOrxO95WgZtjyLIS4W7F2GJL4TOo+aX4ic X-Received: by 2002:a17:907:320a:b0:88a:1ea9:a5ea with SMTP id xg10-20020a170907320a00b0088a1ea9a5eamr28596072ejb.65.1684144492097; Mon, 15 May 2023 02:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684144492; cv=none; d=google.com; s=arc-20160816; b=AF6pynY3oEfIz5rsltYftpM6XLxaIFnnaslbXXI4mWll8KiBL0nurdFKxUQJJ2jjb9 0vjIVMTofQeqvgzypzkrA4vH8yNt2wC4XpRy42oX5yEYOdqHnkj19TPCQh+86NP0lQhF fy4coRvpy6U2Mopo2wM3iAPA0Hs9TnzLveaTcOj6tfpc2aOYMgPg1GNTi5IFHJ1vpwpp ZqKAp4Iv12go2KQHLZMOnzpZZNj4UtjV1CA4WXcZDsXABKdEXlpnblrOKH88g735EeJ0 lHKQDxGZZInfRBnUMtxVMTbhwllka4E2jG1v4LC72YC684KWXnTbNji3EyCIo1J2oV5W UHXg== 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=F4buhzcwLxs2WUC0uIN1olUyV2xdqb9RKEsh9ZAjuYw=; b=z+S9SBX2XPRu72BMFKNMJ/b18+n4t50blT93xhet1ZpWjy17v0p9uVqywULTYSb5P8 HOpaLsdqgSX9nK9QrgFIdZxGH+9JDpTvEvVYpN+4vW9rJc8ThsC8N8pFoF713jSd1abF w/1NpkOOyfIB9EYQtrHEIpEqwJsFK/QpbM6GYyKLNSUNXHol4rxnm/YVVgN/Q4nd+kPo OKL5dOyOWKWLEPqa0Tqp65cIbi3iJWxq8uZ56dNtm7v54G3p6qVEgdEJ1xE7mCzi3B58 XEKZKJ9J7BnIU493BNZZb97P9QrVcJyJrKzCqT3sDT1TVdYsVMpcoF1yJpVzBTPs02rz 20gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=sWaaPn0i; 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 g20-20020a170906199400b0096640d0ce45si11662392ejd.1001.2023.05.15.02.54.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 02:54:52 -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=sWaaPn0i; 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 553EB385E019 for ; Mon, 15 May 2023 09:48:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 553EB385E019 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684144118; bh=F4buhzcwLxs2WUC0uIN1olUyV2xdqb9RKEsh9ZAjuYw=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=sWaaPn0iJ/FaAKi+8QXYPNEDgoBFA2BxI10PObRtHclYq/0G+JJBJryThAAWJlJrV pCFIJVgZZQDl36LN1xTU1dhDh1WUjijbp+fiLSS7FZWS2DsZTO3epa5iExB1fJU8Qz SiMXcCE/J/jLAKnwEXSJYcolgRiESObZlHE+9RGw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id CE89D3853837 for ; Mon, 15 May 2023 09:43:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE89D3853837 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-30789a4c537so6584674f8f.0 for ; Mon, 15 May 2023 02:43:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684143823; x=1686735823; 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=F4buhzcwLxs2WUC0uIN1olUyV2xdqb9RKEsh9ZAjuYw=; b=agiH/o5Wf4Ldc+9J3nbf6mR+NFRvDdDHxDiHvtB2eM7D/C0IaMQ1Mc+zAzBGD7YRv8 gpOV9jfI7ox+QN9220GmYJL0zHG6gyvSJCJVblS4Ou1gwBAC0g5CThw9m5D/0O6iBj/h nYuULU2RscbMisXTEAabvLuOW55shcWvOlFcJmiSWHXYOMpUD/VeFSZJS0gMIONjUiI/ S+38mdQSgBM4YC+YRzgh+Hl9wW2kgOd9PbYkoO4S839PyFlKd9xlY/S4K9dq7QpUAc7M gwyIahYE8n0RpNWk+dOdJFoNsb7c7pwwfyVJIZMOcXaXa3re4T1YvyKeMSlboZzuaflm dkVA== X-Gm-Message-State: AC+VfDyIoI8ROsUDvGSTQ2leJZAkKBlqXFO1u9XlQMl9BBqi0qO69/C2 l1wjqVHf5l0YWPBht6/S+t56cczBTpDKiQeXwqUzKQ== X-Received: by 2002:adf:fd4c:0:b0:306:2c47:9736 with SMTP id h12-20020adffd4c000000b003062c479736mr22546215wrs.15.1684143823642; Mon, 15 May 2023 02:43:43 -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 p1-20020a05600c204100b003f4e47c6504sm13997161wmg.21.2023.05.15.02.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 02:43:43 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED] ada: Simplify lookup of predecessor in homonym chain Date: Mon, 15 May 2023 11:43:41 +0200 Message-Id: <20230515094341.1408360-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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?1765953495244892746?= X-GMAIL-MSGID: =?utf-8?q?1765953495244892746?= From: Ronan Desplanques gcc/ada/ * sem_ch8.adb (End_Scope): Simplify lookup of predecessor in homonym chain. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch8.adb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 6f858eea0f9..e4b3519bbaa 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -5066,7 +5066,6 @@ package body Sem_Ch8 is if Id /= Current_Entity (Id) then Prev := Current_Entity (Id); while Present (Prev) - and then Present (Homonym (Prev)) and then Homonym (Prev) /= Id loop Prev := Homonym (Prev); @@ -5074,7 +5073,7 @@ package body Sem_Ch8 is -- Skip to end of loop if Id is not in the visibility chain - if No (Prev) or else Homonym (Prev) /= Id then + if No (Prev) then goto Next_Ent; end if;