diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/gcc~13/developer-options.html | |
new repository
Diffstat (limited to 'devdocs/gcc~13/developer-options.html')
| -rw-r--r-- | devdocs/gcc~13/developer-options.html | 403 |
1 files changed, 403 insertions, 0 deletions
diff --git a/devdocs/gcc~13/developer-options.html b/devdocs/gcc~13/developer-options.html new file mode 100644 index 00000000..c36d6331 --- /dev/null +++ b/devdocs/gcc~13/developer-options.html @@ -0,0 +1,403 @@ +<div class="section-level-extent" id="Developer-Options"> <div class="nav-panel"> <p> Next: <a href="submodel-options" accesskey="n" rel="next">Machine-Dependent Options</a>, Previous: <a href="code-gen-options" accesskey="p" rel="prev">Options for Code Generation Conventions</a>, Up: <a href="invoking-gcc" accesskey="u" rel="up">GCC Command Options</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div> <h1 class="section" id="GCC-Developer-Options"><span>3.18 GCC Developer Options<a class="copiable-link" href="#GCC-Developer-Options"> ¶</a></span></h1> <p>This section describes command-line options that are primarily of interest to GCC developers, including options to support compiler testing and investigation of compiler bugs and compile-time performance problems. This includes options that produce debug dumps at various points in the compilation; that print statistics such as memory use and execution time; and that print information about GCC’s configuration, such as where it searches for libraries. You should rarely need to use any of these options for ordinary compilation and linking tasks. </p> <p>Many developer options that cause GCC to dump output to a file take an optional ‘<samp class="samp">=<var class="var">filename</var></samp>’ suffix. You can specify ‘<samp class="samp">stdout</samp>’ or ‘<samp class="samp">-</samp>’ to dump to standard output, and ‘<samp class="samp">stderr</samp>’ for standard error. </p> <p>If ‘<samp class="samp">=<var class="var">filename</var></samp>’ is omitted, a default dump file name is constructed by concatenating the base dump file name, a pass number, phase letter, and pass name. The base dump file name is the name of output file produced by the compiler if explicitly specified and not an executable; otherwise it is the source file name. The pass number is determined by the order passes are registered with the compiler’s pass manager. This is generally the same as the order of execution, but passes registered by plugins, target-specific passes, or passes that are otherwise registered late are numbered higher than the pass named ‘<samp class="samp">final</samp>’, even if they are executed earlier. The phase letter is one of ‘<samp class="samp">i</samp>’ (inter-procedural analysis), ‘<samp class="samp">l</samp>’ (language-specific), ‘<samp class="samp">r</samp>’ (RTL), or ‘<samp class="samp">t</samp>’ (tree). The files are created in the directory of the output file. </p> <dl class="table"> <dt> +<span><code class="code">-fcallgraph-info</code><a class="copiable-link" href="#index-fcallgraph-info"> ¶</a></span> +</dt> <dt><code class="code">-fcallgraph-info=<var class="var">MARKERS</var></code></dt> <dd> +<p>Makes the compiler output callgraph information for the program, on a per-object-file basis. The information is generated in the common VCG format. It can be decorated with additional, per-node and/or per-edge information, if a list of comma-separated markers is additionally specified. When the <code class="code">su</code> marker is specified, the callgraph is decorated with stack usage information; it is equivalent to <samp class="option">-fstack-usage</samp>. When the <code class="code">da</code> marker is specified, the callgraph is decorated with information about dynamically allocated objects. </p> <p>When compiling with <samp class="option">-flto</samp>, no callgraph information is output along with the object file. At LTO link time, <samp class="option">-fcallgraph-info</samp> may generate multiple callgraph information files next to intermediate LTO output files. </p> </dd> <dt> + <span><code class="code">-d<var class="var">letters</var></code><a class="copiable-link" href="#index-d-1"> ¶</a></span> +</dt> <dt><code class="code">-fdump-rtl-<var class="var">pass</var></code></dt> <dt><code class="code">-fdump-rtl-<var class="var">pass</var>=<var class="var">filename</var></code></dt> <dd> +<p>Says to make debugging dumps during compilation at times specified by <var class="var">letters</var>. This is used for debugging the RTL-based passes of the compiler. </p> <p>Some <samp class="option">-d<var class="var">letters</var></samp> switches have different meaning when <samp class="option">-E</samp> is used for preprocessing. See <a class="xref" href="preprocessor-options">Options Controlling the Preprocessor</a>, for information about preprocessor-specific dump options. </p> <p>Debug dumps can be enabled with a <samp class="option">-fdump-rtl</samp> switch or some <samp class="option">-d</samp> option <var class="var">letters</var>. Here are the possible letters for use in <var class="var">pass</var> and <var class="var">letters</var>, and their meanings: </p> <dl class="table"> <dt> +<span><code class="code">-fdump-rtl-alignments</code><a class="copiable-link" href="#index-fdump-rtl-alignments"> ¶</a></span> +</dt> <dd> +<p>Dump after branch alignments have been computed. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-asmcons</code><a class="copiable-link" href="#index-fdump-rtl-asmcons"> ¶</a></span> +</dt> <dd> +<p>Dump after fixing rtl statements that have unsatisfied in/out constraints. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-auto_inc_dec</code><a class="copiable-link" href="#index-fdump-rtl-auto_005finc_005fdec"> ¶</a></span> +</dt> <dd> +<p>Dump after auto-inc-dec discovery. This pass is only run on architectures that have auto inc or auto dec instructions. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-barriers</code><a class="copiable-link" href="#index-fdump-rtl-barriers"> ¶</a></span> +</dt> <dd> +<p>Dump after cleaning up the barrier instructions. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-bbpart</code><a class="copiable-link" href="#index-fdump-rtl-bbpart"> ¶</a></span> +</dt> <dd> +<p>Dump after partitioning hot and cold basic blocks. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-bbro</code><a class="copiable-link" href="#index-fdump-rtl-bbro"> ¶</a></span> +</dt> <dd> +<p>Dump after block reordering. </p> </dd> <dt> + <span><code class="code">-fdump-rtl-btl1</code><a class="copiable-link" href="#index-fdump-rtl-btl2"> ¶</a></span> +</dt> <dt><code class="code">-fdump-rtl-btl2</code></dt> <dd> +<p><samp class="option">-fdump-rtl-btl1</samp> and <samp class="option">-fdump-rtl-btl2</samp> enable dumping after the two branch target load optimization passes. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-bypass</code><a class="copiable-link" href="#index-fdump-rtl-bypass"> ¶</a></span> +</dt> <dd> +<p>Dump after jump bypassing and control flow optimizations. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-combine</code><a class="copiable-link" href="#index-fdump-rtl-combine"> ¶</a></span> +</dt> <dd> +<p>Dump after the RTL instruction combination pass. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-compgotos</code><a class="copiable-link" href="#index-fdump-rtl-compgotos"> ¶</a></span> +</dt> <dd> +<p>Dump after duplicating the computed gotos. </p> </dd> <dt> + <span><code class="code">-fdump-rtl-ce1</code><a class="copiable-link" href="#index-fdump-rtl-ce1"> ¶</a></span> +</dt> <dt><code class="code">-fdump-rtl-ce2</code></dt> <dt><code class="code">-fdump-rtl-ce3</code></dt> <dd> +<p><samp class="option">-fdump-rtl-ce1</samp>, <samp class="option">-fdump-rtl-ce2</samp>, and <samp class="option">-fdump-rtl-ce3</samp> enable dumping after the three if conversion passes. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-cprop_hardreg</code><a class="copiable-link" href="#index-fdump-rtl-cprop_005fhardreg"> ¶</a></span> +</dt> <dd> +<p>Dump after hard register copy propagation. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-csa</code><a class="copiable-link" href="#index-fdump-rtl-csa"> ¶</a></span> +</dt> <dd> +<p>Dump after combining stack adjustments. </p> </dd> <dt> + <span><code class="code">-fdump-rtl-cse1</code><a class="copiable-link" href="#index-fdump-rtl-cse1"> ¶</a></span> +</dt> <dt><code class="code">-fdump-rtl-cse2</code></dt> <dd> +<p><samp class="option">-fdump-rtl-cse1</samp> and <samp class="option">-fdump-rtl-cse2</samp> enable dumping after the two common subexpression elimination passes. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-dce</code><a class="copiable-link" href="#index-fdump-rtl-dce"> ¶</a></span> +</dt> <dd> +<p>Dump after the standalone dead code elimination passes. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-dbr</code><a class="copiable-link" href="#index-fdump-rtl-dbr"> ¶</a></span> +</dt> <dd> +<p>Dump after delayed branch scheduling. </p> </dd> <dt> + <span><code class="code">-fdump-rtl-dce1</code><a class="copiable-link" href="#index-fdump-rtl-dce1"> ¶</a></span> +</dt> <dt><code class="code">-fdump-rtl-dce2</code></dt> <dd> +<p><samp class="option">-fdump-rtl-dce1</samp> and <samp class="option">-fdump-rtl-dce2</samp> enable dumping after the two dead store elimination passes. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-eh</code><a class="copiable-link" href="#index-fdump-rtl-eh"> ¶</a></span> +</dt> <dd> +<p>Dump after finalization of EH handling code. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-eh_ranges</code><a class="copiable-link" href="#index-fdump-rtl-eh_005franges"> ¶</a></span> +</dt> <dd> +<p>Dump after conversion of EH handling range regions. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-expand</code><a class="copiable-link" href="#index-fdump-rtl-expand"> ¶</a></span> +</dt> <dd> +<p>Dump after RTL generation. </p> </dd> <dt> + <span><code class="code">-fdump-rtl-fwprop1</code><a class="copiable-link" href="#index-fdump-rtl-fwprop1"> ¶</a></span> +</dt> <dt><code class="code">-fdump-rtl-fwprop2</code></dt> <dd> +<p><samp class="option">-fdump-rtl-fwprop1</samp> and <samp class="option">-fdump-rtl-fwprop2</samp> enable dumping after the two forward propagation passes. </p> </dd> <dt> + <span><code class="code">-fdump-rtl-gcse1</code><a class="copiable-link" href="#index-fdump-rtl-gcse1"> ¶</a></span> +</dt> <dt><code class="code">-fdump-rtl-gcse2</code></dt> <dd> +<p><samp class="option">-fdump-rtl-gcse1</samp> and <samp class="option">-fdump-rtl-gcse2</samp> enable dumping after global common subexpression elimination. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-init-regs</code><a class="copiable-link" href="#index-fdump-rtl-init-regs"> ¶</a></span> +</dt> <dd> +<p>Dump after the initialization of the registers. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-initvals</code><a class="copiable-link" href="#index-fdump-rtl-initvals"> ¶</a></span> +</dt> <dd> +<p>Dump after the computation of the initial value sets. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-into_cfglayout</code><a class="copiable-link" href="#index-fdump-rtl-into_005fcfglayout"> ¶</a></span> +</dt> <dd> +<p>Dump after converting to cfglayout mode. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-ira</code><a class="copiable-link" href="#index-fdump-rtl-ira"> ¶</a></span> +</dt> <dd> +<p>Dump after iterated register allocation. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-jump</code><a class="copiable-link" href="#index-fdump-rtl-jump"> ¶</a></span> +</dt> <dd> +<p>Dump after the second jump optimization. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-loop2</code><a class="copiable-link" href="#index-fdump-rtl-loop2"> ¶</a></span> +</dt> <dd> +<p><samp class="option">-fdump-rtl-loop2</samp> enables dumping after the rtl loop optimization passes. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-mach</code><a class="copiable-link" href="#index-fdump-rtl-mach"> ¶</a></span> +</dt> <dd> +<p>Dump after performing the machine dependent reorganization pass, if that pass exists. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-mode_sw</code><a class="copiable-link" href="#index-fdump-rtl-mode_005fsw"> ¶</a></span> +</dt> <dd> +<p>Dump after removing redundant mode switches. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-rnreg</code><a class="copiable-link" href="#index-fdump-rtl-rnreg"> ¶</a></span> +</dt> <dd> +<p>Dump after register renumbering. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-outof_cfglayout</code><a class="copiable-link" href="#index-fdump-rtl-outof_005fcfglayout"> ¶</a></span> +</dt> <dd> +<p>Dump after converting from cfglayout mode. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-peephole2</code><a class="copiable-link" href="#index-fdump-rtl-peephole2"> ¶</a></span> +</dt> <dd> +<p>Dump after the peephole pass. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-postreload</code><a class="copiable-link" href="#index-fdump-rtl-postreload"> ¶</a></span> +</dt> <dd> +<p>Dump after post-reload optimizations. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-pro_and_epilogue</code><a class="copiable-link" href="#index-fdump-rtl-pro_005fand_005fepilogue"> ¶</a></span> +</dt> <dd> +<p>Dump after generating the function prologues and epilogues. </p> </dd> <dt> + <span><code class="code">-fdump-rtl-sched1</code><a class="copiable-link" href="#index-fdump-rtl-sched1"> ¶</a></span> +</dt> <dt><code class="code">-fdump-rtl-sched2</code></dt> <dd> +<p><samp class="option">-fdump-rtl-sched1</samp> and <samp class="option">-fdump-rtl-sched2</samp> enable dumping after the basic block scheduling passes. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-ree</code><a class="copiable-link" href="#index-fdump-rtl-ree"> ¶</a></span> +</dt> <dd> +<p>Dump after sign/zero extension elimination. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-seqabstr</code><a class="copiable-link" href="#index-fdump-rtl-seqabstr"> ¶</a></span> +</dt> <dd> +<p>Dump after common sequence discovery. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-shorten</code><a class="copiable-link" href="#index-fdump-rtl-shorten"> ¶</a></span> +</dt> <dd> +<p>Dump after shortening branches. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-sibling</code><a class="copiable-link" href="#index-fdump-rtl-sibling"> ¶</a></span> +</dt> <dd> +<p>Dump after sibling call optimizations. </p> </dd> <dt> + <span><code class="code">-fdump-rtl-split1</code><a class="copiable-link" href="#index-fdump-rtl-split1"> ¶</a></span> +</dt> <dt><code class="code">-fdump-rtl-split2</code></dt> <dt><code class="code">-fdump-rtl-split3</code></dt> <dt><code class="code">-fdump-rtl-split4</code></dt> <dt><code class="code">-fdump-rtl-split5</code></dt> <dd> +<p>These options enable dumping after five rounds of instruction splitting. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-sms</code><a class="copiable-link" href="#index-fdump-rtl-sms"> ¶</a></span> +</dt> <dd> +<p>Dump after modulo scheduling. This pass is only run on some architectures. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-stack</code><a class="copiable-link" href="#index-fdump-rtl-stack"> ¶</a></span> +</dt> <dd> +<p>Dump after conversion from GCC’s “flat register file” registers to the x87’s stack-like registers. This pass is only run on x86 variants. </p> </dd> <dt> + <span><code class="code">-fdump-rtl-subreg1</code><a class="copiable-link" href="#index-fdump-rtl-subreg1"> ¶</a></span> +</dt> <dt><code class="code">-fdump-rtl-subreg2</code></dt> <dd> +<p><samp class="option">-fdump-rtl-subreg1</samp> and <samp class="option">-fdump-rtl-subreg2</samp> enable dumping after the two subreg expansion passes. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-unshare</code><a class="copiable-link" href="#index-fdump-rtl-unshare"> ¶</a></span> +</dt> <dd> +<p>Dump after all rtl has been unshared. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-vartrack</code><a class="copiable-link" href="#index-fdump-rtl-vartrack"> ¶</a></span> +</dt> <dd> +<p>Dump after variable tracking. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-vregs</code><a class="copiable-link" href="#index-fdump-rtl-vregs"> ¶</a></span> +</dt> <dd> +<p>Dump after converting virtual registers to hard registers. </p> </dd> <dt> +<span><code class="code">-fdump-rtl-web</code><a class="copiable-link" href="#index-fdump-rtl-web"> ¶</a></span> +</dt> <dd> +<p>Dump after live range splitting. </p> </dd> <dt> + <span><code class="code">-fdump-rtl-regclass</code><a class="copiable-link" href="#index-fdump-rtl-regclass"> ¶</a></span> +</dt> <dt><code class="code">-fdump-rtl-subregs_of_mode_init</code></dt> <dt><code class="code">-fdump-rtl-subregs_of_mode_finish</code></dt> <dt><code class="code">-fdump-rtl-dfinit</code></dt> <dt><code class="code">-fdump-rtl-dfinish</code></dt> <dd> +<p>These dumps are defined but always produce empty files. </p> </dd> <dt> + <span><code class="code">-da</code><a class="copiable-link" href="#index-da"> ¶</a></span> +</dt> <dt><code class="code">-fdump-rtl-all</code></dt> <dd> +<p>Produce all the dumps listed above. </p> </dd> <dt> +<span><code class="code">-dA</code><a class="copiable-link" href="#index-dA"> ¶</a></span> +</dt> <dd> +<p>Annotate the assembler output with miscellaneous debugging information. </p> </dd> <dt> +<span><code class="code">-dD</code><a class="copiable-link" href="#index-dD-1"> ¶</a></span> +</dt> <dd> +<p>Dump all macro definitions, at the end of preprocessing, in addition to normal output. </p> </dd> <dt> +<span><code class="code">-dH</code><a class="copiable-link" href="#index-dH"> ¶</a></span> +</dt> <dd> +<p>Produce a core dump whenever an error occurs. </p> </dd> <dt> +<span><code class="code">-dp</code><a class="copiable-link" href="#index-dp"> ¶</a></span> +</dt> <dd> +<p>Annotate the assembler output with a comment indicating which pattern and alternative is used. The length and cost of each instruction are also printed. </p> </dd> <dt> +<span><code class="code">-dP</code><a class="copiable-link" href="#index-dP"> ¶</a></span> +</dt> <dd> +<p>Dump the RTL in the assembler output as a comment before each instruction. Also turns on <samp class="option">-dp</samp> annotation. </p> </dd> <dt> +<span><code class="code">-dx</code><a class="copiable-link" href="#index-dx"> ¶</a></span> +</dt> <dd><p>Just generate RTL for a function instead of compiling it. Usually used with <samp class="option">-fdump-rtl-expand</samp>. </p></dd> </dl> </dd> <dt> +<span><code class="code">-fdump-debug</code><a class="copiable-link" href="#index-fdump-debug"> ¶</a></span> +</dt> <dd> +<p>Dump debugging information generated during the debug generation phase. </p> </dd> <dt> +<span><code class="code">-fdump-earlydebug</code><a class="copiable-link" href="#index-fdump-earlydebug"> ¶</a></span> +</dt> <dd> +<p>Dump debugging information generated during the early debug generation phase. </p> </dd> <dt> +<span><code class="code">-fdump-noaddr</code><a class="copiable-link" href="#index-fdump-noaddr"> ¶</a></span> +</dt> <dd> +<p>When doing debugging dumps, suppress address output. This makes it more feasible to use diff on debugging dumps for compiler invocations with different compiler binaries and/or different text / bss / data / heap / stack / dso start locations. </p> </dd> <dt> +<span><code class="code">-freport-bug</code><a class="copiable-link" href="#index-freport-bug"> ¶</a></span> +</dt> <dd> +<p>Collect and dump debug information into a temporary file if an internal compiler error (ICE) occurs. </p> </dd> <dt> +<span><code class="code">-fdump-unnumbered</code><a class="copiable-link" href="#index-fdump-unnumbered"> ¶</a></span> +</dt> <dd> +<p>When doing debugging dumps, suppress instruction numbers and address output. This makes it more feasible to use diff on debugging dumps for compiler invocations with different options, in particular with and without <samp class="option">-g</samp>. </p> </dd> <dt> +<span><code class="code">-fdump-unnumbered-links</code><a class="copiable-link" href="#index-fdump-unnumbered-links"> ¶</a></span> +</dt> <dd> +<p>When doing debugging dumps (see <samp class="option">-d</samp> option above), suppress instruction numbers for the links to the previous and next instructions in a sequence. </p> </dd> <dt> +<span><code class="code">-fdump-ipa-<var class="var">switch</var></code><a class="copiable-link" href="#index-fdump-ipa"> ¶</a></span> +</dt> <dt><code class="code">-fdump-ipa-<var class="var">switch</var>-<var class="var">options</var></code></dt> <dd> +<p>Control the dumping at various stages of inter-procedural analysis language tree to a file. The file name is generated by appending a switch specific suffix to the source file name, and the file is created in the same directory as the output file. The following dumps are possible: </p> <dl class="table"> <dt>‘<samp class="samp">all</samp>’</dt> <dd> +<p>Enables all inter-procedural analysis dumps. </p> </dd> <dt>‘<samp class="samp">cgraph</samp>’</dt> <dd> +<p>Dumps information about call-graph optimization, unused function removal, and inlining decisions. </p> </dd> <dt>‘<samp class="samp">inline</samp>’</dt> <dd> +<p>Dump after function inlining. </p> </dd> </dl> <p>Additionally, the options <samp class="option">-optimized</samp>, <samp class="option">-missed</samp>, <samp class="option">-note</samp>, and <samp class="option">-all</samp> can be provided, with the same meaning as for <samp class="option">-fopt-info</samp>, defaulting to <samp class="option">-optimized</samp>. </p> <p>For example, <samp class="option">-fdump-ipa-inline-optimized-missed</samp> will emit information on callsites that were inlined, along with callsites that were not inlined. </p> <p>By default, the dump will contain messages about successful optimizations (equivalent to <samp class="option">-optimized</samp>) together with low-level details about the analysis. </p> </dd> <dt> +<span><code class="code">-fdump-lang</code><a class="copiable-link" href="#index-fdump-lang"> ¶</a></span> +</dt> <dd> +<p>Dump language-specific information. The file name is made by appending <samp class="file">.lang</samp> to the source file name. </p> </dd> <dt> + <span><code class="code">-fdump-lang-all</code><a class="copiable-link" href="#index-fdump-lang-all"> ¶</a></span> +</dt> <dt><code class="code">-fdump-lang-<var class="var">switch</var></code></dt> <dt><code class="code">-fdump-lang-<var class="var">switch</var>-<var class="var">options</var></code></dt> <dt><code class="code">-fdump-lang-<var class="var">switch</var>-<var class="var">options</var>=<var class="var">filename</var></code></dt> <dd> +<p>Control the dumping of language-specific information. The <var class="var">options</var> and <var class="var">filename</var> portions behave as described in the <samp class="option">-fdump-tree</samp> option. The following <var class="var">switch</var> values are accepted: </p> <dl class="table"> <dt>‘<samp class="samp">all</samp>’</dt> <dd> <p>Enable all language-specific dumps. </p> </dd> <dt>‘<samp class="samp">class</samp>’</dt> <dd> +<p>Dump class hierarchy information. Virtual table information is emitted unless ’<samp class="option">slim</samp>’ is specified. This option is applicable to C++ only. </p> </dd> <dt>‘<samp class="samp">module</samp>’</dt> <dd> +<p>Dump module information. Options <samp class="option">lineno</samp> (locations), <samp class="option">graph</samp> (reachability), <samp class="option">blocks</samp> (clusters), <samp class="option">uid</samp> (serialization), <samp class="option">alias</samp> (mergeable), <samp class="option">asmname</samp> (Elrond), <samp class="option">eh</samp> (mapper) & <samp class="option">vops</samp> (macros) may provide additional information. This option is applicable to C++ only. </p> </dd> <dt>‘<samp class="samp">raw</samp>’</dt> <dd> +<p>Dump the raw internal tree data. This option is applicable to C++ only. </p> </dd> </dl> </dd> <dt> +<span><code class="code">-fdump-passes</code><a class="copiable-link" href="#index-fdump-passes"> ¶</a></span> +</dt> <dd> +<p>Print on <samp class="file">stderr</samp> the list of optimization passes that are turned on and off by the current command-line options. </p> </dd> <dt> +<span><code class="code">-fdump-statistics-<var class="var">option</var></code><a class="copiable-link" href="#index-fdump-statistics"> ¶</a></span> +</dt> <dd> +<p>Enable and control dumping of pass statistics in a separate file. The file name is generated by appending a suffix ending in ‘<samp class="samp">.statistics</samp>’ to the source file name, and the file is created in the same directory as the output file. If the ‘<samp class="samp">-<var class="var">option</var></samp>’ form is used, ‘<samp class="samp">-stats</samp>’ causes counters to be summed over the whole compilation unit while ‘<samp class="samp">-details</samp>’ dumps every event as the passes generate them. The default with no option is to sum counters for each function compiled. </p> </dd> <dt> + <span><code class="code">-fdump-tree-all</code><a class="copiable-link" href="#index-fdump-tree-all"> ¶</a></span> +</dt> <dt><code class="code">-fdump-tree-<var class="var">switch</var></code></dt> <dt><code class="code">-fdump-tree-<var class="var">switch</var>-<var class="var">options</var></code></dt> <dt><code class="code">-fdump-tree-<var class="var">switch</var>-<var class="var">options</var>=<var class="var">filename</var></code></dt> <dd> +<p>Control the dumping at various stages of processing the intermediate language tree to a file. If the ‘<samp class="samp">-<var class="var">options</var></samp>’ form is used, <var class="var">options</var> is a list of ‘<samp class="samp">-</samp>’ separated options which control the details of the dump. Not all options are applicable to all dumps; those that are not meaningful are ignored. The following options are available </p> <dl class="table"> <dt>‘<samp class="samp">address</samp>’</dt> <dd><p>Print the address of each node. Usually this is not meaningful as it changes according to the environment and source file. Its primary use is for tying up a dump file with a debug environment. </p></dd> <dt>‘<samp class="samp">asmname</samp>’</dt> <dd><p>If <code class="code">DECL_ASSEMBLER_NAME</code> has been set for a given decl, use that in the dump instead of <code class="code">DECL_NAME</code>. Its primary use is ease of use working backward from mangled names in the assembly file. </p></dd> <dt>‘<samp class="samp">slim</samp>’</dt> <dd> +<p>When dumping front-end intermediate representations, inhibit dumping of members of a scope or body of a function merely because that scope has been reached. Only dump such items when they are directly reachable by some other path. </p> <p>When dumping pretty-printed trees, this option inhibits dumping the bodies of control structures. </p> <p>When dumping RTL, print the RTL in slim (condensed) form instead of the default LISP-like representation. </p> +</dd> <dt>‘<samp class="samp">raw</samp>’</dt> <dd><p>Print a raw representation of the tree. By default, trees are pretty-printed into a C-like representation. </p></dd> <dt>‘<samp class="samp">details</samp>’</dt> <dd><p>Enable more detailed dumps (not honored by every dump option). Also include information from the optimization passes. </p></dd> <dt>‘<samp class="samp">stats</samp>’</dt> <dd><p>Enable dumping various statistics about the pass (not honored by every dump option). </p></dd> <dt>‘<samp class="samp">blocks</samp>’</dt> <dd><p>Enable showing basic block boundaries (disabled in raw dumps). </p></dd> <dt>‘<samp class="samp">graph</samp>’</dt> <dd> +<p>For each of the other indicated dump files (<samp class="option">-fdump-rtl-<var class="var">pass</var></samp>), dump a representation of the control flow graph suitable for viewing with GraphViz to <samp class="file"><var class="var">file</var>.<var class="var">passid</var>.<var class="var">pass</var>.dot</samp>. Each function in the file is pretty-printed as a subgraph, so that GraphViz can render them all in a single plot. </p> <p>This option currently only works for RTL dumps, and the RTL is always dumped in slim form. </p> +</dd> <dt>‘<samp class="samp">vops</samp>’</dt> <dd><p>Enable showing virtual operands for every statement. </p></dd> <dt>‘<samp class="samp">lineno</samp>’</dt> <dd><p>Enable showing line numbers for statements. </p></dd> <dt>‘<samp class="samp">uid</samp>’</dt> <dd><p>Enable showing the unique ID (<code class="code">DECL_UID</code>) for each variable. </p></dd> <dt>‘<samp class="samp">verbose</samp>’</dt> <dd><p>Enable showing the tree dump for each statement. </p></dd> <dt>‘<samp class="samp">eh</samp>’</dt> <dd><p>Enable showing the EH region number holding each statement. </p></dd> <dt>‘<samp class="samp">scev</samp>’</dt> <dd><p>Enable showing scalar evolution analysis details. </p></dd> <dt>‘<samp class="samp">optimized</samp>’</dt> <dd><p>Enable showing optimization information (only available in certain passes). </p></dd> <dt>‘<samp class="samp">missed</samp>’</dt> <dd><p>Enable showing missed optimization information (only available in certain passes). </p></dd> <dt>‘<samp class="samp">note</samp>’</dt> <dd><p>Enable other detailed optimization information (only available in certain passes). </p></dd> <dt>‘<samp class="samp">all</samp>’</dt> <dd><p>Turn on all options, except <samp class="option">raw</samp>, <samp class="option">slim</samp>, <samp class="option">verbose</samp> and <samp class="option">lineno</samp>. </p></dd> <dt>‘<samp class="samp">optall</samp>’</dt> <dd><p>Turn on all optimization options, i.e., <samp class="option">optimized</samp>, <samp class="option">missed</samp>, and <samp class="option">note</samp>. </p></dd> </dl> <p>To determine what tree dumps are available or find the dump for a pass of interest follow the steps below. </p> <ol class="enumerate"> <li> Invoke GCC with <samp class="option">-fdump-passes</samp> and in the <samp class="file">stderr</samp> output look for a code that corresponds to the pass you are interested in. For example, the codes <code class="code">tree-evrp</code>, <code class="code">tree-vrp1</code>, and <code class="code">tree-vrp2</code> correspond to the three Value Range Propagation passes. The number at the end distinguishes distinct invocations of the same pass. </li> +<li> To enable the creation of the dump file, append the pass code to the <samp class="option">-fdump-</samp> option prefix and invoke GCC with it. For example, to enable the dump from the Early Value Range Propagation pass, invoke GCC with the <samp class="option">-fdump-tree-evrp</samp> option. Optionally, you may specify the name of the dump file. If you don’t specify one, GCC creates as described below. </li> +<li> Find the pass dump in a file whose name is composed of three components separated by a period: the name of the source file GCC was invoked to compile, a numeric suffix indicating the pass number followed by the letter ‘<samp class="samp">t</samp>’ for tree passes (and the letter ‘<samp class="samp">r</samp>’ for RTL passes), and finally the pass code. For example, the Early VRP pass dump might be in a file named <samp class="file">myfile.c.038t.evrp</samp> in the current working directory. Note that the numeric codes are not stable and may change from one version of GCC to another. </li> +</ol> </dd> <dt> +<span><code class="code">-fopt-info</code><a class="copiable-link" href="#index-fopt-info"> ¶</a></span> +</dt> <dt><code class="code">-fopt-info-<var class="var">options</var></code></dt> <dt><code class="code">-fopt-info-<var class="var">options</var>=<var class="var">filename</var></code></dt> <dd> +<p>Controls optimization dumps from various optimization passes. If the ‘<samp class="samp">-<var class="var">options</var></samp>’ form is used, <var class="var">options</var> is a list of ‘<samp class="samp">-</samp>’ separated option keywords to select the dump details and optimizations. </p> <p>The <var class="var">options</var> can be divided into three groups: </p> +<ol class="enumerate"> <li> options describing what kinds of messages should be emitted, </li> +<li> options describing the verbosity of the dump, and </li> +<li> options describing which optimizations should be included. </li> +</ol> <p>The options from each group can be freely mixed as they are non-overlapping. However, in case of any conflicts, the later options override the earlier options on the command line. </p> <p>The following options control which kinds of messages should be emitted: </p> <dl class="table"> <dt>‘<samp class="samp">optimized</samp>’</dt> <dd><p>Print information when an optimization is successfully applied. It is up to a pass to decide which information is relevant. For example, the vectorizer passes print the source location of loops which are successfully vectorized. </p></dd> <dt>‘<samp class="samp">missed</samp>’</dt> <dd><p>Print information about missed optimizations. Individual passes control which information to include in the output. </p></dd> <dt>‘<samp class="samp">note</samp>’</dt> <dd><p>Print verbose information about optimizations, such as certain transformations, more detailed messages about decisions etc. </p></dd> <dt>‘<samp class="samp">all</samp>’</dt> <dd><p>Print detailed optimization information. This includes ‘<samp class="samp">optimized</samp>’, ‘<samp class="samp">missed</samp>’, and ‘<samp class="samp">note</samp>’. </p></dd> </dl> <p>The following option controls the dump verbosity: </p> <dl class="table"> <dt>‘<samp class="samp">internals</samp>’</dt> <dd><p>By default, only “high-level” messages are emitted. This option enables additional, more detailed, messages, which are likely to only be of interest to GCC developers. </p></dd> </dl> <p>One or more of the following option keywords can be used to describe a group of optimizations: </p> <dl class="table"> <dt>‘<samp class="samp">ipa</samp>’</dt> <dd><p>Enable dumps from all interprocedural optimizations. </p></dd> <dt>‘<samp class="samp">loop</samp>’</dt> <dd><p>Enable dumps from all loop optimizations. </p></dd> <dt>‘<samp class="samp">inline</samp>’</dt> <dd><p>Enable dumps from all inlining optimizations. </p></dd> <dt>‘<samp class="samp">omp</samp>’</dt> <dd><p>Enable dumps from all OMP (Offloading and Multi Processing) optimizations. </p></dd> <dt>‘<samp class="samp">vec</samp>’</dt> <dd><p>Enable dumps from all vectorization optimizations. </p></dd> <dt>‘<samp class="samp">optall</samp>’</dt> <dd><p>Enable dumps from all optimizations. This is a superset of the optimization groups listed above. </p></dd> </dl> <p>If <var class="var">options</var> is omitted, it defaults to ‘<samp class="samp">optimized-optall</samp>’, which means to dump messages about successful optimizations from all the passes, omitting messages that are treated as “internals”. </p> <p>If the <var class="var">filename</var> is provided, then the dumps from all the applicable optimizations are concatenated into the <var class="var">filename</var>. Otherwise the dump is output onto <samp class="file">stderr</samp>. Though multiple <samp class="option">-fopt-info</samp> options are accepted, only one of them can include a <var class="var">filename</var>. If other filenames are provided then all but the first such option are ignored. </p> <p>Note that the output <var class="var">filename</var> is overwritten in case of multiple translation units. If a combined output from multiple translation units is desired, <samp class="file">stderr</samp> should be used instead. </p> <p>In the following example, the optimization info is output to <samp class="file">stderr</samp>: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">gcc -O3 -fopt-info</pre> +</div> <p>This example: </p> +<div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">gcc -O3 -fopt-info-missed=missed.all</pre> +</div> <p>outputs missed optimization report from all the passes into <samp class="file">missed.all</samp>, and this one: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">gcc -O2 -ftree-vectorize -fopt-info-vec-missed</pre> +</div> <p>prints information about missed optimization opportunities from vectorization passes on <samp class="file">stderr</samp>. Note that <samp class="option">-fopt-info-vec-missed</samp> is equivalent to <samp class="option">-fopt-info-missed-vec</samp>. The order of the optimization group names and message types listed after <samp class="option">-fopt-info</samp> does not matter. </p> <p>As another example, </p> +<div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">gcc -O3 -fopt-info-inline-optimized-missed=inline.txt</pre> +</div> <p>outputs information about missed optimizations as well as optimized locations from all the inlining passes into <samp class="file">inline.txt</samp>. </p> <p>Finally, consider: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt</pre> +</div> <p>Here the two output filenames <samp class="file">vec.miss</samp> and <samp class="file">loop.opt</samp> are in conflict since only one output file is allowed. In this case, only the first option takes effect and the subsequent options are ignored. Thus only <samp class="file">vec.miss</samp> is produced which contains dumps from the vectorizer about missed opportunities. </p> </dd> <dt> +<span><code class="code">-fsave-optimization-record</code><a class="copiable-link" href="#index-fsave-optimization-record"> ¶</a></span> +</dt> <dd> +<p>Write a SRCFILE.opt-record.json.gz file detailing what optimizations were performed, for those optimizations that support <samp class="option">-fopt-info</samp>. </p> <p>This option is experimental and the format of the data within the compressed JSON file is subject to change. </p> <p>It is roughly equivalent to a machine-readable version of <samp class="option">-fopt-info-all</samp>, as a collection of messages with source file, line number and column number, with the following additional data for each message: </p> <ul class="itemize mark-bullet"> <li>the execution count of the code being optimized, along with metadata about whether this was from actual profile data, or just an estimate, allowing consumers to prioritize messages by code hotness, </li> +<li>the function name of the code being optimized, where applicable, </li> +<li>the “inlining chain” for the code being optimized, so that when a function is inlined into several different places (which might themselves be inlined), the reader can distinguish between the copies, </li> +<li>objects identifying those parts of the message that refer to expressions, statements or symbol-table nodes, which of these categories they are, and, when available, their source code location, </li> +<li>the GCC pass that emitted the message, and </li> +<li>the location in GCC’s own code from which the message was emitted </li> +</ul> <p>Additionally, some messages are logically nested within other messages, reflecting implementation details of the optimization passes. </p> </dd> <dt> +<span><code class="code">-fsched-verbose=<var class="var">n</var></code><a class="copiable-link" href="#index-fsched-verbose"> ¶</a></span> +</dt> <dd> +<p>On targets that use instruction scheduling, this option controls the amount of debugging output the scheduler prints to the dump files. </p> <p>For <var class="var">n</var> greater than zero, <samp class="option">-fsched-verbose</samp> outputs the same information as <samp class="option">-fdump-rtl-sched1</samp> and <samp class="option">-fdump-rtl-sched2</samp>. For <var class="var">n</var> greater than one, it also output basic block probabilities, detailed ready list information and unit/insn info. For <var class="var">n</var> greater than two, it includes RTL at abort point, control-flow and regions info. And for <var class="var">n</var> over four, <samp class="option">-fsched-verbose</samp> also includes dependence info. </p> </dd> <dt> + <span><code class="code">-fenable-<var class="var">kind</var>-<var class="var">pass</var></code><a class="copiable-link" href="#index-fdisable-"> ¶</a></span> +</dt> <dt><code class="code">-fdisable-<var class="var">kind</var>-<var class="var">pass</var>=<var class="var">range-list</var></code></dt> <dd> <p>This is a set of options that are used to explicitly disable/enable optimization passes. These options are intended for use for debugging GCC. Compiler users should use regular options for enabling/disabling passes instead. </p> <dl class="table"> <dt><code class="code">-fdisable-ipa-<var class="var">pass</var></code></dt> <dd> +<p>Disable IPA pass <var class="var">pass</var>. <var class="var">pass</var> is the pass name. If the same pass is statically invoked in the compiler multiple times, the pass name should be appended with a sequential number starting from 1. </p> </dd> <dt><code class="code">-fdisable-rtl-<var class="var">pass</var></code></dt> <dt><code class="code">-fdisable-rtl-<var class="var">pass</var>=<var class="var">range-list</var></code></dt> <dd> +<p>Disable RTL pass <var class="var">pass</var>. <var class="var">pass</var> is the pass name. If the same pass is statically invoked in the compiler multiple times, the pass name should be appended with a sequential number starting from 1. <var class="var">range-list</var> is a comma-separated list of function ranges or assembler names. Each range is a number pair separated by a colon. The range is inclusive in both ends. If the range is trivial, the number pair can be simplified as a single number. If the function’s call graph node’s <var class="var">uid</var> falls within one of the specified ranges, the <var class="var">pass</var> is disabled for that function. The <var class="var">uid</var> is shown in the function header of a dump file, and the pass names can be dumped by using option <samp class="option">-fdump-passes</samp>. </p> </dd> <dt><code class="code">-fdisable-tree-<var class="var">pass</var></code></dt> <dt><code class="code">-fdisable-tree-<var class="var">pass</var>=<var class="var">range-list</var></code></dt> <dd> +<p>Disable tree pass <var class="var">pass</var>. See <samp class="option">-fdisable-rtl</samp> for the description of option arguments. </p> </dd> <dt><code class="code">-fenable-ipa-<var class="var">pass</var></code></dt> <dd> +<p>Enable IPA pass <var class="var">pass</var>. <var class="var">pass</var> is the pass name. If the same pass is statically invoked in the compiler multiple times, the pass name should be appended with a sequential number starting from 1. </p> </dd> <dt><code class="code">-fenable-rtl-<var class="var">pass</var></code></dt> <dt><code class="code">-fenable-rtl-<var class="var">pass</var>=<var class="var">range-list</var></code></dt> <dd> +<p>Enable RTL pass <var class="var">pass</var>. See <samp class="option">-fdisable-rtl</samp> for option argument description and examples. </p> </dd> <dt><code class="code">-fenable-tree-<var class="var">pass</var></code></dt> <dt><code class="code">-fenable-tree-<var class="var">pass</var>=<var class="var">range-list</var></code></dt> <dd> +<p>Enable tree pass <var class="var">pass</var>. See <samp class="option">-fdisable-rtl</samp> for the description of option arguments. </p> </dd> </dl> <p>Here are some examples showing uses of these options. </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp"># disable ccp1 for all functions + -fdisable-tree-ccp1 +# disable complete unroll for function whose cgraph node uid is 1 + -fenable-tree-cunroll=1 +# disable gcse2 for functions at the following ranges [1,1], +# [300,400], and [400,1000] +# disable gcse2 for functions foo and foo2 + -fdisable-rtl-gcse2=foo,foo2 +# disable early inlining + -fdisable-tree-einline +# disable ipa inlining + -fdisable-ipa-inline +# enable tree full unroll + -fenable-tree-unroll</pre> +</div> </dd> <dt> + <span><code class="code">-fchecking</code><a class="copiable-link" href="#index-fchecking"> ¶</a></span> +</dt> <dt><code class="code">-fchecking=<var class="var">n</var></code></dt> <dd> +<p>Enable internal consistency checking. The default depends on the compiler configuration. <samp class="option">-fchecking=2</samp> enables further internal consistency checking that might affect code generation. </p> </dd> <dt> +<span><code class="code">-frandom-seed=<var class="var">string</var></code><a class="copiable-link" href="#index-frandom-seed"> ¶</a></span> +</dt> <dd> +<p>This option provides a seed that GCC uses in place of random numbers in generating certain symbol names that have to be different in every compiled file. It is also used to place unique stamps in coverage data files and the object files that produce them. You can use the <samp class="option">-frandom-seed</samp> option to produce reproducibly identical object files. </p> <p>The <var class="var">string</var> can either be a number (decimal, octal or hex) or an arbitrary string (in which case it’s converted to a number by computing CRC32). </p> <p>The <var class="var">string</var> should be different for every file you compile. </p> </dd> <dt> +<span><code class="code">-save-temps</code><a class="copiable-link" href="#index-save-temps"> ¶</a></span> +</dt> <dd> +<p>Store the usual “temporary” intermediate files permanently; name them as auxiliary output files, as specified described under <samp class="option">-dumpbase</samp> and <samp class="option">-dumpdir</samp>. </p> <p>When used in combination with the <samp class="option">-x</samp> command-line option, <samp class="option">-save-temps</samp> is sensible enough to avoid overwriting an input source file with the same extension as an intermediate file. The corresponding intermediate file may be obtained by renaming the source file before using <samp class="option">-save-temps</samp>. </p> </dd> <dt> +<span><code class="code">-save-temps=cwd</code><a class="copiable-link" href="#index-save-temps_003dcwd"> ¶</a></span> +</dt> <dd> +<p>Equivalent to <samp class="option">-save-temps -dumpdir ./</samp>. </p> </dd> <dt> +<span><code class="code">-save-temps=obj</code><a class="copiable-link" href="#index-save-temps_003dobj"> ¶</a></span> +</dt> <dd> +<p>Equivalent to <samp class="option">-save-temps -dumpdir <samp class="file">outdir/</samp></samp>, where <samp class="file">outdir/</samp> is the directory of the output file specified after the <samp class="option">-o</samp> option, including any directory separators. If the <samp class="option">-o</samp> option is not used, the <samp class="option">-save-temps=obj</samp> switch behaves like <samp class="option">-save-temps=cwd</samp>. </p> </dd> <dt> +<span><code class="code">-time<span class="r">[</span>=<var class="var">file</var><span class="r">]</span></code><a class="copiable-link" href="#index-time"> ¶</a></span> +</dt> <dd> +<p>Report the CPU time taken by each subprocess in the compilation sequence. For C source files, this is the compiler proper and assembler (plus the linker if linking is done). </p> <p>Without the specification of an output file, the output looks like this: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp"># cc1 0.12 0.01 +# as 0.00 0.01</pre> +</div> <p>The first number on each line is the “user time”, that is time spent executing the program itself. The second number is “system time”, time spent executing operating system routines on behalf of the program. Both numbers are in seconds. </p> <p>With the specification of an output file, the output is appended to the named file, and it looks like this: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">0.12 0.01 cc1 <var class="var">options</var> +0.00 0.01 as <var class="var">options</var></pre> +</div> <p>The “user time” and the “system time” are moved before the program name, and the options passed to the program are displayed, so that one can later tell what file was being compiled, and with which options. </p> </dd> <dt> +<span><code class="code">-fdump-final-insns<span class="r">[</span>=<var class="var">file</var><span class="r">]</span></code><a class="copiable-link" href="#index-fdump-final-insns"> ¶</a></span> +</dt> <dd> +<p>Dump the final internal representation (RTL) to <var class="var">file</var>. If the optional argument is omitted (or if <var class="var">file</var> is <code class="code">.</code>), the name of the dump file is determined by appending <code class="code">.gkd</code> to the dump base name, see <samp class="option">-dumpbase</samp>. </p> </dd> <dt> + <span><code class="code">-fcompare-debug<span class="r">[</span>=<var class="var">opts</var><span class="r">]</span></code><a class="copiable-link" href="#index-fcompare-debug"> ¶</a></span> +</dt> <dd> +<p>If no error occurs during compilation, run the compiler a second time, adding <var class="var">opts</var> and <samp class="option">-fcompare-debug-second</samp> to the arguments passed to the second compilation. Dump the final internal representation in both compilations, and print an error if they differ. </p> <p>If the equal sign is omitted, the default <samp class="option">-gtoggle</samp> is used. </p> <p>The environment variable <code class="env">GCC_COMPARE_DEBUG</code>, if defined, non-empty and nonzero, implicitly enables <samp class="option">-fcompare-debug</samp>. If <code class="env">GCC_COMPARE_DEBUG</code> is defined to a string starting with a dash, then it is used for <var class="var">opts</var>, otherwise the default <samp class="option">-gtoggle</samp> is used. </p> <p><samp class="option">-fcompare-debug=</samp>, with the equal sign but without <var class="var">opts</var>, is equivalent to <samp class="option">-fno-compare-debug</samp>, which disables the dumping of the final representation and the second compilation, preventing even <code class="env">GCC_COMPARE_DEBUG</code> from taking effect. </p> <p>To verify full coverage during <samp class="option">-fcompare-debug</samp> testing, set <code class="env">GCC_COMPARE_DEBUG</code> to say <samp class="option">-fcompare-debug-not-overridden</samp>, which GCC rejects as an invalid option in any actual compilation (rather than preprocessing, assembly or linking). To get just a warning, setting <code class="env">GCC_COMPARE_DEBUG</code> to ‘<samp class="samp">-w%n-fcompare-debug not overridden</samp>’ will do. </p> </dd> <dt> +<span><code class="code">-fcompare-debug-second</code><a class="copiable-link" href="#index-fcompare-debug-second"> ¶</a></span> +</dt> <dd> +<p>This option is implicitly passed to the compiler for the second compilation requested by <samp class="option">-fcompare-debug</samp>, along with options to silence warnings, and omitting other options that would cause the compiler to produce output to files or to standard output as a side effect. Dump files and preserved temporary files are renamed so as to contain the <code class="code">.gk</code> additional extension during the second compilation, to avoid overwriting those generated by the first. </p> <p>When this option is passed to the compiler driver, it causes the <em class="emph">first</em> compilation to be skipped, which makes it useful for little other than debugging the compiler proper. </p> </dd> <dt> +<span><code class="code">-gtoggle</code><a class="copiable-link" href="#index-gtoggle"> ¶</a></span> +</dt> <dd> +<p>Turn off generation of debug info, if leaving out this option generates it, or turn it on at level 2 otherwise. The position of this argument in the command line does not matter; it takes effect after all other options are processed, and it does so only once, no matter how many times it is given. This is mainly intended to be used with <samp class="option">-fcompare-debug</samp>. </p> </dd> <dt> + <span><code class="code">-fvar-tracking-assignments-toggle</code><a class="copiable-link" href="#index-fvar-tracking-assignments-toggle"> ¶</a></span> +</dt> <dd> +<p>Toggle <samp class="option">-fvar-tracking-assignments</samp>, in the same way that <samp class="option">-gtoggle</samp> toggles <samp class="option">-g</samp>. </p> </dd> <dt> +<span><code class="code">-Q</code><a class="copiable-link" href="#index-Q"> ¶</a></span> +</dt> <dd> +<p>Makes the compiler print out each function name as it is compiled, and print some statistics about each pass when it finishes. </p> </dd> <dt> +<span><code class="code">-ftime-report</code><a class="copiable-link" href="#index-ftime-report"> ¶</a></span> +</dt> <dd> +<p>Makes the compiler print some statistics about the time consumed by each pass when it finishes. </p> </dd> <dt> +<span><code class="code">-ftime-report-details</code><a class="copiable-link" href="#index-ftime-report-details"> ¶</a></span> +</dt> <dd> +<p>Record the time consumed by infrastructure parts separately for each pass. </p> </dd> <dt> +<span><code class="code">-fira-verbose=<var class="var">n</var></code><a class="copiable-link" href="#index-fira-verbose"> ¶</a></span> +</dt> <dd> +<p>Control the verbosity of the dump file for the integrated register allocator. The default value is 5. If the value <var class="var">n</var> is greater or equal to 10, the dump output is sent to stderr using the same format as <var class="var">n</var> minus 10. </p> </dd> <dt> +<span><code class="code">-flto-report</code><a class="copiable-link" href="#index-flto-report"> ¶</a></span> +</dt> <dd> +<p>Prints a report with internal details on the workings of the link-time optimizer. The contents of this report vary from version to version. It is meant to be useful to GCC developers when processing object files in LTO mode (via <samp class="option">-flto</samp>). </p> <p>Disabled by default. </p> </dd> <dt> +<span><code class="code">-flto-report-wpa</code><a class="copiable-link" href="#index-flto-report-wpa"> ¶</a></span> +</dt> <dd> +<p>Like <samp class="option">-flto-report</samp>, but only print for the WPA phase of link-time optimization. </p> </dd> <dt> +<span><code class="code">-fmem-report</code><a class="copiable-link" href="#index-fmem-report"> ¶</a></span> +</dt> <dd> +<p>Makes the compiler print some statistics about permanent memory allocation when it finishes. </p> </dd> <dt> +<span><code class="code">-fmem-report-wpa</code><a class="copiable-link" href="#index-fmem-report-wpa"> ¶</a></span> +</dt> <dd> +<p>Makes the compiler print some statistics about permanent memory allocation for the WPA phase only. </p> </dd> <dt> + <span><code class="code">-fpre-ipa-mem-report</code><a class="copiable-link" href="#index-fpre-ipa-mem-report"> ¶</a></span> +</dt> <dt><code class="code">-fpost-ipa-mem-report</code></dt> <dd> +<p>Makes the compiler print some statistics about permanent memory allocation before or after interprocedural optimization. </p> </dd> <dt> +<span><code class="code">-fmultiflags</code><a class="copiable-link" href="#index-fmultiflags"> ¶</a></span> +</dt> <dd> +<p>This option enables multilib-aware <code class="code">TFLAGS</code> to be used to build target libraries with options different from those the compiler is configured to use by default, through the use of specs (See <a class="xref" href="spec-files">Specifying Subprocesses and the Switches to Pass to Them</a>) set up by compiler internals, by the target, or by builders at configure time. </p> <p>Like <code class="code">TFLAGS</code>, this allows the target libraries to be built for portable baseline environments, while the compiler defaults to more demanding ones. That’s useful because users can easily override the defaults the compiler is configured to use to build their own programs, if the defaults are not ideal for their target environment, whereas rebuilding the runtime libraries is usually not as easy or desirable. </p> <p>Unlike <code class="code">TFLAGS</code>, the use of specs enables different flags to be selected for different multilibs. The way to accomplish that is to build with ‘<samp class="samp">make TFLAGS=-fmultiflags</samp>’, after configuring ‘<samp class="samp">--with-specs=%{fmultiflags:...}</samp>’. </p> <p>This option is discarded by the driver once it’s done processing driver self spec. </p> <p>It is also useful to check that <code class="code">TFLAGS</code> are being used to build all target libraries, by configuring a non-bootstrap compiler ‘<samp class="samp">--with-specs='%{!fmultiflags:%emissing TFLAGS}'</samp>’ and building the compiler and target libraries. </p> </dd> <dt> +<span><code class="code">-fprofile-report</code><a class="copiable-link" href="#index-fprofile-report"> ¶</a></span> +</dt> <dd> +<p>Makes the compiler print some statistics about consistency of the (estimated) profile and effect of individual passes. </p> </dd> <dt> +<span><code class="code">-fstack-usage</code><a class="copiable-link" href="#index-fstack-usage"> ¶</a></span> +</dt> <dd> +<p>Makes the compiler output stack usage information for the program, on a per-function basis. The filename for the dump is made by appending <samp class="file">.su</samp> to the <var class="var">auxname</var>. <var class="var">auxname</var> is generated from the name of the output file, if explicitly specified and it is not an executable, otherwise it is the basename of the source file. An entry is made up of three fields: </p> <ul class="itemize mark-bullet"> <li>The name of the function. </li> +<li>A number of bytes. </li> +<li>One or more qualifiers: <code class="code">static</code>, <code class="code">dynamic</code>, <code class="code">bounded</code>. </li> +</ul> <p>The qualifier <code class="code">static</code> means that the function manipulates the stack statically: a fixed number of bytes are allocated for the frame on function entry and released on function exit; no stack adjustments are otherwise made in the function. The second field is this fixed number of bytes. </p> <p>The qualifier <code class="code">dynamic</code> means that the function manipulates the stack dynamically: in addition to the static allocation described above, stack adjustments are made in the body of the function, for example to push/pop arguments around function calls. If the qualifier <code class="code">bounded</code> is also present, the amount of these adjustments is bounded at compile time and the second field is an upper bound of the total amount of stack used by the function. If it is not present, the amount of these adjustments is not bounded at compile time and the second field only represents the bounded part. </p> </dd> <dt> +<span><code class="code">-fstats</code><a class="copiable-link" href="#index-fstats"> ¶</a></span> +</dt> <dd> +<p>Emit statistics about front-end processing at the end of the compilation. This option is supported only by the C++ front end, and the information is generally only useful to the G++ development team. </p> </dd> <dt> +<span><code class="code">-fdbg-cnt-list</code><a class="copiable-link" href="#index-fdbg-cnt-list"> ¶</a></span> +</dt> <dd> +<p>Print the name and the counter upper bound for all debug counters. </p> </dd> <dt> +<span><code class="code">-fdbg-cnt=<var class="var">counter-value-list</var></code><a class="copiable-link" href="#index-fdbg-cnt"> ¶</a></span> +</dt> <dd> +<p>Set the internal debug counter lower and upper bound. <var class="var">counter-value-list</var> is a comma-separated list of <var class="var">name</var>:<var class="var">lower_bound1</var>-<var class="var">upper_bound1</var> [:<var class="var">lower_bound2</var>-<var class="var">upper_bound2</var>...] tuples which sets the name of the counter and list of closed intervals. The <var class="var">lower_bound</var> is optional and is zero initialized if not set. For example, with <samp class="option">-fdbg-cnt=dce:2-4:10-11,tail_call:10</samp>, <code class="code">dbg_cnt(dce)</code> returns true only for second, third, fourth, tenth and eleventh invocation. For <code class="code">dbg_cnt(tail_call)</code> true is returned for first 10 invocations. </p> </dd> <dt> +<span><code class="code">-print-file-name=<var class="var">library</var></code><a class="copiable-link" href="#index-print-file-name"> ¶</a></span> +</dt> <dd> +<p>Print the full absolute name of the library file <var class="var">library</var> that would be used when linking—and don’t do anything else. With this option, GCC does not compile or link anything; it just prints the file name. </p> </dd> <dt> +<span><code class="code">-print-multi-directory</code><a class="copiable-link" href="#index-print-multi-directory"> ¶</a></span> +</dt> <dd> +<p>Print the directory name corresponding to the multilib selected by any other switches present in the command line. This directory is supposed to exist in <code class="env">GCC_EXEC_PREFIX</code>. </p> </dd> <dt> +<span><code class="code">-print-multi-lib</code><a class="copiable-link" href="#index-print-multi-lib"> ¶</a></span> +</dt> <dd> +<p>Print the mapping from multilib directory names to compiler switches that enable them. The directory name is separated from the switches by ‘<samp class="samp">;</samp>’, and each switch starts with an ‘<samp class="samp">@</samp>’ instead of the ‘<samp class="samp">-</samp>’, without spaces between multiple switches. This is supposed to ease shell processing. </p> </dd> <dt> +<span><code class="code">-print-multi-os-directory</code><a class="copiable-link" href="#index-print-multi-os-directory"> ¶</a></span> +</dt> <dd> +<p>Print the path to OS libraries for the selected multilib, relative to some <samp class="file">lib</samp> subdirectory. If OS libraries are present in the <samp class="file">lib</samp> subdirectory and no multilibs are used, this is usually just <samp class="file">.</samp>, if OS libraries are present in <samp class="file">lib<var class="var">suffix</var></samp> sibling directories this prints e.g. <samp class="file">../lib64</samp>, <samp class="file">../lib</samp> or <samp class="file">../lib32</samp>, or if OS libraries are present in <samp class="file">lib/<var class="var">subdir</var></samp> subdirectories it prints e.g. <samp class="file">amd64</samp>, <samp class="file">sparcv9</samp> or <samp class="file">ev6</samp>. </p> </dd> <dt> +<span><code class="code">-print-multiarch</code><a class="copiable-link" href="#index-print-multiarch"> ¶</a></span> +</dt> <dd> +<p>Print the path to OS libraries for the selected multiarch, relative to some <samp class="file">lib</samp> subdirectory. </p> </dd> <dt> +<span><code class="code">-print-prog-name=<var class="var">program</var></code><a class="copiable-link" href="#index-print-prog-name"> ¶</a></span> +</dt> <dd> +<p>Like <samp class="option">-print-file-name</samp>, but searches for a program such as <code class="command">cpp</code>. </p> </dd> <dt> +<span><code class="code">-print-libgcc-file-name</code><a class="copiable-link" href="#index-print-libgcc-file-name"> ¶</a></span> +</dt> <dd> +<p>Same as <samp class="option">-print-file-name=libgcc.a</samp>. </p> <p>This is useful when you use <samp class="option">-nostdlib</samp> or <samp class="option">-nodefaultlibs</samp> but you do want to link with <samp class="file">libgcc.a</samp>. You can do: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">gcc -nostdlib <var class="var">files</var>… `gcc -print-libgcc-file-name`</pre> +</div> </dd> <dt> +<span><code class="code">-print-search-dirs</code><a class="copiable-link" href="#index-print-search-dirs"> ¶</a></span> +</dt> <dd> +<p>Print the name of the configured installation directory and a list of program and library directories <code class="command">gcc</code> searches—and don’t do anything else. </p> <p>This is useful when <code class="command">gcc</code> prints the error message ‘<samp class="samp">installation problem, cannot exec cpp0: No such file or directory</samp>’. To resolve this you either need to put <samp class="file">cpp0</samp> and the other compiler components where <code class="command">gcc</code> expects to find them, or you can set the environment variable <code class="env">GCC_EXEC_PREFIX</code> to the directory where you installed them. Don’t forget the trailing ‘<samp class="samp">/</samp>’. See <a class="xref" href="environment-variables">Environment Variables Affecting GCC</a>. </p> </dd> <dt> +<span><code class="code">-print-sysroot</code><a class="copiable-link" href="#index-print-sysroot"> ¶</a></span> +</dt> <dd> +<p>Print the target sysroot directory that is used during compilation. This is the target sysroot specified either at configure time or using the <samp class="option">--sysroot</samp> option, possibly with an extra suffix that depends on compilation options. If no target sysroot is specified, the option prints nothing. </p> </dd> <dt> +<span><code class="code">-print-sysroot-headers-suffix</code><a class="copiable-link" href="#index-print-sysroot-headers-suffix"> ¶</a></span> +</dt> <dd> +<p>Print the suffix added to the target sysroot when searching for headers, or give an error if the compiler is not configured with such a suffix—and don’t do anything else. </p> </dd> <dt> +<span><code class="code">-dumpmachine</code><a class="copiable-link" href="#index-dumpmachine"> ¶</a></span> +</dt> <dd> +<p>Print the compiler’s target machine (for example, ‘<samp class="samp">i686-pc-linux-gnu</samp>’)—and don’t do anything else. </p> </dd> <dt> +<span><code class="code">-dumpversion</code><a class="copiable-link" href="#index-dumpversion"> ¶</a></span> +</dt> <dd> +<p>Print the compiler version (for example, <code class="code">3.0</code>, <code class="code">6.3.0</code> or <code class="code">7</code>)—and don’t do anything else. This is the compiler version used in filesystem paths and specs. Depending on how the compiler has been configured it can be just a single number (major version), two numbers separated by a dot (major and minor version) or three numbers separated by dots (major, minor and patchlevel version). </p> </dd> <dt> +<span><code class="code">-dumpfullversion</code><a class="copiable-link" href="#index-dumpfullversion"> ¶</a></span> +</dt> <dd> +<p>Print the full compiler version—and don’t do anything else. The output is always three numbers separated by dots, major, minor and patchlevel version. </p> </dd> <dt> +<span><code class="code">-dumpspecs</code><a class="copiable-link" href="#index-dumpspecs"> ¶</a></span> +</dt> <dd><p>Print the compiler’s built-in specs—and don’t do anything else. (This is used when GCC itself is being built.) See <a class="xref" href="spec-files">Specifying Subprocesses and the Switches to Pass to Them</a>. </p></dd> </dl> </div> <div class="nav-panel"> <p> Next: <a href="submodel-options">Machine-Dependent Options</a>, Previous: <a href="code-gen-options">Options for Code Generation Conventions</a>, Up: <a href="invoking-gcc">GCC Command Options</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div><div class="_attribution"> + <p class="_attribution-p"> + © Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br> + <a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Developer-Options.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Developer-Options.html</a> + </p> +</div> |
