===================================================================
@@ -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)