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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
it's odd that VRP doesn't optimize this though.  VRP2 says

Exported global range table:
============================
i_6  : int ~[4, 4]
bool foo (int i)
{
  bool _3;

  <bb 2> [local count: 118111600]:
  if (i_2(D) == 4)
    goto <bb 3>; [97.00%]
  else
    goto <bb 4>; [3.00%]

  <bb 3> [local count: 955630224]:

  <bb 4> [local count: 118111600]:
  # i_6 = PHI <i_2(D)(2), 6(3)>
  _3 = i_6 != 0;
  return _3;

but shouldn't ranger figure that i_2(D) != 0 && 6 != 0 is the same as
i_2(D) != 0?  Alternatively this could be sth for phiopt.  PRE still
sees the loop (I guess it was previously the one optimizing this)

Reply via email to