public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/guojiufu/heads/personal-branch)] [Ada] Subtype inherits Atomic flag from base type
@ 2020-06-10  3:41 Jiu Fu Guo
  0 siblings, 0 replies; only message in thread
From: Jiu Fu Guo @ 2020-06-10  3:41 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:faf250080011f5e92a6ba5ee5af22b12654992ba

commit faf250080011f5e92a6ba5ee5af22b12654992ba
Author: Ed Schonberg <schonberg@adacore.com>
Date:   Wed Feb 5 11:38:38 2020 -0500

    [Ada] Subtype inherits Atomic flag from base type
    
    2020-06-05  Ed Schonberg  <schonberg@adacore.com>
    
    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:
---
 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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-10  3:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10  3:41 [gcc(refs/users/guojiufu/heads/personal-branch)] [Ada] Subtype inherits Atomic flag from base type Jiu Fu Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).