From: Eric Botcazou Date: Thu, 17 Feb 2022 17:20:01 +0000 (+0100) Subject: [Ada] Fix compiler crash on FOR iteration scheme over container X-Git-Tag: basepoints/gcc-14~6816 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0145570e89270c33d4cf2a0abd2a215f09456789;p=thirdparty%2Fgcc.git [Ada] Fix compiler crash on FOR iteration scheme over container The front-end drops a freeze node on the floor because it puts the node into the Condition_Actions of an N_Iteration_Scheme of a FOR loop. gcc/ada/ * exp_util.adb (Insert_Actions) : Check that it is a WHILE iteration scheme before using Condition_Actions. --- diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index e590751a15f..cd497ee453b 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -7545,7 +7545,7 @@ package body Exp_Util is when N_Elsif_Part | N_Iteration_Scheme => - if N = Condition (P) then + if Present (Condition (P)) and then N = Condition (P) then if Present (Condition_Actions (P)) then Insert_List_After_And_Analyze (Last (Condition_Actions (P)), Ins_Actions);