[Bug tree-optimization/126696] Fold a fused multiply-add by one into an addition

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

--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
  double fadd (double x, double y) { return __builtin_fma (x, y, -0.0); }

can also be folded into just x*y (clang handles that too).

Maybe these only valid to do without signaling nans.


Note:
  double fmul1 (double x, double y) { return __builtin_fma (1.0, x, y); }

operands 0 and 1 are swapped for Canonicalization so we only need to handle the
1.0 in operand 1.
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.