Patchwork [Ada] Disable aggregate expansion in assignments in VM targets

login
register
mail settings
Submitter Arnaud Charlet
Date Aug. 3, 2011, 7:46 a.m.
Message ID <20110803074620.GA9539@adacore.com>
Download mbox | patch
Permalink /patch/108033/
State New
Headers show

Comments

Arnaud Charlet - Aug. 3, 2011, 7:46 a.m.
This patch does not change the behavior of native compilers. It
disables the frontend expansion of aggregates into assignments
when the type of the aggregate whose size is not known at compile time.

Tested on x86_64-pc-linux-gnu, committed on trunk

2011-08-03  Javier Miranda  <miranda@adacore.com>

	* exp_aggr.adb
	(Expand_Record_Aggregate): In VM targets disable the expansion into
	assignments of aggregates whose type is not known at compile time.

Patch

Index: exp_aggr.adb
===================================================================
--- exp_aggr.adb	(revision 177086)
+++ exp_aggr.adb	(working copy)
@@ -6,7 +6,7 @@ 
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2010, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2011, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -5649,7 +5649,9 @@ 
       --  Gigi doesn't handle properly temporaries of variable size
       --  so we generate it in the front-end
 
-      elsif not Size_Known_At_Compile_Time (Typ) then
+      elsif not Size_Known_At_Compile_Time (Typ)
+        and then Tagged_Type_Expansion
+      then
          Convert_To_Assignments (N, Typ);
 
       --  Temporaries for controlled aggregates need to be attached to a