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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2025-10-07

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. A few things we don't do loop splitting except at -O3.
But then we don't optimize away the loops even though we do optimize it almost
all the way.

(all below is for -O3).

First loop we produce:
```
  <bb 3> [local count: 740529671]:
  # RANGE [irange] integer(kind=4) [-2147483647, +INF]
  # w_49 = PHI <_35(2), _54(3)>
  # RANGE [irange] integer(kind=4) [-2147483646, +INF]
  _54 = w_49 + 1;
  if (_54 == _69)
    goto <bb 4>; [15.95%]
  else
    goto <bb 3>; [84.05%]
```

Second loop:
```
  <bb 6> [local count: 740529671]:
  # RANGE [irange] integer(kind=4) [-2147483647, +INF]
  # z_3 = PHI <_7(5), _28(6)>
  # RANGE [irange] integer(kind=4) [-2147483646, +INF]
  _28 = z_3 + 1;
  if (_28 == _102)
    goto <bb 7>; [15.95%]
  else
    goto <bb 6>; [84.05%]
```

Reply via email to