From faf250080011f5e92a6ba5ee5af22b12654992ba Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Wed, 5 Feb 2020 11:38:38 -0500 Subject: [PATCH] [Ada] Subtype inherits Atomic flag from base type 2020-06-05 Ed Schonberg gcc/ada/ * sem_ch3.adb (Analyze_Subtype_Declaration): For scalar types, and for subtype declarations without a constraint, subtype inherits Atomic flag from base type. --- gcc/ada/sem_ch3.adb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 3c65a340ff1..4d6382e59d4 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -5804,6 +5804,15 @@ package body Sem_Ch3 is end if; end if; + -- If the base type is a scalar type, or else if there is no + -- constraint, the atomic flag is inherited by the subtype. + + if Is_Scalar_Type (Id) + or else Is_Entity_Name (Subtype_Indication (N)) + then + Set_Is_Atomic (Id, Is_Atomic (T)); + end if; + -- Remaining processing depends on characteristics of base type T := Etype (Id); -- 2.30.2