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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-03-30
          Component|middle-end                  |tree-optimization
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
VRP does simplify a_6 != 0 to 1 (this is the a on the path from a++; to if
(a)).
It even does result in optimization, namely in jump-threading and thus
transforming code to

  a = abs(b);
  if (b)
   {
     a++;
     return 1;
   }
  if (a)
    return 1;
  return 0;

this specifically short-cuts the case where b == INT_MAX because a++ would
invoke undefined behavior.  Now, for the case of a a != 0 test and an
increment of 1 this is not really relevant - but the VRP code doesn't record
how much a variable could have overflown at max, just that it possibly did:

 a_6 = [1, +INF(OVF)]

Thus, confirmed.

Reply via email to