Skip to content
Snippets Groups Projects
Commit a2e4afc6 authored by Eric Botcazou's avatar Eric Botcazou Committed by Marc Poulhiès
Browse files

ada: Elide temporary for aliased array with unconstrained nominal subtype

When the array is initialized with the result of a call to a function whose
result type is unconstrained, then the result is allocated with its bounds,
so the array can be rewritten as a renaming of the result in this case too.

gcc/ada/

	* exp_ch3.adb (Expand_N_Object_Declaration): Fold initialization
	expression of Nominal_Subtype_Is_Constrained_Array constant into
	the computation of Rewrite_As_Renaming and remove the constant.
	Set it to True for an aliased array with unconstrained nominal
	subtype if the subtype of the expression is also unconstrained.
parent de4f7051
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment