https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116891
--- Comment #2 from Walter Mascarenhas <walter.mascarenhas at gmail dot com> --- Hi, You will find two files attached to this message: 1) the cpp file contains the C++ code, with comments describing the exact options used and the g++ version. The bug is described in detail in a comment in this file. 2) the .s file was obtained with g++'s -S flag. In a quick look at it you will notice that it contains only vfmadd132sd instructions and no changes of signs, that is, g++ is "optimizing" - ( fma( -a, x, - y) ) to fma( a, x, y ), and this is not supposed to happen when -frounding-math is used. walter. On Sun, Sep 29, 2024 at 11:10 PM pinskia at gcc dot gnu.org < gcc-bugzi...@gcc.gnu.org> wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116891 > > Andrew Pinski <pinskia at gcc dot gnu.org> changed: > > What |Removed |Added > > ---------------------------------------------------------------------------- > Status|UNCONFIRMED |WAITING > Component|c++ |middle-end > Last reconfirmed| |2024-09-30 > Ever confirmed|0 |1 > > --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- > I tried: > ``` > #include <cmath> > > double bad_fma( double y, double z, double w) { > return std::fma( -y, z, -w ); > } > ``` > > and it produces with `-O3 -frounding-math -mfma`: > ``` > _Z7bad_fmaddd: > .cfi_startproc > vfnmsub132sd %xmm1, %xmm2, %xmm0 # tmp104, tmp105, <retval> > ret > ``` > > https://godbolt.org/z/fzs1cso3P > > > Can you provide the preprocessed source you are using and/or even the full > testcase including what headers you are using and what exact options you > used? > > -- > You are receiving this mail because: > You reported the bug.