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] fixes in checks handling


Tested on i686-linux, committed on trunk

Handle case in which 'address is applied to in-mode actuals. After this
patch gnat.dg/addr1.adb compiles without errors.

Also, if a discriminated component is constrained by a current instance, that
is to say a discriminant constraint of the form T'access, there is no applicable
discriminant constraint on an aggregate of the type, because the constraint
is obtained from the target object of the aggregate.

When the target subtype of an array conversion is an unconstrained type,
the bounds of the expression must be compatible with the index types of the
target. The code that generates the corresponding constraint checks dit not
work properly when the expression in the conversion was a slice.

gnat.dg/conv_bug.adb must run quietly.

2007-06-06  Javier Miranda  <miranda@adacore.com>
	    Robert Dewar  <dewar@adacore.com>
	    Ed Schonberg  <schonberg@adacore.com>

	* checks.ads, checks.adb (Apply_Address_Clause_Check): Handle case in
	which the address-clause is applied to in-mode actuals (allowed by
	13.1(22)).
	(Apply_Discriminant_Check): Do not generate a check if the type is
	constrained by a current instance.
	(Activate_Division_Check): New procedure
	(Activate_Overflow_Check): New procedure
	(Activate_Range_Check): New procedure
	Call these new Activate procedures instead of setting flags directly
	(Apply_Array_Size_Check): Removed, no longer needed.
	Code clean up: remove obsolete code related to GCC 2.
	(Get_E_Length): Protect against bomb in case scope is standard
	(Selected_Range_Checks): If the node to be checked is a conversion to
	an unconstrained array type, and the expression is a slice, use the
	bounds of the slice to construct the required constraint checks.
	Improve NOT NULL error messages
	(Apply_Constraint_Check): If the context is a null-excluding access
	type, diagnose properly the literal null.

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]