From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 8C8EF3858016; Tue, 17 May 2022 08:29:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C8EF3858016 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-549] [Ada] Restore defensive guard in checks for volatile actuals X-Act-Checkin: gcc X-Git-Author: Piotr Trojanek X-Git-Refname: refs/heads/master X-Git-Oldrev: de0665fc7f195e12ede10abb6a98b10011e70807 X-Git-Newrev: 33400df641d834ca3fd3f2c964ed92759f128ffa Message-Id: <20220517082950.8C8EF3858016@sourceware.org> Date: Tue, 17 May 2022 08:29:50 +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: Tue, 17 May 2022 08:29:50 -0000 https://gcc.gnu.org/g:33400df641d834ca3fd3f2c964ed92759f128ffa commit r13-549-g33400df641d834ca3fd3f2c964ed92759f128ffa Author: Piotr Trojanek Date: Wed Mar 30 12:00:20 2022 +0200 [Ada] Restore defensive guard in checks for volatile actuals When flagging names of volatile objects occurring in actual parameters it is safer to guard against identifiers without entity. This is redundant (because earlier in the resolution of actual parameters we already guard against actuals with Any_Type), but perhaps such identifiers will become allowed in constructs like: Subprogram_Call (Actual => (declare X : Boolean := ... with Annotate (GNATprove, ...))); ^^^^^^^^^ which include an identifier that does not denote any entity. Code cleanup related to handling of volatile components; behaviour is unaffected. gcc/ada/ * sem_res.adb (Flag_Effectively_Volatile_Objects): Restore redundant guard. Diff: --- gcc/ada/sem_res.adb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 12735daab6d..33f445d69b9 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -3873,7 +3873,8 @@ package body Sem_Res is -- selector_name in selected_component or as a choice in -- component_association. - if Is_Object (Id) + if Present (Id) + and then Is_Object (Id) and then Ekind (Id) not in E_Component | E_Discriminant and then Is_Effectively_Volatile_For_Reading (Id) and then