This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SIGFPE, Arithmetic exception. "Value optimized out" when using --ffast-math


On 6/30/2011 5:20 PM, Steve Kargl wrote:
On Thu, Jun 30, 2011 at 10:13:37PM +0200, Daniel Franke wrote:
On Thursday 30 June 2011 21:34:19 Paul van Delst wrote:
Is there any other investigative work you could recommend I do to find the
root cause of the exception?

Hi Paul.


Besides a self contained testcase for everyone to check, depending on your
patience it might help to identify the exact offender; -ffast-math simply
enables a bunch of potentially unsafe options [1]:

-ffast-math
     Sets -fno-math-errno, -funsafe-math-optimizations,
     -fno-trapping-math, -ffinite-math-only, -fno-rounding-math,
     -fno-signaling-nans and fcx-limited-range.

Try the options individually, all but one, other groups if required.
Identifying the bad one might give a clue?!


At one time, the above set of options was not equivalent to -ffast-math. Don't know if this is still true, but it should be easy to test by compiling a moderately complicate program and comparing the results *.o and final executables.

I don't share the optimism about ease of discovering the effect of these options.
-fnocx-limited-range -fnoreciprocal-math have been commonly desired ways to back off from -ffast-math. Have these options changed, or did I get the spelling wrong?
Is -mreciprocal implied by -ffinite-math-only? This seems to involve some disconnect; one of the reasons for avoiding -mreciprocal being to avoid premature violation of the conditions for finite-math-only.


--
Tim Prince


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]