[PATCH] Fix optimization regression in constant folder

Richard Guenther richard.guenther@gmail.com
Tue Sep 18 11:22:00 GMT 2007


On 9/18/07, Eric Botcazou <ebotcazou@adacore.com> wrote:
> > Well, we need to be consistent and the above documentation is not clear
> > what happens on overflow.  Either assume overflow of size types wrap or
> > overflow on them is undefined - if you stick to one or the other behavior
> > then I'd rather have you update all the TYPE_OVERFLOW_* predicates
> > than fixing this one single place.
>
> The point is precisely not to choose between wrapping and not wrapping
> arithmetics: we want to allow *all* optimizations by pretending that
> overflow doesn't exist for size types.

That only works if you know that there is no overflow.  You will have a hard
time arguing that we never hit the case that sizetype calculations do overflow.

Richard.



More information about the Gcc-patches mailing list