This is the mail archive of the
mailing list for the GCC project.
Re: Ada subtypes and base types
- From: Jeffrey A Law <law at redhat dot com>
- To: Sebastian Pop <sebastian dot pop at cri dot ensmp dot fr>
- Cc: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>, gcc at gcc dot gnu dot org
- Date: Fri, 24 Feb 2006 09:53:03 -0700
- Subject: Re: Ada subtypes and base types
- References: <10602241616.AA08086@vlsi1.ultra.nyu.edu> <20060224174211.GA4315@napoca.cri.ensmp.fr>
- Reply-to: law at redhat dot com
On Fri, 2006-02-24 at 18:42 +0100, Sebastian Pop wrote:
> Richard Kenner wrote:
> > Just to make sure I've dotted the i's and crossed the t's, this is not
> > what's happening when we hang in VRP when compiling a-textio.
> > We convert the incoming object from natural___XDLU_0___2147483647
> > into its base type, perform the addition in the base type, then
> > convert back to XDLU_0_2147483647.
> > The above is exactly what I thought everybody agrees is and should be
> > happening, so I'm confused by your "this is not what's happening"
> > comment above.
> So if I understand correctly, if we can prove that the operation does
> not overflow in natural___XDLU_0___2147483647, then there is no need
> of a cast to the base type and back.
And that's still a topic that needs to be thoroughly
discussed. We overflow the TYPE_MAX_VALUE, but do not
overflow its TYPE_PRECISION. ie, TYPE_MIN_VALUE/TYPE_MAX_VALUE
do not cover the set of values allowed by TYPE_PRECISION.
I claim that is a bug in the Ada front-end. Others might