https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89459
Bug ID: 89459 Summary: Incorrect rounding for fma in some cases Product: gcc Version: 6.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libquadmath Assignee: unassigned at gcc dot gnu.org Reporter: andres_takach at mentor dot com Target Milestone: --- Created attachment 45802 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45802&action=edit testcase for issue: c++ fma_rnd_bug.cxx -lquadmath The function fmaq(x,y,z) should be equivalent to x*y+z if x*y returns a finite exact value. Test x = smallest (subnormal) hex: 00000000000000000000000000000001 y = 2*(2^112 + 1) hex: 40700000000000000000000000000001 z = x fma(x,y,z) returns hex (same as x*y): 00020000000000000000000000000001 x*y+z return hex (it is rounded to nearest even): 00020000000000000000000000000002 GCC version info: Using built-in specs. COLLECT_GCC=/wv/hlstools/gcc6.2.0-64/pkgs/dcs_gcc/gcc-6.2.0/lib/gcc/../../bin/c++ COLLECT_LTO_WRAPPER=/wv/hlstools/gcc6.2.0-64/pkgs/dcs_gcc/gcc-6.2.0/lib/gcc/../../libexec/gcc/x86_64-linux-gnu/6.2.0/lto-wrapper Target: x86_64-linux-gnu Configured with: /wv/hls01/dcs_gcc/rls_iwa/2016-09-27_163927/aol/build/src/gcc-6.2.0/configure --prefix=/wv/hls01/dcs_gcc/rls_iwa/2016-09-27_163927/aol/exports/mgc_home/pkgs/dcs_gcc.aol/gcc-6.2.0 -build=x86_64-linux-gnu --enable-languages=c,c++ --enable-threads --with-dwarf2 --with-pkgversion=Calypto Thread model: posix gcc version 6.2.0 (Calypto)