[Ada] Spurious constraint error on array of null-excluding components
This patch fixes an issue whereby the compiler would raise spurious runtime
errors when an array of null-excluding components was initialized with an
expression which required the secondary stack (such as with an concatination
operation) due to certain generated checks which were incorrected performed
on internal object declarations.
2018-05-28 Justin Squirek <squirek@adacore.com>
gcc/ada/
* exp_ch3.adb
(Build_Initialization_Call): Add logic to pass the appropriate actual to match
new formal.
(Init_Formals): Add new formal *_skip_null_excluding_check
* exp_util.adb, exp_util.ads
(Enclosing_Init_Proc): Added to fetch the enclosing Init_Proc from the current
scope.
(Inside_Init_Proc): Refactored to use Enclosing_Init_Proc
(Needs_Conditional_Null_Excluding_Check): Added to factorize the predicate
used to determine how to generate an Init_Proc for a given type.
(Needs_Constant_Address): Minor reformatting
* sem_res.adb
(Resolve_Null): Add logic to generate a conditional check in certain cases
gcc/testsuite/
* gnat.dg/array31.adb: New testcase.
From-SVN: r260822