[Bug tree-optimization/58195] Missed optimization opportunity when returning a conditional

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Nov 19 23:24:58 GMT 2022


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

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note the loop one looks like:
  if (input_4(D) != 0)
    goto <bb 3>; [89.00%]
  else
    goto <bb 4>; [11.00%]

  <bb 3> [local count: 105119324]:
  _1 = (unsigned int) input_4(D);
  _3 = -_1;
  value_2 = (int) _3;

  <bb 4> [local count: 118111600]:
  # value_10 = PHI <value_2(3), 0(2)>

---- CUT ----
Which avoids undefined overflow for INT_MIN.


More information about the Gcc-bugs mailing list