[Ada] Fix expansion of quantified expressions as part of "others" associations
2018-05-25 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * 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. From-SVN: r260737
This commit is contained in:
parent
25eadeeaa2
commit
1f6237e3dd
@ -1,3 +1,11 @@
|
||||
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.
|
||||
|
@ -4373,6 +4373,7 @@ package body Exp_Aggr is
|
||||
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;
|
||||
@ -4523,10 +4524,20 @@ package body Exp_Aggr is
|
||||
|
||||
-- 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));
|
||||
@ -7235,6 +7246,10 @@ package body Exp_Aggr is
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user