Debugging Options (The GNU Fortran Compiler) (original) (raw)

Specify a list of floating point exception traps to enable. On most systems, if a floating point exception occurs and the trap for that exception is enabled, a SIGFPE signal is sent and the program being aborted, producing a core file useful for debugging. listis a (possibly empty) comma-separated list of either ‘none’ (to clear the set of exceptions to be trapped), or of the following exceptions: ‘invalid’ (invalid floating point operation, such asSQRT(-1.0)), ‘zero’ (division by zero), ‘overflow’ (overflow in a floating point operation), ‘underflow’ (underflow in a floating point operation), ‘inexact’ (loss of precision during operation), and ‘denormal’ (operation performed on a denormal value). The first five exceptions correspond to the five IEEE 754 exceptions, whereas the last one (‘denormal’) is not part of the IEEE 754 standard but is available on some common architectures such as x86.

The first three exceptions (‘invalid’, ‘zero’, and ‘overflow’) often indicate serious errors, and unless the program has provisions for dealing with these exceptions, enabling traps for these three exceptions is probably a good idea.

If the option is used more than once in the command line, the lists are joined: ’ffpe-trap=list1 ffpe-trap=list2’ is equivalent to ffpe-trap=list1,list2.

Note that once enabled an exception cannot be disabled (no negative form), except by clearing all traps by specifying ‘none’.

Many, if not most, floating point operations incur loss of precision due to rounding, and hence the ffpe-trap=inexact is likely to be uninteresting in practice.

By default no exception traps are enabled.

Specify a list of floating-point exceptions, whose flag status is printed to ERROR_UNIT when invoking STOP and ERROR STOP.list can be either ‘none’, ‘all’ or a comma-separated list of the following exceptions: ‘invalid’, ‘zero’, ‘overflow’, ‘underflow’, ‘inexact’ and ‘denormal’. (See-ffpe-trap for a description of the exceptions.)

If the option is used more than once in the command line, only the last one is used.

By default, a summary for all exceptions but ‘inexact’ is shown.