[Ada] Crash on build-in-place call with address specification for target
The presence of an address clause complicates the build-in-place expansion
because the indicated address must be processed before the indirect call is
generated, including the definition of a local pointer to the object.
The address clause may come from an aspect specification or from an explicit
attribute specification appearing after the object declaration. These two
cases require different processing.
2018-01-11 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Handle
properly object declarations with initializations that are
build-in-place function calls, when there is an address specification,
either as an aspect specification or an explicit attribute
specification clause, for the initialized object.
* freeze.adb (Check_Address_Clause): Do not remove side-effects from
initial expressions in the case of a build-in-place call.
gcc/testsuite/
* gnat.dg/bip_overlay.adb, gnat.dg/bip_overlay.ads: New testcase.
From-SVN: r256523