public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-1678] [Ada] Skip overlay checks on protected components with expansion disabled
Date: Mon, 21 Jun 2021 11:05:23 +0000 (GMT)	[thread overview]
Message-ID: <20210621110523.81268388881B@sourceware.org> (raw)

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

commit r12-1678-gb1955e0e6dbcc376c8a05ea51751dcce7e210266
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Fri Mar 26 09:02:33 2021 +0100

    [Ada] Skip overlay checks on protected components with expansion disabled
    
    gcc/ada/
    
            * sem_util.adb (Find_Overlaid_Entity): Ignore references to
            components and discriminants.

Diff:
---
 gcc/ada/sem_util.adb | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index b59116e540b..2e102b93497 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -9437,6 +9437,18 @@ package body Sem_Util is
 
          if Is_Entity_Name (Expr) then
             Ent := Entity (Expr);
+
+            --  If expansion is disabled, then we might see an entity of a
+            --  protected component or of a discriminant of a concurrent unit.
+            --  Ignore such entities, because further warnings for overlays
+            --  expect this routine to only collect entities of entire objects.
+
+            if Ekind (Ent) in E_Component | E_Discriminant then
+               pragma Assert
+                 (not Expander_Active
+                  and then Is_Concurrent_Type (Scope (Ent)));
+               Ent := Empty;
+            end if;
             return;
 
          --  Check for components


                 reply	other threads:[~2021-06-21 11:05 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=20210621110523.81268388881B@sourceware.org \
    --to=pmderodat@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).