It doesn’t violate IEEE-754, because IEEE-754 defers to languages on this point:
A language standard should also define, and require implementations to provide, attributes that allow and disallow value-changing optimizations, separately or collectively, for a block. These optimizations might include, but are not limited to:
…
― Synthesis of a fusedMultiplyAdd operation from a multiplication and an addition.
In standard C, the STDC FP_CONTRACT
pragma provides the means to control this value-changing optimization. So GCC is licensed to perform the fusion by default, so long as it allows you to disable the optimization by setting STDC FP_CONTRACT OFF
. Not supporting that means not adhering to the C standard.