From 1f0c3120cc9cf5b563a11ab0c977273620a03001 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 25 Apr 2001 23:38:10 +0100 Subject: [PATCH] invoke.texi: Document -Wmissing-braces... * invoke.texi: Document -Wmissing-braces, -dumpspecs, -dumpmachine, -dumpversion, -fmem-report and -ftime-report. * gcc.1: Regenerate. From-SVN: r41560 --- gcc/ChangeLog | 6 ++++ gcc/gcc.1 | 91 +++++++++++++++++++++++++++++++++++++++---------- gcc/invoke.texi | 38 +++++++++++++++++++-- 3 files changed, 114 insertions(+), 21 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ff06d6a5a60..1609e32084a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-04-25 Joseph S. Myers + + * invoke.texi: Document -Wmissing-braces, -dumpspecs, + -dumpmachine, -dumpversion, -fmem-report and -ftime-report. + * gcc.1: Regenerate. + 2001-04-25 Rainer Orth * dwarfout.c (is_pseudo_reg, type_main_variant, is_tagged_type, diff --git a/gcc/gcc.1 b/gcc/gcc.1 index 7e73371b5d4..4a87440e3d8 100644 --- a/gcc/gcc.1 +++ b/gcc/gcc.1 @@ -1,5 +1,5 @@ -.\" Automatically generated by Pod::Man version 1.1 -.\" Fri Mar 9 21:54:51 2001 +.\" Automatically generated by Pod::Man version 1.15 +.\" Wed Apr 25 21:39:15 2001 .\" .\" Standard preamble: .\" ====================================================================== @@ -138,7 +138,7 @@ .\" ====================================================================== .\" .IX Title "GCC 1" -.TH GCC 1 "gcc-3.1" "2001-03-09" "GNU" +.TH GCC 1 "gcc-3.1" "2001-04-25" "GNU" .UC .SH "NAME" gcc \- \s-1GNU\s0 project C and \*(C+ compiler @@ -244,7 +244,7 @@ in the following sections. \&\-Werror-implicit-function-declaration \&\-Wimport \-Winline \&\-Wlarger-than-\fR\fIlen\fR \fB\-Wlong-long -\&\-Wmain \-Wmissing-declarations +\&\-Wmain \-Wmissing-braces \-Wmissing-declarations \&\-Wmissing-format-attribute \-Wmissing-noreturn \&\-Wmultichar \-Wno-format-extra-args \-Wno-format-y2k \&\-Wno-import \-Wpacked \-Wpadded @@ -261,8 +261,10 @@ in the following sections. \&\-Wstrict-prototypes \-Wtraditional\fR .Ip "\fIDebugging Options\fR" 4 .IX Item "Debugging Options" -\&\fB\-a \-ax \-d\fR\fIletters\fR \fB\-fdump-unnumbered \-fdump-translation-unit=\fR\fIfile\fR -\&\fB\-fdump-class-layout=\fR\fIfile\fR \fB\-fpretend-float \-fprofile-arcs \-ftest-coverage +\&\fB\-a \-ax \-d\fR\fIletters\fR \fB\-dumpspecs \-dumpmachine \-dumpversion +\&\-fdump-unnumbered \-fdump-translation-unit=\fR\fIfile\fR +\&\fB\-fdump-class-layout=\fR\fIfile\fR \fB\-fmem-report \-fpretend-float +\&\-fprofile-arcs \-ftest-coverage \-ftime-report \&\-g \-g\fR\fIlevel\fR \fB\-gcoff \-gdwarf \-gdwarf-1 \-gdwarf-1+ \-gdwarf-2 \&\-ggdb \-gstabs \-gstabs+ \-gxcoff \-gxcoff+ \&\-p \-pg \-print-file-name=\fR\fIlibrary\fR \fB\-print-libgcc-file-name @@ -276,7 +278,7 @@ in the following sections. \&\-fcse-follow-jumps \-fcse-skip-blocks \-fdata-sections \-fdce \&\-fdelayed-branch \-fdelete-null-pointer-checks \&\-fexpensive-optimizations \-ffast-math \-ffloat-store -\&\-fforce-addr \-fforce-mem \-ffunction-sections \-fgcse +\&\-fforce-addr \-fforce-mem \-ffunction-sections \-fgcse \-fgcse-lm \-fgcse-sm \&\-finline-functions \-finline-limit=\fR\fIn\fR \fB\-fkeep-inline-functions \&\-fkeep-static-consts \-fmove-all-movables \&\-fno-default-inline \-fno-defer-pop @@ -1595,6 +1597,16 @@ Same as \fB\-Wimplicit-int\fR and \fB\-Wimplicit-function-\fR\fBdeclaration\fR. Warn if the type of \fBmain\fR is suspicious. \fBmain\fR should be a function with external linkage, returning int, taking either zero arguments, two, or three arguments of appropriate types. +.Ip "\fB\-Wmissing-braces\fR" 4 +.IX Item "-Wmissing-braces" +Warn if an aggregate or union initializer is not fully bracketed. In +the following example, the initializer for \fBa\fR is not fully +bracketed, but that for \fBb\fR is fully bracketed. +.Sp +.Vb 2 +\& int a[2][2] = { 0, 1, 2, 3 }; +\& int b[2][2] = { { 0, 1 }, { 2, 3 } }; +.Ve .Ip "\fB\-Wmultichar\fR" 4 .IX Item "-Wmultichar" Warn if a multicharacter constant (\fB'\s-1FOOF\s0'\fR) is used. Usually they @@ -1925,7 +1937,8 @@ probably mistaken. .Ip "\fB\-Wtraditional (C only)\fR" 4 .IX Item "-Wtraditional (C only)" Warn about certain constructs that behave differently in traditional and -\&\s-1ISO\s0 C. +\&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C +equivalent, and/or problematic constructs which should be avoided. .RS 4 .Ip "\(bu" 4 Macro parameters that appear within string literals in the macro body. @@ -1950,9 +1963,9 @@ The `U' integer constant suffix, or the `F' or `L' floating point constant suffixes. (Traditonal C does support the `L' suffix on integer constants.) Note, these suffixes appear in macros defined in the system headers of most modern systems, e.g. the _MIN/_MAX macros in limits.h. -Use of these macros can lead to spurious warnings as they do not -necessarily reflect whether the code in question is any less portable to -traditional C given that suitable backup definitions are provided. +Use of these macros in user code might normally lead to spurious +warnings, however gcc's integrated preprocessor has enough context to +avoid warning in these cases. .Ip "\(bu" 4 A function declared external in one block and then used after the end of the block. @@ -1979,6 +1992,11 @@ omitted. This is done under the assumption that the zero initializer in user code appears conditioned on e.g. \f(CW\*(C`_\|_STDC_\|_\*(C'\fR to avoid missing initializer warnings and relies on default initialization to zero in the traditional C case. +.Ip "\(bu" 4 +Conversions by prototypes between fixed/floating point values and vice +versa. The absence of these prototypes when compiling with traditional +C would cause serious problems. This is a subset of the possible +conversion warnings, for the full set use \fB\-Wconversion\fR. .RE .RS 4 .RE @@ -1987,7 +2005,8 @@ traditional C case. Warn if an undefined identifier is evaluated in an \fB#if\fR directive. .Ip "\fB\-Wshadow\fR" 4 .IX Item "-Wshadow" -Warn whenever a local variable shadows another local variable. +Warn whenever a local variable shadows another local variable, parameter or +global variable or whenever a built-in function is shadowed. .Ip "\fB\-Wid-clash-\fR\fIlen\fR" 4 .IX Item "-Wid-clash-len" Warn whenever two distinct identifiers match in the first \fIlen\fR @@ -2295,6 +2314,14 @@ Eventually \s-1GNU\s0 \f(CW\*(C`gprof\*(C'\fR should be extended to process this .IX Item "-Q" Makes the compiler print out each function name as it is compiled, and print some statistics about each pass when it finishes. +.Ip "\fB\-ftime-report\fR" 4 +.IX Item "-ftime-report" +Makes the compiler print some statistics about the time consumed by each +pass when it finishes. +.Ip "\fB\-fmem-report\fR" 4 +.IX Item "-fmem-report" +Makes the compiler print some statistics about permanent memory +allocation when it finishes. .Ip "\fB\-ax\fR" 4 .IX Item "-ax" Generate extra code to profile basic blocks. Your executable will @@ -2315,19 +2342,19 @@ available paths and filenames in file \fIbb.out\fR. .Sp Several function names have a special meaning: .RS 4 -.if n .Ip "\f(CW""_\|_bb_jumps_\|_""\fR" 4 +.if n .Ip "\f(CW""""_\|_bb_jumps_\|_""""\fR" 4 .el .Ip "\f(CW_\|_bb_jumps_\|_\fR" 4 .IX Item "__bb_jumps__" Write source, target and frequency of jumps to file \fIbb.out\fR. -.if n .Ip "\f(CW""_\|_bb_hidecall_\|_""\fR" 4 +.if n .Ip "\f(CW""""_\|_bb_hidecall_\|_""""\fR" 4 .el .Ip "\f(CW_\|_bb_hidecall_\|_\fR" 4 .IX Item "__bb_hidecall__" Exclude function calls from frequency count. -.if n .Ip "\f(CW""_\|_bb_showret_\|_""\fR" 4 +.if n .Ip "\f(CW""""_\|_bb_showret_\|_""""\fR" 4 .el .Ip "\f(CW_\|_bb_showret_\|_\fR" 4 .IX Item "__bb_showret__" Include function returns in frequency count. -.if n .Ip "\f(CW""_\|_bb_trace_\|_""\fR" 4 +.if n .Ip "\f(CW""""_\|_bb_trace_\|_""""\fR" 4 .el .Ip "\f(CW_\|_bb_trace_\|_\fR" 4 .IX Item "__bb_trace__" Write the sequence of basic blocks executed to file \fIbbtrace.gz\fR. @@ -2640,6 +2667,18 @@ To resolve this you either need to put \fIcpp0\fR and the other compiler components where gcc expects to find them, or you can set the environment variable \fB\s-1GCC_EXEC_PREFIX\s0\fR to the directory where you installed them. Don't forget the trailing '/'. +.Ip "\fB\-dumpmachine\fR" 4 +.IX Item "-dumpmachine" +Print the compiler's target machine (for example, +\&\fBi686\-pc-linux-gnu\fR)\-\-\-and don't do anything else. +.Ip "\fB\-dumpversion\fR" 4 +.IX Item "-dumpversion" +Print the compiler version (for example, \fB3.0\fR)\-\-\-and don't do +anything else. +.Ip "\fB\-dumpspecs\fR" 4 +.IX Item "-dumpspecs" +Print the compiler's built-in specs\-\-\-and don't do anything else. (This +is used when \s-1GCC\s0 itself is being built.) .Sh "Options That Control Optimization" .IX Subsection "Options That Control Optimization" These options control various sorts of optimizations: @@ -2825,8 +2864,6 @@ and \fB\-fno-trapping-math\fR. .Sp This option causes the preprocessor macro _\|_FAST_MATH_\|_ to be defined. .Sp -This option causes the preprocessor macro _\|_FAST_MATH_\|_ to be defined. -.Sp This option should never be turned on by any \fB\-O\fR option since it can result in incorrect output for programs which depend on an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications for @@ -2916,6 +2953,18 @@ Run the loop optimizer twice. .IX Item "-fgcse" Perform a global common subexpression elimination pass. This pass also performs global constant and copy propagation. +.Ip "\fB\-fgcse-lm\fR" 4 +.IX Item "-fgcse-lm" +When \-fgcse-lm is enabled, global common subexpression elimination will +attempt to move loads which are only killed by stores into themselves. This +allows a loop containing a load/store sequence to be changed to a load outside +the loop, and a copy/store within the loop. +.Ip "\fB\-fgcse-sm\fR" 4 +.IX Item "-fgcse-sm" +When \-fgcse-sm is enabled, A store motion pass is run after global common +subexpression elimination. This pass will attempt to move stores out of loops. +When used in conjunction with \-fgcse-lm, loops containing a load/store sequence +can be changed to a load before the loop and a store after the loop. .Ip "\fB\-fdelete-null-pointer-checks\fR" 4 .IX Item "-fdelete-null-pointer-checks" Use global dataflow analysis to identify and eliminate useless null @@ -3183,6 +3232,12 @@ In each case, the \fIvalue\fR is a integer. The allowable choices for If an function contains more than this many instructions, it will not be inlined. This option is precisely equivalent to \&\fB\-finline-limit\fR. +.Ip "\fBmax-gcse-memory\fR" 4 +.IX Item "max-gcse-memory" +The approximate maximum amount of memory that will be allocated in +order to perform the global common subexpression elimination +optimization. If more memory than specified is required, the +optimization will not be done. .RE .RS 4 .RE diff --git a/gcc/invoke.texi b/gcc/invoke.texi index cde251c2932..fa7d047e9d7 100644 --- a/gcc/invoke.texi +++ b/gcc/invoke.texi @@ -204,7 +204,7 @@ in the following sections. -Werror-implicit-function-declaration @gol -Wimport -Winline @gol -Wlarger-than-@var{len} -Wlong-long @gol --Wmain -Wmissing-declarations @gol +-Wmain -Wmissing-braces -Wmissing-declarations @gol -Wmissing-format-attribute -Wmissing-noreturn @gol -Wmultichar -Wno-format-extra-args -Wno-format-y2k @gol -Wno-import -Wpacked -Wpadded @gol @@ -224,8 +224,10 @@ in the following sections. @item Debugging Options @xref{Debugging Options,,Options for Debugging Your Program or GCC}. @gccoptlist{ --a -ax -d@var{letters} -fdump-unnumbered -fdump-translation-unit=@var{file} @gol --fdump-class-layout=@var{file} -fpretend-float -fprofile-arcs -ftest-coverage @gol +-a -ax -d@var{letters} -dumpspecs -dumpmachine -dumpversion @gol +-fdump-unnumbered -fdump-translation-unit=@var{file} @gol +-fdump-class-layout=@var{file} -fmem-report -fpretend-float @gol +-fprofile-arcs -ftest-coverage -ftime-report @gol -g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2 @gol -ggdb -gstabs -gstabs+ -gxcoff -gxcoff+ @gol -p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol @@ -1697,6 +1699,16 @@ Warn if the type of @samp{main} is suspicious. @samp{main} should be a function with external linkage, returning int, taking either zero arguments, two, or three arguments of appropriate types. +@item -Wmissing-braces +Warn if an aggregate or union initializer is not fully bracketed. In +the following example, the initializer for @samp{a} is not fully +bracketed, but that for @samp{b} is fully bracketed. + +@smallexample +int a[2][2] = @{ 0, 1, 2, 3 @}; +int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @}; +@end smallexample + @item -Wmultichar Warn if a multicharacter constant (@samp{'FOOF'}) is used. Usually they indicate a typo in the user's code, as they have implementation-defined @@ -2451,6 +2463,14 @@ Eventually GNU @code{gprof} should be extended to process this data. Makes the compiler print out each function name as it is compiled, and print some statistics about each pass when it finishes. +@item -ftime-report +Makes the compiler print some statistics about the time consumed by each +pass when it finishes. + +@item -fmem-report +Makes the compiler print some statistics about permanent memory +allocation when it finishes. + @item -ax Generate extra code to profile basic blocks. Your executable will produce output that is a superset of that produced when @samp{-a} is @@ -2747,6 +2767,18 @@ components where gcc expects to find them, or you can set the environment variable @env{GCC_EXEC_PREFIX} to the directory where you installed them. Don't forget the trailing '/'. @xref{Environment Variables}. + +@item -dumpmachine +Print the compiler's target machine (for example, +@samp{i686-pc-linux-gnu})---and don't do anything else. + +@item -dumpversion +Print the compiler version (for example, @samp{3.0})---and don't do +anything else. + +@item -dumpspecs +Print the compiler's built-in specs---and don't do anything else. (This +is used when GCC itself is being built.) @xref{Spec Files}. @end table @node Optimize Options -- 2.30.2