aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-06 10:05:10 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-06 10:05:10 +0000
commit8b8f1d9876597d82f2ab618f1b749b8196f9f640 (patch)
treee124bc5974e7659ce403e0ed50952ad03cf3fe59
parent9040d7303678fb82f0f39e5436dd5eb8828e4da9 (diff)
downloadgcc-upstream-8b8f1d9876597d82f2ab618f1b749b8196f9f640.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193222 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog14
-rw-r--r--gcc/ada/eval_fat.adb17
-rw-r--r--gcc/ada/exp_vfpt.adb74
-rw-r--r--gcc/ada/sem_ch9.adb14
4 files changed, 113 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index ea56dec772c..7aad4baa46a 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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.
diff --git a/gcc/ada/eval_fat.adb b/gcc/ada/eval_fat.adb
index 8ebeb117614..bbcb886b722 100644
--- a/gcc/ada/eval_fat.adb
+++ b/gcc/ada/eval_fat.adb
@@ -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;
diff --git a/gcc/ada/exp_vfpt.adb b/gcc/ada/exp_vfpt.adb
index 592114cf1d8..146fab8a9df 100644
--- a/gcc/ada/exp_vfpt.adb
+++ b/gcc/ada/exp_vfpt.adb
@@ -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;
diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb
index a81ea5c6148..4e0ecf28a2d 100644
--- a/gcc/ada/sem_ch9.adb
+++ b/gcc/ada/sem_ch9.adb
@@ -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;