On Tue, 18 Jul 2017, Jakub Jelinek wrote:
On Tue, Jul 18, 2017 at 05:35:54PM +0200, Marc Glisse wrote:
On Tue, 18 Jul 2017, Jakub Jelinek wrote:
In the PR Marc noted that the optimization might be useful even for
constants other than 1, by transforming
x+C1 <= C2 if unsigned and C2-C1==INT_MAX into (int)x > (int)(-1-C1).
(int)x >= (int)(-C1) might be easier (and more valid, except that the only
case where that makes a difference seems to be when C2==UINT_MAX, in which
case we could hope not to reach this transformation).
Don't we canonicalize that (int)x >= (int)(-C1) to (int)x > (int)(-1-C1)
immediately though?
We probably don't canonicalize (int)x >= INT_MIN to (int)x > INT_MAX ;-)
(what I was suggesting essentially delegates the check for INT_MIN or
overflow to the canonicalization code)
--
Marc Glisse