https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104296
Bug ID: 104296
Summary: MIN<unsigned, 1> should simplify to unsigned != 0
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Take:
unsigned t(unsigned a)
{
unsigned b = 1;
return a >= b ? b : a;
}
unsigned t1(unsigned a)
{
return a >= 1 ? 1 : a;
}
These two functions are the same but currently they do not optimize to the same
thing.