According to the documentation:
Tells the compiler to disable speculation if there is a possibility that the speculation may cause a floating-point exception
According to my tests it looks as if the behavior of this option purely depends on the status of the -fpe flag.
- when -fpe0 is used then it falls back to speculation= strict.
- when -fpe1|3 is used then it falls back to speculation= fast.
Can someone please confirm that this is the case. Does the option have other effect than this?
speculation-safe is intended to avoid exceptions due to executing code outside a "false" conditional e.g. when both branches of an if are executed, or a loop invariant is calculated for a zero trip loop. . -fp-model strict would set speculation-safe so as to enable sane use of IEEE exceptions. The compiler manual gives much more complete descriptions of -fp-model strict and -fpe0 than any post here. Apparently, either of those options implies a non-default setting of -fp-speculation and fast-transcendentals.