gcc: Developer Options
1
1 3.17 GCC Developer Options
1 ==========================
1
1 This section describes command-line options that are primarily of
1 interest to GCC developers, including options to support compiler
1 testing and investigation of compiler bugs and compile-time performance
1 problems. This includes options that produce debug dumps at various
1 points in the compilation; that print statistics such as memory use and
1 execution time; and that print information about GCC's configuration,
1 such as where it searches for libraries. You should rarely need to use
1 any of these options for ordinary compilation and linking tasks.
1
1 '-dLETTERS'
1 '-fdump-rtl-PASS'
1 '-fdump-rtl-PASS=FILENAME'
1 Says to make debugging dumps during compilation at times specified
1 by LETTERS. This is used for debugging the RTL-based passes of the
1 compiler. The file names for most of the dumps are made by
1 appending a pass number and a word to the DUMPNAME, and the files
1 are created in the directory of the output file. In case of
1 '=FILENAME' option, the dump is output on the given file instead of
1 the pass numbered dump files. Note that the pass number is
1 assigned as passes are registered into the pass manager. Most
1 passes are registered in the order that they will execute and for
1 these passes the number corresponds to the pass execution order.
1 However, passes registered by plugins, passes specific to
1 compilation targets, or passes that are otherwise registered after
1 all the other passes are numbered higher than a pass named "final",
1 even if they are executed earlier. DUMPNAME is generated from the
1 name of the output file if explicitly specified and not an
1 executable, otherwise it is the basename of the source file.
1
1 Some '-dLETTERS' switches have different meaning when '-E' is used
1 for preprocessing. ⇒Preprocessor Options, for information
1 about preprocessor-specific dump options.
1
1 Debug dumps can be enabled with a '-fdump-rtl' switch or some '-d'
1 option LETTERS. Here are the possible letters for use in PASS and
1 LETTERS, and their meanings:
1
1 '-fdump-rtl-alignments'
1 Dump after branch alignments have been computed.
1
1 '-fdump-rtl-asmcons'
1 Dump after fixing rtl statements that have unsatisfied in/out
1 constraints.
1
1 '-fdump-rtl-auto_inc_dec'
1 Dump after auto-inc-dec discovery. This pass is only run on
1 architectures that have auto inc or auto dec instructions.
1
1 '-fdump-rtl-barriers'
1 Dump after cleaning up the barrier instructions.
1
1 '-fdump-rtl-bbpart'
1 Dump after partitioning hot and cold basic blocks.
1
1 '-fdump-rtl-bbro'
1 Dump after block reordering.
1
1 '-fdump-rtl-btl1'
1 '-fdump-rtl-btl2'
1 '-fdump-rtl-btl1' and '-fdump-rtl-btl2' enable dumping after
1 the two branch target load optimization passes.
1
1 '-fdump-rtl-bypass'
1 Dump after jump bypassing and control flow optimizations.
1
1 '-fdump-rtl-combine'
1 Dump after the RTL instruction combination pass.
1
1 '-fdump-rtl-compgotos'
1 Dump after duplicating the computed gotos.
1
1 '-fdump-rtl-ce1'
1 '-fdump-rtl-ce2'
1 '-fdump-rtl-ce3'
1 '-fdump-rtl-ce1', '-fdump-rtl-ce2', and '-fdump-rtl-ce3'
1 enable dumping after the three if conversion passes.
1
1 '-fdump-rtl-cprop_hardreg'
1 Dump after hard register copy propagation.
1
1 '-fdump-rtl-csa'
1 Dump after combining stack adjustments.
1
1 '-fdump-rtl-cse1'
1 '-fdump-rtl-cse2'
1 '-fdump-rtl-cse1' and '-fdump-rtl-cse2' enable dumping after
1 the two common subexpression elimination passes.
1
1 '-fdump-rtl-dce'
1 Dump after the standalone dead code elimination passes.
1
1 '-fdump-rtl-dbr'
1 Dump after delayed branch scheduling.
1
1 '-fdump-rtl-dce1'
1 '-fdump-rtl-dce2'
1 '-fdump-rtl-dce1' and '-fdump-rtl-dce2' enable dumping after
1 the two dead store elimination passes.
1
1 '-fdump-rtl-eh'
1 Dump after finalization of EH handling code.
1
1 '-fdump-rtl-eh_ranges'
1 Dump after conversion of EH handling range regions.
1
1 '-fdump-rtl-expand'
1 Dump after RTL generation.
1
1 '-fdump-rtl-fwprop1'
1 '-fdump-rtl-fwprop2'
1 '-fdump-rtl-fwprop1' and '-fdump-rtl-fwprop2' enable dumping
1 after the two forward propagation passes.
1
1 '-fdump-rtl-gcse1'
1 '-fdump-rtl-gcse2'
1 '-fdump-rtl-gcse1' and '-fdump-rtl-gcse2' enable dumping after
1 global common subexpression elimination.
1
1 '-fdump-rtl-init-regs'
1 Dump after the initialization of the registers.
1
1 '-fdump-rtl-initvals'
1 Dump after the computation of the initial value sets.
1
1 '-fdump-rtl-into_cfglayout'
1 Dump after converting to cfglayout mode.
1
1 '-fdump-rtl-ira'
1 Dump after iterated register allocation.
1
1 '-fdump-rtl-jump'
1 Dump after the second jump optimization.
1
1 '-fdump-rtl-loop2'
1 '-fdump-rtl-loop2' enables dumping after the rtl loop
1 optimization passes.
1
1 '-fdump-rtl-mach'
1 Dump after performing the machine dependent reorganization
1 pass, if that pass exists.
1
1 '-fdump-rtl-mode_sw'
1 Dump after removing redundant mode switches.
1
1 '-fdump-rtl-rnreg'
1 Dump after register renumbering.
1
1 '-fdump-rtl-outof_cfglayout'
1 Dump after converting from cfglayout mode.
1
1 '-fdump-rtl-peephole2'
1 Dump after the peephole pass.
1
1 '-fdump-rtl-postreload'
1 Dump after post-reload optimizations.
1
1 '-fdump-rtl-pro_and_epilogue'
1 Dump after generating the function prologues and epilogues.
1
1 '-fdump-rtl-sched1'
1 '-fdump-rtl-sched2'
1 '-fdump-rtl-sched1' and '-fdump-rtl-sched2' enable dumping
1 after the basic block scheduling passes.
1
1 '-fdump-rtl-ree'
1 Dump after sign/zero extension elimination.
1
1 '-fdump-rtl-seqabstr'
1 Dump after common sequence discovery.
1
1 '-fdump-rtl-shorten'
1 Dump after shortening branches.
1
1 '-fdump-rtl-sibling'
1 Dump after sibling call optimizations.
1
1 '-fdump-rtl-split1'
1 '-fdump-rtl-split2'
1 '-fdump-rtl-split3'
1 '-fdump-rtl-split4'
1 '-fdump-rtl-split5'
1 These options enable dumping after five rounds of instruction
1 splitting.
1
1 '-fdump-rtl-sms'
1 Dump after modulo scheduling. This pass is only run on some
1 architectures.
1
1 '-fdump-rtl-stack'
1 Dump after conversion from GCC's "flat register file"
1 registers to the x87's stack-like registers. This pass is
1 only run on x86 variants.
1
1 '-fdump-rtl-subreg1'
1 '-fdump-rtl-subreg2'
1 '-fdump-rtl-subreg1' and '-fdump-rtl-subreg2' enable dumping
1 after the two subreg expansion passes.
1
1 '-fdump-rtl-unshare'
1 Dump after all rtl has been unshared.
1
1 '-fdump-rtl-vartrack'
1 Dump after variable tracking.
1
1 '-fdump-rtl-vregs'
1 Dump after converting virtual registers to hard registers.
1
1 '-fdump-rtl-web'
1 Dump after live range splitting.
1
1 '-fdump-rtl-regclass'
1 '-fdump-rtl-subregs_of_mode_init'
1 '-fdump-rtl-subregs_of_mode_finish'
1 '-fdump-rtl-dfinit'
1 '-fdump-rtl-dfinish'
1 These dumps are defined but always produce empty files.
1
1 '-da'
1 '-fdump-rtl-all'
1 Produce all the dumps listed above.
1
1 '-dA'
1 Annotate the assembler output with miscellaneous debugging
1 information.
1
1 '-dD'
1 Dump all macro definitions, at the end of preprocessing, in
1 addition to normal output.
1
1 '-dH'
1 Produce a core dump whenever an error occurs.
1
1 '-dp'
1 Annotate the assembler output with a comment indicating which
1 pattern and alternative is used. The length and cost of each
1 instruction are also printed.
1
1 '-dP'
1 Dump the RTL in the assembler output as a comment before each
1 instruction. Also turns on '-dp' annotation.
1
1 '-dx'
1 Just generate RTL for a function instead of compiling it.
1 Usually used with '-fdump-rtl-expand'.
1
1 '-fdump-noaddr'
1 When doing debugging dumps, suppress address output. This makes it
1 more feasible to use diff on debugging dumps for compiler
1 invocations with different compiler binaries and/or different text
1 / bss / data / heap / stack / dso start locations.
1
1 '-freport-bug'
1 Collect and dump debug information into a temporary file if an
1 internal compiler error (ICE) occurs.
1
1 '-fdump-unnumbered'
1 When doing debugging dumps, suppress instruction numbers and
1 address output. This makes it more feasible to use diff on
1 debugging dumps for compiler invocations with different options, in
1 particular with and without '-g'.
1
1 '-fdump-unnumbered-links'
1 When doing debugging dumps (see '-d' option above), suppress
1 instruction numbers for the links to the previous and next
1 instructions in a sequence.
1
1 '-fdump-ipa-SWITCH'
1 Control the dumping at various stages of inter-procedural analysis
1 language tree to a file. The file name is generated by appending a
1 switch specific suffix to the source file name, and the file is
1 created in the same directory as the output file. The following
1 dumps are possible:
1
1 'all'
1 Enables all inter-procedural analysis dumps.
1
1 'cgraph'
1 Dumps information about call-graph optimization, unused
1 function removal, and inlining decisions.
1
1 'inline'
1 Dump after function inlining.
1
1 '-fdump-lang-all'
1 '-fdump-lang-SWITCH'
1 '-fdump-lang-SWITCH-OPTIONS'
1 '-fdump-lang-SWITCH-OPTIONS=FILENAME'
1 Control the dumping of language-specific information. The OPTIONS
1 and FILENAME portions behave as described in the '-fdump-tree'
1 option. The following SWITCH values are accepted:
1
1 'all'
1
1 Enable all language-specific dumps.
1
1 'class'
1 Dump class hierarchy information. Virtual table information
1 is emitted unless ''slim'' is specified. This option is
1 applicable to C++ only.
1
1 'raw'
1 Dump the raw internal tree data. This option is applicable to
1 C++ only.
1
1 '-fdump-passes'
1 Print on 'stderr' the list of optimization passes that are turned
1 on and off by the current command-line options.
1
1 '-fdump-statistics-OPTION'
1 Enable and control dumping of pass statistics in a separate file.
1 The file name is generated by appending a suffix ending in
1 '.statistics' to the source file name, and the file is created in
1 the same directory as the output file. If the '-OPTION' form is
1 used, '-stats' causes counters to be summed over the whole
1 compilation unit while '-details' dumps every event as the passes
1 generate them. The default with no option is to sum counters for
1 each function compiled.
1
1 '-fdump-tree-all'
1 '-fdump-tree-SWITCH'
1 '-fdump-tree-SWITCH-OPTIONS'
1 '-fdump-tree-SWITCH-OPTIONS=FILENAME'
1 Control the dumping at various stages of processing the
1 intermediate language tree to a file. The file name is generated
1 by appending a switch-specific suffix to the source file name, and
1 the file is created in the same directory as the output file. In
1 case of '=FILENAME' option, the dump is output on the given file
1 instead of the auto named dump files. If the '-OPTIONS' form is
1 used, OPTIONS is a list of '-' separated options which control the
1 details of the dump. Not all options are applicable to all dumps;
1 those that are not meaningful are ignored. The following options
1 are available
1
1 'address'
1 Print the address of each node. Usually this is not
1 meaningful as it changes according to the environment and
1 source file. Its primary use is for tying up a dump file with
1 a debug environment.
1 'asmname'
1 If 'DECL_ASSEMBLER_NAME' has been set for a given decl, use
1 that in the dump instead of 'DECL_NAME'. Its primary use is
1 ease of use working backward from mangled names in the
1 assembly file.
1 'slim'
1 When dumping front-end intermediate representations, inhibit
1 dumping of members of a scope or body of a function merely
1 because that scope has been reached. Only dump such items
1 when they are directly reachable by some other path.
1
1 When dumping pretty-printed trees, this option inhibits
1 dumping the bodies of control structures.
1
1 When dumping RTL, print the RTL in slim (condensed) form
1 instead of the default LISP-like representation.
1 'raw'
1 Print a raw representation of the tree. By default, trees are
1 pretty-printed into a C-like representation.
1 'details'
1 Enable more detailed dumps (not honored by every dump option).
1 Also include information from the optimization passes.
1 'stats'
1 Enable dumping various statistics about the pass (not honored
1 by every dump option).
1 'blocks'
1 Enable showing basic block boundaries (disabled in raw dumps).
1 'graph'
1 For each of the other indicated dump files
1 ('-fdump-rtl-PASS'), dump a representation of the control flow
1 graph suitable for viewing with GraphViz to
1 'FILE.PASSID.PASS.dot'. Each function in the file is
1 pretty-printed as a subgraph, so that GraphViz can render them
1 all in a single plot.
1
1 This option currently only works for RTL dumps, and the RTL is
1 always dumped in slim form.
1 'vops'
1 Enable showing virtual operands for every statement.
1 'lineno'
1 Enable showing line numbers for statements.
1 'uid'
1 Enable showing the unique ID ('DECL_UID') for each variable.
1 'verbose'
1 Enable showing the tree dump for each statement.
1 'eh'
1 Enable showing the EH region number holding each statement.
1 'scev'
1 Enable showing scalar evolution analysis details.
1 'optimized'
1 Enable showing optimization information (only available in
1 certain passes).
1 'missed'
1 Enable showing missed optimization information (only available
1 in certain passes).
1 'note'
1 Enable other detailed optimization information (only available
1 in certain passes).
1 '=FILENAME'
1 Instead of an auto named dump file, output into the given file
1 name. The file names 'stdout' and 'stderr' are treated
1 specially and are considered already open standard streams.
1 For example,
1
1 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
1 -fdump-tree-pre=/dev/stderr file.c
1
1 outputs vectorizer dump into 'foo.dump', while the PRE dump is
1 output on to 'stderr'. If two conflicting dump filenames are
1 given for the same pass, then the latter option overrides the
1 earlier one.
1
1 'all'
1 Turn on all options, except 'raw', 'slim', 'verbose' and
1 'lineno'.
1
1 'optall'
1 Turn on all optimization options, i.e., 'optimized', 'missed',
1 and 'note'.
1
1 To determine what tree dumps are available or find the dump for a
1 pass of interest follow the steps below.
1
1 1. Invoke GCC with '-fdump-passes' and in the 'stderr' output
1 look for a code that corresponds to the pass you are
1 interested in. For example, the codes 'tree-evrp',
1 'tree-vrp1', and 'tree-vrp2' correspond to the three Value
1 Range Propagation passes. The number at the end distinguishes
1 distinct invocations of the same pass.
1 2. To enable the creation of the dump file, append the pass code
1 to the '-fdump-' option prefix and invoke GCC with it. For
1 example, to enable the dump from the Early Value Range
1 Propagation pass, invoke GCC with the '-fdump-tree-evrp'
1 option. Optionally, you may specify the name of the dump
1 file. If you don't specify one, GCC creates as described
1 below.
1 3. Find the pass dump in a file whose name is composed of three
1 components separated by a period: the name of the source file
1 GCC was invoked to compile, a numeric suffix indicating the
1 pass number followed by the letter 't' for tree passes (and
1 the letter 'r' for RTL passes), and finally the pass code.
1 For example, the Early VRP pass dump might be in a file named
1 'myfile.c.038t.evrp' in the current working directory. Note
1 that the numeric codes are not stable and may change from one
1 version of GCC to another.
1
1 '-fopt-info'
1 '-fopt-info-OPTIONS'
1 '-fopt-info-OPTIONS=FILENAME'
1 Controls optimization dumps from various optimization passes. If
1 the '-OPTIONS' form is used, OPTIONS is a list of '-' separated
1 option keywords to select the dump details and optimizations.
1
1 The OPTIONS can be divided into two groups: options describing the
1 verbosity of the dump, and options describing which optimizations
1 should be included. The options from both the groups can be freely
1 mixed as they are non-overlapping. However, in case of any
1 conflicts, the later options override the earlier options on the
1 command line.
1
1 The following options control the dump verbosity:
1
1 'optimized'
1 Print information when an optimization is successfully
1 applied. It is up to a pass to decide which information is
1 relevant. For example, the vectorizer passes print the source
1 location of loops which are successfully vectorized.
1 'missed'
1 Print information about missed optimizations. Individual
1 passes control which information to include in the output.
1 'note'
1 Print verbose information about optimizations, such as certain
1 transformations, more detailed messages about decisions etc.
1 'all'
1 Print detailed optimization information. This includes
1 'optimized', 'missed', and 'note'.
1
1 One or more of the following option keywords can be used to
1 describe a group of optimizations:
1
1 'ipa'
1 Enable dumps from all interprocedural optimizations.
1 'loop'
1 Enable dumps from all loop optimizations.
1 'inline'
1 Enable dumps from all inlining optimizations.
1 'omp'
1 Enable dumps from all OMP (Offloading and Multi Processing)
1 optimizations.
1 'vec'
1 Enable dumps from all vectorization optimizations.
1 'optall'
1 Enable dumps from all optimizations. This is a superset of
1 the optimization groups listed above.
1
1 If OPTIONS is omitted, it defaults to 'optimized-optall', which
1 means to dump all info about successful optimizations from all the
1 passes.
1
1 If the FILENAME is provided, then the dumps from all the applicable
1 optimizations are concatenated into the FILENAME. Otherwise the
1 dump is output onto 'stderr'. Though multiple '-fopt-info' options
1 are accepted, only one of them can include a FILENAME. If other
1 filenames are provided then all but the first such option are
1 ignored.
1
1 Note that the output FILENAME is overwritten in case of multiple
1 translation units. If a combined output from multiple translation
1 units is desired, 'stderr' should be used instead.
1
1 In the following example, the optimization info is output to
1 'stderr':
1
1 gcc -O3 -fopt-info
1
1 This example:
1 gcc -O3 -fopt-info-missed=missed.all
1
1 outputs missed optimization report from all the passes into
1 'missed.all', and this one:
1
1 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
1
1 prints information about missed optimization opportunities from
1 vectorization passes on 'stderr'. Note that
1 '-fopt-info-vec-missed' is equivalent to '-fopt-info-missed-vec'.
1 The order of the optimization group names and message types listed
1 after '-fopt-info' does not matter.
1
1 As another example,
1 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
1
1 outputs information about missed optimizations as well as optimized
1 locations from all the inlining passes into 'inline.txt'.
1
1 Finally, consider:
1
1 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
1
1 Here the two output filenames 'vec.miss' and 'loop.opt' are in
1 conflict since only one output file is allowed. In this case, only
1 the first option takes effect and the subsequent options are
1 ignored. Thus only 'vec.miss' is produced which contains dumps
1 from the vectorizer about missed opportunities.
1
1 '-fsched-verbose=N'
1 On targets that use instruction scheduling, this option controls
1 the amount of debugging output the scheduler prints to the dump
1 files.
1
1 For N greater than zero, '-fsched-verbose' outputs the same
1 information as '-fdump-rtl-sched1' and '-fdump-rtl-sched2'. For N
1 greater than one, it also output basic block probabilities,
1 detailed ready list information and unit/insn info. For N greater
1 than two, it includes RTL at abort point, control-flow and regions
1 info. And for N over four, '-fsched-verbose' also includes
1 dependence info.
1
1 '-fenable-KIND-PASS'
1 '-fdisable-KIND-PASS=RANGE-LIST'
1
1 This is a set of options that are used to explicitly disable/enable
1 optimization passes. These options are intended for use for
1 debugging GCC. Compiler users should use regular options for
1 enabling/disabling passes instead.
1
1 '-fdisable-ipa-PASS'
1 Disable IPA pass PASS. PASS is the pass name. If the same
1 pass is statically invoked in the compiler multiple times, the
1 pass name should be appended with a sequential number starting
1 from 1.
1
1 '-fdisable-rtl-PASS'
1 '-fdisable-rtl-PASS=RANGE-LIST'
1 Disable RTL pass PASS. PASS is the pass name. If the same
1 pass is statically invoked in the compiler multiple times, the
1 pass name should be appended with a sequential number starting
1 from 1. RANGE-LIST is a comma-separated list of function
1 ranges or assembler names. Each range is a number pair
1 separated by a colon. The range is inclusive in both ends.
1 If the range is trivial, the number pair can be simplified as
1 a single number. If the function's call graph node's UID
1 falls within one of the specified ranges, the PASS is disabled
1 for that function. The UID is shown in the function header of
1 a dump file, and the pass names can be dumped by using option
1 '-fdump-passes'.
1
1 '-fdisable-tree-PASS'
1 '-fdisable-tree-PASS=RANGE-LIST'
1 Disable tree pass PASS. See '-fdisable-rtl' for the
1 description of option arguments.
1
1 '-fenable-ipa-PASS'
1 Enable IPA pass PASS. PASS is the pass name. If the same
1 pass is statically invoked in the compiler multiple times, the
1 pass name should be appended with a sequential number starting
1 from 1.
1
1 '-fenable-rtl-PASS'
1 '-fenable-rtl-PASS=RANGE-LIST'
1 Enable RTL pass PASS. See '-fdisable-rtl' for option argument
1 description and examples.
1
1 '-fenable-tree-PASS'
1 '-fenable-tree-PASS=RANGE-LIST'
1 Enable tree pass PASS. See '-fdisable-rtl' for the
1 description of option arguments.
1
1 Here are some examples showing uses of these options.
1
1
1 # disable ccp1 for all functions
1 -fdisable-tree-ccp1
1 # disable complete unroll for function whose cgraph node uid is 1
1 -fenable-tree-cunroll=1
1 # disable gcse2 for functions at the following ranges [1,1],
1 # [300,400], and [400,1000]
1 # disable gcse2 for functions foo and foo2
1 -fdisable-rtl-gcse2=foo,foo2
1 # disable early inlining
1 -fdisable-tree-einline
1 # disable ipa inlining
1 -fdisable-ipa-inline
1 # enable tree full unroll
1 -fenable-tree-unroll
1
1
1 '-fchecking'
1 '-fchecking=N'
1 Enable internal consistency checking. The default depends on the
1 compiler configuration. '-fchecking=2' enables further internal
1 consistency checking that might affect code generation.
1
1 '-frandom-seed=STRING'
1 This option provides a seed that GCC uses in place of random
1 numbers in generating certain symbol names that have to be
1 different in every compiled file. It is also used to place unique
1 stamps in coverage data files and the object files that produce
1 them. You can use the '-frandom-seed' option to produce
1 reproducibly identical object files.
1
1 The STRING can either be a number (decimal, octal or hex) or an
1 arbitrary string (in which case it's converted to a number by
1 computing CRC32).
1
1 The STRING should be different for every file you compile.
1
1 '-save-temps'
1 '-save-temps=cwd'
1 Store the usual "temporary" intermediate files permanently; place
1 them in the current directory and name them based on the source
1 file. Thus, compiling 'foo.c' with '-c -save-temps' produces files
1 'foo.i' and 'foo.s', as well as 'foo.o'. This creates a
1 preprocessed 'foo.i' output file even though the compiler now
1 normally uses an integrated preprocessor.
1
1 When used in combination with the '-x' command-line option,
1 '-save-temps' is sensible enough to avoid over writing an input
1 source file with the same extension as an intermediate file. The
1 corresponding intermediate file may be obtained by renaming the
1 source file before using '-save-temps'.
1
1 If you invoke GCC in parallel, compiling several different source
1 files that share a common base name in different subdirectories or
1 the same source file compiled for multiple output destinations, it
1 is likely that the different parallel compilers will interfere with
1 each other, and overwrite the temporary files. For instance:
1
1 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
1 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
1
1 may result in 'foo.i' and 'foo.o' being written to simultaneously
1 by both compilers.
1
1 '-save-temps=obj'
1 Store the usual "temporary" intermediate files permanently. If the
1 '-o' option is used, the temporary files are based on the object
1 file. If the '-o' option is not used, the '-save-temps=obj' switch
1 behaves like '-save-temps'.
1
1 For example:
1
1 gcc -save-temps=obj -c foo.c
1 gcc -save-temps=obj -c bar.c -o dir/xbar.o
1 gcc -save-temps=obj foobar.c -o dir2/yfoobar
1
1 creates 'foo.i', 'foo.s', 'dir/xbar.i', 'dir/xbar.s',
1 'dir2/yfoobar.i', 'dir2/yfoobar.s', and 'dir2/yfoobar.o'.
1
1 '-time[=FILE]'
1 Report the CPU time taken by each subprocess in the compilation
1 sequence. For C source files, this is the compiler proper and
1 assembler (plus the linker if linking is done).
1
1 Without the specification of an output file, the output looks like
1 this:
1
1 # cc1 0.12 0.01
1 # as 0.00 0.01
1
1 The first number on each line is the "user time", that is time
1 spent executing the program itself. The second number is "system
1 time", time spent executing operating system routines on behalf of
1 the program. Both numbers are in seconds.
1
1 With the specification of an output file, the output is appended to
1 the named file, and it looks like this:
1
1 0.12 0.01 cc1 OPTIONS
1 0.00 0.01 as OPTIONS
1
1 The "user time" and the "system time" are moved before the program
1 name, and the options passed to the program are displayed, so that
1 one can later tell what file was being compiled, and with which
1 options.
1
1 '-fdump-final-insns[=FILE]'
1 Dump the final internal representation (RTL) to FILE. If the
1 optional argument is omitted (or if FILE is '.'), the name of the
1 dump file is determined by appending '.gkd' to the compilation
1 output file name.
1
1 '-fcompare-debug[=OPTS]'
1 If no error occurs during compilation, run the compiler a second
1 time, adding OPTS and '-fcompare-debug-second' to the arguments
1 passed to the second compilation. Dump the final internal
1 representation in both compilations, and print an error if they
1 differ.
1
1 If the equal sign is omitted, the default '-gtoggle' is used.
1
1 The environment variable 'GCC_COMPARE_DEBUG', if defined, non-empty
1 and nonzero, implicitly enables '-fcompare-debug'. If
1 'GCC_COMPARE_DEBUG' is defined to a string starting with a dash,
1 then it is used for OPTS, otherwise the default '-gtoggle' is used.
1
1 '-fcompare-debug=', with the equal sign but without OPTS, is
1 equivalent to '-fno-compare-debug', which disables the dumping of
1 the final representation and the second compilation, preventing
1 even 'GCC_COMPARE_DEBUG' from taking effect.
1
1 To verify full coverage during '-fcompare-debug' testing, set
1 'GCC_COMPARE_DEBUG' to say '-fcompare-debug-not-overridden', which
1 GCC rejects as an invalid option in any actual compilation (rather
1 than preprocessing, assembly or linking). To get just a warning,
1 setting 'GCC_COMPARE_DEBUG' to '-w%n-fcompare-debug not overridden'
1 will do.
1
1 '-fcompare-debug-second'
1 This option is implicitly passed to the compiler for the second
1 compilation requested by '-fcompare-debug', along with options to
1 silence warnings, and omitting other options that would cause the
1 compiler to produce output to files or to standard output as a side
1 effect. Dump files and preserved temporary files are renamed so as
1 to contain the '.gk' additional extension during the second
1 compilation, to avoid overwriting those generated by the first.
1
1 When this option is passed to the compiler driver, it causes the
1 _first_ compilation to be skipped, which makes it useful for little
1 other than debugging the compiler proper.
1
1 '-gtoggle'
1 Turn off generation of debug info, if leaving out this option
1 generates it, or turn it on at level 2 otherwise. The position of
1 this argument in the command line does not matter; it takes effect
1 after all other options are processed, and it does so only once, no
1 matter how many times it is given. This is mainly intended to be
1 used with '-fcompare-debug'.
1
1 '-fvar-tracking-assignments-toggle'
1 Toggle '-fvar-tracking-assignments', in the same way that
1 '-gtoggle' toggles '-g'.
1
1 '-Q'
1 Makes the compiler print out each function name as it is compiled,
1 and print some statistics about each pass when it finishes.
1
1 '-ftime-report'
1 Makes the compiler print some statistics about the time consumed by
1 each pass when it finishes.
1
1 '-ftime-report-details'
1 Record the time consumed by infrastructure parts separately for
1 each pass.
1
1 '-fira-verbose=N'
1 Control the verbosity of the dump file for the integrated register
1 allocator. The default value is 5. If the value N is greater or
1 equal to 10, the dump output is sent to stderr using the same
1 format as N minus 10.
1
1 '-flto-report'
1 Prints a report with internal details on the workings of the
1 link-time optimizer. The contents of this report vary from version
1 to version. It is meant to be useful to GCC developers when
1 processing object files in LTO mode (via '-flto').
1
1 Disabled by default.
1
1 '-flto-report-wpa'
1 Like '-flto-report', but only print for the WPA phase of Link Time
1 Optimization.
1
1 '-fmem-report'
1 Makes the compiler print some statistics about permanent memory
1 allocation when it finishes.
1
1 '-fmem-report-wpa'
1 Makes the compiler print some statistics about permanent memory
1 allocation for the WPA phase only.
1
1 '-fpre-ipa-mem-report'
1 '-fpost-ipa-mem-report'
1 Makes the compiler print some statistics about permanent memory
1 allocation before or after interprocedural optimization.
1
1 '-fprofile-report'
1 Makes the compiler print some statistics about consistency of the
1 (estimated) profile and effect of individual passes.
1
1 '-fstack-usage'
1 Makes the compiler output stack usage information for the program,
1 on a per-function basis. The filename for the dump is made by
1 appending '.su' to the AUXNAME. AUXNAME is generated from the name
1 of the output file, if explicitly specified and it is not an
1 executable, otherwise it is the basename of the source file. An
1 entry is made up of three fields:
1
1 * The name of the function.
1 * A number of bytes.
1 * One or more qualifiers: 'static', 'dynamic', 'bounded'.
1
1 The qualifier 'static' means that the function manipulates the
1 stack statically: a fixed number of bytes are allocated for the
1 frame on function entry and released on function exit; no stack
1 adjustments are otherwise made in the function. The second field
1 is this fixed number of bytes.
1
1 The qualifier 'dynamic' means that the function manipulates the
1 stack dynamically: in addition to the static allocation described
1 above, stack adjustments are made in the body of the function, for
1 example to push/pop arguments around function calls. If the
1 qualifier 'bounded' is also present, the amount of these
1 adjustments is bounded at compile time and the second field is an
1 upper bound of the total amount of stack used by the function. If
1 it is not present, the amount of these adjustments is not bounded
1 at compile time and the second field only represents the bounded
1 part.
1
1 '-fstats'
1 Emit statistics about front-end processing at the end of the
1 compilation. This option is supported only by the C++ front end,
1 and the information is generally only useful to the G++ development
1 team.
1
1 '-fdbg-cnt-list'
1 Print the name and the counter upper bound for all debug counters.
1
1 '-fdbg-cnt=COUNTER-VALUE-LIST'
1 Set the internal debug counter upper bound. COUNTER-VALUE-LIST is
1 a comma-separated list of NAME:VALUE pairs which sets the upper
1 bound of each debug counter NAME to VALUE. All debug counters have
1 the initial upper bound of 'UINT_MAX'; thus 'dbg_cnt' returns true
1 always unless the upper bound is set by this option. For example,
1 with '-fdbg-cnt=dce:10,tail_call:0', 'dbg_cnt(dce)' returns true
1 only for first 10 invocations.
1
1 '-print-file-name=LIBRARY'
1 Print the full absolute name of the library file LIBRARY that would
1 be used when linking--and don't do anything else. With this
1 option, GCC does not compile or link anything; it just prints the
1 file name.
1
1 '-print-multi-directory'
1 Print the directory name corresponding to the multilib selected by
1 any other switches present in the command line. This directory is
1 supposed to exist in 'GCC_EXEC_PREFIX'.
1
1 '-print-multi-lib'
1 Print the mapping from multilib directory names to compiler
1 switches that enable them. The directory name is separated from
1 the switches by ';', and each switch starts with an '@' instead of
1 the '-', without spaces between multiple switches. This is
1 supposed to ease shell processing.
1
1 '-print-multi-os-directory'
1 Print the path to OS libraries for the selected multilib, relative
1 to some 'lib' subdirectory. If OS libraries are present in the
1 'lib' subdirectory and no multilibs are used, this is usually just
1 '.', if OS libraries are present in 'libSUFFIX' sibling directories
1 this prints e.g. '../lib64', '../lib' or '../lib32', or if OS
1 libraries are present in 'lib/SUBDIR' subdirectories it prints e.g.
1 'amd64', 'sparcv9' or 'ev6'.
1
1 '-print-multiarch'
1 Print the path to OS libraries for the selected multiarch, relative
1 to some 'lib' subdirectory.
1
1 '-print-prog-name=PROGRAM'
1 Like '-print-file-name', but searches for a program such as 'cpp'.
1
1 '-print-libgcc-file-name'
1 Same as '-print-file-name=libgcc.a'.
1
1 This is useful when you use '-nostdlib' or '-nodefaultlibs' but you
1 do want to link with 'libgcc.a'. You can do:
1
1 gcc -nostdlib FILES... `gcc -print-libgcc-file-name`
1
1 '-print-search-dirs'
1 Print the name of the configured installation directory and a list
1 of program and library directories 'gcc' searches--and don't do
1 anything else.
1
1 This is useful when 'gcc' prints the error message 'installation
1 problem, cannot exec cpp0: No such file or directory'. To resolve
1 this you either need to put 'cpp0' and the other compiler
1 components where 'gcc' expects to find them, or you can set the
1 environment variable 'GCC_EXEC_PREFIX' to the directory where you
11 installed them. Don't forget the trailing '/'. ⇒Environment
Variables.
1
1 '-print-sysroot'
1 Print the target sysroot directory that is used during compilation.
1 This is the target sysroot specified either at configure time or
1 using the '--sysroot' option, possibly with an extra suffix that
1 depends on compilation options. If no target sysroot is specified,
1 the option prints nothing.
1
1 '-print-sysroot-headers-suffix'
1 Print the suffix added to the target sysroot when searching for
1 headers, or give an error if the compiler is not configured with
1 such a suffix--and don't do anything else.
1
1 '-dumpmachine'
1 Print the compiler's target machine (for example,
1 'i686-pc-linux-gnu')--and don't do anything else.
1
1 '-dumpversion'
1 Print the compiler version (for example, '3.0', '6.3.0' or
1 '7')--and don't do anything else. This is the compiler version
1 used in filesystem paths, specs, can be depending on how the
1 compiler has been configured just a single number (major version),
1 two numbers separated by dot (major and minor version) or three
1 numbers separated by dots (major, minor and patchlevel version).
1
1 '-dumpfullversion'
1 Print the full compiler version, always 3 numbers separated by
1 dots, major, minor and patchlevel version.
1
1 '-dumpspecs'
1 Print the compiler's built-in specs--and don't do anything else.
1 (This is used when GCC itself is being built.) ⇒Spec Files.
1