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 r13-1442] [Ada] Adjust previous change to Rewrite_As_Renaming
Date: Mon,  4 Jul 2022 07:51:34 +0000 (GMT)	[thread overview]
Message-ID: <20220704075134.3B77E3834E59@sourceware.org> (raw)

https://gcc.gnu.org/g:0896e2b79a3f7864b08f221a157a5c7fe8958116

commit r13-1442-g0896e2b79a3f7864b08f221a157a5c7fe8958116
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Sun May 29 13:35:57 2022 +0200

    [Ada] Adjust previous change to Rewrite_As_Renaming
    
    gcc/ada/
    
            * exp_ch3.adb (Expand_N_Object_Declaration.Rewrite_As_Renaming):
            Do not rewrite if the declaration has got constraints.
            * sinfo.ads (Case Expression Alternative): Fix typo.

Diff:
---
 gcc/ada/exp_ch3.adb | 19 +++++++++++++------
 gcc/ada/sinfo.ads   |  2 +-
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 75d94b0947a..9759c8d0512 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -6865,13 +6865,20 @@ package body Exp_Ch3 is
                            and then
                           OK_To_Rename_Entity_Name (Prefix (Expr_Q)))));
       begin
-         --  ??? Return False if there are any aspect specifications, because
-         --  otherwise we duplicate that corresponding implicit attribute
-         --  definition, and call Insert_Action, which has no place to insert
-         --  the attribute definition. The attribute definition is stored in
-         --  Aspect_Rep_Item, which is not a list.
+         return Result
 
-         return Result and then No (Aspect_Specifications (N));
+           --  The declaration cannot be rewritten if it has got constraints,
+           --  in other words the nominal subtype must be unconstrained.
+
+           and then Is_Entity_Name (Original_Node (Obj_Def))
+
+           --  ??? Return False if there are any aspect specifications, because
+           --  otherwise we duplicate that corresponding implicit attribute
+           --  definition, and call Insert_Action, which has no place to insert
+           --  the attribute definition. The attribute definition is stored in
+           --  Aspect_Rep_Item, which is not a list.
+
+           and then No (Aspect_Specifications (N));
       end Rewrite_As_Renaming;
 
       --  Local variables
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index e18a427f9a2..57c6438130b 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -4651,7 +4651,7 @@ package Sinfo is
 
       --  Note: The Actions field temporarily holds any actions associated with
       --  evaluation of the Expression. During expansion of the case expression
-      --  these actions are wrapped into an N_Expressions_With_Actions node
+      --  these actions are wrapped into an N_Expression_With_Actions node
       --  replacing the original expression.
 
       --  Note: this node never appears in the tree passed to the back end,


                 reply	other threads:[~2022-07-04  7:51 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=20220704075134.3B77E3834E59@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).