Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26730 Discussions

clarification on the -fp-speculation safe




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?

0 Kudos
1 Reply
Black Belt

  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.