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

            Bug ID: 126528
           Summary: Another missing min/max detection (sign change)
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, TREE
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
unsigned
smax (unsigned a)
{
  if (((signed) a) > 10)
    return a;
  return 10;
}

signed
umax (signed a)
{
  if (((unsigned) a) > 10)
    return a;
  return 10;
}
```

These are not detected in match so phiopt does not detect it.
Note the old phiopt minmax optimization code didn't detect it either.

Reply via email to