[Bug tree-optimization/126693] New: Fold abs (x) * abs (y) -> abs (x * y)

"ktkachov 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=126693

            Bug ID: 126693
           Summary: Fold abs (x) * abs (y) -> abs (x * y)
           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: ktkachov at gcc dot gnu.org
  Target Milestone: ---

double f (double x, double y)
  { return __builtin_fabs (x) * __builtin_fabs (y); }

Clang at -Ofast generates on aarch64:
f:
        fmul    d0, d1, d0
        fabs    d0, d0
        ret

whereas GCC computes two fabs + fmul
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.