]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Revert latest change to Find_Hook_Context
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 16 May 2023 09:35:23 +0000 (11:35 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 15 Jun 2023 07:59:37 +0000 (09:59 +0200)
The issue is that, if an aggregate is both below a conditional expression
and above another conditional expression in the tree, we have currently no
place to put the finalization actions generated by the innermost expression
in the context of the aggregate before it is expanded, so they end up being
placed after the outermost expression.

But it is not clear whether that's really problematic because this does not
seem to happen for array aggregates with multiple or others choices: in this
case the aggregate is expanded first and the code path is not taken.

gcc/ada/

* exp_util.adb (Find_Hook_Context): Revert latest change.

gcc/ada/exp_util.adb

index a4aa5f64447ea2cf619c3ceea2fd951cdb5f1e36..91959793638170975ed96219a5c59870877d2356 100644 (file)
@@ -6500,16 +6500,6 @@ package body Exp_Util is
             then
                Top := Par;
 
-            --  Stop at contexts where temporaries may be contained
-
-            elsif Nkind (Par) in N_Aggregate
-                               | N_Delta_Aggregate
-                               | N_Extension_Aggregate
-                               | N_Block_Statement
-                               | N_Loop_Statement
-            then
-               exit;
-
             --  Prevent the search from going too far
 
             elsif Is_Body_Or_Package_Declaration (Par) then