On Fri, 17 Apr 2015, Richard Biener wrote:
The difference in behavior between bar and baz seems odd.
Yeah, I suppose VRP gets conservative in a way that's not helpful for
consistency of this warning. ~[0,0] and ~[-2,-2] likely meet as VARYING
and the warning code doesn't look at equivalences.
Visiting statement:
i_10 = ASSERT_EXPR <i_9, i_9 != -2>;
Intersecting
~[-2, -2] EQUIVALENCES: { i_2(D) i_9 } (2 elements)
and
~[0, 0] EQUIVALENCES: { i_2(D) } (1 elements)
to
~[-2, -2] EQUIVALENCES: { i_2(D) i_9 } (2 elements)
Found new range for i_10: ~[-2, -2]
It has to pick one of the 2 anti-ranges, which one it picks is pretty
arbitrary. It probably warns if you swap the tests for 0 and -2.
--
Marc Glisse