https://gcc.gnu.org/g:aace405b4205dbcd4a9a01c2282040ce0858eeeb
commit r16-5230-gaace405b4205dbcd4a9a01c2282040ce0858eeeb Author: Piotr Trojanek <[email protected]> Date: Thu Oct 23 12:11:35 2025 +0200 ada: Relax assertion in compile-time evaluator A statically dead ELSIF branch can be rewritten either to a NULL statement or entirely detached from its parent. gcc/ada/ChangeLog: * exp_util.adb (Get_Current_Value_Condition): Relax assertion about rewritten ELSIF branch. Diff: --- gcc/ada/exp_util.adb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index e2d2554d3a1f..15e956469d46 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -7641,13 +7641,11 @@ package body Exp_Util is begin -- An ELSIF part whose condition is false could have been - -- already rewritten into NULL statement and we are already - -- past the statements inside that ELSIF part. + -- already rewritten and we are already past the statements + -- inside that ELSIF part. if Nkind (If_Stmt) /= N_If_Statement then - pragma Assert - (Nkind (CV) = N_Elsif_Part - and then Is_Rewrite_Substitution (If_Stmt)); + pragma Assert (Nkind (CV) = N_Elsif_Part); return; end if;
