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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikael at gcc dot gnu.org

--- Comment #3 from Mikael Morin <mikael at gcc dot gnu.org> ---
pre replaces usages of the 'e' global with a set of 'pretmp' and 'prephitmp'
ssa registers.

With gcc-13, the value of 'e' is reloaded directly after the call to 'foo',
and that value is joined with a phi in the next bb:

  <bb 10> [local count: 7761689018]:
  foo ();
  pretmp_25 = e;
  goto <bb 15>; [100.00%]

...

  <bb 15> [local count: 8963573811]:
  # j_28 = PHI <1(10), j_30(24), 1(22), j_30(25), 1(26), j_30(20)>
  # i_29 = PHI <i_20(10), 0(24), i_19(22), 0(25), i_21(26), 0(20)>
  # prephitmp_38 = PHI <pretmp_25(10), prephitmp_26(24), prephitmp_26(22),
prephitmp_26(25), prephitmp_26(26), prephitmp_26(20)>
  d.7_22 = d;
  _23 = d.7_22 + 1;
  d = _23;
  if (_23 != 0)
    goto <bb 27>; [94.50%]
  else
    goto <bb 18>; [5.50%]


With gcc-14, the value of 'e' is reloaded later in the next bb, causing a
dependency on 'e', even on paths not calling 'foo':

  <bb 5> [local count: 7761689018]:
  foo ();
  goto <bb 8>; [100.00%]

...

  <bb 8> [local count: 8963573796]:
  # i_28 = PHI <i_13(5), 0(12), i_13(15)>
  d.7_22 = d;
  _23 = d.7_22 + 1;
  d = _23;
  pretmp_10 = e;
  if (_23 != 0)
    goto <bb 17>; [94.50%]
  else
    goto <bb 11>; [5.50%]


Later on this prevents copyprop from simplifying the 'pretmp' and 'prephitmp'
values to 3 and remove the branch calling 'foo'.

Reply via email to