blob: f70c14d4135aaa45651cfb446e0dc054e73006fe [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1999-2014 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
"GNU Free Documentation License".
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development. -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>The GNU Fortran Compiler: Debugging Options</title>
<meta name="description" content="The GNU Fortran Compiler: Debugging Options">
<meta name="keywords" content="The GNU Fortran Compiler: Debugging Options">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Invoking-GNU-Fortran.html#Invoking-GNU-Fortran" rel="up" title="Invoking GNU Fortran">
<link href="Directory-Options.html#Directory-Options" rel="next" title="Directory Options">
<link href="Error-and-Warning-Options.html#Error-and-Warning-Options" rel="prev" title="Error and Warning Options">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Debugging-Options"></a>
<div class="header">
<p>
Next: <a href="Directory-Options.html#Directory-Options" accesskey="n" rel="next">Directory Options</a>, Previous: <a href="Error-and-Warning-Options.html#Error-and-Warning-Options" accesskey="p" rel="prev">Error and Warning Options</a>, Up: <a href="Invoking-GNU-Fortran.html#Invoking-GNU-Fortran" accesskey="u" rel="up">Invoking GNU Fortran</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Options-for-debugging-your-program-or-GNU-Fortran"></a>
<h3 class="section">2.5 Options for debugging your program or GNU Fortran</h3>
<a name="index-options_002c-debugging"></a>
<a name="index-debugging-information-options"></a>
<p>GNU Fortran has various special options that are used for debugging
either your program or the GNU Fortran compiler.
</p>
<dl compact="compact">
<dt><code>-fdump-fortran-original</code></dt>
<dd><a name="index-fdump_002dfortran_002doriginal"></a>
<p>Output the internal parse tree after translating the source program
into internal representation. Only really useful for debugging the
GNU Fortran compiler itself.
</p>
</dd>
<dt><code>-fdump-fortran-optimized</code></dt>
<dd><a name="index-fdump_002dfortran_002doptimized"></a>
<p>Output the parse tree after front-end optimization. Only really
useful for debugging the GNU Fortran compiler itself.
</p>
</dd>
<dt><code>-fdump-parse-tree</code></dt>
<dd><a name="index-fdump_002dparse_002dtree"></a>
<p>Output the internal parse tree after translating the source program
into internal representation. Only really useful for debugging the
GNU Fortran compiler itself. This option is deprecated; use
<code>-fdump-fortran-original</code> instead.
</p>
</dd>
<dt><code>-ffpe-trap=<var>list</var></code></dt>
<dd><a name="index-ffpe_002dtrap_003dlist"></a>
<p>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 will be sent and the program
being aborted, producing a core file useful for debugging. <var>list</var>
is a (possibly empty) comma-separated list of the following
exceptions: &lsquo;<samp>invalid</samp>&rsquo; (invalid floating point operation, such as
<code>SQRT(-1.0)</code>), &lsquo;<samp>zero</samp>&rsquo; (division by zero), &lsquo;<samp>overflow</samp>&rsquo;
(overflow in a floating point operation), &lsquo;<samp>underflow</samp>&rsquo; (underflow
in a floating point operation), &lsquo;<samp>inexact</samp>&rsquo; (loss of precision
during operation), and &lsquo;<samp>denormal</samp>&rsquo; (operation performed on a
denormal value). The first five exceptions correspond to the five
IEEE 754 exceptions, whereas the last one (&lsquo;<samp>denormal</samp>&rsquo;) is not
part of the IEEE 754 standard but is available on some common
architectures such as x86.
</p>
<p>The first three exceptions (&lsquo;<samp>invalid</samp>&rsquo;, &lsquo;<samp>zero</samp>&rsquo;, and
&lsquo;<samp>overflow</samp>&rsquo;) 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.
</p>
<p>Many, if not most, floating point operations incur loss of precision
due to rounding, and hence the <code>ffpe-trap=inexact</code> is likely to
be uninteresting in practice.
</p>
<p>By default no exception traps are enabled.
</p>
</dd>
<dt><code>-ffpe-summary=<var>list</var></code></dt>
<dd><a name="index-ffpe_002dsummary_003dlist"></a>
<p>Specify a list of floating-point exceptions, whose flag status is printed
to <code>ERROR_UNIT</code> when invoking <code>STOP</code> and <code>ERROR STOP</code>.
<var>list</var> can be either &lsquo;<samp>none</samp>&rsquo;, &lsquo;<samp>all</samp>&rsquo; or a comma-separated list
of the following exceptions: &lsquo;<samp>invalid</samp>&rsquo;, &lsquo;<samp>zero</samp>&rsquo;, &lsquo;<samp>overflow</samp>&rsquo;,
&lsquo;<samp>underflow</samp>&rsquo;, &lsquo;<samp>inexact</samp>&rsquo; and &lsquo;<samp>denormal</samp>&rsquo;. (See
<samp>-ffpe-trap</samp> for a description of the exceptions.)
</p>
<p>By default, a summary for all exceptions but &lsquo;<samp>inexact</samp>&rsquo; is shown.
</p>
</dd>
<dt><code>-fno-backtrace</code></dt>
<dd><a name="index-fno_002dbacktrace"></a>
<a name="index-backtrace"></a>
<a name="index-trace"></a>
<p>When a serious runtime error is encountered or a deadly signal is
emitted (segmentation fault, illegal instruction, bus error,
floating-point exception, and the other POSIX signals that have the
action &lsquo;<samp>core</samp>&rsquo;), the Fortran runtime library tries to output a
backtrace of the error. <code>-fno-backtrace</code> disables the backtrace
generation. This option only has influence for compilation of the
Fortran main program.
</p>
</dd>
</dl>
<p>See <a href="http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging-Options">Options for Debugging Your Program or GCC</a> in <cite>Using the GNU Compiler Collection (GCC)</cite>, for more information on
debugging options.
</p>
<hr>
<div class="header">
<p>
Next: <a href="Directory-Options.html#Directory-Options" accesskey="n" rel="next">Directory Options</a>, Previous: <a href="Error-and-Warning-Options.html#Error-and-Warning-Options" accesskey="p" rel="prev">Error and Warning Options</a>, Up: <a href="Invoking-GNU-Fortran.html#Invoking-GNU-Fortran" accesskey="u" rel="up">Invoking GNU Fortran</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>