From 66818b0350e0b108b885e75420a2fb0ebbada404 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Thu, 2 Feb 2017 20:57:37 +0000 Subject: [PATCH] PR middle-end/32003 - Undocumented -fdump-tree options gcc/ChangeLog: * doc/invoke.texi (-fdump-rtl-): Remove pass-specific options from index. (-fdump-tree-@var): Add to index and document how to come up with pass-specific option and dump file names. (-fdump-passes): Clarify where to look for output. From-SVN: r245136 --- gcc/ChangeLog | 9 ++ gcc/doc/invoke.texi | 208 ++++++++------------------------------------ 2 files changed, 44 insertions(+), 173 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 07da434e166..ec835c6c6b9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2017-02-02 Martin Sebor + + PR middle-end/32003 + * doc/invoke.texi (-fdump-rtl-): Remove pass-specific options from + index. + (-fdump-tree-@var): Add to index and document how to come up + with pass-specific option and dump file names. + (-fdump-passes): Clarify where to look for output. + 2017-02-02 Jan Hubicka PR middle-end/77445 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 4b13aeb7426..47ceebbb20a 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -544,29 +544,9 @@ Objective-C and Objective-C++ Dialects}. -fdump-rtl-@var{pass} -fdump-rtl-@var{pass}=@var{filename} @gol -fdump-statistics @gol -fdump-tree-all @gol --fdump-tree-original@r{[}-@var{n}@r{]} @gol --fdump-tree-optimized@r{[}-@var{n}@r{]} @gol --fdump-tree-cfg -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{]} @gol --fdump-tree-dom@r{[}-@var{n}@r{]} @gol --fdump-tree-dse@r{[}-@var{n}@r{]} @gol --fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol --fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol --fdump-tree-backprop@r{[}-@var{n}@r{]} @gol --fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol --fdump-tree-nrv -fdump-tree-vect @gol --fdump-tree-sink @gol --fdump-tree-sra@r{[}-@var{n}@r{]} @gol --fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol --fdump-tree-fre@r{[}-@var{n}@r{]} @gol --fdump-tree-vtable-verify @gol --fdump-tree-vrp@r{[}-@var{n}@r{]} @gol --fdump-tree-split-paths@r{[}-@var{n}@r{]} @gol --fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol --fdump-final-insns=@var{file} @gol +-fdump-tree-@var{switch} @gol +-fdump-tree-@var{switch}-@var{options} @gol +-fdump-tree-@var{switch}-@var{options}=@var{filename} @gol -fcompare-debug@r{[}=@var{opts}@r{]} -fcompare-debug-second @gol -fenable-@var{kind}-@var{pass} @gol -fenable-@var{kind}-@var{pass}=@var{range-list} @gol @@ -12971,8 +12951,8 @@ Dump after function inlining. @item -fdump-passes @opindex fdump-passes -Dump the list of optimization passes that are turned on and off by -the current command-line options. +Print on @file{stderr} the list of optimization passes that are turned +on and off by the current command-line options. @item -fdump-statistics-@var{option} @opindex fdump-statistics @@ -12985,9 +12965,11 @@ whole compilation unit while @samp{-details} dumps every event as the passes generate them. The default with no option is to sum counters for each function compiled. -@item -fdump-tree-@var{switch} +@item -fdump-tree-all +@itemx -fdump-tree-@var{switch} @itemx -fdump-tree-@var{switch}-@var{options} @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename} +@opindex fdump-tree-all @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 @@ -13069,7 +13051,7 @@ example, @smallexample gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump - -fdump-tree-pre=stderr file.c + -fdump-tree-pre=/dev/stderr file.c @end smallexample outputs vectorizer dump into @file{foo.dump}, while the PRE dump is @@ -13077,11 +13059,6 @@ output on to @file{stderr}. If two conflicting dump filenames are given for the same pass, then the latter option overrides the earlier one. -@item split-paths -@opindex fdump-tree-split-paths -Dump each function after splitting paths to loop backedges. The file -name is made by appending @file{.split-paths} to the source file name. - @item all Turn on all options, except @option{raw}, @option{slim}, @option{verbose} and @option{lineno}. @@ -13091,148 +13068,33 @@ Turn on all optimization options, i.e., @option{optimized}, @option{missed}, and @option{note}. @end table -The following tree dumps are possible: -@table @samp - -@item original -@opindex fdump-tree-original -Dump before any tree based optimization, to @file{@var{file}.original}. - -@item optimized -@opindex fdump-tree-optimized -Dump after all tree based optimization, to @file{@var{file}.optimized}. - -@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 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 storeccp -@opindex fdump-tree-storeccp -Dump each function after STORE-CCP@. The file name is made by appending -@file{.storeccp} to the source file name. - -@item pre -@opindex fdump-tree-pre -Dump trees after partial redundancy elimination and/or code hoisting. -The file name is made by appending @file{.pre} to the source file name. - -@item fre -@opindex fdump-tree-fre -Dump trees after full redundancy elimination. The file name is made -by appending @file{.fre} to the source file name. - -@item copyprop -@opindex fdump-tree-copyprop -Dump trees after copy propagation. The file name is made -by appending @file{.copyprop} to the source file name. - -@item store_copyprop -@opindex fdump-tree-store_copyprop -Dump trees after store copy-propagation. The file name is made -by appending @file{.store_copyprop} 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 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 sink -@opindex fdump-tree-sink -Dump each function after performing code sinking. The file name is made -by appending @file{.sink} 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 backprop -@opindex fdump-tree-backprop -Dump each function after back-propagating use information up the definition -chain. The file name is made by appending @file{.backprop} 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 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 vect -@opindex fdump-tree-vect -Dump each function after applying vectorization of loops. The file name is -made by appending @file{.vect} to the source file name. - -@item slp -@opindex fdump-tree-slp -Dump each function after applying vectorization of basic blocks. The file name -is made by appending @file{.slp} to the source file name. - -@item vrp -@opindex fdump-tree-vrp -Dump each function after Value Range Propagation (VRP). The file name -is made by appending @file{.vrp} to the source file name. +To determine what tree dumps are available or find the dump for a pass +of interest follow the steps below. -@item early vrp -@opindex fdump-tree-evrp -Dump each function after Early Value Range Propagation (EVRP). The file name -is made by appending @file{.evrp} to the source file name. - -@item oaccdevlow -@opindex fdump-tree-oaccdevlow -Dump each function after applying device-specific OpenACC transformations. -The file name is made by appending @file{.oaccdevlow} 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 +@enumerate +@item +Invoke GCC with @option{-fdump-passes} and in the @file{stderr} output +look for a code that corresponds to the pass you are interested in. +For example, the codes @code{tree-evrp}, @code{tree-vrp1}, and +@code{tree-vrp2} correspond to the three Value Range Propagation passes. +The number at the end distinguishes distinct invocations of the same pass. +@item +To enable the creation of the dump file, append the pass code to +the @option{-fdump-} option prefix and invoke GCC with it. For example, +to enable the dump from the Early Value Range Propagation pass, invoke +GCC with the @option{-fdump-tree-evrp} option. Optionally, you may +specify the name of the dump file. If you don't specify one, GCC +creates as described below. +@item +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{t} for tree passes (and the letter @samp{r} for RTL passes), +and finally the pass code. For example, the Early VRP pass dump might +be in a file named @file{myfile.c.038t.evrp} in the current working +directory. Note that the numeric codes are not stable and may change +from one version of GCC to another. +@end enumerate @item -fopt-info @itemx -fopt-info-@var{options} -- 2.30.2