From: Viljar Indus <in...@adacore.com>

gcc/ada/ChangeLog:

        * table.adb (Max): Move variable to the body and initialize
        it with the same value as in the Init function.
        * table.ads (Max): Likewise.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/table.adb | 3 +++
 gcc/ada/table.ads | 3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/table.adb b/gcc/ada/table.adb
index 37c49494197..31891de87db 100644
--- a/gcc/ada/table.adb
+++ b/gcc/ada/table.adb
@@ -40,6 +40,9 @@ package body Table is
       Min : constant Int := Int (Table_Low_Bound);
       --  Subscript of the minimum entry in the currently allocated table
 
+      Max : Int := Min + (Table_Initial * Table_Factor) - 1;
+      --  Subscript of the maximum entry in the currently allocated table
+
       Length : Int := 0;
       --  Number of entries in currently allocated table. The value of zero
       --  ensures that we initially allocate the table.
diff --git a/gcc/ada/table.ads b/gcc/ada/table.ads
index 22e9172bc48..623ce14711b 100644
--- a/gcc/ada/table.ads
+++ b/gcc/ada/table.ads
@@ -223,9 +223,6 @@ package Table is
       --  the official interfaces (since a modification to Last may require a
       --  reallocation of the table).
 
-      Max : Int;
-      --  Subscript of the maximum entry in the currently allocated table
-
       type Saved_Table is record
          Last_Val : Int;
          Max      : Int;
-- 
2.43.0

Reply via email to