https://gcc.gnu.org/g:c9fe4eae41c0e05ef213b9a47c611d5fc704006a
commit r14-10755-gc9fe4eae41c0e05ef213b9a47c611d5fc704006a Author: Eric Botcazou <ebotca...@adacore.com> Date: Wed Sep 11 19:26:18 2024 +0200 ada: Fix internal error on elsif part of if-statement containing if-expression The problem occurs when the compiler is trying to find a context to which it can hoist finalization actions coming from the if-expression, because Find_Hook_Context incorrectly returns the N_Elsif_Part node. gcc/ada/ChangeLog: PR ada/114640 * exp_util.adb (Find_Hook_Context): For a node present within a conditional expression, do not return an N_Elsif_Part node. Diff: --- gcc/ada/exp_util.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 47a928a6a40d..f81380846e00 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -6555,6 +6555,7 @@ package body Exp_Util is | N_Aggregate | N_Delta_Aggregate | N_Extension_Aggregate + | N_Elsif_Part and then Nkind (Parent (Par)) not in N_Function_Call | N_Procedure_Call_Statement | N_Entry_Call_Statement