From: Ed Schonberg Date: Wed, 5 Feb 2020 16:38:38 +0000 (-0500) Subject: [Ada] Subtype inherits Atomic flag from base type X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=faf250080011f5e92a6ba5ee5af22b12654992ba;p=gcc.git [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. --- 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);