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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-07-19
           Severity|normal                      |enhancement
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. Pre changes:
```
  if (x_4(D) != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870912]:
  MEM[(struct Base *)&a]._vptr.Base = &MEM <int (*) ()[4]> [(void *)&_ZTV4Base
+ 16B];
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 536870912]:
  MEM[(struct Derived *)&a].D.3334._vptr.Base = &MEM <int (*) ()[4]> [(void
*)&_ZTV7Derived + 16B];

  <bb 5> [local count: 1073741824]:
  _1 = MEM[(struct Base *)&a]._vptr.Base;
  _2 = *_1;
  OBJ_TYPE_REF(_2;(struct Base)&a->0B) (&a);
```

Into:
```
  <bb 2> [local count: 1073741824]:
  if (x_4(D) != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870912]:
  MEM[(struct Base *)&a]._vptr.Base = &MEM <int (*) ()[4]> [(void *)&_ZTV4Base
+ 16B];
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 536870912]:
  MEM[(struct Derived *)&a].D.3334._vptr.Base = &MEM <int (*) ()[4]> [(void
*)&_ZTV7Derived + 16B];

  <bb 5> [local count: 1073741824]:
  # prephitmp_11 = PHI <__dt_comp (3), __dt_comp (4)>
  OBJ_TYPE_REF(prephitmp_11;(struct Base)&a->0B) (&a);
```

But there is no pass which pushes the calls into back into branches from the
PHI node.

Reply via email to