ada: Add missing ss_mark/ss_release in quantified expressions
commitd38366cbaedee32faba1664a8f529875f1128ae5
authorBob Duff <duff@adacore.com>
Wed, 3 May 2023 12:42:24 +0000 (3 08:42 -0400)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 13 Jun 2023 07:31:46 +0000 (13 09:31 +0200)
tree9b5975f54763a38708d891fcec5728a1f4d2e4f4
parent86b8d11e485832367446569dec6847bfcd8a62da
ada: Add missing ss_mark/ss_release in quantified expressions

If a quantified expression says "for all ... of F(...)"
where F(...) is a function call that returns on the secondary
stack, we need to clean up the secondary stack. This patch
adds the required ss_mark/ss_release in that case.

gcc/ada/

* exp_ch4.adb
(Expand_N_Quantified_Expression): Detect the secondary-stack
case, and find the innermost scope where we should mark/release,
and Set_Uses_Sec_Stack on that. Skip intermediate blocks and loops
that are part of expansion.
gcc/ada/exp_ch4.adb