This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Conditional expansion for large static aggregates.


Tested on i686-linux, committed on trunk

When possible, we replace the initialization procedure for a composite type
that has static components by a static constant, in order to prevent the
generation of elaboration code. This expansion was done unconditionally, which
could result in very large static expressions that can exhaust memory. The
expansion is now conditional on an upper bound that depends on whether the
restrictions No_Elaboration_Code or No_Implicit_Loops are in effect. This is
identical to what is done for the expansion of aggregates in other contexts.

See gnat.dg/specs/aggr1.ads

2008-04-08  Ed Schonberg  <schonberg@adacore.com>

	* exp_aggr.adb (Static_Array_Aggregate): Use Max_Aggr_Size to determine
	whether an array aggregate with static bounds and scalar components
	should be expanded into a static constant.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]