On Tue, 16 Mar 2021, David Aldrich via Gcc-help wrote: > Hi > > We are comparing results from our C++ app on Ubuntu 18.04 (gcc 7.3.0, glibc > 2.27 ) and Ubuntu 20.04 (gcc 9.3.0, glibc 2.31 ). We are seeing > significant differences in floating point calculation results across these > platforms. > > Were there significant changes to the floating point library in gcc 9? math library is part of Glibc, not GCC, and yes, it received updates between 2.27 and 2.31. If you are using non-conservative optimization flags such as -Ofast or -ffast-math, you can expect different results between GCC 7 and GCC 9 as well. If you use an FMA-capable CPU and run GCC with -march=native or another flag that allows use of FMA, you might see different compilers merging a*b+c to fma(a, b, c) in different places. You can pass -ffp-contract=off to disallow such contraction. Alexander