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

            Bug ID: 112093
           Summary: (X & Y) < X (unsigned) and (X & Y) != X should produce
                    the same code
           Product: gcc
           Version: 14.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:
```
int f(unsigned a, unsigned b)
{
        return (a&b) < a;
}

int f1(unsigned a, unsigned b)
{
        return (a&b) != a;
}

int g(unsigned a, unsigned b)
{
        return (a&b) >= a;
}

int g1(unsigned a, unsigned b)
{
        return (a&b) == a;
}
```

f and f1 are equivalent but don't produce the same result.
Likewise for g and g1.

This is a Canonical issue really.

Reply via email to