From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 01DCE385043A; Fri, 13 May 2022 08:07:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01DCE385043A 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-384] [Ada] Remove redundant guard in checks for volatile actuals X-Act-Checkin: gcc X-Git-Author: Piotr Trojanek X-Git-Refname: refs/heads/master X-Git-Oldrev: 8a8366d4969e87366a94d9f2b768606fdf46a7b2 X-Git-Newrev: 7427e673d818be052fd07468c9dfdad3dbfe13b3 Message-Id: <20220513080720.01DCE385043A@sourceware.org> Date: Fri, 13 May 2022 08:07:20 +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: Fri, 13 May 2022 08:07:20 -0000 https://gcc.gnu.org/g:7427e673d818be052fd07468c9dfdad3dbfe13b3 commit r13-384-g7427e673d818be052fd07468c9dfdad3dbfe13b3 Author: Piotr Trojanek Date: Wed Feb 16 10:15:12 2022 +0100 [Ada] Remove redundant guard in checks for volatile actuals When flagging names of volatile objects occurring in actual parameters we guard against identifiers without entity. This is redundant, because earlier in the resolution of actual parameters we already guard against actuals with Any_Type. Code cleanup related to handling of volatile components; behaviour is unaffected. gcc/ada/ * sem_res.adb (Flag_Effectively_Volatile_Objects): Remove redundant guard. Diff: --- gcc/ada/sem_res.adb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index f038a33eb55..4ae0835498b 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -3868,8 +3868,7 @@ package body Sem_Res is when N_Identifier | N_Expanded_Name => Id := Entity (N); - if Present (Id) - and then Is_Object (Id) + if Is_Object (Id) and then Is_Effectively_Volatile_For_Reading (Id) and then not Is_OK_Volatile_Context (Context => Parent (N),