This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix optimization regression in constant folder
On 10/11/07, Richard Kenner <email@example.com> wrote:
> > But if that is the only justifieable property of sizetype, why not use a
> > type which naturally has this property, like some unsigned type?
> Because there exist signed types that have that property too.
> But I'm having trouble understanding what you're trying to do here.
> Clearly we need the TYPE_IS_SIZETYPE flag and clearly the type must
> be unique (for validity purposes, if nothing else). So what we're talking
> about is how we interpret the TYPE_IS_SIZETYPE flag. I don't understand
> why it has to be interpreted in terms of some *other* flags (ones that
> are used for non-internal types).
> > Depends on if you agree to the above or not. If you agree (and you seem
> > to) that the important thing is wrapping overflow, I'm also going to say
> > that sizetype should not be allowed to be a signed type.
> I *really* have a problem with purposely putting a negative value into an
> unsigned type. I think it's bad software engineering and completely
We do that all the time now with POINTER_PLUS_EXPR which takes an
unsigned sizetype as its offset parameter. There is nothing bad about this.