aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_eval.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2016-04-21 10:48:04 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2016-04-21 10:48:04 +0200
commit08f52d9f8462f6d35a82fe51818929fc563b4285 (patch)
treed48fa71938d552b7b9b48fb1a0a0bf1bc6acb1a9 /gcc/ada/sem_eval.adb
parentb943a971133bb727c28aaaa705b93c7f6f7a5fb4 (diff)
downloadgcc-08f52d9f8462f6d35a82fe51818929fc563b4285.zip
gcc-08f52d9f8462f6d35a82fe51818929fc563b4285.tar.gz
gcc-08f52d9f8462f6d35a82fe51818929fc563b4285.tar.bz2
[multiple changes]
2016-04-21 Philippe Gil <gil@adacore.com> * tracebak.c (__gnat_backtrace): handle bad RIP values (win64 only) 2016-04-21 Javier Miranda <miranda@adacore.com> * exp_aggr.adb (Component_Not_OK_For_Backend): Return true for string literals. 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Has_Non_Null_Abstract_State): New routine. * einfo.ads New synthesized attribute Has_Non_Null_Abstract_State along with occurrences in entities. (Has_Non_Null_Abstract_State): New routine. * sem_ch7.adb (Unit_Requires_Body): Add local variable Requires_Body. A package declaring an abstract state requires a body only when the state is non-null and the package contains at least one other construct that requires completion in a body. * sem_util.adb (Mode_Is_Off): Removed. (Requires_State_Refinement): Remove an obsolete check. Code cleanup. 2016-04-21 Bob Duff <duff@adacore.com> * sem_attr.adb (Analyze_Attribute): In processing the 'Old attribute, a warning is given for infinite recursion. Fix the code to not crash when the prefix of 'Old denotes a protected function. * sem_ch5.adb (Analyze_Iterator_Specification): Avoid calling Is_Dependent_Component_Of_Mutable_Object in cases where the parameter would not be an object. 2016-04-21 Eric Botcazou <ebotcazou@adacore.com> * sem_eval.adb (Compile_Time_Compare): Be prepared for an empty Etype or Underlying_Type of the operands. 2016-04-21 Eric Botcazou <ebotcazou@adacore.com> * atree.adb (Print_Statistics): Protect against overflows and print the memory consumption in bytes. * table.adb (Reallocate): Do the intermediate calculation of the new size using the Memory.size_t type. From-SVN: r235312
Diffstat (limited to 'gcc/ada/sem_eval.adb')
-rw-r--r--gcc/ada/sem_eval.adb32
1 files changed, 22 insertions, 10 deletions
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index 620c166..5589394 100644
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2016, 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- --
@@ -772,12 +772,8 @@ package body Sem_Eval is
Assume_Valid : Boolean;
Rec : Boolean := False) return Compare_Result
is
- Ltyp : Entity_Id := Underlying_Type (Etype (L));
- Rtyp : Entity_Id := Underlying_Type (Etype (R));
- -- These get reset to the base type for the case of entities where
- -- Is_Known_Valid is not set. This takes care of handling possible
- -- invalid representations using the value of the base type, in
- -- accordance with RM 13.9.1(10).
+ Ltyp : Entity_Id := Etype (L);
+ Rtyp : Entity_Id := Etype (R);
Discard : aliased Uint;
@@ -1100,19 +1096,35 @@ package body Sem_Eval is
if L = R then
return EQ;
+ end if;
-- If expressions have no types, then do not attempt to determine if
-- they are the same, since something funny is going on. One case in
-- which this happens is during generic template analysis, when bounds
-- are not fully analyzed.
- elsif No (Ltyp) or else No (Rtyp) then
+ if No (Ltyp) or else No (Rtyp) then
+ return Unknown;
+ end if;
+
+ -- These get reset to the base type for the case of entities where
+ -- Is_Known_Valid is not set. This takes care of handling possible
+ -- invalid representations using the value of the base type, in
+ -- accordance with RM 13.9.1(10).
+
+ Ltyp := Underlying_Type (Ltyp);
+ Rtyp := Underlying_Type (Rtyp);
+
+ -- Same rationale as above, but for Underlying_Type instead of Etype
+
+ if No (Ltyp) or else No (Rtyp) then
return Unknown;
+ end if;
- -- We do not attempt comparisons for packed arrays represented as
+ -- We do not attempt comparisons for packed arrays arrays represented as
-- modular types, where the semantics of comparison is quite different.
- elsif Is_Packed_Array_Impl_Type (Ltyp)
+ if Is_Packed_Array_Impl_Type (Ltyp)
and then Is_Modular_Integer_Type (Ltyp)
then
return Unknown;