[Bug tree-optimization/126706] `(int)(float)(int)(unsigned short)a` should be optimized to `(int)(unsigned short)a`

"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=126706

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
here is a more complex example that shows the range should be used:
```
int f12(unsigned int t1)
{
  if (t1 > 1000)
    return t1;
  int t = t1; // [0, 1000]
  float tt = t;
  return tt;
}
```

LLVM is able to optimize this.
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.