===================================================================
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
+-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -6269,6 +6269,9 @@ package body Exp_Ch4 is
and then not Atomic_Synchronization_Disabled (Atp))
or else (Is_Atomic (Typ)
and then not Atomic_Synchronization_Disabled (Typ))
+ or else (Is_Entity_Name (P)
+ and then Has_Atomic_Components (Entity (P))
+ and then not Atomic_Synchronization_Disabled (Entity (P)))
then
Activate_Atomic_Synchronization (N);
end if;
===================================================================
@@ -4028,6 +4028,9 @@ node_is_atomic (Node_Id gnat_node)
case N_Indexed_Component:
if (Has_Atomic_Components (Etype (Prefix (gnat_node))))
return true;
+ if (Is_Entity_Name (Prefix (gnat_node))
+ && Has_Atomic_Components (Entity (Prefix (gnat_node))))
+ return true;
/* ... fall through ... */