[Ada] Improve handling of arrays

Eric Botcazou ebotcazou@adacore.com
Sat Sep 26 11:36:00 GMT 2009


This patch improves the handling of arrays in gigi, both for the unconstrained 
flavor by filter out negative size for the dimensions like in the constrained 
case and for the constrained one by not creating an artificially non-constant 
high bound if the low bound is non-constant.

It also enhances the lvalue_required_p predicate to make it more general.

Tested on i586-suse-linux, applied on the mainline.


2009-09-26  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Filter out
	negative size for the array dimensions like in the constrained case.
	<E_Array_Subtype>: Do not create an artificially non-constant high
	bound if the low bound is non-constant.  Minor tweaks.

	* gcc-interface/trans.c (lvalue_required_p): Add CONSTANT parameter
	and turn ALIASED into a boolean parameter.  Adjust calls to self.
	<N_Attribute_Reference>: Return 1 for more attributes.
	<N_Object_Renaming_Declaration>: Return 1 for non-constant objects.
	<N_Assignment_Statement>: Return 1 for the LHS.
	(Identifier_to_gnu): Adjust calls to lvalue_required_p.
	(call_to_gnu): Be prepared for wrapped boolean rvalues.


2009-09-26  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/array9.adb: New test.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 11768 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090926/66af246b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: array9.adb
Type: text/x-adasrc
Size: 309 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090926/66af246b/attachment-0001.bin>


More information about the Gcc-patches mailing list