[Bug tree-optimization/126694] New: Fold a magnitude comparison against zero

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

            Bug ID: 126694
           Summary: Fold a magnitude comparison against zero
           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: ---

int f (double x) { return __builtin_fabs (x) <= 0.0; }

We could generated for aarch64 -fno-trapping-math:
        fcmp    d0, #0.0
        cset    w0, eq

instead of the current:

        fabs    d0, d0
        fcmpe   d0, #0.0
        cset    w0, ls
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.