[Ada] Get rid of secondary stack for controlled components of limited types
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 5 May 2022 16:08:50 +0000 (18:08 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 1 Jun 2022 08:43:18 +0000 (08:43 +0000)
commitdbb0c80c36033590f8ad63ea1cdaabcf79c52fd3
treecef7075e8dafe71bccb9f03093152c197895b75e
parent7a9800fa4d065ce220e00e7d6194dc419b7dbb38
[Ada] Get rid of secondary stack for controlled components of limited types

The initial work didn't change anything for limited types because they use
a specific return mechanism for functions called build-in-place where there
is no anonymous return object, so the secondary stack was used only for the
sake of consistency with the nonlimited case.

This change aligns the limited case with the nonlimited case, i.e. either
they both use the primary stack or they both use the secondary stack.

gcc/ada/

* exp_ch6.adb (Caller_Known_Size): Call Returns_On_Secondary_Stack
instead of Requires_Transient_Scope and tidy up.
(Needs_BIP_Alloc_Form): Likewise.
* exp_util.adb (Initialized_By_Aliased_BIP_Func_Call): Also return
true if the build-in-place function call has no BIPalloc parameter.
(Is_Finalizable_Transient): Remove redundant test.
gcc/ada/exp_ch6.adb
gcc/ada/exp_util.adb