summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_prag.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r--gcc/ada/sem_prag.adb13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index d5c1599498d..74607e57655 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -11491,12 +11491,15 @@ package body Sem_Prag is
E := Base_Type (E);
end if;
- Set_Has_Volatile_Components (E);
+ -- Atomic implies both Independent and Volatile
if Prag_Id = Pragma_Atomic_Components then
Set_Has_Atomic_Components (E);
+ Set_Has_Independent_Components (E);
end if;
+ Set_Has_Volatile_Components (E);
+
else
Error_Pragma_Arg ("inappropriate entity for pragma%", Arg1);
end if;
@@ -14977,11 +14980,13 @@ package body Sem_Prag is
D := Declaration_Node (E);
K := Nkind (D);
+ -- The flag is set on the base type, or on the object
+
if K = N_Full_Type_Declaration
and then (Is_Array_Type (E) or else Is_Record_Type (E))
then
- Independence_Checks.Append ((N, Base_Type (E)));
Set_Has_Independent_Components (Base_Type (E));
+ Independence_Checks.Append ((N, Base_Type (E)));
-- For record type, set all components independent
@@ -14998,8 +15003,8 @@ package body Sem_Prag is
and then Nkind (Object_Definition (D)) =
N_Constrained_Array_Definition
then
- Independence_Checks.Append ((N, Base_Type (Etype (E))));
- Set_Has_Independent_Components (Base_Type (Etype (E)));
+ Set_Has_Independent_Components (E);
+ Independence_Checks.Append ((N, E));
else
Error_Pragma_Arg ("inappropriate entity for pragma%", Arg1);