This is the mail archive of the 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: Handling non-constant bounds in extract_range_from_cond

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
discussing it.

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
> 4.1?
That stuff is fine with me.  


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