This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Ada subtypes and base types
- From: Jeffrey A Law <law at redhat dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 21 Feb 2006 15:02:55 -0700
- Subject: Re: Ada subtypes and base types
- References: <10602212124.AA13482@vlsi1.ultra.nyu.edu>
- Reply-to: law at redhat dot com
On Tue, 2006-02-21 at 16:24 -0500, Richard Kenner wrote:
> So, back to my example. If I have an object with a range [0,
> 0x7ff fffff] based on the type of the object and I add one to that
> object, then I can safely conclude that the result of the addition has
> the range [1, 0x7fffffff]. Right?
>
> If the addition were in the type of the object, yes. But it's not supposed
> to be. It's supposed to be in the *base type* of the object which won't
> have the TYPE_MAX_VALUE restriction so that nobody would try to conclude
> that there was an upper-bound limit.
?!? WTF
Given an expression, we have to do computations in some other type than
the type of the expression? Now that's just silly. If the expression
has some type X, then we should be doing our computations in type X.
Not the basetype X'. If Ada really expects this throughout GCC, then
we've got some major underlying problems.
Jeff