Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
2 Views

clarification on the -fp-speculation safe

 

Hi,

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.

E.g

- 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
Highlighted
Black Belt
2 Views

  speculation-safe is

  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.

0 Kudos