[Bug middle-end/78228] [6/7 Regression] fstrict-overflow breaks code without overflow?

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 7 08:26:00 GMT 2016


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2016-11-07
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
No, it is phiopt1 that introduces ABS, but disabling VRP fixes it so I guess
some bogus range info is around.

   <bb 2>:
   _4 = i_3(D) < 0;
   width_5 = (unsigned int) _4;
-  if (i_3(D) > 0)
+  _19 = ABS_EXPR <i_3(D)>;
+  i_18 = -_19;
+  if (i_18 < -999999999)

from:

  <bb 2>:
  # RANGE [0, 1]
  _4 = i_3(D) < 0;
  # RANGE [0, 1] NONZERO 1
  width_5 = (unsigned int) _4;
  if (i_3(D) > 0)
    goto <bb 3>;
  else
    goto <bb 4>;

  <bb 3>:
  # RANGE [-2147483647, -1]
  i_6 = -i_3(D);

  <bb 4>:
  # RANGE [-2147483648, 0]
  # i_1 = PHI <i_3(D)(2), i_6(3)>

which IMHO looks ok.

Looks like a abs_replacement bug where it creates a negate w/o proper
checking.


More information about the Gcc-bugs mailing list