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] improve handling of aggregates


Tested on i686-linux, committed on mainline.

Array aggregates whose components are all static expressions are flattened
into a single structure so that they can be allocated statically by the
back-end. This is only done if the number of components is a "reasonable"
value, to avoid hitting memory limits during code generation. The check
that the size is below the chosen threshold was done on a dimension-by-
dimension basis. A more accurate check now takes into account the size of
the component type of the array as well, because if it is a composite type
there will be expressions for each of its subcomponents in the flattened
representation.

2005-06-14  Ed Schonberg  <schonberg@adacore.com>

	* exp_aggr.adb (Aggr_Size_OK): An array with no components can always
	be expanded in place. The size computation does not require a
	subtraction, which would raise an exception on a compiler built with
	assertions when the upper bound is Integer'first.
	(Flatten): For an array of composite components, take into account the
	size of the components to determine whether it is safe to expand the
	array into a purely positional representation.

Attachment: difs.20
Description: Text document


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