diff options
author | Yannick Moy <moy@adacore.com> | 2023-03-30 15:07:09 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-29 10:23:18 +0200 |
commit | 68d5f8bdf16ba80f0b4326a6b2da1722f95f0546 (patch) | |
tree | f55dc476f21e831af203233048714e556ddef85e | |
parent | 4c33d93bfe8582375d4e56faebb911854517a9f3 (diff) | |
download | gcc-68d5f8bdf16ba80f0b4326a6b2da1722f95f0546.zip gcc-68d5f8bdf16ba80f0b4326a6b2da1722f95f0546.tar.gz gcc-68d5f8bdf16ba80f0b4326a6b2da1722f95f0546.tar.bz2 |
ada: Restore SPARK_Mode On for numerical functions
GNATprove has ad-hoc support for the standard numerical functions, which
consists in emitting an unprovable preconditions on cases which could
lead to an overflow. These functions are thus valid to call from SPARK
code.
gcc/ada/
* libgnat/a-ngelfu.ads: Restore SPARK_Mode from context.
-rw-r--r-- | gcc/ada/libgnat/a-ngelfu.ads | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/gcc/ada/libgnat/a-ngelfu.ads b/gcc/ada/libgnat/a-ngelfu.ads index ae06ea7..f6d6c96 100644 --- a/gcc/ada/libgnat/a-ngelfu.ads +++ b/gcc/ada/libgnat/a-ngelfu.ads @@ -116,17 +116,14 @@ is Post => (if X = 0.0 then Tan'Result = 0.0); function Tan (X, Cycle : Float_Type'Base) return Float_Type'Base with - SPARK_Mode => Off, -- Tan can overflow for some values of X and Cycle Pre => Cycle > 0.0 and then abs Float_Type'Base'Remainder (X, Cycle) /= 0.25 * Cycle, Post => (if X = 0.0 then Tan'Result = 0.0); function Cot (X : Float_Type'Base) return Float_Type'Base with - SPARK_Mode => Off, -- Cot can overflow for some values of X Pre => X /= 0.0; function Cot (X, Cycle : Float_Type'Base) return Float_Type'Base with - SPARK_Mode => Off, -- Cot can overflow for some values of X and Cycle Pre => Cycle > 0.0 and then X /= 0.0 and then Float_Type'Base'Remainder (X, Cycle) /= 0.0 @@ -179,11 +176,9 @@ is Post => (if X > 0.0 and then Y = 0.0 then Arccot'Result = 0.0); function Sinh (X : Float_Type'Base) return Float_Type'Base with - SPARK_Mode => Off, -- Sinh can overflow for some values of X Post => (if X = 0.0 then Sinh'Result = 0.0); function Cosh (X : Float_Type'Base) return Float_Type'Base with - SPARK_Mode => Off, -- Cosh can overflow for some values of X Post => Cosh'Result >= 1.0 and then (if X = 0.0 then Cosh'Result = 1.0); @@ -192,7 +187,6 @@ is and then (if X = 0.0 then Tanh'Result = 0.0); function Coth (X : Float_Type'Base) return Float_Type'Base with - SPARK_Mode => Off, -- Coth can overflow for some values of X Pre => X /= 0.0, Post => abs Coth'Result >= 1.0; |