[Bug tree-optimization/126703] New: copysign(x, -abs(t)) -> copysign(x, -1.0)

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

            Bug ID: 126703
           Summary: copysign(x, -abs(t)) -> copysign(x, -1.0)
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: easyhack, 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:
```
double f3(double x, double y)
{
  double t = -__builtin_abs(y);
  return __builtin_copysign (x,t);
}
```

This is just copysign(x, -1.0) or -abs(x).
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.