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

            Bug ID: 126086
           Summary: `MIN<sa,sb> < 0` can be done as `(sa|sb) < 0`
           Product: gcc
           Version: 17.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:
```
void use();
void f1(int a, int b) {
    int m = a < b ? a : b;
    if (m < 0) use();
}
```

This can be optimized to `(a|b) < 0` as this is saying if both a and b have
their sign bits set. Note `>= 0` can be handled similarly.

Reply via email to