https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120081
Bug ID: 120081
Summary: lsplit is not always working
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Take at -O3:
```
void f();
void g (unsigned n)
{
for (unsigned i = n; i < 30; ++i)
if (i > 10)
f();
}
void g1 (unsigned n)
{
unsigned i = n;
for (; i <= 10 && i < 30; ++i)
;
for (; i < 30; ++i)
//if (i > 10)
f();
}
```
I had assumed g would transform into g1 but currently it is not.
This is derived from gcc.dg/Wrestrict-22.c .