Re: -ffast-math in Ports and wrong generated code

From: Thomas Mueller <tmueller_at_sysgo.com>
Date: Tue, 3 Apr 2012 15:58:33 +0200
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
Received on Tue Apr 03 2012 - 12:08:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:25 UTC