[Ada] Do not generate elaboration code for alignment aspect

Pierre-Marie de Rodat derodat@adacore.com
Wed Jul 15 13:45:19 GMT 2020


This prevents the compiler from generating elaboration code for a record
declared with an initial value and an alignment aspect.  The expression
of an alignment aspect must be static so, in practice, there is no need
to defer the elaboration of the object just because of it.

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

gcc/ada/

	* einfo.ads (Delayed Freezing and Elaboration): Adjust description.
	* freeze.adb (Freeze_Object_Declaration): Likewise.
	* sem_ch3.adb (Delayed_Aspect_Present): Likewise.  Do not return
	true for Alignment.
	* sem_ch13.adb (Analyze_Aspect_Specifications): Do not always delay
	for Alignment.  Moreover, for Alignment and various Size aspects,
	do not delay if the expression is an attribute whose prefix is the
	Standard package.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 4227 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200715/0c008460/attachment-0001.bin>


More information about the Gcc-patches mailing list