On Fri, 2015-04-17 at 21:08 +0200, Marc Glisse wrote:
> 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.

You are right, If I swap the tests then I do get the warning.

Steve Ellcey
sell...@imgtec.com

Reply via email to