PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE (Ada RFC)
Robert Dewar
dewar@adacore.com
Fri Aug 12 16:08:00 GMT 2005
Richard Kenner wrote:
> If this still doesn't convince you, here's an example which doesn't
> use Ada.Unchecked_Conversion at all.
>
> Well sure, reading an uninitialized value is erroneous except for the use
> of 'Valid.
That is wrong, it is a bounded error. and of course validit checks must
work as described in the ghnat rm.
>
> I'm not saying that things aren't broken, just being very careful in the
> definition of what a "valid" value in an object is. The point is that these
> values are not "valid" (which is why 'Valid returns FALSE) and that the
> compiler (specifically VRP) is *correct* in deducing that the values are
> in the valid range of the type *except* for 'Valid and range checks.
right, but range ckecks for validity checking arr crucial
>
> Those checks need to be done another way, such as by using the "base type".
> The issues with that have to do with debug output, representation within
> Gigi, and whether the NOP_EXPRs that would have to be used to implement
> that will be maintained.
the are done with the base type now!
More information about the Gcc
mailing list