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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-02-04
                 CC|                            |hubicka at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue here is that the abstraction includes memory objects in the GCC IL
which makes it very difficult for GCC to get rid of it during IPA analysis.

foo (int a)
{
  struct Cont D.1982;
  struct Cont D.1983;

  <bb 2> :
  D.1983.f = bar;
  D.1982.f = h;
  g (D.1982, D.1983, a_4(D));
  return;

}

g (struct Cont c, struct Cont d, int a)
{
  int _1;
  int _2;
  void (*<T2f9>) (struct cont, int) _3;

  <bb 2> :
  _1 = quux (a_6(D));
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  _2 = a_6(D) + 1;
  g (c, d, _2);

  <bb 4> :
  _3 = c.f;
  _3 (d, a_6(D));
  return;

}

this is probably another case where knowing and exposing the ABI upfront
would help - Cont is passed in a register.  OTOH generally rewriting
Cont into SSA (if not address-taken) might be an option as well.
update_address_taken has a good idea whether accesses meet SSA requirements.

Reply via email to