My issue isn’t with the FMA optimization or the behavior of -ffp-contract=on. My issue is with the fact that now -ffp-contract=on is now on by default with -ffp-model=precise. This results in expressions like return a * b + 5; returning values that are different from what’s expected.
If you want to have FMA optimizations, then you should have to choose them explicitly, either by using -ffp-contract=on or -ffp-contract=fast because you really need to know what you’re doing when you turn these things on.