This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bootstrap failure on trunk: x86_64-linux-gnu


On 2/21/06, Mark Mitchell <mark@codesourcery.com> wrote:
> Jeffrey A Law wrote:
>
> > My feeling?  Absolutely, TYPE_MIN_VALUE and TYPE_MAX_VALUE should
> > represent the set of values that an object of the type may hold.
> > Any other definition effectively renders those values useless.
>
> I agree -- with the obvious caveat that it need not be the case that the
> object actually have that value if the program has invoked undefined
> behavior.  So, if you have an 5-bit type, stored in a byte, and you
> manage to get 255 in that byte, and you read the value, you might see
> 255 at runtime -- but only because your program was busted anyhow.

Right.  And if Ada wants to test for this condition using 'Valid, it should do
the range comparison in the base type and use a VIEW_CONVERT_EXPR
to get to the object of the base type from the 5-bit-type to avoid VRP
optimizing
away the comparison.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]