Re: [PATCH doc] clean up -fdump-tree- options (PR 32003)
On 02/15/2017 05:51 AM, Thomas Schwinge wrote: Hi! On Wed, 1 Feb 2017 20:26:24 -0700, Martin Sebor wrote: On 02/01/2017 08:06 PM, Sandra Loosemore wrote: On 02/01/2017 06:57 PM, Martin Sebor wrote: PR middle-end/32003 * doc/invoke.texi (-fdump-rtl-): Remove pass-specific options from index. "rtl" vs. "tree" typo. ;-) --- 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-storeccp@r{[}-@var{n}@r{]} @gol --fdump-final-insns=@var{file} @gol Is it intentional that you've also removed "-fdump-final-insns" here? (It remains documented further down the file.) No, I meant to only remove the -fdump-tree-xxx options in this pass. I committed r245493 to restore it and fix the ChangeLog. Thanks for the review and for pointing it out! Martin
Re: [PATCH doc] clean up -fdump-tree- options (PR 32003)
Hi! On Wed, 1 Feb 2017 20:26:24 -0700, Martin Sebor wrote: > On 02/01/2017 08:06 PM, Sandra Loosemore wrote: > > On 02/01/2017 06:57 PM, Martin Sebor wrote: > PR middle-end/32003 > * doc/invoke.texi (-fdump-rtl-): Remove pass-specific options from > index. "rtl" vs. "tree" typo. ;-) > --- 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-storeccp@r{[}-@var{n}@r{]} @gol > --fdump-final-insns=@var{file} @gol Is it intentional that you've also removed "-fdump-final-insns" here? (It remains documented further down the file.) Grüße Thomas
Re: [PATCH doc] clean up -fdump-tree- options (PR 32003)
On 02/01/2017 10:28 PM, Sandra Loosemore wrote: On 02/01/2017 08:26 PM, Martin Sebor wrote: On 02/01/2017 08:06 PM, Sandra Loosemore wrote: On 02/01/2017 06:57 PM, Martin Sebor wrote: As discussed in bug 32003 - Undocumented -fdump-tree options, rather than duplicating the same boiler-plate text for each of the dozens (138 by my count) of undocumented passes, the attached patch removes the pass-specific -fdump-tree- options replacing them with a list of generic steps to determine the full list of such options and the names of the dump files for each. The bug only talks about -fdump-tree- options so the attached patch only tackles those and leaves the -fdump-rtl- options for another time. Thanks for tackling this. I think the patch requires another round of cleanup, though. Attached is an updated version. Just a couple more small things. @@ -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-all @item -fdump-tree-@var{switch} You need to make this one @itemx now since you added @item just above it. +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 will +create one as described below. s/will create one/creates one/ @@ -15572,7 +15434,7 @@ before calling a function and popped afterwards. Popping the arguments after the function call can be expensive on AVR so that accumulating the stack space might lead to smaller -executables because arguments need not to be removed from the +executables because arguments need not be removed from the stack after such a function call. This option can lead to reduced code size for functions that perform This change is good, but it's clearly not related to the other parts of the patch, and wasn't present in the previous version. Did you intend to do this? If so, please commit it separately. (I often commit big patches with collected copy-edits and typo corrections, but I try to keep those separate from content rewrites or restructuring patches.) I was prompted to make the change by your request to replace "need not be" with "are not". I wanted to see if there were other uses of the former. This one was incorrect so I fixed it. Martin The rest of the patch is OK to commit with the two nits fixed. -Sandra
Re: [PATCH doc] clean up -fdump-tree- options (PR 32003)
On 02/01/2017 08:26 PM, Martin Sebor wrote: On 02/01/2017 08:06 PM, Sandra Loosemore wrote: On 02/01/2017 06:57 PM, Martin Sebor wrote: As discussed in bug 32003 - Undocumented -fdump-tree options, rather than duplicating the same boiler-plate text for each of the dozens (138 by my count) of undocumented passes, the attached patch removes the pass-specific -fdump-tree- options replacing them with a list of generic steps to determine the full list of such options and the names of the dump files for each. The bug only talks about -fdump-tree- options so the attached patch only tackles those and leaves the -fdump-rtl- options for another time. Thanks for tackling this. I think the patch requires another round of cleanup, though. Attached is an updated version. Just a couple more small things. @@ -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-all @item -fdump-tree-@var{switch} You need to make this one @itemx now since you added @item just above it. +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 will +create one as described below. s/will create one/creates one/ @@ -15572,7 +15434,7 @@ before calling a function and popped afterwards. Popping the arguments after the function call can be expensive on AVR so that accumulating the stack space might lead to smaller -executables because arguments need not to be removed from the +executables because arguments need not be removed from the stack after such a function call. This option can lead to reduced code size for functions that perform This change is good, but it's clearly not related to the other parts of the patch, and wasn't present in the previous version. Did you intend to do this? If so, please commit it separately. (I often commit big patches with collected copy-edits and typo corrections, but I try to keep those separate from content rewrites or restructuring patches.) The rest of the patch is OK to commit with the two nits fixed. -Sandra
Re: [PATCH doc] clean up -fdump-tree- options (PR 32003)
On 02/01/2017 08:06 PM, Sandra Loosemore wrote: On 02/01/2017 06:57 PM, Martin Sebor wrote: As discussed in bug 32003 - Undocumented -fdump-tree options, rather than duplicating the same boiler-plate text for each of the dozens (138 by my count) of undocumented passes, the attached patch removes the pass-specific -fdump-tree- options replacing them with a list of generic steps to determine the full list of such options and the names of the dump files for each. The bug only talks about -fdump-tree- options so the attached patch only tackles those and leaves the -fdump-rtl- options for another time. Thanks for tackling this. I think the patch requires another round of cleanup, though. Attached is an updated version. Martin PR middle-end/32003 - Undocumented -fdump-tree options gcc/ChangeLog: 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. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 4b13aeb..73732d0 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-all @item -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 -@
Re: [PATCH doc] clean up -fdump-tree- options (PR 32003)
On 02/01/2017 06:57 PM, Martin Sebor wrote: As discussed in bug 32003 - Undocumented -fdump-tree options, rather than duplicating the same boiler-plate text for each of the dozens (138 by my count) of undocumented passes, the attached patch removes the pass-specific -fdump-tree- options replacing them with a list of generic steps to determine the full list of such options and the names of the dump files for each. The bug only talks about -fdump-tree- options so the attached patch only tackles those and leaves the -fdump-rtl- options for another time. Thanks for tackling this. I think the patch requires another round of cleanup, though. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 4b13aeb..75b6e3e 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -543,30 +543,9 @@ Objective-C and Objective-C++ Dialects}. -fdump-passes @gol -fdump-rtl-@var{pass} -fdump-rtl-@var{pass}=@var{filename} @gol -fdump-statistics @gol --fdump-tree-all @gol I'd prefer that we continue to document -fdump-tree-all explicitly. It's the easiest to use and remember, and it's also the one I need most often when I'm tracking down a bug and I don't have a clue which pass is introducing it. :-) +The determine what tree dumps are available or find the dump for a pass +of interest follow the steps below. s/The/To/ +@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 @code{-fdump-tree-evrp} option. Optionally, you may s/@code/@option/ +specify the name of the dump file. If you don't specify one, GCC will +create on as described below. s/will create on/creates one/ +@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 @code{t} for tree passes (and the letter @code{r} for rtl passes), s/@code/@samp/g s/rtl/RTL/ +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 need not be stable and may change s/need not be/are not/ +from one version of GCC to another. +@end enumerate -Sandra