From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 8AB22385780C; Wed, 18 May 2022 08:42:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8AB22385780C MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-585] [Ada] Small performance tweak in recent change X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: 1ef3f0911cf08f1b80c845ee7eee07ecf43b9c8a X-Git-Newrev: 700cd7d6733e62e5ad8212cb6c51866679173b41 Message-Id: <20220518084256.8AB22385780C@sourceware.org> Date: Wed, 18 May 2022 08:42:56 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2022 08:42:56 -0000 https://gcc.gnu.org/g:700cd7d6733e62e5ad8212cb6c51866679173b41 commit r13-585-g700cd7d6733e62e5ad8212cb6c51866679173b41 Author: Eric Botcazou Date: Wed Mar 30 12:59:23 2022 +0200 [Ada] Small performance tweak in recent change This avoids a useless walk of the prefix chain in instances. gcc/ada/ * sem_ch8.adb (Analyze_Subprogram_Renaming): Move final test on In_Instance to outer condition. Diff: --- 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 1cf34117a30..5945bfdf90d 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -3975,7 +3975,7 @@ package body Sem_Ch8 is -- normally illegal renamings can be constructed when expanding -- instantiations. - elsif Nkind (Nam) = N_Expanded_Name then + elsif Nkind (Nam) = N_Expanded_Name and then not In_Instance then declare function Ult_Expanded_Prefix (N : Node_Id) return Node_Id is (if Nkind (N) /= N_Expanded_Name @@ -3985,7 +3985,6 @@ package body Sem_Ch8 is begin if Chars (Entity (Ult_Expanded_Prefix (Nam))) = Chars (New_S) - and then not In_Instance then Error_Msg_Sloc := Sloc (N); Error_Msg_NE