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

            Bug ID: 125640
           Summary: MAX(x, -1) can use orr with ash operand
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64

Take:
```
int f(int x)
{
    int k = -1;
    return x < k ? k : x;
}
```

This can be optimized to:
        orr     w0, w0, w0, asr 31

Reply via email to