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] Improper initialization of elementary parameters in entry calls


The compiler was incorrectly default initializing entry call parameters in
cases where the parameter is of an access type or of a scalar type whose
Default_Value aspect is set. The access type case caused a problem for
CodePeer in the case where the formal parameter is a null-excluding access
type, because the compiler was initializing the null-excluding parameter
temporary to null. In case of a scalar out parameter with Default_Value,
the compiler was default-initializing the parameter temporary rather than
assigning the value of the actual to the temporary. The assignment of
the actual is now generated in the Default_Value case, and the default
initialization is suppressed in both cases.

Tested on x86_64-pc-linux-gnu, committed on trunk

2015-10-16  Gary Dismukes  <dismukes@adacore.com>

	* exp_ch9.adb (Build_Simple_Entry_Call): Set_Is_Internal on
	the temporary object used for a by-copy entry parameter, to
	ensure that the object doesn't get its No_Initialization flag
	reset later in Default_Initialize_Object. Also, generate the
	assignment of the actual to the temporary in the additional case
	of a scalar out parameter whose type has a Default_Value aspect.
	* exp_ch3.adb: Fix minor typo in comment.

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]