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

--- Comment #26 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note I think we should be able to do this without the tracer.
After PRE we get now:
```
  if (_1 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 531502204]:
  _14 = operator new (16);
  MEM[(struct A *)_14].i = 0;
  MEM[(struct A *)_14]._vptr.A = &MEM <int (*) ()[3]> [(void *)&_ZTV1A + 16B];
  goto <bb 6>; [100.00%]

  <bb 5> [local count: 531502204]:
  _10 = operator new (16);
  MEM[(struct B *)_10].D.2821.i = 0;
  MEM[(struct B *)_10].b = 0;
  MEM[(struct B *)_10].D.2821._vptr.A = &MEM <int (*) ()[3]> [(void *)&_ZTV1B +
16B];

  <bb 6> [local count: 1063004408]:
  # ap_5 = PHI <_14(4), _10(5)>
  # prephitmp_7 = PHI <foo(4), foo(5)>
  OBJ_TYPE_REF(prephitmp_7;(struct A)ap_5->0B) (ap_5);
```

Which should be enough to push the call (OBJ_TYPE_REF) back into the branches.

Note that part is what we see with PR 116001 too.

Reply via email to