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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2026-05-12
             Status|UNCONFIRMED                 |NEW
             Blocks|                            |121364

--- Comment #3 from Drea Pinski <pinskia at gcc dot gnu.org> ---
So there is a missed optimization here.
```
  MEM <bool Pred::<T427> (const struct Pred *, char) *> [(struct  *)&D.3303] =
check;
  MEM <long int> [(struct  *)&D.3303 + 8B] = 0;
  b.f_ = VIEW_CONVERT_EXPR<struct cmf3>(D.3303);
  drive_end.0_1 = drive_end;
  pred = b;
...
  goto <bb 6>; [100.00%]

  <bb 3> [local count: 8687547538]:
...
  SR.5_10 = MEM[(const struct cmf3 *)&pred].f_.__pfn;
...

  <bb 6> [local count: 9761289362]:
  if (drive_end.0_1 != 0B)
    goto <bb 3>; [89.00%]
  else
    goto <bb 7>; [11.00%]
```

The load to SR.5_10 should be the same as &check.
pred never escapes (likewise of b).

So there is a missing FRE here.
Now there is also a missing copy prop for aggregate here too:
  b.f_ = VIEW_CONVERT_EXPR<struct cmf3>(D.3304);
  pred = b;

I will look at it via that angle in later today.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121364
[Bug 121364] [meta-bug] copy prop for aggregates

Reply via email to