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

--- Comment #4 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
All the no-options result in duplicate PHI nodes that use the same values just
have different RHS

>>> p debug (loop->header)
<bb 21> [local count: 958878292]:
# a.2_29 = PHI <0(18), _34(25)>
# a_lsm.8_31 = PHI <0(18), _34(25)>
_34 = a.2_29 + -1;
if (_34 != 1)
  goto <bb 25>; [94.50%]
else
  goto <bb 32>; [5.50%]

$11 = void
>>> p debug (update_bb)
<bb 33> [local count: 958878292]:
# a.2_6 = PHI <a_lsm.8_36(32), _41(34)>
# a_lsm.8_18 = PHI <a_lsm.8_36(32), _41(34)>
_41 = a.2_6 + -1;
if (_41 != 1)
  goto <bb 34>; [94.50%]
else
  goto <bb 26>; [5.50%]

$12 = void

So one of the PHIs is completely useless. But that makes the update loop visit
the PHI twice, but the first time we already updated them so we end up with a
non SSA_NAME there.

In the old code we'd just re-update the PHI with the same statement. So I'll
put  back that code as fallback.

testing a patch.

Reply via email to