[Bug tree-optimization/126487] New: Another missing smin detection

"pinskia at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126487

            Bug ID: 126487
           Summary: Another missing smin detection
           Product: gcc
           Version: 17.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:
```
unsigned
f1 (unsigned int a, unsigned tt)
{
  unsigned t = a;
  unsigned t1 = -1u;
  return a > __INT_MAX__ ? t : t1;
}
```


This should be detected as smin (a, -1).  LLVM is able to detect it.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.