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

--- Comment #19 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So looking into this further, this can only show up with loops and loops where
there is only one variable around it (and no load/stores either).

This is why:
```
  __BB(5):
  if (h_6 != 0)
    goto __BB7;
  else
    goto __BB6;

  __BB(6):
  h_6 = __PHI (__BB4: 0, __BB5: 1);
  goto __BB7;

  __BB(7):
  f_8 = __PHI (__BB5: 0, __BB6: h_6);
  _9 = f_8 ^ 1;
  _10 = a;
  _11 = _9 + _10;
  if (_11 != _Literal (int) -117)
    goto __BB5;
  else
    goto __BB8;
```

structure is impossible without a back-edge which BB7->BB5 is the back edge.

This also explains why it has only been seen with fuzziers and code in the wild
too.

Note I had been trying to create one where we could error out instead of
causing a timeout if the code is miscompiled but there is no way because of the
constraint of having one only PHI node for BB7 too.

As an aside my gimple testcase does not hit if we add startwith("phiopt2")
either because a pass that you can't disable decided to split a critial edge
and cleanup cfg is not called.

Reply via email to