How to set ICC attribute “fp-model precise” for a single function, to prevent associative optimizations?
问题 I am implementing Kahan summation, in a project that supports compilation with gcc47, gcc48, clang33, icc13, and icc14. As part of this algorithm, I would like to disable optimizations that take advantage of the associativity of addition of real numbers. (Floating point operations are not associative.) I would like to disable those optimizations only in the relevant function . I have figured out how to do this under gcc, using the ''no-associative-math'' attribute. How can I do this in icc or