This is the mail archive of the
mailing list for the GCC project.
Re: Handling non-constant bounds in extract_range_from_cond
- From: Jeffrey A Law <law at redhat dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 29 Nov 2004 14:04:29 -0700
- Subject: Re: Handling non-constant bounds in extract_range_from_cond
- Organization: Red Hat, Inc
- References: <10411242046.AA00309@vlsi1.ultra.nyu.edu>
- Reply-to: law at redhat dot com
On Wed, 2004-11-24 at 15:46 -0500, Richard Kenner wrote:
> We discussed this a while ago and you were concerned about the call that
> didn't check the result.
I don't recall that discussion. That doesn't mean it didn't happen, I
just don't remember it... Can you summarize the problem in more detail.
> I now think it's an error to use the bounds of a subtype even if they are
> constant, so I changed to using the bounds of the underlying type, which are
> always constant.
I'll assume that there's some Ada construct that allows a subtype to
have a varying range? Using the bounds of the underlying type in that
case seems appropriate as long as the bounds of that underlying type are
guaranteed to be as least as big as the subtype.
However, it doesn't seem wise to do that in the more general case. Can
you clarify why we would always want to look at the subtype?
> Does this seem the correct approach? (I haven't tested it yet.)
It seems reasonable for the case where the subtype has varying bounds.
I'm less sure about doing it in the general case, but I'm open to
I did read the comment indicating this was useful to do when you're
checking if some value is within the range of its type, but it still
doesn't make a lot of sense to me.
> I also changed some uses of int to bool for consistency.
> Also, I have a whitespace patch to that file to fix a bunch of places where
> "!" is followed by a blank, where ")" is not, and some overlong lines, and a
> few other similar things. Do you want me to apply that or hold off until
That stuff is fine with me.