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: Florian Weimer <fw at deneb dot enyo dot de>
- To: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 05 Aug 2005 23:36:18 +0200
- Subject: Re: PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE (Ada RFC)
- References: <10508052114.AA11329@vlsi1.ultra.nyu.edu>
* Richard Kenner:
> This is simply not true for Ada. Look at the definition of the 'Valid
> attribute in the standard:
>
> 3. X'Valid
>
> Yields True if and only if the object denoted by X is normal
> and has a valid representation. The value of this attribute
> is of the predefined type Boolean.
>
> Right. That says what a "valid representation" is. Except for the
> result of an unchecked_conversion being given as the operand of 'Valid,
> any other value in that type is erroneous.
Both ARM 13.9.1 and the GNAT User Guide (in Section 3.2.4 Validity
Checking) require that such reads are NOT erroneous.