Mercurial > hg > CbC > CbC_gcc
diff gcc/ada/libgnat/s-fatgen.adb @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
line wrap: on
line diff
--- a/gcc/ada/libgnat/s-fatgen.adb Fri Oct 27 22:46:09 2017 +0900 +++ b/gcc/ada/libgnat/s-fatgen.adb Thu Oct 25 07:37:49 2018 +0900 @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2017, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2018, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -394,7 +394,7 @@ function Model (X : T) return T is begin - return Machine (X); + return T'Machine (X); end Model; ---------- @@ -415,16 +415,7 @@ elsif X = T'First then - -- If not generating infinities, we raise a constraint error - - if T'Machine_Overflows then - raise Constraint_Error with "Pred of largest negative number"; - - -- Otherwise generate a negative infinity - - else - return X / (X - X); - end if; + raise Constraint_Error with "Pred of largest negative number"; -- For infinities, return unchanged @@ -671,15 +662,10 @@ -- If not generating infinities, we raise a constraint error - if T'Machine_Overflows then - raise Constraint_Error with "Succ of largest negative number"; + raise Constraint_Error with "Succ of largest positive number"; -- Otherwise generate a positive infinity - else - return X / (X - X); - end if; - -- For infinities, return unchanged elsif X < T'First or else X > T'Last then @@ -739,10 +725,11 @@ Result := abs X; if Result >= Radix_To_M_Minus_1 then - return Machine (X); + return T'Machine (X); else - Result := Machine (Radix_To_M_Minus_1 + Result) - Radix_To_M_Minus_1; + Result := + T'Machine (Radix_To_M_Minus_1 + Result) - Radix_To_M_Minus_1; if Result > abs X then Result := Result - 1.0;