]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix internal error on nested aggregate in conditional expression
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 29 Mar 2024 16:46:43 +0000 (17:46 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 20 May 2024 07:47:06 +0000 (09:47 +0200)
This plugs a loophole in the change improving code generation for nested
aggregates present in conditional expressions: once the delayed expansion
is chosen for the nested aggregate, the expansion of the parent aggregate
cannot be left to the back-end and the test must be adjusted to implement
this in the presence of conditional expressions too.

gcc/ada/

* exp_aggr.adb (Expand_Record_Aggregate.Component_OK_For_Backend):
Also return False for a delayed conditional expression.

gcc/ada/exp_aggr.adb

index a386aa85ae43039b8fa5aabe11d26c2f9215a8fb..796b0f1e0de1ea9aa675ed2aae74ab05985101de 100644 (file)
@@ -8376,7 +8376,9 @@ package body Exp_Aggr is
                Static_Components := False;
                return False;
 
-            elsif Is_Delayed_Aggregate (Expr_Q) then
+            elsif Is_Delayed_Aggregate (Expr_Q)
+              or else Is_Delayed_Conditional_Expression (Expr_Q)
+            then
                Static_Components := False;
                return False;