I wonder if clang++ allows optimizations that could raise the FP exception flag in its default setup? For our code this would be a problem since we trap certain FP exceptions. Hence such optimizations would lead to a crash of the code. We have seen this happening with this version of clang++
$ clang++ --version
clang version 3.3 (trunk 179781)
Thread model: posix
If such optimizations are allowed, we need a way to disable them. Gcc has the -ftrapping-math flag to achieve this. Clang++ seems to accept this flag, but it didn't have any effect in the case we studied. Would this be the correct way to disable such optimizations?