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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
But we end up with

 <bb 2> [local count: 1073741824]:
  b.1_1 = b;
  if (b.1_1 != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  iftmp.3_14 = d;

  <bb 4> [local count: 966367640]:
  # RANGE [irange] int [-INF, -1][1, +INF]
  # iftmp.3_10 = PHI <iftmp.3_14(3), 0(2)>

  <bb 6> [local count: 1073741824]:
  # RANGE [irange] int [-INF, -1][1, +INF]
  # iftmp.2_9 = PHI <iftmp.3_10(4)>
  _4 = iftmp.2_9 < 0;

before CFG cleanup which does look wrong.  Before the phiopt we have

  <bb 4> [local count: 966367640]:
  # iftmp.3_10 = PHI <iftmp.3_14(3), 0(2)>
  if (iftmp.3_10 != 0)
    goto <bb 6>; [56.25%]
  else 
    goto <bb 5>; [43.75%]

  <bb 5> [local count: 536870913]:

  <bb 6> [local count: 1073741824]:
  # RANGE [irange] int [-INF, -1][1, +INF]
  # iftmp.2_9 = PHI <iftmp.3_10(4), 8(5)>
  _4 = iftmp.2_9 < 0;

but clearly value-replacing the edge 5->6 with iftmp.3_10 is wrong (its
zero, not 8 on that edge)?

Reply via email to