[Ada] Do not second-guess the hardware for underflow handling of Scaling
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 21 Jan 2021 12:12:50 +0000 (13:12 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 6 May 2021 07:51:38 +0000 (03:51 -0400)
gcc/ada/

* libgnat/s-fatgen.adb (Scaling): Use single handling of
underflow.  Add pragma Annotate.

gcc/ada/libgnat/s-fatgen.adb

index 145d4ac..ec376e7 100644 (file)
@@ -781,11 +781,9 @@ package body System.Fat_Gen is
          --  Check for underflow
 
          elsif Adjustment < IEEE_Emin - Exp then
-            --  Check for gradual underflow
+            --  Check for possibly gradual underflow (up to the hardware)
 
-            if T'Denorm
-              and then Adjustment >= IEEE_Emin - Mantissa - Exp
-            then
+            if Adjustment >= IEEE_Emin - Mantissa - Exp then
                Expf := IEEE_Emin;
                Expi := Exp + Adjustment - Expf;
 
@@ -810,6 +808,9 @@ package body System.Fat_Gen is
             --  Given that Expi >= -Mantissa, only -64 is problematic
 
             if Expi = -64 then
+               pragma Annotate
+                 (CodePeer, Intentional, "test always false",
+                  "test always false in some instantiations");
                XX := XX / 2.0;
                Expi := -63;
             end if;