aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-02-16 10:15:12 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-13 08:04:25 +0000
commit7427e673d818be052fd07468c9dfdad3dbfe13b3 (patch)
tree9da2faf609d426f0e3d4d6196d415de769484383 /gcc/ada/sem_res.adb
parent8a8366d4969e87366a94d9f2b768606fdf46a7b2 (diff)
downloadgcc-7427e673d818be052fd07468c9dfdad3dbfe13b3.zip
gcc-7427e673d818be052fd07468c9dfdad3dbfe13b3.tar.gz
gcc-7427e673d818be052fd07468c9dfdad3dbfe13b3.tar.bz2
[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.
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index f038a33..4ae0835 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),