-ffast-math in Ports and wrong generated code

Thomas Mueller tmueller at sysgo.com
Tue Apr 3 14:08:31 UTC 2012


On Tue, 3 Apr 2012 14:21:11 +0300, Andrey Simonenko wrote:
> At least finite() function call was eliminated from the result Assembler
> code when -ffast-math option is used, tested on 9.0-STABLE and 10.0-CURRENT.

The documentation for -ffast-math once (GCC 3.x?) contained 
 -ffast-math
    Might allow some programs designed to not be too dependent on IEEE
    behavior for floating-point to run faster, or die trying. 
which seems like what you're observing.

-ffast-math includes -ffinite-math-only which assumes that
floating-point arguments and results are never NaNs or +-Infs.

Compiling your code with "-ffast-math -fno-finite-math-only" should
restore the call to finite().

-- 
Thomas Mueller


More information about the freebsd-current mailing list