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: [PATCH] Fix optimization regression in constant folder

> Yes I understand that.  But what we have to do in the middle-end from C++ 
> constructs like Mark has shown has to be done in a type which does not 
> have the ignore_overflow "semantic" (because the justification for that 
> semantic, namely negative values have small magnitude simply doesn't 
> hold).  In fact the most natural choice for a type to calculate that 
> expression would have been unsigned because that allows all rearrangements 
> of the operands.  But when the natural type for doing arithmetics on such 
> operands is type X it simply doesn't make sense to store those operands as 
> having type Y, as conversions would be required all the time we actually 
> look at the operands.

But I thought that we agreed yesterday that, unless there are some surprises
coming from givs in loop optimization, we should treat sizetypes as 
wrapping on overflow, whether signed or unsigned.  So I'm not sure what you
mean above.

Certainly the point is to do the entire sizing computation in ONE type
and not convert back and forth: that's the whole point of sizetype!

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