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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the testcase only triggers on trunk because store commoning is new there and
it transforms (interestingly!)

  <bb 2> [local count: 10631108]:
  p3 ();
  bl = 0;

  <bb 3> [local count: 1073741824]:
  bl.0_1 = bl;
  _2 = bl.0_1 + 1;
  bl = _2;
  goto <bb 3>; [100.00%]

to

  <bb 2> [local count: 10631108]:
  p3 ();

  <bb 3> [local count: 1073741824]:
  # _8 = PHI <0(2), _2(3)>
  bl = _8;
  bl.0_1 = bl;
  _2 = bl.0_1 + 1;
  goto <bb 3>; [100.00%]

which predcom tries to "improve" to

  <bb 2> [local count: 10631108]:
  p3 ();
  _10 = bl;

  <bb 3> [local count: 1073741824]:
  # _8 = PHI <0(2), _2(4)>
  # bl_lsm0.3_7 = PHI <_10(2), bl_lsm0.3_6(4)>
  bl = _8;
  bl_lsm0.3_6 = _8;
  bl.0_1 = bl_lsm0.3_6;
  _2 = bl.0_1 + 1;

  <bb 4> [local count: 1073741824]:
  goto <bb 3>; [100.00%]

so the situation is quite arcane and eventually not worth fixing on branches.

Reply via email to