https://gcc.gnu.org/g:843b49269eaca82860ab4171f9644b5c411f05fc
commit r17-1286-g843b49269eaca82860ab4171f9644b5c411f05fc Author: Viljar Indus <[email protected]> Date: Thu Apr 30 16:15:28 2026 +0300 ada: Revert "Remove unnecessary workaround" This reverts commit 5c0785d62ca44b9073e543b2b3dbb04f0aca83af. Diff: --- gcc/ada/sem_prag.adb | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 81de61ae9eb2..a22ae61cd55b 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -15698,7 +15698,33 @@ package body Sem_Prag is -- Now go ahead and analyze the if statement In_Assertion_Expr := In_Assertion_Expr + 1; - Analyze (N); + + -- One rather special treatment. If we are now in Eliminated + -- overflow mode, then suppress overflow checking since we do + -- not want to drag in the bignum stuff if we are in Ignore + -- mode anyway. This is particularly important if we are using + -- a configurable run time that does not support bignum ops. + + if Scope_Suppress.Overflow_Mode_Assertions = Eliminated then + declare + Svo : constant Boolean := + Scope_Suppress.Suppress (Overflow_Check); + begin + Scope_Suppress.Overflow_Mode_Assertions := Strict; + Scope_Suppress.Suppress (Overflow_Check) := True; + Analyze (N); + Scope_Suppress.Suppress (Overflow_Check) := Svo; + Scope_Suppress.Overflow_Mode_Assertions := Eliminated; + end; + + -- Not that special case + + else + Analyze (N); + end if; + + -- All done with this check + In_Assertion_Expr := In_Assertion_Expr - 1; -- Check is active or expansion not active. In these cases we can
