This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix optimization regression in constant folder
On Thu, 11 Oct 2007, Richard Kenner wrote:
> > As shown we can't calculate with sizetypes in C anyway,
> We're not calculating them *in C*, but in the middle-end, as an
> *implementation* of C-language features, such as indexing.
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.