That is what you have to do enable turning FP exceptions into traps on a hardware level. But the FP instructions your compiler actually emits as hardware instructions bears only a superficial resemblance to the code you originally wrote. Compilers generally assume FP operations are pure operations without side-effects, so it happily speculates them (including ones that might generate the trap you're looking for) on paths where they didn't, or remove them, or evaluate them at compile time instead of run time, etc. Turning this behavior off so that the traps you get are actually the traps you expected to get involves disabling a lot of optimizations.