+2018-05-25 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_aggr.adb (Flatten): A quantified expression cannot be duplicated
+ in an others clause to prevent visibility issues with the generated
+ loop variable.
+ (Component_OK_For_Backend): Return false for a quantified expression.
+ (Check_Static_Component): Ditto.
+
2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
* libgnat/s-secsta.adb (SS_Allocate): Reimplemented.
or else not Compile_Time_Known_Aggregate (Expression (Expr))
or else Expansion_Delayed (Expression (Expr))
or else Nkind (Expr) = N_Iterated_Component_Association
+ or else Nkind (Expr) = N_Quantified_Expression
then
Static_Components := False;
exit;
-- If we have an others choice, fill in the missing elements
-- subject to the limit established by Max_Others_Replicate.
+ -- If the expression involves a construct that generates
+ -- a loop, we must generate individual assignmentw and
+ -- no flattening is possible.
if Nkind (Choice) = N_Others_Choice then
Rep_Count := 0;
+ if Nkind_In (Expression (Elmt),
+ N_Quantified_Expression,
+ N_Iterated_Component_Association)
+ then
+ return False;
+ end if;
+
for J in Vals'Range loop
if No (Vals (J)) then
Vals (J) := New_Copy_Tree (Expression (Elmt));
Static_Components := False;
return False;
+ elsif Nkind (Expr_Q) = N_Quantified_Expression then
+ Static_Components := False;
+ return False;
+
elsif Possible_Bit_Aligned_Component (Expr_Q) then
Static_Components := False;
return False;