https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104214

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So it looks like we registered q_4(D) != 2147483647 && p_3(D) != -2147483648
as assumptions as we set no_overflow to false before using (delta + step - 1) /
step for niter in number_of_iterations_lt.

So for the fixed cases it seems that some earlier transforms use the adjusted
IVs under wrong assumptions.  A way out would be to register the no overflow
assumptions earlier.

Oh, and for pointers we kept the no overflow guarantee, making the
relational compare transform always valid - possibly because of reasoning
that relational compares in C invoke undefined behavior when they compare
two distinct objects and object addresses not wrapping around (ignoring
maybe the special case of one-after-the-object being wrapped).

So the testcase which uses pointers can possibly be fixed by re-instantiating
that.

As said, further improvements might involve doing sth like registering
assumptions earlier and to make that possible for LE also, turn LE to LT
earlier as well.

Reply via email to