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 Generic_Dispatching_Constructor


Tested on i686-linux, committed on trunk

The expansion of a Dispatching_Construct_Call involves conversions to
classwide types and a complex expansion process. If the expression that
provides the tag is a function call, generate it early, to prevent the
insertion of expansion code at the wrong place in the tree. This is
the case in particular if stack-checking is enabled, because the call
that produces the tag will force additional declarations.

gnat.dg/graphic.adb must compile properly.

2007-04-06  Robert Dewar  <dewar@adacore.com>
	    Ed Schonberg  <schonberg@adacore.com>

	* exp_intr.adb (Expand_Exception_Call): Calls to subprograms in
	GNAT.Current_Exception are not allowed if pragma Restrictions
	(No_Exception_Propagation) is set and in any case make the associated
	handler unsuitable as a target for a local raise statement.
	(Expand_Dispatching_Constructor_Call): Replace generation of call to the
	run-time subprogram CW_Membership by call to Build_CW_Membership.
	(Expand_Dispatching_Constructor_Call): If the dispatching tag is given
	by a function call, a temporary must be created before expanding the
	Constructor_Call itself, to prevent out-of-order elaboration in the
	back-end when stack checking is enabled..

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]