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] fix handling of protected object and priority


Tested on i686-linux, committed on trunk.

When private components of a protected object depend on an enclosing
discriminants, their types must be updated after each protected body is
compiled, because the renaming declarations for these components (and
the corresponding actual subtypes) are created after the private
entities themselves. The back-end enforces the rule that an identifier
node must have the same type as the entity that it denotes, and the code
that performs the type replacement was failing on a reference to a
component constrained by an access discriminant, that was being used as
the prefix in a call to a primitive operation.

Also, the priority of a protected type may be a per-object expression, if it
depends on the enclosing discriminant. If it is a complex expression
rather than a simple reference, its value must be captured in a temporary
that is local to the initialization procedure.

gnat.dg/test_prio.adb should run successfully.

2006-10-31  Ed Schonberg  <schonberg@adacore.com>             

        * exp_ch9.adb (Update_Prival_Types): Simplify code for entity
	references that are private components of the protected object.
	(Build_Barrier_Function): Set flag Is_Entry_Barrier_Function
	(Update_Prival_Subtypes): Add explicit Process argument to Traverse_Proc
	instantiation to deal with warnings.
	(Initialize_Protection): If expression for priority is non-static, use
	System_Priority as its expected type, in case the expression has not
	been analyzed yet.

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]