https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126646
Bug ID: 126646
Summary: Umin(a,1) | umin(b,1) ->umin(a|b, 1)
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Take:
```
unsigned f(unsigned a, unsigned b)
{
unsigned t = 1;
a = a < t ? a : t;
b = b < t ? b : t;
return a | b;
}
```
This should be reduced to just:
```
unsigned f1(unsigned a, unsigned b)
{
unsigned t = 1;
a = a|b;
return a < t ? a : t;
}
```
Note the use of t here is to get MIN_EXPR rather than `!= 0` which shows up due
to early folding.