This changes the rounding mode used for the static evaluation of the
Machine attribute of floating-point types to the mode used for the
static evaluation of real expressions, for the sake of consistency.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * sem_attr.adb (Eval_Attribute) <Attribute_Machine>: Use
        Round_Even instead of Round in the call to the Machine routine.
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -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);
 
       ------------------


Reply via email to