]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Check restriction No_Secondary_Stack for overflow elimination
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 30 Jul 2025 10:08:46 +0000 (12:08 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 9 Sep 2025 12:39:52 +0000 (14:39 +0200)
When overflow checks are eliminated using System.Bignums package, we must
check if secondary stack that is necessary for this package is available.

gcc/ada/ChangeLog:

* checks.adb (Make_Bignum_Block): Check restriction No_Secondary_Stack.

gcc/ada/checks.adb

index dfda0a6622bcda60caa90b286195ba7b5108a19e..a9bebee3e13934df7fa23ff005ba40419e955ea4 100644 (file)
@@ -8948,6 +8948,8 @@ package body Checks is
    function Make_Bignum_Block (Loc : Source_Ptr) return Node_Id is
       M : constant Entity_Id := Make_Defining_Identifier (Loc, Name_uM);
    begin
+      Check_Restriction (No_Secondary_Stack, M);
+
       return
         Make_Block_Statement (Loc,
           Declarations               =>