]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Change rounding mode of 'Machine for static floating point
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 19 Dec 2020 10:46:06 +0000 (11:46 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 29 Apr 2021 08:00:49 +0000 (04:00 -0400)
gcc/ada/

* sem_attr.adb (Eval_Attribute) <Attribute_Machine>: Use
Round_Even instead of Round in the call to the Machine routine.

gcc/ada/sem_attr.adb

index 2226eced4421a817a68141764d3a21ff5265706b..9d96ee16c5b0965050fe0393c5d4db33d19c19e7 100644 (file)
@@ -9107,11 +9107,13 @@ package body Sem_Attr is
       -- Machine --
       -------------
 
+      --  We use the same rounding mode as the one used for RM 4.9(38)
+
       when Attribute_Machine =>
          Fold_Ureal
            (N,
             Eval_Fat.Machine
-              (P_Base_Type, Expr_Value_R (E1), Eval_Fat.Round, N),
+              (P_Base_Type, Expr_Value_R (E1), Eval_Fat.Round_Even, N),
             Static);
 
       ------------------