https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112356
Bug ID: 112356
Summary: `x == MIN & x > y` is not optimized to 0 if x was
casted to signed from unsigned
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: tree-optimization
Assignee: pinskia at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Take:
```
#include <limits.h>
signed f2_1( unsigned x, signed y)
{
signed xs = x;
signed t = x == INT_MIN;
signed t1 = xs > y;
return t & t1;
}
```
This is not optimized to 0.