public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Giuliano Belinassi <giulianob@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/autopar_devel] [Ada] Subtype inherits Atomic flag from base type
Date: Sat, 22 Aug 2020 22:06:21 +0000 (GMT)	[thread overview]
Message-ID: <20200822220621.4AC3E3850410@sourceware.org> (raw)

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

commit ae1ff15f17254489cccfb307656b3ce1d4fc4300
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);


                 reply	other threads:[~2020-08-22 22:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200822220621.4AC3E3850410@sourceware.org \
    --to=giulianob@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).