]> gcc.gnu.org Git - gcc.git/commit - gcc/ada/exp_attr.adb
[Ada] Implement Machine_Rounding attribute in line when possible
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 19 Sep 2019 08:13:38 +0000 (08:13 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 19 Sep 2019 08:13:38 +0000 (08:13 +0000)
commitd8ec2787e0ba7b508c968c330b04575d2cbf97d7
treec3c07f4f98ae46537abb0ec4383ef8b1d9b17fef
parent143df1f9aa4e829907d4e300a0006783fcbba71b
[Ada] Implement Machine_Rounding attribute in line when possible

GNAT implements Machine_Rounding as an alias for Rounding but, whereas
the implementation of the latter is in line when possible, that of the
former is always out of line, which is not aligned with the intent of
the Ada RM.

This changes the compiler to using for Machine_Rounding the same in line
implementation as Rounding when possible.

Running these commands:

  gcc -c f.adb -gnatD
  grep system f.adb.dg

On the following sources:

function F (Val : Float) return Integer is
begin
  return Integer (Float'Machine_Rounding (Val));
end;

Should execute silently.

2019-09-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* exp_attr.adb (Is_Inline_Floating_Point_Attribute): Treat
Machine_Rounding as an alias for Rounding.
* sem_res.adb (Simplify_Type_Conversion): Likewise.

From-SVN: r275943
gcc/ada/ChangeLog
gcc/ada/exp_attr.adb
gcc/ada/sem_res.adb
This page took 0.057953 seconds and 5 git commands to generate.