public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] ada: Fix expanding container aggregates
@ 2023-06-27 12:07 Marc Poulhiès
  2023-07-07  8:51 ` Eric Botcazou
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Poulhiès @ 2023-06-27 12:07 UTC (permalink / raw)
  To: gcc-patches; +Cc: Viljar Indus

From: Viljar Indus <indus@adacore.com>

Ensure that that container aggregate expressions are expanded as
such and not as records even if the type of the expression is a
record.

gcc/ada/

	* exp_aggr.adb (Expand_N_Aggregate): Ensure that container
	aggregate expressions do not get expanded as records but instead
	as container aggregates.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/exp_aggr.adb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 5e22fefbc1d..d922c3bf1a4 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -6463,6 +6463,7 @@ package body Exp_Aggr is
 
       if Is_Record_Type (T)
         and then not Is_Private_Type (T)
+        and then not Is_Homogeneous_Aggregate (N)
       then
          Expand_Record_Aggregate (N);
 
-- 
2.40.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [COMMITTED] ada: Fix expanding container aggregates
  2023-06-27 12:07 [COMMITTED] ada: Fix expanding container aggregates Marc Poulhiès
@ 2023-07-07  8:51 ` Eric Botcazou
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Botcazou @ 2023-07-07  8:51 UTC (permalink / raw)
  To: Marc Poulhiès; +Cc: gcc-patches, Viljar Indus

> Ensure that that container aggregate expressions are expanded as
> such and not as records even if the type of the expression is a
> record.
> 
> gcc/ada/
> 
> 	* exp_aggr.adb (Expand_N_Aggregate): Ensure that container
> 	aggregate expressions do not get expanded as records but instead
> 	as container aggregates.

This is not a regression but the problem is quite visible in Ada 2022 so I 
backported the fix onto the 13 branch.

-- 
Eric Botcazou




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-07  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-27 12:07 [COMMITTED] ada: Fix expanding container aggregates Marc Poulhiès
2023-07-07  8:51 ` Eric Botcazou

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).