aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-06-23 11:53:53 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-15 05:39:09 -0400
commit73b211a76e4da53960958b8a4b3821de82a3219c (patch)
tree5ad04ad1acda52e70912fe645f3cf151bc8ea3cf
parenta39bc02543ee30ac995104e369adc84a08798709 (diff)
downloadgcc-73b211a76e4da53960958b8a4b3821de82a3219c.zip
gcc-73b211a76e4da53960958b8a4b3821de82a3219c.tar.gz
gcc-73b211a76e4da53960958b8a4b3821de82a3219c.tar.bz2
[Ada] Do not use maximal values from System in runtime units
gcc/ada/ * libgnat/a-cfinve.adb (Int): Use subtype of Long_Long_Integer. * libgnat/a-cofove.adb (Int): Likewise. * libgnat/a-cgcaso.adb (T): Likewise. * libgnat/a-cogeso.adb (T): Likewise. * libgnat/g-debpoo.ads (Byte_Count): Use Long_Long_Integer'Size.
-rw-r--r--gcc/ada/libgnat/a-cfinve.adb2
-rw-r--r--gcc/ada/libgnat/a-cgcaso.adb4
-rw-r--r--gcc/ada/libgnat/a-cofove.adb2
-rw-r--r--gcc/ada/libgnat/a-cogeso.adb4
-rw-r--r--gcc/ada/libgnat/g-debpoo.ads2
5 files changed, 5 insertions, 9 deletions
diff --git a/gcc/ada/libgnat/a-cfinve.adb b/gcc/ada/libgnat/a-cfinve.adb
index 28e31d1..e424df0 100644
--- a/gcc/ada/libgnat/a-cfinve.adb
+++ b/gcc/ada/libgnat/a-cfinve.adb
@@ -40,7 +40,7 @@ is
-- When growing a container, multiply current capacity by this. Doubling
-- leads to amortized linear-time copying.
- type Int is range System.Min_Int .. System.Max_Int;
+ subtype Int is Long_Long_Integer;
procedure Free is
new Ada.Unchecked_Deallocation (Elements_Array, Elements_Array_Ptr);
diff --git a/gcc/ada/libgnat/a-cgcaso.adb b/gcc/ada/libgnat/a-cgcaso.adb
index 877abab..ff03b80 100644
--- a/gcc/ada/libgnat/a-cgcaso.adb
+++ b/gcc/ada/libgnat/a-cgcaso.adb
@@ -29,12 +29,10 @@
-- This algorithm was adapted from GNAT.Heap_Sort_G (see g-hesorg.ad[sb])
-with System;
-
procedure Ada.Containers.Generic_Constrained_Array_Sort
(Container : in out Array_Type)
is
- type T is range System.Min_Int .. System.Max_Int;
+ subtype T is Long_Long_Integer;
function To_Index (J : T) return Index_Type;
pragma Inline (To_Index);
diff --git a/gcc/ada/libgnat/a-cofove.adb b/gcc/ada/libgnat/a-cofove.adb
index 41c69a8..c8a60df 100644
--- a/gcc/ada/libgnat/a-cofove.adb
+++ b/gcc/ada/libgnat/a-cofove.adb
@@ -33,7 +33,7 @@ package body Ada.Containers.Formal_Vectors with
SPARK_Mode => Off
is
- type Int is range System.Min_Int .. System.Max_Int;
+ subtype Int is Long_Long_Integer;
function To_Array_Index (Index : Index_Type'Base) return Count_Type'Base;
diff --git a/gcc/ada/libgnat/a-cogeso.adb b/gcc/ada/libgnat/a-cogeso.adb
index 7a71772..2b6b05e 100644
--- a/gcc/ada/libgnat/a-cogeso.adb
+++ b/gcc/ada/libgnat/a-cogeso.adb
@@ -29,10 +29,8 @@
-- This algorithm was adapted from GNAT.Heap_Sort (see g-heasor.ad[sb])
-with System;
-
procedure Ada.Containers.Generic_Sort (First, Last : Index_Type'Base) is
- type T is range System.Min_Int .. System.Max_Int;
+ subtype T is Long_Long_Integer;
function To_Index (J : T) return Index_Type;
pragma Inline (To_Index);
diff --git a/gcc/ada/libgnat/g-debpoo.ads b/gcc/ada/libgnat/g-debpoo.ads
index ed000fa..88cffe8 100644
--- a/gcc/ada/libgnat/g-debpoo.ads
+++ b/gcc/ada/libgnat/g-debpoo.ads
@@ -299,7 +299,7 @@ package GNAT.Debug_Pools is
-- If Valid is True, Size_In_Storage_Elements is set to the size of this
-- chunk of memory.
- type Byte_Count is mod System.Max_Binary_Modulus;
+ type Byte_Count is mod 2 ** Long_Long_Integer'Size;
-- Type used for maintaining byte counts, needs to be large enough to
-- to accommodate counts allowing for repeated use of the same memory.