This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE (Ada RFC)
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: fw at deneb dot enyo dot de
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 5 Aug 05 17:45:28 EDT
- Subject: Re: PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE (Ada RFC)
Both ARM 13.9.1 and the GNAT User Guide (in Section 3.2.4 Validity
Checking) require that such reads are NOT erroneous.
It depends what "such reads" mean. 13.9.1(12) clearly says that the
result of an Unchecked_Conversion is erroneous if it isn't a valid
representation. There are some cases, however, where an out-of-range
value is a bounded error instead of being erroneous.
However, note 20 (13.9.2) says that 'Valid is not considered a "read"
and hence its use is not erroneous.