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