diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-09 13:44:04 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-09 13:44:04 +0000 |
commit | 780bfb21f031faba83f49c3277ca732d90f28a82 (patch) | |
tree | 5bb42b5c9fd503b30a6ce3e268ee8f709af55414 /gcc/ada/sem_eval.adb | |
parent | a0016f6ba25eddf76347464334ea63ccb95c8e6b (diff) | |
download | gcc-780bfb21f031faba83f49c3277ca732d90f28a82.tar.gz |
2010-09-09 Ed Schonberg <schonberg@adacore.com>
* sem_eval.adb (Is_Same_Value): Two occurrences of the same
discriminant cannot be assumed to be the same value because they may
refer to bounds of a component of two different instances of a
discriminated type.
2010-09-09 Gary Dismukes <dismukes@adacore.com>
* checks.adb (Apply_Arithmetic_Overflow_Check): When converting the
operands of an operator to the type of an enclosing conversion, rewrite
the operator so the conversion can't be flagged as redundant.
Remove useless assignments to Typ and Rtyp.
2010-09-09 Eric Botcazou <ebotcazou@adacore.com>
* gnat_ugn.texi: Fix another long line.
2010-09-09 Bob Duff <duff@adacore.com>
* sem_warn.adb (Output_Reference_Error): Don't warn for renames read
but never assigned.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164096 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_eval.adb')
-rw-r--r-- | gcc/ada/sem_eval.adb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 467fafadb38..68c9ce8bd49 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -642,9 +642,15 @@ package body Sem_Eval is -- types, since we may have two NaN values and they should never -- compare equal. + -- If the entity is a discriminant, the two expressions may be + -- bounds of components of objects of the same discriminated + -- type. The values of the discriminants are not static, and + -- therefore the result is unknown. + if Nkind_In (Lf, N_Identifier, N_Expanded_Name) and then Nkind_In (Rf, N_Identifier, N_Expanded_Name) and then Entity (Lf) = Entity (Rf) + and then Ekind (Entity (Lf)) /= E_Discriminant and then Present (Entity (Lf)) and then not Is_Floating_Point_Type (Etype (L)) and then not Is_Volatile_Reference (L) |