https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118922
--- Comment #12 from Andrew Macleod <amacleod at redhat dot com> ---
Hmm. Going into phiopt2, I see:
<bb 5> [local count: 1014686024]:
if (h_6 != 0)
goto <bb 7>; [94.50%]
else
goto <bb 6>; [5.50%]
<bb 6> [local count: 114863530]:
# h_6 = PHI <0(4), 1(5)>
<bb 7> [local count: 1073741824]:
# f_8 = PHI <0(5), h_6(6)>
_9 = f_8 ^ 1;
a.0_10 = a;
_11 = _9 + a.0_10;
if (_11 != -117)
goto <bb 5>; [94.50%]
else
goto <bb 8>; [5.50%]
and PHIOPT2 says:
COND_EXPR in block 5 and PHI in block 7 converted to straightline code.
Merging blocks 4 and 6
Removing basic block 5
and produces:
<bb 4> [local count: 59055799]:
c = d_3;
<bb 5> [local count: 1073741824]:
# f_8 = PHI <0(5), 0(4)>
_9 = f_8 ^ 1;
a.0_10 = a;
_11 = _9 + a.0_10;
if (_11 != -117)
goto <bb 5>; [94.50%]
else
goto <bb 6>; [5.50%]
It seems to have lost the possibility of h_6 being 1 or 0, and it looks like
it is now an infinite loop.