gcc -O0 still optimizes out “unused” code that should raise an FP exception. Is there a compile flag to change that?

Why does gcc not emit the specified instruction? A compiler produces code that must have the observable behavior specified by the Standard. Anything that is not observable can be changed (and optimized) at will, as it does not change the behavior of the program (as specified). How can you beat it into submission? The trick … Read more