From: Piotr Trojanek Date: Wed, 16 Feb 2022 09:15:12 +0000 (+0100) Subject: [Ada] Remove redundant guard in checks for volatile actuals X-Git-Tag: basepoints/gcc-14~6823 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7427e673d818be052fd07468c9dfdad3dbfe13b3;p=thirdparty%2Fgcc.git [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 --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),