aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_eval.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-10-24 11:19:15 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-10-24 11:19:15 +0200
commit86f0e17adccb1d1f127d6e489ac1cf7a3bb2f517 (patch)
treed89cf897a9a425f8c25bed513a2012ba82a689ae /gcc/ada/sem_eval.adb
parent02b76a8d709b488c9de95820add27ef9d964aa92 (diff)
downloadgcc-86f0e17adccb1d1f127d6e489ac1cf7a3bb2f517.zip
gcc-86f0e17adccb1d1f127d6e489ac1cf7a3bb2f517.tar.gz
gcc-86f0e17adccb1d1f127d6e489ac1cf7a3bb2f517.tar.bz2
2011-10-24 Sergey Rybin <rybin@adacore.com frybin>
* gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
Diffstat (limited to 'gcc/ada/sem_eval.adb')
-rw-r--r--gcc/ada/sem_eval.adb67
1 files changed, 36 insertions, 31 deletions
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index 5be5843..64db8d6 100644
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -250,27 +250,32 @@ package body Sem_Eval is
and not Range_Checks_Suppressed (T);
begin
- -- Ignore cases of non-scalar types or error types
+ -- Ignore cases of non-scalar types, error types, or universal real
+ -- types that have no usable bounds.
- if T = Any_Type or else not Is_Scalar_Type (T) then
+ if T = Any_Type
+ or else not Is_Scalar_Type (T)
+ or else T = Universal_Fixed
+ or else T = Universal_Real
+ then
return;
end if;
- -- At this stage we have a scalar type. If we have an expression
- -- that raises CE, then we already issued a warning or error msg
- -- so there is nothing more to be done in this routine.
+ -- At this stage we have a scalar type. If we have an expression that
+ -- raises CE, then we already issued a warning or error msg so there
+ -- is nothing more to be done in this routine.
if Raises_Constraint_Error (N) then
return;
end if;
- -- Now we have a scalar type which is not marked as raising a
- -- constraint error exception. The main purpose of this routine
- -- is to deal with static expressions appearing in a non-static
- -- context. That means that if we do not have a static expression
- -- then there is not much to do. The one case that we deal with
- -- here is that if we have a floating-point value that is out of
- -- range, then we post a warning that an infinity will result.
+ -- Now we have a scalar type which is not marked as raising a constraint
+ -- error exception. The main purpose of this routine is to deal with
+ -- static expressions appearing in a non-static context. That means
+ -- that if we do not have a static expression then there is not much
+ -- to do. The one case that we deal with here is that if we have a
+ -- floating-point value that is out of range, then we post a warning
+ -- that an infinity will result.
if not Is_Static_Expression (N) then
if Is_Floating_Point_Type (T)
@@ -283,17 +288,17 @@ package body Sem_Eval is
return;
end if;
- -- Here we have the case of outer level static expression of
- -- scalar type, where the processing of this procedure is needed.
+ -- Here we have the case of outer level static expression of scalar
+ -- type, where the processing of this procedure is needed.
-- For real types, this is where we convert the value to a machine
- -- number (see RM 4.9(38)). Also see ACVC test C490001. We should
- -- only need to do this if the parent is a constant declaration,
- -- since in other cases, gigi should do the necessary conversion
- -- correctly, but experimentation shows that this is not the case
- -- on all machines, in particular if we do not convert all literals
- -- to machine values in non-static contexts, then ACVC test C490001
- -- fails on Sparc/Solaris and SGI/Irix.
+ -- number (see RM 4.9(38)). Also see ACVC test C490001. We should only
+ -- need to do this if the parent is a constant declaration, since in
+ -- other cases, gigi should do the necessary conversion correctly, but
+ -- experimentation shows that this is not the case on all machines, in
+ -- particular if we do not convert all literals to machine values in
+ -- non-static contexts, then ACVC test C490001 fails on Sparc/Solaris
+ -- and SGI/Irix.
if Nkind (N) = N_Real_Literal
and then not Is_Machine_Number (N)
@@ -320,12 +325,12 @@ package body Sem_Eval is
elsif not UR_Is_Zero (Realval (N)) then
- -- Note: even though RM 4.9(38) specifies biased rounding,
- -- this has been modified by AI-100 in order to prevent
- -- confusing differences in rounding between static and
- -- non-static expressions. AI-100 specifies that the effect
- -- of such rounding is implementation dependent, and in GNAT
- -- we round to nearest even to match the run-time behavior.
+ -- Note: even though RM 4.9(38) specifies biased rounding, this
+ -- has been modified by AI-100 in order to prevent confusing
+ -- differences in rounding between static and non-static
+ -- expressions. AI-100 specifies that the effect of such rounding
+ -- is implementation dependent, and in GNAT we round to nearest
+ -- even to match the run-time behavior.
Set_Realval
(N, Machine (Base_Type (T), Realval (N), Round_Even, N));
@@ -455,10 +460,10 @@ package body Sem_Eval is
-- simple cases can be recognized.
function Is_Same_Value (L, R : Node_Id) return Boolean;
- -- Returns True iff L and R represent expressions that definitely
- -- have identical (but not necessarily compile time known) values
- -- Indeed the caller is expected to have already dealt with the
- -- cases of compile time known values, so these are not tested here.
+ -- Returns True iff L and R represent expressions that definitely have
+ -- identical (but not necessarily compile time known) values Indeed the
+ -- caller is expected to have already dealt with the cases of compile
+ -- time known values, so these are not tested here.
-----------------------
-- Compare_Decompose --