diff options
Diffstat (limited to 'gcc/doc/invoke.texi')
-rw-r--r-- | gcc/doc/invoke.texi | 298 |
1 files changed, 292 insertions, 6 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index ff1e34a3b34..3144fd1fcb4 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -245,11 +245,24 @@ in the following sections. @gccoptlist{-d@var{letters} -dumpspecs -dumpmachine -dumpversion @gol -fdump-unnumbered -fdump-translation-unit@r{[}-@var{n}@r{]} @gol -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol +-fdump-tree-all @gol -fdump-tree-original@r{[}-@var{n}@r{]} @gol -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol +-fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol +-fdump-tree-ch @gol +-fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol +-fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol +-fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol +-fdump-tree-dom@r{[}-@var{n}@r{]} @gol +-fdump-tree-dse@r{[}-@var{n}@r{]} @gol +-fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol +-fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol +-fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol +-fdump-tree-nrv @gol +-fdump-tree-sra@r{[}-@var{n}@r{]} @gol -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol --feliminate-unused-debug-symbols -fmem-report -fprofile-arcs @gol +-feliminate-unused-debug-symbols -fmem-report -fprofile-arcs -ftree-based-profiling @gol -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol -ftest-coverage -ftime-report -fvar-tracking @gol -g -g@var{level} -gcoff -gdwarf-2 @gol @@ -263,6 +276,7 @@ in the following sections. @xref{Optimize Options,,Options that Control Optimization}. @gccoptlist{-falign-functions=@var{n} -falign-jumps=@var{n} @gol -falign-labels=@var{n} -falign-loops=@var{n} @gol +-fbounds-check -fmudflap -fmudflapth -fmudflapir @gol -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol -fcaller-saves -fcprop-registers @gol @@ -296,6 +310,9 @@ in the following sections. -fstrength-reduce -fstrict-aliasing -ftracer -fthread-jumps @gol -funroll-all-loops -funroll-loops -fpeel-loops @gol -funswitch-loops -fold-unroll-loops -fold-unroll-all-loops @gol +-ftree-pre -ftree-ccp -ftree-dce @gol +-ftree-dominator-opts -ftree-dse -ftree-copyrename @gol +-ftree-ch -ftree-sra -ftree-ter -ftree-lrs @gol --param @var{name}=@var{value} -O -O0 -O1 -O2 -O3 -Os} @@ -754,6 +771,10 @@ preprocessor). Fortran source code which must be preprocessed with a RATFOR preprocessor (not included with GCC)@. +@item @var{file}.f90 +@itemx @var{file}.f95 +Fortran 90/95 source code which should not be preprocessed. + @xref{Overall Options,,Options Controlling the Kind of Output, g77, Using and Porting GNU Fortran}, for more details of the handling of Fortran input files. @@ -807,6 +828,7 @@ objective-c objective-c-header objc-cpp-output assembler assembler-with-cpp ada f77 f77-cpp-input ratfor +f95 java treelang @end smallexample @@ -3214,6 +3236,17 @@ executed. When an arc is the only exit or only entrance to a block, the instrumentation code can be added to the block; otherwise, a new basic block must be created to hold the instrumentation code. +@item -ftree-based-profiling +@opindex ftree-based-profiling +This option is used in addition to @option{-fprofile-arcs} or +@option{-fbranch-probabilities} to control whether those optimizations +are performed on a tree-based or rtl-based internal representation. +If you use this option when compiling with @option{-fprofile-arcs}, +you must also use it when compiling later with @option{-fbranch-probabilities}. +Currently the tree-based optimization is in an early stage of +development, and this option is recommended only for those people +working on improving it. + @need 2000 @item -ftest-coverage @opindex ftest-coverage @@ -3409,8 +3442,8 @@ to the source file name. If the @samp{-@var{options}} form is used, @var{options} controls the details of the dump as described for the @option{-fdump-tree} options. -@item -fdump-tree-@var{switch} @r{(C++ only)} -@itemx -fdump-tree-@var{switch}-@var{options} @r{(C++ only)} +@item -fdump-tree-@var{switch} @r{(C and C++ only)} +@itemx -fdump-tree-@var{switch}-@var{options} @r{(C and C++ only)} @opindex fdump-tree Control the dumping at various stages of processing the intermediate language tree to a file. The file name is generated by appending a switch @@ -3427,20 +3460,133 @@ changes according to the environment and source file. Its primary use is for tying up a dump file with a debug environment. @item slim 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. +because that scope has been reached. Only dump such items when they +are directly reachable by some other path. When dumping pretty-printed +trees, this option inhibits dumping the bodies of control structures. +@item raw +Print a raw representation of the tree. By default, trees are +pretty-printed into a C-like representation. +@item details +Enable more detailed dumps (not honored by every dump option). +@item stats +Enable dumping various statistics about the pass (not honored by every dump +option). +@item blocks +Enable showing basic block boundaries (disabled in raw dumps). +@item vops +Enable showing virtual operands for every statement. +@item lineno +Enable showing line numbers for statements. +@item uid +Enable showing the unique ID (@code{DECL_UID}) for each variable. @item all -Turn on all options. +Turn on all options, except @option{raw}, @option{slim} and @option{lineno}. @end table The following tree dumps are possible: @table @samp + @item original Dump before any tree based optimization, to @file{@var{file}.original}. + @item optimized Dump after all tree based optimization, to @file{@var{file}.optimized}. + @item inlined Dump after function inlining, to @file{@var{file}.inlined}. + +@item gimple +@opindex fdump-tree-gimple +Dump each function before and after the gimplification pass to a file. The +file name is made by appending @file{.gimple} to the source file name. + +@item cfg +@opindex fdump-tree-cfg +Dump the control flow graph of each function to a file. The file name is +made by appending @file{.cfg} to the source file name. + +@item vcg +@opindex fdump-tree-vcg +Dump the control flow graph of each function to a file in VCG format. The +file name is made by appending @file{.vcg} to the source file name. Note +that if the file contains more than one function, the generated file cannot +be used directly by VCG. You will need to cut and paste each function's +graph into its own separate file first. + +@item ch +@opindex fdump-tree-ch +Dump each function after copying loop headers. The file name is made by +appending @file{.ch} to the source file name. + +@item ssa +@opindex fdump-tree-ssa +Dump SSA related information to a file. The file name is made by appending +@file{.ssa} to the source file name. + +@item alias +@opindex fdump-tree-alias +Dump aliasing information for each function. The file name is made by +appending @file{.alias} to the source file name. + +@item ccp +@opindex fdump-tree-ccp +Dump each function after CCP. The file name is made by appending +@file{.ccp} to the source file name. + +@item pre +@opindex fdump-tree-pre +Dump trees after partial redundancy elimination. The file name is made +by appending @file{.pre} to the source file name. + +@item dce +@opindex fdump-tree-dce +Dump each function after dead code elimination. The file name is made by +appending @file{.dce} to the source file name. + +@item mudflap +@opindex fdump-tree-mudflap +Dump each function after adding mudflap instrumentation. The file name is +made by appending @file{.mudflap} to the source file name. + +@item sra +@opindex fdump-tree-sra +Dump each function after performing scalar replacement of aggregates. The +file name is made by appending @file{.sra} to the source file name. + +@item dom +@opindex fdump-tree-dom +Dump each function after applying dominator tree optimizations. The file +name is made by appending @file{.dom} to the source file name. + +@item dse +@opindex fdump-tree-dse +Dump each function after applying dead store elimination. The file +name is made by appending @file{.dse} to the source file name. + +@item phiopt +@opindex fdump-tree-phiopt +Dump each function after optimizing PHI nodes into straightline code. The file +name is made by appending @file{.phiopt} to the source file name. + +@item forwprop +@opindex fdump-tree-forwprop +Dump each function after forward propagating single use variables. The file +name is made by appending @file{.forwprop} to the source file name. + +@item copyrename +@opindex fdump-tree-copyrename +Dump each function after applying the copy rename optimization. The file +name is made by appending @file{.copyrename} to the source file name. + +@item nrv +@opindex fdump-tree-nrv +Dump each function after applying the named return value optimization on +generic trees. The file name is made by appending @file{.nrv} to the source +file name. + +@item all +@opindex fdump-tree-all +Enable all the available tree dumps with the flags provided in this option. @end table @item -frandom-seed=@var{string} @@ -3900,6 +4046,39 @@ assumptions based on that. The default is @option{-fzero-initialized-in-bss}. +@item -fbounds-check +@opindex fbounds-check +For front-ends that support it, generate additional code to check that +indices used to access arrays are within the declared range. This is +currently only supported by the Java and Fortran front-ends, where +this option defaults to true and false respectively. + +@item -fmudflap -fmudflapth -fmudflapir +@opindex fmudflap +@opindex fmudflapth +@opindex fmudflapir +@cindex bounds checking +@cindex mudflap +For front-ends that support it (C and C++), instrument all risky +pointer/array dereferencing operations, some standard library +string/heap functions, and some other associated constructs with +range/validity tests. Modules so instrumented should be immune to +buffer overflows, invalid heap use, and some other classes of C/C++ +programming errors. The instrumentation relies on a separate runtime +library (@file{libmudflap}), which will be linked into a program if +@option{-fmudflap} is given at link time. Run-time behavior of the +instrumented program is controlled by the @env{MUDFLAP_OPTIONS} +environment variable. See @code{env MUDFLAP_OPTIONS=-help a.out} +for its options. + +Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to +link if your program is multi-threaded. Use @option{-fmudflapir}, in +addition to @option{-fmudflap} or @option{-fmudflapth}, if +instrumentation should ignore pointer reads. This produces less +instrumentation (and therefore faster execution) and still provides +some protection against outright memory corrupting writes, but allows +erroneously read data to propagate within a program. + @item -fstrength-reduce @opindex fstrength-reduce Perform the optimizations of loop strength reduction and @@ -4159,6 +4338,76 @@ those which have no call-preserved registers to use instead. Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. +@item -ftree-pre +Perform Partial Redundancy Elimination (PRE) on trees. This flag is +enabled by default at -O and higher. + +@item -ftree-ccp +Perform sparse conditional constant propagation (CCP) on trees. This flag +is enabled by default at -O and higher. + +@item -ftree-dce +Perform dead code elimination (DCE) on trees. This flag is enabled by +default at -O and higher. + +@item -ftree-dominator-opts +Perform dead code elimination (DCE) on trees. This flag is enabled by +default at -O and higher. + +@item -ftree-ch +Perform loop header copying on trees. This is beneficial since it increases +effectivity of code motion optimizations. It also saves one jump. This flag +is enabled by default at -O and higher. It is not enabled for -Os, since it +usually increases code size. + +@item -ftree-sra +Perform scalar replacement of aggregates. This pass replaces structure +references with scalars to prevent committing structures to memory too +early. This flag is enabled by default at -O and higher. + +@item -ftree-copyrename +Perform copy renaming on trees. This pass attempts to rename compiler +temporaries to other variables at copy locations, usually resulting in +variable names which more closely resemble the original variables. This flag +is enabled by default at -O and higher. + +@item -ftree-ter +Perform temporary expression replacement during the SSA->normal phase. Single +use/single def temporaries are replaced at their use location with their +defining expression. This results in non-GIMPLE code, but gives the expanders +much more complex trees to work on resulting in better RTL generation. This is +enabled by default at -O and higher. + +@item -ftree-lrs +Perform live range splitting during the SSA->normal phase. Distinct live +ranges of a variable are split into unique variables, allowing for better +optimization later. This is enabled by default at -O and higher. + +@item -ftracer +@opindex ftracer +Perform tail duplication to enlarge superblock size. This transformation +simplifies the control flow of the function allowing other optimizations to do +better job. + +@item -funroll-loops +@opindex funroll-loops +Unroll loops whose number of iterations can be determined at compile +time or upon entry to the loop. @option{-funroll-loops} implies both +@option{-fstrength-reduce} and @option{-frerun-cse-after-loop}. This +option makes code larger, and may or may not make it run faster. + +@item -funroll-all-loops +@opindex funroll-all-loops +Unroll all loops, even if their number of iterations is uncertain when +the loop is entered. This usually makes programs run more slowly. +@option{-funroll-all-loops} implies the same options as +@option{-funroll-loops}, + +@item -fprefetch-loop-arrays +@opindex fprefetch-loop-arrays +If supported by the target machine, generate instructions to prefetch +memory to improve the performance of loops that access large arrays. + @item -fmove-all-movables @opindex fmove-all-movables Forces all invariant computations in loops to be moved @@ -4820,6 +5069,27 @@ Specifies maximal overall growth of the compilation unit caused by inlining. This parameter is ignored when @option{-funit-at-a-time} is not used. The default value is 150. +@item max-inline-insns-recursive +@itemx max-inline-insns-recursive-auto +Specifies maximum number of instructions out-of-line copy of self recursive inline +function can grow into by performing recursive inlining. + +For functions declared inline @option{--param max-inline-insns-recursive} is +taken into acount. For function not declared inline, recursive inlining +happens only when @option{-finline-functions} (included in @option{-O3}) is +enabled and @option{--param max-inline-insns-recursive-auto} is used. The +default value is 500. + +@item max-inline-recursive-depth +@itemx max-inline-recursive-depth-auto +Specifies maximum recursion depth used by the recursive inlining. + +For functions declared inline @option{--param max-inline-recursive-depth} is +taken into acount. For function not declared inline, recursive inlining +happens only when @option{-finline-functions} (included in @option{-O3}) is +enabled and @option{--param max-inline-recursive-depth-auto} is used. The +default value is 500. + @item max-inline-insns-rtl For languages that use the RTL inliner (this happens at a later stage than tree inlining), you can set the maximum allowable size (counted @@ -4904,6 +5174,22 @@ order to make tracer effective. Maximum number of basic blocks on path that cse considers. The default is 10. +@item global-var-threshold + +Counts the number of function calls (N) and the number of +call-clobbered variables (V). If NxV is larger than this limit, a +single artificial variable will be created to represent all the +call-clobbered variables at function call sites. This artificial +variable will then be made to alias every call-clobbered variable. +(done as int * size_t on the host machine; beware overflow). + +@item max-aliased-vops + +Maxiumum number of virtual operands allowed to represent aliases +before triggering the alias grouping heuristic. Alias grouping +reduces compile times and memory consumption needed for aliasing at +the expense of precision loss in alias information. + @item ggc-min-expand GCC uses a garbage collector to manage its own memory allocation. This |