public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-7908] ada: Fix internal error on aggregate nested in container aggregate
Date: Wed, 27 Sep 2023 08:28:41 +0000 (GMT)	[thread overview]
Message-ID: <20230927082842.013A3386483A@sourceware.org> (raw)

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

commit r13-7908-ga44435c1d2e1c13dd5ba60ad38feec7f7b1899da
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Wed Sep 6 09:37:29 2023 +0200

    ada: Fix internal error on aggregate nested in container aggregate
    
    This handles the case where a component association is present.
    
    gcc/ada/
    
            * exp_aggr.adb (Convert_To_Assignments): In the case of a
            component association, call Is_Container_Aggregate on the parent's
            parent.
            (Expand_Array_Aggregate): Likewise.

Diff:
---
 gcc/ada/exp_aggr.adb | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index f78d339961e..306f17bb5bf 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -5018,9 +5018,11 @@ package body Exp_Aggr is
          --  excluding container aggregates as these are transformed into
          --  subprogram calls later.
 
-         (Parent_Kind in
-            N_Component_Association | N_Aggregate | N_Extension_Aggregate
-            and then not Is_Container_Aggregate (Parent_Node))
+         (Parent_Kind = N_Component_Association
+           and then not Is_Container_Aggregate (Parent (Parent_Node)))
+
+         or else (Parent_Kind in N_Aggregate | N_Extension_Aggregate
+                   and then not Is_Container_Aggregate (Parent_Node))
 
          --  Allocator (see Convert_Aggr_In_Allocator)
 
@@ -6898,10 +6900,10 @@ package body Exp_Aggr is
          Parent_Kind := Nkind (Parent_Node);
       end if;
 
-      if ((Parent_Kind = N_Component_Association
-            or else Parent_Kind = N_Aggregate
-            or else Parent_Kind = N_Extension_Aggregate)
-           and then not Is_Container_Aggregate (Parent_Node))
+      if (Parent_Kind = N_Component_Association
+           and then not Is_Container_Aggregate (Parent (Parent_Node)))
+        or else (Parent_Kind in N_Aggregate | N_Extension_Aggregate
+                  and then not Is_Container_Aggregate (Parent_Node))
         or else (Parent_Kind = N_Object_Declaration
                   and then (Needs_Finalization (Typ)
                              or else Is_Special_Return_Object

                 reply	other threads:[~2023-09-27  8:28 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=20230927082842.013A3386483A@sourceware.org \
    --to=ebotcazou@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).