Commit b6cfa9eb by Tobias Burnus Committed by Tobias Burnus

re PR middle-end/59257 (usan/*san: Dpcumentation oddness of -fsanitize= / -fsanitize=shift)

2013-12-02  Tobias Burnus  <burnus@net-b.de>
            Manuel López-Ibáñez  <manu@gcc.gnu.org>

        PR middle-end/59257
        * doc/invoke.texi: Add missing @opindex.
        (-fsanitize=): Use @gcctabopt instead of @itemize.


Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>

From-SVN: r205598
parent 2399cad0
2013-12-02 Tobias Burnus <burnus@net-b.de>
Manuel López-Ibáñez <manu@gcc.gnu.org>
PR middle-end/59257
* doc/invoke.texi: Add missing @opindex.
(-fsanitize=): Use @gcctabopt instead of @itemize.
2013-12-02 Bernd Edlinger <bernd.edlinger@hotmail.de> 2013-12-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
Fix C++0x memory model for unaligned fields in packed, aligned(4) Fix C++0x memory model for unaligned fields in packed, aligned(4)
...@@ -1501,6 +1501,7 @@ This invokes all subprograms of @command{gcc} under ...@@ -1501,6 +1501,7 @@ This invokes all subprograms of @command{gcc} under
@samp{gdb --args cc1 @dots{}}. @samp{gdb --args cc1 @dots{}}.
@item -fplugin=@var{name}.so @item -fplugin=@var{name}.so
@opindex fplugin
Load the plugin code in file @var{name}.so, assumed to be a Load the plugin code in file @var{name}.so, assumed to be a
shared object to be dlopen'd by the compiler. The base name of shared object to be dlopen'd by the compiler. The base name of
the shared object file is used to identify the plugin for the the shared object file is used to identify the plugin for the
...@@ -1510,15 +1511,18 @@ Each plugin should define the callback functions specified in the ...@@ -1510,15 +1511,18 @@ Each plugin should define the callback functions specified in the
Plugins API. Plugins API.
@item -fplugin-arg-@var{name}-@var{key}=@var{value} @item -fplugin-arg-@var{name}-@var{key}=@var{value}
@opindex fplugin-arg
Define an argument called @var{key} with a value of @var{value} Define an argument called @var{key} with a value of @var{value}
for the plugin called @var{name}. for the plugin called @var{name}.
@item -fdump-ada-spec@r{[}-slim@r{]} @item -fdump-ada-spec@r{[}-slim@r{]}
@opindex fdump-ada-spec
For C and C++ source and include files, generate corresponding Ada For C and C++ source and include files, generate corresponding Ada
specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn, specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
GNAT User's Guide}, which provides detailed documentation on this feature. GNAT User's Guide}, which provides detailed documentation on this feature.
@item -fdump-go-spec=@var{file} @item -fdump-go-spec=@var{file}
@opindex fdump-go-spec
For input files in any language, generate corresponding Go For input files in any language, generate corresponding Go
declarations in @var{file}. This generates Go @code{const}, declarations in @var{file}. This generates Go @code{const},
@code{type}, @code{var}, and @code{func} declarations which may be a @code{type}, @code{var}, and @code{func} declarations which may be a
...@@ -1759,6 +1763,7 @@ arguments followed by their declarations is also provided, inside ...@@ -1759,6 +1763,7 @@ arguments followed by their declarations is also provided, inside
comments, after the declaration. comments, after the declaration.
@item -fallow-parameterless-variadic-functions @item -fallow-parameterless-variadic-functions
@opindex fallow-parameterless-variadic-functions
Accept variadic functions without named parameters. Accept variadic functions without named parameters.
Although it is possible to define such a function, this is not very Although it is possible to define such a function, this is not very
...@@ -2400,7 +2405,7 @@ Note: This feature APPENDS data to the log file. If you want a fresh log ...@@ -2400,7 +2405,7 @@ Note: This feature APPENDS data to the log file. If you want a fresh log
file, be sure to delete any existing one. file, be sure to delete any existing one.
@item -fvtv-counts @item -fvtv-counts
@opindex (fvtv-counts) @opindex fvtv-counts
This is a debugging flag. When used in conjunction with This is a debugging flag. When used in conjunction with
@option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
causes the compiler to keep track of the total number of virtual calls causes the compiler to keep track of the total number of virtual calls
...@@ -3499,6 +3504,8 @@ Options,,Options Controlling C Dialect}. ...@@ -3499,6 +3504,8 @@ Options,,Options Controlling C Dialect}.
@table @gcctabopt @table @gcctabopt
@item -Wformat=1 @item -Wformat=1
@itemx -Wformat @itemx -Wformat
@opindex Wformat
@opindex Wformat=1
Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
@option{-Wno-format} is equivalent to @option{-Wformat=0}. Since @option{-Wno-format} is equivalent to @option{-Wformat=0}. Since
@option{-Wformat} also checks for null format arguments for several @option{-Wformat} also checks for null format arguments for several
...@@ -3537,6 +3544,7 @@ The C standard specifies that zero-length formats are allowed. ...@@ -3537,6 +3544,7 @@ The C standard specifies that zero-length formats are allowed.
@item -Wformat=2 @item -Wformat=2
@opindex Wformat=2
Enable @option{-Wformat} plus additional format checks. Currently Enable @option{-Wformat} plus additional format checks. Currently
equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
-Wformat-y2k}. -Wformat-y2k}.
...@@ -5273,6 +5281,7 @@ many times it is given. This is mainly intended to be used with ...@@ -5273,6 +5281,7 @@ many times it is given. This is mainly intended to be used with
@option{-fcompare-debug}. @option{-fcompare-debug}.
@item -fsanitize=address @item -fsanitize=address
@opindex fsanitize=address
Enable AddressSanitizer, a fast memory error detector. Enable AddressSanitizer, a fast memory error detector.
Memory access instructions will be instrumented to detect Memory access instructions will be instrumented to detect
out-of-bounds and use-after-free bugs. out-of-bounds and use-after-free bugs.
...@@ -5283,6 +5292,7 @@ more details. The run-time behavior can be influenced using the ...@@ -5283,6 +5292,7 @@ more details. The run-time behavior can be influenced using the
a list of supported options. a list of supported options.
@item -fsanitize=thread @item -fsanitize=thread
@opindex fsanitize=thread
Enable ThreadSanitizer, a fast data race detector. Enable ThreadSanitizer, a fast data race detector.
Memory access instructions will be instrumented to detect Memory access instructions will be instrumented to detect
data race bugs. See @uref{http://code.google.com/p/thread-sanitizer/} for more data race bugs. See @uref{http://code.google.com/p/thread-sanitizer/} for more
...@@ -5292,6 +5302,7 @@ environment variable; see ...@@ -5292,6 +5302,7 @@ environment variable; see
supported options. supported options.
@item -fsanitize=leak @item -fsanitize=leak
@opindex fsanitize=leak
Enable LeakSanitizer, a memory leak detector. Enable LeakSanitizer, a memory leak detector.
This option only matters for linking of executables and if neither This option only matters for linking of executables and if neither
@option{-fsanitize=address} nor @option{-fsanitize=thread} is used. In that @option{-fsanitize=address} nor @option{-fsanitize=thread} is used. In that
...@@ -5302,43 +5313,49 @@ details. The run-time behavior can be influenced using the ...@@ -5302,43 +5313,49 @@ details. The run-time behavior can be influenced using the
@env{LSAN_OPTIONS} environment variable. @env{LSAN_OPTIONS} environment variable.
@item -fsanitize=undefined @item -fsanitize=undefined
@opindex fsanitize=undefined
Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector. Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
Various computations will be instrumented to detect undefined behavior Various computations will be instrumented to detect undefined behavior
at runtime. Current suboptions are: at runtime. Current suboptions are:
@itemize @bullet @table @gcctabopt
@item @option{-fsanitize=shift} @item -fsanitize=shift
@opindex fsanitize=shift
This option enables checking that the result of a shift operation is This option enables checking that the result of a shift operation is
not undefined. Note that what exactly is considered undefined differs not undefined. Note that what exactly is considered undefined differs
slightly between C and C++, as well as between ISO C90 and C99, etc. slightly between C and C++, as well as between ISO C90 and C99, etc.
@item @option{-fsanitize=integer-divide-by-zero} @item -fsanitize=integer-divide-by-zero
@opindex fsanitize=integer-divide-by-zero
Detect integer division by zero as well as @code{INT_MIN / -1} division. Detect integer division by zero as well as @code{INT_MIN / -1} division.
@item @option{-fsanitize=unreachable} @item -fsanitize=unreachable
@opindex fsanitize=unreachable
With this option, the compiler will turn the @code{__builtin_unreachable} With this option, the compiler will turn the @code{__builtin_unreachable}
call into a diagnostics message call instead. When reaching the call into a diagnostics message call instead. When reaching the
@code{__builtin_unreachable} call, the behavior is undefined. @code{__builtin_unreachable} call, the behavior is undefined.
@item @option{-fsanitize=vla-bound} @item -fsanitize=vla-bound
@opindex fsanitize=vla-bound
This option instructs the compiler to check that the size of a variable This option instructs the compiler to check that the size of a variable
length array is positive. This option does not have any effect in length array is positive. This option does not have any effect in
@option{-std=c++1y} mode, as the standard requires the exception be thrown @option{-std=c++1y} mode, as the standard requires the exception be thrown
instead. instead.
@item @option{-fsanitize=null} @item -fsanitize=null
@opindex fsanitize=null
This option enables pointer checking. Particularly, the application This option enables pointer checking. Particularly, the application
built with this option turned on will issue an error message when it built with this option turned on will issue an error message when it
tries to dereference a NULL pointer, or if a reference (possibly an tries to dereference a NULL pointer, or if a reference (possibly an
rvalue reference) is bound to a NULL pointer. rvalue reference) is bound to a NULL pointer.
@end itemize @end table
While @option{-ftrapv} causes traps for signed overflows to be emitted, While @option{-ftrapv} causes traps for signed overflows to be emitted,
@option{-fsanitize=undefined} gives a diagnostic message. @option{-fsanitize=undefined} gives a diagnostic message.
...@@ -5400,6 +5417,7 @@ information about each symbol. This option only makes sense when ...@@ -5400,6 +5417,7 @@ information about each symbol. This option only makes sense when
generating DWARF 2 debugging information with @option{-gdwarf-2}. generating DWARF 2 debugging information with @option{-gdwarf-2}.
@item -femit-struct-debug-baseonly @item -femit-struct-debug-baseonly
@opindex femit-struct-debug-baseonly
Emit debug information for struct-like types Emit debug information for struct-like types
only when the base name of the compilation source file only when the base name of the compilation source file
matches the base name of file in which the struct is defined. matches the base name of file in which the struct is defined.
...@@ -5412,6 +5430,7 @@ See @option{-femit-struct-debug-detailed} for more detailed control. ...@@ -5412,6 +5430,7 @@ See @option{-femit-struct-debug-detailed} for more detailed control.
This option works only with DWARF 2. This option works only with DWARF 2.
@item -femit-struct-debug-reduced @item -femit-struct-debug-reduced
@opindex femit-struct-debug-reduced
Emit debug information for struct-like types Emit debug information for struct-like types
only when the base name of the compilation source file only when the base name of the compilation source file
matches the base name of file in which the type is defined, matches the base name of file in which the type is defined,
...@@ -5742,6 +5761,7 @@ Here are some examples showing uses of these options. ...@@ -5742,6 +5761,7 @@ Here are some examples showing uses of these options.
@itemx -fdump-rtl-@var{pass} @itemx -fdump-rtl-@var{pass}
@itemx -fdump-rtl-@var{pass}=@var{filename} @itemx -fdump-rtl-@var{pass}=@var{filename}
@opindex d @opindex d
@opindex fdump-rtl-@var{pass}
Says to make debugging dumps during compilation at times specified by Says to make debugging dumps during compilation at times specified by
@var{letters}. This is used for debugging the RTL-based passes of the @var{letters}. This is used for debugging the RTL-based passes of the
compiler. The file names for most of the dumps are made by appending compiler. The file names for most of the dumps are made by appending
...@@ -8030,6 +8050,7 @@ variable names which more closely resemble the original variables. This flag ...@@ -8030,6 +8050,7 @@ variable names which more closely resemble the original variables. This flag
is enabled by default at @option{-O} and higher. is enabled by default at @option{-O} and higher.
@item -ftree-coalesce-inlined-vars @item -ftree-coalesce-inlined-vars
@opindex ftree-coalesce-inlined-vars
Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
combine small user-defined variables too, but only if they were inlined combine small user-defined variables too, but only if they were inlined
from other functions. It is a more limited form of from other functions. It is a more limited form of
...@@ -8040,6 +8061,7 @@ contain the expected values in a debugging session. This was the ...@@ -8040,6 +8061,7 @@ contain the expected values in a debugging session. This was the
default in GCC versions older than 4.7. default in GCC versions older than 4.7.
@item -ftree-coalesce-vars @item -ftree-coalesce-vars
@opindex ftree-coalesce-vars
Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
combine small user-defined variables too, instead of just compiler combine small user-defined variables too, instead of just compiler
temporaries. This may severely limit the ability to debug an optimized temporaries. This may severely limit the ability to debug an optimized
...@@ -8691,9 +8713,11 @@ the comparison operation before register allocation is complete. ...@@ -8691,9 +8713,11 @@ the comparison operation before register allocation is complete.
Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}. Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
@item -fuse-ld=bfd @item -fuse-ld=bfd
@opindex fuse-ld=bfd
Use the @command{bfd} linker instead of the default linker. Use the @command{bfd} linker instead of the default linker.
@item -fuse-ld=gold @item -fuse-ld=gold
@opindex fuse-ld=gold
Use the @command{gold} linker instead of the default linker. Use the @command{gold} linker instead of the default linker.
@item -fcprop-registers @item -fcprop-registers
...@@ -10250,6 +10274,7 @@ for the languages used in the program, or using the option ...@@ -10250,6 +10274,7 @@ for the languages used in the program, or using the option
@file{libgcc}. @file{libgcc}.
@item -static-libasan @item -static-libasan
@opindex static-libasan
When the @option{-fsanitize=address} option is used to link a program, When the @option{-fsanitize=address} option is used to link a program,
the GCC driver automatically links against @option{libasan}. If the GCC driver automatically links against @option{libasan}. If
@file{libasan} is available as a shared library, and the @option{-static} @file{libasan} is available as a shared library, and the @option{-static}
...@@ -10259,6 +10284,7 @@ driver to link @file{libasan} statically, without necessarily linking ...@@ -10259,6 +10284,7 @@ driver to link @file{libasan} statically, without necessarily linking
other libraries statically. other libraries statically.
@item -static-libtsan @item -static-libtsan
@opindex static-libtsan
When the @option{-fsanitize=thread} option is used to link a program, When the @option{-fsanitize=thread} option is used to link a program,
the GCC driver automatically links against @option{libtsan}. If the GCC driver automatically links against @option{libtsan}. If
@file{libtsan} is available as a shared library, and the @option{-static} @file{libtsan} is available as a shared library, and the @option{-static}
...@@ -10268,6 +10294,7 @@ driver to link @file{libtsan} statically, without necessarily linking ...@@ -10268,6 +10294,7 @@ driver to link @file{libtsan} statically, without necessarily linking
other libraries statically. other libraries statically.
@item -static-liblsan @item -static-liblsan
@opindex static-liblsan
When the @option{-fsanitize=leak} option is used to link a program, When the @option{-fsanitize=leak} option is used to link a program,
the GCC driver automatically links against @option{liblsan}. If the GCC driver automatically links against @option{liblsan}. If
@file{liblsan} is available as a shared library, and the @option{-static} @file{liblsan} is available as a shared library, and the @option{-static}
...@@ -10277,6 +10304,7 @@ driver to link @file{liblsan} statically, without necessarily linking ...@@ -10277,6 +10304,7 @@ driver to link @file{liblsan} statically, without necessarily linking
other libraries statically. other libraries statically.
@item -static-libubsan @item -static-libubsan
@opindex static-libubsan
When the @option{-fsanitize=undefined} option is used to link a program, When the @option{-fsanitize=undefined} option is used to link a program,
the GCC driver automatically links against @option{libubsan}. If the GCC driver automatically links against @option{libubsan}. If
@file{libubsan} is available as a shared library, and the @option{-static} @file{libubsan} is available as a shared library, and the @option{-static}
...@@ -10286,6 +10314,7 @@ driver to link @file{libubsan} statically, without necessarily linking ...@@ -10286,6 +10314,7 @@ driver to link @file{libubsan} statically, without necessarily linking
other libraries statically. other libraries statically.
@item -static-libstdc++ @item -static-libstdc++
@opindex static-libstdc++
When the @command{g++} program is used to link a C++ program, it When the @command{g++} program is used to link a C++ program, it
normally automatically links against @option{libstdc++}. If normally automatically links against @option{libstdc++}. If
@file{libstdc++} is available as a shared library, and the @file{libstdc++} is available as a shared library, and the
...@@ -10378,6 +10407,7 @@ If you really need to change the search order for system directories, ...@@ -10378,6 +10407,7 @@ If you really need to change the search order for system directories,
use the @option{-nostdinc} and/or @option{-isystem} options. use the @option{-nostdinc} and/or @option{-isystem} options.
@item -iplugindir=@var{dir} @item -iplugindir=@var{dir}
@opindex iplugindir=
Set the directory to search for plugins that are passed Set the directory to search for plugins that are passed
by @option{-fplugin=@var{name}} instead of by @option{-fplugin=@var{name}} instead of
@option{-fplugin=@var{path}/@var{name}.so}. This option is not meant @option{-fplugin=@var{path}/@var{name}.so}. This option is not meant
...@@ -11827,7 +11857,7 @@ Enable Rcw constraint handling - ccfsm condexec mostly depends on this. ...@@ -11827,7 +11857,7 @@ Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
This is the default. This is the default.
@item -msize-level=@var{level} @item -msize-level=@var{level}
@ opindex msize-level @opindex msize-level
Fine-tune size optimization with regards to instruction lengths and alignment. Fine-tune size optimization with regards to instruction lengths and alignment.
The recognized values for @var{level} are: The recognized values for @var{level} are:
@table @samp @table @samp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment