]> gcc.gnu.org Git - gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 6 Nov 2012 10:05:10 +0000 (11:05 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 6 Nov 2012 10:05:10 +0000 (11:05 +0100)
2012-11-06  Tristan Gingold  <gingold@adacore.com>

* exp_vfpt.adb: Document VAX float point layout.

2012-11-06  Geert Bosch  <bosch@adacore.com>

* eval_fat.adb (Machine): Don't return -0.0 on targets without
signed zeros.

2012-11-06  Ed Schonberg  <schonberg@adacore.com>

* sem_ch9.adb (Analyze_Entry_Call_Alternative,
Check_Triggering_Statement): Reject properly an indirect call.

From-SVN: r193222

gcc/ada/ChangeLog
gcc/ada/eval_fat.adb
gcc/ada/exp_vfpt.adb
gcc/ada/sem_ch9.adb

index ea56dec772c53641283521d50a5809e84ad58f14..7aad4baa46abd006626f79d8ac5d599c2440e1d0 100644 (file)
@@ -1,3 +1,17 @@
+2012-11-06  Tristan Gingold  <gingold@adacore.com>
+
+       * exp_vfpt.adb: Document VAX float point layout.
+
+2012-11-06  Geert Bosch  <bosch@adacore.com>
+
+       * eval_fat.adb (Machine): Don't return -0.0 on targets without
+       signed zeros.
+
+2012-11-06  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch9.adb (Analyze_Entry_Call_Alternative,
+       Check_Triggering_Statement): Reject properly an indirect call.
+
 2012-11-06  Pascal Obry  <obry@adacore.com>
 
        * xoscons.adb, xutil.adb, xutil.ads: Add support for post-processing.
index 8ebeb117614b4fa08f2d4e99524a498f362fd95c..bbcb886b72210383b5db7fa383d3623798747382 100644 (file)
@@ -371,9 +371,14 @@ package body Eval_Fat is
          case Mode is
             when Round_Even =>
 
-               --  This rounding mode should not be used for static
-               --  expressions, but only for compile-time evaluation of
-               --  non-static expressions.
+               --  This rounding mode corresponds to the unbiased rounding
+               --  method that is used at run time. When the real value is
+               --  exactly between two machine numbers, choose the machine
+               --  number with its least significant bit equal to zero.
+
+               --  The recommendation advice in RM 4.9(38) is that static
+               --  expressions are rounded to machine numbers in the same
+               --  way as the target machine does.
 
                if (Even and then N * 2 > D)
                      or else
@@ -386,7 +391,9 @@ package body Eval_Fat is
 
                --  Do not round to even as is done with IEEE arithmetic, but
                --  instead round away from zero when the result is exactly
-               --  between two machine numbers. See RM 4.9(38).
+               --  between two machine numbers. This biased rounding method
+               --  should not be used to convert static expressions to
+               --  machine numbers, see AI95-268.
 
                if N * 2 >= D then
                   Fraction := Fraction + 1;
@@ -513,7 +520,7 @@ package body Eval_Fat is
                                         - Machine_Mantissa_Value (RT) + Uint_1;
          begin
             if X_Exp < Emin_Den or not Denorm_On_Target then
-               if UR_Is_Negative (X) then
+               if Signed_Zeros_On_Target and then UR_Is_Negative (X) then
                   Error_Msg_N
                     ("floating-point value underflows to -0.0?", Enode);
                   return Ureal_M_0;
index 592114cf1d843ce3d09a218180d4644a97e34cc4..146fab8a9df638e11886c8d64fb7e4bcb51dbfb2 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1997-2010, Free Software Foundation, Inc.         --
+--          Copyright (C) 1997-2012, 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- --
@@ -37,6 +37,78 @@ with Urealp;   use Urealp;
 
 package body Exp_VFpt is
 
+   --  Vax floating point format (from Vax Architecture Reference Manual
+   --  version 6):
+   --
+   --  Float F:
+   --  --------
+   --
+   --   1 1
+   --   5 4             7 6            0
+   --  +-+---------------+--------------+
+   --  |S|     exp       |   fraction   |  A
+   --  +-+---------------+--------------+
+   --  |             fraction           |  A + 2
+   --  +--------------------------------+
+   --
+   --  bit 15 is the sign bit,
+   --  bits 14:7 is the excess 128 binary exponent,
+   --  bits 6:0 and 31:16 the normalized 24-bit fraction with the redundant
+   --    most significant fraction bit not represented.
+   --
+   --  An exponent value of 0 together with a sign bit of 0, is taken to
+   --  indicate that the datum has a value of 0. Exponent values of 1 through
+   --  255 indicate true binary exponents of -127 to +127. An exponent value
+   --  of 0, together with a sign bit of 1, is taken as reserved.
+   --
+   --  Note that fraction bits are not continuous in memory, VAX is little
+   --  endian (LSB first).
+   --
+   --  Float D:
+   --  --------
+   --
+   --   1 1
+   --   5 4             7 6            0
+   --  +-+---------------+--------------+
+   --  |S|     exp       |   fraction   |  A
+   --  +-+---------------+--------------+
+   --  |             fraction           |  A + 2
+   --  +--------------------------------+
+   --  |             fraction           |  A + 4
+   --  +--------------------------------+
+   --  |             fraction           |  A + 6
+   --  +--------------------------------+
+   --
+   --  Like Float F but with 55 bits for the fraction.
+   --
+   --  Float G:
+   --  --------
+   --
+   --   1 1
+   --   5 4                   4 3      0
+   --  +-+---------------------+--------+
+   --  |S|     exp             |  fract |  A
+   --  +-+---------------------+--------+
+   --  |             fraction           |  A + 2
+   --  +--------------------------------+
+   --  |             fraction           |  A + 4
+   --  +--------------------------------+
+   --  |             fraction           |  A + 6
+   --  +--------------------------------+
+   --
+   --  Exponent values of 1 through 2047 indicate trye binary exponents of
+   --  -1023 to +1023.
+   --
+   --  Main differences compared to IEEE 754:
+   --
+   --  * No denormalized numbers
+   --  * No infinity
+   --  * No NaN
+   --  * No -0.0
+   --  * Reserved values (exp = 0, sign = 1)
+   --  * Vax mantissa represent values [0.5, 1)
+   --  * Bias is shifted by 1 (for single float: 128 on Vax, 127 on IEEE)
+
    VAXFF_Digits : constant := 6;
    VAXDF_Digits : constant := 9;
    VAXGF_Digits : constant := 15;
index a81ea5c6148c3ac7c78f4aec0e7a55b2f9ed6eb9..4e0ecf28a2dbce67891bcaff90d1f71440ec3037 100644 (file)
@@ -1470,6 +1470,15 @@ package body Sem_Ch9 is
 
       Analyze (Call);
 
+      --  An indirect call in this context  is illegal. A procedure call that
+      --  does not involve a renaming of an entry is illegal as well, but this
+      --  and other semantic errors are caught during resolution.
+
+      if Nkind (Call) = N_Explicit_Dereference then
+         Error_Msg_N
+           ("entry call or dispatching primitive of interface required ", N);
+      end if;
+
       if Is_Non_Empty_List (Statements (N)) then
          Analyze_Statements (Statements (N));
       end if;
@@ -3304,6 +3313,11 @@ package body Sem_Ch9 is
                  ("dispatching operation of limited or synchronized " &
                   "interface required (RM 9.7.2(3))!", Error_Node);
             end if;
+
+         elsif Nkind (Trigger) = N_Explicit_Dereference then
+            Error_Msg_N
+              ("entry call or dispatching primitive of interface required ",
+                Trigger);
          end if;
       end if;
    end Check_Triggering_Statement;
This page took 0.082938 seconds and 5 git commands to generate.