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

Reply via email to