@samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
@table @gcctabopt
-@item -c
@opindex c
+@item -c
Compile or assemble the source files, but do not link. The linking
stage simply is not done. The ultimate output is in the form of an
object file for each source file.
Unrecognized input files, not requiring compilation or assembly, are
ignored.
-@item -S
@opindex S
+@item -S
Stop after the stage of compilation proper; do not assemble. The output
is in the form of an assembler code file for each non-assembler input
file specified.
Input files that don't require compilation are ignored.
-@item -E
@opindex E
+@item -E
Stop after the preprocessing stage; do not run the compiler proper. The
output is in the form of preprocessed source code, which is sent to the
standard output.
Input files that don't require preprocessing are ignored.
@cindex output file option
-@item -o @var{file}
@opindex o
+@item -o @var{file}
Place the primary output in file @var{file}. This applies to whatever
sort of output is being produced, whether it be an executable file, an
object file, an assembler file or preprocessed C code.
@option{-save-temps=obj}.
-@item -dumpbase @var{dumpbase}
@opindex dumpbase
+@item -dumpbase @var{dumpbase}
This option sets the base name for auxiliary and dump output files. It
does not affect the name of the primary output file. Intermediate
outputs, when preserved, are not regarded as primary outputs, but as
auxiliary files.
-@item -dumpbase-ext @var{auxdropsuf}
@opindex dumpbase-ext
+@item -dumpbase-ext @var{auxdropsuf}
When forming the name of an auxiliary (but not a dump) output file, drop
trailing @var{auxdropsuf} from @var{dumpbase} before appending any
suffixes. If not specified, this option defaults to the suffix of a
@file{main-foo.c.*} and @file{main-bar.c.*}.
-@item -dumpdir @var{dumppfx}
@opindex dumpdir
+@item -dumpdir @var{dumppfx}
When forming the name of an auxiliary or dump output file, use
@var{dumppfx} as a prefix:
component so that it overrides any @option{-dumpdir}, and passes that as
@option{-dumpbase} to sub-compilers.
-@item -v
@opindex v
+@item -v
Print (on standard error output) the commands executed to run the stages
of compilation. Also print the version number of the compiler driver
program and of the preprocessor and the compiler proper.
-@item -###
@opindex ###
+@item -###
Like @option{-v} except the commands are not executed and arguments
are quoted unless they contain only alphanumeric characters or @code{./-_}.
This is useful for shell scripts to capture the driver-generated command lines.
-@item --help
@opindex help
+@item --help
Print (on the standard output) a description of the command-line options
understood by @command{gcc}. If the @option{-v} option is also specified
then @option{--help} is also passed on to the various processes
(prior to the @option{--help} option), then command-line options that
have no documentation associated with them are also displayed.
-@item --target-help
@opindex target-help
+@item --target-help
Print (on the standard output) a description of target-specific command-line
options for each tool. For some targets extra target-specific
information may also be printed.
diff /tmp/O2-opts /tmp/O3-opts | grep enabled
@end smallexample
-@item --version
@opindex version
+@item --version
Display the version number and copyrights of the invoked GCC@.
-@item -pass-exit-codes
@opindex pass-exit-codes
+@item -pass-exit-codes
Normally the @command{gcc} program exits with the code of 1 if any
phase of the compiler returns a non-success return code. If you specify
@option{-pass-exit-codes}, the @command{gcc} program instead returns with
indication. The C, C++, and Fortran front ends return 4 if an internal
compiler error is encountered.
-@item -pipe
@opindex pipe
+@item -pipe
Use pipes rather than temporary files for communication between the
various stages of compilation. This fails to work on some systems where
the assembler is unable to read from a pipe; but the GNU assembler has
no trouble.
-@item -specs=@var{file}
@opindex specs
+@item -specs=@var{file}
Process @var{file} after the compiler reads in the standard @file{specs}
file, in order to override the defaults which the @command{gcc} driver
program uses when determining what switches to pass to @command{cc1},
are processed in order, from left to right. @xref{Spec Files}, for
information about the format of the @var{file}.
-@item -wrapper
@opindex wrapper
+@item -wrapper
Invoke all subcommands under a wrapper program. The name of the
wrapper program and its parameters are passed as a comma separated
list.
@samp{gdb --args}, thus the invocation of @command{cc1} is
@samp{gdb --args cc1 @dots{}}.
-@item -ffile-prefix-map=@var{old}=@var{new}
@opindex ffile-prefix-map
+@item -ffile-prefix-map=@var{old}=@var{new}
When compiling files residing in directory @file{@var{old}}, record
any references to them in the result of the compilation as if the
files resided in directory @file{@var{new}} instead. Specifying this
@option{-fmacro-prefix-map}, @option{-fdebug-prefix-map} and
@option{-fprofile-prefix-map}.
-@item -fplugin=@var{name}.so
@opindex fplugin
+@item -fplugin=@var{name}.so
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
the shared object file is used to identify the plugin for the
Each plugin should define the callback functions specified in the
Plugins API.
-@item -fplugin-arg-@var{name}-@var{key}=@var{value}
@opindex fplugin-arg
+@item -fplugin-arg-@var{name}-@var{key}=@var{value}
Define an argument called @var{key} with a value of @var{value}
for the plugin called @var{name}.
-@item -fdump-ada-spec@r{[}-slim@r{]}
@opindex fdump-ada-spec
+@item -fdump-ada-spec@r{[}-slim@r{]}
For C and C++ source and include files, generate corresponding Ada specs.
@xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
GNAT User's Guide}, which provides detailed documentation on this feature.
-@item -fada-spec-parent=@var{unit}
@opindex fada-spec-parent
+@item -fada-spec-parent=@var{unit}
In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
Ada specs as child units of parent @var{unit}.
-@item -fdump-go-spec=@var{file}
@opindex fdump-go-spec
+@item -fdump-go-spec=@var{file}
For input files in any language, generate corresponding Go
declarations in @var{file}. This generates Go @code{const},
@code{type}, @code{var}, and @code{func} declarations which may be a
@table @gcctabopt
@cindex ANSI support
@cindex ISO support
-@item -ansi
@opindex ansi
+@item -ansi
In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
equivalent to @option{-std=c++98}.
built-in functions provided by GCC}, for details of the functions
affected.
-@item -std=
@opindex std
+@item -std=
Determine the language standard. @xref{Standards,,Language Standards
Supported by GCC}, for details of these standard versions. This option
is currently only supported when compiling C or C++.
releases.
@end table
-@item -aux-info @var{filename}
@opindex aux-info
+@item -aux-info @var{filename}
Output to the given filename prototyped declarations for all functions
declared and/or defined in a translation unit, including those in header
files. This option is silently ignored in any language other than C@.
arguments followed by their declarations is also provided, inside
comments, after the declaration.
-@item -fno-asm
@opindex fno-asm
@opindex fasm
+@item -fno-asm
Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
keyword, so that code can use these words as identifiers. You can use
the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
the @code{asm} keyword, since @code{typeof} is a standard keyword in
ISO C2X.
-@item -fno-builtin
-@itemx -fno-builtin-@var{function}
@opindex fno-builtin
@opindex fbuiltin
+@item -fno-builtin
+@itemx -fno-builtin-@var{function}
@cindex built-in functions
Don't recognize built-in functions that do not begin with
@samp{__builtin_} as prefix. @xref{Other Builtins,,Other built-in
#define strcpy(d, s) __builtin_strcpy ((d), (s))
@end smallexample
-@item -fcond-mismatch
@opindex fcond-mismatch
+@item -fcond-mismatch
Allow conditional expressions with mismatched types in the second and
third arguments. The value of such an expression is void. This option
is not supported for C++.
-@item -ffreestanding
@opindex ffreestanding
+@item -ffreestanding
@cindex hosted environment
Assert that compilation targets a freestanding environment. This
@xref{Standards,,Language Standards Supported by GCC}, for details of
freestanding and hosted environments.
-@item -fgimple
@opindex fgimple
+@item -fgimple
Enable parsing of function definitions marked with @code{__GIMPLE}.
This is an experimental feature that allows unit testing of GIMPLE
passes.
-@item -fgnu-tm
@opindex fgnu-tm
+@item -fgnu-tm
When the option @option{-fgnu-tm} is specified, the compiler
generates code for the Linux variant of Intel's current Transactional
Memory ABI specification document (Revision 1.1, May 6 2009). This is
Note that the transactional memory feature is not supported with
non-call exceptions (@option{-fnon-call-exceptions}).
-@item -fgnu89-inline
@opindex fgnu89-inline
+@item -fgnu89-inline
The option @option{-fgnu89-inline} tells GCC to use the traditional
GNU semantics for @code{inline} functions when in C99 mode.
@xref{Inline,,An Inline Function is As Fast As a Macro}.
in effect for @code{inline} functions. @xref{Common Predefined
Macros,,,cpp,The C Preprocessor}.
-@item -fhosted
@opindex fhosted
+@item -fhosted
@cindex hosted environment
Assert that compilation targets a hosted environment. This implies
type of @code{int}. Examples are nearly everything except a kernel.
This is equivalent to @option{-fno-freestanding}.
-@item -flax-vector-conversions
@opindex flax-vector-conversions
+@item -flax-vector-conversions
Allow implicit conversions between vectors with differing numbers of
elements and/or incompatible element types. This option should not be
used for new code.
-@item -fms-extensions
@opindex fms-extensions
+@item -fms-extensions
Accept some non-standard constructs used in Microsoft header files.
In C++ code, this allows member names in structures to be similar
Note that this option is off for all targets except for x86
targets using ms-abi.
+@opindex foffload
@item -foffload=disable
@itemx -foffload=default
@itemx -foffload=@var{target-list}
-@opindex foffload
@cindex Offloading targets
@cindex OpenACC offloading targets
@cindex OpenMP offloading targets
run the compiler with @option{-v} to show the list of configured offload targets
under @code{OFFLOAD_TARGET_NAMES}.
+@opindex foffload-options
@item -foffload-options=@var{options}
@itemx -foffload-options=@var{target-triplet-list}=@var{options}
-@opindex foffload-options
@cindex Offloading options
@cindex OpenACC offloading options
@cindex OpenMP offloading options
-foffload-options=amdgcn-amdhsa=-march=gfx906 -foffload-options=-lm
@end smallexample
-@item -fopenacc
@opindex fopenacc
+@item -fopenacc
@cindex OpenACC accelerator programming
Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
@code{!$acc} in Fortran. When @option{-fopenacc} is specified, the
implies @option{-pthread}, and thus is only supported on targets that
have support for @option{-pthread}.
-@item -fopenacc-dim=@var{geom}
@opindex fopenacc-dim
+@item -fopenacc-dim=@var{geom}
@cindex OpenACC accelerator programming
Specify default compute dimensions for parallel offload regions that do
not explicitly specify. The @var{geom} value is a triple of
':'-separated sizes, in order 'gang', 'worker' and, 'vector'. A size
can be omitted, to use a target-specific default value.
-@item -fopenmp
@opindex fopenmp
+@item -fopenmp
@cindex OpenMP parallel
Enable handling of OpenMP directives @code{#pragma omp} in C/C++,
@code{[[omp::directive(...)]]} and @code{[[omp::sequence(...)]]} in C++ and
have support for @option{-pthread}. @option{-fopenmp} implies
@option{-fopenmp-simd}.
-@item -fopenmp-simd
@opindex fopenmp-simd
+@item -fopenmp-simd
@cindex OpenMP SIMD
@cindex SIMD
Enable handling of OpenMP's @code{simd}, @code{declare simd},
@code{[[omp::directive(...)]]} and @code{[[omp::sequence(...)]]} in C++
and @code{!$omp} in Fortran. Other OpenMP directives are ignored.
+@opindex fopenmp-target-simd-clone
@item -fopenmp-target-simd-clone
@item -fopenmp-target-simd-clone=@var{device-type}
-@opindex fopenmp-target-simd-clone
@cindex OpenMP target SIMD clone
In addition to generating SIMD clones for functions marked with the
@code{declare simd} directive, GCC also generates clones
optimization defaults to @option{-fopenmp-target-simd-clone=nohost}; otherwise
it is disabled by default.
-@item -fpermitted-flt-eval-methods=@var{style}
@opindex fpermitted-flt-eval-methods
@opindex fpermitted-flt-eval-methods=c11
@opindex fpermitted-flt-eval-methods=ts-18661-3
+@item -fpermitted-flt-eval-methods=@var{style}
ISO/IEC TS 18661-3 defines new permissible values for
@code{FLT_EVAL_METHOD} that indicate that operations and constants with
a semantic type that is an interchange or extended format should be
dialect (@option{-std=gnu11} or similar) is
@option{-fpermitted-flt-eval-methods=ts-18661-3}.
-@item -fplan9-extensions
@opindex fplan9-extensions
+@item -fplan9-extensions
Accept some non-standard constructs used in Plan 9 code.
This enables @option{-fms-extensions}, permits passing pointers to
struct/union fields within structs/unions}, for details. This is only
supported for C, not C++.
-@item -fsigned-bitfields
-@itemx -funsigned-bitfields
-@itemx -fno-signed-bitfields
-@itemx -fno-unsigned-bitfields
@opindex fsigned-bitfields
@opindex funsigned-bitfields
@opindex fno-signed-bitfields
@opindex fno-unsigned-bitfields
+@item -fsigned-bitfields
+@itemx -funsigned-bitfields
+@itemx -fno-signed-bitfields
+@itemx -fno-unsigned-bitfields
These options control whether a bit-field is signed or unsigned, when the
declaration does not use either @code{signed} or @code{unsigned}. By
default, such a bit-field is signed, because this is consistent: the
basic integer types such as @code{int} are signed types.
-@item -fsigned-char
@opindex fsigned-char
+@item -fsigned-char
Let the type @code{char} be signed, like @code{signed char}.
Note that this is equivalent to @option{-fno-unsigned-char}, which is
the negative form of @option{-funsigned-char}. Likewise, the option
@option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
-@item -funsigned-char
@opindex funsigned-char
+@item -funsigned-char
Let the type @code{char} be unsigned, like @code{unsigned char}.
Each kind of machine has a default for what @code{char} should
@code{signed char} or @code{unsigned char}, even though its behavior
is always just like one of those two.
-@item -fstrict-flex-arrays
@opindex fstrict-flex-arrays
@opindex fno-strict-flex-arrays
+@item -fstrict-flex-arrays
Control when to treat the trailing array of a structure as a flexible array
member for the purpose of accessing the elements of such an array.
The positive form is equivalent to @option{-fstrict-flex-arrays=3}, which is the
least strict. All trailing arrays of structures are treated as flexible array
members.
-@item -fstrict-flex-arrays=@var{level}
@opindex fstrict-flex-arrays=@var{level}
+@item -fstrict-flex-arrays=@var{level}
Control when to treat the trailing array of a structure as a flexible array
member for the purpose of accessing the elements of such an array. The value
of @var{level} controls the level of strictness.
structure by using the variable attribute @code{strict_flex_array} attribute
(@pxref{Variable Attributes}).
-@item -fsso-struct=@var{endianness}
@opindex fsso-struct
+@item -fsso-struct=@var{endianness}
Set the default scalar storage order of structures and unions to the
specified endianness. The accepted values are @samp{big-endian},
@samp{little-endian} and @samp{native} for the native endianness of
@table @gcctabopt
-@item -fabi-version=@var{n}
@opindex fabi-version
+@item -fabi-version=@var{n}
Use version @var{n} of the C++ ABI@. The default is version 0.
Version 0 refers to the version conforming most closely to
See also @option{-Wabi}.
-@item -fabi-compat-version=@var{n}
@opindex fabi-compat-version
+@item -fabi-compat-version=@var{n}
On targets that support strong aliases, G++
works around mangling changes by creating an alias with the correct
mangled name when defining a symbol with an incorrect mangled name.
along with @option{-Wabi} (without the version), the version from this
option is used for the warning.
-@item -fno-access-control
@opindex fno-access-control
@opindex faccess-control
+@item -fno-access-control
Turn off all access checking. This switch is mainly useful for working
around bugs in the access control code.
-@item -faligned-new
@opindex faligned-new
+@item -faligned-new
Enable support for C++17 @code{new} of types that require more
alignment than @code{void* ::operator new(std::size_t)} provides. A
numeric argument such as @code{-faligned-new=32} can be used to
This flag is enabled by default for @option{-std=c++17}.
-@item -fchar8_t
-@itemx -fno-char8_t
@opindex fchar8_t
@opindex fno-char8_t
+@item -fchar8_t
+@itemx -fno-char8_t
Enable support for @code{char8_t} as adopted for C++20. This includes
the addition of a new @code{char8_t} fundamental type, changes to the
types of UTF-8 string and character literals, new signatures for
// type `basic_string<char>' requested
@end smallexample
-@item -fcheck-new
@opindex fcheck-new
+@item -fcheck-new
Check that the pointer returned by @code{operator new} is non-null
before attempting to modify the storage allocated. This check is
normally unnecessary because the C++ standard specifies that
exhaustion is signalled by throwing @code{std::bad_alloc}. See also
@samp{new (nothrow)}.
-@item -fconcepts
-@itemx -fconcepts-ts
@opindex fconcepts
@opindex fconcepts-ts
+@item -fconcepts
+@itemx -fconcepts-ts
Enable support for the C++ Concepts feature for constraining template
arguments. With @option{-std=c++20} and above, Concepts are part of
the language standard, so @option{-fconcepts} defaults to on.
into the standard, can additionally be enabled by
@option{-fconcepts-ts}.
-@item -fconstexpr-depth=@var{n}
@opindex fconstexpr-depth
+@item -fconstexpr-depth=@var{n}
Set the maximum nested evaluation depth for C++11 constexpr functions
to @var{n}. A limit is needed to detect endless recursion during
constant expression evaluation. The minimum specified by the standard
is 512.
-@item -fconstexpr-cache-depth=@var{n}
@opindex fconstexpr-cache-depth
+@item -fconstexpr-cache-depth=@var{n}
Set the maximum level of nested evaluation depth for C++11 constexpr
functions that will be cached to @var{n}. This is a heuristic that
trades off compilation speed (when the cache avoids repeated
constexpr calculations you might want to experiment to find which
value works best for you.
-@item -fconstexpr-fp-except
@opindex fconstexpr-fp-except
+@item -fconstexpr-fp-except
Annex F of the C standard specifies that IEC559 floating point
exceptions encountered at compile time should not stop compilation.
C++ compilers have historically not followed this guidance, instead
constexpr float inf = 1./0.; // OK with -fconstexpr-fp-except
@end smallexample
-@item -fconstexpr-loop-limit=@var{n}
@opindex fconstexpr-loop-limit
+@item -fconstexpr-loop-limit=@var{n}
Set the maximum number of iterations for a loop in C++14 constexpr functions
to @var{n}. A limit is needed to detect infinite loops during
constant expression evaluation. The default is 262144 (1<<18).
-@item -fconstexpr-ops-limit=@var{n}
@opindex fconstexpr-ops-limit
+@item -fconstexpr-ops-limit=@var{n}
Set the maximum number of operations during a single constexpr evaluation.
Even when number of iterations of a single loop is limited with the above limit,
if there are several nested loops and each of them has many iterations but still
evaluation might take too long.
The default is 33554432 (1<<25).
-@item -fcontracts
@opindex fcontracts
+@item -fcontracts
Enable experimental support for the C++ Contracts feature, as briefly
added to and then removed from the C++20 working paper (N4820). The
implementation also includes proposed enhancements from papers P1290,
used together.
@table @gcctabopt
-@item -fcontract-mode=[on|off]
@opindex fcontract-mode
+@item -fcontract-mode=[on|off]
Control whether any contracts have any semantics at all. Defaults to on.
-@item -fcontract-assumption-mode=[on|off]
@opindex fcontract-assumption-mode
+@item -fcontract-assumption-mode=[on|off]
[N4820] Control whether contracts with level @samp{axiom}
should have the assume semantic. Defaults to on.
-@item -fcontract-build-level=[off|default|audit]
@opindex fcontract-build-level
+@item -fcontract-build-level=[off|default|audit]
[N4820] Specify which level of contracts to generate checks
for. Defaults to @samp{default}.
-@item -fcontract-continuation-mode=[on|off]
@opindex fcontract-continuation-mode
+@item -fcontract-continuation-mode=[on|off]
[N4820] Control whether to allow the program to continue executing
after a contract violation. That is, do checked contracts have the
@samp{maybe} semantic described below rather than the @samp{never}
semantic. Defaults to off.
-@item -fcontract-role=<name>:<default>,<audit>,<axiom>
@opindex fcontract-role
+@item -fcontract-role=<name>:<default>,<audit>,<axiom>
[P1332] Specify the concrete semantics for each contract level
of a particular contract role.
[P1429] Specify the concrete semantic for a particular
contract level.
-@item -fcontract-strict-declarations=[on|off]
@opindex fcontract-strict-declarations
+@item -fcontract-strict-declarations=[on|off]
Control whether to reject adding contracts to a function after its
first declaration. Defaults to off.
@end table
called. If the handler returns, execution continues normally.
@end table
-@item -fcoroutines
@opindex fcoroutines
+@item -fcoroutines
Enable support for the C++ coroutines extension (experimental).
-@item -fno-elide-constructors
@opindex fno-elide-constructors
@opindex felide-constructors
+@item -fno-elide-constructors
The C++ standard allows an implementation to omit creating a temporary
that is only used to initialize another object of the same type.
Specifying this option disables that optimization, and forces G++ to
In C++17, the compiler is required to omit these temporaries, but this
option still affects trivial member functions.
-@item -fno-enforce-eh-specs
@opindex fno-enforce-eh-specs
@opindex fenforce-eh-specs
+@item -fno-enforce-eh-specs
Don't generate code to check for violation of exception specifications
at run time. This option violates the C++ standard, but may be useful
for reducing code size in production builds, much like defining
still optimizes based on the specifications, so throwing an
unexpected exception results in undefined behavior at run time.
-@item -fextern-tls-init
-@itemx -fno-extern-tls-init
@opindex fextern-tls-init
@opindex fno-extern-tls-init
+@item -fextern-tls-init
+@itemx -fno-extern-tls-init
The C++11 and OpenMP standards allow @code{thread_local} and
@code{threadprivate} variables to have dynamic (runtime)
initialization. To support this, any use of such a variable goes
@option{-fextern-tls-init}. On targets that do not support symbol
aliases, the default is @option{-fno-extern-tls-init}.
-@item -ffold-simple-inlines
-@itemx -fno-fold-simple-inlines
@opindex ffold-simple-inlines
@opindex fno-fold-simple-inlines
+@item -ffold-simple-inlines
+@itemx -fno-fold-simple-inlines
Permit the C++ frontend to fold calls to @code{std::move}, @code{std::forward},
@code{std::addressof} and @code{std::as_const}. In contrast to inlining, this
means no debug information will be generated for such calls. Since these
functions are rarely interesting to debug, this flag is enabled by default
unless @option{-fno-inline} is active.
-@item -fno-gnu-keywords
@opindex fno-gnu-keywords
@opindex fgnu-keywords
+@item -fno-gnu-keywords
Do not recognize @code{typeof} as a keyword, so that code can use this
word as an identifier. You can use the keyword @code{__typeof__} instead.
This option is implied by the strict ISO C++ dialects: @option{-ansi},
@option{-std=c++98}, @option{-std=c++11}, etc.
-@item -fimplicit-constexpr
@opindex fimplicit-constexpr
+@item -fimplicit-constexpr
Make inline functions implicitly constexpr, if they satisfy the
requirements for a constexpr function. This option can be used in
C++14 mode or later. This can result in initialization changing from
dynamic to static and other optimizations.
-@item -fno-implicit-templates
@opindex fno-implicit-templates
@opindex fimplicit-templates
+@item -fno-implicit-templates
Never emit code for non-inline templates that are instantiated
implicitly (i.e.@: by use); only emit code for explicit instantiations.
If you use this option, you must take care to structure your code to
undefined symbols at link time.
@xref{Template Instantiation}, for more information.
-@item -fno-implicit-inline-templates
@opindex fno-implicit-inline-templates
@opindex fimplicit-inline-templates
+@item -fno-implicit-inline-templates
Don't emit code for implicit instantiations of inline templates, either.
The default is to handle inlines differently so that compiles with and
without optimization need the same set of explicit instantiations.
-@item -fno-implement-inlines
@opindex fno-implement-inlines
@opindex fimplement-inlines
+@item -fno-implement-inlines
To save space, do not emit out-of-line copies of inline functions
controlled by @code{#pragma implementation}. This causes linker
errors if these functions are not inlined everywhere they are called.
-@item -fmodules-ts
-@itemx -fno-modules-ts
@opindex fmodules-ts
@opindex fno-modules-ts
+@item -fmodules-ts
+@itemx -fno-modules-ts
Enable support for C++20 modules (@pxref{C++ Modules}). The
@option{-fno-modules-ts} is usually not needed, as that is the
default. Even though this is a C++20 feature, it is not currently
implicitly enabled by selecting that standard version.
+@opindex fmodule-header
@item -fmodule-header
@itemx -fmodule-header=user
@itemx -fmodule-header=system
-@opindex fmodule-header
Compile a header file to create an importable header unit.
-@item -fmodule-implicit-inline
@opindex fmodule-implicit-inline
+@item -fmodule-implicit-inline
Member functions defined in their class definitions are not implicitly
inline for modular code. This is different to traditional C++
behavior, for good reasons. However, it may result in a difficulty
so you must use it everywhere or nowhere. (Such definitions outside
of a named module remain implicitly inline, regardless.)
-@item -fno-module-lazy
@opindex fno-module-lazy
@opindex fmodule-lazy
+@item -fno-module-lazy
Disable lazy module importing and module mapper creation.
@item -fmodule-mapper=@r{[}@var{hostname}@r{]}:@var{port}@r{[}?@var{ident}@r{]}
unspecified the @env{CXX_MODULE_MAPPER} environment variable is used,
and if that is unset, an in-process default is provided.
-@item -fmodule-only
@opindex fmodule-only
+@item -fmodule-only
Only emit the Compiled Module Interface, inhibiting any object file.
-@item -fms-extensions
@opindex fms-extensions
+@item -fms-extensions
Disable Wpedantic warnings about constructs used in MFC, such as implicit
int and getting a pointer to member function via non-standard syntax.
-@item -fnew-inheriting-ctors
@opindex fnew-inheriting-ctors
+@item -fnew-inheriting-ctors
Enable the P0136 adjustment to the semantics of C++11 constructor
inheritance. This is part of C++17 but also considered to be a Defect
Report against C++11 and C++14. This flag is enabled by default
unless @option{-fabi-version=10} or lower is specified.
-@item -fnew-ttp-matching
@opindex fnew-ttp-matching
+@item -fnew-ttp-matching
Enable the P0522 resolution to Core issue 150, template template
parameters and default arguments: this allows a template with default
template arguments as an argument for a template template parameter
with fewer template parameters. This flag is enabled by default for
@option{-std=c++17}.
-@item -fno-nonansi-builtins
@opindex fno-nonansi-builtins
@opindex fnonansi-builtins
+@item -fno-nonansi-builtins
Disable built-in declarations of functions that are not mandated by
ANSI/ISO C@. These include @code{ffs}, @code{alloca}, @code{_exit},
@code{index}, @code{bzero}, @code{conjf}, and other related functions.
-@item -fnothrow-opt
@opindex fnothrow-opt
+@item -fnothrow-opt
Treat a @code{throw()} exception specification as if it were a
@code{noexcept} specification to reduce or eliminate the text size
overhead relative to a function with no exception specification. If
a function with such an exception specification results in a call
to @code{terminate} rather than @code{unexpected}.
-@item -fno-operator-names
@opindex fno-operator-names
@opindex foperator-names
+@item -fno-operator-names
Do not treat the operator name keywords @code{and}, @code{bitand},
@code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
synonyms as keywords.
-@item -fno-optional-diags
@opindex fno-optional-diags
@opindex foptional-diags
+@item -fno-optional-diags
Disable diagnostics that the standard says a compiler does not need to
issue. Currently, the only such diagnostic issued by G++ is the one for
a name having multiple meanings within a class.
-@item -fpermissive
@opindex fpermissive
+@item -fpermissive
Downgrade some diagnostics about nonconformant code from errors to
warnings. Thus, using @option{-fpermissive} allows some
nonconforming code to compile.
-@item -fno-pretty-templates
@opindex fno-pretty-templates
@opindex fpretty-templates
+@item -fno-pretty-templates
When an error message refers to a specialization of a function
template, the compiler normally prints the signature of the
template followed by the template arguments and any typedefs or
behaviors make it harder to understand the error message rather than
easier, you can use @option{-fno-pretty-templates} to disable them.
-@item -fno-rtti
@opindex fno-rtti
@opindex frtti
+@item -fno-rtti
Disable generation of information about every class with virtual
functions for use by the C++ run-time type identification features
(@code{dynamic_cast} and @code{typeid}). If you don't use those parts
fail to link if a class compiled with @option{-fno-rtti} is used as a base
for a class compiled with @option{-frtti}.
-@item -fsized-deallocation
@opindex fsized-deallocation
+@item -fsized-deallocation
Enable the built-in global declarations
@smallexample
void operator delete (void *, std::size_t) noexcept;
@option{-std=c++14} and above. The flag @option{-Wsized-deallocation}
warns about places that might want to add a definition.
-@item -fstrict-enums
@opindex fstrict-enums
+@item -fstrict-enums
Allow the compiler to optimize using the assumption that a value of
enumerated type can only be one of the values of the enumeration (as
defined in the C++ standard; basically, a value that can be
enumerators). This assumption may not be valid if the program uses a
cast to convert an arbitrary integer value to the enumerated type.
-@item -fstrong-eval-order
@opindex fstrong-eval-order
+@item -fstrong-eval-order
Evaluate member access, array subscripting, and shift expressions in
left-to-right order, and evaluate assignment in right-to-left order,
as adopted for C++17. Enabled by default with @option{-std=c++17}.
access and shift expressions, and is the default without
@option{-std=c++17}.
-@item -ftemplate-backtrace-limit=@var{n}
@opindex ftemplate-backtrace-limit
+@item -ftemplate-backtrace-limit=@var{n}
Set the maximum number of template instantiation notes for a single
warning or error to @var{n}. The default value is 10.
-@item -ftemplate-depth=@var{n}
@opindex ftemplate-depth
+@item -ftemplate-depth=@var{n}
Set the maximum instantiation depth for template classes to @var{n}.
A limit on the template instantiation depth is needed to detect
endless recursions during template class instantiation. ANSI/ISO C++
(changed to 1024 in C++11). The default value is 900, as the compiler
can run out of stack space before hitting 1024 in some situations.
-@item -fno-threadsafe-statics
@opindex fno-threadsafe-statics
@opindex fthreadsafe-statics
+@item -fno-threadsafe-statics
Do not emit the extra code to use the routines specified in the C++
ABI for thread-safe initialization of local statics. You can use this
option to reduce code size slightly in code that doesn't need to be
thread-safe.
-@item -fuse-cxa-atexit
@opindex fuse-cxa-atexit
+@item -fuse-cxa-atexit
Register destructors for objects with static storage duration with the
@code{__cxa_atexit} function rather than the @code{atexit} function.
This option is required for fully standards-compliant handling of static
destructors, but only works if your C library supports
@code{__cxa_atexit}.
-@item -fno-use-cxa-get-exception-ptr
@opindex fno-use-cxa-get-exception-ptr
@opindex fuse-cxa-get-exception-ptr
+@item -fno-use-cxa-get-exception-ptr
Don't use the @code{__cxa_get_exception_ptr} runtime routine. This
causes @code{std::uncaught_exception} to be incorrect, but is necessary
if the runtime routine is not available.
-@item -fvisibility-inlines-hidden
@opindex fvisibility-inlines-hidden
+@item -fvisibility-inlines-hidden
This switch declares that the user does not attempt to compare
pointers to inline functions or methods where the addresses of the two functions
are taken in different shared objects.
as their linkage might otherwise cross a shared library boundary.
@xref{Template Instantiation}.
-@item -fvisibility-ms-compat
@opindex fvisibility-ms-compat
+@item -fvisibility-ms-compat
This flag attempts to use visibility settings to make GCC's C++
linkage model compatible with that of Microsoft Visual Studio.
objects may not compare equal. When this flag is given, it is a
violation of the ODR to define types with the same name differently.
-@item -fno-weak
@opindex fno-weak
@opindex fweak
+@item -fno-weak
Do not use weak symbol support, even if it is provided by the linker.
By default, G++ uses weak symbols if they are available. This
option exists only for testing, and should not be used by end-users;
it results in inferior code and has no benefits. This option may
be removed in a future release of G++.
-@item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
@opindex fext-numeric-literals
@opindex fno-ext-numeric-literals
+@item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
Accept imaginary, fixed-point, or machine-defined
literal number suffixes as GNU extensions.
When this option is turned off these suffixes are treated
This option is off by default
for ISO C++11 onwards (@option{-std=c++11}, ...).
-@item -nostdinc++
@opindex nostdinc++
+@item -nostdinc++
Do not search for header files in the standard directories specific to
C++, but do still search the other standard directories. (This option
is used when building the C++ library.)
+@opindex flang-info-include-translate
+@opindex flang-info-include-translate-not
@item -flang-info-include-translate
@itemx -flang-info-include-translate-not
@itemx -flang-info-include-translate=@var{header}
-@opindex flang-info-include-translate
-@opindex flang-info-include-translate-not
Inform of include translation events. The first will note accepted
include translations, the second will note declined include
translations. The @var{header} form will inform of include
the form @code{"user"} or @code{<system>} it will be resolved to a
specific user or system header using the include path.
+@opindex flang-info-module-cmi
@item -flang-info-module-cmi
@itemx -flang-info-module-cmi=@var{module}
-@opindex flang-info-module-cmi
Inform of Compiled Module Interface pathnames. The first will note
all read CMI pathnames. The @var{module} form will not reading a
specific module's CMI. @var{module} may be a named module or a
header-unit (the latter indicated by either being a pathname containing
directory separators or enclosed in @code{<>} or @code{""}).
-@item -stdlib=@var{libstdc++,libc++}
@opindex stdlib
+@item -stdlib=@var{libstdc++,libc++}
When G++ is configured to support this option, it allows specification of
alternate C++ runtime libraries. Two options are available: @var{libstdc++}
(the default, native C++ runtime for G++) and @var{libc++} which is the
In addition, these warning options have meanings only for C++ programs:
@table @gcctabopt
-@item -Wabi-tag @r{(C++ and Objective-C++ only)}
@opindex Wabi-tag
+@item -Wabi-tag @r{(C++ and Objective-C++ only)}
Warn when a type with an ABI tag is used in a context that does not
have that ABI tag. See @ref{C++ Attributes} for more information
about ABI tags.
-@item -Wcomma-subscript @r{(C++ and Objective-C++ only)}
@opindex Wcomma-subscript
@opindex Wno-comma-subscript
+@item -Wcomma-subscript @r{(C++ and Objective-C++ only)}
Warn about uses of a comma expression within a subscripting expression.
This usage was deprecated in C++20 and is going to be removed in C++23.
However, a comma expression wrapped in @code{( )} is not deprecated. Example:
Enabled by default with @option{-std=c++20} unless @option{-Wno-deprecated},
and with @option{-std=c++23} regardless of @option{-Wno-deprecated}.
-@item -Wctad-maybe-unsupported @r{(C++ and Objective-C++ only)}
@opindex Wctad-maybe-unsupported
@opindex Wno-ctad-maybe-unsupported
+@item -Wctad-maybe-unsupported @r{(C++ and Objective-C++ only)}
Warn when performing class template argument deduction (CTAD) on a type with
no explicitly written deduction guides. This warning will point out cases
where CTAD succeeded only because the compiler synthesized the implicit
S(allow_ctad_t) -> S<void>; // guide with incomplete parameter type will never be considered
@end smallexample
-@item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
@opindex Wctor-dtor-privacy
@opindex Wno-ctor-dtor-privacy
+@item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
Warn when a class seems unusable because all the constructors or
destructors in that class are private, and it has neither friends nor
public static member functions. Also warn if there are no non-private
methods, and there's at least one private member function that isn't
a constructor or destructor.
-@item -Wdangling-reference @r{(C++ and Objective-C++ only)}
@opindex Wdangling-reference
@opindex Wno-dangling-reference
+@item -Wdangling-reference @r{(C++ and Objective-C++ only)}
Warn when a reference is bound to a temporary whose lifetime has ended.
For example:
This warning is enabled by @option{-Wall}.
-@item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
@opindex Wdelete-non-virtual-dtor
@opindex Wno-delete-non-virtual-dtor
+@item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
Warn when @code{delete} is used to destroy an instance of a class that
has virtual functions and non-virtual destructor. It is unsafe to delete
an instance of a derived class through a pointer to a base class if the
base class does not have a virtual destructor. This warning is enabled
by @option{-Wall}.
-@item -Wdeprecated-copy @r{(C++ and Objective-C++ only)}
@opindex Wdeprecated-copy
@opindex Wno-deprecated-copy
+@item -Wdeprecated-copy @r{(C++ and Objective-C++ only)}
Warn that the implicit declaration of a copy constructor or copy
assignment operator is deprecated if the class has a user-provided
copy constructor or copy assignment operator, in C++11 and up. This
@option{-Wdeprecated-copy-dtor}, also deprecate if the class has a
user-provided destructor.
-@item -Wno-deprecated-enum-enum-conversion @r{(C++ and Objective-C++ only)}
@opindex Wdeprecated-enum-enum-conversion
@opindex Wno-deprecated-enum-enum-conversion
+@item -Wno-deprecated-enum-enum-conversion @r{(C++ and Objective-C++ only)}
Disable the warning about the case when the usual arithmetic conversions
are applied on operands where one is of enumeration type and the other is
of a different enumeration type. This conversion was deprecated in C++20.
@option{-std=c++20}. In pre-C++20 dialects, this warning can be enabled
by @option{-Wenum-conversion}.
-@item -Wno-deprecated-enum-float-conversion @r{(C++ and Objective-C++ only)}
@opindex Wdeprecated-enum-float-conversion
@opindex Wno-deprecated-enum-float-conversion
+@item -Wno-deprecated-enum-float-conversion @r{(C++ and Objective-C++ only)}
Disable the warning about the case when the usual arithmetic conversions
are applied on operands where one is of enumeration type and the other is
of a floating-point type. This conversion was deprecated in C++20. For
@option{-std=c++20}. In pre-C++20 dialects, this warning can be enabled
by @option{-Wenum-conversion}.
-@item -Wno-init-list-lifetime @r{(C++ and Objective-C++ only)}
@opindex Winit-list-lifetime
@opindex Wno-init-list-lifetime
+@item -Wno-init-list-lifetime @r{(C++ and Objective-C++ only)}
Do not warn about uses of @code{std::initializer_list} that are likely
to result in dangling pointers. Since the underlying array for an
@code{initializer_list} is handled like a normal C++ temporary object,
@end itemize
-@item -Winvalid-constexpr
@opindex Winvalid-constexpr
@opindex Wno-invalid-constexpr
+@item -Winvalid-constexpr
Warn when a function never produces a constant expression. In C++20
and earlier, for every @code{constexpr} function and function template,
@}
@end smallexample
-@item -Winvalid-imported-macros
@opindex Winvalid-imported-macros
@opindex Wno-invalid-imported-macros
+@item -Winvalid-imported-macros
Verify all imported macro definitions are valid at the end of
compilation. This is not enabled by default, as it requires
additional processing to determine. It may be useful when preparing
sets of header-units to ensure consistent macros.
-@item -Wno-literal-suffix @r{(C++ and Objective-C++ only)}
@opindex Wliteral-suffix
@opindex Wno-literal-suffix
+@item -Wno-literal-suffix @r{(C++ and Objective-C++ only)}
Do not warn when a string or character literal is followed by a
ud-suffix which does not begin with an underscore. As a conforming
extension, GCC treats such suffixes as separate preprocessing tokens
These warnings are enabled by default.
-@item -Wno-narrowing @r{(C++ and Objective-C++ only)}
@opindex Wnarrowing
@opindex Wno-narrowing
+@item -Wno-narrowing @r{(C++ and Objective-C++ only)}
For C++11 and later standards, narrowing conversions are diagnosed by default,
as required by the standard. A narrowing conversion from a constant produces
an error, and a narrowing conversion from a non-constant produces a warning,
This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
-@item -Wnoexcept @r{(C++ and Objective-C++ only)}
@opindex Wnoexcept
@opindex Wno-noexcept
+@item -Wnoexcept @r{(C++ and Objective-C++ only)}
Warn when a noexcept-expression evaluates to false because of a call
to a function that does not have a non-throwing exception
specification (i.e. @code{throw()} or @code{noexcept}) but is known by
the compiler to never throw an exception.
-@item -Wnoexcept-type @r{(C++ and Objective-C++ only)}
@opindex Wnoexcept-type
@opindex Wno-noexcept-type
+@item -Wnoexcept-type @r{(C++ and Objective-C++ only)}
Warn if the C++17 feature making @code{noexcept} part of a function
type changes the mangled name of a symbol relative to C++14. Enabled
by @option{-Wabi} and @option{-Wc++17-compat}.
In C++14, @code{f} calls @code{f<void(*)()>}, but in
C++17 it calls @code{f<void(*)()noexcept>}.
-@item -Wclass-memaccess @r{(C++ and Objective-C++ only)}
@opindex Wclass-memaccess
@opindex Wno-class-memaccess
+@item -Wclass-memaccess @r{(C++ and Objective-C++ only)}
Warn when the destination of a call to a raw memory function such as
@code{memset} or @code{memcpy} is an object of class type, and when writing
into such an object might bypass the class non-trivial or deleted constructor
to a type that can be safely accessed by the raw memory function suppresses
the warning.
-@item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
@opindex Wnon-virtual-dtor
@opindex Wno-non-virtual-dtor
+@item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
Warn when a class has virtual functions and an accessible non-virtual
destructor itself or in an accessible polymorphic base class, in which
case it is possible but unsafe to delete an instance of a derived
should be preferred because it warns about the unsafe cases without false
positives.
-@item -Wregister @r{(C++ and Objective-C++ only)}
@opindex Wregister
@opindex Wno-register
+@item -Wregister @r{(C++ and Objective-C++ only)}
Warn on uses of the @code{register} storage class specifier, except
when it is part of the GNU @ref{Explicit Register Variables} extension.
The use of the @code{register} keyword as storage class specifier has
been deprecated in C++11 and removed in C++17.
Enabled by default with @option{-std=c++17}.
-@item -Wreorder @r{(C++ and Objective-C++ only)}
@opindex Wreorder
@opindex Wno-reorder
+@item -Wreorder @r{(C++ and Objective-C++ only)}
@cindex reordering, warning
@cindex warning for reordering of member initializers
Warn when the order of member initializers given in the code does not
and @code{j} to match the declaration order of the members, emitting
a warning to that effect. This warning is enabled by @option{-Wall}.
-@item -Wno-pessimizing-move @r{(C++ and Objective-C++ only)}
@opindex Wpessimizing-move
@opindex Wno-pessimizing-move
+@item -Wno-pessimizing-move @r{(C++ and Objective-C++ only)}
This warning warns when a call to @code{std::move} prevents copy
elision. A typical scenario when copy elision can occur is when returning in
a function with a class return type, when the expression being returned is the
This warning is enabled by @option{-Wall}.
-@item -Wno-redundant-move @r{(C++ and Objective-C++ only)}
@opindex Wredundant-move
@opindex Wno-redundant-move
+@item -Wno-redundant-move @r{(C++ and Objective-C++ only)}
This warning warns about redundant calls to @code{std::move}; that is, when
a move operation would have been performed even without the @code{std::move}
call. This happens because the compiler is forced to treat the object as if
This warning is enabled by @option{-Wextra}.
-@item -Wrange-loop-construct @r{(C++ and Objective-C++ only)}
@opindex Wrange-loop-construct
@opindex Wno-range-loop-construct
+@item -Wrange-loop-construct @r{(C++ and Objective-C++ only)}
This warning warns when a C++ range-based for-loop is creating an unnecessary
copy. This can happen when the range declaration is not a reference, but
probably should be. For example:
This warning is enabled by @option{-Wall}.
-@item -Wredundant-tags @r{(C++ and Objective-C++ only)}
@opindex Wredundant-tags
@opindex Wno-redundant-tags
+@item -Wredundant-tags @r{(C++ and Objective-C++ only)}
Warn about redundant class-key and enum-key in references to class types
and enumerated types in contexts where the key can be eliminated without
causing an ambiguity. For example:
void bar (struct foo&); // no warning, keyword struct is necessary
@end smallexample
-@item -Wno-subobject-linkage @r{(C++ and Objective-C++ only)}
@opindex Wsubobject-linkage
@opindex Wno-subobject-linkage
+@item -Wno-subobject-linkage @r{(C++ and Objective-C++ only)}
Do not warn
if a class type has a base or a field whose type uses the anonymous
namespace or depends on a type with no linkage. If a type A depends on
file, as those are unlikely to have multiple definitions.
@option{-Wsubobject-linkage} is enabled by default.
-@item -Weffc++ @r{(C++ and Objective-C++ only)}
@opindex Weffc++
@opindex Wno-effc++
+@item -Weffc++ @r{(C++ and Objective-C++ only)}
Warn about violations of the following style guidelines from Scott Meyers'
@cite{Effective C++} series of books:
headers do not obey all of these guidelines; use @samp{grep -v}
to filter out those warnings.
-@item -Wno-exceptions @r{(C++ and Objective-C++ only)}
@opindex Wexceptions
@opindex Wno-exceptions
+@item -Wno-exceptions @r{(C++ and Objective-C++ only)}
Disable the warning about the case when an exception handler is shadowed by
another handler, which can point out a wrong ordering of exception handlers.
-@item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
@opindex Wstrict-null-sentinel
@opindex Wno-strict-null-sentinel
+@item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
Warn about the use of an uncasted @code{NULL} as sentinel. When
compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
to @code{__null}. Although it is a null pointer constant rather than a
null pointer, it is guaranteed to be of the same size as a pointer.
But this use is not portable across different compilers.
-@item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
@opindex Wno-non-template-friend
@opindex Wnon-template-friend
+@item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
Disable warnings when non-template friend functions are declared
within a template. In very old versions of GCC that predate implementation
of the ISO standard, declarations such as
function; the warning exists to diagnose compatibility problems,
and is enabled by default.
-@item -Wold-style-cast @r{(C++ and Objective-C++ only)}
@opindex Wold-style-cast
@opindex Wno-old-style-cast
+@item -Wold-style-cast @r{(C++ and Objective-C++ only)}
Warn if an old-style (C-style) cast to a non-void type is used within
a C++ program. The new-style casts (@code{dynamic_cast},
@code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
less vulnerable to unintended effects and much easier to search for.
-@item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
-@itemx -Woverloaded-virtual=@var{n}
@opindex Woverloaded-virtual
@opindex Wno-overloaded-virtual
+@item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
+@itemx -Woverloaded-virtual=@var{n}
@cindex overloaded virtual function, warning
@cindex warning for overloaded virtual function
Warn when a function declaration hides virtual functions from a
@option{-Woverloaded-virtual} by itself selects level 2. Level 1 is
included in @option{-Wall}.
-@item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
@opindex Wno-pmf-conversions
@opindex Wpmf-conversions
+@item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
Disable the diagnostic for converting a bound pointer to member function
to a plain pointer.
-@item -Wsign-promo @r{(C++ and Objective-C++ only)}
@opindex Wsign-promo
@opindex Wno-sign-promo
+@item -Wsign-promo @r{(C++ and Objective-C++ only)}
Warn when overload resolution chooses a promotion from unsigned or
enumerated type to a signed type, over a conversion to an unsigned type of
the same size. Previous versions of G++ tried to preserve
unsignedness, but the standard mandates the current behavior.
-@item -Wtemplates @r{(C++ and Objective-C++ only)}
@opindex Wtemplates
@opindex Wno-templates
+@item -Wtemplates @r{(C++ and Objective-C++ only)}
Warn when a primary template declaration is encountered. Some coding
rules disallow templates, and this may be used to enforce that rule.
The warning is inactive inside a system header file, such as the STL, so
one can still use the STL. One may also instantiate or specialize
templates.
-@item -Wmismatched-new-delete @r{(C++ and Objective-C++ only)}
@opindex Wmismatched-new-delete
@opindex Wno-mismatched-new-delete
+@item -Wmismatched-new-delete @r{(C++ and Objective-C++ only)}
Warn for mismatches between calls to @code{operator new} or @code{operator
delete} and the corresponding call to the allocation or deallocation function.
This includes invocations of C++ @code{operator delete} with pointers
@option{-Wmismatched-new-delete} is included in @option{-Wall}.
-@item -Wmismatched-tags @r{(C++ and Objective-C++ only)}
@opindex Wmismatched-tags
@opindex Wno-mismatched-tags
+@item -Wmismatched-tags @r{(C++ and Objective-C++ only)}
Warn for declarations of structs, classes, and class templates and their
specializations with a class-key that does not match either the definition
or the first declaration if no definition is provided.
declared with different class-keys. The option can be used either on its
own or in conjunction with @option{-Wredundant-tags}.
-@item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
@opindex Wmultiple-inheritance
@opindex Wno-multiple-inheritance
+@item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
Warn when a class is defined with multiple direct base classes. Some
coding rules disallow multiple inheritance, and this may be used to
enforce that rule. The warning is inactive inside a system header file,
such as the STL, so one can still use the STL. One may also define
classes that indirectly use multiple inheritance.
-@item -Wvirtual-inheritance
@opindex Wvirtual-inheritance
@opindex Wno-virtual-inheritance
+@item -Wvirtual-inheritance
Warn when a class is defined with a virtual direct base class. Some
coding rules disallow multiple inheritance, and this may be used to
enforce that rule. The warning is inactive inside a system header file,
such as the STL, so one can still use the STL. One may also define
classes that indirectly use virtual inheritance.
-@item -Wno-virtual-move-assign
@opindex Wvirtual-move-assign
@opindex Wno-virtual-move-assign
+@item -Wno-virtual-move-assign
Suppress warnings about inheriting from a virtual base with a
non-trivial C++11 move assignment operator. This is dangerous because
if the virtual base is reachable along more than one path, it is
moved-from state. If the move assignment operator is written to avoid
moving from a moved-from object, this warning can be disabled.
-@item -Wnamespaces
@opindex Wnamespaces
@opindex Wno-namespaces
+@item -Wnamespaces
Warn when a namespace definition is opened. Some coding rules disallow
namespaces, and this may be used to enforce that rule. The warning is
inactive inside a system header file, such as the STL, so one can still
use the STL. One may also use using directives and qualified names.
-@item -Wno-terminate @r{(C++ and Objective-C++ only)}
@opindex Wterminate
@opindex Wno-terminate
+@item -Wno-terminate @r{(C++ and Objective-C++ only)}
Disable the warning about a throw-expression that will immediately
result in a call to @code{terminate}.
-@item -Wno-vexing-parse @r{(C++ and Objective-C++ only)}
@opindex Wvexing-parse
@opindex Wno-vexing-parse
+@item -Wno-vexing-parse @r{(C++ and Objective-C++ only)}
Warn about the most vexing parse syntactic ambiguity. This warns about
the cases when a declaration looks like a variable definition, but the
C++ language requires it to be interpreted as a function declaration.
This warning is enabled by default.
-@item -Wno-class-conversion @r{(C++ and Objective-C++ only)}
@opindex Wno-class-conversion
@opindex Wclass-conversion
+@item -Wno-class-conversion @r{(C++ and Objective-C++ only)}
Do not warn when a conversion function converts an
object to the same type, to a base class of that type, or to void; such
a conversion function will never be called.
-@item -Wvolatile @r{(C++ and Objective-C++ only)}
@opindex Wvolatile
@opindex Wno-volatile
+@item -Wvolatile @r{(C++ and Objective-C++ only)}
Warn about deprecated uses of the @code{volatile} qualifier. This includes
postfix and prefix @code{++} and @code{--} expressions of
@code{volatile}-qualified types, using simple assignments where the left
Enabled by default with @option{-std=c++20}.
-@item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
@opindex Wzero-as-null-pointer-constant
@opindex Wno-zero-as-null-pointer-constant
+@item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
Warn when a literal @samp{0} is used as null pointer constant. This can
be useful to facilitate the conversion to @code{nullptr} in C++11.
-@item -Waligned-new
@opindex Waligned-new
@opindex Wno-aligned-new
+@item -Waligned-new
Warn about a new-expression of a type that requires greater alignment
than the @code{alignof(std::max_align_t)} but uses an allocation
function without an explicit alignment parameter. This option is
@option{-Waligned-new=all} also warns about class member allocation
functions.
-@item -Wno-placement-new
-@itemx -Wplacement-new=@var{n}
@opindex Wplacement-new
@opindex Wno-placement-new
+@item -Wno-placement-new
+@itemx -Wplacement-new=@var{n}
Warn about placement new expressions with undefined behavior, such as
constructing an object in a buffer that is smaller than the type of
the object. For example, the placement new expression below is diagnosed
@end table
-@item -Wcatch-value
-@itemx -Wcatch-value=@var{n} @r{(C++ and Objective-C++ only)}
@opindex Wcatch-value
@opindex Wno-catch-value
+@item -Wcatch-value
+@itemx -Wcatch-value=@var{n} @r{(C++ and Objective-C++ only)}
Warn about catch handlers that do not catch via reference.
With @option{-Wcatch-value=1} (or @option{-Wcatch-value} for short)
warn about polymorphic class types that are caught by value.
by value. With @option{-Wcatch-value=3} warn about all types that are
not caught by reference. @option{-Wcatch-value} is enabled by @option{-Wall}.
-@item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
@opindex Wconditionally-supported
@opindex Wno-conditionally-supported
+@item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
Warn for conditionally-supported (C++11 [intro.defs]) constructs.
-@item -Wno-delete-incomplete @r{(C++ and Objective-C++ only)}
@opindex Wdelete-incomplete
@opindex Wno-delete-incomplete
+@item -Wno-delete-incomplete @r{(C++ and Objective-C++ only)}
Do not warn when deleting a pointer to incomplete type, which may cause
undefined behavior at runtime. This warning is enabled by default.
-@item -Wextra-semi @r{(C++, Objective-C++ only)}
@opindex Wextra-semi
@opindex Wno-extra-semi
+@item -Wextra-semi @r{(C++, Objective-C++ only)}
Warn about redundant semicolons after in-class function definitions.
-@item -Wno-inaccessible-base @r{(C++, Objective-C++ only)}
@opindex Winaccessible-base
@opindex Wno-inaccessible-base
+@item -Wno-inaccessible-base @r{(C++, Objective-C++ only)}
This option controls warnings
when a base class is inaccessible in a class derived from it due to
ambiguity. The warning is enabled by default.
@end group
@end smallexample
-@item -Wno-inherited-variadic-ctor
@opindex Winherited-variadic-ctor
@opindex Wno-inherited-variadic-ctor
+@item -Wno-inherited-variadic-ctor
Suppress warnings about use of C++11 inheriting constructors when the
base class inherited from has a C variadic constructor; the warning is
on by default because the ellipsis is not inherited.
-@item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
@opindex Wno-invalid-offsetof
@opindex Winvalid-offsetof
+@item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
Suppress warnings from applying the @code{offsetof} macro to a non-POD
type. According to the 2014 ISO C++ standard, applying @code{offsetof}
to a non-standard-layout type is undefined. In existing C++ implementations,
The restrictions on @code{offsetof} may be relaxed in a future version
of the C++ standard.
-@item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
@opindex Wsized-deallocation
@opindex Wno-sized-deallocation
+@item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
Warn about a definition of an unsized deallocation function
@smallexample
void operator delete (void *) noexcept;
or vice versa. Enabled by @option{-Wextra} along with
@option{-fsized-deallocation}.
-@item -Wsuggest-final-types
@opindex Wno-suggest-final-types
@opindex Wsuggest-final-types
+@item -Wsuggest-final-types
Warn about types with virtual methods where code quality would be improved
if the type were declared with the C++11 @code{final} specifier,
or, if possible,
where the information about the class hierarchy graph is
more complete.
-@item -Wsuggest-final-methods
@opindex Wno-suggest-final-methods
@opindex Wsuggest-final-methods
+@item -Wsuggest-final-methods
Warn about virtual methods where code quality would be improved if the method
were declared with the C++11 @code{final} specifier,
or, if possible, its type were
suggestions of @option{-Wsuggest-final-types} and then rebuild with new
annotations.
-@item -Wsuggest-override
@opindex Wsuggest-override
@opindex Wno-suggest-override
+@item -Wsuggest-override
Warn about overriding virtual functions that are not marked with the
@code{override} keyword.
-@item -Wuse-after-free
-@itemx -Wuse-after-free=@var{n}
@opindex Wuse-after-free
@opindex Wno-use-after-free
+@item -Wuse-after-free
+@itemx -Wuse-after-free=@var{n}
Warn about uses of pointers to dynamically allocated objects that have
been rendered indeterminate by a call to a deallocation function.
The warning is enabled at all optimization levels but may yield different
@option{-Wuse-after-free=2} is included in @option{-Wall}.
-@item -Wuseless-cast @r{(C++ and Objective-C++ only)}
@opindex Wuseless-cast
@opindex Wno-useless-cast
+@item -Wuseless-cast @r{(C++ and Objective-C++ only)}
Warn when an expression is cast to its own type. This warning does not
occur when a class object is converted to a non-reference type as that
is a way to create a temporary:
@}
@end smallexample
-@item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
@opindex Wconversion-null
@opindex Wno-conversion-null
+@item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
Do not warn for conversions between @code{NULL} and non-pointer
types. @option{-Wconversion-null} is enabled by default.
and Objective-C++ programs:
@table @gcctabopt
-@item -fconstant-string-class=@var{class-name}
@opindex fconstant-string-class
+@item -fconstant-string-class=@var{class-name}
Use @var{class-name} as the name of the class to instantiate for each
literal string specified with the syntax @code{@@"@dots{}"}. The default
class name is @code{NXConstantString} if the GNU runtime is being used, and
@option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
to be laid out as constant CoreFoundation strings.
-@item -fgnu-runtime
@opindex fgnu-runtime
+@item -fgnu-runtime
Generate object code compatible with the standard GNU Objective-C
runtime. This is the default for most types of systems.
-@item -fnext-runtime
@opindex fnext-runtime
+@item -fnext-runtime
Generate output compatible with the NeXT runtime. This is the default
for NeXT-based systems, including Darwin and Mac OS X@. The macro
@code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
used.
-@item -fno-nil-receivers
@opindex fno-nil-receivers
@opindex fnil-receivers
+@item -fno-nil-receivers
Assume that all Objective-C message dispatches (@code{[receiver
message:arg]}) in this translation unit ensure that the receiver is
not @code{nil}. This allows for more efficient entry points in the
runtime to be used. This option is only available in conjunction with
the NeXT runtime and ABI version 0 or 1.
-@item -fobjc-abi-version=@var{n}
@opindex fobjc-abi-version
+@item -fobjc-abi-version=@var{n}
Use version @var{n} of the Objective-C ABI for the selected runtime.
This option is currently supported only for the NeXT runtime. In that
case, Version 0 is the traditional (32-bit) ABI without support for
nothing is specified, the default is Version 0 on 32-bit target
machines, and Version 2 on 64-bit target machines.
-@item -fobjc-call-cxx-cdtors
@opindex fobjc-call-cxx-cdtors
+@item -fobjc-call-cxx-cdtors
For each Objective-C class, check if any of its instance variables is a
C++ object with a non-trivial default constructor. If so, synthesize a
special @code{- (id) .cxx_construct} instance method which runs
support for invoking the @code{- (id) .cxx_construct} and
@code{- (void) .cxx_destruct} methods.
-@item -fobjc-direct-dispatch
@opindex fobjc-direct-dispatch
+@item -fobjc-direct-dispatch
Allow fast jumps to the message dispatcher. On Darwin this is
accomplished via the comm page.
-@item -fobjc-exceptions
@opindex fobjc-exceptions
+@item -fobjc-exceptions
Enable syntactic support for structured exception handling in
Objective-C, similar to what is offered by C++. This option
is required to use the Objective-C keywords @code{@@try},
runtime and the NeXT runtime (but not available in conjunction with
the NeXT runtime on Mac OS X 10.2 and earlier).
-@item -fobjc-gc
@opindex fobjc-gc
+@item -fobjc-gc
Enable garbage collection (GC) in Objective-C and Objective-C++
programs. This option is only available with the NeXT runtime; the
GNU runtime has a different garbage collection implementation that
does not require special compiler flags.
-@item -fobjc-nilcheck
@opindex fobjc-nilcheck
+@item -fobjc-nilcheck
For the NeXT runtime with version 2 of the ABI, check for a nil
receiver in method invocations before doing the actual method call.
This is the default and can be disabled using
Currently this flag does nothing when the GNU runtime, or an older
version of the NeXT runtime ABI, is used.
-@item -fobjc-std=objc1
@opindex fobjc-std
+@item -fobjc-std=objc1
Conform to the language syntax of Objective-C 1.0, the language
recognized by GCC 4.0. This only affects the Objective-C additions to
the C/C++ language; it does not affect conformance to C/C++ standards,
This is useful if you need to make sure that your Objective-C code can
be compiled with older versions of GCC@.
-@item -freplace-objc-classes
@opindex freplace-objc-classes
+@item -freplace-objc-classes
Emit a special marker instructing @command{ld(1)} not to statically link in
the resulting object file, and allow @command{dyld(1)} to load it in at
run time instead. This is used in conjunction with the Fix-and-Continue
is only available in conjunction with the NeXT runtime on Mac OS X 10.3
and later.
-@item -fzero-link
@opindex fzero-link
+@item -fzero-link
When compiling for the NeXT runtime, the compiler ordinarily replaces calls
to @code{objc_getClass("@dots{}")} (when the name of the class is known at
compile time) with static class references that get initialized at load time,
The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
regardless of command-line options.
-@item -fno-local-ivars
@opindex fno-local-ivars
@opindex flocal-ivars
+@item -fno-local-ivars
By default instance variables in Objective-C can be accessed as if
they were local variables from within the methods of the class they're
declared in. This can lead to shadowing between instance variables
globally with the same name. Specifying the @option{-fno-local-ivars}
flag disables this behavior thus avoiding variable shadowing issues.
-@item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
@opindex fivar-visibility
+@item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
Set the default instance variable visibility to the specified option
so that instance variables declared outside the scope of any access
modifier directives default to the specified visibility.
-@item -gen-decls
@opindex gen-decls
+@item -gen-decls
Dump interface declarations for all classes seen in the source file to a
file named @file{@var{sourcename}.decl}.
-@item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
@opindex Wassign-intercept
@opindex Wno-assign-intercept
+@item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
Warn whenever an Objective-C assignment is being intercepted by the
garbage collector.
-@item -Wno-property-assign-default @r{(Objective-C and Objective-C++ only)}
@opindex Wproperty-assign-default
@opindex Wno-property-assign-default
+@item -Wno-property-assign-default @r{(Objective-C and Objective-C++ only)}
Do not warn if a property for an Objective-C object has no assign
semantics specified.
-@item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
@opindex Wno-protocol
@opindex Wprotocol
+@item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
If a class is declared to implement a protocol, a warning is issued for
every method in the protocol that is not implemented by the class. The
default behavior is to issue a warning for every method not explicitly
methods inherited from the superclass are considered to be implemented,
and no warning is issued for them.
-@item -Wobjc-root-class @r{(Objective-C and Objective-C++ only)}
@opindex Wobjc-root-class
+@item -Wobjc-root-class @r{(Objective-C and Objective-C++ only)}
Warn if a class interface lacks a superclass. Most classes will inherit
from @code{NSObject} (or @code{Object}) for example. When declaring
classes intended to be root classes, the warning can be suppressed by
marking their interfaces with @code{__attribute__((objc_root_class))}.
-@item -Wselector @r{(Objective-C and Objective-C++ only)}
@opindex Wselector
@opindex Wno-selector
+@item -Wselector @r{(Objective-C and Objective-C++ only)}
Warn if multiple methods of different types for the same selector are
found during compilation. The check is performed on the list of methods
in the final stage of compilation. Additionally, a check is performed
found during compilation, or because the @option{-fsyntax-only} option is
being used.
-@item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
@opindex Wstrict-selector-match
@opindex Wno-strict-selector-match
+@item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
Warn if multiple methods with differing argument and/or return types are
found for a given selector when attempting to send a message using this
selector to a receiver of type @code{id} or @code{Class}. When this flag
if any differences found are confined to types that share the same size
and alignment.
-@item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
@opindex Wundeclared-selector
@opindex Wno-undeclared-selector
+@item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
Warn if a @code{@@selector(@dots{})} expression referring to an
undeclared selector is found. A selector is considered undeclared if no
method with that name has been declared before the
compilation. This also enforces the coding style convention
that methods and selectors must be declared before being used.
-@item -print-objc-runtime-info
@opindex print-objc-runtime-info
+@item -print-objc-runtime-info
Generate C header describing the largest structure that is passed by
value, if any.
honor these options.
@table @gcctabopt
-@item -fmessage-length=@var{n}
@opindex fmessage-length
+@item -fmessage-length=@var{n}
Try to format error messages so that they fit on lines of about
@var{n} characters. If @var{n} is zero, then no line-wrapping is
done; each error message appears on a single line. This is the
In the future, if GCC changes the default appearance of its diagnostics, the
corresponding option to disable the new behavior will be added to this list.
-@item -fdiagnostics-show-location=once
@opindex fdiagnostics-show-location
+@item -fdiagnostics-show-location=once
Only meaningful in line-wrapping mode. Instructs the diagnostic messages
reporter to emit source location information @emph{once}; that is, in
case the message is too long to fit on a single physical line and has to
prefix) for physical lines that result from the process of breaking
a message which is too long to fit on a single line.
+@opindex fdiagnostics-color
@item -fdiagnostics-color[=@var{WHEN}]
@itemx -fno-diagnostics-color
-@opindex fdiagnostics-color
@cindex highlight, color
@vindex GCC_COLORS @r{environment variable}
Use color in diagnostics. @var{WHEN} is @samp{never}, @samp{always},
arguments in the C++ frontend.
@end table
-@item -fdiagnostics-urls[=@var{WHEN}]
@opindex fdiagnostics-urls
+@item -fdiagnostics-urls[=@var{WHEN}]
@cindex urls
@vindex GCC_URLS @r{environment variable}
@vindex TERM_URLS @r{environment variable}
gnome-terminal versions, the linux console, and mingw.
This check can be skipped with the @option{-fdiagnostics-urls=always}.
-@item -fno-diagnostics-show-option
@opindex fno-diagnostics-show-option
@opindex fdiagnostics-show-option
+@item -fno-diagnostics-show-option
By default, each diagnostic emitted includes text indicating the
command-line option that directly controls the diagnostic (if such an
option is known to the diagnostic machinery). Specifying the
@option{-fno-diagnostics-show-option} flag suppresses that behavior.
-@item -fno-diagnostics-show-caret
@opindex fno-diagnostics-show-caret
@opindex fdiagnostics-show-caret
+@item -fno-diagnostics-show-caret
By default, each diagnostic emitted includes the original source line
and a caret @samp{^} indicating the column. This option suppresses this
information. The source line is truncated to @var{n} characters, if
to the terminal, the width is limited to the width given by the
@env{COLUMNS} environment variable or, if not set, to the terminal width.
-@item -fno-diagnostics-show-labels
@opindex fno-diagnostics-show-labels
@opindex fdiagnostics-show-labels
+@item -fno-diagnostics-show-labels
By default, when printing source code (via @option{-fdiagnostics-show-caret}),
diagnostics can label ranges of source code with pertinent information, such
as the types of expressions:
This option suppresses the printing of these labels (in the example above,
the vertical bars and the ``char *'' and ``long int'' text).
-@item -fno-diagnostics-show-cwe
@opindex fno-diagnostics-show-cwe
@opindex fdiagnostics-show-cwe
+@item -fno-diagnostics-show-cwe
Diagnostic messages can optionally have an associated
@uref{https://cwe.mitre.org/index.html, CWE} identifier.
GCC itself only provides such metadata for some of the @option{-fanalyzer}
By default, if this information is present, it will be printed with
the diagnostic. This option suppresses the printing of this metadata.
-@item -fno-diagnostics-show-rules
@opindex fno-diagnostics-show-rules
@opindex fdiagnostics-show-rules
+@item -fno-diagnostics-show-rules
Diagnostic messages can optionally have rules associated with them, such
as from a coding standard, or a specification.
GCC itself does not do this for any of its diagnostics, but plugins may do so.
By default, if this information is present, it will be printed with
the diagnostic. This option suppresses the printing of this metadata.
-@item -fno-diagnostics-show-line-numbers
@opindex fno-diagnostics-show-line-numbers
@opindex fdiagnostics-show-line-numbers
+@item -fno-diagnostics-show-line-numbers
By default, when printing source code (via @option{-fdiagnostics-show-caret}),
a left margin is printed, showing line numbers. This option suppresses this
left margin.
-@item -fdiagnostics-minimum-margin-width=@var{width}
@opindex fdiagnostics-minimum-margin-width
+@item -fdiagnostics-minimum-margin-width=@var{width}
This option controls the minimum width of the left margin printed by
@option{-fdiagnostics-show-line-numbers}. It defaults to 6.
-@item -fdiagnostics-parseable-fixits
@opindex fdiagnostics-parseable-fixits
+@item -fdiagnostics-parseable-fixits
Emit fix-it hints in a machine-parseable format, suitable for consumption
by IDEs. For each fix-it, a line will be printed after the relevant
diagnostic, starting with the string ``fix-it:''. For example:
An empty range (e.g. ``45:3-45:3'') indicates that the string is to
be inserted at the given position.
-@item -fdiagnostics-generate-patch
@opindex fdiagnostics-generate-patch
+@item -fdiagnostics-generate-patch
Print fix-it hints to stderr in unified diff format, after any diagnostics
are printed. For example:
The diff may or may not be colorized, following the same rules
as for diagnostics (see @option{-fdiagnostics-color}).
-@item -fdiagnostics-show-template-tree
@opindex fdiagnostics-show-template-tree
+@item -fdiagnostics-show-template-tree
In the C++ frontend, when printing diagnostics showing mismatching
template types, such as:
The parts that differ are highlighted with color (``double'' and
``float'' in this case).
-@item -fno-elide-type
@opindex fno-elide-type
@opindex felide-type
+@item -fno-elide-type
By default when the C++ frontend prints diagnostics showing mismatching
template types, common parts of the types are printed as ``[...]'' to
simplify the error message. For example:
This flag also affects the output of the
@option{-fdiagnostics-show-template-tree} flag.
-@item -fdiagnostics-path-format=@var{KIND}
@opindex fdiagnostics-path-format
+@item -fdiagnostics-path-format=@var{KIND}
Specify how to print paths of control-flow events for diagnostics that
have such a path associated with them.
(etc)
@end smallexample
-@item -fdiagnostics-show-path-depths
@opindex fdiagnostics-show-path-depths
+@item -fdiagnostics-show-path-depths
This option provides additional information when printing control-flow paths
associated with a diagnostic.
This is intended for use by GCC developers and plugin developers when
debugging diagnostics that report interprocedural control flow.
-@item -fno-show-column
@opindex fno-show-column
@opindex fshow-column
+@item -fno-show-column
Do not print column numbers in diagnostics. This may be necessary if
diagnostics are being scanned by a program that does not understand the
column numbers, such as @command{dejagnu}.
-@item -fdiagnostics-column-unit=@var{UNIT}
@opindex fdiagnostics-column-unit
+@item -fdiagnostics-column-unit=@var{UNIT}
Select the units for the column number. This affects traditional diagnostics
(in the absence of @option{-fno-show-column}), as well as JSON format
diagnostics if requested.
Setting @var{UNIT} to @samp{byte} changes the column number to the raw byte
count in all cases, as was traditionally output by GCC prior to version 11.1.0.
-@item -fdiagnostics-column-origin=@var{ORIGIN}
@opindex fdiagnostics-column-origin
+@item -fdiagnostics-column-origin=@var{ORIGIN}
Select the origin for column numbers, i.e. the column number assigned to the
first column. The default value of 1 corresponds to traditional GCC
behavior and to the GNU style guide. Some utilities may perform better with an
origin of 0; any non-negative value may be specified.
-@item -fdiagnostics-escape-format=@var{FORMAT}
@opindex fdiagnostics-escape-format
+@item -fdiagnostics-escape-format=@var{FORMAT}
When GCC prints pertinent source lines for a diagnostic it normally attempts
to print the source bytes directly. However, some diagnostics relate to encoding
issues in the source file, such as malformed UTF-8, or issues with Unicode
before<CF><80><BF>after
@end smallexample
-@item -fdiagnostics-format=@var{FORMAT}
@opindex fdiagnostics-format
+@item -fdiagnostics-format=@var{FORMAT}
Select a different format for printing diagnostics.
@var{FORMAT} is @samp{text}, @samp{sarif-stderr}, @samp{sarif-file},
@samp{json}, @samp{json-stderr}, or @samp{json-file}.
@table @gcctabopt
@cindex syntax checking
-@item -fsyntax-only
@opindex fsyntax-only
+@item -fsyntax-only
Check the code for syntax errors, but don't do anything beyond that.
-@item -fmax-errors=@var{n}
@opindex fmax-errors
+@item -fmax-errors=@var{n}
Limits the maximum number of error messages to @var{n}, at which point
GCC bails out rather than attempting to continue processing the source
code. If @var{n} is 0 (the default), there is no limit on the number
specified, then @option{-Wfatal-errors} takes precedence over this
option.
-@item -w
@opindex w
+@item -w
Inhibit all warning messages.
-@item -Werror
@opindex Werror
@opindex Wno-error
+@item -Werror
Make all warnings into errors.
-@item -Werror=
@opindex Werror=
@opindex Wno-error=
+@item -Werror=
Make the specified warning into an error. The specifier for a warning
is appended; for example @option{-Werror=switch} turns the warnings
controlled by @option{-Wswitch} into errors. This switch takes a
@option{-W}@var{foo}. However, @option{-Wno-error=}@var{foo} does not
imply anything.
-@item -Wfatal-errors
@opindex Wfatal-errors
@opindex Wno-fatal-errors
+@item -Wfatal-errors
This option causes the compiler to abort compilation on the first error
occurred rather than trying to keep going and printing further error
messages.
warnings, in some cases it may also cause false positives.
@table @gcctabopt
-@item -Wpedantic
-@itemx -pedantic
@opindex pedantic
@opindex Wpedantic
@opindex Wno-pedantic
+@item -Wpedantic
+@itemx -pedantic
Issue all the warnings demanded by strict ISO C and ISO C++;
reject all programs that use forbidden extensions, and some other
programs that do not follow ISO C and ISO C++. For ISO C, follows the
features the compiler supports with the given option, and there would be
nothing to warn about.)
-@item -pedantic-errors
@opindex pedantic-errors
+@item -pedantic-errors
Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
requires a diagnostic, in some cases where there is undefined behavior
at compile-time and in some other cases that do not prevent compilation
equivalent to @option{-Werror=pedantic}, since there are errors enabled
by this option and not enabled by the latter and vice versa.
-@item -Wall
@opindex Wall
@opindex Wno-all
+@item -Wall
This enables all the warnings about constructions that some users
consider questionable, and that are easy to avoid (or modify to
prevent the warning), even in conjunction with macros. This also
the warning. Some of them are enabled by @option{-Wextra} but many of
them must be enabled individually.
-@item -Wextra
@opindex W
@opindex Wextra
@opindex Wno-extra
+@item -Wextra
This enables some extra warning flags that are not enabled by
@option{-Wall}. (This option used to be called @option{-W}. The older
name is still supported, but the newer name is more descriptive.)
@end itemize
-@item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
@opindex Wabi
@opindex Wno-abi
+@item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
Warn about code affected by ABI changes. This includes code that may
not be compatible with the vendor-neutral C++ ABI as well as the psABI
Both diagnostics are also suppressed by @option{-fms-extensions}.
-@item -Wchar-subscripts
@opindex Wchar-subscripts
@opindex Wno-char-subscripts
+@item -Wchar-subscripts
Warn if an array subscript has type @code{char}. This is a common cause
of error, as programmers often forget that this type is signed on some
machines.
This warning is enabled by @option{-Wall}.
-@item -Wno-coverage-mismatch
@opindex Wno-coverage-mismatch
@opindex Wcoverage-mismatch
+@item -Wno-coverage-mismatch
Warn if feedback profiles do not match when using the
@option{-fprofile-use} option.
If a source file is changed between compiling with @option{-fprofile-generate}
case of very minor changes such as bug fixes to an existing code-base.
Completely disabling the warning is not recommended.
-@item -Wno-coverage-invalid-line-number
@opindex Wno-coverage-invalid-line-number
@opindex Wcoverage-invalid-line-number
+@item -Wno-coverage-invalid-line-number
Warn in case a function ends earlier than it begins due
to an invalid linenum macros. The warning is emitted only
with @option{--coverage} enabled.
warning or @option{-Wno-error=coverage-invalid-line-number} can be used to
disable the error.
-@item -Wno-cpp @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
@opindex Wno-cpp
@opindex Wcpp
+@item -Wno-cpp @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
Suppress warning messages emitted by @code{#warning} directives.
-@item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
@opindex Wdouble-promotion
@opindex Wno-double-promotion
+@item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
Give a warning when a value of type @code{float} is implicitly
promoted to @code{double}. CPUs with a 32-bit ``single-precision''
floating-point unit implement @code{float} in hardware, but emulate
the compiler performs the entire computation with @code{double}
because the floating-point literal is a @code{double}.
-@item -Wduplicate-decl-specifier @r{(C and Objective-C only)}
@opindex Wduplicate-decl-specifier
@opindex Wno-duplicate-decl-specifier
+@item -Wduplicate-decl-specifier @r{(C and Objective-C only)}
Warn if a declaration has duplicate @code{const}, @code{volatile},
@code{restrict} or @code{_Atomic} specifier. This warning is enabled by
@option{-Wall}.
-@item -Wformat
-@itemx -Wformat=@var{n}
@opindex Wformat
@opindex Wno-format
@opindex ffreestanding
@opindex fno-builtin
@opindex Wformat=
+@item -Wformat
+@itemx -Wformat=@var{n}
Check calls to @code{printf} and @code{scanf}, etc., to make sure that
the arguments supplied have types appropriate to the format string
specified, and that the conversions specified in the format string make
Options,,Options Controlling C Dialect}.
@table @gcctabopt
-@item -Wformat=1
-@itemx -Wformat
@opindex Wformat
@opindex Wformat=1
+@item -Wformat=1
+@itemx -Wformat
Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
@option{-Wno-format} is equivalent to @option{-Wformat=0}. Since
@option{-Wformat} also checks for null format arguments for several
@option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
@option{-Wformat} is enabled by @option{-Wall}.
-@item -Wformat=2
@opindex Wformat=2
+@item -Wformat=2
Enable @option{-Wformat} plus additional format checks. Currently
equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
-Wformat-y2k}.
@end table
-@item -Wno-format-contains-nul
@opindex Wno-format-contains-nul
@opindex Wformat-contains-nul
+@item -Wno-format-contains-nul
If @option{-Wformat} is specified, do not warn about format strings that
contain NUL bytes.
-@item -Wno-format-extra-args
@opindex Wno-format-extra-args
@opindex Wformat-extra-args
+@item -Wno-format-extra-args
If @option{-Wformat} is specified, do not warn about excess arguments to a
@code{printf} or @code{scanf} format function. The C standard specifies
that such arguments are ignored.
warning if the unused arguments are all pointers, since the Single
Unix Specification says that such unused arguments are allowed.
-@item -Wformat-overflow
-@itemx -Wformat-overflow=@var{level}
@opindex Wformat-overflow
@opindex Wno-format-overflow
+@item -Wformat-overflow
+@itemx -Wformat-overflow=@var{level}
Warn about calls to formatted input/output functions such as @code{sprintf}
and @code{vsprintf} that might overflow the destination buffer. When the
exact number of bytes written by a format directive cannot be determined
result in false positives.
@table @gcctabopt
-@item -Wformat-overflow
-@itemx -Wformat-overflow=1
@opindex Wformat-overflow
@opindex Wno-format-overflow
+@item -Wformat-overflow
+@itemx -Wformat-overflow=1
Level @var{1} of @option{-Wformat-overflow} enabled by @option{-Wformat}
employs a conservative approach that warns only about calls that most
likely overflow the buffer. At this level, numeric arguments to format
@end smallexample
@end table
-@item -Wno-format-zero-length
@opindex Wno-format-zero-length
@opindex Wformat-zero-length
+@item -Wno-format-zero-length
If @option{-Wformat} is specified, do not warn about zero-length formats.
The C standard specifies that zero-length formats are allowed.
-@item -Wformat-nonliteral
@opindex Wformat-nonliteral
@opindex Wno-format-nonliteral
+@item -Wformat-nonliteral
If @option{-Wformat} is specified, also warn if the format string is not a
string literal and so cannot be checked, unless the format function
takes its format arguments as a @code{va_list}.
-@item -Wformat-security
@opindex Wformat-security
@opindex Wno-format-security
+@item -Wformat-security
If @option{-Wformat} is specified, also warn about uses of format
functions that represent possible security problems. At present, this
warns about calls to @code{printf} and @code{scanf} functions where the
in future warnings may be added to @option{-Wformat-security} that are not
included in @option{-Wformat-nonliteral}.)
-@item -Wformat-signedness
@opindex Wformat-signedness
@opindex Wno-format-signedness
+@item -Wformat-signedness
If @option{-Wformat} is specified, also warn if the format string
requires an unsigned argument and the argument is signed and vice versa.
-@item -Wformat-truncation
-@itemx -Wformat-truncation=@var{level}
@opindex Wformat-truncation
@opindex Wno-format-truncation
+@item -Wformat-truncation
+@itemx -Wformat-truncation=@var{level}
Warn about calls to formatted input/output functions such as @code{snprintf}
and @code{vsnprintf} that might result in output truncation. When the exact
number of bytes written by a format directive cannot be determined at
logic @option{-Wformat-overflow}.
@table @gcctabopt
-@item -Wformat-truncation
-@itemx -Wformat-truncation=1
@opindex Wformat-truncation
@opindex Wno-format-truncation
+@item -Wformat-truncation
+@itemx -Wformat-truncation=1
Level @var{1} of @option{-Wformat-truncation} enabled by @option{-Wformat}
employs a conservative approach that warns only about calls to bounded
functions whose return value is unused and that will most likely result
sufficient length or magnitude.
@end table
-@item -Wformat-y2k
@opindex Wformat-y2k
@opindex Wno-format-y2k
+@item -Wformat-y2k
If @option{-Wformat} is specified, also warn about @code{strftime}
formats that may yield only a two-digit year.
-@item -Wnonnull
@opindex Wnonnull
@opindex Wno-nonnull
+@item -Wnonnull
Warn about passing a null pointer for arguments marked as
requiring a non-null value by the @code{nonnull} function attribute.
@option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}. It
can be disabled with the @option{-Wno-nonnull} option.
-@item -Wnonnull-compare
@opindex Wnonnull-compare
@opindex Wno-nonnull-compare
+@item -Wnonnull-compare
Warn when comparing an argument marked with the @code{nonnull}
function attribute against null inside the function.
@option{-Wnonnull-compare} is included in @option{-Wall}. It
can be disabled with the @option{-Wno-nonnull-compare} option.
-@item -Wnull-dereference
@opindex Wnull-dereference
@opindex Wno-null-dereference
+@item -Wnull-dereference
Warn if the compiler detects paths that trigger erroneous or
undefined behavior due to dereferencing a null pointer. This option
is only active when @option{-fdelete-null-pointer-checks} is active,
which is enabled by optimizations in most targets. The precision of
the warnings depends on the optimization options used.
-@item -Winfinite-recursion
@opindex Winfinite-recursion
@opindex Wno-infinite-recursion
+@item -Winfinite-recursion
Warn about infinitely recursive calls. The warning is effective at all
optimization levels but requires optimization in order to detect infinite
recursion in calls between two or more functions.
similar diagnostic, but is implemented in a different way (as part of
@option{-fanalyzer}).
-@item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
@opindex Winit-self
@opindex Wno-init-self
+@item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
Warn about uninitialized variables that are initialized with themselves.
Note this option can only be used with the @option{-Wuninitialized} option.
This warning is enabled by @option{-Wall} in C++.
-@item -Wno-implicit-int @r{(C and Objective-C only)}
@opindex Wimplicit-int
@opindex Wno-implicit-int
+@item -Wno-implicit-int @r{(C and Objective-C only)}
This option controls warnings when a declaration does not specify a type.
This warning is enabled by default in C99 and later dialects of C,
and also by @option{-Wall}.
-@item -Wno-implicit-function-declaration @r{(C and Objective-C only)}
@opindex Wimplicit-function-declaration
@opindex Wno-implicit-function-declaration
+@item -Wno-implicit-function-declaration @r{(C and Objective-C only)}
This option controls warnings when a function is used before being declared.
This warning is enabled by default in C99 and later dialects of C,
and also by @option{-Wall}.
The warning is made into an error by @option{-pedantic-errors}.
-@item -Wimplicit @r{(C and Objective-C only)}
@opindex Wimplicit
@opindex Wno-implicit
+@item -Wimplicit @r{(C and Objective-C only)}
Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
This warning is enabled by @option{-Wall}.
-@item -Wimplicit-fallthrough
@opindex Wimplicit-fallthrough
@opindex Wno-implicit-fallthrough
+@item -Wimplicit-fallthrough
@option{-Wimplicit-fallthrough} is the same as @option{-Wimplicit-fallthrough=3}
and @option{-Wno-implicit-fallthrough} is the same as
@option{-Wimplicit-fallthrough=0}.
-@item -Wimplicit-fallthrough=@var{n}
@opindex Wimplicit-fallthrough=
+@item -Wimplicit-fallthrough=@var{n}
Warn when a switch case falls through. For example:
@smallexample
The @option{-Wimplicit-fallthrough=3} warning is enabled by @option{-Wextra}.
-@item -Wno-if-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
@opindex Wif-not-aligned
@opindex Wno-if-not-aligned
+@item -Wno-if-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
Control if warnings triggered by the @code{warn_if_not_aligned} attribute
should be issued. These warnings are enabled by default.
-@item -Wignored-qualifiers @r{(C and C++ only)}
@opindex Wignored-qualifiers
@opindex Wno-ignored-qualifiers
+@item -Wignored-qualifiers @r{(C and C++ only)}
Warn if the return type of a function has a type qualifier
such as @code{const}. For ISO C such a type qualifier has no effect,
since the value returned by a function is not an lvalue.
This warning is also enabled by @option{-Wextra}.
-@item -Wno-ignored-attributes @r{(C and C++ only)}
@opindex Wignored-attributes
@opindex Wno-ignored-attributes
+@item -Wno-ignored-attributes @r{(C and C++ only)}
This option controls warnings when an attribute is ignored.
This is different from the
@option{-Wattributes} option in that it warns whenever the compiler decides
to drop an attribute, not that the attribute is either unknown, used in a
wrong place, etc. This warning is enabled by default.
-@item -Wmain
@opindex Wmain
@opindex Wno-main
+@item -Wmain
Warn if the type of @code{main} is suspicious. @code{main} should be
a function with external linkage, returning int, taking either zero
arguments, two, or three arguments of appropriate types. This warning
is enabled by default in C++ and is enabled by either @option{-Wall}
or @option{-Wpedantic}.
-@item -Wmisleading-indentation @r{(C and C++ only)}
@opindex Wmisleading-indentation
@opindex Wno-misleading-indentation
+@item -Wmisleading-indentation @r{(C and C++ only)}
Warn when the indentation of the code does not reflect the block structure.
Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
@code{for} clauses with a guarded statement that does not use braces,
This warning is enabled by @option{-Wall} in C and C++.
-@item -Wmissing-attributes
@opindex Wmissing-attributes
@opindex Wno-missing-attributes
+@item -Wmissing-attributes
Warn when a declaration of a function is missing one or more attributes
that a related function is declared with and whose absence may adversely
affect the correctness or efficiency of generated code. For example,
allocate<void> (size_t);
@end smallexample
-@item -Wmissing-braces
@opindex Wmissing-braces
@opindex Wno-missing-braces
+@item -Wmissing-braces
Warn if an aggregate or union initializer is not fully bracketed. In
the following example, the initializer for @code{a} is not fully
bracketed, but that for @code{b} is fully bracketed.
This warning is enabled by @option{-Wall}.
-@item -Wmissing-include-dirs @r{(C, C++, Objective-C, Objective-C++ and Fortran only)}
@opindex Wmissing-include-dirs
@opindex Wno-missing-include-dirs
+@item -Wmissing-include-dirs @r{(C, C++, Objective-C, Objective-C++ and Fortran only)}
Warn if a user-supplied include directory does not exist. This opions is disabled
by default for C, C++, Objective-C and Objective-C++. For Fortran, it is partially
enabled by default by warning for -I and -J, only.
-@item -Wno-missing-profile
@opindex Wmissing-profile
@opindex Wno-missing-profile
+@item -Wno-missing-profile
This option controls warnings if feedback profiles are missing when using the
@option{-fprofile-use} option.
This option diagnoses those cases where a new function or a new file is added
disable the warning, but this is not recommended and should be done only
when non-existent profile data is justified.
-@item -Wmismatched-dealloc
@opindex Wmismatched-dealloc
@opindex Wno-mismatched-dealloc
+@item -Wmismatched-dealloc
Warn for calls to deallocation functions with pointer arguments returned
from from allocations functions for which the former isn't a suitable
Option @option{-Wmismatched-dealloc} is included in @option{-Wall}.
-@item -Wmultistatement-macros
@opindex Wmultistatement-macros
@opindex Wno-multistatement-macros
+@item -Wmultistatement-macros
Warn about unsafe multiple statement macros that appear to be guarded
by a clause such as @code{if}, @code{else}, @code{for}, @code{switch}, or
@code{while}, in which only the first statement is actually guarded after
This warning is enabled by @option{-Wall} in C and C++.
-@item -Wparentheses
@opindex Wparentheses
@opindex Wno-parentheses
+@item -Wparentheses
Warn if parentheses are omitted in certain contexts, such
as when there is an assignment in a context where a truth value
is expected, or when operators are nested whose precedence people
This warning is enabled by @option{-Wall}.
-@item -Wno-self-move @r{(C++ and Objective-C++ only)}
@opindex Wself-move
@opindex Wno-self-move
+@item -Wno-self-move @r{(C++ and Objective-C++ only)}
This warning warns when a value is moved to itself with @code{std::move}.
Such a @code{std::move} typically has no effect.
This warning is enabled by @option{-Wall}.
-@item -Wsequence-point
@opindex Wsequence-point
@opindex Wno-sequence-point
+@item -Wsequence-point
Warn about code that may have undefined semantics because of violations
of sequence point rules in the C and C++ standards.
This warning is enabled by @option{-Wall} for C and C++.
-@item -Wno-return-local-addr
@opindex Wno-return-local-addr
@opindex Wreturn-local-addr
+@item -Wno-return-local-addr
Do not warn about returning a pointer (or in C++, a reference) to a
variable that goes out of scope after the function returns.
-@item -Wreturn-type
@opindex Wreturn-type
@opindex Wno-return-type
+@item -Wreturn-type
Warn whenever a function is defined with a return type that defaults
to @code{int}. Also warn about any @code{return} statement with no
return value in a function whose return type is not @code{void}
This warning is enabled by default in C++ and by @option{-Wall} otherwise.
-@item -Wno-shift-count-negative
@opindex Wshift-count-negative
@opindex Wno-shift-count-negative
+@item -Wno-shift-count-negative
Controls warnings if a shift count is negative.
This warning is enabled by default.
-@item -Wno-shift-count-overflow
@opindex Wshift-count-overflow
@opindex Wno-shift-count-overflow
+@item -Wno-shift-count-overflow
Controls warnings if a shift count is greater than or equal to the bit width
of the type. This warning is enabled by default.
-@item -Wshift-negative-value
@opindex Wshift-negative-value
@opindex Wno-shift-negative-value
+@item -Wshift-negative-value
Warn if left shifting a negative value. This warning is enabled by
@option{-Wextra} in C99 (and newer) and C++11 to C++17 modes.
-@item -Wno-shift-overflow
-@itemx -Wshift-overflow=@var{n}
@opindex Wshift-overflow
@opindex Wno-shift-overflow
+@item -Wno-shift-overflow
+@itemx -Wshift-overflow=@var{n}
These options control warnings about left shift overflows.
@table @gcctabopt
unless C++14 mode (or newer) is active.
@end table
-@item -Wswitch
@opindex Wswitch
@opindex Wno-switch
+@item -Wswitch
Warn whenever a @code{switch} statement has an index of enumerated type
and lacks a @code{case} for one or more of the named codes of that
enumeration. (The presence of a @code{default} label prevents this
@code{default} label).
This warning is enabled by @option{-Wall}.
-@item -Wswitch-default
@opindex Wswitch-default
@opindex Wno-switch-default
+@item -Wswitch-default
Warn whenever a @code{switch} statement does not have a @code{default}
case.
-@item -Wswitch-enum
@opindex Wswitch-enum
@opindex Wno-switch-enum
+@item -Wswitch-enum
Warn whenever a @code{switch} statement has an index of enumerated type
and lacks a @code{case} for one or more of the named codes of that
enumeration. @code{case} labels outside the enumeration range also
warning about an omitted enumeration code even if there is a
@code{default} label.
-@item -Wno-switch-bool
@opindex Wswitch-bool
@opindex Wno-switch-bool
+@item -Wno-switch-bool
Do not warn when a @code{switch} statement has an index of boolean type
and the case values are outside the range of a boolean type.
It is possible to suppress this warning by casting the controlling
@end smallexample
This warning is enabled by default for C and C++ programs.
-@item -Wno-switch-outside-range
@opindex Wswitch-outside-range
@opindex Wno-switch-outside-range
+@item -Wno-switch-outside-range
This option controls warnings when a @code{switch} case has a value
that is outside of its
respective type range. This warning is enabled by default for
C and C++ programs.
-@item -Wno-switch-unreachable
@opindex Wswitch-unreachable
@opindex Wno-switch-unreachable
+@item -Wno-switch-unreachable
Do not warn when a @code{switch} statement contains statements between the
controlling expression and the first case label, which will never be
executed. For example:
@end smallexample
This warning is enabled by default for C and C++ programs.
-@item -Wsync-nand @r{(C and C++ only)}
@opindex Wsync-nand
@opindex Wno-sync-nand
+@item -Wsync-nand @r{(C and C++ only)}
Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
built-in functions are used. These functions changed semantics in GCC 4.4.
-@item -Wtrivial-auto-var-init
@opindex Wtrivial-auto-var-init
@opindex Wno-trivial-auto-var-init
+@item -Wtrivial-auto-var-init
Warn when @code{-ftrivial-auto-var-init} cannot initialize the automatic
variable. A common situation is an automatic variable that is declared
between the controlling expression and the first case label of a @code{switch}
statement.
-@item -Wunused-but-set-parameter
@opindex Wunused-but-set-parameter
@opindex Wno-unused-but-set-parameter
+@item -Wunused-but-set-parameter
Warn whenever a function parameter is assigned to, but otherwise unused
(aside from its declaration).
This warning is also enabled by @option{-Wunused} together with
@option{-Wextra}.
-@item -Wunused-but-set-variable
@opindex Wunused-but-set-variable
@opindex Wno-unused-but-set-variable
+@item -Wunused-but-set-variable
Warn whenever a local variable is assigned to, but otherwise unused
(aside from its declaration).
This warning is enabled by @option{-Wall}.
This warning is also enabled by @option{-Wunused}, which is enabled
by @option{-Wall}.
-@item -Wunused-function
@opindex Wunused-function
@opindex Wno-unused-function
+@item -Wunused-function
Warn whenever a static function is declared but not defined or a
non-inline static function is unused.
This warning is enabled by @option{-Wall}.
-@item -Wunused-label
@opindex Wunused-label
@opindex Wno-unused-label
+@item -Wunused-label
Warn whenever a label is declared but not used.
This warning is enabled by @option{-Wall}.
To suppress this warning use the @code{unused} attribute
(@pxref{Variable Attributes}).
-@item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
@opindex Wunused-local-typedefs
@opindex Wno-unused-local-typedefs
+@item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
Warn when a typedef locally defined in a function is not used.
This warning is enabled by @option{-Wall}.
-@item -Wunused-parameter
@opindex Wunused-parameter
@opindex Wno-unused-parameter
+@item -Wunused-parameter
Warn whenever a function parameter is unused aside from its declaration.
To suppress this warning use the @code{unused} attribute
(@pxref{Variable Attributes}).
-@item -Wno-unused-result
@opindex Wunused-result
@opindex Wno-unused-result
+@item -Wno-unused-result
Do not warn if a caller of a function marked with attribute
@code{warn_unused_result} (@pxref{Function Attributes}) does not use
its return value. The default is @option{-Wunused-result}.
-@item -Wunused-variable
@opindex Wunused-variable
@opindex Wno-unused-variable
+@item -Wunused-variable
Warn whenever a local or static variable is unused aside from its
declaration. This option implies @option{-Wunused-const-variable=1} for C,
but not for C++. This warning is enabled by @option{-Wall}.
To suppress this warning use the @code{unused} attribute
(@pxref{Variable Attributes}).
-@item -Wunused-const-variable
-@itemx -Wunused-const-variable=@var{n}
@opindex Wunused-const-variable
@opindex Wno-unused-const-variable
+@item -Wunused-const-variable
+@itemx -Wunused-const-variable=@var{n}
Warn whenever a constant static variable is unused aside from its declaration.
@option{-Wunused-const-variable=1} is enabled by @option{-Wunused-variable}
for C, but not for C++. In C this declares variable storage, but in C++ this
headers included.
@end table
-@item -Wunused-value
@opindex Wunused-value
@opindex Wno-unused-value
+@item -Wunused-value
Warn whenever a statement computes a result that is explicitly not
used. To suppress this warning cast the unused expression to
@code{void}. This includes an expression-statement or the left-hand
This warning is enabled by @option{-Wall}.
-@item -Wunused
@opindex Wunused
@opindex Wno-unused
+@item -Wunused
All the above @option{-Wunused} options combined.
In order to get a warning about an unused function parameter, you must
either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
@option{-Wunused}), or separately specify @option{-Wunused-parameter}.
-@item -Wuninitialized
@opindex Wuninitialized
@opindex Wno-uninitialized
+@item -Wuninitialized
Warn if an object with automatic or allocated storage duration is used
without having been initialized. In C++, also warn if a non-static
reference or non-static @code{const} member appears in a class without
@};
@end smallexample
-@item -Wno-invalid-memory-model
@opindex Winvalid-memory-model
@opindex Wno-invalid-memory-model
+@item -Wno-invalid-memory-model
This option controls warnings
for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins},
and the C11 atomic generic functions with a memory consistency argument
@option{-Winvalid-memory-model} is enabled by default.
-@item -Wmaybe-uninitialized
@opindex Wmaybe-uninitialized
@opindex Wno-maybe-uninitialized
+@item -Wmaybe-uninitialized
For an object with automatic or allocated storage duration, if there exists
a path from the function entry to a use of the object that is initialized,
but there exist some other paths for which the object is not initialized,
This warning is enabled by @option{-Wall} or @option{-Wextra}.
-@item -Wunknown-pragmas
@opindex Wunknown-pragmas
@opindex Wno-unknown-pragmas
+@item -Wunknown-pragmas
@cindex warning for unknown pragmas
@cindex unknown pragmas, warning
@cindex pragmas, warning of unknown
for unknown pragmas in system header files. This is not the case if
the warnings are only enabled by the @option{-Wall} command-line option.
-@item -Wno-pragmas
@opindex Wno-pragmas
@opindex Wpragmas
+@item -Wno-pragmas
Do not warn about misuses of pragmas, such as incorrect parameters,
invalid syntax, or conflicts between pragmas. See also
@option{-Wunknown-pragmas}.
-@item -Wno-prio-ctor-dtor
@opindex Wno-prio-ctor-dtor
@opindex Wprio-ctor-dtor
+@item -Wno-prio-ctor-dtor
Do not warn if a priority from 0 to 100 is used for constructor or destructor.
The use of constructor and destructor attributes allow you to assign a
priority to the constructor/destructor to control its order of execution
greater than 100 as the compiler reserves priority values between 0--100 for
the implementation.
-@item -Wstrict-aliasing
@opindex Wstrict-aliasing
@opindex Wno-strict-aliasing
+@item -Wstrict-aliasing
This option is only active when @option{-fstrict-aliasing} is active.
It warns about code that might break the strict aliasing rules that the
compiler is using for optimization. The warning does not catch all
included in @option{-Wall}.
It is equivalent to @option{-Wstrict-aliasing=3}
-@item -Wstrict-aliasing=n
@opindex Wstrict-aliasing=n
+@item -Wstrict-aliasing=n
This option is only active when @option{-fstrict-aliasing} is active.
It warns about code that might break the strict aliasing rules that the
compiler is using for optimization.
Only warns when the converted pointer is dereferenced.
Does not warn about incomplete types.
-@item -Wstrict-overflow
-@itemx -Wstrict-overflow=@var{n}
@opindex Wstrict-overflow
@opindex Wno-strict-overflow
+@item -Wstrict-overflow
+@itemx -Wstrict-overflow=@var{n}
This option is only active when signed overflow is undefined.
It warns about cases where the compiler optimizes based on the
assumption that signed overflow does not occur. Note that it does not
false positives.
@end table
-@item -Wstring-compare
@opindex Wstring-compare
@opindex Wno-string-compare
+@item -Wstring-compare
Warn for calls to @code{strcmp} and @code{strncmp} whose result is
determined to be either zero or non-zero in tests for such equality
owing to the length of one argument being greater than the size of
@option{-Wstring-compare} is enabled by @option{-Wextra}.
+@opindex Wstringop-overflow
+@opindex Wno-stringop-overflow
@item -Wno-stringop-overflow
@item -Wstringop-overflow
@itemx -Wstringop-overflow=@var{type}
-@opindex Wstringop-overflow
-@opindex Wno-stringop-overflow
Warn for calls to string manipulation functions such as @code{memcpy} and
@code{strcpy} that are determined to overflow the destination buffer. The
optional argument is one greater than the type of Object Size Checking to
Option @option{-Wstringop-overflow=2} is enabled by default.
@table @gcctabopt
-@item -Wstringop-overflow
-@itemx -Wstringop-overflow=1
@opindex Wstringop-overflow
@opindex Wno-stringop-overflow
+@item -Wstringop-overflow
+@itemx -Wstringop-overflow=1
The @option{-Wstringop-overflow=1} option uses type-zero Object Size Checking
to determine the sizes of destination objects. At this setting the option
does not warn for writes past the end of subobjects of larger objects accessed
setting of the option may result in warnings for benign code.
@end table
-@item -Wno-stringop-overread
@opindex Wstringop-overread
@opindex Wno-stringop-overread
+@item -Wno-stringop-overread
Warn for calls to string manipulation functions such as @code{memchr}, or
@code{strcpy} that are determined to read past the end of the source
sequence.
Option @option{-Wstringop-overread} is enabled by default.
-@item -Wno-stringop-truncation
@opindex Wstringop-truncation
@opindex Wno-stringop-truncation
+@item -Wno-stringop-truncation
Do not warn for calls to bounded string manipulation functions
such as @code{strncat},
@code{strncpy}, and @code{stpncpy} that may either truncate the copied string
such arrays GCC issues warnings unless it can prove that the use is
safe. @xref{Common Variable Attributes}.
-@item -Wstrict-flex-arrays
@opindex Wstrict-flex-arrays
@opindex Wno-strict-flex-arrays
+@item -Wstrict-flex-arrays
Warn about inproper usages of flexible array members
according to the @var{level} of the @code{strict_flex_array (@var{level})}
attribute attached to the trailing array field of a structure if it's
if the array is referenced as a flexible array member.
-@item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}cold@r{|}malloc@r{]}
@opindex Wsuggest-attribute=
@opindex Wno-suggest-attribute=
+@item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}cold@r{|}malloc@r{]}
Warn for cases where adding an attribute may be beneficial. The
attributes currently supported are listed below.
@table @gcctabopt
-@item -Wsuggest-attribute=pure
-@itemx -Wsuggest-attribute=const
-@itemx -Wsuggest-attribute=noreturn
-@itemx -Wmissing-noreturn
-@itemx -Wsuggest-attribute=malloc
@opindex Wsuggest-attribute=pure
@opindex Wno-suggest-attribute=pure
@opindex Wsuggest-attribute=const
@opindex Wno-missing-noreturn
@opindex Wsuggest-attribute=malloc
@opindex Wno-suggest-attribute=malloc
+@item -Wsuggest-attribute=pure
+@itemx -Wsuggest-attribute=const
+@itemx -Wsuggest-attribute=noreturn
+@itemx -Wmissing-noreturn
+@itemx -Wsuggest-attribute=malloc
Warn about functions that might be candidates for attributes
@code{pure}, @code{const} or @code{noreturn} or @code{malloc}. The compiler
@option{-O} and higher. Higher optimization levels improve the accuracy
of the analysis.
-@item -Wsuggest-attribute=format
-@itemx -Wmissing-format-attribute
@opindex Wsuggest-attribute=format
@opindex Wmissing-format-attribute
@opindex Wno-suggest-attribute=format
@opindex Wno-missing-format-attribute
@opindex Wformat
@opindex Wno-format
+@item -Wsuggest-attribute=format
+@itemx -Wmissing-format-attribute
Warn about function pointers that might be candidates for @code{format}
attributes. Note these are only possible candidates, not absolute ones.
case, and some functions for which @code{format} attributes are
appropriate may not be detected.
-@item -Wsuggest-attribute=cold
@opindex Wsuggest-attribute=cold
@opindex Wno-suggest-attribute=cold
+@item -Wsuggest-attribute=cold
Warn about functions that might be candidates for @code{cold} attribute. This
is based on static detection and generally only warns about functions which
C++ @code{throw} or fatal error reporting functions leading to @code{abort}.
@end table
-@item -Walloc-zero
@opindex Wno-alloc-zero
@opindex Walloc-zero
+@item -Walloc-zero
Warn about calls to allocation functions decorated with attribute
@code{alloc_size} that specify zero bytes, including those to the built-in
forms of the functions @code{aligned_alloc}, @code{alloca}, @code{calloc},
of @code{realloc} has been deprecated) relying on it may result in subtle
portability bugs and should be avoided.
-@item -Walloc-size-larger-than=@var{byte-size}
@opindex Walloc-size-larger-than=
@opindex Wno-alloc-size-larger-than
+@item -Walloc-size-larger-than=@var{byte-size}
Warn about calls to functions decorated with attribute @code{alloc_size}
that attempt to allocate objects larger than the specified number of bytes,
or where the result of the size computation in an integer type with infinite
@option{-Wno-alloc-size-larger-than}.
@xref{Function Attributes}.
-@item -Wno-alloc-size-larger-than
@opindex Wno-alloc-size-larger-than
+@item -Wno-alloc-size-larger-than
Disable @option{-Walloc-size-larger-than=} warnings. The option is
equivalent to @option{-Walloc-size-larger-than=}@samp{SIZE_MAX} or
larger.
-@item -Walloca
@opindex Wno-alloca
@opindex Walloca
+@item -Walloca
This option warns on all uses of @code{alloca} in the source.
-@item -Walloca-larger-than=@var{byte-size}
@opindex Walloca-larger-than=
@opindex Wno-alloca-larger-than
+@item -Walloca-larger-than=@var{byte-size}
This option warns on calls to @code{alloca} with an integer argument whose
value is either zero, or that is not bounded by a controlling predicate
that limits its value to at most @var{byte-size}. It also warns for calls
See also @option{-Wvla-larger-than=}@samp{byte-size}.
-@item -Wno-alloca-larger-than
@opindex Wno-alloca-larger-than
+@item -Wno-alloca-larger-than
Disable @option{-Walloca-larger-than=} warnings. The option is
equivalent to @option{-Walloca-larger-than=}@samp{SIZE_MAX} or larger.
-@item -Warith-conversion
@opindex Warith-conversion
@opindex Wno-arith-conversion
+@item -Warith-conversion
Do warn about implicit conversions from arithmetic operations even
when conversion of the operands to the same type cannot change their
values. This affects warnings from @option{-Wconversion},
@end group
@end smallexample
-@item -Warray-bounds
-@itemx -Warray-bounds=@var{n}
@opindex Wno-array-bounds
@opindex Warray-bounds
+@item -Warray-bounds
+@itemx -Warray-bounds=@var{n}
Warn about out of bounds subscripts or offsets into arrays. This warning
is enabled by @option{-Wall}. It is more effective when @option{-ftree-vrp}
is active (the default for @option{-O2} and above) but a subset of instances
give a larger number of false positives and is deactivated by default.
@end table
-@item -Warray-compare
@opindex Warray-compare
@opindex Wno-array-compare
+@item -Warray-compare
Warn about equality and relational comparisons between two operands of array
type. This comparison was deprecated in C++20. For example:
@option{-Warray-compare} is enabled by @option{-Wall}.
+@opindex Wno-array-parameter
@item -Warray-parameter
@itemx -Warray-parameter=@var{n}
-@opindex Wno-array-parameter
Warn about redeclarations of functions involving arguments of array or
pointer types of inconsistent kinds or forms, and enable the detection
of out-of-bounds accesses to such parameters by warnings such as
@option{-Wvla-parameter} option triggers warnings for similar inconsistencies
involving Variable Length Array arguments.
-@item -Wattribute-alias=@var{n}
-@itemx -Wno-attribute-alias
@opindex Wattribute-alias
@opindex Wno-attribute-alias
+@item -Wattribute-alias=@var{n}
+@itemx -Wno-attribute-alias
Warn about declarations using the @code{alias} and similar attributes whose
target is incompatible with the type of the alias.
@xref{Function Attributes,,Declaring Attributes of Functions}.
This is the default. You can disable these warnings with either
@option{-Wno-attribute-alias} or @option{-Wattribute-alias=0}.
-@item -Wbidi-chars=@r{[}none@r{|}unpaired@r{|}any@r{|}ucn@r{]}
@opindex Wbidi-chars=
@opindex Wbidi-chars
@opindex Wno-bidi-chars
+@item -Wbidi-chars=@r{[}none@r{|}unpaired@r{|}any@r{|}ucn@r{]}
Warn about possibly misleading UTF-8 bidirectional control characters in
comments, string literals, character constants, and identifiers. Such
characters can change left-to-right writing direction into right-to-left
and is equivalent to @option{-Wbidi-chars=unpaired,ucn}, if no previous
@option{-Wbidi-chars=any} was specified.
-@item -Wbool-compare
@opindex Wno-bool-compare
@opindex Wbool-compare
+@item -Wbool-compare
Warn about boolean expression compared with an integer value different from
@code{true}/@code{false}. For instance, the following comparison is
always false:
@end smallexample
This warning is enabled by @option{-Wall}.
-@item -Wbool-operation
@opindex Wno-bool-operation
@opindex Wbool-operation
+@item -Wbool-operation
Warn about suspicious operations on expressions of a boolean type. For
instance, bitwise negation of a boolean is very likely a bug in the program.
For C, this warning also warns about incrementing or decrementing a boolean,
This warning is enabled by @option{-Wall}.
-@item -Wduplicated-branches
@opindex Wno-duplicated-branches
@opindex Wduplicated-branches
+@item -Wduplicated-branches
Warn when an if-else has identical branches. This warning detects cases like
@smallexample
if (p != NULL)
int i = x ? *p : *p;
@end smallexample
-@item -Wduplicated-cond
@opindex Wno-duplicated-cond
@opindex Wduplicated-cond
+@item -Wduplicated-cond
Warn about duplicated conditions in an if-else-if chain. For instance,
warn for the following code:
@smallexample
else if (p->q != NULL) @{ @dots{} @}
@end smallexample
-@item -Wframe-address
@opindex Wno-frame-address
@opindex Wframe-address
+@item -Wframe-address
Warn when the @samp{__builtin_frame_address} or @samp{__builtin_return_address}
is called with an argument greater than 0. Such calls may return indeterminate
values or crash the program. The warning is included in @option{-Wall}.
-@item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
@opindex Wno-discarded-qualifiers
@opindex Wdiscarded-qualifiers
+@item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
Do not warn if type qualifiers on pointers are being discarded.
Typically, the compiler warns if a @code{const char *} variable is
passed to a function that takes a @code{char *} parameter. This option
can be used to suppress such a warning.
-@item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
@opindex Wno-discarded-array-qualifiers
@opindex Wdiscarded-array-qualifiers
+@item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
Do not warn if type qualifiers on arrays which are pointer targets
are being discarded. Typically, the compiler warns if a
@code{const int (*)[]} variable is passed to a function that
takes a @code{int (*)[]} parameter. This option can be used to
suppress such a warning.
-@item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
@opindex Wno-incompatible-pointer-types
@opindex Wincompatible-pointer-types
+@item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
Do not warn when there is a conversion between pointers that have incompatible
types. This warning is for cases not covered by @option{-Wno-pointer-sign},
which warns for pointer argument passing or assignment with different
signedness.
-@item -Wno-int-conversion @r{(C and Objective-C only)}
@opindex Wno-int-conversion
@opindex Wint-conversion
+@item -Wno-int-conversion @r{(C and Objective-C only)}
Do not warn about incompatible integer to pointer and pointer to integer
conversions. This warning is about implicit conversions; for explicit
conversions the warnings @option{-Wno-int-to-pointer-cast} and
@option{-Wno-pointer-to-int-cast} may be used.
-@item -Wzero-length-bounds
@opindex Wzero-length-bounds
@opindex Wzero-length-bounds
+@item -Wzero-length-bounds
Warn about accesses to elements of zero-length array members that might
overlap other members of the same object. Declaring interior zero-length
arrays is discouraged because accesses to them are undefined. See
Option @option{-Wzero-length-bounds} is enabled by @option{-Warray-bounds}.
-@item -Wno-div-by-zero
@opindex Wno-div-by-zero
@opindex Wdiv-by-zero
+@item -Wno-div-by-zero
Do not warn about compile-time integer division by zero. Floating-point
division by zero is not warned about, as it can be a legitimate way of
obtaining infinities and NaNs.
-@item -Wsystem-headers
@opindex Wsystem-headers
@opindex Wno-system-headers
+@item -Wsystem-headers
@cindex warnings from system headers
@cindex system headers, warnings from
Print warning messages for constructs found in system header files.
option does @emph{not} warn about unknown pragmas in system
headers---for that, @option{-Wunknown-pragmas} must also be used.
-@item -Wtautological-compare
@opindex Wtautological-compare
@opindex Wno-tautological-compare
+@item -Wtautological-compare
Warn if a self-comparison always evaluates to true or false. This
warning detects various mistakes such as:
@smallexample
This warning is enabled by @option{-Wall}.
-@item -Wtrampolines
@opindex Wtrampolines
@opindex Wno-trampolines
+@item -Wtrampolines
Warn about trampolines generated for pointers to nested functions.
A trampoline is a small piece of data or code that is created at run
time on the stack when the address of a nested function is taken, and is
most targets, it is made up of code and thus requires the stack to be
made executable in order for the program to work properly.
-@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
+@item -Wfloat-equal
Warn if floating-point values are used in equality comparisons.
The idea behind this is that sometimes it is convenient (for the
this is done with the relational operators, so equality comparisons are
probably mistaken.
-@item -Wtraditional @r{(C and Objective-C only)}
@opindex Wtraditional
@opindex Wno-traditional
+@item -Wtraditional @r{(C and Objective-C only)}
Warn about certain constructs that behave differently in traditional and
ISO C@. Also warn about ISO C constructs that have no traditional C
equivalent, and/or problematic constructs that should be avoided.
traditional C compatibility.
@end itemize
-@item -Wtraditional-conversion @r{(C and Objective-C only)}
@opindex Wtraditional-conversion
@opindex Wno-traditional-conversion
+@item -Wtraditional-conversion @r{(C and Objective-C only)}
Warn if a prototype causes a type conversion that is different from what
would happen to the same argument in the absence of a prototype. This
includes conversions of fixed point to floating and vice versa, and
conversions changing the width or signedness of a fixed-point argument
except when the same as the default promotion.
-@item -Wdeclaration-after-statement @r{(C and Objective-C only)}
@opindex Wdeclaration-after-statement
@opindex Wno-declaration-after-statement
+@item -Wdeclaration-after-statement @r{(C and Objective-C only)}
Warn when a declaration is found after a statement in a block. This
construct, known from C++, was introduced with ISO C99 and is by default
allowed in GCC@. It is not supported by ISO C90. @xref{Mixed Labels and Declarations}.
-@item -Wshadow
@opindex Wshadow
@opindex Wno-shadow
+@item -Wshadow
Warn whenever a local variable or type declaration shadows another
variable, parameter, type, class member (in C++), or instance variable
(in Objective-C) or whenever a built-in function is shadowed. Note
@option{-Wshadow} is used.
Same as @option{-Wshadow=global}.
-@item -Wno-shadow-ivar @r{(Objective-C only)}
@opindex Wno-shadow-ivar
@opindex Wshadow-ivar
+@item -Wno-shadow-ivar @r{(Objective-C only)}
Do not warn whenever a local variable shadows an instance variable in an
Objective-C method.
-@item -Wshadow=global
@opindex Wshadow=global
+@item -Wshadow=global
Warn for any shadowing.
Same as @option{-Wshadow}.
-@item -Wshadow=local
@opindex Wshadow=local
+@item -Wshadow=local
Warn when a local variable shadows another local variable or parameter.
-@item -Wshadow=compatible-local
@opindex Wshadow=compatible-local
+@item -Wshadow=compatible-local
Warn when a local variable shadows another local variable or parameter
whose type is compatible with that of the shadowing variable. In C++,
type compatibility here means the type of the shadowing variable can be
This warning is also enabled by @option{-Wshadow=local}.
-@item -Wlarger-than=@var{byte-size}
@opindex Wlarger-than=
@opindex Wlarger-than-@var{byte-size}
+@item -Wlarger-than=@var{byte-size}
Warn whenever an object is defined whose size exceeds @var{byte-size}.
@option{-Wlarger-than=}@samp{PTRDIFF_MAX} is enabled by default.
Warnings controlled by the option can be disabled either by specifying
object, which is @samp{PTRDIFF_MAX} bytes by default. These warnings
can only be disabled by @option{-Wno-larger-than}.
-@item -Wno-larger-than
@opindex Wno-larger-than
+@item -Wno-larger-than
Disable @option{-Wlarger-than=} warnings. The option is equivalent
to @option{-Wlarger-than=}@samp{SIZE_MAX} or larger.
-@item -Wframe-larger-than=@var{byte-size}
@opindex Wframe-larger-than=
@opindex Wno-frame-larger-than
+@item -Wframe-larger-than=@var{byte-size}
Warn if the size of a function frame exceeds @var{byte-size}.
The computation done to determine the stack frame size is approximate
and not conservative.
@var{byte-size} of @samp{SIZE_MAX} or more or by
@option{-Wno-frame-larger-than}.
-@item -Wno-frame-larger-than
@opindex Wno-frame-larger-than
+@item -Wno-frame-larger-than
Disable @option{-Wframe-larger-than=} warnings. The option is equivalent
to @option{-Wframe-larger-than=}@samp{SIZE_MAX} or larger.
-@item -Wfree-nonheap-object
@opindex Wfree-nonheap-object
@opindex Wno-free-nonheap-object
+@item -Wfree-nonheap-object
Warn when attempting to deallocate an object that was either not allocated
on the heap, or by using a pointer that was not returned from a prior call
to the corresponding allocation function. For example, because the call
@option{-Wfree-nonheap-object} is included in @option{-Wall}.
-@item -Wstack-usage=@var{byte-size}
@opindex Wstack-usage
@opindex Wno-stack-usage
+@item -Wstack-usage=@var{byte-size}
Warn if the stack usage of a function might exceed @var{byte-size}.
The computation done to determine the stack usage is conservative.
Any space allocated via @code{alloca}, variable-length arrays, or related
@var{byte-size} of @samp{SIZE_MAX} or more or by
@option{-Wno-stack-usage}.
-@item -Wno-stack-usage
@opindex Wno-stack-usage
+@item -Wno-stack-usage
Disable @option{-Wstack-usage=} warnings. The option is equivalent
to @option{-Wstack-usage=}@samp{SIZE_MAX} or larger.
-@item -Wunsafe-loop-optimizations
@opindex Wunsafe-loop-optimizations
@opindex Wno-unsafe-loop-optimizations
+@item -Wunsafe-loop-optimizations
Warn if the loop cannot be optimized because the compiler cannot
assume anything on the bounds of the loop indices. With
@option{-funsafe-loop-optimizations} warn if the compiler makes
such assumptions.
-@item -Wno-pedantic-ms-format @r{(MinGW targets only)}
@opindex Wno-pedantic-ms-format
@opindex Wpedantic-ms-format
+@item -Wno-pedantic-ms-format @r{(MinGW targets only)}
When used in combination with @option{-Wformat}
and @option{-pedantic} without GNU extensions, this option
disables the warnings about non-ISO @code{printf} / @code{scanf} format
width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
which depend on the MS runtime.
-@item -Wpointer-arith
@opindex Wpointer-arith
@opindex Wno-pointer-arith
+@item -Wpointer-arith
Warn about anything that depends on the ``size of'' a function type or
of @code{void}. GNU C assigns these types a size of 1, for
convenience in calculations with @code{void *} pointers and pointers
to functions. In C++, warn also when an arithmetic operation involves
@code{NULL}. This warning is also enabled by @option{-Wpedantic}.
-@item -Wno-pointer-compare
@opindex Wpointer-compare
@opindex Wno-pointer-compare
+@item -Wno-pointer-compare
Do not warn if a pointer is compared with a zero character constant.
This usually
means that the pointer was meant to be dereferenced. For example:
This warning is enabled by default.
-@item -Wtsan
@opindex Wtsan
@opindex Wno-tsan
+@item -Wtsan
Warn about unsupported features in ThreadSanitizer.
ThreadSanitizer does not support @code{std::atomic_thread_fence} and
This warning is enabled by default.
-@item -Wtype-limits
@opindex Wtype-limits
@opindex Wno-type-limits
+@item -Wtype-limits
Warn if a comparison is always true or always false due to the limited
range of the data type, but do not warn for constant expressions. For
example, warn if an unsigned variable is compared against zero with
@code{<} or @code{>=}. This warning is also enabled by
@option{-Wextra}.
-@item -Wabsolute-value @r{(C and Objective-C only)}
@opindex Wabsolute-value
@opindex Wno-absolute-value
+@item -Wabsolute-value @r{(C and Objective-C only)}
Warn for calls to standard functions that compute the absolute value
of an argument when a more appropriate standard function is available.
For example, calling @code{abs(3.14)} triggers the warning because the
@include cppwarnopts.texi
-@item -Wbad-function-cast @r{(C and Objective-C only)}
@opindex Wbad-function-cast
@opindex Wno-bad-function-cast
+@item -Wbad-function-cast @r{(C and Objective-C only)}
Warn when a function call is cast to a non-matching type.
For example, warn if a call to a function returning an integer type
is cast to a pointer type.
-@item -Wc90-c99-compat @r{(C and Objective-C only)}
@opindex Wc90-c99-compat
@opindex Wno-c90-c99-compat
+@item -Wc90-c99-compat @r{(C and Objective-C only)}
Warn about features not present in ISO C90, but present in ISO C99.
For instance, warn about use of variable length arrays, @code{long long}
type, @code{bool} type, compound literals, designated initializers, and so
on. This option is independent of the standards mode. Warnings are disabled
in the expression that follows @code{__extension__}.
-@item -Wc99-c11-compat @r{(C and Objective-C only)}
@opindex Wc99-c11-compat
@opindex Wno-c99-c11-compat
+@item -Wc99-c11-compat @r{(C and Objective-C only)}
Warn about features not present in ISO C99, but present in ISO C11.
For instance, warn about use of anonymous structures and unions,
@code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
and so on. This option is independent of the standards mode. Warnings are
disabled in the expression that follows @code{__extension__}.
-@item -Wc11-c2x-compat @r{(C and Objective-C only)}
@opindex Wc11-c2x-compat
@opindex Wno-c11-c2x-compat
+@item -Wc11-c2x-compat @r{(C and Objective-C only)}
Warn about features not present in ISO C11, but present in ISO C2X.
For instance, warn about omitting the string in @code{_Static_assert},
use of @samp{[[]]} syntax for attributes, use of decimal
standards mode. Warnings are disabled in the expression that follows
@code{__extension__}.
-@item -Wc++-compat @r{(C and Objective-C only)}
@opindex Wc++-compat
@opindex Wno-c++-compat
+@item -Wc++-compat @r{(C and Objective-C only)}
Warn about ISO C constructs that are outside of the common subset of
ISO C and ISO C++, e.g.@: request for implicit conversion from
@code{void *} to a pointer to non-@code{void} type.
-@item -Wc++11-compat @r{(C++ and Objective-C++ only)}
@opindex Wc++11-compat
@opindex Wno-c++11-compat
+@item -Wc++11-compat @r{(C++ and Objective-C++ only)}
Warn about C++ constructs whose meaning differs between ISO C++ 1998
and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
in ISO C++ 2011. This warning turns on @option{-Wnarrowing} and is
enabled by @option{-Wall}.
-@item -Wc++14-compat @r{(C++ and Objective-C++ only)}
@opindex Wc++14-compat
@opindex Wno-c++14-compat
+@item -Wc++14-compat @r{(C++ and Objective-C++ only)}
Warn about C++ constructs whose meaning differs between ISO C++ 2011
and ISO C++ 2014. This warning is enabled by @option{-Wall}.
-@item -Wc++17-compat @r{(C++ and Objective-C++ only)}
@opindex Wc++17-compat
@opindex Wno-c++17-compat
+@item -Wc++17-compat @r{(C++ and Objective-C++ only)}
Warn about C++ constructs whose meaning differs between ISO C++ 2014
and ISO C++ 2017. This warning is enabled by @option{-Wall}.
-@item -Wc++20-compat @r{(C++ and Objective-C++ only)}
@opindex Wc++20-compat
@opindex Wno-c++20-compat
+@item -Wc++20-compat @r{(C++ and Objective-C++ only)}
Warn about C++ constructs whose meaning differs between ISO C++ 2017
and ISO C++ 2020. This warning is enabled by @option{-Wall}.
-@item -Wno-c++11-extensions @r{(C++ and Objective-C++ only)}
@opindex Wc++11-extensions
@opindex Wno-c++11-extensions
+@item -Wno-c++11-extensions @r{(C++ and Objective-C++ only)}
Do not warn about C++11 constructs in code being compiled using
an older C++ standard. Even without this option, some C++11 constructs
will only be diagnosed if @option{-Wpedantic} is used.
-@item -Wno-c++14-extensions @r{(C++ and Objective-C++ only)}
@opindex Wc++14-extensions
@opindex Wno-c++14-extensions
+@item -Wno-c++14-extensions @r{(C++ and Objective-C++ only)}
Do not warn about C++14 constructs in code being compiled using
an older C++ standard. Even without this option, some C++14 constructs
will only be diagnosed if @option{-Wpedantic} is used.
-@item -Wno-c++17-extensions @r{(C++ and Objective-C++ only)}
@opindex Wc++17-extensions
@opindex Wno-c++17-extensions
+@item -Wno-c++17-extensions @r{(C++ and Objective-C++ only)}
Do not warn about C++17 constructs in code being compiled using
an older C++ standard. Even without this option, some C++17 constructs
will only be diagnosed if @option{-Wpedantic} is used.
-@item -Wno-c++20-extensions @r{(C++ and Objective-C++ only)}
@opindex Wc++20-extensions
@opindex Wno-c++20-extensions
+@item -Wno-c++20-extensions @r{(C++ and Objective-C++ only)}
Do not warn about C++20 constructs in code being compiled using
an older C++ standard. Even without this option, some C++20 constructs
will only be diagnosed if @option{-Wpedantic} is used.
-@item -Wno-c++23-extensions @r{(C++ and Objective-C++ only)}
@opindex Wc++23-extensions
@opindex Wno-c++23-extensions
+@item -Wno-c++23-extensions @r{(C++ and Objective-C++ only)}
Do not warn about C++23 constructs in code being compiled using
an older C++ standard. Even without this option, some C++23 constructs
will only be diagnosed if @option{-Wpedantic} is used.
-@item -Wcast-qual
@opindex Wcast-qual
@opindex Wno-cast-qual
+@item -Wcast-qual
Warn whenever a pointer is cast so as to remove a type qualifier from
the target type. For example, warn if a @code{const char *} is cast
to an ordinary @code{char *}.
**p = 'b';
@end smallexample
-@item -Wcast-align
@opindex Wcast-align
@opindex Wno-cast-align
+@item -Wcast-align
Warn whenever a pointer is cast such that the required alignment of the
target is increased. For example, warn if a @code{char *} is cast to
an @code{int *} on machines where integers can only be accessed at
two- or four-byte boundaries.
-@item -Wcast-align=strict
@opindex Wcast-align=strict
+@item -Wcast-align=strict
Warn whenever a pointer is cast such that the required alignment of the
target is increased. For example, warn if a @code{char *} is cast to
an @code{int *} regardless of the target machine.
-@item -Wcast-function-type
@opindex Wcast-function-type
@opindex Wno-cast-function-type
+@item -Wcast-function-type
Warn when a function pointer is cast to an incompatible function pointer.
In a cast involving function types with a variable argument list only
the types of initial arguments that are provided are considered.
the type cast is changing the pointer to member type.
This warning is enabled by @option{-Wextra}.
-@item -Wwrite-strings
@opindex Wwrite-strings
@opindex Wno-write-strings
+@item -Wwrite-strings
When compiling C, give string constants the type @code{const
char[@var{length}]} so that copying the address of one into a
non-@code{const} @code{char *} pointer produces a warning. These
Warnings about conversion from arithmetic on a small type back to that
type are only given with @option{-Warith-conversion}.
-@item -Wdangling-else
@opindex Wdangling-else
@opindex Wno-dangling-else
+@item -Wdangling-else
Warn about constructions where there may be confusion to which
@code{if} statement an @code{else} branch belongs. Here is an example of
such a case:
This warning is enabled by @option{-Wparentheses}.
-@item -Wdangling-pointer
-@itemx -Wdangling-pointer=@var{n}
@opindex Wdangling-pointer
@opindex Wno-dangling-pointer
+@item -Wdangling-pointer
+@itemx -Wdangling-pointer=@var{n}
Warn about uses of pointers (or C++ references) to objects with automatic
storage duration after their lifetime has ended. This includes local
variables declared in nested blocks, compound literals and other unnamed
@option{-Wdangling-pointer=2} is included in @option{-Wall}.
-@item -Wdate-time
@opindex Wdate-time
@opindex Wno-date-time
+@item -Wdate-time
Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
are encountered as they might prevent bit-wise-identical reproducible
compilations.
-@item -Wempty-body
@opindex Wempty-body
@opindex Wno-empty-body
+@item -Wempty-body
Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
while} statement. This warning is also enabled by @option{-Wextra}.
-@item -Wno-endif-labels
@opindex Wendif-labels
@opindex Wno-endif-labels
+@item -Wno-endif-labels
Do not warn about stray tokens after @code{#else} and @code{#endif}.
-@item -Wenum-compare
@opindex Wenum-compare
@opindex Wno-enum-compare
+@item -Wenum-compare
Warn about a comparison between values of different enumerated types.
In C++ enumerated type mismatches in conditional expressions are also
diagnosed and the warning is enabled by default. In C this warning is
enabled by @option{-Wall}.
-@item -Wenum-conversion
@opindex Wenum-conversion
@opindex Wno-enum-conversion
+@item -Wenum-conversion
Warn when a value of enumerated type is implicitly converted to a
different enumerated type. This warning is enabled by @option{-Wextra}
in C@.
-@item -Wenum-int-mismatch @r{(C and Objective-C only)}
@opindex Wenum-int-mismatch
@opindex Wno-enum-int-mismatch
+@item -Wenum-int-mismatch @r{(C and Objective-C only)}
Warn about mismatches between an enumerated type and an integer type in
declarations. For example:
are an error. In C, this warning is enabled by @option{-Wall} and
@option{-Wc++-compat}.
-@item -Wjump-misses-init @r{(C, Objective-C only)}
@opindex Wjump-misses-init
@opindex Wno-jump-misses-init
+@item -Wjump-misses-init @r{(C, Objective-C only)}
Warn if a @code{goto} statement or a @code{switch} statement jumps
forward across the initialization of a variable, or jumps backward to a
label after the variable has been initialized. This only warns about
@option{-Wjump-misses-init} is included in @option{-Wc++-compat}. It
can be disabled with the @option{-Wno-jump-misses-init} option.
-@item -Wsign-compare
@opindex Wsign-compare
@opindex Wno-sign-compare
+@item -Wsign-compare
@cindex warning for comparison of signed and unsigned values
@cindex comparison of signed and unsigned values, warning
@cindex signed and unsigned values, comparison warning
In C++, this warning is also enabled by @option{-Wall}. In C, it is
also enabled by @option{-Wextra}.
-@item -Wsign-conversion
@opindex Wsign-conversion
@opindex Wno-sign-conversion
+@item -Wsign-conversion
Warn for implicit conversions that may change the sign of an integer
value, like assigning a signed integer expression to an unsigned
integer variable. An explicit cast silences the warning. In C, this
option is enabled also by @option{-Wconversion}.
-@item -Wfloat-conversion
@opindex Wfloat-conversion
@opindex Wno-float-conversion
+@item -Wfloat-conversion
Warn for implicit conversions that reduce the precision of a real value.
This includes conversions from real to integer, and from higher precision
real to lower precision real values. This option is also enabled by
@option{-Wconversion}.
-@item -Wno-scalar-storage-order
@opindex Wno-scalar-storage-order
@opindex Wscalar-storage-order
+@item -Wno-scalar-storage-order
Do not warn on suspicious constructs involving reverse scalar storage order.
-@item -Wsizeof-array-div
@opindex Wsizeof-array-div
@opindex Wno-sizeof-array-div
+@item -Wsizeof-array-div
Warn about divisions of two sizeof operators when the first one is applied
to an array and the divisor does not equal the size of the array element.
In such a case, the computation will not yield the number of elements in the
This warning is enabled by @option{-Wall}.
-@item -Wsizeof-pointer-div
@opindex Wsizeof-pointer-div
@opindex Wno-sizeof-pointer-div
+@item -Wsizeof-pointer-div
Warn for suspicious divisions of two sizeof expressions that divide
the pointer size by the element size, which is the usual way to compute
the array size but won't work out correctly with pointers. This warning
warns e.g.@: about @code{sizeof (ptr) / sizeof (ptr[0])} if @code{ptr} is
not an array, but a pointer. This warning is enabled by @option{-Wall}.
-@item -Wsizeof-pointer-memaccess
@opindex Wsizeof-pointer-memaccess
@opindex Wno-sizeof-pointer-memaccess
+@item -Wsizeof-pointer-memaccess
Warn for suspicious length parameters to certain string and memory built-in
functions if the argument uses @code{sizeof}. This warning triggers for
example for @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not
The @option{-Wsizeof-pointer-memaccess} option is enabled by @option{-Wall}.
-@item -Wno-sizeof-array-argument
@opindex Wsizeof-array-argument
@opindex Wno-sizeof-array-argument
+@item -Wno-sizeof-array-argument
Do not warn when the @code{sizeof} operator is applied to a parameter that is
declared as an array in a function definition. This warning is enabled by
default for C and C++ programs.
-@item -Wmemset-elt-size
@opindex Wmemset-elt-size
@opindex Wno-memset-elt-size
+@item -Wmemset-elt-size
Warn for suspicious calls to the @code{memset} built-in function, if the
first argument references an array, and the third argument is a number
equal to the number of elements, but not equal to the size of the array
in memory. This indicates that the user has omitted a multiplication by
the element size. This warning is enabled by @option{-Wall}.
-@item -Wmemset-transposed-args
@opindex Wmemset-transposed-args
@opindex Wno-memset-transposed-args
+@item -Wmemset-transposed-args
Warn for suspicious calls to the @code{memset} built-in function where
the second argument is not zero and the third argument is zero. For
example, the call @code{memset (buf, sizeof buf, 0)} is diagnosed because
transposed and no warning is emitted. This warning is enabled
by @option{-Wall}.
-@item -Waddress
@opindex Waddress
@opindex Wno-address
+@item -Waddress
Warn about suspicious uses of address expressions. These include comparing
the address of a function or a declared object to the null pointer constant
such as in
of macro expansion.
@option{-Waddress} warning is enabled by @option{-Wall}.
-@item -Wno-address-of-packed-member
@opindex Waddress-of-packed-member
@opindex Wno-address-of-packed-member
+@item -Wno-address-of-packed-member
Do not warn when the address of packed member of struct or union is taken,
which usually results in an unaligned pointer value. This is
enabled by default.
-@item -Wlogical-op
@opindex Wlogical-op
@opindex Wno-logical-op
+@item -Wlogical-op
Warn about suspicious uses of logical operators in expressions.
This includes using logical operators in contexts where a
bit-wise operator is likely to be expected. Also warns when
if (a < 0 && a < 0) @{ @dots{} @}
@end smallexample
-@item -Wlogical-not-parentheses
@opindex Wlogical-not-parentheses
@opindex Wno-logical-not-parentheses
+@item -Wlogical-not-parentheses
Warn about logical not used on the left hand side operand of a comparison.
This option does not warn if the right operand is considered to be a boolean
expression. Its purpose is to detect suspicious code like the following:
This warning is enabled by @option{-Wall}.
-@item -Waggregate-return
@opindex Waggregate-return
@opindex Wno-aggregate-return
+@item -Waggregate-return
Warn if any functions that return structures or unions are defined or
called. (In languages where you can return an array, this also elicits
a warning.)
-@item -Wno-aggressive-loop-optimizations
@opindex Wno-aggressive-loop-optimizations
@opindex Waggressive-loop-optimizations
+@item -Wno-aggressive-loop-optimizations
Warn if in a loop with constant number of iterations the compiler detects
undefined behavior in some statement during one or more of the iterations.
-@item -Wno-attributes
@opindex Wno-attributes
@opindex Wattributes
+@item -Wno-attributes
Do not warn if an unexpected @code{__attribute__} is used, such as
unrecognized attributes, function attributes applied to variables,
etc. This does not stop errors for incorrect use of supported
Note that @option{-Wno-attributes=} does not imply @option{-Wno-attributes}.
-@item -Wno-builtin-declaration-mismatch
@opindex Wno-builtin-declaration-mismatch
@opindex Wbuiltin-declaration-mismatch
+@item -Wno-builtin-declaration-mismatch
Warn if a built-in function is declared with an incompatible signature
or as a non-function, or when a built-in function declared with a type
that does not include a prototype is called with arguments whose promoted
@}
@end smallexample
-@item -Wno-builtin-macro-redefined
@opindex Wno-builtin-macro-redefined
@opindex Wbuiltin-macro-redefined
+@item -Wno-builtin-macro-redefined
Do not warn if certain built-in macros are redefined. This suppresses
warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
@code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
-@item -Wstrict-prototypes @r{(C and Objective-C only)}
@opindex Wstrict-prototypes
@opindex Wno-strict-prototypes
+@item -Wstrict-prototypes @r{(C and Objective-C only)}
Warn if a function is declared or defined without specifying the
argument types. (An old-style function definition is permitted without
a warning if preceded by a declaration that specifies the argument
types.)
-@item -Wold-style-declaration @r{(C and Objective-C only)}
@opindex Wold-style-declaration
@opindex Wno-old-style-declaration
+@item -Wold-style-declaration @r{(C and Objective-C only)}
Warn for obsolescent usages, according to the C Standard, in a
declaration. For example, warn if storage-class specifiers like
@code{static} are not the first things in a declaration. This warning
is also enabled by @option{-Wextra}.
-@item -Wold-style-definition @r{(C and Objective-C only)}
@opindex Wold-style-definition
@opindex Wno-old-style-definition
+@item -Wold-style-definition @r{(C and Objective-C only)}
Warn if an old-style function definition is used. A warning is given
even if there is a previous prototype. A definition using @samp{()}
is not considered an old-style definition in C2X mode, because it is
equivalent to @samp{(void)} in that case, but is considered an
old-style definition for older standards.
-@item -Wmissing-parameter-type @r{(C and Objective-C only)}
@opindex Wmissing-parameter-type
@opindex Wno-missing-parameter-type
+@item -Wmissing-parameter-type @r{(C and Objective-C only)}
A function parameter is declared without a type specifier in K&R-style
functions:
This warning is also enabled by @option{-Wextra}.
-@item -Wmissing-prototypes @r{(C and Objective-C only)}
@opindex Wmissing-prototypes
@opindex Wno-missing-prototypes
+@item -Wmissing-prototypes @r{(C and Objective-C only)}
Warn if a global function is defined without a previous prototype
declaration. This warning is issued even if the definition itself
provides a prototype. Use this option to detect global functions
overload rather than conflict with an earlier declaration.
Use @option{-Wmissing-declarations} to detect missing declarations in C++.
-@item -Wmissing-declarations
@opindex Wmissing-declarations
@opindex Wno-missing-declarations
+@item -Wmissing-declarations
Warn if a global function is defined without a previous declaration.
Do so even if the definition itself provides a prototype.
Use this option to detect global functions that are not declared in
missing prototypes. In C++, no warnings are issued for function templates,
or for inline functions, or for functions in anonymous namespaces.
-@item -Wmissing-field-initializers
@opindex Wmissing-field-initializers
@opindex Wno-missing-field-initializers
@opindex W
@opindex Wextra
@opindex Wno-extra
+@item -Wmissing-field-initializers
Warn if a structure's initializer has some fields missing. For
example, the following code causes such a warning, because
@code{x.h} is implicitly zero:
This warning is included in @option{-Wextra}. To get other @option{-Wextra}
warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
-@item -Wno-missing-requires
@opindex Wmissing-requires
@opindex Wno-missing-requires
+@item -Wno-missing-requires
By default, the compiler warns about a concept-id appearing as a C++20 simple-requirement:
This warning can be disabled with @option{-Wno-missing-requires}.
-@item -Wno-missing-template-keyword
@opindex Wmissing-template-keyword
@opindex Wno-missing-template-keyword
+@item -Wno-missing-template-keyword
The member access tokens ., -> and :: must be followed by the @code{template}
keyword if the parent object is dependent and the member being named is a
This warning can be disabled with @option{-Wno-missing-template-keyword}.
-@item -Wno-multichar
@opindex Wno-multichar
@opindex Wmultichar
+@item -Wno-multichar
Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
Usually they indicate a typo in the user's code, as they have
implementation-defined values, and should not be used in portable code.
-@item -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]}
@opindex Wnormalized=
@opindex Wnormalized
@opindex Wno-normalized
+@item -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]}
@cindex NFC
@cindex NFKC
@cindex character set, input normalization
useful as a local coding convention if the programming environment
cannot be fixed to display these characters distinctly.
-@item -Wno-attribute-warning
@opindex Wno-attribute-warning
@opindex Wattribute-warning
+@item -Wno-attribute-warning
Do not warn about usage of functions (@pxref{Function Attributes})
declared with @code{warning} attribute. By default, this warning is
enabled. @option{-Wno-attribute-warning} can be used to disable the
warning or @option{-Wno-error=attribute-warning} can be used to
disable the error when compiled with @option{-Werror} flag.
-@item -Wno-deprecated
@opindex Wno-deprecated
@opindex Wdeprecated
+@item -Wno-deprecated
Do not warn about usage of deprecated features. @xref{Deprecated Features}.
-@item -Wno-deprecated-declarations
@opindex Wno-deprecated-declarations
@opindex Wdeprecated-declarations
+@item -Wno-deprecated-declarations
Do not warn about uses of functions (@pxref{Function Attributes}),
variables (@pxref{Variable Attributes}), and types (@pxref{Type
Attributes}) marked as deprecated by using the @code{deprecated}
attribute.
-@item -Wno-overflow
@opindex Wno-overflow
@opindex Woverflow
+@item -Wno-overflow
Do not warn about compile-time overflow in constant expressions.
-@item -Wno-odr
@opindex Wno-odr
@opindex Wodr
+@item -Wno-odr
Warn about One Definition Rule violations during link-time optimization.
Enabled by default.
-@item -Wopenacc-parallelism
@opindex Wopenacc-parallelism
@opindex Wno-openacc-parallelism
+@item -Wopenacc-parallelism
@cindex OpenACC accelerator programming
Warn about potentially suboptimal choices related to OpenACC parallelism.
-@item -Wopenmp-simd
@opindex Wopenmp-simd
@opindex Wno-openmp-simd
+@item -Wopenmp-simd
Warn if the vectorizer cost model overrides the OpenMP
simd directive set by user. The @option{-fsimd-cost-model=unlimited}
option can be used to relax the cost model.
-@item -Woverride-init @r{(C and Objective-C only)}
@opindex Woverride-init
@opindex Wno-override-init
@opindex W
@opindex Wextra
@opindex Wno-extra
+@item -Woverride-init @r{(C and Objective-C only)}
Warn if an initialized field without side effects is overridden when
using designated initializers (@pxref{Designated Inits, , Designated
Initializers}).
@option{-Wextra} warnings without this one, use @option{-Wextra
-Wno-override-init}.
-@item -Wno-override-init-side-effects @r{(C and Objective-C only)}
@opindex Woverride-init-side-effects
@opindex Wno-override-init-side-effects
+@item -Wno-override-init-side-effects @r{(C and Objective-C only)}
Do not warn if an initialized field with side effects is overridden when
using designated initializers (@pxref{Designated Inits, , Designated
Initializers}). This warning is enabled by default.
-@item -Wpacked
@opindex Wpacked
@opindex Wno-packed
+@item -Wpacked
Warn if a structure is given the packed attribute, but the packed
attribute has no effect on the layout or size of the structure.
Such structures may be mis-aligned for little benefit. For
@end group
@end smallexample
-@item -Wnopacked-bitfield-compat
@opindex Wpacked-bitfield-compat
@opindex Wno-packed-bitfield-compat
+@item -Wnopacked-bitfield-compat
The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
on bit-fields of type @code{char}. This was fixed in GCC 4.4 but
the change can lead to differences in the structure layout. GCC
This warning is enabled by default. Use
@option{-Wno-packed-bitfield-compat} to disable this warning.
-@item -Wpacked-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
@opindex Wpacked-not-aligned
@opindex Wno-packed-not-aligned
+@item -Wpacked-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
Warn if a structure field with explicitly specified alignment in a
packed struct or union is misaligned. For example, a warning will
be issued on @code{struct S}, like, @code{warning: alignment 1 of
This warning is enabled by @option{-Wall}.
-@item -Wpadded
@opindex Wpadded
@opindex Wno-padded
+@item -Wpadded
Warn if padding is included in a structure, either to align an element
of the structure or to align the whole structure. Sometimes when this
happens it is possible to rearrange the fields of the structure to
reduce the padding and so make the structure smaller.
-@item -Wredundant-decls
@opindex Wredundant-decls
@opindex Wno-redundant-decls
+@item -Wredundant-decls
Warn if anything is declared more than once in the same scope, even in
cases where multiple declaration is valid and changes nothing.
-@item -Wrestrict
@opindex Wrestrict
@opindex Wno-restrict
+@item -Wrestrict
Warn when an object referenced by a @code{restrict}-qualified parameter
(or, in C++, a @code{__restrict}-qualified parameter) is aliased by another
argument, or when copies between such objects overlap. For example,
even without optimization but works best at @option{-O2} and above. It
is included in @option{-Wall}.
-@item -Wnested-externs @r{(C and Objective-C only)}
@opindex Wnested-externs
@opindex Wno-nested-externs
+@item -Wnested-externs @r{(C and Objective-C only)}
Warn if an @code{extern} declaration is encountered within a function.
-@item -Winline
@opindex Winline
@opindex Wno-inline
+@item -Winline
Warn if a function that is declared as inline cannot be inlined.
Even with this option, the compiler does not warn about failures to
inline functions declared in system headers.
seemingly insignificant changes in the source program can cause the
warnings produced by @option{-Winline} to appear or disappear.
-@item -Winterference-size
@opindex Winterference-size
+@item -Winterference-size
Warn about use of C++17 @code{std::hardware_destructive_interference_size}
without specifying its value with @option{--param destructive-interference-size}.
Also warn about questionable values for that option.
outside a single build of your project, you can turn off the warning
with @option{-Wno-interference-size}.
-@item -Wint-in-bool-context
@opindex Wint-in-bool-context
@opindex Wno-int-in-bool-context
+@item -Wint-in-bool-context
Warn for suspicious use of integer values where boolean values are expected,
such as conditional expressions (?:) using non-boolean integer constants in
boolean context, like @code{if (a <= b ? 2 : 3)}. Or left shifting of signed
for all kinds of multiplications regardless of the data type.
This warning is enabled by @option{-Wall}.
-@item -Wno-int-to-pointer-cast
@opindex Wno-int-to-pointer-cast
@opindex Wint-to-pointer-cast
+@item -Wno-int-to-pointer-cast
Suppress warnings from casts to pointer type of an integer of a
different size. In C++, casting to a pointer type of smaller size is
an error. @option{Wint-to-pointer-cast} is enabled by default.
-@item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
@opindex Wno-pointer-to-int-cast
@opindex Wpointer-to-int-cast
+@item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
Suppress warnings from casts from a pointer to an integer type of a
different size.
-@item -Winvalid-pch
@opindex Winvalid-pch
@opindex Wno-invalid-pch
+@item -Winvalid-pch
Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
the search path but cannot be used.
-@item -Winvalid-utf8
@opindex Winvalid-utf8
@opindex Wno-invalid-utf8
+@item -Winvalid-utf8
Warn if an invalid UTF-8 character is found.
This warning is on by default for C++23 if @option{-finput-charset=UTF-8}
is used and turned into error with @option{-pedantic-errors}.
-@item -Wno-unicode
@opindex Wunicode
@opindex Wno-unicode
+@item -Wno-unicode
Don't diagnose invalid forms of delimited or named escape sequences which are
treated as separate tokens. @option{Wunicode} is enabled by default.
-@item -Wlong-long
@opindex Wlong-long
@opindex Wno-long-long
+@item -Wlong-long
Warn if @code{long long} type is used. This is enabled by either
@option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
modes. To inhibit the warning messages, use @option{-Wno-long-long}.
-@item -Wvariadic-macros
@opindex Wvariadic-macros
@opindex Wno-variadic-macros
+@item -Wvariadic-macros
Warn if variadic macros are used in ISO C90 mode, or if the GNU
alternate syntax is used in ISO C99 mode. This is enabled by either
@option{-Wpedantic} or @option{-Wtraditional}. To inhibit the warning
messages, use @option{-Wno-variadic-macros}.
-@item -Wno-varargs
@opindex Wvarargs
@opindex Wno-varargs
+@item -Wno-varargs
Do not warn upon questionable usage of the macros used to handle variable
arguments like @code{va_start}. These warnings are enabled by default.
-@item -Wvector-operation-performance
@opindex Wvector-operation-performance
@opindex Wno-vector-operation-performance
+@item -Wvector-operation-performance
Warn if vector operation is not implemented via SIMD capabilities of the
architecture. Mainly useful for the performance tuning.
Vector operation can be implemented @code{piecewise}, which means that the
and @code{as a single scalar}, which means that vector fits into a
scalar type.
-@item -Wvla
@opindex Wvla
@opindex Wno-vla
+@item -Wvla
Warn if a variable-length array is used in the code.
@option{-Wno-vla} prevents the @option{-Wpedantic} warning of
the variable-length array.
-@item -Wvla-larger-than=@var{byte-size}
@opindex Wvla-larger-than=
@opindex Wno-vla-larger-than
+@item -Wvla-larger-than=@var{byte-size}
If this option is used, the compiler warns for declarations of
variable-length arrays whose size is either unbounded, or bounded
by an argument that allows the array size to exceed @var{byte-size}
See also @option{-Walloca-larger-than=@var{byte-size}}.
-@item -Wno-vla-larger-than
@opindex Wno-vla-larger-than
+@item -Wno-vla-larger-than
Disable @option{-Wvla-larger-than=} warnings. The option is equivalent
to @option{-Wvla-larger-than=}@samp{SIZE_MAX} or larger.
-@item -Wvla-parameter
@opindex Wno-vla-parameter
+@item -Wvla-parameter
Warn about redeclarations of functions involving arguments of Variable
Length Array types of inconsistent kinds or forms, and enable the detection
of out-of-bounds accesses to such parameters by warnings such as
@option{-Warray-parameter} option triggers warnings for similar problems
involving ordinary array arguments.
-@item -Wvolatile-register-var
@opindex Wvolatile-register-var
@opindex Wno-volatile-register-var
+@item -Wvolatile-register-var
Warn if a register variable is declared volatile. The volatile
modifier does not inhibit all optimizations that may eliminate reads
and/or writes to register variables. This warning is enabled by
@option{-Wall}.
-@item -Wxor-used-as-pow @r{(C, C++, Objective-C and Objective-C++ only)}
@opindex Wxor-used-as-pow
@opindex Wno-xor-used-as-pow
+@item -Wxor-used-as-pow @r{(C, C++, Objective-C and Objective-C++ only)}
Warn about uses of @code{^}, the exclusive or operator, where it appears
the user meant exponentiation. Specifically, the warning occurs when the
left-hand side is the decimal constant 2 or 10 and the right-hand side
This warning is enabled by default. It can be silenced by converting one
of the operands to hexadecimal.
-@item -Wdisabled-optimization
@opindex Wdisabled-optimization
@opindex Wno-disabled-optimization
+@item -Wdisabled-optimization
Warn if a requested optimization pass is disabled. This warning does
not generally indicate that there is anything wrong with your code; it
merely indicates that GCC's optimizers are unable to handle the code
complex; GCC refuses to optimize programs when the optimization
itself is likely to take inordinate amounts of time.
-@item -Wpointer-sign @r{(C and Objective-C only)}
@opindex Wpointer-sign
@opindex Wno-pointer-sign
+@item -Wpointer-sign @r{(C and Objective-C only)}
Warn for pointer argument passing or assignment with different signedness.
This option is only supported for C and Objective-C@. It is implied by
@option{-Wall} and by @option{-Wpedantic}, which can be disabled with
@option{-Wno-pointer-sign}.
-@item -Wstack-protector
@opindex Wstack-protector
@opindex Wno-stack-protector
+@item -Wstack-protector
This option is only active when @option{-fstack-protector} is active. It
warns about functions that are not protected against stack smashing.
-@item -Woverlength-strings
@opindex Woverlength-strings
@opindex Wno-overlength-strings
+@item -Woverlength-strings
Warn about string constants that are longer than the ``minimum
maximum'' length specified in the C standard. Modern compilers
generally allow string constants that are much longer than the
This option is implied by @option{-Wpedantic}, and can be disabled with
@option{-Wno-overlength-strings}.
-@item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
@opindex Wunsuffixed-float-constants
@opindex Wno-unsuffixed-float-constants
+@item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
Issue a warning for any floating constant that does not have
a suffix. When used together with @option{-Wsystem-headers} it
when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
from the decimal floating-point extension to C99.
-@item -Wno-lto-type-mismatch
@opindex Wlto-type-mismatch
@opindex Wno-lto-type-mismatch
+@item -Wno-lto-type-mismatch
During the link-time optimization, do not warn about type mismatches in
global declarations from different compilation units.
Requires @option{-flto} to be enabled. Enabled by default.
-@item -Wno-designated-init @r{(C and Objective-C only)}
@opindex Wdesignated-init
@opindex Wno-designated-init
+@item -Wno-designated-init @r{(C and Objective-C only)}
Suppress warnings when a positional initializer is used to initialize
a structure that has been marked with the @code{designated_init}
attribute.
@section Options That Control Static Analysis
@table @gcctabopt
-@item -fanalyzer
@opindex analyzer
@opindex fanalyzer
@opindex fno-analyzer
+@item -fanalyzer
This option enables an static analysis of program flow which looks
for ``interesting'' interprocedural paths through the
code, and issues warnings for problems found on them.
This option is only available if GCC was configured with analyzer
support enabled.
-@item -Wanalyzer-too-complex
@opindex Wanalyzer-too-complex
@opindex Wno-analyzer-too-complex
+@item -Wanalyzer-too-complex
If @option{-fanalyzer} is enabled, the analyzer uses various heuristics
to attempt to explore the control flow and data flow in the program,
but these can be defeated by sufficiently complicated code.
complicated for the analyzer to fully explore and it reaches an internal
limit. The @option{-Wanalyzer-too-complex} option warns if this occurs.
-@item -Wno-analyzer-allocation-size
@opindex Wanalyzer-allocation-size
@opindex Wno-analyzer-allocation-size
+@item -Wno-analyzer-allocation-size
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-allocation-size}
to disable it.
See @uref{https://cwe.mitre.org/data/definitions/131.html, CWE-131: Incorrect Calculation of Buffer Size}.
-@item -Wno-analyzer-deref-before-check
@opindex Wanalyzer-deref-before-check
@opindex Wno-analyzer-deref-before-check
+@item -Wno-analyzer-deref-before-check
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-deref-before-check}
to disable it.
analyzer "sees" them. Hence optimization should be disabled when
attempting to trigger this diagnostic.
-@item -Wno-analyzer-double-fclose
@opindex Wanalyzer-double-fclose
@opindex Wno-analyzer-double-fclose
+@item -Wno-analyzer-double-fclose
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-double-fclose} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/1341.html, CWE-1341: Multiple Releases of Same Resource or Handle}.
-@item -Wno-analyzer-double-free
@opindex Wanalyzer-double-free
@opindex Wno-analyzer-double-free
+@item -Wno-analyzer-double-free
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-double-free} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/415.html, CWE-415: Double Free}.
-@item -Wno-analyzer-exposure-through-output-file
@opindex Wanalyzer-exposure-through-output-file
@opindex Wno-analyzer-exposure-through-output-file
+@item -Wno-analyzer-exposure-through-output-file
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-exposure-through-output-file}
to disable it.
See @uref{https://cwe.mitre.org/data/definitions/532.html, CWE-532: Information Exposure Through Log Files}.
-@item -Wanalyzer-exposure-through-uninit-copy
@opindex Wanalyzer-exposure-through-uninit-copy
@opindex Wno-analyzer-exposure-through-uninit-copy
+@item -Wanalyzer-exposure-through-uninit-copy
This warning requires both @option{-fanalyzer} and the use of a plugin
to specify a function that copies across a ``trust boundary''. Use
@option{-Wno-analyzer-exposure-through-uninit-copy} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/200.html, CWE-200: Exposure of Sensitive Information to an Unauthorized Actor}.
-@item -Wno-analyzer-fd-access-mode-mismatch
@opindex Wanalyzer-fd-access-mode-mismatch
@opindex Wno-analyzer-fd-access-mode-mismatch
+@item -Wno-analyzer-fd-access-mode-mismatch
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-fd-access-mode-mismatch}
to disable it.
@code{fd_arg_write (N)} is called with a file descriptor opened with
@code{O_RDONLY} at referenced argument @var{N}.
-@item -Wno-analyzer-fd-double-close
@opindex Wanalyzer-fd-double-close
@opindex Wno-analyzer-fd-double-close
+@item -Wno-analyzer-fd-double-close
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-fd-double-close}
to disable it.
See @uref{https://cwe.mitre.org/data/definitions/1341.html, CWE-1341: Multiple Releases of Same Resource or Handle}.
-@item -Wno-analyzer-fd-leak
@opindex Wanalyzer-fd-leak
@opindex Wno-analyzer-fd-leak
+@item -Wno-analyzer-fd-leak
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-fd-leak}
to disable it.
See @uref{https://cwe.mitre.org/data/definitions/775.html, CWE-775: Missing Release of File Descriptor or Handle after Effective Lifetime}.
-@item -Wno-analyzer-fd-phase-mismatch
@opindex Wanalyzer-fd-phase-mismatch
@opindex Wno-analyzer-fd-phase-mismatch
+@item -Wno-analyzer-fd-phase-mismatch
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-fd-phase-mismatch}
to disable it.
See @uref{https://cwe.mitre.org/data/definitions/666.html, CWE-666: Operation on Resource in Wrong Phase of Lifetime}.
-@item -Wno-analyzer-fd-type-mismatch
@opindex Wanalyzer-fd-type-mismatch
@opindex Wno-analyzer-fd-type-mismatch
+@item -Wno-analyzer-fd-type-mismatch
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-fd-type-mismatch}
to disable it.
on a file descriptor obtained via @code{open}, or when attempting
to use a stream socket operation on a datagram socket.
-@item -Wno-analyzer-fd-use-after-close
@opindex Wanalyzer-fd-use-after-close
@opindex Wno-analyzer-fd-use-after-close
+@item -Wno-analyzer-fd-use-after-close
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-fd-use-after-close}
to disable it.
or @code{fd_arg_write (N)} is called with a closed file descriptor at
referenced argument @code{N}.
-@item -Wno-analyzer-fd-use-without-check
@opindex Wanalyzer-fd-use-without-check
@opindex Wno-analyzer-fd-use-without-check
+@item -Wno-analyzer-fd-use-without-check
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-fd-use-without-check}
to disable it.
or @code{fd_arg_write (N)} is called with a file descriptor, at referenced
argument @code{N}, without being checked for validity.
-@item -Wno-analyzer-file-leak
@opindex Wanalyzer-file-leak
@opindex Wno-analyzer-file-leak
+@item -Wno-analyzer-file-leak
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-file-leak}
to disable it.
See @uref{https://cwe.mitre.org/data/definitions/775.html, CWE-775: Missing Release of File Descriptor or Handle after Effective Lifetime}.
-@item -Wno-analyzer-free-of-non-heap
@opindex Wanalyzer-free-of-non-heap
@opindex Wno-analyzer-free-of-non-heap
+@item -Wno-analyzer-free-of-non-heap
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-free-of-non-heap}
to disable it.
See @uref{https://cwe.mitre.org/data/definitions/590.html, CWE-590: Free of Memory not on the Heap}.
-@item -Wno-analyzer-imprecise-fp-arithmetic
@opindex Wanalyzer-imprecise-fp-arithmetic
@opindex Wno-analyzer-imprecise-fp-arithmetic
+@item -Wno-analyzer-imprecise-fp-arithmetic
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-imprecise-fp-arithmetic}
to disable it.
diagnostic only warns on use of floating-point operands inside the
calculation of an allocation size at the moment.
-@item -Wno-analyzer-infinite-recursion
@opindex Wanalyzer-infinite-recursion
@opindex Wno-analyzer-infinite-recursion
+@item -Wno-analyzer-infinite-recursion
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-infinite-recursion} to disable it.
Compare with @option{-Winfinite-recursion}, which provides a similar
diagnostic, but is implemented in a different way.
-@item -Wno-analyzer-jump-through-null
@opindex Wanalyzer-jump-through-null
@opindex Wno-analyzer-jump-through-null
+@item -Wno-analyzer-jump-through-null
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-jump-through-null}
to disable it.
This diagnostic warns for paths through the code in which a @code{NULL}
function pointer is called.
-@item -Wno-analyzer-malloc-leak
@opindex Wanalyzer-malloc-leak
@opindex Wno-analyzer-malloc-leak
+@item -Wno-analyzer-malloc-leak
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-malloc-leak}
to disable it.
See @uref{https://cwe.mitre.org/data/definitions/401.html, CWE-401: Missing Release of Memory after Effective Lifetime}.
-@item -Wno-analyzer-mismatching-deallocation
@opindex Wanalyzer-mismatching-deallocation
@opindex Wno-analyzer-mismatching-deallocation
+@item -Wno-analyzer-mismatching-deallocation
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-mismatching-deallocation}
to disable it.
See @uref{https://cwe.mitre.org/data/definitions/762.html, CWE-762: Mismatched Memory Management Routines}.
-@item -Wno-analyzer-out-of-bounds
@opindex Wanalyzer-out-of-bounds
@opindex Wno-analyzer-out-of-bounds
+@item -Wno-analyzer-out-of-bounds
This warning requires @option{-fanalyzer} to enable it; use
@option{-Wno-analyzer-out-of-bounds} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/119.html, CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer}.
-@item -Wno-analyzer-possible-null-argument
@opindex Wanalyzer-possible-null-argument
@opindex Wno-analyzer-possible-null-argument
+@item -Wno-analyzer-possible-null-argument
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-possible-null-argument} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/690.html, CWE-690: Unchecked Return Value to NULL Pointer Dereference}.
-@item -Wno-analyzer-possible-null-dereference
@opindex Wanalyzer-possible-null-dereference
@opindex Wno-analyzer-possible-null-dereference
+@item -Wno-analyzer-possible-null-dereference
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-possible-null-dereference} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/690.html, CWE-690: Unchecked Return Value to NULL Pointer Dereference}.
-@item -Wno-analyzer-null-argument
@opindex Wanalyzer-null-argument
@opindex Wno-analyzer-null-argument
+@item -Wno-analyzer-null-argument
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-null-argument} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/476.html, CWE-476: NULL Pointer Dereference}.
-@item -Wno-analyzer-null-dereference
@opindex Wanalyzer-null-dereference
@opindex Wno-analyzer-null-dereference
+@item -Wno-analyzer-null-dereference
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-null-dereference} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/476.html, CWE-476: NULL Pointer Dereference}.
-@item -Wno-analyzer-putenv-of-auto-var
@opindex Wanalyzer-putenv-of-auto-var
@opindex Wno-analyzer-putenv-of-auto-var
+@item -Wno-analyzer-putenv-of-auto-var
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-putenv-of-auto-var} to disable it.
See @uref{https://wiki.sei.cmu.edu/confluence/x/6NYxBQ, POS34-C. Do not call putenv() with a pointer to an automatic variable as the argument}.
-@item -Wno-analyzer-shift-count-negative
@opindex Wanalyzer-shift-count-negative
@opindex Wno-analyzer-shift-count-negative
+@item -Wno-analyzer-shift-count-negative
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-shift-count-negative} to disable it.
However, the analyzer does not prioritize detection of such paths, so
false negatives are more likely relative to other warnings.
-@item -Wno-analyzer-shift-count-overflow
@opindex Wanalyzer-shift-count-overflow
@opindex Wno-analyzer-shift-count-overflow
+@item -Wno-analyzer-shift-count-overflow
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-shift-count-overflow} to disable it.
However, the analyzer does not prioritize detection of such paths, so
false negatives are more likely relative to other warnings.
-@item -Wno-analyzer-stale-setjmp-buffer
@opindex Wanalyzer-stale-setjmp-buffer
@opindex Wno-analyzer-stale-setjmp-buffer
+@item -Wno-analyzer-stale-setjmp-buffer
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-stale-setjmp-buffer} to disable it.
to rewind to it via @code{longjmp} would reference a stack frame that
no longer exists, and likely lead to a crash (or worse).
-@item -Wno-analyzer-tainted-allocation-size
@opindex Wanalyzer-tainted-allocation-size
@opindex Wno-analyzer-tainted-allocation-size
+@item -Wno-analyzer-tainted-allocation-size
This warning requires both @option{-fanalyzer} and
@option{-fanalyzer-checker=taint} to enable it;
use @option{-Wno-analyzer-tainted-allocation-size} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/789.html, CWE-789: Memory Allocation with Excessive Size Value}.
-@item -Wno-analyzer-tainted-assertion
@opindex Wanalyzer-tainted-assertion
@opindex Wno-analyzer-tainted-assertion
+@item -Wno-analyzer-tainted-assertion
This warning requires both @option{-fanalyzer} and
@option{-fanalyzer-checker=taint} to enable it;
despite the above not being an assertion failure, strictly speaking.
-@item -Wno-analyzer-tainted-array-index
@opindex Wanalyzer-tainted-array-index
@opindex Wno-analyzer-tainted-array-index
+@item -Wno-analyzer-tainted-array-index
This warning requires both @option{-fanalyzer} and
@option{-fanalyzer-checker=taint} to enable it;
use @option{-Wno-analyzer-tainted-array-index} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/129.html, CWE-129: Improper Validation of Array Index}.
-@item -Wno-analyzer-tainted-divisor
@opindex Wanalyzer-tainted-divisor
@opindex Wno-analyzer-tainted-divisor
+@item -Wno-analyzer-tainted-divisor
This warning requires both @option{-fanalyzer} and
@option{-fanalyzer-checker=taint} to enable it;
use @option{-Wno-analyzer-tainted-divisor} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/369.html, CWE-369: Divide By Zero}.
-@item -Wno-analyzer-tainted-offset
@opindex Wanalyzer-tainted-offset
@opindex Wno-analyzer-tainted-offset
+@item -Wno-analyzer-tainted-offset
This warning requires both @option{-fanalyzer} and
@option{-fanalyzer-checker=taint} to enable it;
use @option{-Wno-analyzer-tainted-offset} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/823.html, CWE-823: Use of Out-of-range Pointer Offset}.
-@item -Wno-analyzer-tainted-size
@opindex Wanalyzer-tainted-size
@opindex Wno-analyzer-tainted-size
+@item -Wno-analyzer-tainted-size
This warning requires both @option{-fanalyzer} and
@option{-fanalyzer-checker=taint} to enable it;
use @option{-Wno-analyzer-tainted-size} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/129.html, CWE-129: Improper Validation of Array Index}.
-@item -Wno-analyzer-unsafe-call-within-signal-handler
@opindex Wanalyzer-unsafe-call-within-signal-handler
@opindex Wno-analyzer-unsafe-call-within-signal-handler
+@item -Wno-analyzer-unsafe-call-within-signal-handler
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-unsafe-call-within-signal-handler} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/479.html, CWE-479: Signal Handler Use of a Non-reentrant Function}.
-@item -Wno-analyzer-use-after-free
@opindex Wanalyzer-use-after-free
@opindex Wno-analyzer-use-after-free
+@item -Wno-analyzer-use-after-free
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-use-after-free} to disable it.
See @uref{https://cwe.mitre.org/data/definitions/416.html, CWE-416: Use After Free}.
-@item -Wno-analyzer-use-of-pointer-in-stale-stack-frame
@opindex Wanalyzer-use-of-pointer-in-stale-stack-frame
@opindex Wno-analyzer-use-of-pointer-in-stale-stack-frame
+@item -Wno-analyzer-use-of-pointer-in-stale-stack-frame
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-use-of-pointer-in-stale-stack-frame}
to disable it.
This diagnostic warns for paths through the code in which a pointer
is dereferenced that points to a variable in a stale stack frame.
-@item -Wno-analyzer-va-arg-type-mismatch
@opindex Wanalyzer-va-arg-type-mismatch
@opindex Wno-analyzer-va-arg-type-mismatch
+@item -Wno-analyzer-va-arg-type-mismatch
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-va-arg-type-mismatch}
to disable it.
See @uref{https://cwe.mitre.org/data/definitions/686.html, CWE-686: Function Call With Incorrect Argument Type}.
-@item -Wno-analyzer-va-list-exhausted
@opindex Wanalyzer-va-list-exhausted
@opindex Wno-analyzer-va-list-exhausted
+@item -Wno-analyzer-va-list-exhausted
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-va-list-exhausted}
to disable it.
See @uref{https://cwe.mitre.org/data/definitions/685.html, CWE-685: Function Call With Incorrect Number of Arguments}.
-@item -Wno-analyzer-va-list-leak
@opindex Wanalyzer-va-list-leak
@opindex Wno-analyzer-va-list-leak
+@item -Wno-analyzer-va-list-leak
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-va-list-leak}
to disable it.
the analyzer detects that @code{va_start} or @code{va_copy} has been called
on a @code{va_list} without a corresponding call to @code{va_end}.
-@item -Wno-analyzer-va-list-use-after-va-end
@opindex Wanalyzer-va-list-use-after-va-end
@opindex Wno-analyzer-va-list-use-after-va-end
+@item -Wno-analyzer-va-list-use-after-va-end
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-va-list-use-after-va-end}
to disable it.
@code{va_end} has been called on it.
@code{va_list}.
-@item -Wno-analyzer-write-to-const
@opindex Wanalyzer-write-to-const
@opindex Wno-analyzer-write-to-const
+@item -Wno-analyzer-write-to-const
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-write-to-const}
to disable it.
However, the analyzer does not prioritize detection of such paths, so
false negatives are more likely relative to other warnings.
-@item -Wno-analyzer-write-to-string-literal
@opindex Wanalyzer-write-to-string-literal
@opindex Wno-analyzer-write-to-string-literal
+@item -Wno-analyzer-write-to-string-literal
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-write-to-string-literal}
to disable it.
However, the analyzer does not prioritize detection of such paths, so
false negatives are more likely relative to other warnings.
-@item -Wno-analyzer-use-of-uninitialized-value
@opindex Wanalyzer-use-of-uninitialized-value
@opindex Wno-analyzer-use-of-uninitialized-value
+@item -Wno-analyzer-use-of-uninitialized-value
This warning requires @option{-fanalyzer}, which enables it; use
@option{-Wno-analyzer-use-of-uninitialized-value} to disable it.
@table @gcctabopt
-@item -fanalyzer-call-summaries
@opindex fanalyzer-call-summaries
@opindex fno-analyzer-call-summaries
+@item -fanalyzer-call-summaries
Simplify interprocedural analysis by computing the effect of certain calls,
rather than exploring all paths through the function from callsite to each
possible return.
call site, and that are sufficiently complicated (as per
@option{--param analyzer-min-snodes-for-call-summary=@var{value}}).
-@item -fanalyzer-checker=@var{name}
@opindex fanalyzer-checker
+@item -fanalyzer-checker=@var{name}
Restrict the analyzer to run just the named checker, and enable it.
Some checkers are disabled by default (even with @option{-fanalyzer}),
-Wanalyzer-va-list-use-after-va-end @gol
}
-@item -fno-analyzer-feasibility
@opindex fanalyzer-feasibility
@opindex fno-analyzer-feasibility
+@item -fno-analyzer-feasibility
This option is intended for analyzer developers.
By default the analyzer verifies that there is a feasible control flow path
This filtering can be suppressed with @option{-fno-analyzer-feasibility}, for
debugging issues in this code.
-@item -fanalyzer-fine-grained
@opindex fanalyzer-fine-grained
@opindex fno-analyzer-fine-grained
+@item -fanalyzer-fine-grained
This option is intended for analyzer developers.
Internally the analyzer builds an ``exploded graph'' that combines
of multiple statements within a basic block. With
@option{-fanalyzer-fine-grained}, each statement gets its own edge.
-@item -fanalyzer-show-duplicate-count
@opindex fanalyzer-show-duplicate-count
@opindex fno-analyzer-show-duplicate-count
+@item -fanalyzer-show-duplicate-count
This option is intended for analyzer developers: if multiple diagnostics
have been detected as being duplicates of each other, it emits a note when
reporting the best diagnostic, giving the number of additional diagnostics
that were suppressed by the deduplication logic.
-@item -fno-analyzer-state-merge
@opindex fanalyzer-state-merge
@opindex fno-analyzer-state-merge
+@item -fno-analyzer-state-merge
This option is intended for analyzer developers.
By default the analyzer attempts to simplify analysis by merging
``exploded graph''. With @option{-fno-analyzer-state-merge} this
merging can be suppressed, for debugging state-handling issues.
-@item -fno-analyzer-state-purge
@opindex fanalyzer-state-purge
@opindex fno-analyzer-state-purge
+@item -fno-analyzer-state-purge
This option is intended for analyzer developers.
By default the analyzer attempts to simplify analysis by purging
be helpful for debugging issues in the analyzer, or for microbenchmarks
for detecting undefined behavior.
-@item -fanalyzer-transitivity
@opindex fanalyzer-transitivity
@opindex fno-analyzer-transitivity
+@item -fanalyzer-transitivity
This option enables transitivity of constraints within the analyzer.
-@item -fno-analyzer-undo-inlining
@opindex fanalyzer-undo-inlining
@opindex fno-analyzer-undo-inlining
+@item -fno-analyzer-undo-inlining
This option is intended for analyzer developers.
@option{-fanalyzer} runs relatively late compared to other code analysis
@end table
-@item -fdump-analyzer
@opindex fdump-analyzer
+@item -fdump-analyzer
Dump internal details about what the analyzer is doing to
@file{@var{file}.analyzer.txt}.
This option is overridden by @option{-fdump-analyzer-stderr}.
-@item -fdump-analyzer-stderr
@opindex fdump-analyzer-stderr
+@item -fdump-analyzer-stderr
Dump internal details about what the analyzer is doing to stderr.
This option overrides @option{-fdump-analyzer}.
-@item -fdump-analyzer-callgraph
@opindex fdump-analyzer-callgraph
+@item -fdump-analyzer-callgraph
Dump a representation of the call graph suitable for viewing with
GraphViz to @file{@var{file}.callgraph.dot}.
-@item -fdump-analyzer-exploded-graph
@opindex fdump-analyzer-exploded-graph
+@item -fdump-analyzer-exploded-graph
Dump a representation of the ``exploded graph'' suitable for viewing with
GraphViz to @file{@var{file}.eg.dot}.
Nodes are color-coded based on state-machine states to emphasize
state changes.
-@item -fdump-analyzer-exploded-nodes
@opindex dump-analyzer-exploded-nodes
+@item -fdump-analyzer-exploded-nodes
Emit diagnostics showing where nodes in the ``exploded graph'' are
in relation to the program source.
-@item -fdump-analyzer-exploded-nodes-2
@opindex dump-analyzer-exploded-nodes-2
+@item -fdump-analyzer-exploded-nodes-2
Dump a textual representation of the ``exploded graph'' to
@file{@var{file}.eg.txt}.
-@item -fdump-analyzer-exploded-nodes-3
@opindex dump-analyzer-exploded-nodes-3
+@item -fdump-analyzer-exploded-nodes-3
Dump a textual representation of the ``exploded graph'' to
one dump file per node, to @file{@var{file}.eg-@var{id}.txt}.
This is typically a large number of dump files.
-@item -fdump-analyzer-exploded-paths
@opindex fdump-analyzer-exploded-paths
+@item -fdump-analyzer-exploded-paths
Dump a textual representation of the ``exploded path'' for each
diagnostic to @file{@var{file}.@var{idx}.@var{kind}.epath.txt}.
-@item -fdump-analyzer-feasibility
@opindex dump-analyzer-feasibility
+@item -fdump-analyzer-feasibility
Dump internal details about the analyzer's search for feasible paths.
The details are written in a form suitable for viewing with GraphViz
to filenames of the form @file{@var{file}.*.fg.dot},
@file{@var{file}.*.tg.dot}, and @file{@var{file}.*.fpath.txt}.
-@item -fdump-analyzer-json
@opindex fdump-analyzer-json
+@item -fdump-analyzer-json
Dump a compressed JSON representation of analyzer internals to
@file{@var{file}.analyzer.json.gz}. The precise format is subject
to change.
-@item -fdump-analyzer-state-purge
@opindex fdump-analyzer-state-purge
+@item -fdump-analyzer-state-purge
As per @option{-fdump-analyzer-supergraph}, dump a representation of the
``supergraph'' suitable for viewing with GraphViz, but annotate the
graph with information on what state will be purged at each node.
The graph is written to @file{@var{file}.state-purge.dot}.
-@item -fdump-analyzer-supergraph
@opindex fdump-analyzer-supergraph
+@item -fdump-analyzer-supergraph
Dump representations of the ``supergraph'' suitable for viewing with
GraphViz to @file{@var{file}.supergraph.dot} and to
@file{@var{file}.supergraph-eg.dot}. These show all of the
calls and returns. The second dump contains annotations showing nodes
in the ``exploded graph'' and diagnostics associated with them.
-@item -fdump-analyzer-untracked
@opindex fdump-analyzer-untracked
+@item -fdump-analyzer-untracked
Emit custom warnings with internal details intended for analyzer developers.
@end table
@option{-Og} may result in a better debugging experience.
@table @gcctabopt
-@item -g
@opindex g
+@item -g
Produce debugging information in the operating system's native format
(stabs, COFF, XCOFF, or DWARF)@. GDB can work with this debugging
information.
crash or refuse to read the program. If you want to control for certain whether
to generate the extra information, use @option{-gvms} (see below).
-@item -ggdb
@opindex ggdb
+@item -ggdb
Produce debugging information for use by GDB@. This means to use the
most expressive format available (DWARF, stabs, or the native format
if neither of those are supported), including GDB extensions if at all
possible.
+@opindex gdwarf
@item -gdwarf
@itemx -gdwarf-@var{version}
-@opindex gdwarf
Produce debugging information in DWARF format (if that is supported).
The value of @var{version} may be either 2, 3, 4 or 5; the default
version for most targets is 5 (with the exception of VxWorks, TPF and
@option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
in their names, but apply to all currently-supported versions of DWARF.
-@item -gbtf
@opindex gbtf
+@item -gbtf
Request BTF debug information. BTF is the default debugging format for the
eBPF target. On other targets, like x86, BTF debug information can be
generated along with DWARF debug information when both of the debug formats are
enabled explicitly via their respective command line options.
+@opindex gctf
@item -gctf
@itemx -gctf@var{level}
-@opindex gctf
Request CTF debug information and use level to specify how much CTF debug
information should be produced. If @option{-gctf} is specified
without a value for level, the default level of CTF debug information is 2.
Level 2 produces type information for entities (functions, data objects etc.)
at file-scope or global-scope only.
-@item -gvms
@opindex gvms
+@item -gvms
Produce debugging information in Alpha/VMS debug format (if that is
supported). This is the format used by DEBUG on Alpha/VMS systems.
Instead use an additional @option{-g@var{level}} option to change the
debug level for DWARF.
-@item -fno-eliminate-unused-debug-symbols
@opindex feliminate-unused-debug-symbols
@opindex fno-eliminate-unused-debug-symbols
+@item -fno-eliminate-unused-debug-symbols
By default, no debug information is produced for symbols that are not actually
used. Use this option if you want debug information for all symbols.
-@item -femit-class-debug-always
@opindex femit-class-debug-always
+@item -femit-class-debug-always
Instead of emitting debugging information for a C++ class in only one
object file, emit it in all object files using the class. This option
should be used only with debuggers that are unable to handle the way GCC
option increases the size of debugging information by as much as a
factor of two.
-@item -fno-merge-debug-strings
@opindex fmerge-debug-strings
@opindex fno-merge-debug-strings
+@item -fno-merge-debug-strings
Direct the linker to not merge together strings in the debugging
information that are identical in different object files. Merging is
not supported by all assemblers or linkers. Merging decreases the size
of the debug information in the output file at the cost of increasing
link processing time. Merging is enabled by default.
-@item -fdebug-prefix-map=@var{old}=@var{new}
@opindex fdebug-prefix-map
+@item -fdebug-prefix-map=@var{old}=@var{new}
When compiling files residing in directory @file{@var{old}}, record
debugging information describing them as if the files resided in
directory @file{@var{new}} instead. This can be used to replace a
are location independent, but may require an extra command to tell GDB
where to find the source files. See also @option{-ffile-prefix-map}.
-@item -fvar-tracking
@opindex fvar-tracking
+@item -fvar-tracking
Run variable tracking pass. It computes where variables are stored at each
position in code. Better debugging information is then generated
(if the debugging information format supports this information).
@option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
the debug info format supports it.
-@item -fvar-tracking-assignments
@opindex fvar-tracking-assignments
@opindex fno-var-tracking-assignments
+@item -fvar-tracking-assignments
Annotate assignments to user variables early in the compilation and
attempt to carry the annotations over throughout the compilation all the
way to the end, in an attempt to improve debug information while
By default, this flag is enabled together with @option{-fvar-tracking},
except when selective scheduling is enabled.
-@item -gsplit-dwarf
@opindex gsplit-dwarf
+@item -gsplit-dwarf
If DWARF debugging information is enabled, separate as much debugging
information as possible into a separate output file with the extension
@file{.dwo}. This option allows the build system to avoid linking files with
debug information. To be useful, this option requires a debugger capable of
reading @file{.dwo} files.
-@item -gdwarf32
-@itemx -gdwarf64
@opindex gdwarf32
@opindex gdwarf64
+@item -gdwarf32
+@itemx -gdwarf64
If DWARF debugging information is enabled, the @option{-gdwarf32} selects
the 32-bit DWARF format and the @option{-gdwarf64} selects the 64-bit
DWARF format. The default is target specific, on most targets it is
debug information sections. The 64-bit DWARF format allows larger debug
information and might not be well supported by all consumers yet.
-@item -gdescribe-dies
@opindex gdescribe-dies
+@item -gdescribe-dies
Add description attributes to some DWARF DIEs that have no name attribute,
such as artificial variables, external references and call site
parameter DIEs.
-@item -gpubnames
@opindex gpubnames
+@item -gpubnames
Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
-@item -ggnu-pubnames
@opindex ggnu-pubnames
+@item -ggnu-pubnames
Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
suitable for conversion into a GDB@ index. This option is only useful
with a linker that can produce GDB@ index version 7.
-@item -fdebug-types-section
@opindex fdebug-types-section
@opindex fno-debug-types-section
+@item -fdebug-types-section
When using DWARF Version 4 or higher, type DIEs can be put into
their own @code{.debug_types} section instead of making them part of the
@code{.debug_info} section. It is more efficient to put them in a separate
and on some objects @code{.debug_types} produces larger instead of smaller
debugging information.
-@item -grecord-gcc-switches
-@itemx -gno-record-gcc-switches
@opindex grecord-gcc-switches
@opindex gno-record-gcc-switches
+@item -grecord-gcc-switches
+@itemx -gno-record-gcc-switches
This switch causes the command-line options used to invoke the
compiler that may affect code generation to be appended to the
DW_AT_producer attribute in DWARF debugging information. The options
See also @option{-frecord-gcc-switches} for another
way of storing compiler options into the object file.
-@item -gstrict-dwarf
@opindex gstrict-dwarf
+@item -gstrict-dwarf
Disallow using extensions of later DWARF standard version than selected
with @option{-gdwarf-@var{version}}. On most targets using non-conflicting
DWARF extensions from later standard versions is allowed.
-@item -gno-strict-dwarf
@opindex gno-strict-dwarf
+@item -gno-strict-dwarf
Allow using extensions of later DWARF standard version than selected with
@option{-gdwarf-@var{version}}.
-@item -gas-loc-support
@opindex gas-loc-support
+@item -gas-loc-support
Inform the compiler that the assembler supports @code{.loc} directives.
It may then use them for the assembler to generate DWARF2+ line number
tables.
This option will be enabled by default if, at GCC configure time, the
assembler was found to support such directives.
-@item -gno-as-loc-support
@opindex gno-as-loc-support
+@item -gno-as-loc-support
Force GCC to generate DWARF2+ line number tables internally, if DWARF2+
line number tables are to be generated.
-@item -gas-locview-support
@opindex gas-locview-support
+@item -gas-locview-support
Inform the compiler that the assembler supports @code{view} assignment
and reset assertion checking in @code{.loc} directives.
Force GCC to assign view numbers internally, if
@option{-gvariable-location-views} are explicitly requested.
-@item -gcolumn-info
-@itemx -gno-column-info
@opindex gcolumn-info
@opindex gno-column-info
+@item -gcolumn-info
+@itemx -gno-column-info
Emit location column information into DWARF debugging information, rather
than just file and line.
This option is enabled by default.
-@item -gstatement-frontiers
-@itemx -gno-statement-frontiers
@opindex gstatement-frontiers
@opindex gno-statement-frontiers
+@item -gstatement-frontiers
+@itemx -gno-statement-frontiers
This option causes GCC to create markers in the internal representation
at the beginning of statements, and to keep them roughly in place
throughout compilation, using them to guide the output of @code{is_stmt}
compiling with optimization (@option{-Os}, @option{-O1}, @option{-O2},
@dots{}), and outputting DWARF 2 debug information at the normal level.
-@item -gvariable-location-views
-@itemx -gvariable-location-views=incompat5
-@itemx -gno-variable-location-views
@opindex gvariable-location-views
@opindex gvariable-location-views=incompat5
@opindex gno-variable-location-views
+@item -gvariable-location-views
+@itemx -gvariable-location-views=incompat5
+@itemx -gno-variable-location-views
Augment variable location lists with progressive view numbers implied
from the line number table. This enables debug information consumers to
inspect state at certain points of the program, even if no instructions
consumers are not expected to support this extended format, and they
would be rendered unable to decode location lists using it.
-@item -ginternal-reset-location-views
-@itemx -gno-internal-reset-location-views
@opindex ginternal-reset-location-views
@opindex gno-internal-reset-location-views
+@item -ginternal-reset-location-views
+@itemx -gno-internal-reset-location-views
Attempt to determine location views that can be omitted from location
view lists. This requires the compiler to have very accurate insn
length estimates, which isn't always the case, and it may cause
any such error as a @code{view number mismatch}. This is only enabled
on ports that define a reliable estimation function.
-@item -ginline-points
-@itemx -gno-inline-points
@opindex ginline-points
@opindex gno-inline-points
+@item -ginline-points
+@itemx -gno-inline-points
Generate extended debug information for inlined functions. Location
view tracking markers are inserted at inlined entry points, so that
address and view numbers can be computed and output in debug
along with statement frontiers, and it is only enabled by default if
location views are enabled.
-@item -gz@r{[}=@var{type}@r{]}
@opindex gz
+@item -gz@r{[}=@var{type}@r{]}
Produce compressed debug sections in DWARF format, if that is supported.
If @var{type} is not given, the default type depends on the capabilities
of the assembler and linker used. @var{type} may be one of
assembler does not support them, @option{-gz} is silently ignored when
producing object files.
-@item -femit-struct-debug-baseonly
@opindex femit-struct-debug-baseonly
+@item -femit-struct-debug-baseonly
Emit debug information for struct-like types
only when the base name of the compilation source file
matches the base name of file in which the struct is defined.
This option works only with DWARF debug output.
-@item -femit-struct-debug-reduced
@opindex femit-struct-debug-reduced
+@item -femit-struct-debug-reduced
Emit debug information for struct-like types
only when the base name of the compilation source file
matches the base name of file in which the type is defined,
This option works only with DWARF debug output.
-@item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
@opindex femit-struct-debug-detailed
+@item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
Specify the struct-like types
for which the compiler generates debug information.
The intent is to reduce duplicate struct debug information
This option works only with DWARF debug output.
-@item -fno-dwarf2-cfi-asm
@opindex fdwarf2-cfi-asm
@opindex fno-dwarf2-cfi-asm
+@item -fno-dwarf2-cfi-asm
Emit DWARF unwind info as compiler generated @code{.eh_frame} section
instead of using GAS @code{.cfi_*} directives.
-@item -fno-eliminate-unused-debug-types
@opindex feliminate-unused-debug-types
@opindex fno-eliminate-unused-debug-types
+@item -fno-eliminate-unused-debug-types
Normally, when producing DWARF output, GCC avoids producing debug symbol
output for types that are nowhere used in the source file being compiled.
Sometimes it is useful to have GCC emit debugging
@xref{Overall Options}, for examples.
@table @gcctabopt
-@item -O
-@itemx -O1
@opindex O
@opindex O1
+@item -O
+@itemx -O1
Optimize. Optimizing compilation takes somewhat more time, and a lot
more memory for a large function.
-ftree-ter @gol
-funit-at-a-time}
-@item -O2
@opindex O2
+@item -O2
Optimize even more. GCC performs nearly all supported optimizations
that do not involve a space-speed tradeoff.
As compared to @option{-O}, this option increases both compilation time
Please note the warning under @option{-fgcse} about
invoking @option{-O2} on programs that use computed gotos.
-@item -O3
@opindex O3
+@item -O3
Optimize yet more. @option{-O3} turns on all optimizations specified
by @option{-O2} and also turns on the following optimization flags:
-fvect-cost-model=dynamic @gol
-fversion-loops-for-strides}
-@item -O0
@opindex O0
+@item -O0
Reduce compilation time and make debugging produce the expected
results. This is the default.
-@item -Os
@opindex Os
+@item -Os
Optimize for size. @option{-Os} enables all @option{-O2} optimizations
except those that often increase code size:
code size rather than execution speed, and performs further optimizations
designed to reduce code size.
-@item -Ofast
@opindex Ofast
+@item -Ofast
Disregard strict standards compliance. @option{-Ofast} enables all
@option{-O3} optimizations. It also enables optimizations that are not
valid for all standard-compliant programs.
@option{-fmax-stack-var-size} is specified, and @option{-fno-protect-parens}.
It turns off @option{-fsemantic-interposition}.
-@item -Og
@opindex Og
+@item -Og
Optimize debugging experience. @option{-Og} should be the optimization
level of choice for the standard edit-compile-debug cycle, offering
a reasonable level of optimization while maintaining fast compilation
-fmove-loop-invariants -fmove-loop-stores -fssa-phiopt @gol
-ftree-bit-ccp -ftree-dse -ftree-pta -ftree-sra}
-@item -Oz
@opindex Oz
+@item -Oz
Optimize aggressively for size rather than speed. This may increase
the number of instructions executed if those instructions require
fewer bytes to encode. @option{-Oz} behaves similarly to @option{-Os}
optimizations to be performed is desired.
@table @gcctabopt
-@item -fno-defer-pop
@opindex fno-defer-pop
@opindex fdefer-pop
+@item -fno-defer-pop
For machines that must pop arguments after a function call, always pop
the arguments as soon as each function returns.
At levels @option{-O1} and higher, @option{-fdefer-pop} is the default;
this allows the compiler to let arguments accumulate on the stack for several
function calls and pop them all at once.
-@item -fforward-propagate
@opindex fforward-propagate
+@item -fforward-propagate
Perform a forward propagation pass on RTL@. The pass tries to combine two
instructions and checks if the result can be simplified. If loop unrolling
is active, two passes are performed and the second is scheduled after
This option is enabled by default at optimization levels @option{-O1},
@option{-O2}, @option{-O3}, @option{-Os}.
-@item -ffp-contract=@var{style}
@opindex ffp-contract
+@item -ffp-contract=@var{style}
@option{-ffp-contract=off} disables floating-point expression contraction.
@option{-ffp-contract=fast} enables floating-point expression contraction
such as forming of fused multiply-add operations if the target has
The default is @option{-ffp-contract=fast}.
-@item -fomit-frame-pointer
@opindex fomit-frame-pointer
+@item -fomit-frame-pointer
Omit the frame pointer in functions that don't need one. This avoids the
instructions to save, set up and restore the frame pointer; on many targets
it also makes an extra register available.
Enabled by default at @option{-O1} and higher.
-@item -foptimize-sibling-calls
@opindex foptimize-sibling-calls
+@item -foptimize-sibling-calls
Optimize sibling and tail recursive calls.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -foptimize-strlen
@opindex foptimize-strlen
+@item -foptimize-strlen
Optimize various standard C string functions (e.g.@: @code{strlen},
@code{strchr} or @code{strcpy}) and
their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
Enabled at levels @option{-O2}, @option{-O3}.
-@item -fno-inline
@opindex fno-inline
@opindex finline
+@item -fno-inline
Do not expand any functions inline apart from those marked with
the @code{always_inline} attribute. This is the default when not
optimizing.
Single functions can be exempted from inlining by marking them
with the @code{noinline} attribute.
-@item -finline-small-functions
@opindex finline-small-functions
+@item -finline-small-functions
Integrate functions into their callers when their body is smaller than expected
function call code (so overall size of program gets smaller). The compiler
heuristically decides which functions are simple enough to be worth integrating
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -findirect-inlining
@opindex findirect-inlining
+@item -findirect-inlining
Inline also indirect calls that are discovered to be known at compile
time thanks to previous inlining. This option has any effect only
when inlining itself is turned on by the @option{-finline-functions}
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -finline-functions
@opindex finline-functions
+@item -finline-functions
Consider all functions for inlining, even if they are not declared inline.
The compiler heuristically decides which functions are worth integrating
in this way.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. Also enabled
by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -finline-functions-called-once
@opindex finline-functions-called-once
+@item -finline-functions-called-once
Consider all @code{static} functions called once for inlining into their
caller even if they are not marked @code{inline}. If a call to a given
function is integrated, then the function is not output as assembler code
Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os},
but not @option{-Og}.
-@item -fearly-inlining
@opindex fearly-inlining
+@item -fearly-inlining
Inline functions marked by @code{always_inline} and functions whose body seems
smaller than the function call overhead early before doing
@option{-fprofile-generate} instrumentation and real inlining pass. Doing so
Enabled by default.
-@item -fipa-sra
@opindex fipa-sra
+@item -fipa-sra
Perform interprocedural scalar replacement of aggregates, removal of
unused parameters and replacement of parameters passed by reference
by parameters passed by value.
Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
-@item -finline-limit=@var{n}
@opindex finline-limit
+@item -finline-limit=@var{n}
By default, GCC limits the size of functions that can be inlined. This flag
allows coarse control of this limit. @var{n} is the size of functions that
can be inlined in number of pseudo instructions.
of assembly instructions and as such its exact meaning might change from one
release to an another.
-@item -fno-keep-inline-dllexport
@opindex fno-keep-inline-dllexport
@opindex fkeep-inline-dllexport
+@item -fno-keep-inline-dllexport
This is a more fine-grained version of @option{-fkeep-inline-functions},
which applies only to functions that are declared using the @code{dllexport}
attribute or declspec. @xref{Function Attributes,,Declaring Attributes of
Functions}.
-@item -fkeep-inline-functions
@opindex fkeep-inline-functions
+@item -fkeep-inline-functions
In C, emit @code{static} functions that are declared @code{inline}
into the object file, even if the function has been inlined into all
of its callers. This switch does not affect functions using the
@code{extern inline} extension in GNU C90@. In C++, emit any and all
inline functions into the object file.
-@item -fkeep-static-functions
@opindex fkeep-static-functions
+@item -fkeep-static-functions
Emit @code{static} functions into the object file, even if the function
is never used.
-@item -fkeep-static-consts
@opindex fkeep-static-consts
+@item -fkeep-static-consts
Emit variables declared @code{static const} when optimization isn't turned
on, even if the variables aren't referenced.
check if a variable is referenced, regardless of whether or not
optimization is turned on, use the @option{-fno-keep-static-consts} option.
-@item -fmerge-constants
@opindex fmerge-constants
+@item -fmerge-constants
Attempt to merge identical constants (string constants and floating-point
constants) across compilation units.
Enabled at levels @option{-O1}, @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fmerge-all-constants
@opindex fmerge-all-constants
+@item -fmerge-all-constants
Attempt to merge identical constants and identical variables.
This option implies @option{-fmerge-constants}. In addition to
so using this option results in non-conforming
behavior.
-@item -fmodulo-sched
@opindex fmodulo-sched
+@item -fmodulo-sched
Perform swing modulo scheduling immediately before the first scheduling
pass. This pass looks at innermost loops and reorders their
instructions by overlapping different iterations.
-@item -fmodulo-sched-allow-regmoves
@opindex fmodulo-sched-allow-regmoves
+@item -fmodulo-sched-allow-regmoves
Perform more aggressive SMS-based modulo scheduling with register moves
allowed. By setting this flag certain anti-dependences edges are
deleted, which triggers the generation of reg-moves based on the
life-range analysis. This option is effective only with
@option{-fmodulo-sched} enabled.
-@item -fno-branch-count-reg
@opindex fno-branch-count-reg
@opindex fbranch-count-reg
+@item -fno-branch-count-reg
Disable the optimization pass that scans for opportunities to use
``decrement and branch'' instructions on a count register instead of
instruction sequences that decrement a register, compare it against zero, and
The default is @option{-fbranch-count-reg} at @option{-O1} and higher,
except for @option{-Og}.
-@item -fno-function-cse
@opindex fno-function-cse
@opindex ffunction-cse
+@item -fno-function-cse
Do not put function addresses in registers; make each instruction that
calls a constant function contain the function's address explicitly.
The default is @option{-ffunction-cse}
-@item -fno-zero-initialized-in-bss
@opindex fno-zero-initialized-in-bss
@opindex fzero-initialized-in-bss
+@item -fno-zero-initialized-in-bss
If the target supports a BSS section, GCC by default puts variables that
are initialized to zero into BSS@. This can save space in the resulting
code.
The default is @option{-fzero-initialized-in-bss}.
-@item -fthread-jumps
@opindex fthread-jumps
+@item -fthread-jumps
Perform optimizations that check to see if a jump branches to a
location where another comparison subsumed by the first is found. If
so, the first branch is redirected to either the destination of the
Enabled at levels @option{-O1}, @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fsplit-wide-types
@opindex fsplit-wide-types
+@item -fsplit-wide-types
When using a type that occupies multiple registers, such as @code{long
long} on a 32-bit system, split the registers apart and allocate them
independently. This normally generates better code for those types,
Enabled at levels @option{-O1}, @option{-O2}, @option{-O3},
@option{-Os}.
-@item -fsplit-wide-types-early
@opindex fsplit-wide-types-early
+@item -fsplit-wide-types-early
Fully split wide types early, instead of very late.
This option has no effect unless @option{-fsplit-wide-types} is turned on.
This is the default on some targets.
-@item -fcse-follow-jumps
@opindex fcse-follow-jumps
+@item -fcse-follow-jumps
In common subexpression elimination (CSE), scan through jump instructions
when the target of the jump is not reached by any other path. For
example, when CSE encounters an @code{if} statement with an
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fcse-skip-blocks
@opindex fcse-skip-blocks
+@item -fcse-skip-blocks
This is similar to @option{-fcse-follow-jumps}, but causes CSE to
follow jumps that conditionally skip over blocks. When CSE
encounters a simple @code{if} statement with no else clause,
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -frerun-cse-after-loop
@opindex frerun-cse-after-loop
+@item -frerun-cse-after-loop
Re-run common subexpression elimination after loop optimizations are
performed.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fgcse
@opindex fgcse
+@item -fgcse
Perform a global common subexpression elimination pass.
This pass also performs global constant and copy propagation.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fgcse-lm
@opindex fgcse-lm
+@item -fgcse-lm
When @option{-fgcse-lm} is enabled, global common subexpression elimination
attempts to move loads that are only killed by stores into themselves. This
allows a loop containing a load/store sequence to be changed to a load outside
Enabled by default when @option{-fgcse} is enabled.
-@item -fgcse-sm
@opindex fgcse-sm
+@item -fgcse-sm
When @option{-fgcse-sm} is enabled, a store motion pass is run after
global common subexpression elimination. This pass attempts to move
stores out of loops. When used in conjunction with @option{-fgcse-lm},
Not enabled at any optimization level.
-@item -fgcse-las
@opindex fgcse-las
+@item -fgcse-las
When @option{-fgcse-las} is enabled, the global common subexpression
elimination pass eliminates redundant loads that come after stores to the
same memory location (both partial and full redundancies).
Not enabled at any optimization level.
-@item -fgcse-after-reload
@opindex fgcse-after-reload
+@item -fgcse-after-reload
When @option{-fgcse-after-reload} is enabled, a redundant load elimination
pass is performed after reload. The purpose of this pass is to clean up
redundant spilling.
Enabled by @option{-O3}, @option{-fprofile-use} and @option{-fauto-profile}.
-@item -faggressive-loop-optimizations
@opindex faggressive-loop-optimizations
+@item -faggressive-loop-optimizations
This option tells the loop optimizer to use language constraints to
derive bounds for the number of iterations of a loop. This assumes that
loop code does not invoke undefined behavior by for example causing signed
and loop exit test optimizations.
This option is enabled by default.
-@item -funconstrained-commons
@opindex funconstrained-commons
+@item -funconstrained-commons
This option tells the compiler that variables declared in common blocks
(e.g.@: Fortran) may later be overridden with longer trailing arrays. This
prevents certain optimizations that depend on knowing the array bounds.
-@item -fcrossjumping
@opindex fcrossjumping
+@item -fcrossjumping
Perform cross-jumping transformation.
This transformation unifies equivalent code and saves code size. The
resulting code may or may not perform better than without cross-jumping.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fauto-inc-dec
@opindex fauto-inc-dec
+@item -fauto-inc-dec
Combine increments or decrements of addresses with memory accesses.
This pass is always skipped on architectures that do not have
instructions to support this. Enabled by default at @option{-O1} and
higher on architectures that support this.
-@item -fdce
@opindex fdce
+@item -fdce
Perform dead code elimination (DCE) on RTL@.
Enabled by default at @option{-O1} and higher.
-@item -fdse
@opindex fdse
+@item -fdse
Perform dead store elimination (DSE) on RTL@.
Enabled by default at @option{-O1} and higher.
-@item -fif-conversion
@opindex fif-conversion
+@item -fif-conversion
Attempt to transform conditional jumps into branch-less equivalents. This
includes use of conditional moves, min, max, set flags and abs instructions, and
some tricks doable by standard arithmetics. The use of conditional execution
Enabled at levels @option{-O1}, @option{-O2}, @option{-O3}, @option{-Os}, but
not with @option{-Og}.
-@item -fif-conversion2
@opindex fif-conversion2
+@item -fif-conversion2
Use conditional execution (where available) to transform conditional jumps into
branch-less equivalents.
Enabled at levels @option{-O1}, @option{-O2}, @option{-O3}, @option{-Os}, but
not with @option{-Og}.
-@item -fdeclone-ctor-dtor
@opindex fdeclone-ctor-dtor
+@item -fdeclone-ctor-dtor
The C++ ABI requires multiple entry points for constructors and
destructors: one for a base subobject, one for a complete object, and
one for a virtual destructor that calls operator delete afterwards.
Enabled by @option{-Os}.
-@item -fdelete-null-pointer-checks
@opindex fdelete-null-pointer-checks
+@item -fdelete-null-pointer-checks
Assume that programs cannot safely dereference null pointers, and that
no code or data element resides at address zero.
This option enables simple constant
Passes that use the dataflow information
are enabled independently at different optimization levels.
-@item -fdevirtualize
@opindex fdevirtualize
+@item -fdevirtualize
Attempt to convert calls to virtual functions to direct calls. This
is done both within a procedure and interprocedurally as part of
indirect inlining (@option{-findirect-inlining}) and interprocedural constant
propagation (@option{-fipa-cp}).
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fdevirtualize-speculatively
@opindex fdevirtualize-speculatively
+@item -fdevirtualize-speculatively
Attempt to convert calls to virtual functions to speculative direct calls.
Based on the analysis of the type inheritance graph, determine for a given call
the set of likely targets. If the set is small, preferably of size 1, change
speculative calls enable more optimizations, such as inlining. When they seem
useless after further optimization, they are converted back into original form.
-@item -fdevirtualize-at-ltrans
@opindex fdevirtualize-at-ltrans
+@item -fdevirtualize-at-ltrans
Stream extra information needed for aggressive devirtualization when running
the link-time optimizer in local transformation mode.
This option enables more devirtualization but
significantly increases the size of streamed data. For this reason it is
disabled by default.
-@item -fexpensive-optimizations
@opindex fexpensive-optimizations
+@item -fexpensive-optimizations
Perform a number of minor optimizations that are relatively expensive.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -free
@opindex free
+@item -free
Attempt to remove redundant extension instructions. This is especially
helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
registers after writing to their lower 32-bit half.
Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
@option{-O3}, @option{-Os}.
-@item -fno-lifetime-dse
@opindex fno-lifetime-dse
@opindex flifetime-dse
+@item -fno-lifetime-dse
In C++ the value of an object is only affected by changes within its
lifetime: when the constructor begins, the object has an indeterminate
value, and any changes during the lifetime of the object are dead when
explicitly selected with @option{-flifetime-dse=2}.
@option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
-@item -flive-range-shrinkage
@opindex flive-range-shrinkage
+@item -flive-range-shrinkage
Attempt to decrease register pressure through register live range
shrinkage. This is helpful for fast processors with small or moderate
size register sets.
-@item -fira-algorithm=@var{algorithm}
@opindex fira-algorithm
+@item -fira-algorithm=@var{algorithm}
Use the specified coloring algorithm for the integrated register
allocator. The @var{algorithm} argument can be @samp{priority}, which
specifies Chow's priority coloring, or @samp{CB}, which specifies
for all architectures, but for those targets that do support it, it is
the default because it generates better code.
-@item -fira-region=@var{region}
@opindex fira-region
+@item -fira-region=@var{region}
Use specified regions for the integrated register allocator. The
@var{region} argument should be one of the following:
@end table
-@item -fira-hoist-pressure
@opindex fira-hoist-pressure
+@item -fira-hoist-pressure
Use IRA to evaluate register pressure in the code hoisting pass for
decisions to hoist expressions. This option usually results in smaller
code, but it can slow the compiler down.
This option is enabled at level @option{-Os} for all targets.
-@item -fira-loop-pressure
@opindex fira-loop-pressure
+@item -fira-loop-pressure
Use IRA to evaluate register pressure in loops for decisions to move
loop invariants. This option usually results in generation
of faster and smaller code on machines with large register files (>= 32
This option is enabled at level @option{-O3} for some targets.
-@item -fno-ira-share-save-slots
@opindex fno-ira-share-save-slots
@opindex fira-share-save-slots
+@item -fno-ira-share-save-slots
Disable sharing of stack slots used for saving call-used hard
registers living through a call. Each hard register gets a
separate stack slot, and as a result function stack frames are
larger.
-@item -fno-ira-share-spill-slots
@opindex fno-ira-share-spill-slots
@opindex fira-share-spill-slots
+@item -fno-ira-share-spill-slots
Disable sharing of stack slots allocated for pseudo-registers. Each
pseudo-register that does not get a hard register gets a separate
stack slot, and as a result function stack frames are larger.
-@item -flra-remat
@opindex flra-remat
+@item -flra-remat
Enable CFG-sensitive rematerialization in LRA. Instead of loading
values of spilled pseudos, LRA tries to rematerialize (recalculate)
values if it is profitable.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fdelayed-branch
@opindex fdelayed-branch
+@item -fdelayed-branch
If supported for the target machine, attempt to reorder instructions
to exploit instruction slots available after delayed branch
instructions.
Enabled at levels @option{-O1}, @option{-O2}, @option{-O3}, @option{-Os},
but not at @option{-Og}.
-@item -fschedule-insns
@opindex fschedule-insns
+@item -fschedule-insns
If supported for the target machine, attempt to reorder instructions to
eliminate execution stalls due to required data being unavailable. This
helps machines that have slow floating point or memory load instructions
Enabled at levels @option{-O2}, @option{-O3}.
-@item -fschedule-insns2
@opindex fschedule-insns2
+@item -fschedule-insns2
Similar to @option{-fschedule-insns}, but requests an additional pass of
instruction scheduling after register allocation has been done. This is
especially useful on machines with a relatively small number of
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fno-sched-interblock
@opindex fno-sched-interblock
@opindex fsched-interblock
+@item -fno-sched-interblock
Disable instruction scheduling across basic blocks, which
is normally enabled when scheduling before register allocation, i.e.@:
with @option{-fschedule-insns} or at @option{-O2} or higher.
-@item -fno-sched-spec
@opindex fno-sched-spec
@opindex fsched-spec
+@item -fno-sched-spec
Disable speculative motion of non-load instructions, which
is normally enabled when scheduling before register allocation, i.e.@:
with @option{-fschedule-insns} or at @option{-O2} or higher.
-@item -fsched-pressure
@opindex fsched-pressure
+@item -fsched-pressure
Enable register pressure sensitive insn scheduling before register
allocation. This only makes sense when scheduling before register
allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
increase above the number of available hard registers and subsequent
spills in register allocation.
-@item -fsched-spec-load
@opindex fsched-spec-load
+@item -fsched-spec-load
Allow speculative motion of some load instructions. This only makes
sense when scheduling before register allocation, i.e.@: with
@option{-fschedule-insns} or at @option{-O2} or higher.
-@item -fsched-spec-load-dangerous
@opindex fsched-spec-load-dangerous
+@item -fsched-spec-load-dangerous
Allow speculative motion of more load instructions. This only makes
sense when scheduling before register allocation, i.e.@: with
@option{-fschedule-insns} or at @option{-O2} or higher.
+@opindex fsched-stalled-insns
@item -fsched-stalled-insns
@itemx -fsched-stalled-insns=@var{n}
-@opindex fsched-stalled-insns
Define how many insns (if any) can be moved prematurely from the queue
of stalled insns into the ready list during the second scheduling pass.
@option{-fno-sched-stalled-insns} means that no insns are moved
@option{-fsched-stalled-insns} without a value is equivalent to
@option{-fsched-stalled-insns=1}.
+@opindex fsched-stalled-insns-dep
@item -fsched-stalled-insns-dep
@itemx -fsched-stalled-insns-dep=@var{n}
-@opindex fsched-stalled-insns-dep
Define how many insn groups (cycles) are examined for a dependency
on a stalled insn that is a candidate for premature removal from the queue
of stalled insns. This has an effect only during the second scheduling pass,
@option{-fsched-stalled-insns-dep} without a value is equivalent to
@option{-fsched-stalled-insns-dep=1}.
-@item -fsched2-use-superblocks
@opindex fsched2-use-superblocks
+@item -fsched2-use-superblocks
When scheduling after register allocation, use superblock scheduling.
This allows motion across basic block boundaries,
resulting in faster schedules. This option is experimental, as not all machine
This only makes sense when scheduling after register allocation, i.e.@: with
@option{-fschedule-insns2} or at @option{-O2} or higher.
-@item -fsched-group-heuristic
@opindex fsched-group-heuristic
+@item -fsched-group-heuristic
Enable the group heuristic in the scheduler. This heuristic favors
the instruction that belongs to a schedule group. This is enabled
by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
or @option{-fschedule-insns2} or at @option{-O2} or higher.
-@item -fsched-critical-path-heuristic
@opindex fsched-critical-path-heuristic
+@item -fsched-critical-path-heuristic
Enable the critical-path heuristic in the scheduler. This heuristic favors
instructions on the critical path. This is enabled by default when
scheduling is enabled, i.e.@: with @option{-fschedule-insns}
or @option{-fschedule-insns2} or at @option{-O2} or higher.
-@item -fsched-spec-insn-heuristic
@opindex fsched-spec-insn-heuristic
+@item -fsched-spec-insn-heuristic
Enable the speculative instruction heuristic in the scheduler. This
heuristic favors speculative instructions with greater dependency weakness.
This is enabled by default when scheduling is enabled, i.e.@:
with @option{-fschedule-insns} or @option{-fschedule-insns2}
or at @option{-O2} or higher.
-@item -fsched-rank-heuristic
@opindex fsched-rank-heuristic
+@item -fsched-rank-heuristic
Enable the rank heuristic in the scheduler. This heuristic favors
the instruction belonging to a basic block with greater size or frequency.
This is enabled by default when scheduling is enabled, i.e.@:
with @option{-fschedule-insns} or @option{-fschedule-insns2} or
at @option{-O2} or higher.
-@item -fsched-last-insn-heuristic
@opindex fsched-last-insn-heuristic
+@item -fsched-last-insn-heuristic
Enable the last-instruction heuristic in the scheduler. This heuristic
favors the instruction that is less dependent on the last instruction
scheduled. This is enabled by default when scheduling is enabled,
i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
at @option{-O2} or higher.
-@item -fsched-dep-count-heuristic
@opindex fsched-dep-count-heuristic
+@item -fsched-dep-count-heuristic
Enable the dependent-count heuristic in the scheduler. This heuristic
favors the instruction that has more instructions depending on it.
This is enabled by default when scheduling is enabled, i.e.@:
with @option{-fschedule-insns} or @option{-fschedule-insns2} or
at @option{-O2} or higher.
-@item -freschedule-modulo-scheduled-loops
@opindex freschedule-modulo-scheduled-loops
+@item -freschedule-modulo-scheduled-loops
Modulo scheduling is performed before traditional scheduling. If a loop
is modulo scheduled, later scheduling passes may change its schedule.
Use this option to control that behavior.
-@item -fselective-scheduling
@opindex fselective-scheduling
+@item -fselective-scheduling
Schedule instructions using selective scheduling algorithm. Selective
scheduling runs instead of the first scheduler pass.
-@item -fselective-scheduling2
@opindex fselective-scheduling2
+@item -fselective-scheduling2
Schedule instructions using selective scheduling algorithm. Selective
scheduling runs instead of the second scheduler pass.
-@item -fsel-sched-pipelining
@opindex fsel-sched-pipelining
+@item -fsel-sched-pipelining
Enable software pipelining of innermost loops during selective scheduling.
This option has no effect unless one of @option{-fselective-scheduling} or
@option{-fselective-scheduling2} is turned on.
-@item -fsel-sched-pipelining-outer-loops
@opindex fsel-sched-pipelining-outer-loops
+@item -fsel-sched-pipelining-outer-loops
When pipelining loops during selective scheduling, also pipeline outer loops.
This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
-@item -fsemantic-interposition
@opindex fsemantic-interposition
+@item -fsemantic-interposition
Some object formats, like ELF, allow interposing of symbols by the
dynamic linker.
This means that for symbols exported from the DSO, the compiler cannot perform
(where it is never allowed for interposition to change semantics)
and for symbols explicitly declared weak.
-@item -fshrink-wrap
@opindex fshrink-wrap
+@item -fshrink-wrap
Emit function prologues only before parts of the function that need it,
rather than at the top of the function. This flag is enabled by default at
@option{-O} and higher.
-@item -fshrink-wrap-separate
@opindex fshrink-wrap-separate
+@item -fshrink-wrap-separate
Shrink-wrap separate parts of the prologue and epilogue separately, so that
those parts are only executed when needed.
This option is on by default, but has no effect unless @option{-fshrink-wrap}
is also turned on and the target supports this.
-@item -fcaller-saves
@opindex fcaller-saves
+@item -fcaller-saves
Enable allocation of values to registers that are clobbered by
function calls, by emitting extra instructions to save and restore the
registers around such calls. Such allocation is done only when it
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fcombine-stack-adjustments
@opindex fcombine-stack-adjustments
+@item -fcombine-stack-adjustments
Tracks stack adjustments (pushes and pops) and stack memory references
and then tries to find ways to combine them.
Enabled by default at @option{-O1} and higher.
-@item -fipa-ra
@opindex fipa-ra
+@item -fipa-ra
Use caller save registers for allocation if those registers are not used by
any called function. In that case it is not necessary to save and restore
them around calls. This is only possible if called functions are part of
exactly (this happens on targets that do not expose prologues
and epilogues in RTL).
-@item -fconserve-stack
@opindex fconserve-stack
+@item -fconserve-stack
Attempt to minimize stack usage. The compiler attempts to use less
stack space, even if that makes the program slower. This option
implies setting the @option{large-stack-frame} parameter to 100
and the @option{large-stack-frame-growth} parameter to 400.
-@item -ftree-reassoc
@opindex ftree-reassoc
+@item -ftree-reassoc
Perform reassociation on trees. This flag is enabled by default
at @option{-O1} and higher.
-@item -fcode-hoisting
@opindex fcode-hoisting
+@item -fcode-hoisting
Perform code hoisting. Code hoisting tries to move the
evaluation of expressions executed on all paths to the function exit
as early as possible. This is especially useful as a code size
optimization, but it often helps for code speed as well.
This flag is enabled by default at @option{-O2} and higher.
-@item -ftree-pre
@opindex ftree-pre
+@item -ftree-pre
Perform partial redundancy elimination (PRE) on trees. This flag is
enabled by default at @option{-O2} and @option{-O3}.
-@item -ftree-partial-pre
@opindex ftree-partial-pre
+@item -ftree-partial-pre
Make partial redundancy elimination (PRE) more aggressive. This flag is
enabled by default at @option{-O3}.
-@item -ftree-forwprop
@opindex ftree-forwprop
+@item -ftree-forwprop
Perform forward propagation on trees. This flag is enabled by default
at @option{-O1} and higher.
-@item -ftree-fre
@opindex ftree-fre
+@item -ftree-fre
Perform full redundancy elimination (FRE) on trees. The difference
between FRE and PRE is that FRE only considers expressions
that are computed on all paths leading to the redundant computation.
This analysis is faster than PRE, though it exposes fewer redundancies.
This flag is enabled by default at @option{-O1} and higher.
-@item -ftree-phiprop
@opindex ftree-phiprop
+@item -ftree-phiprop
Perform hoisting of loads from conditional pointers on trees. This
pass is enabled by default at @option{-O1} and higher.
-@item -fhoist-adjacent-loads
@opindex fhoist-adjacent-loads
+@item -fhoist-adjacent-loads
Speculatively hoist loads from both branches of an if-then-else if the
loads are from adjacent locations in the same structure and the target
architecture has a conditional move instruction. This flag is enabled
by default at @option{-O2} and higher.
-@item -ftree-copy-prop
@opindex ftree-copy-prop
+@item -ftree-copy-prop
Perform copy propagation on trees. This pass eliminates unnecessary
copy operations. This flag is enabled by default at @option{-O1} and
higher.
-@item -fipa-pure-const
@opindex fipa-pure-const
+@item -fipa-pure-const
Discover which functions are pure or constant.
Enabled by default at @option{-O1} and higher.
-@item -fipa-reference
@opindex fipa-reference
+@item -fipa-reference
Discover which static variables do not escape the
compilation unit.
Enabled by default at @option{-O1} and higher.
-@item -fipa-reference-addressable
@opindex fipa-reference-addressable
+@item -fipa-reference-addressable
Discover read-only, write-only and non-addressable static variables.
Enabled by default at @option{-O1} and higher.
-@item -fipa-stack-alignment
@opindex fipa-stack-alignment
+@item -fipa-stack-alignment
Reduce stack alignment on call sites if possible.
Enabled by default.
-@item -fipa-pta
@opindex fipa-pta
+@item -fipa-pta
Perform interprocedural pointer analysis and interprocedural modification
and reference analysis. This option can cause excessive memory and
compile-time usage on large compilation units. It is not enabled by
default at any optimization level.
-@item -fipa-profile
@opindex fipa-profile
+@item -fipa-profile
Perform interprocedural profile propagation. The functions called only from
cold functions are marked as cold. Also functions executed once (such as
@code{cold}, @code{noreturn}, static constructors or destructors) are
then optimized for size.
Enabled by default at @option{-O1} and higher.
-@item -fipa-modref
@opindex fipa-modref
+@item -fipa-modref
Perform interprocedural mod/ref analysis. This optimization analyzes the side
effects of functions (memory locations that are modified or referenced) and
enables better optimization across the function call boundary. This flag is
enabled by default at @option{-O1} and higher.
-@item -fipa-cp
@opindex fipa-cp
+@item -fipa-cp
Perform interprocedural constant propagation.
This optimization analyzes the program to determine when values passed
to functions are constants and then optimizes accordingly.
This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -fipa-cp-clone
@opindex fipa-cp-clone
+@item -fipa-cp-clone
Perform function cloning to make interprocedural constant propagation stronger.
When enabled, interprocedural constant propagation performs function cloning
when externally visible function can be called with constant arguments.
This flag is enabled by default at @option{-O3}.
It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -fipa-bit-cp
@opindex fipa-bit-cp
+@item -fipa-bit-cp
When enabled, perform interprocedural bitwise constant
propagation. This flag is enabled by default at @option{-O2} and
by @option{-fprofile-use} and @option{-fauto-profile}.
It requires that @option{-fipa-cp} is enabled.
-@item -fipa-vrp
@opindex fipa-vrp
+@item -fipa-vrp
When enabled, perform interprocedural propagation of value
ranges. This flag is enabled by default at @option{-O2}. It requires
that @option{-fipa-cp} is enabled.
-@item -fipa-icf
@opindex fipa-icf
+@item -fipa-icf
Perform Identical Code Folding for functions and read-only variables.
The optimization reduces code size and may disturb unwind stacks by replacing
a function by equivalent one with a different name. The optimization works
This flag is enabled by default at @option{-O2} and @option{-Os}.
-@item -flive-patching=@var{level}
@opindex flive-patching
+@item -flive-patching=@var{level}
Control GCC's optimizations to produce output suitable for live-patching.
If the compiler's optimization uses a function's body or information extracted
Note that @option{-flive-patching} is not supported with link-time optimization
(@option{-flto}).
-@item -fisolate-erroneous-paths-dereference
@opindex fisolate-erroneous-paths-dereference
+@item -fisolate-erroneous-paths-dereference
Detect paths that trigger erroneous or undefined behavior due to
dereferencing a null pointer. Isolate those paths from the main control
flow and turn the statement with erroneous or undefined behavior into a trap.
This flag is enabled by default at @option{-O2} and higher and depends on
@option{-fdelete-null-pointer-checks} also being enabled.
-@item -fisolate-erroneous-paths-attribute
@opindex fisolate-erroneous-paths-attribute
+@item -fisolate-erroneous-paths-attribute
Detect paths that trigger erroneous or undefined behavior due to a null value
being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
attribute. Isolate those paths from the main control flow and turn the
statement with erroneous or undefined behavior into a trap. This is not
currently enabled, but may be enabled by @option{-O2} in the future.
-@item -ftree-sink
@opindex ftree-sink
+@item -ftree-sink
Perform forward store motion on trees. This flag is
enabled by default at @option{-O1} and higher.
-@item -ftree-bit-ccp
@opindex ftree-bit-ccp
+@item -ftree-bit-ccp
Perform sparse conditional bit constant propagation on trees and propagate
pointer alignment information.
This pass only operates on local scalar variables and is enabled by default
at @option{-O1} and higher, except for @option{-Og}.
It requires that @option{-ftree-ccp} is enabled.
-@item -ftree-ccp
@opindex ftree-ccp
+@item -ftree-ccp
Perform sparse conditional constant propagation (CCP) on trees. This
pass only operates on local scalar variables and is enabled by default
at @option{-O1} and higher.
-@item -fssa-backprop
@opindex fssa-backprop
+@item -fssa-backprop
Propagate information about uses of a value up the definition chain
in order to simplify the definitions. For example, this pass strips
sign operations if the sign of a value never matters. The flag is
enabled by default at @option{-O1} and higher.
-@item -fssa-phiopt
@opindex fssa-phiopt
+@item -fssa-phiopt
Perform pattern matching on SSA PHI nodes to optimize conditional
code. This pass is enabled by default at @option{-O1} and higher,
except for @option{-Og}.
-@item -ftree-switch-conversion
@opindex ftree-switch-conversion
+@item -ftree-switch-conversion
Perform conversion of simple initializations in a switch to
initializations from a scalar array. This flag is enabled by default
at @option{-O2} and higher.
-@item -ftree-tail-merge
@opindex ftree-tail-merge
+@item -ftree-tail-merge
Look for identical code sequences. When found, replace one with a jump to the
other. This optimization is known as tail merging or cross jumping. This flag
is enabled by default at @option{-O2} and higher. The compilation time
be limited using @option{max-tail-merge-comparisons} parameter and
@option{max-tail-merge-iterations} parameter.
-@item -ftree-dce
@opindex ftree-dce
+@item -ftree-dce
Perform dead code elimination (DCE) on trees. This flag is enabled by
default at @option{-O1} and higher.
-@item -ftree-builtin-call-dce
@opindex ftree-builtin-call-dce
+@item -ftree-builtin-call-dce
Perform conditional dead code elimination (DCE) for calls to built-in functions
that may set @code{errno} but are otherwise free of side effects. This flag is
enabled by default at @option{-O2} and higher if @option{-Os} is not also
specified.
-@item -ffinite-loops
@opindex ffinite-loops
@opindex fno-finite-loops
+@item -ffinite-loops
Assume that a loop with an exit will eventually take the exit and not loop
indefinitely. This allows the compiler to remove loops that otherwise have
no side-effects, not considering eventual endless looping as such.
This option is enabled by default at @option{-O2} for C++ with -std=c++11
or higher.
-@item -ftree-dominator-opts
@opindex ftree-dominator-opts
+@item -ftree-dominator-opts
Perform a variety of simple scalar cleanups (constant/copy
propagation, redundancy elimination, range propagation and expression
simplification) based on a dominator tree traversal. This also
performs jump threading (to reduce jumps to jumps). This flag is
enabled by default at @option{-O1} and higher.
-@item -ftree-dse
@opindex ftree-dse
+@item -ftree-dse
Perform dead store elimination (DSE) on trees. A dead store is a store into
a memory location that is later overwritten by another store without
any intervening loads. In this case the earlier store can be deleted. This
flag is enabled by default at @option{-O1} and higher.
-@item -ftree-ch
@opindex ftree-ch
+@item -ftree-ch
Perform loop header copying on trees. This is beneficial since it increases
effectiveness of code motion optimizations. It also saves one jump. This flag
is enabled by default at @option{-O1} and higher. It is not enabled
for @option{-Os}, since it usually increases code size.
-@item -ftree-loop-optimize
@opindex ftree-loop-optimize
+@item -ftree-loop-optimize
Perform loop optimizations on trees. This flag is enabled by default
at @option{-O1} and higher.
-@item -ftree-loop-linear
-@itemx -floop-strip-mine
-@itemx -floop-block
@opindex ftree-loop-linear
@opindex floop-strip-mine
@opindex floop-block
+@item -ftree-loop-linear
+@itemx -floop-strip-mine
+@itemx -floop-block
Perform loop nest optimizations. Same as
@option{-floop-nest-optimize}. To use this code transformation, GCC has
to be configured with @option{--with-isl} to enable the Graphite loop
transformation infrastructure.
-@item -fgraphite-identity
@opindex fgraphite-identity
+@item -fgraphite-identity
Enable the identity transformation for graphite. For every SCoP we generate
the polyhedral representation and transform it back to gimple. Using
@option{-fgraphite-identity} we can check the costs or benefits of the
are also performed by the code generator isl, like index splitting and
dead code elimination in loops.
-@item -floop-nest-optimize
@opindex floop-nest-optimize
+@item -floop-nest-optimize
Enable the isl based loop nest optimizer. This is a generic loop nest
optimizer based on the Pluto optimization algorithms. It calculates a loop
structure optimized for data-locality and parallelism. This option
is experimental.
-@item -floop-parallelize-all
@opindex floop-parallelize-all
+@item -floop-parallelize-all
Use the Graphite data dependence analysis to identify loops that can
be parallelized. Parallelize all the loops that can be analyzed to
not contain loop carried dependences without checking that it is
profitable to parallelize the loops.
-@item -ftree-coalesce-vars
@opindex ftree-coalesce-vars
+@item -ftree-coalesce-vars
While transforming the program out of the SSA representation, attempt to
reduce copying by coalescing versions of different user-defined
variables, instead of just compiler temporaries. This may severely
prevents SSA coalescing of user variables. This option is enabled by
default if optimization is enabled, and it does very little otherwise.
-@item -ftree-loop-if-convert
@opindex ftree-loop-if-convert
+@item -ftree-loop-if-convert
Attempt to transform conditional jumps in the innermost loops to
branch-less equivalents. The intent is to remove control-flow from
the innermost loops in order to improve the ability of the
vectorization pass to handle these loops. This is enabled by default
if vectorization is enabled.
-@item -ftree-loop-distribution
@opindex ftree-loop-distribution
+@item -ftree-loop-distribution
Perform loop distribution. This flag can improve cache performance on
big loop bodies and allow further loop optimizations, like
parallelization or vectorization, to take place. For example, the loop
This flag is enabled by default at @option{-O3}.
It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -ftree-loop-distribute-patterns
@opindex ftree-loop-distribute-patterns
+@item -ftree-loop-distribute-patterns
Perform loop distribution of patterns that can be code generated with
calls to a library. This flag is enabled by default at @option{-O2} and
higher, and by @option{-fprofile-use} and @option{-fauto-profile}.
This flag is enabled by default at @option{-O3}.
It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -floop-interchange
@opindex floop-interchange
+@item -floop-interchange
Perform loop interchange outside of graphite. This flag can improve cache
performance on loop nest and allow further loop optimizations, like
vectorization, to take place. For example, the loop
This flag is enabled by default at @option{-O3}.
It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -floop-unroll-and-jam
@opindex floop-unroll-and-jam
+@item -floop-unroll-and-jam
Apply unroll and jam transformations on feasible loops. In a loop
nest this unrolls the outer loop by some factor and fuses the resulting
multiple inner loops. This flag is enabled by default at @option{-O3}.
It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -ftree-loop-im
@opindex ftree-loop-im
+@item -ftree-loop-im
Perform loop invariant motion on trees. This pass moves only invariants that
are hard to handle at RTL level (function calls, operations that expand to
nontrivial sequences of insns). With @option{-funswitch-loops} it also moves
just trivial invariantness analysis in loop unswitching. The pass also includes
store motion.
-@item -ftree-loop-ivcanon
@opindex ftree-loop-ivcanon
+@item -ftree-loop-ivcanon
Create a canonical counter for number of iterations in loops for which
determining number of iterations requires complicated analysis. Later
optimizations then may determine the number easily. Useful especially
in connection with unrolling.
-@item -ftree-scev-cprop
@opindex ftree-scev-cprop
+@item -ftree-scev-cprop
Perform final value replacement. If a variable is modified in a loop
in such a way that its value when exiting the loop can be determined using
only its initial value and the number of loop iterations, replace uses of
This reduces data dependencies and may allow further simplifications.
Enabled by default at @option{-O1} and higher.
-@item -fivopts
@opindex fivopts
+@item -fivopts
Perform induction variable optimizations (strength reduction, induction
variable merging and induction variable elimination) on trees.
-@item -ftree-parallelize-loops=n
@opindex ftree-parallelize-loops
+@item -ftree-parallelize-loops=n
Parallelize loops, i.e., split their iteration space to run in n threads.
This is only possible for loops whose iterations are independent
and can be arbitrarily reordered. The optimization is only
implies @option{-pthread}, and thus is only supported on targets
that have support for @option{-pthread}.
-@item -ftree-pta
@opindex ftree-pta
+@item -ftree-pta
Perform function-local points-to analysis on trees. This flag is
enabled by default at @option{-O1} and higher, except for @option{-Og}.
-@item -ftree-sra
@opindex ftree-sra
+@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 @option{-O1} and higher,
except for @option{-Og}.
-@item -fstore-merging
@opindex fstore-merging
+@item -fstore-merging
Perform merging of narrow stores to consecutive memory addresses. This pass
merges contiguous stores of immediate values narrower than a word into fewer
wider stores to reduce the number of instructions. This is enabled by default
at @option{-O2} and higher as well as @option{-Os}.
-@item -ftree-ter
@opindex ftree-ter
+@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 @option{-O1} and higher.
-@item -ftree-slsr
@opindex ftree-slsr
+@item -ftree-slsr
Perform straight-line strength reduction on trees. This recognizes related
expressions involving multiplications and replaces them by less expensive
calculations when possible. This is enabled by default at @option{-O1} and
higher.
-@item -ftree-vectorize
@opindex ftree-vectorize
+@item -ftree-vectorize
Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
and @option{-ftree-slp-vectorize} if not explicitly specified.
-@item -ftree-loop-vectorize
@opindex ftree-loop-vectorize
+@item -ftree-loop-vectorize
Perform loop vectorization on trees. This flag is enabled by default at
@option{-O2} and by @option{-ftree-vectorize}, @option{-fprofile-use},
and @option{-fauto-profile}.
-@item -ftree-slp-vectorize
@opindex ftree-slp-vectorize
+@item -ftree-slp-vectorize
Perform basic block vectorization on trees. This flag is enabled by default at
@option{-O2} and by @option{-ftree-vectorize}, @option{-fprofile-use},
and @option{-fauto-profile}.
-@item -ftrivial-auto-var-init=@var{choice}
@opindex ftrivial-auto-var-init
+@item -ftrivial-auto-var-init=@var{choice}
Initialize automatic variables with either a pattern or with zeroes to increase
the security and predictability of a program by preventing uninitialized memory
disclosure and use.
You can control this behavior for a specific variable by using the variable
attribute @code{uninitialized} (@pxref{Variable Attributes}).
-@item -fvect-cost-model=@var{model}
@opindex fvect-cost-model
+@item -fvect-cost-model=@var{model}
Alter the cost model used for vectorization. The @var{model} argument
should be one of @samp{unlimited}, @samp{dynamic}, @samp{cheap} or
@samp{very-cheap}.
The default cost model depends on other optimization flags and is
either @samp{dynamic} or @samp{cheap}.
-@item -fsimd-cost-model=@var{model}
@opindex fsimd-cost-model
+@item -fsimd-cost-model=@var{model}
Alter the cost model used for vectorization of loops marked with the OpenMP
simd directive. The @var{model} argument should be one of
@samp{unlimited}, @samp{dynamic}, @samp{cheap}. All values of @var{model}
have the same meaning as described in @option{-fvect-cost-model} and by
default a cost model defined with @option{-fvect-cost-model} is used.
-@item -ftree-vrp
@opindex ftree-vrp
+@item -ftree-vrp
Perform Value Range Propagation on trees. This is similar to the
constant propagation pass, but instead of values, ranges of values are
propagated. This allows the optimizers to remove unnecessary range
elimination is only done if @option{-fdelete-null-pointer-checks} is
enabled.
-@item -fsplit-paths
@opindex fsplit-paths
+@item -fsplit-paths
Split paths leading to loop backedges. This can improve dead code
elimination and common subexpression elimination. This is enabled by
default at @option{-O3} and above.
-@item -fsplit-ivs-in-unroller
@opindex fsplit-ivs-in-unroller
+@item -fsplit-ivs-in-unroller
Enables expression of values of induction variables in later iterations
of the unrolled loop using the value in the first iteration. This breaks
long dependency chains, thus improving efficiency of the scheduling passes.
This optimization is enabled by default.
-@item -fvariable-expansion-in-unroller
@opindex fvariable-expansion-in-unroller
+@item -fvariable-expansion-in-unroller
With this option, the compiler creates multiple copies of some
local variables when unrolling a loop, which can result in superior code.
This optimization is enabled by default for PowerPC targets, but disabled
by default otherwise.
-@item -fpartial-inlining
@opindex fpartial-inlining
+@item -fpartial-inlining
Inline parts of functions. This option has any effect only
when inlining itself is turned on by the @option{-finline-functions}
or @option{-finline-small-functions} options.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fpredictive-commoning
@opindex fpredictive-commoning
+@item -fpredictive-commoning
Perform predictive commoning optimization, i.e., reusing computations
(especially memory loads and stores) performed in previous
iterations of loops.
This option is enabled at level @option{-O3}.
It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -fprefetch-loop-arrays
@opindex fprefetch-loop-arrays
+@item -fprefetch-loop-arrays
If supported by the target machine, generate instructions to prefetch
memory to improve the performance of loops that access large arrays.
Disabled at level @option{-Os}.
-@item -fno-printf-return-value
@opindex fno-printf-return-value
@opindex fprintf-return-value
+@item -fno-printf-return-value
Do not substitute constants for known return value of formatted output
functions such as @code{sprintf}, @code{snprintf}, @code{vsprintf}, and
@code{vsnprintf} (but not @code{printf} of @code{fprintf}). This
with the @option{-Wformat-overflow} and @option{-Wformat-truncation}
options. The @option{-fprintf-return-value} option is enabled by default.
-@item -fno-peephole
-@itemx -fno-peephole2
@opindex fno-peephole
@opindex fpeephole
@opindex fno-peephole2
@opindex fpeephole2
+@item -fno-peephole
+@itemx -fno-peephole2
Disable any machine-specific peephole optimizations. The difference
between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
are implemented in the compiler; some targets use one, some use the
@option{-fpeephole} is enabled by default.
@option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fno-guess-branch-probability
@opindex fno-guess-branch-probability
@opindex fguess-branch-probability
+@item -fno-guess-branch-probability
Do not guess branch probabilities using heuristics.
GCC uses heuristics to guess branch probabilities if they are
The default is @option{-fguess-branch-probability} at levels
@option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
-@item -freorder-blocks
@opindex freorder-blocks
+@item -freorder-blocks
Reorder basic blocks in the compiled function in order to reduce number of
taken branches and improve code locality.
Enabled at levels @option{-O1}, @option{-O2}, @option{-O3}, @option{-Os}.
-@item -freorder-blocks-algorithm=@var{algorithm}
@opindex freorder-blocks-algorithm
+@item -freorder-blocks-algorithm=@var{algorithm}
Use the specified algorithm for basic block reordering. The
@var{algorithm} argument can be @samp{simple}, which does not increase
code size (except sometimes due to secondary effects like alignment),
The default is @samp{simple} at levels @option{-O1}, @option{-Os}, and
@samp{stc} at levels @option{-O2}, @option{-O3}.
-@item -freorder-blocks-and-partition
@opindex freorder-blocks-and-partition
+@item -freorder-blocks-and-partition
In addition to reordering basic blocks in the compiled function, in order
to reduce number of taken branches, partitions hot and cold basic blocks
into separate sections of the assembly and @file{.o} files, to improve
Enabled for x86 at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -freorder-functions
@opindex freorder-functions
+@item -freorder-functions
Reorder functions in the object file in order to
improve code locality. This is implemented by using special
subsections @code{.text.hot} for most frequently executed functions and
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fstrict-aliasing
@opindex fstrict-aliasing
+@item -fstrict-aliasing
Allow the compiler to assume the strictest aliasing rules applicable to
the language being compiled. For C (and C++), this activates
optimizations based on the type of expressions. In particular, an
The @option{-fstrict-aliasing} option is enabled at levels
@option{-O2}, @option{-O3}, @option{-Os}.
-@item -fipa-strict-aliasing
@opindex fipa-strict-aliasing
+@item -fipa-strict-aliasing
Controls whether rules of @option{-fstrict-aliasing} are applied across
function boundaries. Note that if multiple functions gets inlined into a
single function the memory accesses are no longer considered to be crossing a
The @option{-fipa-strict-aliasing} option is enabled by default and is
effective only in combination with @option{-fstrict-aliasing}.
+@opindex falign-functions
@item -falign-functions
@itemx -falign-functions=@var{n}
@itemx -falign-functions=@var{n}:@var{m}
@itemx -falign-functions=@var{n}:@var{m}:@var{n2}
@itemx -falign-functions=@var{n}:@var{m}:@var{n2}:@var{m2}
-@opindex falign-functions
Align the start of functions to the next power-of-two greater than or
equal to @var{n}, skipping up to @var{m}-1 bytes. This ensures that at
least the first @var{m} bytes of the function can be fetched by the CPU
by the amount specified by @option{-falign-functions}, but not to
skip more bytes than the size of the function.
+@opindex falign-labels
@item -falign-labels
@itemx -falign-labels=@var{n}
@itemx -falign-labels=@var{n}:@var{m}
@itemx -falign-labels=@var{n}:@var{m}:@var{n2}
@itemx -falign-labels=@var{n}:@var{m}:@var{n2}:@var{m2}
-@opindex falign-labels
Align all branch targets to a power-of-two boundary.
Parameters of this option are analogous to the @option{-falign-functions} option.
Enabled at levels @option{-O2}, @option{-O3}.
+@opindex falign-loops
@item -falign-loops
@itemx -falign-loops=@var{n}
@itemx -falign-loops=@var{n}:@var{m}
@itemx -falign-loops=@var{n}:@var{m}:@var{n2}
@itemx -falign-loops=@var{n}:@var{m}:@var{n2}:@var{m2}
-@opindex falign-loops
Align loops to a power-of-two boundary. If the loops are executed
many times, this makes up for any execution of the dummy padding
instructions.
Enabled at levels @option{-O2}, @option{-O3}.
+@opindex falign-jumps
@item -falign-jumps
@itemx -falign-jumps=@var{n}
@itemx -falign-jumps=@var{n}:@var{m}
@itemx -falign-jumps=@var{n}:@var{m}:@var{n2}
@itemx -falign-jumps=@var{n}:@var{m}:@var{n2}:@var{m2}
-@opindex falign-jumps
Align branch targets to a power-of-two boundary, for branch targets
where the targets can only be reached by jumping. In this case,
no dummy operations need be executed.
Enabled at levels @option{-O2}, @option{-O3}.
-@item -fno-allocation-dce
@opindex fno-allocation-dce
+@item -fno-allocation-dce
Do not remove unused C++ allocations in dead code elimination.
-@item -fallow-store-data-races
@opindex fallow-store-data-races
+@item -fallow-store-data-races
Allow the compiler to perform optimizations that may introduce new data races
on stores, without proving that the variable cannot be concurrently accessed
by other threads. Does not affect optimization of local data. It is safe to
Enabled at level @option{-Ofast}.
-@item -funit-at-a-time
@opindex funit-at-a-time
+@item -funit-at-a-time
This option is left for compatibility reasons. @option{-funit-at-a-time}
has no effect, while @option{-fno-unit-at-a-time} implies
@option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
Enabled by default.
-@item -fno-toplevel-reorder
@opindex fno-toplevel-reorder
@opindex ftoplevel-reorder
+@item -fno-toplevel-reorder
Do not reorder top-level functions, variables, and @code{asm}
statements. Output them in the same order that they appear in the
input file. When this option is used, unreferenced static variables
Additionally @option{-fno-toplevel-reorder} implies
@option{-fno-section-anchors}.
-@item -funreachable-traps
@opindex funreachable-traps
+@item -funreachable-traps
With this option, the compiler turns calls to
@code{__builtin_unreachable} into traps, instead of using them for
optimization. This also affects any such calls implicitly generated
This option is enabled by default at @option{-O0} and @option{-Og}.
-@item -fweb
@opindex fweb
+@item -fweb
Constructs webs as commonly used for register allocation purposes and assign
each web individual pseudo register. This allows the register allocation pass
to operate on pseudos directly, but also strengthens several other optimization
Enabled by default with @option{-funroll-loops}.
-@item -fwhole-program
@opindex fwhole-program
+@item -fwhole-program
Assume that the current compilation unit represents the whole program being
compiled. All public functions and variables with the exception of @code{main}
and those merged by attribute @code{externally_visible} become static functions
final code is produced (with @option{-flto}
@option{-flinker-output=nolto-rel}).
-@item -flto[=@var{n}]
@opindex flto
+@item -flto[=@var{n}]
This option runs the standard link-time optimizer. When invoked
with source code, it generates GIMPLE (one of GCC's internal
representations) and writes it to special ELF sections in the object
or otherwise fall back to autodetection of the number of CPU threads
present in your system.
-@item -flto-partition=@var{alg}
@opindex flto-partition
+@item -flto-partition=@var{alg}
Specify the partitioning algorithm used by the link-time optimizer.
The value is either @samp{1to1} to specify a partitioning mirroring
the original source files or @samp{balanced} to specify partitioning
used while the value @samp{none} bypasses partitioning and executes
the link-time optimization step directly from the WPA phase.
-@item -flto-compression-level=@var{n}
@opindex flto-compression-level
+@item -flto-compression-level=@var{n}
This option specifies the level of compression used for intermediate
language written to LTO object files, and is only meaningful in
conjunction with LTO mode (@option{-flto}). GCC currently supports two
of the supported values. If the option is not given,
a default balanced compression setting is used.
-@item -fuse-linker-plugin
@opindex fuse-linker-plugin
+@item -fuse-linker-plugin
Enables the use of a linker plugin during link-time optimization. This
option relies on plugin support in the linker, which is available in gold
or in GNU ld 2.21 or newer.
and GCC was configured for use with
a linker supporting plugins (GNU ld 2.21 or newer or gold).
-@item -ffat-lto-objects
@opindex ffat-lto-objects
+@item -ffat-lto-objects
Fat LTO objects are object files that contain both the intermediate language
and the object code. This makes them usable for both LTO linking and normal
linking. This option is effective only when compiling with @option{-flto}
The default is @option{-fno-fat-lto-objects} on targets with linker plugin
support.
-@item -fcompare-elim
@opindex fcompare-elim
+@item -fcompare-elim
After register allocation and post-register allocation instruction splitting,
identify arithmetic instructions that compute processor flags similar to a
comparison operation based on that arithmetic. If possible, eliminate the
Enabled at levels @option{-O1}, @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fcprop-registers
@opindex fcprop-registers
+@item -fcprop-registers
After register allocation and post-register allocation instruction splitting,
perform a copy-propagation pass to try to reduce scheduling dependencies
and occasionally eliminate the copy.
Enabled at levels @option{-O1}, @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fprofile-correction
@opindex fprofile-correction
+@item -fprofile-correction
Profiles collected using an instrumented binary for multi-threaded programs may
be inconsistent due to missed counter updates. When this option is specified,
GCC uses heuristics to correct or smooth out such inconsistencies. By
This option is enabled by @option{-fauto-profile}.
-@item -fprofile-partial-training
@opindex fprofile-partial-training
+@item -fprofile-partial-training
With @code{-fprofile-use} all portions of programs not executed during train
run are optimized agressively for size rather than speed. In some cases it is
not practical to train all possible hot paths in the program. (For
when train run is not representative but also leads to significantly bigger
code.
+@opindex fprofile-use
@item -fprofile-use
@itemx -fprofile-use=@var{path}
-@opindex fprofile-use
Enable profile feedback-directed optimizations,
and the following optimizations, many of which
are generally profitable only with profile feedback available:
If @var{path} is specified, GCC looks at the @var{path} to find
the profile feedback data files. See @option{-fprofile-dir}.
+@opindex fauto-profile
@item -fauto-profile
@itemx -fauto-profile=@var{path}
-@opindex fauto-profile
Enable sampling-based feedback-directed optimizations,
and the following optimizations,
many of which are generally profitable only with profile feedback available:
correctness. All must be specifically enabled.
@table @gcctabopt
-@item -ffloat-store
@opindex ffloat-store
+@item -ffloat-store
Do not store floating-point variables in registers, and inhibit other
options that might change whether a floating-point value is taken from a
register or memory.
point. Use @option{-ffloat-store} for such programs, after modifying
them to store all pertinent intermediate computations into variables.
-@item -fexcess-precision=@var{style}
@opindex fexcess-precision
+@item -fexcess-precision=@var{style}
This option allows further control over excess precision on machines
where floating-point operations occur in a format with more precision or
range than the IEEE standard and interchange floating-point types. By
semantics apply without excess precision, and in the latter, rounding
is unpredictable.
-@item -ffast-math
@opindex ffast-math
+@item -ffast-math
Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
@option{-ffinite-math-only}, @option{-fno-rounding-math},
@option{-fno-signaling-nans}, @option{-fcx-limited-range} and
for math functions. It may, however, yield faster code for programs
that do not require the guarantees of these specifications.
-@item -fno-math-errno
@opindex fno-math-errno
@opindex fmath-errno
+@item -fno-math-errno
Do not set @code{errno} after calling math functions that are executed
with a single instruction, e.g., @code{sqrt}. A program that relies on
IEEE exceptions for math error handling may want to use this flag
therefore no reason for the compiler to consider the possibility that
it might, and @option{-fno-math-errno} is the default.
-@item -funsafe-math-optimizations
@opindex funsafe-math-optimizations
+@item -funsafe-math-optimizations
Allow optimizations for floating-point arithmetic that (a) assume
that arguments and results are valid and (b) may violate IEEE or
The default is @option{-fno-unsafe-math-optimizations}.
-@item -fassociative-math
@opindex fassociative-math
+@item -fassociative-math
Allow re-association of operands in series of floating-point operations.
This violates the ISO C and C++ language standard by possibly changing
The default is @option{-fno-associative-math}.
-@item -freciprocal-math
@opindex freciprocal-math
+@item -freciprocal-math
Allow the reciprocal of a value to be used instead of dividing by
the value if this enables optimizations. For example @code{x / y}
The default is @option{-fno-reciprocal-math}.
-@item -ffinite-math-only
@opindex ffinite-math-only
+@item -ffinite-math-only
Allow optimizations for floating-point arithmetic that assume
that arguments and results are not NaNs or +-Infs.
The default is @option{-fno-finite-math-only}.
-@item -fno-signed-zeros
@opindex fno-signed-zeros
@opindex fsigned-zeros
+@item -fno-signed-zeros
Allow optimizations for floating-point arithmetic that ignore the
signedness of zero. IEEE arithmetic specifies the behavior of
distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
The default is @option{-fsigned-zeros}.
-@item -fno-trapping-math
@opindex fno-trapping-math
@opindex ftrapping-math
+@item -fno-trapping-math
Compile code assuming that floating-point operations cannot generate
user-visible traps. These traps include division by zero, overflow,
underflow, inexact result and invalid operation. This option requires
will be used along with @option{-frounding-math} to specify the
default state for @code{FENV_ACCESS}.
-@item -frounding-math
@opindex frounding-math
+@item -frounding-math
Disable transformations and optimizations that assume default floating-point
rounding behavior. This is round-to-zero for all floating point
to integer conversions, and round-to-nearest for all other arithmetic
will be used along with @option{-ftrapping-math} to specify the
default state for @code{FENV_ACCESS}.
-@item -fsignaling-nans
@opindex fsignaling-nans
+@item -fsignaling-nans
Compile code assuming that IEEE signaling NaNs may generate user-visible
traps during floating-point operations. Setting this option disables
optimizations that may change the number of exceptions visible with
This option is experimental and does not currently guarantee to
disable all GCC optimizations that affect signaling NaN behavior.
-@item -fno-fp-int-builtin-inexact
@opindex fno-fp-int-builtin-inexact
@opindex ffp-int-builtin-inexact
+@item -fno-fp-int-builtin-inexact
Do not allow the built-in functions @code{ceil}, @code{floor},
@code{round} and @code{trunc}, and their @code{float} and @code{long
double} variants, to generate code that raises the ``inexact''
generate a call to a library function then the ``inexact'' exception
may be raised if the library implementation does not follow TS 18661.
-@item -fsingle-precision-constant
@opindex fsingle-precision-constant
+@item -fsingle-precision-constant
Treat floating-point constants as single precision instead of
implicitly converting them to double-precision constants.
-@item -fcx-limited-range
@opindex fcx-limited-range
+@item -fcx-limited-range
When enabled, this option states that a range reduction step is not
needed when performing complex division. Also, there is no checking
whether the result of a complex multiplication or division is @code{NaN
@code{CX_LIMITED_RANGE} pragma. Nevertheless, the option applies to
all languages.
-@item -fcx-fortran-rules
@opindex fcx-fortran-rules
+@item -fcx-fortran-rules
Complex multiplication and division follow Fortran rules. Range
reduction is done as part of complex division, but there is no checking
whether the result of a complex multiplication or division is @code{NaN
section includes experimental options that may produce broken code.
@table @gcctabopt
-@item -fbranch-probabilities
@opindex fbranch-probabilities
+@item -fbranch-probabilities
After running a program compiled with @option{-fprofile-arcs}
(@pxref{Instrumentation Options}),
you can compile it a second time using
Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -fprofile-values
@opindex fprofile-values
+@item -fprofile-values
If combined with @option{-fprofile-arcs}, it adds code so that some
data about values of expressions in the program is gathered.
Enabled by @option{-fprofile-generate}, @option{-fprofile-use}, and
@option{-fauto-profile}.
-@item -fprofile-reorder-functions
@opindex fprofile-reorder-functions
+@item -fprofile-reorder-functions
Function reordering based on profile instrumentation collects
first time of execution of a function and orders these functions
in ascending order.
Enabled with @option{-fprofile-use}.
-@item -fvpt
@opindex fvpt
+@item -fvpt
If combined with @option{-fprofile-arcs}, this option instructs the compiler
to add code to gather information about values of expressions.
Enabled with @option{-fprofile-use} and @option{-fauto-profile}.
-@item -frename-registers
@opindex frename-registers
+@item -frename-registers
Attempt to avoid false dependencies in scheduled code by making use
of registers left over after register allocation. This optimization
most benefits processors with lots of registers. Depending on the
Enabled by default with @option{-funroll-loops}.
-@item -fschedule-fusion
@opindex fschedule-fusion
+@item -fschedule-fusion
Performs a target dependent pass over the instruction stream to schedule
instructions of same type together because target machine can execute them
more efficiently if they are adjacent to each other in the instruction flow.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
-@item -ftracer
@opindex ftracer
+@item -ftracer
Perform tail duplication to enlarge superblock size. This transformation
simplifies the control flow of the function allowing other optimizations to do
a better job.
Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -funroll-loops
@opindex funroll-loops
+@item -funroll-loops
Unroll loops whose number of iterations can be determined at compile time or
upon entry to the loop. @option{-funroll-loops} implies
@option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -funroll-all-loops
@opindex funroll-all-loops
+@item -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 -fpeel-loops
@opindex fpeel-loops
+@item -fpeel-loops
Peels loops for which there is enough information that they do not
roll much (from profile feedback or static analysis). It also turns on
complete loop peeling (i.e.@: complete removal of loops with small constant
Enabled by @option{-O3}, @option{-fprofile-use}, and @option{-fauto-profile}.
-@item -fmove-loop-invariants
@opindex fmove-loop-invariants
+@item -fmove-loop-invariants
Enables the loop invariant motion pass in the RTL loop optimizer. Enabled
at level @option{-O1} and higher, except for @option{-Og}.
-@item -fmove-loop-stores
@opindex fmove-loop-stores
+@item -fmove-loop-stores
Enables the loop store motion pass in the GIMPLE loop optimizer. This
moves invariant stores to after the end of the loop in exchange for
carrying the stored value in a register across the iteration.
be enabled as well. Enabled at level @option{-O1} and higher, except
for @option{-Og}.
-@item -fsplit-loops
@opindex fsplit-loops
+@item -fsplit-loops
Split a loop into two if it contains a condition that's always true
for one side of the iteration space and false for the other.
Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -funswitch-loops
@opindex funswitch-loops
+@item -funswitch-loops
Move branches with loop invariant conditions out of the loop, with duplicates
of the loop on both branches (modified according to result of the condition).
Enabled by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -fversion-loops-for-strides
@opindex fversion-loops-for-strides
+@item -fversion-loops-for-strides
If a loop iterates over an array with a variable stride, create another
version of the loop that assumes the stride is always one. For example:
This flag is enabled by default at @option{-O3}.
It is also enabled by @option{-fprofile-use} and @option{-fauto-profile}.
-@item -ffunction-sections
-@itemx -fdata-sections
@opindex ffunction-sections
@opindex fdata-sections
+@item -ffunction-sections
+@itemx -fdata-sections
Place each function or data item into its own section in the output
file if the target supports arbitrary sections. The name of the
function or the name of the data item determines the section's name
link time. An example of such an optimization is relaxing calls to short call
instructions.
-@item -fstdarg-opt
@opindex fstdarg-opt
+@item -fstdarg-opt
Optimize the prologue of variadic argument functions with respect to usage of
those arguments.
-@item -fsection-anchors
@opindex fsection-anchors
+@item -fsection-anchors
Try to reduce the number of symbolic address calculations by using
shared ``anchor'' symbols to address nearby objects. This transformation
can help to reduce the number of GOT entries and GOT accesses on some
Not all targets support this option.
-@item -fzero-call-used-regs=@var{choice}
@opindex fzero-call-used-regs
+@item -fzero-call-used-regs=@var{choice}
Zero call-used registers at function return to increase program
security by either mitigating Return-Oriented Programming (ROP)
attacks or preventing information leakage through registers.
You can control this behavior for a specific function by using the function
attribute @code{zero_call_used_regs} (@pxref{Function Attributes}).
-@item --param @var{name}=@var{value}
@opindex param
+@item --param @var{name}=@var{value}
In some places, GCC uses various constants to control the amount of
optimization that is done. For example, GCC does not inline functions
that contain more than a certain number of instructions. You can
@table @gcctabopt
@cindex @command{prof}
@cindex @command{gprof}
-@item -p
-@itemx -pg
@opindex p
@opindex pg
+@item -p
+@itemx -pg
Generate extra code to write profile information suitable for the
analysis program @command{prof} (for @option{-p}) or @command{gprof}
(for @option{-pg}). You must use this option when compiling
suppress profiling of individual functions when compiling with these options.
@xref{Common Function Attributes}.
-@item -fprofile-arcs
@opindex fprofile-arcs
+@item -fprofile-arcs
Add code so that program flow @dfn{arcs} are instrumented. During
execution the program records how many times each branch and call is
executed and how many times it is taken or returns. On targets that support
@xref{Cross-profiling}.
@cindex @command{gcov}
-@item --coverage
@opindex coverage
+@item --coverage
This option is used to compile and link code instrumented for coverage
analysis. The option is a synonym for @option{-fprofile-arcs}
block must be created to hold the instrumentation code.
@need 2000
-@item -ftest-coverage
@opindex ftest-coverage
+@item -ftest-coverage
Produce a notes file that the @command{gcov} code-coverage utility
(@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
show program coverage. Each source file's note file is called
generate test coverage data. Coverage data matches the source files
more closely if you do not optimize.
-@item -fprofile-abs-path
@opindex fprofile-abs-path
+@item -fprofile-abs-path
Automatically convert relative source file names to absolute path names
in the @file{.gcno} files. This allows @command{gcov} to find the correct
sources in projects where compilations occur with different working
directories.
-@item -fprofile-dir=@var{path}
@opindex fprofile-dir
+@item -fprofile-dir=@var{path}
Set the directory to search for the profile data files in to @var{path}.
This option affects only the profile data generated by
@end table
+@opindex fprofile-generate
@item -fprofile-generate
@itemx -fprofile-generate=@var{path}
-@opindex fprofile-generate
Enable options usually used for instrumenting application to produce
profile useful for later recompilation with profile feedback based
To optimize the program based on the collected profile information, use
@option{-fprofile-use}. @xref{Optimize Options}, for more information.
+@opindex fprofile-info-section
@item -fprofile-info-section
@itemx -fprofile-info-section=@var{name}
-@opindex fprofile-info-section
Register the profile information in the specified section instead of using a
constructor/destructor. The section name is @var{name} if it is specified,
@code{__gcov_info_to_gcda} functions and merge the profile information into
@file{.gcda} files on the host filesystem.
-@item -fprofile-note=@var{path}
@opindex fprofile-note
+@item -fprofile-note=@var{path}
If @var{path} is specified, GCC saves @file{.gcno} file into @var{path}
location. If you combine the option with multiple source files,
the @file{.gcno} file will be overwritten.
-@item -fprofile-prefix-path=@var{path}
@opindex fprofile-prefix-path
+@item -fprofile-prefix-path=@var{path}
This option can be used in combination with
@option{profile-generate=}@var{profile_dir} and
pointing to the base directory of the build can be used to strip the irrelevant
part of the path and keep all file names relative to the main build directory.
-@item -fprofile-prefix-map=@var{old}=@var{new}
@opindex fprofile-prefix-map
+@item -fprofile-prefix-map=@var{old}=@var{new}
When compiling files residing in directory @file{@var{old}}, record
profiling information (with @option{--coverage})
describing them as if the files resided in
directory @file{@var{new}} instead.
See also @option{-ffile-prefix-map}.
-@item -fprofile-update=@var{method}
@opindex fprofile-update
+@item -fprofile-update=@var{method}
Alter the update method for an application instrumented for profile
feedback based optimization. The @var{method} argument should be one of
automatically selects @samp{prefer-atomic} when @option{-pthread}
is present in the command line.
-@item -fprofile-filter-files=@var{regex}
@opindex fprofile-filter-files
+@item -fprofile-filter-files=@var{regex}
Instrument only functions from files whose name matches
any of the regular expressions (separated by semi-colons).
For example, @option{-fprofile-filter-files=main\.c;module.*\.c} will instrument
only @file{main.c} and all C files starting with 'module'.
-@item -fprofile-exclude-files=@var{regex}
@opindex fprofile-exclude-files
+@item -fprofile-exclude-files=@var{regex}
Instrument only functions from files whose name does not match
any of the regular expressions (separated by semi-colons).
For example, @option{-fprofile-exclude-files=/usr/.*} will prevent instrumentation
of all files that are located in the @file{/usr/} folder.
-@item -fprofile-reproducible=@r{[}multithreaded@r{|}parallel-runs@r{|}serial@r{]}
@opindex fprofile-reproducible
+@item -fprofile-reproducible=@r{[}multithreaded@r{|}parallel-runs@r{|}serial@r{]}
Control level of reproducibility of profile gathered by
@code{-fprofile-generate}. This makes it possible to rebuild program
with same outcome which is useful, for example, for distribution
reduces quality of gathered data, in particular of indirect call
profiling.
-@item -fsanitize=address
@opindex fsanitize=address
+@item -fsanitize=address
Enable AddressSanitizer, a fast memory error detector.
Memory access instructions are instrumented to detect
out-of-bounds and use-after-free bugs.
The option cannot be combined with @option{-fsanitize=thread} or
@option{-fsanitize=address}, and is currently only available on AArch64.
-@item -fsanitize=kernel-hwaddress
@opindex fsanitize=kernel-hwaddress
+@item -fsanitize=kernel-hwaddress
Enable Hardware-assisted AddressSanitizer for compilation of the Linux kernel.
Similar to @option{-fsanitize=kernel-address} but using an alternate
instrumentation method, and similar to @option{-fsanitize=hwaddress} but with
@option{--param hwasan-instrument-allocas=1} respectively. Using a random frame
tag is not implemented for kernel instrumentation.
-@item -fsanitize=pointer-compare
@opindex fsanitize=pointer-compare
+@item -fsanitize=pointer-compare
Instrument comparison operation (<, <=, >, >=) with pointer operands.
The option must be combined with either @option{-fsanitize=kernel-address} or
@option{-fsanitize=address}
@env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
invalid operation only when both pointers are non-null.
-@item -fsanitize=pointer-subtract
@opindex fsanitize=pointer-subtract
+@item -fsanitize=pointer-subtract
Instrument subtraction with pointer operands.
The option must be combined with either @option{-fsanitize=kernel-address} or
@option{-fsanitize=address}
@env{ASAN_OPTIONS}. Using @code{detect_invalid_pointer_pairs=1} detects
invalid operation only when both pointers are non-null.
-@item -fsanitize=shadow-call-stack
@opindex fsanitize=shadow-call-stack
+@item -fsanitize=shadow-call-stack
Enable ShadowCallStack, a security enhancement mechanism used to protect
programs against return address overwrites (e.g. stack buffer overflows.)
It works by saving a function's return address to a separately allocated
See @uref{https://clang.llvm.org/docs/ShadowCallStack.html} for more
details.
-@item -fsanitize=thread
@opindex fsanitize=thread
+@item -fsanitize=thread
Enable ThreadSanitizer, a fast data race detector.
Memory access instructions are instrumented to detect
data race bugs. See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
operating on invalid memory addresses with non-call exceptions
(@option{-fnon-call-exceptions}).
-@item -fsanitize=leak
@opindex fsanitize=leak
+@item -fsanitize=leak
Enable LeakSanitizer, a memory leak detector.
This option only matters for linking of executables and
the executable is linked against a library that overrides @code{malloc}
@env{LSAN_OPTIONS} environment variable.
The option cannot be combined with @option{-fsanitize=thread}.
-@item -fsanitize=undefined
@opindex fsanitize=undefined
+@item -fsanitize=undefined
Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
Various computations are instrumented to detect undefined behavior
at runtime. See @uref{https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html} for more details. The run-time behavior can be influenced using the
@table @gcctabopt
-@item -fsanitize=shift
@opindex fsanitize=shift
+@item -fsanitize=shift
This option enables checking that the result of a shift operation is
not undefined. Note that what exactly is considered undefined differs
slightly between C and C++, as well as between ISO C90 and C99, etc.
This option has two suboptions, @option{-fsanitize=shift-base} and
@option{-fsanitize=shift-exponent}.
-@item -fsanitize=shift-exponent
@opindex fsanitize=shift-exponent
+@item -fsanitize=shift-exponent
This option enables checking that the second argument of a shift operation
is not negative and is smaller than the precision of the promoted first
argument.
-@item -fsanitize=shift-base
@opindex fsanitize=shift-base
+@item -fsanitize=shift-base
If the second argument of a shift operation is within range, check that the
result of a shift operation is not undefined. Note that what exactly is
considered undefined differs slightly between C and C++, as well as between
ISO C90 and C99, etc.
-@item -fsanitize=integer-divide-by-zero
@opindex fsanitize=integer-divide-by-zero
+@item -fsanitize=integer-divide-by-zero
Detect integer division by zero.
-@item -fsanitize=unreachable
@opindex fsanitize=unreachable
+@item -fsanitize=unreachable
With this option, the compiler turns the @code{__builtin_unreachable}
call into a diagnostics message call instead. When reaching the
@code{__builtin_unreachable} call, the behavior is undefined.
-@item -fsanitize=vla-bound
@opindex fsanitize=vla-bound
+@item -fsanitize=vla-bound
This option instructs the compiler to check that the size of a variable
length array is positive.
-@item -fsanitize=null
@opindex fsanitize=null
+@item -fsanitize=null
This option enables pointer checking. Particularly, the application
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
rvalue reference) is bound to a NULL pointer, or if a method is invoked
on an object pointed by a NULL pointer.
-@item -fsanitize=return
@opindex fsanitize=return
+@item -fsanitize=return
This option enables return statement checking. Programs
built with this option turned on will issue an error message
when the end of a non-void function is reached without actually
returning a value. This option works in C++ only.
-@item -fsanitize=signed-integer-overflow
@opindex fsanitize=signed-integer-overflow
+@item -fsanitize=signed-integer-overflow
This option enables signed integer overflow checking. We check that
the result of @code{+}, @code{*}, and both unary and binary @code{-}
does not overflow in the signed arithmetics. This also detects
a++;
@end smallexample
-@item -fsanitize=bounds
@opindex fsanitize=bounds
+@item -fsanitize=bounds
This option enables instrumentation of array bounds. Various out of bounds
accesses are detected. Flexible array members, flexible array member-like
arrays, and initializers of variables with static storage are not instrumented.
-@item -fsanitize=bounds-strict
@opindex fsanitize=bounds-strict
+@item -fsanitize=bounds-strict
This option enables strict instrumentation of array bounds. Most out of bounds
accesses are detected, including flexible array members and flexible array
member-like arrays. Initializers of variables with static storage are not
instrumented.
-@item -fsanitize=alignment
@opindex fsanitize=alignment
+@item -fsanitize=alignment
This option enables checking of alignment of pointers when they are
dereferenced, or when a reference is bound to insufficiently aligned target,
or when a method or constructor is invoked on insufficiently aligned object.
-@item -fsanitize=object-size
@opindex fsanitize=object-size
+@item -fsanitize=object-size
This option enables instrumentation of memory references using the
@code{__builtin_dynamic_object_size} function. Various out of bounds
pointer accesses are detected.
-@item -fsanitize=float-divide-by-zero
@opindex fsanitize=float-divide-by-zero
+@item -fsanitize=float-divide-by-zero
Detect floating-point division by zero. Unlike other similar options,
@option{-fsanitize=float-divide-by-zero} is not enabled by
@option{-fsanitize=undefined}, since floating-point division by zero can
be a legitimate way of obtaining infinities and NaNs.
-@item -fsanitize=float-cast-overflow
@opindex fsanitize=float-cast-overflow
+@item -fsanitize=float-cast-overflow
This option enables floating-point type to integer conversion checking.
We check that the result of the conversion does not overflow.
Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
not enabled by @option{-fsanitize=undefined}.
This option does not work well with @code{FE_INVALID} exceptions enabled.
-@item -fsanitize=nonnull-attribute
@opindex fsanitize=nonnull-attribute
+@item -fsanitize=nonnull-attribute
This option enables instrumentation of calls, checking whether null values
are not passed to arguments marked as requiring a non-null value by the
@code{nonnull} function attribute.
-@item -fsanitize=returns-nonnull-attribute
@opindex fsanitize=returns-nonnull-attribute
+@item -fsanitize=returns-nonnull-attribute
This option enables instrumentation of return statements in functions
marked with @code{returns_nonnull} function attribute, to detect returning
of null values from such functions.
-@item -fsanitize=bool
@opindex fsanitize=bool
+@item -fsanitize=bool
This option enables instrumentation of loads from bool. If a value other
than 0/1 is loaded, a run-time error is issued.
-@item -fsanitize=enum
@opindex fsanitize=enum
+@item -fsanitize=enum
This option enables instrumentation of loads from an enum type. If
a value outside the range of values for the enum type is loaded,
a run-time error is issued.
-@item -fsanitize=vptr
@opindex fsanitize=vptr
+@item -fsanitize=vptr
This option enables instrumentation of C++ member function calls, member
accesses and some conversions between pointers to base and derived classes,
to verify the referenced object has the correct dynamic type.
-@item -fsanitize=pointer-overflow
@opindex fsanitize=pointer-overflow
+@item -fsanitize=pointer-overflow
This option enables instrumentation of pointer arithmetics. If the pointer
arithmetics overflows, a run-time error is issued.
-@item -fsanitize=builtin
@opindex fsanitize=builtin
+@item -fsanitize=builtin
This option enables instrumentation of arguments to selected builtin
functions. If an invalid value is passed to such arguments, a run-time
@option{-fsanitize=undefined} gives a diagnostic message.
This currently works only for the C family of languages.
-@item -fno-sanitize=all
@opindex fno-sanitize=all
+@item -fno-sanitize=all
This option disables all previously enabled sanitizers.
@option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
together.
-@item -fasan-shadow-offset=@var{number}
@opindex fasan-shadow-offset
+@item -fasan-shadow-offset=@var{number}
This option forces GCC to use custom shadow offset in AddressSanitizer checks.
It is useful for experimenting with different shadow memory layouts in
Kernel AddressSanitizer.
-@item -fsanitize-sections=@var{s1},@var{s2},...
@opindex fsanitize-sections
+@item -fsanitize-sections=@var{s1},@var{s2},...
Sanitize global variables in selected user-defined sections. @var{si} may
contain wildcards.
-@item -fsanitize-recover@r{[}=@var{opts}@r{]}
@opindex fsanitize-recover
@opindex fno-sanitize-recover
+@item -fsanitize-recover@r{[}=@var{opts}@r{]}
@option{-fsanitize-recover=} controls error recovery mode for sanitizers
mentioned in comma-separated list of @var{opts}. Enabling this option
for a sanitizer component causes it to attempt to continue
undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
@end smallexample
-@item -fsanitize-address-use-after-scope
@opindex fsanitize-address-use-after-scope
+@item -fsanitize-address-use-after-scope
Enable sanitization of local variables to detect use-after-scope bugs.
The option sets @option{-fstack-reuse} to @samp{none}.
-@item -fsanitize-trap@r{[}=@var{opts}@r{]}
@opindex fsanitize-trap
@opindex fno-sanitize-trap
+@item -fsanitize-trap@r{[}=@var{opts}@r{]}
The @option{-fsanitize-trap=} option instructs the compiler to
report for sanitizers mentioned in comma-separated list of @var{opts}
undefined behavior using @code{__builtin_trap} rather than a @code{libubsan}
instrumentation is silently ignored as the instrumentation always needs
@code{libubsan} support, @option{-fsanitize-trap=vptr} is not allowed.
-@item -fsanitize-undefined-trap-on-error
@opindex fsanitize-undefined-trap-on-error
+@item -fsanitize-undefined-trap-on-error
The @option{-fsanitize-undefined-trap-on-error} option is deprecated
equivalent of @option{-fsanitize-trap=all}.
-@item -fsanitize-coverage=trace-pc
@opindex fsanitize-coverage=trace-pc
+@item -fsanitize-coverage=trace-pc
Enable coverage-guided fuzzing code instrumentation.
Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
-@item -fsanitize-coverage=trace-cmp
@opindex fsanitize-coverage=trace-cmp
+@item -fsanitize-coverage=trace-cmp
Enable dataflow guided fuzzing code instrumentation.
Inserts a call to @code{__sanitizer_cov_trace_cmp1},
@code{__sanitizer_cov_trace_cmp2}, @code{__sanitizer_cov_trace_cmp4} or
@code{__sanitizer_cov_trace_cmpd} for float or double comparisons and
@code{__sanitizer_cov_trace_switch} for switch statements.
-@item -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{|}check@r{]}
@opindex fcf-protection
+@item -fcf-protection=@r{[}full@r{|}branch@r{|}return@r{|}none@r{|}check@r{]}
Enable code instrumentation of control-flow transfers to increase
program security by checking that target addresses of control-flow
transfer instructions (such as indirect function call, function return,
on Intel Control-flow Enforcement Technology (CET) which works for
i686 processor or newer.
-@item -fharden-compares
@opindex fharden-compares
+@item -fharden-compares
For every logical test that survives gimple optimizations and is
@emph{not} the condition in a conditional branch (for example,
conditions tested for conditional moves, or to store in boolean
match. Use with @samp{-fharden-conditional-branches} to cover all
conditionals.
-@item -fharden-conditional-branches
@opindex fharden-conditional-branches
+@item -fharden-conditional-branches
For every non-vectorized conditional branch that survives gimple
optimizations, emit extra code to compute and verify the reversed
condition, and to call @code{__builtin_trap} if the result is
unexpected. Use with @samp{-fharden-compares} to cover all
conditionals.
-@item -fstack-protector
@opindex fstack-protector
+@item -fstack-protector
Emit extra code to check for buffer overflows, such as stack smashing
attacks. This is done by adding a guard variable to functions with
vulnerable objects. This includes functions that call @code{alloca}, and
considered, optimized away variables or variables allocated in registers
don't count.
-@item -fstack-protector-all
@opindex fstack-protector-all
+@item -fstack-protector-all
Like @option{-fstack-protector} except that all functions are protected.
-@item -fstack-protector-strong
@opindex fstack-protector-strong
+@item -fstack-protector-strong
Like @option{-fstack-protector} but includes additional functions to
be protected --- those that have local array definitions, or have
references to local frame addresses. Only variables that are actually
allocated on the stack are considered, optimized away variables or variables
allocated in registers don't count.
-@item -fstack-protector-explicit
@opindex fstack-protector-explicit
+@item -fstack-protector-explicit
Like @option{-fstack-protector} but only protects those functions which
have the @code{stack_protect} attribute.
-@item -fstack-check
@opindex fstack-check
+@item -fstack-check
Generate code to verify that you do not go beyond the boundary of the
stack. You should specify this flag if you are running in an
environment with multiple threads, but you only rarely need to specify it in
Ada code. It is not generally sufficient to protect against stack-clash
attacks. To protect against those you want @samp{-fstack-clash-protection}.
-@item -fstack-clash-protection
@opindex fstack-clash-protection
+@item -fstack-clash-protection
Generate code to prevent stack clash style attacks. When this option is
enabled, the compiler will only allocate one page of stack space at a time
and each page is accessed immediately after allocation. Thus, it prevents
protection for static stack allocations if the target supports
@option{-fstack-check=specific}.
-@item -fstack-limit-register=@var{reg}
-@itemx -fstack-limit-symbol=@var{sym}
-@itemx -fno-stack-limit
@opindex fstack-limit-register
@opindex fstack-limit-symbol
@opindex fno-stack-limit
+@item -fstack-limit-register=@var{reg}
+@itemx -fstack-limit-symbol=@var{sym}
+@itemx -fno-stack-limit
Generate code to ensure that the stack does not grow beyond a certain value,
either the value of a register or the address of a symbol. If a larger
stack is required, a signal is raised at run time. For most targets,
You can locally override stack limit checking by using the
@code{no_stack_limit} function attribute (@pxref{Function Attributes}).
-@item -fsplit-stack
@opindex fsplit-stack
+@item -fsplit-stack
Generate code to automatically split the stack before it overflows.
The resulting program has a discontiguous stack which can only
overflow if the program is unable to allocate any more memory. This
this is implemented in the gold linker in GNU binutils release 2.21
and later.
-@item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
@opindex fvtable-verify
+@item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
This option is only available when compiling C++ code.
It turns on (or off, if using @option{-fvtable-verify=none}) the security
feature that verifies at run time, for every virtual call, that
values specified, @samp{none} takes highest priority over both @samp{std} and
@samp{preinit}; @samp{preinit} takes priority over @samp{std}.
-@item -fvtv-debug
@opindex fvtv-debug
+@item -fvtv-debug
When used in conjunction with @option{-fvtable-verify=std} or
@option{-fvtable-verify=preinit}, causes debug versions of the
runtime functions for the vtable verification feature to be called.
Note: This feature @emph{appends} data to the log file. If you want a fresh log
file, be sure to delete any existing one.
-@item -fvtv-counts
@opindex fvtv-counts
+@item -fvtv-counts
This is a debugging flag. When used in conjunction with
@option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
causes the compiler to keep track of the total number of virtual calls
Note: This feature @emph{appends} data to the log files. To get fresh log
files, be sure to delete any existing ones.
-@item -finstrument-functions
@opindex finstrument-functions
+@item -finstrument-functions
Generate instrumentation calls for entry and exit to functions. Just
after function entry and just before function exit, the following
profiling functions are called with the address of the current
routines generate output or allocate memory).
@xref{Common Function Attributes}.
-@item -finstrument-functions-once
@opindex finstrument-functions-once
+@item -finstrument-functions-once
This is similar to @option{-finstrument-functions}, but the profiling
functions are called only once per instrumented function, i.e. the first
profiling function is called after the first entry into the instrumented
thread calls the first function, then it will call the second function,
unless it never reaches the exit of the instrumented function.
-@item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
@opindex finstrument-functions-exclude-file-list
+@item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
Set the list of functions that are excluded from instrumentation (see
the description of @option{-finstrument-functions}). If the file that
@option{-finstrument-functions-exclude-file-list='\,\,tmp'}
(note the single quote surrounding the option).
-@item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
@opindex finstrument-functions-exclude-function-list
+@item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
This is similar to @option{-finstrument-functions-exclude-file-list},
but this option sets the list of function names to be excluded from
extended identifiers, the function name must be given in UTF-8, not
using universal character names.
-@item -fpatchable-function-entry=@var{N}[,@var{M}]
@opindex fpatchable-function-entry
+@item -fpatchable-function-entry=@var{N}[,@var{M}]
Generate @var{N} NOPs right at the beginning
of each function, with the function entry point before the @var{M}th NOP.
If @var{M} is omitted, it defaults to @code{0} so the
@table @gcctabopt
@include cppopts.texi
-@item -Wp,@var{option}
@opindex Wp
+@item -Wp,@var{option}
You can use @option{-Wp,@var{option}} to bypass the compiler driver
and pass @var{option} directly through to the preprocessor. If
@var{option} contains commas, it is split into multiple options at the
you should avoid using @option{-Wp} and let the driver handle the
options instead.
-@item -Xpreprocessor @var{option}
@opindex Xpreprocessor
+@item -Xpreprocessor @var{option}
Pass @var{option} as an option to the preprocessor. You can use this to
supply system-specific preprocessor options that GCC does not
recognize.
If you want to pass an option that takes an argument, you must use
@option{-Xpreprocessor} twice, once for the option and once for the argument.
-@item -no-integrated-cpp
@opindex no-integrated-cpp
+@item -no-integrated-cpp
Perform preprocessing as a separate pass before compilation.
By default, GCC performs preprocessing as an integrated part of
input tokenization and parsing.
perform additional processing of the program source between
normal preprocessing and compilation.
-@item -flarge-source-files
@opindex flarge-source-files
+@item -flarge-source-files
Adjust GCC to expect large source files, at the expense of slower
compilation and higher memory usage.
You can pass options to the assembler.
@table @gcctabopt
-@item -Wa,@var{option}
@opindex Wa
+@item -Wa,@var{option}
Pass @var{option} as an option to the assembler. If @var{option}
contains commas, it is split into multiple options at the commas.
-@item -Xassembler @var{option}
@opindex Xassembler
+@item -Xassembler @var{option}
Pass @var{option} as an option to the assembler. You can use this to
supply system-specific assembler options that GCC does not
recognize.
contents.) If linking is done, these object files are used as input
to the linker.
-@item -c
-@itemx -S
-@itemx -E
@opindex c
@opindex S
@opindex E
+@item -c
+@itemx -S
+@itemx -E
If any of these options is used, then the linker is not run, and
object file names should not be used as arguments. @xref{Overall
Options}.
-@item -flinker-output=@var{type}
@opindex flinker-output
+@item -flinker-output=@var{type}
This option controls code generation of the link-time optimizer. By
default the linker output is automatically determined by the linker
plugin. For debugging the compiler and if incremental linking with a
recommended to link such objects into static library instead. Alternatively it
is possible to use H.J. Lu's binutils with support for mixed objects.
-@item -fuse-ld=bfd
@opindex fuse-ld=bfd
+@item -fuse-ld=bfd
Use the @command{bfd} linker instead of the default linker.
-@item -fuse-ld=gold
@opindex fuse-ld=gold
+@item -fuse-ld=gold
Use the @command{gold} linker instead of the default linker.
-@item -fuse-ld=lld
@opindex fuse-ld=lld
+@item -fuse-ld=lld
Use the LLVM @command{lld} linker instead of the default linker.
-@item -fuse-ld=mold
@opindex fuse-ld=mold
+@item -fuse-ld=mold
Use the Modern Linker (@command{mold}) instead of the default linker.
@cindex Libraries
+@opindex l
@item -l@var{library}
@itemx -l @var{library}
-@opindex l
Search the library named @var{library} when linking. (The second
alternative with the library as a separate argument is only for
POSIX compliance and is not recommended.)
after file @file{foo.o} but before @file{bar.o}. If @file{bar.o} refers
to functions in @samp{z}, those functions may not be loaded.
-@item -lobjc
@opindex lobjc
+@item -lobjc
You need this special case of the @option{-l} option in order to
link an Objective-C or Objective-C++ program.
-@item -nostartfiles
@opindex nostartfiles
+@item -nostartfiles
Do not use the standard system startup files when linking.
The standard system libraries are used normally, unless @option{-nostdlib},
@option{-nolibc}, or @option{-nodefaultlibs} is used.
-@item -nodefaultlibs
@opindex nodefaultlibs
+@item -nodefaultlibs
Do not use the standard system libraries when linking.
Only the libraries you specify are passed to the linker, and options
specifying linkage of the system libraries, such as @option{-static-libgcc}
libc. These entry points should be supplied through some other
mechanism when this option is specified.
-@item -nolibc
@opindex nolibc
+@item -nolibc
Do not use the C library or system libraries tightly coupled with it when
linking. Still link with the startup files, @file{libgcc} or toolchain
provided language support libraries such as @file{libgnat}, @file{libgfortran}
@option{-lm} in some configurations. This is intended for bare-board
targets when there is indeed no C library available.
-@item -nostdlib
@opindex nostdlib
+@item -nostdlib
Do not use the standard system startup files or libraries when linking.
No startup files and only the libraries you specify are passed to
the linker, and options specifying linkage of the system libraries, such as
constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
GNU Compiler Collection (GCC) Internals}.)
-@item -nostdlib++
@opindex nostdlib++
+@item -nostdlib++
Do not implicitly link with standard C++ libraries.
-@item -e @var{entry}
-@itemx --entry=@var{entry}
@opindex e
@opindex entry
+@item -e @var{entry}
+@itemx --entry=@var{entry}
Specify that the program entry point is @var{entry}. The argument is
interpreted by the linker; the GNU linker accepts either a symbol name
or an address.
-@item -pie
@opindex pie
+@item -pie
Produce a dynamically linked position independent executable on targets
that support it. For predictable results, you must also specify the same
set of options used for compilation (@option{-fpie}, @option{-fPIE},
or model suboptions) when you specify this linker option.
-@item -no-pie
@opindex no-pie
+@item -no-pie
Don't produce a dynamically linked position independent executable.
-@item -static-pie
@opindex static-pie
+@item -static-pie
Produce a static position independent executable on targets that support
it. A static position independent executable is similar to a static
executable, but can be loaded at any address without a dynamic linker.
used for compilation (@option{-fpie}, @option{-fPIE}, or model
suboptions) when you specify this linker option.
-@item -pthread
@opindex pthread
+@item -pthread
Link with the POSIX threads library. This option is supported on
GNU/Linux targets, most other Unix derivatives, and also on
x86 Cygwin and MinGW targets. On some targets this option also sets
flags for the preprocessor, so it should be used consistently for both
compilation and linking.
-@item -r
@opindex r
+@item -r
Produce a relocatable object as output. This is also known as partial
linking.
-@item -rdynamic
@opindex rdynamic
+@item -rdynamic
Pass the flag @option{-export-dynamic} to the ELF linker, on targets
that support it. This instructs the linker to add all symbols, not
only used ones, to the dynamic symbol table. This option is needed
for some uses of @code{dlopen} or to allow obtaining backtraces
from within a program.
-@item -s
@opindex s
+@item -s
Remove all symbol table and relocation information from the executable.
-@item -static
@opindex static
+@item -static
On systems that support dynamic linking, this overrides @option{-pie}
and prevents linking with the shared libraries. On other systems, this
option has no effect.
-@item -shared
@opindex shared
+@item -shared
Produce a shared object which can then be linked with other objects to
form an executable. Not all systems support this option. For predictable
results, you must also specify the same set of options used for compilation
to alter the floating-point environment as done with @option{-ffast-math},
@option{-Ofast} or @option{-funsafe-math-optimizations} on some targets.}
-@item -shared-libgcc
-@itemx -static-libgcc
@opindex shared-libgcc
@opindex static-libgcc
+@item -shared-libgcc
+@itemx -static-libgcc
On systems that provide @file{libgcc} as a shared library, these options
force the use of either the shared or static version, respectively.
If no shared version of @file{libgcc} was built when the compiler was
@option{-shared-libgcc}, such that it is linked with the shared
@file{libgcc}.
-@item -static-libasan
@opindex static-libasan
+@item -static-libasan
When the @option{-fsanitize=address} option is used to link a program,
the GCC driver automatically links against @option{libasan}. If
@file{libasan} is available as a shared library, and the @option{-static}
driver to link @file{libasan} statically, without necessarily linking
other libraries statically.
-@item -static-libtsan
@opindex static-libtsan
+@item -static-libtsan
When the @option{-fsanitize=thread} option is used to link a program,
the GCC driver automatically links against @option{libtsan}. If
@file{libtsan} is available as a shared library, and the @option{-static}
driver to link @file{libtsan} statically, without necessarily linking
other libraries statically.
-@item -static-liblsan
@opindex static-liblsan
+@item -static-liblsan
When the @option{-fsanitize=leak} option is used to link a program,
the GCC driver automatically links against @option{liblsan}. If
@file{liblsan} is available as a shared library, and the @option{-static}
driver to link @file{liblsan} statically, without necessarily linking
other libraries statically.
-@item -static-libubsan
@opindex static-libubsan
+@item -static-libubsan
When the @option{-fsanitize=undefined} option is used to link a program,
the GCC driver automatically links against @option{libubsan}. If
@file{libubsan} is available as a shared library, and the @option{-static}
driver to link @file{libubsan} statically, without necessarily linking
other libraries statically.
-@item -static-libstdc++
@opindex static-libstdc++
+@item -static-libstdc++
When the @command{g++} program is used to link a C++ program, it
normally automatically links against @option{libstdc++}. If
@file{libstdc++} is available as a shared library, and the
link @file{libstdc++} statically, without necessarily linking other
libraries statically.
-@item -symbolic
@opindex symbolic
+@item -symbolic
Bind references to global symbols when building a shared object. Warn
about any unresolved references (unless overridden by the link editor
option @option{-Xlinker -z -Xlinker defs}). Only a few systems support
this option.
-@item -T @var{script}
@opindex T
+@item -T @var{script}
@cindex linker script
Use @var{script} as the linker script. This option is supported by most
systems using the GNU linker. On some targets, such as bare-board
targets without an operating system, the @option{-T} option may be required
when linking to avoid references to undefined symbols.
-@item -Xlinker @var{option}
@opindex Xlinker
+@item -Xlinker @var{option}
Pass @var{option} as an option to the linker. You can use this to
supply system-specific linker options that GCC does not recognize.
@option{-Xlinker -Map -Xlinker output.map}. Other linkers may not support
this syntax for command-line options.
-@item -Wl,@var{option}
@opindex Wl
+@item -Wl,@var{option}
Pass @var{option} as an option to the linker. If @var{option} contains
commas, it is split into multiple options at the commas. You can use this
syntax to pass an argument to the option.
linker. When using the GNU linker, you can also get the same effect with
@option{-Wl,-Map=output.map}.
-@item -u @var{symbol}
@opindex u
+@item -u @var{symbol}
Pretend the symbol @var{symbol} is undefined, to force linking of
library modules to define it. You can use @option{-u} multiple times with
different symbols to force loading of additional library modules.
-@item -z @var{keyword}
@opindex z
+@item -z @var{keyword}
@option{-z} is passed directly on to the linker along with the keyword
@var{keyword}. See the section in the documentation of your linker for
permitted values and their meanings.
@table @gcctabopt
@include cppdiropts.texi
-@item -iplugindir=@var{dir}
@opindex iplugindir=
+@item -iplugindir=@var{dir}
Set the directory to search for plugins that are passed
by @option{-fplugin=@var{name}} instead of
@option{-fplugin=@var{path}/@var{name}.so}. This option is not meant
to be used by the user, but only passed by the driver.
-@item -L@var{dir}
@opindex L
+@item -L@var{dir}
Add directory @var{dir} to the list of directories to be searched
for @option{-l}.
-@item -B@var{prefix}
@opindex B
+@item -B@var{prefix}
This option specifies where to find the executables, libraries,
include files, and data files of the compiler itself.
9, then it is replaced by @file{[dir/]include}. This is to help
with boot-strapping the compiler.
-@item -no-canonical-prefixes
@opindex no-canonical-prefixes
+@item -no-canonical-prefixes
Do not expand any symbolic links, resolve references to @samp{/../}
or @samp{/./}, or make the path absolute when generating a relative
prefix.
-@item --sysroot=@var{dir}
@opindex sysroot
+@item --sysroot=@var{dir}
Use @var{dir} as the logical root directory for headers and libraries.
For example, if the compiler normally searches for headers in
@file{/usr/include} and libraries in @file{/usr/lib}, it instead
header file aspect of @option{--sysroot} still works, but the
library aspect does not.
-@item --no-sysroot-suffix
@opindex no-sysroot-suffix
+@item --no-sysroot-suffix
For some targets, a suffix is added to the root directory specified
with @option{--sysroot}, depending on the other options used, so that
headers may for example be found in
it.
@table @gcctabopt
-@item -fstack-reuse=@var{reuse-level}
@opindex fstack_reuse
+@item -fstack-reuse=@var{reuse-level}
This option controls stack space reuse for user declared local/auto variables
and compiler generated temporaries. @var{reuse_level} can be @samp{all},
@samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
not reused, the aggressive stack reuse can lead to runtime errors. This
option is used to control the temporary stack reuse optimization.
-@item -ftrapv
@opindex ftrapv
+@item -ftrapv
This option generates traps for signed overflow on addition, subtraction,
multiplication operations.
The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
results in @option{-ftrapv} being effective.
-@item -fwrapv
@opindex fwrapv
+@item -fwrapv
This option instructs the compiler to assume that signed arithmetic
overflow of addition, subtraction and multiplication wraps around
using twos-complement representation. This flag enables some optimizations
using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
results in @option{-ftrapv} being effective.
-@item -fwrapv-pointer
@opindex fwrapv-pointer
+@item -fwrapv-pointer
This option instructs the compiler to assume that pointer arithmetic
overflow on addition and subtraction wraps around using twos-complement
representation. This flag disables some optimizations which assume
pointer overflow is invalid.
-@item -fstrict-overflow
@opindex fstrict-overflow
+@item -fstrict-overflow
This option implies @option{-fno-wrapv} @option{-fno-wrapv-pointer} and when
negated implies @option{-fwrapv} @option{-fwrapv-pointer}.
-@item -fexceptions
@opindex fexceptions
+@item -fexceptions
Enable exception handling. Generates extra code needed to propagate
exceptions. For some targets, this implies GCC generates frame
unwind information for all functions, which can produce significant data
disable this option if you are compiling older C++ programs that don't
use exception handling.
-@item -fnon-call-exceptions
@opindex fnon-call-exceptions
+@item -fnon-call-exceptions
Generate code that allows trapping instructions to throw exceptions.
Note that this requires platform-specific runtime support that does
not exist everywhere. Moreover, it only allows @emph{trapping}
arbitrary signal handlers such as @code{SIGALRM}. This enables
@option{-fexceptions}.
-@item -fdelete-dead-exceptions
@opindex fdelete-dead-exceptions
+@item -fdelete-dead-exceptions
Consider that instructions that may throw exceptions but don't otherwise
contribute to the execution of the program can be optimized away.
This does not affect calls to functions except those with the
the language specifications.
Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
-@item -funwind-tables
@opindex funwind-tables
+@item -funwind-tables
Similar to @option{-fexceptions}, except that it just generates any needed
static data, but does not affect the generated code in any other way.
You normally do not need to enable this option; instead, a language processor
that needs this handling enables it on your behalf.
-@item -fasynchronous-unwind-tables
@opindex fasynchronous-unwind-tables
+@item -fasynchronous-unwind-tables
Generate unwind table in DWARF format, if supported by target machine. The
table is exact at each instruction boundary, so it can be used for stack
unwinding from asynchronous events (such as debugger or garbage collector).
-@item -fno-gnu-unique
@opindex fno-gnu-unique
@opindex fgnu-unique
+@item -fno-gnu-unique
On systems with recent GNU assembler and C library, the C++ compiler
uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
of template static data members and static local variables in inline
@code{dlclose} and @code{dlopen}, you can use
@option{-fno-gnu-unique}.
-@item -fpcc-struct-return
@opindex fpcc-struct-return
+@item -fpcc-struct-return
Return ``short'' @code{struct} and @code{union} values in memory like
longer ones, rather than in registers. This convention is less
efficient, but it has the advantage of allowing intercallability between
@option{-freg-struct-return} switch.
Use it to conform to a non-default application binary interface.
-@item -freg-struct-return
@opindex freg-struct-return
+@item -freg-struct-return
Return @code{struct} and @code{union} values in registers when possible.
This is more efficient for small structures than
@option{-fpcc-struct-return}.
@option{-fpcc-struct-return} switch.
Use it to conform to a non-default application binary interface.
-@item -fshort-enums
@opindex fshort-enums
+@item -fshort-enums
Allocate to an @code{enum} type only as many bytes as it needs for the
declared range of possible values. Specifically, the @code{enum} type
is equivalent to the smallest integer type that has enough room.
code that is not binary compatible with code generated without that switch.
Use it to conform to a non-default application binary interface.
-@item -fshort-wchar
@opindex fshort-wchar
+@item -fshort-wchar
Override the underlying type for @code{wchar_t} to be @code{short
unsigned int} instead of the default for the target. This option is
useful for building programs to run under WINE@.
code that is not binary compatible with code generated without that switch.
Use it to conform to a non-default application binary interface.
-@item -fcommon
@opindex fcommon
@opindex fno-common
+@item -fcommon
@cindex tentative definitions
In C code, this option controls the placement of global variables
defined without an initializer, known as @dfn{tentative definitions}
a speed and code size penalty on global variable references. It is mainly
useful to enable legacy code to link without errors.
-@item -fno-ident
@opindex fno-ident
@opindex fident
+@item -fno-ident
Ignore the @code{#ident} directive.
-@item -finhibit-size-directive
@opindex finhibit-size-directive
+@item -finhibit-size-directive
Don't output a @code{.size} assembler directive, or anything else that
would cause trouble if the function is split in the middle, and the
two halves are placed at locations far apart in memory. This option is
used when compiling @file{crtstuff.c}; you should not need to use it
for anything else.
-@item -fverbose-asm
@opindex fverbose-asm
+@item -fverbose-asm
Put extra commentary information in the generated assembly code to
make it more readable. This option is generally only of use to those
who actually need to read the generated assembly code (perhaps while
The comments are intended for humans rather than machines and hence the
precise format of the comments is subject to change.
-@item -frecord-gcc-switches
@opindex frecord-gcc-switches
+@item -frecord-gcc-switches
This switch causes the command line used to invoke the
compiler to be recorded into the object file that is being created.
This switch is only implemented on some targets and the exact format
See also @option{-grecord-gcc-switches} for another
way of storing compiler options into the object file.
-@item -fpic
@opindex fpic
+@item -fpic
@cindex global offset table
@cindex PIC
Generate position-independent code (PIC) suitable for use in a shared
When this flag is set, the macros @code{__pic__} and @code{__PIC__}
are defined to 1.
-@item -fPIC
@opindex fPIC
+@item -fPIC
If supported for the target machine, emit position-independent code,
suitable for dynamic linking and avoiding any limit on the size of the
global offset table. This option makes a difference on AArch64, m68k,
When this flag is set, the macros @code{__pic__} and @code{__PIC__}
are defined to 2.
-@item -fpie
-@itemx -fPIE
@opindex fpie
@opindex fPIE
+@item -fpie
+@itemx -fPIE
These options are similar to @option{-fpic} and @option{-fPIC}, but the
generated position-independent code can be only linked into executables.
Usually these options are used to compile code that will be linked using
@code{__pie__} and @code{__PIE__}. The macros have the value 1
for @option{-fpie} and 2 for @option{-fPIE}.
-@item -fno-plt
@opindex fno-plt
@opindex fplt
+@item -fno-plt
Do not use the PLT for external function calls in position-independent code.
Instead, load the callee address at call sites from the GOT and branch to it.
This leads to more efficient code by eliminating PLT stubs and exposing
In position-dependent code, a few targets also convert calls to
functions that are marked to not use the PLT to use the GOT instead.
-@item -fno-jump-tables
@opindex fno-jump-tables
@opindex fjump-tables
+@item -fno-jump-tables
Do not use jump tables for switch statements even where it would be
more efficient than other code generation strategies. This option is
of use in conjunction with @option{-fpic} or @option{-fPIC} for
reference the address of a jump table. On some targets, jump tables
do not require a GOT and this option is not needed.
-@item -fno-bit-tests
@opindex fno-bit-tests
@opindex fbit-tests
+@item -fno-bit-tests
Do not use bit tests for switch statements even where it would be
more efficient than other code generation strategies.
-@item -ffixed-@var{reg}
@opindex ffixed
+@item -ffixed-@var{reg}
Treat the register named @var{reg} as a fixed register; generated code
should never refer to it (except perhaps as a stack pointer, frame
pointer or in some other fixed role).
This flag does not have a negative form, because it specifies a
three-way choice.
-@item -fcall-used-@var{reg}
@opindex fcall-used
+@item -fcall-used-@var{reg}
Treat the register named @var{reg} as an allocable register that is
clobbered by function calls. It may be allocated for temporaries or
variables that do not live across a call. Functions compiled this way
This flag does not have a negative form, because it specifies a
three-way choice.
-@item -fcall-saved-@var{reg}
@opindex fcall-saved
+@item -fcall-saved-@var{reg}
Treat the register named @var{reg} as an allocable register saved by
functions. It may be allocated even for temporaries or variables that
live across a call. Functions compiled this way save and restore
This flag does not have a negative form, because it specifies a
three-way choice.
-@item -fpack-struct[=@var{n}]
@opindex fpack-struct
+@item -fpack-struct[=@var{n}]
Without a value specified, pack all structure members together without
holes. When a value is specified (which must be a small power of two), pack
structure members according to this value, representing the maximum
Additionally, it makes the code suboptimal.
Use it to conform to a non-default application binary interface.
-@item -fleading-underscore
@opindex fleading-underscore
+@item -fleading-underscore
This option and its counterpart, @option{-fno-leading-underscore}, forcibly
change the way C symbols are represented in the object file. One use
is to help link with legacy assembly code.
switch. Use it to conform to a non-default application binary interface.
Not all targets provide complete support for this switch.
-@item -ftls-model=@var{model}
@opindex ftls-model
+@item -ftls-model=@var{model}
Alter the thread-local storage model to be used (@pxref{Thread-Local}).
The @var{model} argument should be one of @samp{global-dynamic},
@samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
The default without @option{-fpic} is @samp{initial-exec}; with
@option{-fpic} the default is @samp{global-dynamic}.
-@item -ftrampolines
@opindex ftrampolines
+@item -ftrampolines
For targets that normally need trampolines for nested functions, always
generate them instead of using descriptors. Otherwise, for targets that
do not need them, like for example HP-PA or IA-64, do nothing.
trampolines are always generated on platforms that need them
for nested functions.
-@item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
@opindex fvisibility
+@item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
Set the default ELF image symbol visibility to the specified option---all
symbols are marked with this unless overridden within the code.
Using this feature can very substantially improve linking and
An overview of these techniques, their benefits and how to use them
is at @uref{https://gcc.gnu.org/@/wiki/@/Visibility}.
-@item -fstrict-volatile-bitfields
@opindex fstrict-volatile-bitfields
+@item -fstrict-volatile-bitfields
This option should be used if accesses to volatile bit-fields (or other
structure fields, although the compiler usually honors those types
anyway) should use a single access of the width of the
The default value of this option is determined by the application binary
interface for the target processor.
-@item -fsync-libcalls
@opindex fsync-libcalls
+@item -fsync-libcalls
This option controls whether any out-of-line instance of the @code{__sync}
family of functions may be used to implement the C++11 @code{__atomic}
family of functions.
@table @gcctabopt
+@opindex fcallgraph-info
@item -fcallgraph-info
@itemx -fcallgraph-info=@var{MARKERS}
-@opindex fcallgraph-info
Makes the compiler output callgraph information for the program, on a
per-object-file basis. The information is generated in the common VCG
format. It can be decorated with additional, per-node and/or per-edge
may generate multiple callgraph information files next to intermediate
LTO output files.
+@opindex d
+@opindex fdump-rtl-@var{pass}
@item -d@var{letters}
@itemx -fdump-rtl-@var{pass}
@itemx -fdump-rtl-@var{pass}=@var{filename}
-@opindex d
-@opindex fdump-rtl-@var{pass}
Says to make debugging dumps during compilation at times specified by
@var{letters}. This is used for debugging the RTL-based passes of the
compiler.
@table @gcctabopt
-@item -fdump-rtl-alignments
@opindex fdump-rtl-alignments
+@item -fdump-rtl-alignments
Dump after branch alignments have been computed.
-@item -fdump-rtl-asmcons
@opindex fdump-rtl-asmcons
+@item -fdump-rtl-asmcons
Dump after fixing rtl statements that have unsatisfied in/out constraints.
-@item -fdump-rtl-auto_inc_dec
@opindex fdump-rtl-auto_inc_dec
+@item -fdump-rtl-auto_inc_dec
Dump after auto-inc-dec discovery. This pass is only run on
architectures that have auto inc or auto dec instructions.
-@item -fdump-rtl-barriers
@opindex fdump-rtl-barriers
+@item -fdump-rtl-barriers
Dump after cleaning up the barrier instructions.
-@item -fdump-rtl-bbpart
@opindex fdump-rtl-bbpart
+@item -fdump-rtl-bbpart
Dump after partitioning hot and cold basic blocks.
-@item -fdump-rtl-bbro
@opindex fdump-rtl-bbro
+@item -fdump-rtl-bbro
Dump after block reordering.
-@item -fdump-rtl-btl1
-@itemx -fdump-rtl-btl2
@opindex fdump-rtl-btl2
@opindex fdump-rtl-btl2
+@item -fdump-rtl-btl1
+@itemx -fdump-rtl-btl2
@option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
after the two branch
target load optimization passes.
-@item -fdump-rtl-bypass
@opindex fdump-rtl-bypass
+@item -fdump-rtl-bypass
Dump after jump bypassing and control flow optimizations.
-@item -fdump-rtl-combine
@opindex fdump-rtl-combine
+@item -fdump-rtl-combine
Dump after the RTL instruction combination pass.
-@item -fdump-rtl-compgotos
@opindex fdump-rtl-compgotos
+@item -fdump-rtl-compgotos
Dump after duplicating the computed gotos.
-@item -fdump-rtl-ce1
-@itemx -fdump-rtl-ce2
-@itemx -fdump-rtl-ce3
@opindex fdump-rtl-ce1
@opindex fdump-rtl-ce2
@opindex fdump-rtl-ce3
+@item -fdump-rtl-ce1
+@itemx -fdump-rtl-ce2
+@itemx -fdump-rtl-ce3
@option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
@option{-fdump-rtl-ce3} enable dumping after the three
if conversion passes.
-@item -fdump-rtl-cprop_hardreg
@opindex fdump-rtl-cprop_hardreg
+@item -fdump-rtl-cprop_hardreg
Dump after hard register copy propagation.
-@item -fdump-rtl-csa
@opindex fdump-rtl-csa
+@item -fdump-rtl-csa
Dump after combining stack adjustments.
-@item -fdump-rtl-cse1
-@itemx -fdump-rtl-cse2
@opindex fdump-rtl-cse1
@opindex fdump-rtl-cse2
+@item -fdump-rtl-cse1
+@itemx -fdump-rtl-cse2
@option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
the two common subexpression elimination passes.
-@item -fdump-rtl-dce
@opindex fdump-rtl-dce
+@item -fdump-rtl-dce
Dump after the standalone dead code elimination passes.
-@item -fdump-rtl-dbr
@opindex fdump-rtl-dbr
+@item -fdump-rtl-dbr
Dump after delayed branch scheduling.
-@item -fdump-rtl-dce1
-@itemx -fdump-rtl-dce2
@opindex fdump-rtl-dce1
@opindex fdump-rtl-dce2
+@item -fdump-rtl-dce1
+@itemx -fdump-rtl-dce2
@option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
the two dead store elimination passes.
-@item -fdump-rtl-eh
@opindex fdump-rtl-eh
+@item -fdump-rtl-eh
Dump after finalization of EH handling code.
-@item -fdump-rtl-eh_ranges
@opindex fdump-rtl-eh_ranges
+@item -fdump-rtl-eh_ranges
Dump after conversion of EH handling range regions.
-@item -fdump-rtl-expand
@opindex fdump-rtl-expand
+@item -fdump-rtl-expand
Dump after RTL generation.
-@item -fdump-rtl-fwprop1
-@itemx -fdump-rtl-fwprop2
@opindex fdump-rtl-fwprop1
@opindex fdump-rtl-fwprop2
+@item -fdump-rtl-fwprop1
+@itemx -fdump-rtl-fwprop2
@option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
dumping after the two forward propagation passes.
-@item -fdump-rtl-gcse1
-@itemx -fdump-rtl-gcse2
@opindex fdump-rtl-gcse1
@opindex fdump-rtl-gcse2
+@item -fdump-rtl-gcse1
+@itemx -fdump-rtl-gcse2
@option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
after global common subexpression elimination.
-@item -fdump-rtl-init-regs
@opindex fdump-rtl-init-regs
+@item -fdump-rtl-init-regs
Dump after the initialization of the registers.
-@item -fdump-rtl-initvals
@opindex fdump-rtl-initvals
+@item -fdump-rtl-initvals
Dump after the computation of the initial value sets.
-@item -fdump-rtl-into_cfglayout
@opindex fdump-rtl-into_cfglayout
+@item -fdump-rtl-into_cfglayout
Dump after converting to cfglayout mode.
-@item -fdump-rtl-ira
@opindex fdump-rtl-ira
+@item -fdump-rtl-ira
Dump after iterated register allocation.
-@item -fdump-rtl-jump
@opindex fdump-rtl-jump
+@item -fdump-rtl-jump
Dump after the second jump optimization.
-@item -fdump-rtl-loop2
@opindex fdump-rtl-loop2
+@item -fdump-rtl-loop2
@option{-fdump-rtl-loop2} enables dumping after the rtl
loop optimization passes.
-@item -fdump-rtl-mach
@opindex fdump-rtl-mach
+@item -fdump-rtl-mach
Dump after performing the machine dependent reorganization pass, if that
pass exists.
-@item -fdump-rtl-mode_sw
@opindex fdump-rtl-mode_sw
+@item -fdump-rtl-mode_sw
Dump after removing redundant mode switches.
-@item -fdump-rtl-rnreg
@opindex fdump-rtl-rnreg
+@item -fdump-rtl-rnreg
Dump after register renumbering.
-@item -fdump-rtl-outof_cfglayout
@opindex fdump-rtl-outof_cfglayout
+@item -fdump-rtl-outof_cfglayout
Dump after converting from cfglayout mode.
-@item -fdump-rtl-peephole2
@opindex fdump-rtl-peephole2
+@item -fdump-rtl-peephole2
Dump after the peephole pass.
-@item -fdump-rtl-postreload
@opindex fdump-rtl-postreload
+@item -fdump-rtl-postreload
Dump after post-reload optimizations.
-@item -fdump-rtl-pro_and_epilogue
@opindex fdump-rtl-pro_and_epilogue
+@item -fdump-rtl-pro_and_epilogue
Dump after generating the function prologues and epilogues.
-@item -fdump-rtl-sched1
-@itemx -fdump-rtl-sched2
@opindex fdump-rtl-sched1
@opindex fdump-rtl-sched2
+@item -fdump-rtl-sched1
+@itemx -fdump-rtl-sched2
@option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
after the basic block scheduling passes.
-@item -fdump-rtl-ree
@opindex fdump-rtl-ree
+@item -fdump-rtl-ree
Dump after sign/zero extension elimination.
-@item -fdump-rtl-seqabstr
@opindex fdump-rtl-seqabstr
+@item -fdump-rtl-seqabstr
Dump after common sequence discovery.
-@item -fdump-rtl-shorten
@opindex fdump-rtl-shorten
+@item -fdump-rtl-shorten
Dump after shortening branches.
-@item -fdump-rtl-sibling
@opindex fdump-rtl-sibling
+@item -fdump-rtl-sibling
Dump after sibling call optimizations.
-@item -fdump-rtl-split1
-@itemx -fdump-rtl-split2
-@itemx -fdump-rtl-split3
-@itemx -fdump-rtl-split4
-@itemx -fdump-rtl-split5
@opindex fdump-rtl-split1
@opindex fdump-rtl-split2
@opindex fdump-rtl-split3
@opindex fdump-rtl-split4
@opindex fdump-rtl-split5
+@item -fdump-rtl-split1
+@itemx -fdump-rtl-split2
+@itemx -fdump-rtl-split3
+@itemx -fdump-rtl-split4
+@itemx -fdump-rtl-split5
These options enable dumping after five rounds of
instruction splitting.
-@item -fdump-rtl-sms
@opindex fdump-rtl-sms
+@item -fdump-rtl-sms
Dump after modulo scheduling. This pass is only run on some
architectures.
-@item -fdump-rtl-stack
@opindex fdump-rtl-stack
+@item -fdump-rtl-stack
Dump after conversion from GCC's ``flat register file'' registers to the
x87's stack-like registers. This pass is only run on x86 variants.
-@item -fdump-rtl-subreg1
-@itemx -fdump-rtl-subreg2
@opindex fdump-rtl-subreg1
@opindex fdump-rtl-subreg2
+@item -fdump-rtl-subreg1
+@itemx -fdump-rtl-subreg2
@option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
the two subreg expansion passes.
-@item -fdump-rtl-unshare
@opindex fdump-rtl-unshare
+@item -fdump-rtl-unshare
Dump after all rtl has been unshared.
-@item -fdump-rtl-vartrack
@opindex fdump-rtl-vartrack
+@item -fdump-rtl-vartrack
Dump after variable tracking.
-@item -fdump-rtl-vregs
@opindex fdump-rtl-vregs
+@item -fdump-rtl-vregs
Dump after converting virtual registers to hard registers.
-@item -fdump-rtl-web
@opindex fdump-rtl-web
+@item -fdump-rtl-web
Dump after live range splitting.
-@item -fdump-rtl-regclass
-@itemx -fdump-rtl-subregs_of_mode_init
-@itemx -fdump-rtl-subregs_of_mode_finish
-@itemx -fdump-rtl-dfinit
-@itemx -fdump-rtl-dfinish
@opindex fdump-rtl-regclass
@opindex fdump-rtl-subregs_of_mode_init
@opindex fdump-rtl-subregs_of_mode_finish
@opindex fdump-rtl-dfinit
@opindex fdump-rtl-dfinish
+@item -fdump-rtl-regclass
+@itemx -fdump-rtl-subregs_of_mode_init
+@itemx -fdump-rtl-subregs_of_mode_finish
+@itemx -fdump-rtl-dfinit
+@itemx -fdump-rtl-dfinish
These dumps are defined but always produce empty files.
-@item -da
-@itemx -fdump-rtl-all
@opindex da
@opindex fdump-rtl-all
+@item -da
+@itemx -fdump-rtl-all
Produce all the dumps listed above.
-@item -dA
@opindex dA
+@item -dA
Annotate the assembler output with miscellaneous debugging information.
-@item -dD
@opindex dD
+@item -dD
Dump all macro definitions, at the end of preprocessing, in addition to
normal output.
-@item -dH
@opindex dH
+@item -dH
Produce a core dump whenever an error occurs.
-@item -dp
@opindex dp
+@item -dp
Annotate the assembler output with a comment indicating which
pattern and alternative is used. The length and cost of each instruction are
also printed.
-@item -dP
@opindex dP
+@item -dP
Dump the RTL in the assembler output as a comment before each instruction.
Also turns on @option{-dp} annotation.
-@item -dx
@opindex dx
+@item -dx
Just generate RTL for a function instead of compiling it. Usually used
with @option{-fdump-rtl-expand}.
@end table
-@item -fdump-debug
@opindex fdump-debug
+@item -fdump-debug
Dump debugging information generated during the debug
generation phase.
-@item -fdump-earlydebug
@opindex fdump-earlydebug
+@item -fdump-earlydebug
Dump debugging information generated during the early debug
generation phase.
-@item -fdump-noaddr
@opindex fdump-noaddr
+@item -fdump-noaddr
When doing debugging dumps, suppress address output. This makes it more
feasible to use diff on debugging dumps for compiler invocations with
different compiler binaries and/or different
text / bss / data / heap / stack / dso start locations.
-@item -freport-bug
@opindex freport-bug
+@item -freport-bug
Collect and dump debug information into a temporary file if an
internal compiler error (ICE) occurs.
-@item -fdump-unnumbered
@opindex fdump-unnumbered
+@item -fdump-unnumbered
When doing debugging dumps, suppress instruction numbers and address output.
This makes it more feasible to use diff on debugging dumps for compiler
invocations with different options, in particular with and without
@option{-g}.
-@item -fdump-unnumbered-links
@opindex fdump-unnumbered-links
+@item -fdump-unnumbered-links
When doing debugging dumps (see @option{-d} option above), suppress
instruction numbers for the links to the previous and next instructions
in a sequence.
+@opindex fdump-ipa
@item -fdump-ipa-@var{switch}
@itemx -fdump-ipa-@var{switch}-@var{options}
-@opindex fdump-ipa
Control the dumping at various stages of inter-procedural analysis
language tree to a file. The file name is generated by appending a
switch specific suffix to the source file name, and the file is created
optimizations (equivalent to @option{-optimized}) together with
low-level details about the analysis.
-@item -fdump-lang
@opindex fdump-lang
+@item -fdump-lang
Dump language-specific information. The file name is made by appending
@file{.lang} to the source file name.
+@opindex fdump-lang-all
+@opindex fdump-lang
@item -fdump-lang-all
@itemx -fdump-lang-@var{switch}
@itemx -fdump-lang-@var{switch}-@var{options}
@itemx -fdump-lang-@var{switch}-@var{options}=@var{filename}
-@opindex fdump-lang-all
-@opindex fdump-lang
Control the dumping of language-specific information. The @var{options}
and @var{filename} portions behave as described in the
@option{-fdump-tree} option. The following @var{switch} values are
@end table
-@item -fdump-passes
@opindex fdump-passes
+@item -fdump-passes
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
+@item -fdump-statistics-@var{option}
Enable and control dumping of pass statistics in a separate file. The
file name is generated by appending a suffix ending in
@samp{.statistics} to the source file name, and the file is created in
the passes generate them. The default with no option is to sum
counters for each function compiled.
+@opindex fdump-tree-all
+@opindex fdump-tree
@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. If the @samp{-@var{options}}
form is used, @var{options} is a list of @samp{-} separated options
from one version of GCC to another.
@end enumerate
+@opindex fopt-info
@item -fopt-info
@itemx -fopt-info-@var{options}
@itemx -fopt-info-@var{options}=@var{filename}
-@opindex fopt-info
Controls optimization dumps from various optimization passes. If the
@samp{-@var{options}} form is used, @var{options} is a list of
@samp{-} separated option keywords to select the dump details and
ignored. Thus only @file{vec.miss} is produced which contains
dumps from the vectorizer about missed opportunities.
-@item -fsave-optimization-record
@opindex fsave-optimization-record
+@item -fsave-optimization-record
Write a SRCFILE.opt-record.json.gz file detailing what optimizations
were performed, for those optimizations that support @option{-fopt-info}.
messages, reflecting implementation details of the optimization
passes.
-@item -fsched-verbose=@var{n}
@opindex fsched-verbose
+@item -fsched-verbose=@var{n}
On targets that use instruction scheduling, this option controls the
amount of debugging output the scheduler prints to the dump files.
-@item -fenable-@var{kind}-@var{pass}
-@itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
@opindex fdisable-
@opindex fenable-
+@item -fenable-@var{kind}-@var{pass}
+@itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
This is a set of options that are used to explicitly disable/enable
optimization passes. These options are intended for use for debugging GCC.
@end smallexample
-@item -fchecking
-@itemx -fchecking=@var{n}
@opindex fchecking
@opindex fno-checking
+@item -fchecking
+@itemx -fchecking=@var{n}
Enable internal consistency checking. The default depends on
the compiler configuration. @option{-fchecking=2} enables further
internal consistency checking that might affect code generation.
-@item -frandom-seed=@var{string}
@opindex frandom-seed
+@item -frandom-seed=@var{string}
This option provides a seed that GCC uses in place of
random numbers in generating certain symbol names
that have to be different in every compiled file. It is also used to
The @var{string} should be different for every file you compile.
-@item -save-temps
@opindex save-temps
+@item -save-temps
Store the usual ``temporary'' intermediate files permanently; name them
as auxiliary output files, as specified described under
@option{-dumpbase} and @option{-dumpdir}.
The corresponding intermediate file may be obtained by renaming the
source file before using @option{-save-temps}.
-@item -save-temps=cwd
@opindex save-temps=cwd
+@item -save-temps=cwd
Equivalent to @option{-save-temps -dumpdir ./}.
-@item -save-temps=obj
@opindex save-temps=obj
+@item -save-temps=obj
Equivalent to @option{-save-temps -dumpdir @file{outdir/}}, where
@file{outdir/} is the directory of the output file specified after the
@option{-o} option, including any directory separators. If the
@option{-o} option is not used, the @option{-save-temps=obj} switch
behaves like @option{-save-temps=cwd}.
-@item -time@r{[}=@var{file}@r{]}
@opindex time
+@item -time@r{[}=@var{file}@r{]}
Report the CPU time taken by each subprocess in the compilation
sequence. For C source files, this is the compiler proper and assembler
(plus the linker if linking is done).
name, and the options passed to the program are displayed, so that one
can later tell what file was being compiled, and with which options.
-@item -fdump-final-insns@r{[}=@var{file}@r{]}
@opindex fdump-final-insns
+@item -fdump-final-insns@r{[}=@var{file}@r{]}
Dump the final internal representation (RTL) to @var{file}. If the
optional argument is omitted (or if @var{file} is @code{.}), the name
of the dump file is determined by appending @code{.gkd} to the
dump base name, see @option{-dumpbase}.
-@item -fcompare-debug@r{[}=@var{opts}@r{]}
@opindex fcompare-debug
@opindex fno-compare-debug
+@item -fcompare-debug@r{[}=@var{opts}@r{]}
If no error occurs during compilation, run the compiler a second time,
adding @var{opts} and @option{-fcompare-debug-second} to the arguments
passed to the second compilation. Dump the final internal
warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
not overridden} will do.
-@item -fcompare-debug-second
@opindex fcompare-debug-second
+@item -fcompare-debug-second
This option is implicitly passed to the compiler for the second
compilation requested by @option{-fcompare-debug}, along with options to
silence warnings, and omitting other options that would cause the compiler
@emph{first} compilation to be skipped, which makes it useful for little
other than debugging the compiler proper.
-@item -gtoggle
@opindex gtoggle
+@item -gtoggle
Turn off generation of debug info, if leaving out this option
generates it, or turn it on at level 2 otherwise. The position of this
argument in the command line does not matter; it takes effect after all
many times it is given. This is mainly intended to be used with
@option{-fcompare-debug}.
-@item -fvar-tracking-assignments-toggle
@opindex fvar-tracking-assignments-toggle
@opindex fno-var-tracking-assignments-toggle
+@item -fvar-tracking-assignments-toggle
Toggle @option{-fvar-tracking-assignments}, in the same way that
@option{-gtoggle} toggles @option{-g}.
-@item -Q
@opindex Q
+@item -Q
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
@opindex ftime-report
+@item -ftime-report
Makes the compiler print some statistics about the time consumed by each
pass when it finishes.
-@item -ftime-report-details
@opindex ftime-report-details
+@item -ftime-report-details
Record the time consumed by infrastructure parts separately for each pass.
-@item -fira-verbose=@var{n}
@opindex fira-verbose
+@item -fira-verbose=@var{n}
Control the verbosity of the dump file for the integrated register allocator.
The default value is 5. If the value @var{n} is greater or equal to 10,
the dump output is sent to stderr using the same format as @var{n} minus 10.
-@item -flto-report
@opindex flto-report
+@item -flto-report
Prints a report with internal details on the workings of the link-time
optimizer. The contents of this report vary from version to version.
It is meant to be useful to GCC developers when processing object
Disabled by default.
-@item -flto-report-wpa
@opindex flto-report-wpa
+@item -flto-report-wpa
Like @option{-flto-report}, but only print for the WPA phase of link-time
optimization.
-@item -fmem-report
@opindex fmem-report
+@item -fmem-report
Makes the compiler print some statistics about permanent memory
allocation when it finishes.
-@item -fmem-report-wpa
@opindex fmem-report-wpa
+@item -fmem-report-wpa
Makes the compiler print some statistics about permanent memory
allocation for the WPA phase only.
-@item -fpre-ipa-mem-report
@opindex fpre-ipa-mem-report
-@item -fpost-ipa-mem-report
@opindex fpost-ipa-mem-report
+@item -fpre-ipa-mem-report
+@item -fpost-ipa-mem-report
Makes the compiler print some statistics about permanent memory
allocation before or after interprocedural optimization.
-@item -fmultiflags
@opindex fmultiflags
+@item -fmultiflags
This option enables multilib-aware @code{TFLAGS} to be used to build
target libraries with options different from those the compiler is
configured to use by default, through the use of specs (@xref{Spec
@samp{--with-specs='%@{!fmultiflags:%emissing TFLAGS@}'} and building
the compiler and target libraries.
-@item -fprofile-report
@opindex fprofile-report
+@item -fprofile-report
Makes the compiler print some statistics about consistency of the
(estimated) profile and effect of individual passes.
-@item -fstack-usage
@opindex fstack-usage
+@item -fstack-usage
Makes the compiler output stack usage information for the program, on a
per-function basis. The filename for the dump is made by appending
@file{.su} to the @var{auxname}. @var{auxname} is generated from the name of
not bounded at compile time and the second field only represents the
bounded part.
-@item -fstats
@opindex fstats
+@item -fstats
Emit statistics about front-end processing at the end of the compilation.
This option is supported only by the C++ front end, and
the information is generally only useful to the G++ development team.
-@item -fdbg-cnt-list
@opindex fdbg-cnt-list
+@item -fdbg-cnt-list
Print the name and the counter upper bound for all debug counters.
-@item -fdbg-cnt=@var{counter-value-list}
@opindex fdbg-cnt
+@item -fdbg-cnt=@var{counter-value-list}
Set the internal debug counter lower and upper bound. @var{counter-value-list}
is a comma-separated list of @var{name}:@var{lower_bound1}-@var{upper_bound1}
[:@var{lower_bound2}-@var{upper_bound2}...] tuples which sets
eleventh invocation.
For @code{dbg_cnt(tail_call)} true is returned for first 10 invocations.
-@item -print-file-name=@var{library}
@opindex print-file-name
+@item -print-file-name=@var{library}
Print the full absolute name of the library file @var{library} that
would be used when linking---and don't do anything else. With this
option, GCC does not compile or link anything; it just prints the
file name.
-@item -print-multi-directory
@opindex print-multi-directory
+@item -print-multi-directory
Print the directory name corresponding to the multilib selected by any
other switches present in the command line. This directory is supposed
to exist in @env{GCC_EXEC_PREFIX}.
-@item -print-multi-lib
@opindex print-multi-lib
+@item -print-multi-lib
Print the mapping from multilib directory names to compiler switches
that enable them. The directory name is separated from the switches by
@samp{;}, and each switch starts with an @samp{@@} instead of the
@samp{-}, without spaces between multiple switches. This is supposed to
ease shell processing.
-@item -print-multi-os-directory
@opindex print-multi-os-directory
+@item -print-multi-os-directory
Print the path to OS libraries for the selected
multilib, relative to some @file{lib} subdirectory. If OS libraries are
present in the @file{lib} subdirectory and no multilibs are used, this is
@file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
-@item -print-multiarch
@opindex print-multiarch
+@item -print-multiarch
Print the path to OS libraries for the selected multiarch,
relative to some @file{lib} subdirectory.
-@item -print-prog-name=@var{program}
@opindex print-prog-name
+@item -print-prog-name=@var{program}
Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
-@item -print-libgcc-file-name
@opindex print-libgcc-file-name
+@item -print-libgcc-file-name
Same as @option{-print-file-name=libgcc.a}.
This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
@end smallexample
-@item -print-search-dirs
@opindex print-search-dirs
+@item -print-search-dirs
Print the name of the configured installation directory and a list of
program and library directories @command{gcc} searches---and don't do anything else.
Don't forget the trailing @samp{/}.
@xref{Environment Variables}.
-@item -print-sysroot
@opindex print-sysroot
+@item -print-sysroot
Print the target sysroot directory that is used during
compilation. This is the target sysroot specified either at configure
time or using the @option{--sysroot} option, possibly with an extra
suffix that depends on compilation options. If no target sysroot is
specified, the option prints nothing.
-@item -print-sysroot-headers-suffix
@opindex print-sysroot-headers-suffix
+@item -print-sysroot-headers-suffix
Print the suffix added to the target sysroot when searching for
headers, or give an error if the compiler is not configured with such
a suffix---and don't do anything else.
-@item -dumpmachine
@opindex dumpmachine
+@item -dumpmachine
Print the compiler's target machine (for example,
@samp{i686-pc-linux-gnu})---and don't do anything else.
-@item -dumpversion
@opindex dumpversion
+@item -dumpversion
Print the compiler version (for example, @code{3.0}, @code{6.3.0} or @code{7})---and don't do
anything else. This is the compiler version used in filesystem paths and
specs. Depending on how the compiler has been configured it can be just
minor version) or three numbers separated by dots (major, minor and patchlevel
version).
-@item -dumpfullversion
@opindex dumpfullversion
+@item -dumpfullversion
Print the full compiler version---and don't do anything else. The output is
always three numbers separated by dots, major, minor and patchlevel version.
-@item -dumpspecs
@opindex dumpspecs
+@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
@table @gcctabopt
-@item -mabi=@var{name}
@opindex mabi
+@item -mabi=@var{name}
Generate code for the specified data model. Permissible values
are @samp{ilp32} for SysV-like data model where int, long int and pointers
are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
the LP64 and ILP32 ABIs are not link-compatible; you must compile your
entire program with the same ABI, and link with a compatible set of libraries.
-@item -mbig-endian
@opindex mbig-endian
+@item -mbig-endian
Generate big-endian code. This is the default when GCC is configured for an
@samp{aarch64_be-*-*} target.
-@item -mgeneral-regs-only
@opindex mgeneral-regs-only
+@item -mgeneral-regs-only
Generate code which uses only the general-purpose registers. This will prevent
the compiler from using floating-point and Advanced SIMD registers but will not
impose any restrictions on the assembler.
-@item -mlittle-endian
@opindex mlittle-endian
+@item -mlittle-endian
Generate little-endian code. This is the default when GCC is configured for an
@samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
-@item -mcmodel=tiny
@opindex mcmodel=tiny
+@item -mcmodel=tiny
Generate code for the tiny code model. The program and its statically defined
symbols must be within 1MB of each other. Programs can be statically or
dynamically linked.
-@item -mcmodel=small
@opindex mcmodel=small
+@item -mcmodel=small
Generate code for the small code model. The program and its statically defined
symbols must be within 4GB of each other. Programs can be statically or
dynamically linked. This is the default code model.
-@item -mcmodel=large
@opindex mcmodel=large
+@item -mcmodel=large
Generate code for the large code model. This makes no assumptions about
addresses and sizes of sections. Programs can be statically linked only. The
@option{-mcmodel=large} option is incompatible with @option{-mabi=ilp32},
@option{-fpic} and @option{-fPIC}.
-@item -mstrict-align
-@itemx -mno-strict-align
@opindex mstrict-align
@opindex mno-strict-align
+@item -mstrict-align
+@itemx -mno-strict-align
Avoid or allow generating memory accesses that may not be aligned on a natural
object boundary as described in the architecture specification.
-@item -momit-leaf-frame-pointer
-@itemx -mno-omit-leaf-frame-pointer
@opindex momit-leaf-frame-pointer
@opindex mno-omit-leaf-frame-pointer
+@item -momit-leaf-frame-pointer
+@itemx -mno-omit-leaf-frame-pointer
Omit or keep the frame pointer in leaf functions. The former behavior is the
default.
-@item -mstack-protector-guard=@var{guard}
-@itemx -mstack-protector-guard-reg=@var{reg}
-@itemx -mstack-protector-guard-offset=@var{offset}
@opindex mstack-protector-guard
@opindex mstack-protector-guard-reg
@opindex mstack-protector-guard-offset
+@item -mstack-protector-guard=@var{guard}
+@itemx -mstack-protector-guard-reg=@var{reg}
+@itemx -mstack-protector-guard-offset=@var{offset}
Generate stack protection code using canary at @var{guard}. Supported
locations are @samp{global} for a global canary or @samp{sysreg} for a
canary in an appropriate system register.
register or offset as this is entirely for use within the Linux
kernel.
-@item -mtls-dialect=desc
@opindex mtls-dialect=desc
+@item -mtls-dialect=desc
Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
of TLS variables. This is the default.
-@item -mtls-dialect=traditional
@opindex mtls-dialect=traditional
+@item -mtls-dialect=traditional
Use traditional TLS as the thread-local storage mechanism for dynamic accesses
of TLS variables.
-@item -mtls-size=@var{size}
@opindex mtls-size
+@item -mtls-size=@var{size}
Specify bit size of immediate TLS offsets. Valid values are 12, 24, 32, 48.
This option requires binutils 2.26 or newer.
-@item -mfix-cortex-a53-835769
-@itemx -mno-fix-cortex-a53-835769
@opindex mfix-cortex-a53-835769
@opindex mno-fix-cortex-a53-835769
+@item -mfix-cortex-a53-835769
+@itemx -mno-fix-cortex-a53-835769
Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
This involves inserting a NOP instruction between memory instructions and
64-bit integer multiply-accumulate instructions.
-@item -mfix-cortex-a53-843419
-@itemx -mno-fix-cortex-a53-843419
@opindex mfix-cortex-a53-843419
@opindex mno-fix-cortex-a53-843419
+@item -mfix-cortex-a53-843419
+@itemx -mno-fix-cortex-a53-843419
Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
This erratum workaround is made at link time and this will only pass the
corresponding flag to the linker.
-@item -mlow-precision-recip-sqrt
-@itemx -mno-low-precision-recip-sqrt
@opindex mlow-precision-recip-sqrt
@opindex mno-low-precision-recip-sqrt
+@item -mlow-precision-recip-sqrt
+@itemx -mno-low-precision-recip-sqrt
Enable or disable the reciprocal square root approximation.
This option only has an effect if @option{-ffast-math} or
@option{-funsafe-math-optimizations} is used as well. Enabling this reduces
precision of reciprocal square root results to about 16 bits for
single precision and to 32 bits for double precision.
-@item -mlow-precision-sqrt
-@itemx -mno-low-precision-sqrt
@opindex mlow-precision-sqrt
@opindex mno-low-precision-sqrt
+@item -mlow-precision-sqrt
+@itemx -mno-low-precision-sqrt
Enable or disable the square root approximation.
This option only has an effect if @option{-ffast-math} or
@option{-funsafe-math-optimizations} is used as well. Enabling this reduces
single precision and to 32 bits for double precision.
If enabled, it implies @option{-mlow-precision-recip-sqrt}.
-@item -mlow-precision-div
-@itemx -mno-low-precision-div
@opindex mlow-precision-div
@opindex mno-low-precision-div
+@item -mlow-precision-div
+@itemx -mno-low-precision-div
Enable or disable the division approximation.
This option only has an effect if @option{-ffast-math} or
@option{-funsafe-math-optimizations} is used as well. Enabling this reduces
selected cpu supports the @samp{lse} feature.
This option is on by default.
-@item -march=@var{name}
@opindex march
+@item -march=@var{name}
Specify the name of the target architecture and, optionally, one or
more feature modifiers. This option has the form
@option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
specified, the code is tuned to perform well across a range of target
processors implementing the target architecture.
-@item -mtune=@var{name}
@opindex mtune
+@item -mtune=@var{name}
Specify the name of the target processor for which GCC should tune the
performance of the code. Permissible values for this option are:
@samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
This option cannot be suffixed by feature modifiers.
-@item -mcpu=@var{name}
@opindex mcpu
+@item -mcpu=@var{name}
Specify the name of the target processor, optionally suffixed by one
or more feature modifiers. This option has the form
@option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
@option{-mcpu=neoverse-512tvb} tunes code in the same way as for
@option{-mtune=neoverse-512tvb}.
-@item -moverride=@var{string}
@opindex moverride
+@item -moverride=@var{string}
Override tuning decisions made by the back-end in response to a
@option{-mtune=} switch. The syntax, semantics, and accepted values
for @var{string} in this option are not guaranteed to be consistent
This option is only intended to be useful when developing GCC.
-@item -mverbose-cost-dump
@opindex mverbose-cost-dump
+@item -mverbose-cost-dump
Enable verbose cost model dumping in the debug dump files. This option is
provided for use in debugging the compiler.
-@item -mpc-relative-literal-loads
-@itemx -mno-pc-relative-literal-loads
@opindex mpc-relative-literal-loads
@opindex mno-pc-relative-literal-loads
+@item -mpc-relative-literal-loads
+@itemx -mno-pc-relative-literal-loads
Enable or disable PC-relative literal loads. With this option literal pools are
accessed using a single instruction and emitted after each function. This
limits the maximum size of functions to 1MB. This is enabled by default for
@option{-mcmodel=tiny}.
-@item -msign-return-address=@var{scope}
@opindex msign-return-address
+@item -msign-return-address=@var{scope}
Select the function scope on which return address signing will be applied.
Permissible values are @samp{none}, which disables return address signing,
@samp{non-leaf}, which enables pointer signing for functions which are not leaf
default value is @samp{none}. This option has been deprecated by
-mbranch-protection.
-@item -mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}+@var{b-key}]|@var{bti}
@opindex mbranch-protection
+@item -mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}+@var{b-key}]|@var{bti}
Select the branch protection features to use.
@samp{none} is the default and turns off all types of branch protection.
@samp{standard} turns on all types of branch protection features. If a feature
with the B-key instead of the A-key.
@samp{bti} turns on branch target identification mechanism.
-@item -mharden-sls=@var{opts}
@opindex mharden-sls
+@item -mharden-sls=@var{opts}
Enable compiler hardening against straight line speculation (SLS).
@var{opts} is a comma-separated list of the following options:
@table @samp
In addition, @samp{-mharden-sls=all} enables all SLS hardening while
@samp{-mharden-sls=none} disables all SLS hardening.
-@item -msve-vector-bits=@var{bits}
@opindex msve-vector-bits
+@item -msve-vector-bits=@var{bits}
Specify the number of bits in an SVE vector register. This option only has
an effect when SVE is enabled.
These @samp{-m} options are defined for Adapteva Epiphany:
@table @gcctabopt
-@item -mhalf-reg-file
@opindex mhalf-reg-file
+@item -mhalf-reg-file
Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
That allows code to run on hardware variants that lack these registers.
-@item -mprefer-short-insn-regs
@opindex mprefer-short-insn-regs
+@item -mprefer-short-insn-regs
Preferentially allocate registers that allow short instruction generation.
This can result in increased instruction count, so this may either reduce or
increase overall code size.
-@item -mbranch-cost=@var{num}
@opindex mbranch-cost
+@item -mbranch-cost=@var{num}
Set the cost of branches to roughly @var{num} ``simple'' instructions.
This cost is only a heuristic and is not guaranteed to produce
consistent results across releases.
-@item -mcmove
@opindex mcmove
+@item -mcmove
Enable the generation of conditional moves.
-@item -mnops=@var{num}
@opindex mnops
+@item -mnops=@var{num}
Emit @var{num} NOPs before every other generated instruction.
-@item -mno-soft-cmpsf
@opindex mno-soft-cmpsf
@opindex msoft-cmpsf
+@item -mno-soft-cmpsf
For single-precision floating-point comparisons, emit an @code{fsub} instruction
and test the flags. This is faster than a software comparison, but can
get incorrect results in the presence of NaNs, or when two different small
The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
software comparisons.
-@item -mstack-offset=@var{num}
@opindex mstack-offset
+@item -mstack-offset=@var{num}
Set the offset between the top of the stack and the stack pointer.
E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
can be used by leaf functions without stack allocation.
offset to build working programs, it is recommended to configure the
toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
-@item -mno-round-nearest
@opindex mno-round-nearest
@opindex mround-nearest
+@item -mno-round-nearest
Make the scheduler assume that the rounding mode has been set to
truncating. The default is @option{-mround-nearest}.
-@item -mlong-calls
@opindex mlong-calls
+@item -mlong-calls
If not otherwise specified by an attribute, assume all calls might be beyond
the offset range of the @code{b} / @code{bl} instructions, and therefore load the
function address into a register before performing a (otherwise direct) call.
This is the default.
-@item -mshort-calls
@opindex short-calls
+@item -mshort-calls
If not otherwise specified by an attribute, assume all direct calls are
in the range of the @code{b} / @code{bl} instructions, so use these instructions
for direct calls. The default is @option{-mlong-calls}.
-@item -msmall16
@opindex msmall16
+@item -msmall16
Assume addresses can be loaded as 16-bit unsigned values. This does not
apply to function addresses for which @option{-mlong-calls} semantics
are in effect.
-@item -mfp-mode=@var{mode}
@opindex mfp-mode
+@item -mfp-mode=@var{mode}
Set the prevailing mode of the floating-point unit.
This determines the floating-point mode that is provided and expected
at function call and return time. Making this mode match the mode you
The default is @option{-mfp-mode=caller}
-@item -mno-split-lohi
-@itemx -mno-postinc
-@itemx -mno-postmodify
@opindex mno-split-lohi
@opindex msplit-lohi
@opindex mno-postinc
@opindex mpostinc
@opindex mno-postmodify
@opindex mpostmodify
+@item -mno-split-lohi
+@itemx -mno-postinc
+@itemx -mno-postmodify
Code generation tweaks that disable, respectively, splitting of 32-bit
loads, generation of post-increment addresses, and generation of
post-modify addresses. The defaults are @option{msplit-lohi},
@option{-mpost-inc}, and @option{-mpost-modify}.
-@item -mnovect-double
@opindex mno-vect-double
@opindex mvect-double
+@item -mnovect-double
Change the preferred SIMD mode to SImode. The default is
@option{-mvect-double}, which uses DImode as preferred SIMD mode.
-@item -max-vect-align=@var{num}
@opindex max-vect-align
+@item -max-vect-align=@var{num}
The maximum alignment for SIMD vector mode types.
@var{num} may be 4 or 8. The default is 8.
Note that this is an ABI change, even though many library function
interfaces are unaffected if they don't use SIMD vector modes
in places that affect size and/or alignment of relevant types.
-@item -msplit-vecmove-early
@opindex msplit-vecmove-early
+@item -msplit-vecmove-early
Split vector moves into single word moves before reload. In theory this
can give better register allocation, but so far the reverse seems to be
generally the case.
-@item -m1reg-@var{reg}
@opindex m1reg-
+@item -m1reg-@var{reg}
Specify a register to hold the constant @minus{}1, which makes loading small negative
constants and certain bitmasks faster.
Allowable values for @var{reg} are @samp{r43} and @samp{r63},
@table @gcctabopt
-@item -march=@var{gpu}
@opindex march
-@itemx -mtune=@var{gpu}
@opindex mtune
+@item -march=@var{gpu}
+@itemx -mtune=@var{gpu}
Set architecture type or tuning for @var{gpu}. Supported values for @var{gpu}
are
@end table
+@opindex msram-ecc
@item -msram-ecc=on
@itemx -msram-ecc=off
@itemx -msram-ecc=any
-@opindex msram-ecc
Compile binaries suitable for devices with the SRAM-ECC feature enabled,
disabled, or either mode. This feature can be enabled per-process on some
devices. The compiled code must match the device mode. The default is
@samp{any}, for devices that support it.
-@item -mstack-size=@var{bytes}
@opindex mstack-size
+@item -mstack-size=@var{bytes}
Specify how many @var{bytes} of stack space will be requested for each GPU
thread (wave-front). Beware that there may be many threads and limited memory
available. The size of the stack allocation may also have an impact on
run-time performance. The default is 32KB when using OpenACC or OpenMP, and
1MB otherwise.
-@item -mxnack
@opindex mxnack
+@item -mxnack
Compile binaries suitable for devices with the XNACK feature enabled. Some
devices always require XNACK and some allow the user to configure XNACK. The
compiled code must match the device mode. The default is @samp{-mno-xnack}.
@c architecture variants
@table @gcctabopt
-@item -mbarrel-shifter
@opindex mbarrel-shifter
+@item -mbarrel-shifter
Generate instructions supported by barrel shifter. This is the default
unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
-@item -mjli-always
@opindex mjli-always
+@item -mjli-always
Force to call a function using jli_s instruction. This option is
valid only for ARCv2 architecture.
-@item -mcpu=@var{cpu}
@opindex mcpu
+@item -mcpu=@var{cpu}
Set architecture type, register usage, and instruction scheduling
parameters for @var{cpu}. There are also shortcut alias options
available for backward compatibility and convenience. Supported
@item arc600
Compile for ARC600. Aliases: @option{-mA6}, @option{-mARC600}.
-@item arc601
@opindex mARC601
+@item arc601
Compile for ARC601. Alias: @option{-mARC601}.
-@item arc700
@opindex mA7
@opindex mARC700
+@item arc700
Compile for ARC700. Aliases: @option{-mA7}, @option{-mARC700}.
This is the default when configured with @option{--with-cpu=arc700}@.
@end table
-@item -mdpfp
@opindex mdpfp
-@itemx -mdpfp-compact
@opindex mdpfp-compact
+@item -mdpfp
+@itemx -mdpfp-compact
Generate double-precision FPX instructions, tuned for the compact
implementation.
-@item -mdpfp-fast
@opindex mdpfp-fast
+@item -mdpfp-fast
Generate double-precision FPX instructions, tuned for the fast
implementation.
-@item -mno-dpfp-lrsr
@opindex mno-dpfp-lrsr
+@item -mno-dpfp-lrsr
Disable @code{lr} and @code{sr} instructions from using FPX extension
aux registers.
-@item -mea
@opindex mea
+@item -mea
Generate extended arithmetic instructions. Currently only
@code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
supported. Only valid for @option{-mcpu=ARC700}.
-@item -mno-mpy
@opindex mno-mpy
@opindex mmpy
+@item -mno-mpy
Do not generate @code{mpy}-family instructions for ARC700. This option is
deprecated.
-@item -mmul32x16
@opindex mmul32x16
+@item -mmul32x16
Generate 32x16-bit multiply and multiply-accumulate instructions.
-@item -mmul64
@opindex mmul64
+@item -mmul64
Generate @code{mul64} and @code{mulu64} instructions.
Only valid for @option{-mcpu=ARC600}.
-@item -mnorm
@opindex mnorm
+@item -mnorm
Generate @code{norm} instructions. This is the default if @option{-mcpu=ARC700}
is in effect.
-@item -mspfp
@opindex mspfp
-@itemx -mspfp-compact
@opindex mspfp-compact
+@item -mspfp
+@itemx -mspfp-compact
Generate single-precision FPX instructions, tuned for the compact
implementation.
-@item -mspfp-fast
@opindex mspfp-fast
+@item -mspfp-fast
Generate single-precision FPX instructions, tuned for the fast
implementation.
-@item -msimd
@opindex msimd
+@item -msimd
Enable generation of ARC SIMD instructions via target-specific
builtins. Only valid for @option{-mcpu=ARC700}.
-@item -msoft-float
@opindex msoft-float
+@item -msoft-float
This option ignored; it is provided for compatibility purposes only.
Software floating-point code is emitted by default, and this default
can overridden by FPX options; @option{-mspfp}, @option{-mspfp-compact}, or
@option{-mspfp-fast} for single precision, and @option{-mdpfp},
@option{-mdpfp-compact}, or @option{-mdpfp-fast} for double precision.
-@item -mswap
@opindex mswap
+@item -mswap
Generate @code{swap} instructions.
-@item -matomic
@opindex matomic
+@item -matomic
This enables use of the locked load/store conditional extension to implement
atomic memory built-in functions. Not available for ARC 6xx or ARC
EM cores.
-@item -mdiv-rem
@opindex mdiv-rem
+@item -mdiv-rem
Enable @code{div} and @code{rem} instructions for ARCv2 cores.
-@item -mcode-density
@opindex mcode-density
+@item -mcode-density
Enable code density instructions for ARC EM.
This option is on by default for ARC HS.
-@item -mll64
@opindex mll64
+@item -mll64
Enable double load/store operations for ARC HS cores.
-@item -mtp-regno=@var{regno}
@opindex mtp-regno
+@item -mtp-regno=@var{regno}
Specify thread pointer register number.
-@item -mmpy-option=@var{multo}
@opindex mmpy-option
+@item -mmpy-option=@var{multo}
Compile ARCv2 code with a multiplier design option. You can specify
the option using either a string or numeric value for @var{multo}.
@samp{wlh1} is the default value. The recognized values are:
This option is only available for ARCv2 cores@.
-@item -mfpu=@var{fpu}
@opindex mfpu
+@item -mfpu=@var{fpu}
Enables support for specific floating-point hardware extensions for ARCv2
cores. Supported values for @var{fpu} are:
@end table
-@item -mirq-ctrl-saved=@var{register-range}, @var{blink}, @var{lp_count}
@opindex mirq-ctrl-saved
+@item -mirq-ctrl-saved=@var{register-range}, @var{blink}, @var{lp_count}
Specifies general-purposes registers that the processor automatically
saves/restores on interrupt entry and exit. @var{register-range} is
specified as two registers separated by a dash. The register range
@var{blink} and @var{lp_count} are optional. This option is only
valid for ARC EM and ARC HS cores.
-@item -mrgf-banked-regs=@var{number}
@opindex mrgf-banked-regs
+@item -mrgf-banked-regs=@var{number}
Specifies the number of registers replicated in second register bank
on entry to fast interrupt. Fast interrupts are interrupts with the
highest priority level P0. These interrupts save only PC and STATUS32
sequences. Use this option when you are using fast interrupts in an
ARC V2 family processor. Permitted values are 4, 8, 16, and 32.
-@item -mlpc-width=@var{width}
@opindex mlpc-width
+@item -mlpc-width=@var{width}
Specify the width of the @code{lp_count} register. Valid values for
@var{width} are 8, 16, 20, 24, 28 and 32 bits. The default width is
fixed to 32 bits. If the width is less than 32, the compiler does not
loop mechanism for various needs. This option defines macro
@code{__ARC_LPC_WIDTH__} with the value of @var{width}.
-@item -mrf16
@opindex mrf16
+@item -mrf16
This option instructs the compiler to generate code for a 16-entry
register file. This option defines the @code{__ARC_RF16__}
preprocessor macro.
-@item -mbranch-index
@opindex mbranch-index
+@item -mbranch-index
Enable use of @code{bi} or @code{bih} instructions to implement jump
tables.
@c Flags used by the assembler, but for which we define preprocessor
@c macro symbols as well.
@table @gcctabopt
-@item -mdsp-packa
@opindex mdsp-packa
+@item -mdsp-packa
Passed down to the assembler to enable the DSP Pack A extensions.
Also sets the preprocessor symbol @code{__Xdsp_packa}. This option is
deprecated.
-@item -mdvbf
@opindex mdvbf
+@item -mdvbf
Passed down to the assembler to enable the dual Viterbi butterfly
extension. Also sets the preprocessor symbol @code{__Xdvbf}. This
option is deprecated.
@c ARC700 4.10 extension instruction
-@item -mlock
@opindex mlock
+@item -mlock
Passed down to the assembler to enable the locked load/store
conditional extension. Also sets the preprocessor symbol
@code{__Xlock}.
-@item -mmac-d16
@opindex mmac-d16
+@item -mmac-d16
Passed down to the assembler. Also sets the preprocessor symbol
@code{__Xxmac_d16}. This option is deprecated.
-@item -mmac-24
@opindex mmac-24
+@item -mmac-24
Passed down to the assembler. Also sets the preprocessor symbol
@code{__Xxmac_24}. This option is deprecated.
@c ARC700 4.10 extension instruction
-@item -mrtsc
@opindex mrtsc
+@item -mrtsc
Passed down to the assembler to enable the 64-bit time-stamp counter
extension instruction. Also sets the preprocessor symbol
@code{__Xrtsc}. This option is deprecated.
@c ARC700 4.10 extension instruction
-@item -mswape
@opindex mswape
+@item -mswape
Passed down to the assembler to enable the swap byte ordering
extension instruction. Also sets the preprocessor symbol
@code{__Xswape}.
-@item -mtelephony
@opindex mtelephony
+@item -mtelephony
Passed down to the assembler to enable dual- and single-operand
instructions for telephony. Also sets the preprocessor symbol
@code{__Xtelephony}. This option is deprecated.
-@item -mxy
@opindex mxy
+@item -mxy
Passed down to the assembler to enable the XY memory extension. Also
sets the preprocessor symbol @code{__Xxy}.
@c Assembly annotation options
@table @gcctabopt
-@item -misize
@opindex misize
+@item -misize
Annotate assembler instructions with estimated addresses.
-@item -mannotate-align
@opindex mannotate-align
+@item -mannotate-align
Explain what alignment considerations lead to the decision to make an
instruction short or long.
@c options passed through to the linker
@table @gcctabopt
-@item -marclinux
@opindex marclinux
+@item -marclinux
Passed through to the linker, to specify use of the @code{arclinux} emulation.
This option is enabled by default in tool chains built for
@w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
when profiling is not requested.
-@item -marclinux_prof
@opindex marclinux_prof
+@item -marclinux_prof
Passed through to the linker, to specify use of the
@code{arclinux_prof} emulation. This option is enabled by default in
tool chains built for @w{@code{arc-linux-uclibc}} and
@c semantically relevant code generation options
@table @gcctabopt
-@item -mlong-calls
@opindex mlong-calls
+@item -mlong-calls
Generate calls as register indirect calls, thus providing access
to the full 32-bit address range.
-@item -mmedium-calls
@opindex mmedium-calls
+@item -mmedium-calls
Don't use less than 25-bit addressing range for calls, which is the
offset available for an unconditional branch-and-link
instruction. Conditional execution of function calls is suppressed, to
conditional branch-and-link. This is the default for tool chains built
for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
-@item -G @var{num}
@opindex G
+@item -G @var{num}
Put definitions of externally-visible data in a small data section if
that data is no bigger than @var{num} bytes. The default value of
@var{num} is 4 for any ARC configuration, or 8 when we have double
load/store operations.
-@item -mno-sdata
@opindex mno-sdata
@opindex msdata
+@item -mno-sdata
Do not generate sdata references. This is the default for tool chains
built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
targets.
-@item -mvolatile-cache
@opindex mvolatile-cache
+@item -mvolatile-cache
Use ordinarily cached memory accesses for volatile references. This is the
default.
-@item -mno-volatile-cache
@opindex mno-volatile-cache
@opindex mvolatile-cache
+@item -mno-volatile-cache
Enable cache bypass for volatile references.
@end table
The following options fine tune code generation:
@c code generation tuning options
@table @gcctabopt
-@item -malign-call
@opindex malign-call
+@item -malign-call
Does nothing. Preserved for backward compatibility.
-@item -mauto-modify-reg
@opindex mauto-modify-reg
+@item -mauto-modify-reg
Enable the use of pre/post modify with register displacement.
-@item -mbbit-peephole
@opindex mbbit-peephole
+@item -mbbit-peephole
Enable bbit peephole2.
-@item -mno-brcc
@opindex mno-brcc
+@item -mno-brcc
This option disables a target-specific pass in @file{arc_reorg} to
generate compare-and-branch (@code{br@var{cc}}) instructions.
It has no effect on
generation of these instructions driven by the combiner pass.
-@item -mcase-vector-pcrel
@opindex mcase-vector-pcrel
+@item -mcase-vector-pcrel
Use PC-relative switch case tables to enable case table shortening.
This is the default for @option{-Os}.
-@item -mcompact-casesi
@opindex mcompact-casesi
+@item -mcompact-casesi
Enable compact @code{casesi} pattern. This is the default for @option{-Os},
and only available for ARCv1 cores. This option is deprecated.
-@item -mno-cond-exec
@opindex mno-cond-exec
+@item -mno-cond-exec
Disable the ARCompact-specific pass to generate conditional
execution instructions.
offset range because they are conditionalized, you should consider using
@option{-mmedium-calls} instead.
-@item -mearly-cbranchsi
@opindex mearly-cbranchsi
+@item -mearly-cbranchsi
Enable pre-reload use of the @code{cbranchsi} pattern.
-@item -mexpand-adddi
@opindex mexpand-adddi
+@item -mexpand-adddi
Expand @code{adddi3} and @code{subdi3} at RTL generation time into
@code{add.f}, @code{adc} etc. This option is deprecated.
-@item -mindexed-loads
@opindex mindexed-loads
+@item -mindexed-loads
Enable the use of indexed loads. This can be problematic because some
optimizers then assume that indexed stores exist, which is not
the case.
-@item -mlra
@opindex mlra
+@item -mlra
Enable Local Register Allocation. This is still experimental for ARC,
so by default the compiler uses standard reload
(i.e.@: @option{-mno-lra}).
-@item -mlra-priority-none
@opindex mlra-priority-none
+@item -mlra-priority-none
Don't indicate any priority for target registers.
-@item -mlra-priority-compact
@opindex mlra-priority-compact
+@item -mlra-priority-compact
Indicate target register priority for r0..r3 / r12..r15.
-@item -mlra-priority-noncompact
@opindex mlra-priority-noncompact
+@item -mlra-priority-noncompact
Reduce target register priority for r0..r3 / r12..r15.
-@item -mmillicode
@opindex mmillicode
+@item -mmillicode
When optimizing for size (using @option{-Os}), prologues and epilogues
that have to save or restore a large number of registers are often
shortened by using call to a special function in libgcc; this is
nonstandard way, this option is provided to turn on or off millicode
call generation.
-@item -mcode-density-frame
@opindex mcode-density-frame
+@item -mcode-density-frame
This option enable the compiler to emit @code{enter} and @code{leave}
instructions. These instructions are only valid for CPUs with
code-density feature.
-@item -mmixed-code
@opindex mmixed-code
+@item -mmixed-code
Does nothing. Preserved for backward compatibility.
-@item -mq-class
@opindex mq-class
+@item -mq-class
Ths option is deprecated. Enable @samp{q} instruction alternatives.
This is the default for @option{-Os}.
-@item -mRcq
@opindex mRcq
+@item -mRcq
Does nothing. Preserved for backward compatibility.
-@item -mRcw
@opindex mRcw
+@item -mRcw
Does nothing. Preserved for backward compatibility.
-@item -msize-level=@var{level}
@opindex msize-level
+@item -msize-level=@var{level}
Fine-tune size optimization with regards to instruction lengths and alignment.
The recognized values for @var{level} are:
@table @samp
This defaults to @samp{3} when @option{-Os} is in effect. Otherwise,
the behavior when this is not set is equivalent to level @samp{1}.
-@item -mtune=@var{cpu}
@opindex mtune
+@item -mtune=@var{cpu}
Set instruction scheduling parameters for @var{cpu}, overriding any implied
by @option{-mcpu=}.
@end table
-@item -mmultcost=@var{num}
@opindex mmultcost
+@item -mmultcost=@var{num}
Cost to assume for a multiply instruction, with @samp{4} being equal to a
normal instruction.
-@item -munalign-prob-threshold=@var{probability}
@opindex munalign-prob-threshold
+@item -munalign-prob-threshold=@var{probability}
Does nothing. Preserved for backward compatibility.
@end table
@c Deprecated options
@table @gcctabopt
-@item -margonaut
@opindex margonaut
+@item -margonaut
Obsolete FPX.
-@item -mbig-endian
@opindex mbig-endian
-@itemx -EB
@opindex EB
+@item -mbig-endian
+@itemx -EB
Compile code for big-endian targets. Use of these options is now
deprecated. Big-endian code is supported by configuring GCC to build
@w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets,
for which big endian is the default.
-@item -mlittle-endian
@opindex mlittle-endian
-@itemx -EL
@opindex EL
+@item -mlittle-endian
+@itemx -EL
Compile code for little-endian targets. Use of these options is now
deprecated. Little-endian code is supported by configuring GCC to build
@w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets,
for which little endian is the default.
-@item -mbarrel_shifter
@opindex mbarrel_shifter
+@item -mbarrel_shifter
Replaced by @option{-mbarrel-shifter}.
-@item -mdpfp_compact
@opindex mdpfp_compact
+@item -mdpfp_compact
Replaced by @option{-mdpfp-compact}.
-@item -mdpfp_fast
@opindex mdpfp_fast
+@item -mdpfp_fast
Replaced by @option{-mdpfp-fast}.
-@item -mdsp_packa
@opindex mdsp_packa
+@item -mdsp_packa
Replaced by @option{-mdsp-packa}.
-@item -mEA
@opindex mEA
+@item -mEA
Replaced by @option{-mea}.
-@item -mmac_24
@opindex mmac_24
+@item -mmac_24
Replaced by @option{-mmac-24}.
-@item -mmac_d16
@opindex mmac_d16
+@item -mmac_d16
Replaced by @option{-mmac-d16}.
-@item -mspfp_compact
@opindex mspfp_compact
+@item -mspfp_compact
Replaced by @option{-mspfp-compact}.
-@item -mspfp_fast
@opindex mspfp_fast
+@item -mspfp_fast
Replaced by @option{-mspfp-fast}.
-@item -mtune=@var{cpu}
@opindex mtune
+@item -mtune=@var{cpu}
Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
@samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
@samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively.
-@item -multcost=@var{num}
@opindex multcost
+@item -multcost=@var{num}
Replaced by @option{-mmultcost}.
@end table
These @samp{-m} options are defined for the ARM port:
@table @gcctabopt
-@item -mabi=@var{name}
@opindex mabi
+@item -mabi=@var{name}
Generate code for the specified ABI@. Permissible values are: @samp{apcs-gnu},
@samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
-@item -mapcs-frame
@opindex mapcs-frame
+@item -mapcs-frame
Generate a stack frame that is compliant with the ARM Procedure Call
Standard for all functions, even if this is not strictly necessary for
correct execution of the code. Specifying @option{-fomit-frame-pointer}
leaf functions. The default is @option{-mno-apcs-frame}.
This option is deprecated.
-@item -mapcs
@opindex mapcs
+@item -mapcs
This is a synonym for @option{-mapcs-frame} and is deprecated.
@ignore
@c not currently implemented
-@item -mapcs-stack-check
@opindex mapcs-stack-check
+@item -mapcs-stack-check
Generate code to check the amount of stack space available upon entry to
every function (that actually uses some stack space). If there is
insufficient space available then either the function
@option{-mno-apcs-stack-check}, since this produces smaller code.
@c not currently implemented
-@item -mapcs-reentrant
@opindex mapcs-reentrant
+@item -mapcs-reentrant
Generate reentrant, position-independent code. The default is
@option{-mno-apcs-reentrant}.
@end ignore
-@item -mthumb-interwork
@opindex mthumb-interwork
+@item -mthumb-interwork
Generate code that supports calling between the ARM and Thumb
instruction sets. Without this option, on pre-v5 architectures, the
two instruction sets cannot be reliably used inside one program. The
is generated when @option{-mthumb-interwork} is specified. In AAPCS
configurations this option is meaningless.
-@item -mno-sched-prolog
@opindex mno-sched-prolog
@opindex msched-prolog
+@item -mno-sched-prolog
Prevent the reordering of instructions in the function prologue, or the
merging of those instruction with the instructions in the function's
body. This means that all functions start with a recognizable set
locate the start of functions inside an executable piece of code. The
default is @option{-msched-prolog}.
-@item -mfloat-abi=@var{name}
@opindex mfloat-abi
+@item -mfloat-abi=@var{name}
Specifies which floating-point ABI to use. Permissible values
are: @samp{soft}, @samp{softfp} and @samp{hard}.
compile your entire program with the same ABI, and link with a
compatible set of libraries.
-@item -mgeneral-regs-only
@opindex mgeneral-regs-only
+@item -mgeneral-regs-only
Generate code which uses only the general-purpose registers. This will prevent
the compiler from using floating-point and Advanced SIMD registers but will not
impose any restrictions on the assembler.
-@item -mlittle-endian
@opindex mlittle-endian
+@item -mlittle-endian
Generate code for a processor running in little-endian mode. This is
the default for all standard configurations.
-@item -mbig-endian
@opindex mbig-endian
+@item -mbig-endian
Generate code for a processor running in big-endian mode; the default is
to compile code for a little-endian processor.
+@opindex mbe8
@item -mbe8
@itemx -mbe32
-@opindex mbe8
When linking a big-endian image select between BE8 and BE32 formats.
The option has no effect for little-endian images and is ignored. The
default is dependent on the selected target architecture. For ARMv6
and later architectures the default is BE8, for older architectures
the default is BE32. BE32 format has been deprecated by ARM.
-@item -march=@var{name}@r{[}+extension@dots{}@r{]}
@opindex march
+@item -march=@var{name}@r{[}+extension@dots{}@r{]}
This specifies the name of the target ARM architecture. GCC uses this
name to determine what kind of instructions it can emit when generating
assembly code. This option can be used in conjunction with or instead
GNU/Linux, and not all architectures are recognized. If the auto-detect
is unsuccessful the option has no effect.
-@item -mtune=@var{name}
@opindex mtune
+@item -mtune=@var{name}
This option specifies the name of the target ARM processor for
which GCC should tune the performance of the code.
For some ARM implementations better performance can be obtained by using
GNU/Linux, and not all architectures are recognized. If the auto-detect is
unsuccessful the option has no effect.
-@item -mcpu=@var{name}@r{[}+extension@dots{}@r{]}
@opindex mcpu
+@item -mcpu=@var{name}@r{[}+extension@dots{}@r{]}
This specifies the name of the target ARM processor. GCC uses this name
to derive the name of the target ARM architecture (as if specified
by @option{-march}) and the ARM processor type for which to tune for
GNU/Linux, and not all architectures are recognized. If the auto-detect
is unsuccessful the option has no effect.
-@item -mfpu=@var{name}
@opindex mfpu
+@item -mfpu=@var{name}
This specifies what floating-point hardware (or hardware emulation) is
available on the target. Permissible names are: @samp{auto}, @samp{vfpv2},
@samp{vfpv3},
You can also set the fpu name at function level by using the @code{target("fpu=")} function attributes (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
-@item -mfp16-format=@var{name}
@opindex mfp16-format
+@item -mfp16-format=@var{name}
Specify the format of the @code{__fp16} half-precision floating-point type.
Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
the default is @samp{none}, in which case the @code{__fp16} type is not
defined. @xref{Half-Precision}, for more information.
-@item -mstructure-size-boundary=@var{n}
@opindex mstructure-size-boundary
+@item -mstructure-size-boundary=@var{n}
The sizes of all structures and unions are rounded up to a multiple
of the number of bits set by this option. Permissible values are 8, 32
and 64. The default value varies for different toolchains. For the COFF
This option is deprecated.
-@item -mabort-on-noreturn
@opindex mabort-on-noreturn
+@item -mabort-on-noreturn
Generate a call to the function @code{abort} at the end of a
@code{noreturn} function. It is executed if the function tries to
return.
-@item -mlong-calls
-@itemx -mno-long-calls
@opindex mlong-calls
@opindex mno-long-calls
+@item -mlong-calls
+@itemx -mno-long-calls
Tells the compiler to perform function calls by first loading the
address of the function into a register and then performing a subroutine
call on this register. This switch is needed if the target function
the compiler generates code to handle function calls via function
pointers.
-@item -msingle-pic-base
@opindex msingle-pic-base
+@item -msingle-pic-base
Treat the register used for PIC addressing as read-only, rather than
loading it in the prologue for each function. The runtime system is
responsible for initializing this register with an appropriate value
before execution begins.
-@item -mpic-register=@var{reg}
@opindex mpic-register
+@item -mpic-register=@var{reg}
Specify the register to be used for PIC addressing.
For standard PIC base case, the default is any suitable register
determined by compiler. For single PIC base case, the default is
@samp{R9} if target is EABI based or stack-checking is enabled,
otherwise the default is @samp{R10}.
-@item -mpic-data-is-text-relative
@opindex mpic-data-is-text-relative
+@item -mpic-data-is-text-relative
Assume that the displacement between the text and data segments is fixed
at static link time. This permits using PC-relative addressing
operations to access data known to be in the data segment. For
disabled on such targets, it will enable @option{-msingle-pic-base} by
default.
-@item -mpoke-function-name
@opindex mpoke-function-name
+@item -mpoke-function-name
Write the name of each function into the text section, directly
preceding the function prologue. The generated code is similar to this:
there is a function name embedded immediately preceding this location
and has length @code{((pc[-3]) & 0xff000000)}.
-@item -mthumb
-@itemx -marm
@opindex marm
@opindex mthumb
+@item -mthumb
+@itemx -marm
Select between generating code that executes in ARM and Thumb
states. The default for most configurations is to generate code
by using the @code{target("thumb")} and @code{target("arm")} function attributes
(@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
-@item -mflip-thumb
@opindex mflip-thumb
+@item -mflip-thumb
Switch ARM/Thumb modes on alternating functions.
This option is provided for regression testing of mixed Thumb/ARM code
generation, and is not intended for ordinary use in compiling code.
-@item -mtpcs-frame
@opindex mtpcs-frame
+@item -mtpcs-frame
Generate a stack frame that is compliant with the Thumb Procedure Call
Standard for all non-leaf functions. (A leaf function is one that does
not call any other functions.) The default is @option{-mno-tpcs-frame}.
-@item -mtpcs-leaf-frame
@opindex mtpcs-leaf-frame
+@item -mtpcs-leaf-frame
Generate a stack frame that is compliant with the Thumb Procedure Call
Standard for all leaf functions. (A leaf function is one that does
not call any other functions.) The default is @option{-mno-apcs-leaf-frame}.
-@item -mcallee-super-interworking
@opindex mcallee-super-interworking
+@item -mcallee-super-interworking
Gives all externally visible functions in the file being compiled an ARM
instruction set header which switches to Thumb mode before executing the
rest of the function. This allows these functions to be called from
non-interworking code. This option is not valid in AAPCS configurations
because interworking is enabled by default.
-@item -mcaller-super-interworking
@opindex mcaller-super-interworking
+@item -mcaller-super-interworking
Allows calls via function pointers (including virtual functions) to
execute correctly regardless of whether the target code has been
compiled for interworking or not. There is a small overhead in the cost
is not valid in AAPCS configurations because interworking is enabled
by default.
-@item -mtp=@var{name}
@opindex mtp
+@item -mtp=@var{name}
Specify the access model for the thread local storage pointer. The valid
models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
@samp{cp15}, which fetches the thread pointer from @code{cp15} directly
best available method for the selected processor. The default setting is
@samp{auto}.
-@item -mtls-dialect=@var{dialect}
@opindex mtls-dialect
+@item -mtls-dialect=@var{dialect}
Specify the dialect to use for accessing thread local storage. Two
@var{dialect}s are supported---@samp{gnu} and @samp{gnu2}. The
@samp{gnu} dialect selects the original GNU scheme for supporting
library support. Initial and local exec TLS models are unaffected by
this option and always use the original scheme.
-@item -mword-relocations
@opindex mword-relocations
+@item -mword-relocations
Only generate absolute relocations on word-sized values (i.e.@: R_ARM_ABS32).
This is enabled by default on targets (uClinux, SymbianOS) where the runtime
loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
is specified. This option conflicts with @option{-mslow-flash-data}.
-@item -mfix-cortex-m3-ldrd
@opindex mfix-cortex-m3-ldrd
+@item -mfix-cortex-m3-ldrd
Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
with overlapping destination and base registers are used. This option avoids
generating these instructions. This option is enabled by default when
option is enabled by default when either @option{-mcpu=cortex-a57} or
@option{-mcpu=cortex-a72} is specified.
-@item -munaligned-access
-@itemx -mno-unaligned-access
@opindex munaligned-access
@opindex mno-unaligned-access
+@item -munaligned-access
+@itemx -mno-unaligned-access
Enables (or disables) reading and writing of 16- and 32- bit values
from addresses that are not 16- or 32- bit aligned. By default
unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
defined.
-@item -mneon-for-64bits
@opindex mneon-for-64bits
+@item -mneon-for-64bits
This option is deprecated and has no effect.
-@item -mslow-flash-data
@opindex mslow-flash-data
+@item -mslow-flash-data
Assume loading data from flash is slower than fetching instruction.
Therefore literal load is minimized for better performance.
This option is only supported when compiling for ARMv7 M-profile and
off by default. It conflicts with @option{-mword-relocations}.
-@item -masm-syntax-unified
@opindex masm-syntax-unified
+@item -masm-syntax-unified
Assume inline assembler is using unified asm syntax. The default is
currently off which implies divided syntax. This option has no impact
on Thumb2. However, this may change in future releases of GCC.
Divided syntax should be considered deprecated.
-@item -mrestrict-it
@opindex mrestrict-it
+@item -mrestrict-it
Restricts generation of IT blocks to conform to the rules of ARMv8-A.
IT blocks can only contain a single 16-bit instruction from a select
set of instructions. This option is on by default for ARMv8-A Thumb mode.
-@item -mprint-tune-info
@opindex mprint-tune-info
+@item -mprint-tune-info
Print CPU tuning information as comment in assembler file. This is
an option used only for regression testing of the compiler and not
intended for ordinary use in compiling code. This option is disabled
by default.
-@item -mverbose-cost-dump
@opindex mverbose-cost-dump
+@item -mverbose-cost-dump
Enable verbose cost model dumping in the debug dump files. This option is
provided for use in debugging the compiler.
-@item -mpure-code
@opindex mpure-code
+@item -mpure-code
Do not allow constant data to be placed in code sections.
Additionally, when compiling for ELF object format give all text sections the
ELF processor-specific section attribute @code{SHF_ARM_PURECODE}. This option
is only available when generating non-pic code for M-profile targets.
-@item -mcmse
@opindex mcmse
+@item -mcmse
Generate secure code as per the "ARMv8-M Security Extensions: Requirements on
Development Tools Engineering Specification", which can be found on
@url{https://developer.arm.com/documentation/ecm0359818/latest/}.
-@item -mfix-cmse-cve-2021-35465
@opindex mfix-cmse-cve-2021-35465
+@item -mfix-cmse-cve-2021-35465
Mitigate against a potential security issue with the @code{VLLDM} instruction
in some M-profile devices when using CMSE (CVE-2021-365465). This option is
enabled by default when the option @option{-mcpu=} is used with
or @code{star-mc1}. The option @option{-mno-fix-cmse-cve-2021-35465} can be used
to disable the mitigation.
-@item -mstack-protector-guard=@var{guard}
-@itemx -mstack-protector-guard-offset=@var{offset}
@opindex mstack-protector-guard
@opindex mstack-protector-guard-offset
+@item -mstack-protector-guard=@var{guard}
+@itemx -mstack-protector-guard-offset=@var{offset}
Generate stack protection code using canary at @var{guard}. Supported
locations are @samp{global} for a global canary or @samp{tls} for a
canary accessible via the TLS register. The option
@option{-mstack-protector-guard-offset=} is for use with
@option{-fstack-protector-guard=tls} and not for use in user-land code.
-@item -mfdpic
-@itemx -mno-fdpic
@opindex mfdpic
@opindex mno-fdpic
+@item -mfdpic
+@itemx -mno-fdpic
Select the FDPIC ABI, which uses 64-bit function descriptors to
represent pointers to functions. When the compiler is configured for
@code{arm-*-uclinuxfdpiceabi} targets, this option is on by default
build the Linux kernel using the same (@code{arm-*-uclinuxfdpiceabi})
toolchain as the one used to build the userland programs.
-@item -mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}][+@var{bti}]|@var{bti}[+@var{pac-ret}[+@var{leaf}]]
@opindex mbranch-protection
+@item -mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}][+@var{bti}]|@var{bti}[+@var{pac-ret}[+@var{leaf}]]
Enable branch protection features (armv8.1-m.main only).
@samp{none} generate code without branch protection or return address
signing.
These options are defined for AVR implementations:
@table @gcctabopt
-@item -mmcu=@var{mcu}
@opindex mmcu
+@item -mmcu=@var{mcu}
Specify Atmel AVR instruction set architectures (ISA) or MCU type.
The default for this option is@tie{}@samp{avr2}.
@include avr-mmcu.texi
-@item -mabsdata
@opindex mabsdata
+@item -mabsdata
Assume that all data in static storage can be accessed by LDS / STS
instructions. This option has only an effect on reduced Tiny devices like
ATtiny40. See also the @code{absdata}
@ref{AVR Variable Attributes,variable attribute}.
-@item -maccumulate-args
@opindex maccumulate-args
+@item -maccumulate-args
Accumulate outgoing function arguments and acquire/release the needed
stack space for outgoing function arguments once in function
prologue/epilogue. Without this option, outgoing arguments are pushed
several calls to functions that get their arguments on the stack like
calls to printf-like functions.
-@item -mbranch-cost=@var{cost}
@opindex mbranch-cost
+@item -mbranch-cost=@var{cost}
Set the branch costs for conditional branch instructions to
@var{cost}. Reasonable values for @var{cost} are small, non-negative
integers. The default branch cost is 0.
-@item -mcall-prologues
@opindex mcall-prologues
+@item -mcall-prologues
Functions prologues/epilogues are expanded as calls to appropriate
subroutines. Code size is smaller.
-@item -mdouble=@var{bits}
-@itemx -mlong-double=@var{bits}
@opindex mdouble
@opindex mlong-double
+@item -mdouble=@var{bits}
+@itemx -mlong-double=@var{bits}
Set the size (in bits) of the @code{double} or @code{long double} type,
respectively. Possible values for @var{bits} are 32 and 64.
Whether or not a specific value for @var{bits} is allowed depends on
@w{@uref{https://gcc.gnu.org/install/configure.html#avr,configure options}},
and the same applies for the default values of the options.
-@item -mgas-isr-prologues
@opindex mgas-isr-prologues
+@item -mgas-isr-prologues
Interrupt service routines (ISRs) may use the @code{__gcc_isr} pseudo
instruction supported by GNU Binutils.
If this option is on, the feature can still be disabled for individual
if optimization is on (but not with @option{-Og}, @pxref{Optimize Options}),
and if GNU Binutils support @w{@uref{https://sourceware.org/PR21683,PR21683}}.
-@item -mint8
@opindex mint8
+@item -mint8
Assume @code{int} to be 8-bit integer. This affects the sizes of all types: a
@code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
and @code{long long} is 4 bytes. Please note that this option does not
conform to the C standards, but it results in smaller code
size.
-@item -mmain-is-OS_task
@opindex mmain-is-OS_task
+@item -mmain-is-OS_task
Do not save registers in @code{main}. The effect is the same like
attaching attribute @ref{AVR Function Attributes,,@code{OS_task}}
to @code{main}. It is activated per default if optimization is on.
-@item -mn-flash=@var{num}
@opindex mn-flash
+@item -mn-flash=@var{num}
Assume that the flash memory has a size of
@var{num} times 64@tie{}KiB.
-@item -mno-interrupts
@opindex mno-interrupts
+@item -mno-interrupts
Generated code is not compatible with hardware interrupts.
Code size is smaller.
-@item -mrelax
@opindex mrelax
+@item -mrelax
Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
@code{RCALL} resp.@: @code{RJMP} instruction if applicable.
Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
Relaxing must be turned on if linker stubs are needed, see the
section on @code{EIND} and linker stubs below.
-@item -mrmw
@opindex mrmw
+@item -mrmw
Assume that the device supports the Read-Modify-Write
instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
-@item -mshort-calls
@opindex mshort-calls
+@item -mshort-calls
Assume that @code{RJMP} and @code{RCALL} can target the whole
program memory.
This option is used internally for multilib selection. It is
not an optimization option, and you don't need to set it by hand.
-@item -msp8
@opindex msp8
+@item -msp8
Treat the stack pointer register as an 8-bit register,
i.e.@: assume the high byte of the stack pointer is zero.
In general, you don't need to set this option by hand.
or architecture has an 8-bit stack pointer and thus no @code{SPH}
register or not.
-@item -mstrict-X
@opindex mstrict-X
+@item -mstrict-X
Use address register @code{X} in a way proposed by the hardware. This means
that @code{X} is only used in indirect, post-increment or
pre-decrement addressing.
sbiw r26, const ; X -= const
@end example
-@item -mtiny-stack
@opindex mtiny-stack
+@item -mtiny-stack
Only change the lower 8@tie{}bits of the stack pointer.
-@item -mfract-convert-truncate
@opindex mfract-convert-truncate
+@item -mfract-convert-truncate
Allow to use truncation instead of rounding towards zero for fractional fixed-point types.
-@item -nodevicelib
@opindex nodevicelib
+@item -nodevicelib
Don't link against AVR-LibC's device specific library @code{lib<mcu>.a}.
-@item -nodevicespecs
@opindex nodevicespecs
+@item -nodevicespecs
Don't add @option{-specs=device-specs/specs-@var{mcu}} to the compiler driver's
command line. The user takes responsibility for supplying the sub-processes
like compiler proper, assembler and linker with appropriate command line
which contains a folder named @code{device-specs} which contains a specs file named
@code{specs-@var{mcu}}, where @var{mcu} was specified by @option{-mmcu=@var{mcu}}.
-@item -Waddr-space-convert
@opindex Waddr-space-convert
@opindex Wno-addr-space-convert
+@item -Waddr-space-convert
Warn about conversions between address spaces in the case where the
resulting address space is not contained in the incoming address space.
-@item -Wmisspelled-isr
@opindex Wmisspelled-isr
@opindex Wno-misspelled-isr
+@item -Wmisspelled-isr
Warn if the ISR is misspelled, i.e.@: without __vector prefix.
Enabled by default.
@end table
@cindex Blackfin Options
@table @gcctabopt
-@item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
@opindex mcpu=
+@item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
Specifies the name of the target Blackfin processor. Currently, @var{cpu}
can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
@samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
Note that support for @samp{bf561} is incomplete. For @samp{bf561},
only the preprocessor macro is defined.
-@item -msim
@opindex msim
+@item -msim
Specifies that the program will be run on the simulator. This causes
the simulator BSP provided by libgloss to be linked in. This option
has effect only for @samp{bfin-elf} toolchain.
Certain other options, such as @option{-mid-shared-library} and
@option{-mfdpic}, imply @option{-msim}.
-@item -momit-leaf-frame-pointer
@opindex momit-leaf-frame-pointer
+@item -momit-leaf-frame-pointer
Don't keep the frame pointer in a register for leaf functions. This
avoids the instructions to save, set up and restore frame pointers and
makes an extra register available in leaf functions.
-@item -mspecld-anomaly
@opindex mspecld-anomaly
+@item -mspecld-anomaly
When enabled, the compiler ensures that the generated code does not
contain speculative loads after jump instructions. If this option is used,
@code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
-@item -mno-specld-anomaly
@opindex mno-specld-anomaly
@opindex mspecld-anomaly
+@item -mno-specld-anomaly
Don't generate extra code to prevent speculative loads from occurring.
-@item -mcsync-anomaly
@opindex mcsync-anomaly
+@item -mcsync-anomaly
When enabled, the compiler ensures that the generated code does not
contain CSYNC or SSYNC instructions too soon after conditional branches.
If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
-@item -mno-csync-anomaly
@opindex mno-csync-anomaly
@opindex mcsync-anomaly
+@item -mno-csync-anomaly
Don't generate extra code to prevent CSYNC or SSYNC instructions from
occurring too soon after a conditional branch.
-@item -mlow64k
@opindex mlow64k
+@item -mlow64k
When enabled, the compiler is free to take advantage of the knowledge that
the entire program fits into the low 64k of memory.
-@item -mno-low64k
@opindex mno-low64k
+@item -mno-low64k
Assume that the program is arbitrarily large. This is the default.
-@item -mstack-check-l1
@opindex mstack-check-l1
+@item -mstack-check-l1
Do stack checking using information placed into L1 scratchpad memory by the
uClinux kernel.
-@item -mid-shared-library
@opindex mid-shared-library
+@item -mid-shared-library
Generate code that supports shared libraries via the library ID method.
This allows for execute in place and shared libraries in an environment
without virtual memory management. This option implies @option{-fPIC}.
With a @samp{bfin-elf} target, this option implies @option{-msim}.
-@item -mno-id-shared-library
@opindex mno-id-shared-library
@opindex mid-shared-library
+@item -mno-id-shared-library
Generate code that doesn't assume ID-based shared libraries are being used.
This is the default.
-@item -mleaf-id-shared-library
@opindex mleaf-id-shared-library
+@item -mleaf-id-shared-library
Generate code that supports shared libraries via the library ID method,
but assumes that this library or executable won't link against any other
ID shared libraries. That allows the compiler to use faster code for jumps
and calls.
-@item -mno-leaf-id-shared-library
@opindex mno-leaf-id-shared-library
@opindex mleaf-id-shared-library
+@item -mno-leaf-id-shared-library
Do not assume that the code being compiled won't link against any ID shared
libraries. Slower code is generated for jump and call insns.
-@item -mshared-library-id=n
@opindex mshared-library-id
+@item -mshared-library-id=n
Specifies the identification number of the ID-based shared library being
compiled. Specifying a value of 0 generates more compact code; specifying
other values forces the allocation of that number to the current
library but is no more space- or time-efficient than omitting this option.
-@item -msep-data
@opindex msep-data
+@item -msep-data
Generate code that allows the data segment to be located in a different
area of memory from the text segment. This allows for execute in place in
an environment without virtual memory management by eliminating relocations
against the text section.
-@item -mno-sep-data
@opindex mno-sep-data
@opindex msep-data
+@item -mno-sep-data
Generate code that assumes that the data segment follows the text segment.
This is the default.
-@item -mlong-calls
-@itemx -mno-long-calls
@opindex mlong-calls
@opindex mno-long-calls
+@item -mlong-calls
+@itemx -mno-long-calls
Tells the compiler to perform function calls by first loading the
address of the function into a register and then performing a subroutine
call on this register. This switch is needed if the target function
switches have no effect on how the compiler generates code to handle
function calls via function pointers.
-@item -mfast-fp
@opindex mfast-fp
+@item -mfast-fp
Link with the fast floating-point library. This library relaxes some of
the IEEE floating-point standard's rules for checking inputs against
Not-a-Number (NAN), in the interest of performance.
-@item -minline-plt
@opindex minline-plt
+@item -minline-plt
Enable inlining of PLT entries in function calls to functions that are
not known to bind locally. It has no effect without @option{-mfdpic}.
-@item -mmulticore
@opindex mmulticore
+@item -mmulticore
Build a standalone application for multicore Blackfin processors.
This option causes proper start files and link scripts supporting
multicore to be used, and defines the macro @code{__BFIN_MULTICORE}.
If this option is not used, the single-core application programming
model is used.
-@item -mcorea
@opindex mcorea
+@item -mcorea
Build a standalone application for Core A of BF561 when using
the one-application-per-core programming model. Proper start files
and link scripts are used to support Core A, and the macro
@code{__BFIN_COREA} is defined.
This option can only be used in conjunction with @option{-mmulticore}.
-@item -mcoreb
@opindex mcoreb
+@item -mcoreb
Build a standalone application for Core B of BF561 when using
the one-application-per-core programming model. Proper start files
and link scripts are used to support Core B, and the macro
should be used instead of @code{main}.
This option can only be used in conjunction with @option{-mmulticore}.
-@item -msdram
@opindex msdram
+@item -msdram
Build a standalone application for SDRAM. Proper start files and
link scripts are used to put the application into SDRAM, and the macro
@code{__BFIN_SDRAM} is defined.
The loader should initialize SDRAM before loading the application.
-@item -micplb
@opindex micplb
+@item -micplb
Assume that ICPLBs are enabled at run time. This has an effect on certain
anomaly workarounds. For Linux targets, the default is to assume ICPLBs
are enabled; for standalone applications the default is off.
@cindex C6X Options
@table @gcctabopt
-@item -march=@var{name}
@opindex march
+@item -march=@var{name}
This specifies the name of the target architecture. GCC uses this
name to determine what kind of instructions it can emit when generating
assembly code. Permissible names are: @samp{c62x},
@samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
-@item -mbig-endian
@opindex mbig-endian
+@item -mbig-endian
Generate code for a big-endian target.
-@item -mlittle-endian
@opindex mlittle-endian
+@item -mlittle-endian
Generate code for a little-endian target. This is the default.
-@item -msim
@opindex msim
+@item -msim
Choose startup files and linker script suitable for the simulator.
-@item -msdata=default
@opindex msdata=default
+@item -msdata=default
Put small global and static data in the @code{.neardata} section,
which is pointed to by register @code{B14}. Put small uninitialized
global and static data in the @code{.bss} section, which is adjacent
@code{.rodata} section. The corresponding sections used for large
pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
-@item -msdata=all
@opindex msdata=all
+@item -msdata=all
Put all data, not just small objects, into the sections reserved for
small data, and use addressing relative to the @code{B14} register to
access them.
-@item -msdata=none
@opindex msdata=none
+@item -msdata=none
Make no use of the sections reserved for small data, and use absolute
addresses to access all data. Put all initialized global and static
data in the @code{.fardata} section, and all uninitialized data in the
These options are defined specifically for the CRIS ports.
@table @gcctabopt
-@item -march=@var{architecture-type}
-@itemx -mcpu=@var{architecture-type}
@opindex march
@opindex mcpu
+@item -march=@var{architecture-type}
+@itemx -mcpu=@var{architecture-type}
Generate code for the specified architecture. The choices for
@var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
Default is @samp{v0}.
-@item -mtune=@var{architecture-type}
@opindex mtune
+@item -mtune=@var{architecture-type}
Tune to @var{architecture-type} everything applicable about the generated
code, except for the ABI and the set of available instructions. The
choices for @var{architecture-type} are the same as for
@option{-march=@var{architecture-type}}.
-@item -mmax-stack-frame=@var{n}
@opindex mmax-stack-frame
+@item -mmax-stack-frame=@var{n}
Warn when the stack frame of a function exceeds @var{n} bytes.
-@item -metrax4
-@itemx -metrax100
@opindex metrax4
@opindex metrax100
+@item -metrax4
+@itemx -metrax100
The options @option{-metrax4} and @option{-metrax100} are synonyms for
@option{-march=v3} and @option{-march=v8} respectively.
-@item -mmul-bug-workaround
-@itemx -mno-mul-bug-workaround
@opindex mmul-bug-workaround
@opindex mno-mul-bug-workaround
+@item -mmul-bug-workaround
+@itemx -mno-mul-bug-workaround
Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
models where it applies. This option is disabled by default.
-@item -mpdebug
@opindex mpdebug
+@item -mpdebug
Enable CRIS-specific verbose debug-related information in the assembly
code. This option also has the effect of turning off the @samp{#NO_APP}
formatted-code indicator to the assembler at the beginning of the
assembly file.
-@item -mcc-init
@opindex mcc-init
+@item -mcc-init
Do not use condition-code results from previous instruction; always emit
compare and test instructions before use of condition codes.
-@item -mno-side-effects
@opindex mno-side-effects
@opindex mside-effects
+@item -mno-side-effects
Do not emit instructions with side effects in addressing modes other than
post-increment.
-@item -mstack-align
-@itemx -mno-stack-align
-@itemx -mdata-align
-@itemx -mno-data-align
-@itemx -mconst-align
-@itemx -mno-const-align
@opindex mstack-align
@opindex mno-stack-align
@opindex mdata-align
@opindex mno-data-align
@opindex mconst-align
@opindex mno-const-align
+@item -mstack-align
+@itemx -mno-stack-align
+@itemx -mdata-align
+@itemx -mno-data-align
+@itemx -mconst-align
+@itemx -mno-const-align
These options (@samp{no-} options) arrange (eliminate arrangements) for the
stack frame, individual data and constants to be aligned for the maximum
single data access size for the chosen CPU model. The default is to
arrange for 32-bit alignment. ABI details such as structure layout are
not affected by these options.
-@item -m32-bit
-@itemx -m16-bit
-@itemx -m8-bit
@opindex m32-bit
@opindex m16-bit
@opindex m8-bit
+@item -m32-bit
+@itemx -m16-bit
+@itemx -m8-bit
Similar to the stack- data- and const-align options above, these options
arrange for stack frame, writable data and constants to all be 32-bit,
16-bit or 8-bit aligned. The default is 32-bit alignment.
-@item -mno-prologue-epilogue
-@itemx -mprologue-epilogue
@opindex mno-prologue-epilogue
@opindex mprologue-epilogue
+@item -mno-prologue-epilogue
+@itemx -mprologue-epilogue
With @option{-mno-prologue-epilogue}, the normal function prologue and
epilogue which set up the stack frame are omitted and no return
instructions or return sequences are generated in the code. Use this
warnings or errors are generated when call-saved registers must be saved,
or storage for local variables needs to be allocated.
-@item -melf
@opindex melf
+@item -melf
Legacy no-op option.
-@item -sim
@opindex sim
+@item -sim
This option arranges
to link with input-output functions from a simulator library. Code,
initialized data and zero-initialized data are allocated consecutively.
-@item -sim2
@opindex sim2
+@item -sim2
Like @option{-sim}, but pass linker options to locate initialized data at
0x40000000 and zero-initialized data at 0x80000000.
@end table
@table @gcctabopt
-@item -march=@var{arch}
@opindex march=
+@item -march=@var{arch}
Specify the C-SKY target architecture. Valid values for @var{arch} are:
@samp{ck801}, @samp{ck802}, @samp{ck803}, @samp{ck807}, and @samp{ck810}.
The default is @samp{ck810}.
-@item -mcpu=@var{cpu}
@opindex mcpu=
+@item -mcpu=@var{cpu}
Specify the C-SKY target processor. Valid values for @var{cpu} are:
@samp{ck801}, @samp{ck801t},
@samp{ck802}, @samp{ck802t}, @samp{ck802j},
@samp{ck810}, @samp{ck810v}, @samp{ck810f}, @samp{ck810t}, @samp{ck810fv},
@samp{ck810tv}, @samp{ck810ft}, and @samp{ck810ftv}.
-@item -mbig-endian
@opindex mbig-endian
-@itemx -EB
@opindex EB
-@itemx -mlittle-endian
@opindex mlittle-endian
-@itemx -EL
@opindex EL
+@item -mbig-endian
+@itemx -EB
+@itemx -mlittle-endian
+@itemx -EL
Select big- or little-endian code. The default is little-endian.
-@item -mfloat-abi=@var{name}
@opindex mfloat-abi
+@item -mfloat-abi=@var{name}
Specifies which floating-point ABI to use. Permissible values
are: @samp{soft}, @samp{softfp} and @samp{hard}.
compile your entire program with the same ABI, and link with a
compatible set of libraries.
-@item -mhard-float
@opindex mhard-float
-@itemx -msoft-float
@opindex msoft-float
+@item -mhard-float
+@itemx -msoft-float
Select hardware or software floating-point implementations.
The default is soft float.
+@opindex mdouble-float
@item -mdouble-float
@itemx -mno-double-float
-@opindex mdouble-float
When @option{-mhard-float} is in effect, enable generation of
double-precision float instructions. This is the default except
when compiling for CK803.
+@opindex mfdivdu
@item -mfdivdu
@itemx -mno-fdivdu
-@opindex mfdivdu
When @option{-mhard-float} is in effect, enable generation of
@code{frecipd}, @code{fsqrtd}, and @code{fdivd} instructions.
This is the default except when compiling for CK803.
-@item -mfpu=@var{fpu}
@opindex mfpu=
+@item -mfpu=@var{fpu}
Select the floating-point processor. This option can only be used with
@option{-mhard-float}.
Values for @var{fpu} are
@samp{fpv2} (@samp{-mdouble-float -mno-divdu}), and
@samp{fpv2_divd} (@samp{-mdouble-float -mdivdu}).
+@opindex melrw
@item -melrw
@itemx -mno-elrw
-@opindex melrw
Enable the extended @code{lrw} instruction. This option defaults to on
for CK801 and off otherwise.
+@opindex mistack
@item -mistack
@itemx -mno-istack
-@opindex mistack
Enable interrupt stack instructions; the default is off.
The @option{-mistack} option is required to handle the
@code{interrupt} and @code{isr} function attributes
(@pxref{C-SKY Function Attributes}).
-@item -mmp
@opindex mmp
+@item -mmp
Enable multiprocessor instructions; the default is off.
-@item -mcp
@opindex mcp
+@item -mcp
Enable coprocessor instructions; the default is off.
-@item -mcache
@opindex mcache
+@item -mcache
Enable coprocessor instructions; the default is off.
-@item -msecurity
@opindex msecurity
+@item -msecurity
Enable C-SKY security instructions; the default is off.
-@item -mtrust
@opindex mtrust
+@item -mtrust
Enable C-SKY trust instructions; the default is off.
-@item -mdsp
@opindex mdsp
-@itemx -medsp
@opindex medsp
-@itemx -mvdsp
@opindex mvdsp
+@item -mdsp
+@itemx -medsp
+@itemx -mvdsp
Enable C-SKY DSP, Enhanced DSP, or Vector DSP instructions, respectively.
All of these options default to off.
+@opindex mdiv
@item -mdiv
@itemx -mno-div
-@opindex mdiv
Generate divide instructions. Default is off.
+@opindex msmart
@item -msmart
@itemx -mno-smart
-@opindex msmart
Generate code for Smart Mode, using only registers numbered 0-7 to allow
use of 16-bit instructions. This option is ignored for CK801 where this
is the required behavior, and it defaults to on for CK802.
For other targets, the default is off.
+@opindex mhigh-registers
@item -mhigh-registers
@itemx -mno-high-registers
-@opindex mhigh-registers
Generate code using the high registers numbered 16-31. This option
is not supported on CK801, CK802, or CK803, and is enabled by default
for other processors.
+@opindex manchor
@item -manchor
@itemx -mno-anchor
-@opindex manchor
Generate code using global anchor symbol addresses.
+@opindex mpushpop
@item -mpushpop
@itemx -mno-pushpop
-@opindex mpushpop
Generate code using @code{push} and @code{pop} instructions. This option
defaults to on.
+@opindex mmultiple-stld
@item -mmultiple-stld
@itemx -mstm
@itemx -mno-multiple-stld
@itemx -mno-stm
-@opindex mmultiple-stld
Generate code using @code{stm} and @code{ldm} instructions. This option
isn't supported on CK801 but is enabled by default on other processors.
+@opindex mconstpool
@item -mconstpool
@itemx -mno-constpool
-@opindex mconstpool
Create constant pools in the compiler instead of deferring it to the
assembler. This option is the default and required for correct code
generation on CK801 and CK802, and is optional on other processors.
+@opindex mstack-size
@item -mstack-size
@item -mno-stack-size
-@opindex mstack-size
Emit @code{.stack_size} directives for each function in the assembly
output. This option defaults to off.
+@opindex mccrt
@item -mccrt
@itemx -mno-ccrt
-@opindex mccrt
Generate code for the C-SKY compiler runtime instead of libgcc. This
option defaults to off.
-@item -mbranch-cost=@var{n}
@opindex mbranch-cost=
+@item -mbranch-cost=@var{n}
Set the branch costs to roughly @code{n} instructions. The default is 1.
+@opindex msched-prolog
@item -msched-prolog
@itemx -mno-sched-prolog
-@opindex msched-prolog
Permit scheduling of function prologue and epilogue sequences. Using
this option can result in code that is not compliant with the C-SKY V2 ABI
prologue requirements and that cannot be debugged or backtraced.
It is disabled by default.
-@item -msim
@opindex msim
+@item -msim
Links the library libsemi.a which is in compatible with simulator. Applicable
to ELF compiler only.
restrictive subtype of any of its input files.
@table @gcctabopt
-@item -F@var{dir}
@opindex F
+@item -F@var{dir}
Add the framework directory @var{dir} to the head of the list of
directories to be searched for header files. These directories are
interleaved with those specified by @option{-I} options and are
the name of the framework and @file{header.h} is found in the
@file{PrivateHeaders} or @file{Headers} directory.
-@item -iframework@var{dir}
@opindex iframework
+@item -iframework@var{dir}
Like @option{-F} except the directory is a treated as a system
directory. The main difference between this @option{-iframework} and
@option{-F} is that with @option{-iframework} the compiler does not
warn about constructs contained within header files found via
@var{dir}. This option is valid only for the C family of languages.
-@item -gused
@opindex gused
+@item -gused
Emit debugging information for symbols that are used. For stabs
debugging format, this enables @option{-feliminate-unused-debug-symbols}.
This is by default ON@.
-@item -gfull
@opindex gfull
+@item -gfull
Emit debugging information for all symbols and types.
@item -mmacosx-version-min=@var{version}
compiler is running, otherwise the default is to make choices that
are compatible with as many systems and code bases as possible.
-@item -mkernel
@opindex mkernel
+@item -mkernel
Enable kernel development mode. The @option{-mkernel} option sets
@option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
@option{-fno-exceptions}, @option{-fno-non-call-exceptions},
@option{-msoft-float}, @option{-fno-builtin} and
@option{-mlong-branch} for PowerPC targets.
-@item -mone-byte-bool
@opindex mone-byte-bool
+@item -mone-byte-bool
Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
By default @code{sizeof(bool)} is @code{4} when compiling for
Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
other modules in a program, including system libraries. Use this
switch to conform to a non-default data model.
-@item -mfix-and-continue
-@itemx -ffix-and-continue
-@itemx -findirect-data
@opindex mfix-and-continue
@opindex ffix-and-continue
@opindex findirect-data
+@item -mfix-and-continue
+@itemx -ffix-and-continue
+@itemx -findirect-data
Generate code suitable for fast turnaround development, such as to
allow GDB to dynamically load @file{.o} files into already-running
programs. @option{-findirect-data} and @option{-ffix-and-continue}
are provided for backwards compatibility.
-@item -all_load
@opindex all_load
+@item -all_load
Loads all members of static archive libraries.
See man ld(1) for more information.
-@item -arch_errors_fatal
@opindex arch_errors_fatal
+@item -arch_errors_fatal
Cause the errors having to do with files that have the wrong architecture
to be fatal.
-@item -bind_at_load
@opindex bind_at_load
+@item -bind_at_load
Causes the output file to be marked such that the dynamic linker will
bind all undefined references when the file is loaded or launched.
-@item -bundle
@opindex bundle
+@item -bundle
Produce a Mach-o bundle format file.
See man ld(1) for more information.
-@item -bundle_loader @var{executable}
@opindex bundle_loader
+@item -bundle_loader @var{executable}
This option specifies the @var{executable} that will load the build
output file being linked. See man ld(1) for more information.
-@item -dynamiclib
@opindex dynamiclib
+@item -dynamiclib
When passed this option, GCC produces a dynamic library instead of
an executable when linking, using the Darwin @file{libtool} command.
-@item -force_cpusubtype_ALL
@opindex force_cpusubtype_ALL
+@item -force_cpusubtype_ALL
This causes GCC's output file to have the @samp{ALL} subtype, instead of
one controlled by the @option{-mcpu} or @option{-march} option.
@itemx -static
@itemx -sub_library
@need 800
-@itemx -sub_umbrella
-@itemx -twolevel_namespace
-@itemx -umbrella
-@itemx -undefined
-@itemx -unexported_symbols_list
-@itemx -weak_reference_mismatches
-@itemx -whatsloaded
@opindex allowable_client
@opindex client_name
@opindex compatibility_version
@opindex unexported_symbols_list
@opindex weak_reference_mismatches
@opindex whatsloaded
+@itemx -sub_umbrella
+@itemx -twolevel_namespace
+@itemx -umbrella
+@itemx -undefined
+@itemx -unexported_symbols_list
+@itemx -weak_reference_mismatches
+@itemx -whatsloaded
These options are passed to the Darwin linker. The Darwin linker man page
describes them in detail.
@end table
These @samp{-m} options are defined for the DEC Alpha implementations:
@table @gcctabopt
-@item -mno-soft-float
-@itemx -msoft-float
@opindex mno-soft-float
@opindex msoft-float
+@item -mno-soft-float
+@itemx -msoft-float
Use (do not use) the hardware floating-point instructions for
floating-point operations. When @option{-msoft-float} is specified,
functions in @file{libgcc.a} are used to perform floating-point
Note that Alpha implementations without floating-point operations are
required to have floating-point registers.
-@item -mfp-reg
-@itemx -mno-fp-regs
@opindex mfp-reg
@opindex mno-fp-regs
+@item -mfp-reg
+@itemx -mno-fp-regs
Generate code that uses (does not use) the floating-point register set.
@option{-mno-fp-regs} implies @option{-msoft-float}. If the floating-point
register set is not used, floating-point operands are passed in integer
A typical use of this option is building a kernel that does not use,
and hence need not save and restore, any floating-point registers.
-@item -mieee
@opindex mieee
+@item -mieee
The Alpha architecture implements floating-point hardware optimized for
maximum performance. It is mostly compliant with the IEEE floating-point
standard. However, for full compliance, software assistance is
values such as not-a-number and plus/minus infinity. Other Alpha
compilers call this option @option{-ieee_with_no_inexact}.
-@item -mieee-with-inexact
@opindex mieee-with-inexact
+@item -mieee-with-inexact
This is like @option{-mieee} except the generated code also maintains
the IEEE @var{inexact-flag}. Turning on this option causes the
generated code to implement fully-compliant IEEE math. In addition to
normally not specify this option. Other Alpha compilers call this
option @option{-ieee_with_inexact}.
-@item -mfp-trap-mode=@var{trap-mode}
@opindex mfp-trap-mode
+@item -mfp-trap-mode=@var{trap-mode}
This option controls what floating-point related traps are enabled.
Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
The trap mode can be set to one of four values:
Like @samp{su}, but inexact traps are enabled as well.
@end table
-@item -mfp-rounding-mode=@var{rounding-mode}
@opindex mfp-rounding-mode
+@item -mfp-rounding-mode=@var{rounding-mode}
Selects the IEEE rounding mode. Other Alpha compilers call this option
@option{-fprm @var{rounding-mode}}. The @var{rounding-mode} can be one
of:
@var{fpcr}, @samp{d} corresponds to round towards plus infinity.
@end table
-@item -mtrap-precision=@var{trap-precision}
@opindex mtrap-precision
+@item -mtrap-precision=@var{trap-precision}
In the Alpha architecture, floating-point traps are imprecise. This
means without software assistance it is impossible to recover from a
floating trap and program execution normally needs to be terminated.
Other Alpha compilers provide the equivalent options called
@option{-scope_safe} and @option{-resumption_safe}.
-@item -mieee-conformant
@opindex mieee-conformant
+@item -mieee-conformant
This option marks the generated code as IEEE conformant. You must not
use this option unless you also specify @option{-mtrap-precision=i} and either
@option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}. Its only effect
is to emit the line @samp{.eflag 48} in the function prologue of the
generated assembly file.
-@item -mbuild-constants
@opindex mbuild-constants
+@item -mbuild-constants
Normally GCC examines a 32- or 64-bit integer constant to
see if it can construct it from smaller constants in two or three
instructions. If it cannot, it outputs the constant as a literal and
loader. Itself a shared library, it must relocate itself in memory
before it can find the variables and constants in its own data segment.
-@item -mbwx
-@itemx -mno-bwx
-@itemx -mcix
-@itemx -mno-cix
-@itemx -mfix
-@itemx -mno-fix
-@itemx -mmax
-@itemx -mno-max
@opindex mbwx
@opindex mno-bwx
@opindex mcix
@opindex mno-fix
@opindex mmax
@opindex mno-max
+@item -mbwx
+@itemx -mno-bwx
+@itemx -mcix
+@itemx -mno-cix
+@itemx -mfix
+@itemx -mno-fix
+@itemx -mmax
+@itemx -mno-max
Indicate whether GCC should generate code to use the optional BWX,
CIX, FIX and MAX instruction sets. The default is to use the instruction
sets supported by the CPU type specified via @option{-mcpu=} option or that
of the CPU on which GCC was built if none is specified.
-@item -mfloat-vax
-@itemx -mfloat-ieee
@opindex mfloat-vax
@opindex mfloat-ieee
+@item -mfloat-vax
+@itemx -mfloat-ieee
Generate code that uses (does not use) VAX F and G floating-point
arithmetic instead of IEEE single and double precision.
-@item -mexplicit-relocs
-@itemx -mno-explicit-relocs
@opindex mexplicit-relocs
@opindex mno-explicit-relocs
+@item -mexplicit-relocs
+@itemx -mno-explicit-relocs
Older Alpha assemblers provided no way to generate symbol relocations
except via assembler macros. Use of these macros does not allow
optimal instruction scheduling. GNU binutils as of version 2.12
is mostly useful for debugging, as GCC detects the capabilities of
the assembler when it is built and sets the default accordingly.
-@item -msmall-data
-@itemx -mlarge-data
@opindex msmall-data
@opindex mlarge-data
+@item -msmall-data
+@itemx -mlarge-data
When @option{-mexplicit-relocs} is in effect, static data is
accessed via @dfn{gp-relative} relocations. When @option{-msmall-data}
is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
When generating code for shared libraries, @option{-fpic} implies
@option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
-@item -msmall-text
-@itemx -mlarge-text
@opindex msmall-text
@opindex mlarge-text
+@item -msmall-text
+@itemx -mlarge-text
When @option{-msmall-text} is used, the compiler assumes that the
code of the entire program (or shared library) fits in 4MB, and is
thus reachable with a branch instruction. When @option{-msmall-data}
The default is @option{-mlarge-text}.
-@item -mcpu=@var{cpu_type}
@opindex mcpu
+@item -mcpu=@var{cpu_type}
Set the instruction set and instruction scheduling parameters for
machine type @var{cpu_type}. You can specify either the @samp{EV}
style name or the corresponding chip number. GCC supports scheduling
@option{-mcpu=native} has no effect if GCC does not recognize
the processor.
-@item -mtune=@var{cpu_type}
@opindex mtune
+@item -mtune=@var{cpu_type}
Set only the instruction scheduling parameters for machine type
@var{cpu_type}. The instruction set is not changed.
@option{-mtune=native} has no effect if GCC does not recognize
the processor.
-@item -mmemory-latency=@var{time}
@opindex mmemory-latency
+@item -mmemory-latency=@var{time}
Sets the latency the scheduler should assume for typical memory
references as seen by the application. This number is highly
dependent on the memory access patterns used by the application
@samp{32767}. Defaults to whatever limit is imposed by the version of
the Linux kernel targeted.
-@item -mkernel=@var{version}
@opindex mkernel
+@item -mkernel=@var{version}
This specifies the minimum version of the kernel that will run the
compiled program. GCC uses this version to determine which
instructions to use, what kernel helpers to allow, etc. Currently,
@samp{4.18}, @samp{4.19}, @samp{4.20}, @samp{5.0}, @samp{5.1},
@samp{5.2}, @samp{latest} and @samp{native}.
-@item -mbig-endian
@opindex mbig-endian
+@item -mbig-endian
Generate code for a big-endian target.
-@item -mlittle-endian
@opindex mlittle-endian
+@item -mlittle-endian
Generate code for a little-endian target. This is the default.
-@item -mjmpext
@opindex mjmpext
+@item -mjmpext
Enable generation of extra conditional-branch instructions.
Enabled for CPU v2 and above.
-@item -mjmp32
@opindex mjmp32
+@item -mjmp32
Enable 32-bit jump instructions. Enabled for CPU v3 and above.
-@item -malu32
@opindex malu32
+@item -malu32
Enable 32-bit ALU instructions. Enabled for CPU v3 and above.
-@item -mcpu=@var{version}
@opindex mcpu
+@item -mcpu=@var{version}
This specifies which version of the eBPF ISA to target. Newer versions
may not be supported by all kernels. The default is @samp{v3}.
@end table
-@item -mco-re
@opindex mco-re
+@item -mco-re
Enable BPF Compile Once - Run Everywhere (CO-RE) support. Requires and
is implied by @option{-gbtf}.
-@item -mno-co-re
@opindex mno-co-re
+@item -mno-co-re
Disable BPF Compile Once - Run Everywhere (CO-RE) support. BPF CO-RE
support is enabled by default when generating BTF debug information for
the BPF target.
@table @gcctabopt
-@item -msmall-model
@opindex msmall-model
+@item -msmall-model
Use the small address space model. This can produce smaller code, but
it does assume that all symbolic values and addresses fit into a
20-bit range.
-@item -mno-lsim
@opindex mno-lsim
+@item -mno-lsim
Assume that runtime support has been provided and so there is no need
to include the simulator library (@file{libsim.a}) on the linker
command line.
@table @gcctabopt
-@item -msim
@opindex msim
+@item -msim
Specifies that the program will be run on the simulator. This causes
an alternate runtime startup and library to be linked.
You must not use this option when generating programs that will run on
real hardware; you must provide your own runtime library for whatever
I/O functions are needed.
-@item -mlra
@opindex mlra
+@item -mlra
Enable Local Register Allocation. This is still experimental for FT32,
so by default the compiler uses standard reload.
-@item -mnodiv
@opindex mnodiv
+@item -mnodiv
Do not use div and mod instructions.
-@item -mft32b
@opindex mft32b
+@item -mft32b
Enable use of the extended instructions of the FT32B processor.
-@item -mcompress
@opindex mcompress
+@item -mcompress
Compress all code using the Ft32B code compression scheme.
-@item -mnopm
@opindex mnopm
+@item -mnopm
Do not generate code that reads program memory.
@end table
@cindex FRV Options
@table @gcctabopt
-@item -mgpr-32
@opindex mgpr-32
+@item -mgpr-32
Only use the first 32 general-purpose registers.
-@item -mgpr-64
@opindex mgpr-64
+@item -mgpr-64
Use all 64 general-purpose registers.
-@item -mfpr-32
@opindex mfpr-32
+@item -mfpr-32
Use only the first 32 floating-point registers.
-@item -mfpr-64
@opindex mfpr-64
+@item -mfpr-64
Use all 64 floating-point registers.
-@item -mhard-float
@opindex mhard-float
+@item -mhard-float
Use hardware instructions for floating-point operations.
-@item -msoft-float
@opindex msoft-float
+@item -msoft-float
Use library routines for floating-point operations.
-@item -malloc-cc
@opindex malloc-cc
+@item -malloc-cc
Dynamically allocate condition code registers.
-@item -mfixed-cc
@opindex mfixed-cc
+@item -mfixed-cc
Do not try to dynamically allocate condition code registers, only
use @code{icc0} and @code{fcc0}.
-@item -mdword
@opindex mdword
+@item -mdword
Change ABI to use double word insns.
-@item -mno-dword
@opindex mno-dword
@opindex mdword
+@item -mno-dword
Do not use double word instructions.
-@item -mdouble
@opindex mdouble
+@item -mdouble
Use floating-point double instructions.
-@item -mno-double
@opindex mno-double
+@item -mno-double
Do not use floating-point double instructions.
-@item -mmedia
@opindex mmedia
+@item -mmedia
Use media instructions.
-@item -mno-media
@opindex mno-media
+@item -mno-media
Do not use media instructions.
-@item -mmuladd
@opindex mmuladd
+@item -mmuladd
Use multiply and add/subtract instructions.
-@item -mno-muladd
@opindex mno-muladd
+@item -mno-muladd
Do not use multiply and add/subtract instructions.
-@item -mfdpic
@opindex mfdpic
+@item -mfdpic
Select the FDPIC ABI, which uses function descriptors to represent
pointers to functions. Without any PIC/PIE-related options, it
are computed with 32 bits.
With a @samp{bfin-elf} target, this option implies @option{-msim}.
-@item -minline-plt
@opindex minline-plt
+@item -minline-plt
Enable inlining of PLT entries in function calls to functions that are
not known to bind locally. It has no effect without @option{-mfdpic}.
optimization option such as @option{-O3} or above is present in the
command line.
-@item -mTLS
@opindex mTLS
+@item -mTLS
Assume a large TLS segment when generating thread-local code.
-@item -mtls
@opindex mtls
+@item -mtls
Do not assume a large TLS segment when generating thread-local code.
-@item -mgprel-ro
@opindex mgprel-ro
+@item -mgprel-ro
Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
that is known to be in read-only sections. It's enabled by default,
for a GOT entry for the referenced symbol, so it's more likely to be a
win. If it is not, @option{-mno-gprel-ro} can be used to disable it.
-@item -multilib-library-pic
@opindex multilib-library-pic
+@item -multilib-library-pic
Link with the (library, not FD) pic libraries. It's implied by
@option{-mlibrary-pic}, as well as by @option{-fPIC} and
@option{-fpic} without @option{-mfdpic}. You should never have to use
it explicitly.
-@item -mlinked-fp
@opindex mlinked-fp
+@item -mlinked-fp
Follow the EABI requirement of always creating a frame pointer whenever
a stack frame is allocated. This option is enabled by default and can
be disabled with @option{-mno-linked-fp}.
-@item -mlong-calls
@opindex mlong-calls
+@item -mlong-calls
Use indirect addressing to call functions outside the current
compilation unit. This allows the functions to be placed anywhere
within the 32-bit address space.
-@item -malign-labels
@opindex malign-labels
+@item -malign-labels
Try to align labels to an 8-byte boundary by inserting NOPs into the
previous packet. This option only has an effect when VLIW packing
is enabled. It doesn't create new packets; it merely adds NOPs to
existing ones.
-@item -mlibrary-pic
@opindex mlibrary-pic
+@item -mlibrary-pic
Generate position-independent EABI code.
-@item -macc-4
@opindex macc-4
+@item -macc-4
Use only the first four media accumulator registers.
-@item -macc-8
@opindex macc-8
+@item -macc-8
Use all eight media accumulator registers.
-@item -mpack
@opindex mpack
+@item -mpack
Pack VLIW instructions.
-@item -mno-pack
@opindex mno-pack
+@item -mno-pack
Do not pack VLIW instructions.
-@item -mno-eflags
@opindex mno-eflags
+@item -mno-eflags
Do not mark ABI switches in e_flags.
-@item -mcond-move
@opindex mcond-move
+@item -mcond-move
Enable the use of conditional-move instructions (default).
This switch is mainly for debugging the compiler and will likely be removed
in a future version.
-@item -mno-cond-move
@opindex mno-cond-move
+@item -mno-cond-move
Disable the use of conditional-move instructions.
This switch is mainly for debugging the compiler and will likely be removed
in a future version.
-@item -mscc
@opindex mscc
+@item -mscc
Enable the use of conditional set instructions (default).
This switch is mainly for debugging the compiler and will likely be removed
in a future version.
-@item -mno-scc
@opindex mno-scc
+@item -mno-scc
Disable the use of conditional set instructions.
This switch is mainly for debugging the compiler and will likely be removed
in a future version.
-@item -mcond-exec
@opindex mcond-exec
+@item -mcond-exec
Enable the use of conditional execution (default).
This switch is mainly for debugging the compiler and will likely be removed
in a future version.
-@item -mno-cond-exec
@opindex mno-cond-exec
+@item -mno-cond-exec
Disable the use of conditional execution.
This switch is mainly for debugging the compiler and will likely be removed
in a future version.
-@item -mvliw-branch
@opindex mvliw-branch
+@item -mvliw-branch
Run a pass to pack branches into VLIW instructions (default).
This switch is mainly for debugging the compiler and will likely be removed
in a future version.
-@item -mno-vliw-branch
@opindex mno-vliw-branch
+@item -mno-vliw-branch
Do not run a pass to pack branches into VLIW instructions.
This switch is mainly for debugging the compiler and will likely be removed
in a future version.
-@item -mmulti-cond-exec
@opindex mmulti-cond-exec
+@item -mmulti-cond-exec
Enable optimization of @code{&&} and @code{||} in conditional execution
(default).
This switch is mainly for debugging the compiler and will likely be removed
in a future version.
-@item -mno-multi-cond-exec
@opindex mno-multi-cond-exec
+@item -mno-multi-cond-exec
Disable optimization of @code{&&} and @code{||} in conditional execution.
This switch is mainly for debugging the compiler and will likely be removed
in a future version.
-@item -mnested-cond-exec
@opindex mnested-cond-exec
+@item -mnested-cond-exec
Enable nested conditional execution optimizations (default).
This switch is mainly for debugging the compiler and will likely be removed
in a future version.
-@item -mno-nested-cond-exec
@opindex mno-nested-cond-exec
+@item -mno-nested-cond-exec
Disable nested conditional execution optimizations.
This switch is mainly for debugging the compiler and will likely be removed
in a future version.
-@item -moptimize-membar
@opindex moptimize-membar
+@item -moptimize-membar
This switch removes redundant @code{membar} instructions from the
compiler-generated code. It is enabled by default.
-@item -mno-optimize-membar
@opindex mno-optimize-membar
@opindex moptimize-membar
+@item -mno-optimize-membar
This switch disables the automatic removal of redundant @code{membar}
instructions from the generated code.
-@item -mtomcat-stats
@opindex mtomcat-stats
+@item -mtomcat-stats
Cause gas to print out tomcat statistics.
-@item -mcpu=@var{cpu}
@opindex mcpu
+@item -mcpu=@var{cpu}
Select the processor type for which to generate code. Possible values are
@samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
These @samp{-m} options are defined for GNU/Linux targets:
@table @gcctabopt
-@item -mglibc
@opindex mglibc
+@item -mglibc
Use the GNU C library. This is the default except
on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
@samp{*-*-linux-*android*} targets.
-@item -muclibc
@opindex muclibc
+@item -muclibc
Use uClibc C library. This is the default on
@samp{*-*-linux-*uclibc*} targets.
-@item -mmusl
@opindex mmusl
+@item -mmusl
Use the musl C library. This is the default on
@samp{*-*-linux-*musl*} targets.
-@item -mbionic
@opindex mbionic
+@item -mbionic
Use Bionic C library. This is the default on
@samp{*-*-linux-*android*} targets.
-@item -mandroid
@opindex mandroid
+@item -mandroid
Compile code compatible with Android platform. This is the default on
@samp{*-*-linux-*android*} targets.
Finally, this option causes the preprocessor macro @code{__ANDROID__}
to be defined.
-@item -tno-android-cc
@opindex tno-android-cc
+@item -tno-android-cc
Disable compilation effects of @option{-mandroid}, i.e., do not enable
@option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
@option{-fno-rtti} by default.
-@item -tno-android-ld
@opindex tno-android-ld
+@item -tno-android-ld
Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
linking options to the linker.
These @samp{-m} options are defined for the H8/300 implementations:
@table @gcctabopt
-@item -mrelax
@opindex mrelax
+@item -mrelax
Shorten some address references at link time, when possible; uses the
linker option @option{-relax}. @xref{H8/300,, @code{ld} and the H8/300,
ld, Using ld}, for a fuller description.
-@item -mh
@opindex mh
+@item -mh
Generate code for the H8/300H@.
-@item -ms
@opindex ms
+@item -ms
Generate code for the H8S@.
-@item -mn
@opindex mn
+@item -mn
Generate code for the H8S and H8/300H in the normal mode. This switch
must be used either with @option{-mh} or @option{-ms}.
-@item -ms2600
@opindex ms2600
+@item -ms2600
Generate code for the H8S/2600. This switch must be used with @option{-ms}.
-@item -mexr
@opindex mexr
+@item -mexr
Extended registers are stored on stack before execution of function
with monitor attribute. Default option is @option{-mexr}.
This option is valid only for H8S targets.
-@item -mno-exr
@opindex mno-exr
@opindex mexr
+@item -mno-exr
Extended registers are not stored on stack before execution of function
with monitor attribute. Default option is @option{-mno-exr}.
This option is valid only for H8S targets.
-@item -mint32
@opindex mint32
+@item -mint32
Make @code{int} data 32 bits by default.
-@item -malign-300
@opindex malign-300
+@item -malign-300
On the H8/300H and H8S, use the same alignment rules as for the H8/300.
The default for the H8/300H and H8S is to align longs and floats on
4-byte boundaries.
These @samp{-m} options are defined for the HPPA family of computers:
@table @gcctabopt
-@item -march=@var{architecture-type}
@opindex march
+@item -march=@var{architecture-type}
Generate code for the specified architecture. The choices for
@var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
1.1, and @samp{2.0} for PA 2.0 processors. Refer to
architectures runs on higher numbered architectures, but not the
other way around.
-@item -mpa-risc-1-0
-@itemx -mpa-risc-1-1
-@itemx -mpa-risc-2-0
@opindex mpa-risc-1-0
@opindex mpa-risc-1-1
@opindex mpa-risc-2-0
+@item -mpa-risc-1-0
+@itemx -mpa-risc-1-1
+@itemx -mpa-risc-2-0
Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
-@item -matomic-libcalls
@opindex matomic-libcalls
@opindex mno-atomic-libcalls
+@item -matomic-libcalls
Generate libcalls for atomic loads and stores when sync libcalls are disabled.
This option is enabled by default. It only affects the generation of
atomic libcalls by the HPPA backend.
It also provides special handling for atomic DImode accesses on 32-bit
targets.
-@item -mbig-switch
@opindex mbig-switch
+@item -mbig-switch
Does nothing. Preserved for backward compatibility.
-@item -mcaller-copies
@opindex mcaller-copies
+@item -mcaller-copies
The caller copies function arguments passed by hidden reference. This
option should be used with care as it is not compatible with the default
32-bit runtime. However, only aggregates larger than eight bytes are
passed by hidden reference and the option provides better compatibility
with OpenMP.
-@item -mcoherent-ldcw
@opindex mcoherent-ldcw
+@item -mcoherent-ldcw
Use ldcw/ldcd coherent cache-control hint.
-@item -mdisable-fpregs
@opindex mdisable-fpregs
+@item -mdisable-fpregs
Disable floating-point registers. Equivalent to @code{-msoft-float}.
-@item -mdisable-indexing
@opindex mdisable-indexing
+@item -mdisable-indexing
Prevent the compiler from using indexing address modes. This avoids some
rather obscure problems when compiling MIG generated code under MACH@.
-@item -mfast-indirect-calls
@opindex mfast-indirect-calls
+@item -mfast-indirect-calls
Generate code that assumes calls never cross space boundaries. This
allows GCC to emit code that performs faster indirect calls.
This option does not work in the presence of shared libraries or nested
functions.
-@item -mfixed-range=@var{register-range}
@opindex mfixed-range
+@item -mfixed-range=@var{register-range}
Generate code treating the given register range as fixed registers.
A fixed register is one that the register allocator cannot use. This is
useful when compiling kernel code. A register range is specified as
two registers separated by a dash. Multiple register ranges can be
specified separated by a comma.
-@item -mgas
@opindex mgas
+@item -mgas
Enable the use of assembler directives only GAS understands.
-@item -mgnu-ld
@opindex mgnu-ld
+@item -mgnu-ld
Use options specific to GNU @command{ld}.
This passes @option{-shared} to @command{ld} when
building a shared library. It is the default when GCC is configured,
using @samp{which `gcc -print-prog-name=ld`}. This option is only available
on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
-@item -mhp-ld
@opindex mhp-ld
+@item -mhp-ld
Use options specific to HP @command{ld}.
This passes @option{-b} to @command{ld} when building
a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
`gcc -print-prog-name=ld`}. This option is only available on the 64-bit
HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
-@item -mlinker-opt
@opindex mlinker-opt
+@item -mlinker-opt
Enable the optimization pass in the HP-UX linker. Note this makes symbolic
debugging impossible. It also triggers a bug in the HP-UX 8 and HP-UX 9
linkers in which they give bogus error messages when linking some programs.
-@item -mlong-calls
@opindex mno-long-calls
@opindex mlong-calls
+@item -mlong-calls
Generate code that uses long call sequences. This ensures that a call
is always able to reach linker generated stubs. The default is to generate
long calls only when the distance from the call site to the beginning
However, an indirect call is used on 32-bit ELF systems in pic code
and it is quite long.
-@item -mlong-load-store
@opindex mlong-load-store
+@item -mlong-load-store
Generate 3-instruction load and store sequences as sometimes required by
the HP-UX 10 linker. This is equivalent to the @samp{+k} option to
the HP compilers.
-@item -mjump-in-delay
@opindex mjump-in-delay
+@item -mjump-in-delay
This option is ignored and provided for compatibility purposes only.
-@item -mno-space-regs
@opindex mno-space-regs
@opindex mspace-regs
+@item -mno-space-regs
Generate code that assumes the target has no space registers. This allows
GCC to generate faster indirect calls and use unscaled index address modes.
Such code is suitable for level 0 PA systems and kernels.
-@item -mordered
@opindex mordered
+@item -mordered
Assume memory references are ordered and barriers are not needed.
-@item -mportable-runtime
@opindex mportable-runtime
+@item -mportable-runtime
Use the portable calling conventions proposed by HP for ELF systems.
-@item -mschedule=@var{cpu-type}
@opindex mschedule
+@item -mschedule=@var{cpu-type}
Schedule code according to the constraints for the machine type
@var{cpu-type}. The choices for @var{cpu-type} are @samp{700}
@samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}. Refer
proper scheduling option for your machine. The default scheduling is
@samp{8000}.
-@item -msio
@opindex msio
+@item -msio
Generate the predefine, @code{_SIO}, for server IO@. The default is
@option{-mwsio}. This generates the predefines, @code{__hp9000s700},
@code{__hp9000s700__} and @code{_WSIO}, for workstation IO@. These
options are available under HP-UX and HI-UX@.
-@item -msoft-float
@opindex msoft-float
+@item -msoft-float
Generate output containing library calls for floating point.
@strong{Warning:} the requisite libraries are not available for all HPPA
targets. Normally the facilities of the machine's usual C compiler are
library that comes with GCC, with @option{-msoft-float} in order for
this to work.
-@item -msoft-mult
@opindex msoft-mult
+@item -msoft-mult
Use software integer multiplication.
This disables the use of the @code{xmpyu} instruction.
-@item -munix=@var{unix-std}
@opindex march
+@item -munix=@var{unix-std}
Generate compiler predefines and select a startfile for the specified
UNIX standard. The choices for @var{unix-std} are @samp{93}, @samp{95}
and @samp{98}. @samp{93} is supported on all HP-UX versions. @samp{95}
standard must test, set and restore the variable @code{__xpg4_extended_mask}
as appropriate. Most GNU software doesn't provide this capability.
-@item -nolibdld
@opindex nolibdld
+@item -nolibdld
Suppress the generation of link options to search libdld.sl when the
@option{-static} option is specified on HP-UX 10 and later.
-@item -static
@opindex static
+@item -static
The HP-UX implementation of setlocale in libc has a dependency on
libdld.sl. There isn't an archive version of libdld.sl. Thus,
when the @option{-static} option is specified, special link options
@option{-nolibdld} option can be used to prevent the GCC driver from
adding these link options.
-@item -threads
@opindex threads
+@item -threads
Add support for multithreading with the @dfn{dce thread} library
under HP-UX@. This option sets flags for both the preprocessor and
linker.
These are the @samp{-m} options defined for the Intel IA-64 architecture.
@table @gcctabopt
-@item -mbig-endian
@opindex mbig-endian
+@item -mbig-endian
Generate code for a big-endian target. This is the default for HP-UX@.
-@item -mlittle-endian
@opindex mlittle-endian
+@item -mlittle-endian
Generate code for a little-endian target. This is the default for AIX5
and GNU/Linux.
-@item -mgnu-as
-@itemx -mno-gnu-as
@opindex mgnu-as
@opindex mno-gnu-as
+@item -mgnu-as
+@itemx -mno-gnu-as
Generate (or don't) code for the GNU assembler. This is the default.
@c Also, this is the default if the configure option @option{--with-gnu-as}
@c is used.
-@item -mgnu-ld
-@itemx -mno-gnu-ld
@opindex mgnu-ld
@opindex mno-gnu-ld
+@item -mgnu-ld
+@itemx -mno-gnu-ld
Generate (or don't) code for the GNU linker. This is the default.
@c Also, this is the default if the configure option @option{--with-gnu-ld}
@c is used.
-@item -mno-pic
@opindex mno-pic
+@item -mno-pic
Generate code that does not use a global pointer register. The result
is not position independent code, and violates the IA-64 ABI@.
-@item -mvolatile-asm-stop
-@itemx -mno-volatile-asm-stop
@opindex mvolatile-asm-stop
@opindex mno-volatile-asm-stop
+@item -mvolatile-asm-stop
+@itemx -mno-volatile-asm-stop
Generate (or don't) a stop bit immediately before and after volatile asm
statements.
-@item -mregister-names
-@itemx -mno-register-names
@opindex mregister-names
@opindex mno-register-names
+@item -mregister-names
+@itemx -mno-register-names
Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
the stacked registers. This may make assembler output more readable.
-@item -mno-sdata
-@itemx -msdata
@opindex mno-sdata
@opindex msdata
+@item -mno-sdata
+@itemx -msdata
Disable (or enable) optimizations that use the small data section. This may
be useful for working around optimizer bugs.
-@item -mconstant-gp
@opindex mconstant-gp
+@item -mconstant-gp
Generate code that uses a single constant global pointer value. This is
useful when compiling kernel code.
-@item -mauto-pic
@opindex mauto-pic
+@item -mauto-pic
Generate code that is self-relocatable. This implies @option{-mconstant-gp}.
This is useful when compiling firmware code.
-@item -minline-float-divide-min-latency
@opindex minline-float-divide-min-latency
+@item -minline-float-divide-min-latency
Generate code for inline divides of floating-point values
using the minimum latency algorithm.
-@item -minline-float-divide-max-throughput
@opindex minline-float-divide-max-throughput
+@item -minline-float-divide-max-throughput
Generate code for inline divides of floating-point values
using the maximum throughput algorithm.
-@item -mno-inline-float-divide
@opindex mno-inline-float-divide
+@item -mno-inline-float-divide
Do not generate inline code for divides of floating-point values.
-@item -minline-int-divide-min-latency
@opindex minline-int-divide-min-latency
+@item -minline-int-divide-min-latency
Generate code for inline divides of integer values
using the minimum latency algorithm.
-@item -minline-int-divide-max-throughput
@opindex minline-int-divide-max-throughput
+@item -minline-int-divide-max-throughput
Generate code for inline divides of integer values
using the maximum throughput algorithm.
-@item -mno-inline-int-divide
@opindex mno-inline-int-divide
@opindex minline-int-divide
+@item -mno-inline-int-divide
Do not generate inline code for divides of integer values.
-@item -minline-sqrt-min-latency
@opindex minline-sqrt-min-latency
+@item -minline-sqrt-min-latency
Generate code for inline square roots
using the minimum latency algorithm.
-@item -minline-sqrt-max-throughput
@opindex minline-sqrt-max-throughput
+@item -minline-sqrt-max-throughput
Generate code for inline square roots
using the maximum throughput algorithm.
-@item -mno-inline-sqrt
@opindex mno-inline-sqrt
+@item -mno-inline-sqrt
Do not generate inline code for @code{sqrt}.
-@item -mfused-madd
-@itemx -mno-fused-madd
@opindex mfused-madd
@opindex mno-fused-madd
+@item -mfused-madd
+@itemx -mno-fused-madd
Do (don't) generate code that uses the fused multiply/add or multiply/subtract
instructions. The default is to use these instructions.
-@item -mno-dwarf2-asm
-@itemx -mdwarf2-asm
@opindex mno-dwarf2-asm
@opindex mdwarf2-asm
+@item -mno-dwarf2-asm
+@itemx -mdwarf2-asm
Don't (or do) generate assembler code for the DWARF line number debugging
info. This may be useful when not using the GNU assembler.
-@item -mearly-stop-bits
-@itemx -mno-early-stop-bits
@opindex mearly-stop-bits
@opindex mno-early-stop-bits
+@item -mearly-stop-bits
+@itemx -mno-early-stop-bits
Allow stop bits to be placed earlier than immediately preceding the
instruction that triggered the stop bit. This can improve instruction
scheduling, but does not always do so.
-@item -mfixed-range=@var{register-range}
@opindex mfixed-range
+@item -mfixed-range=@var{register-range}
Generate code treating the given register range as fixed registers.
A fixed register is one that the register allocator cannot use. This is
useful when compiling kernel code. A register range is specified as
two registers separated by a dash. Multiple register ranges can be
specified separated by a comma.
-@item -mtls-size=@var{tls-size}
@opindex mtls-size
+@item -mtls-size=@var{tls-size}
Specify bit size of immediate TLS offsets. Valid values are 14, 22, and
64.
-@item -mtune=@var{cpu-type}
@opindex mtune
+@item -mtune=@var{cpu-type}
Tune the instruction scheduling for a particular CPU, Valid values are
@samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
and @samp{mckinley}.
-@item -milp32
-@itemx -mlp64
@opindex milp32
@opindex mlp64
+@item -milp32
+@itemx -mlp64
Generate code for a 32-bit or 64-bit environment.
The 32-bit environment sets int, long and pointer to 32 bits.
The 64-bit environment sets int to 32 bits and long and pointer
to 64 bits. These are HP-UX specific flags.
-@item -mno-sched-br-data-spec
-@itemx -msched-br-data-spec
@opindex mno-sched-br-data-spec
@opindex msched-br-data-spec
+@item -mno-sched-br-data-spec
+@itemx -msched-br-data-spec
(Dis/En)able data speculative scheduling before reload.
This results in generation of @code{ld.a} instructions and
the corresponding check instructions (@code{ld.c} / @code{chk.a}).
The default setting is disabled.
-@item -msched-ar-data-spec
-@itemx -mno-sched-ar-data-spec
@opindex msched-ar-data-spec
@opindex mno-sched-ar-data-spec
+@item -msched-ar-data-spec
+@itemx -mno-sched-ar-data-spec
(En/Dis)able data speculative scheduling after reload.
This results in generation of @code{ld.a} instructions and
the corresponding check instructions (@code{ld.c} / @code{chk.a}).
The default setting is enabled.
-@item -mno-sched-control-spec
-@itemx -msched-control-spec
@opindex mno-sched-control-spec
@opindex msched-control-spec
+@item -mno-sched-control-spec
+@itemx -msched-control-spec
(Dis/En)able control speculative scheduling. This feature is
available only during region scheduling (i.e.@: before reload).
This results in generation of the @code{ld.s} instructions and
the corresponding check instructions @code{chk.s}.
The default setting is disabled.
-@item -msched-br-in-data-spec
-@itemx -mno-sched-br-in-data-spec
@opindex msched-br-in-data-spec
@opindex mno-sched-br-in-data-spec
+@item -msched-br-in-data-spec
+@itemx -mno-sched-br-in-data-spec
(En/Dis)able speculative scheduling of the instructions that
are dependent on the data speculative loads before reload.
This is effective only with @option{-msched-br-data-spec} enabled.
The default setting is enabled.
-@item -msched-ar-in-data-spec
-@itemx -mno-sched-ar-in-data-spec
@opindex msched-ar-in-data-spec
@opindex mno-sched-ar-in-data-spec
+@item -msched-ar-in-data-spec
+@itemx -mno-sched-ar-in-data-spec
(En/Dis)able speculative scheduling of the instructions that
are dependent on the data speculative loads after reload.
This is effective only with @option{-msched-ar-data-spec} enabled.
The default setting is enabled.
-@item -msched-in-control-spec
-@itemx -mno-sched-in-control-spec
@opindex msched-in-control-spec
@opindex mno-sched-in-control-spec
+@item -msched-in-control-spec
+@itemx -mno-sched-in-control-spec
(En/Dis)able speculative scheduling of the instructions that
are dependent on the control speculative loads.
This is effective only with @option{-msched-control-spec} enabled.
The default setting is enabled.
-@item -mno-sched-prefer-non-data-spec-insns
-@itemx -msched-prefer-non-data-spec-insns
@opindex mno-sched-prefer-non-data-spec-insns
@opindex msched-prefer-non-data-spec-insns
+@item -mno-sched-prefer-non-data-spec-insns
+@itemx -msched-prefer-non-data-spec-insns
If enabled, data-speculative instructions are chosen for schedule
only if there are no other choices at the moment. This makes
the use of the data speculation much more conservative.
The default setting is disabled.
-@item -mno-sched-prefer-non-control-spec-insns
-@itemx -msched-prefer-non-control-spec-insns
@opindex mno-sched-prefer-non-control-spec-insns
@opindex msched-prefer-non-control-spec-insns
+@item -mno-sched-prefer-non-control-spec-insns
+@itemx -msched-prefer-non-control-spec-insns
If enabled, control-speculative instructions are chosen for schedule
only if there are no other choices at the moment. This makes
the use of the control speculation much more conservative.
The default setting is disabled.
-@item -mno-sched-count-spec-in-critical-path
-@itemx -msched-count-spec-in-critical-path
@opindex mno-sched-count-spec-in-critical-path
@opindex msched-count-spec-in-critical-path
+@item -mno-sched-count-spec-in-critical-path
+@itemx -msched-count-spec-in-critical-path
If enabled, speculative dependencies are considered during
computation of the instructions priorities. This makes the use of the
speculation a bit more conservative.
The default setting is disabled.
-@item -msched-spec-ldc
@opindex msched-spec-ldc
+@item -msched-spec-ldc
Use a simple data speculation check. This option is on by default.
-@item -msched-control-spec-ldc
@opindex msched-spec-ldc
+@item -msched-control-spec-ldc
Use a simple check for control speculation. This option is on by default.
-@item -msched-stop-bits-after-every-cycle
@opindex msched-stop-bits-after-every-cycle
+@item -msched-stop-bits-after-every-cycle
Place a stop bit after every cycle when scheduling. This option is on
by default.
-@item -msched-fp-mem-deps-zero-cost
@opindex msched-fp-mem-deps-zero-cost
+@item -msched-fp-mem-deps-zero-cost
Assume that floating-point stores and loads are not likely to cause a conflict
when placed into the same instruction group. This option is disabled by
default.
-@item -msel-sched-dont-check-control-spec
@opindex msel-sched-dont-check-control-spec
+@item -msel-sched-dont-check-control-spec
Generate checks for control speculation in selective scheduling.
This flag is disabled by default.
-@item -msched-max-memory-insns=@var{max-insns}
@opindex msched-max-memory-insns
+@item -msched-max-memory-insns=@var{max-insns}
Limit on the number of memory insns per instruction group, giving lower
priority to subsequent memory insns attempting to schedule in the same
instruction group. Frequently useful to prevent cache bank conflicts.
The default value is 1.
-@item -msched-max-memory-insns-hard-limit
@opindex msched-max-memory-insns-hard-limit
+@item -msched-max-memory-insns-hard-limit
Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
disallowing more than that number in an instruction group.
Otherwise, the limit is ``soft'', meaning that non-memory operations
These @option{-m} options are defined for the LatticeMico32 architecture:
@table @gcctabopt
-@item -mbarrel-shift-enabled
@opindex mbarrel-shift-enabled
+@item -mbarrel-shift-enabled
Enable barrel-shift instructions.
-@item -mdivide-enabled
@opindex mdivide-enabled
+@item -mdivide-enabled
Enable divide and modulus instructions.
-@item -mmultiply-enabled
@opindex multiply-enabled
+@item -mmultiply-enabled
Enable multiply instructions.
-@item -msign-extend-enabled
@opindex msign-extend-enabled
+@item -msign-extend-enabled
Enable sign extend instructions.
-@item -muser-enabled
@opindex muser-enabled
+@item -muser-enabled
Enable user-defined instructions.
@end table
These command-line options are defined for LoongArch targets:
@table @gcctabopt
-@item -march=@var{cpu-type}
@opindex march
+@item -march=@var{cpu-type}
Generate instructions for the machine type @var{cpu-type}. In contrast to
@option{-mtune=@var{cpu-type}}, which merely tunes the generated code
for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
LoongArch LA464 CPU with LBT, LSX, LASX, LVZ.
@end table
-@item -mtune=@var{cpu-type}
@opindex mtune
+@item -mtune=@var{cpu-type}
Optimize the output for the given processor, specified by microarchitecture
name.
-@item -mabi=@var{base-abi-type}
@opindex mabi
+@item -mabi=@var{base-abi-type}
Generate code for the specified calling convention.
@var{base-abi-type} can be one of:
@table @samp
is 32 bits, while @samp{long int} and pointers are 64 bits.
@end table
-@item -mfpu=@var{fpu-type}
@opindex mfpu
+@item -mfpu=@var{fpu-type}
Generate code for the specified FPU type, which can be one of:
@table @samp
@item 64
Prevent the use of hardware floating-point instructions.
@end table
-@item -msoft-float
@opindex msoft-float
+@item -msoft-float
Force @option{-mfpu=none} and prevents the use of floating-point
registers for parameter passing. This option may change the target
ABI.
-@item -msingle-float
@opindex msingle-float
+@item -msingle-float
Force @option{-mfpu=32} and allow the use of 32-bit floating-point
registers for parameter passing. This option may change the target
ABI.
-@item -mdouble-float
@opindex mdouble-float
+@item -mdouble-float
Force @option{-mfpu=64} and allow the use of 32/64-bit floating-point
registers for parameter passing. This option may change the target
ABI.
-@item -mbranch-cost=@var{n}
@opindex mbranch-cost
+@item -mbranch-cost=@var{n}
Set the cost of branches to roughly @var{n} instructions.
+@opindex mcheck-zero-division
@item -mcheck-zero-division
@itemx -mno-check-zero-divison
-@opindex mcheck-zero-division
Trap (do not trap) on integer division by zero. The default is
@option{-mcheck-zero-division} for @option{-O0} or @option{-Og}, and
@option{-mno-check-zero-division} for other optimization levels.
+@opindex mcond-move-int
@item -mcond-move-int
@itemx -mno-cond-move-int
-@opindex mcond-move-int
Conditional moves for integral data in general-purpose registers
are enabled (disabled). The default is @option{-mcond-move-int}.
+@opindex mcond-move-float
@item -mcond-move-float
@itemx -mno-cond-move-float
-@opindex mcond-move-float
Conditional moves for floating-point registers are enabled (disabled).
The default is @option{-mcond-move-float}.
+@opindex mmemcpy
@item -mmemcpy
@itemx -mno-memcpy
-@opindex mmemcpy
Force (do not force) the use of @code{memcpy} for non-trivial block moves.
The default is @option{-mno-memcpy}, which allows GCC to inline most
constant-sized copies. Setting optimization level to @option{-Os} also
behavior if explicitly specified, regardless of the order these options on
the command line.
+@opindex mstrict-align
@item -mstrict-align
@itemx -mno-strict-align
-@opindex mstrict-align
Avoid or allow generating memory accesses that may not be aligned on a natural
object boundary as described in the architecture specification. The default is
@option{-mno-strict-align}.
-@item -msmall-data-limit=@var{number}
@opindex msmall-data-limit
+@item -msmall-data-limit=@var{number}
Put global and static data smaller than @var{number} bytes into a special
section (on some targets). The default value is 0.
-@item -mmax-inline-memcpy-size=@var{n}
@opindex mmax-inline-memcpy-size
+@item -mmax-inline-memcpy-size=@var{n}
Inline all block moves (such as calls to @code{memcpy} or structure copies)
less than or equal to @var{n} bytes. The default value of @var{n} is 1024.
@end table
The default code model is @code{normal}.
-@item -mexplicit-relocs
-@itemx -mno-explicit-relocs
@opindex mexplicit-relocs
@opindex mno-explicit-relocs
+@item -mexplicit-relocs
+@itemx -mno-explicit-relocs
Use or do not use assembler relocation operators when dealing with symbolic
addresses. The alternative is to use assembler macros instead, which may
limit optimization. The default value for the option is determined during
debugging, or interoperation with assemblers different from the build-time
one.
+@opindex mdirect-extern-access
@item -mdirect-extern-access
@itemx -mno-direct-extern-access
-@opindex mdirect-extern-access
Do not use or use GOT to access external symbols. The default is
@option{-mno-direct-extern-access}: GOT is used for external symbols with
default visibility, but not used for other external symbols.
@cindex M32C options
@table @gcctabopt
-@item -mcpu=@var{name}
@opindex mcpu=
+@item -mcpu=@var{name}
Select the CPU for which code is generated. @var{name} may be one of
@samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
/60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
the M32C/80 series.
-@item -msim
@opindex msim
+@item -msim
Specifies that the program will be run on the simulator. This causes
an alternate runtime library to be linked in which supports, for
example, file I/O@. You must not use this option when generating
programs that will run on real hardware; you must provide your own
runtime library for whatever I/O functions are needed.
-@item -memregs=@var{number}
@opindex memregs=
+@item -memregs=@var{number}
Specifies the number of memory-based pseudo-registers GCC uses
during code generation. These pseudo-registers are used like real
registers, so there is a tradeoff between GCC's ability to fit the
These @option{-m} options are defined for Renesas M32R/D architectures:
@table @gcctabopt
-@item -m32r2
@opindex m32r2
+@item -m32r2
Generate code for the M32R/2@.
-@item -m32rx
@opindex m32rx
+@item -m32rx
Generate code for the M32R/X@.
-@item -m32r
@opindex m32r
+@item -m32r
Generate code for the M32R@. This is the default.
-@item -mmodel=small
@opindex mmodel=small
+@item -mmodel=small
Assume all objects live in the lower 16MB of memory (so that their addresses
can be loaded with the @code{ld24} instruction), and assume all subroutines
are reachable with the @code{bl} instruction.
The addressability of a particular object can be set with the
@code{model} attribute.
-@item -mmodel=medium
@opindex mmodel=medium
+@item -mmodel=medium
Assume objects may be anywhere in the 32-bit address space (the compiler
generates @code{seth/add3} instructions to load their addresses), and
assume all subroutines are reachable with the @code{bl} instruction.
-@item -mmodel=large
@opindex mmodel=large
+@item -mmodel=large
Assume objects may be anywhere in the 32-bit address space (the compiler
generates @code{seth/add3} instructions to load their addresses), and
assume subroutines may not be reachable with the @code{bl} instruction
(the compiler generates the much slower @code{seth/add3/jl}
instruction sequence).
-@item -msdata=none
@opindex msdata=none
+@item -msdata=none
Disable use of the small data area. Variables are put into
one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
@code{section} attribute has been specified).
Objects may be explicitly put in the small data area with the
@code{section} attribute using one of these sections.
-@item -msdata=sdata
@opindex msdata=sdata
+@item -msdata=sdata
Put small global and static data in the small data area, but do not
generate special code to reference them.
-@item -msdata=use
@opindex msdata=use
+@item -msdata=use
Put small global and static data in the small data area, and generate
special instructions to reference them.
-@item -G @var{num}
@opindex G
+@item -G @var{num}
@cindex smaller data references
Put global and static objects less than or equal to @var{num} bytes
into the small data or BSS sections instead of the normal data or BSS
doesn't the linker gives an error message---incorrect code is not
generated.
-@item -mdebug
@opindex mdebug
+@item -mdebug
Makes the M32R-specific code in the compiler display some statistics
that might help in debugging programs.
-@item -malign-loops
@opindex malign-loops
+@item -malign-loops
Align all loops to a 32-byte boundary.
-@item -mno-align-loops
@opindex mno-align-loops
+@item -mno-align-loops
Do not enforce a 32-byte alignment for loops. This is the default.
-@item -missue-rate=@var{number}
@opindex missue-rate=@var{number}
+@item -missue-rate=@var{number}
Issue @var{number} instructions per cycle. @var{number} can only be 1
or 2.
-@item -mbranch-cost=@var{number}
@opindex mbranch-cost=@var{number}
+@item -mbranch-cost=@var{number}
@var{number} can only be 1 or 2. If it is 1 then branches are
preferred over conditional code, if it is 2, then the opposite applies.
-@item -mflush-trap=@var{number}
@opindex mflush-trap=@var{number}
+@item -mflush-trap=@var{number}
Specifies the trap number to use to flush the cache. The default is
12. Valid numbers are between 0 and 15 inclusive.
-@item -mno-flush-trap
@opindex mno-flush-trap
+@item -mno-flush-trap
Specifies that the cache cannot be flushed by using a trap.
-@item -mflush-func=@var{name}
@opindex mflush-func=@var{name}
+@item -mflush-func=@var{name}
Specifies the name of the operating system function to call to flush
the cache. The default is @samp{_flush_cache}, but a function call
is only used if a trap is not available.
-@item -mno-flush-func
@opindex mno-flush-func
+@item -mno-flush-func
Indicates that there is no OS function for flushing the cache.
@end table
are given below.
@table @gcctabopt
-@item -march=@var{arch}
@opindex march
+@item -march=@var{arch}
Generate code for a specific M680x0 or ColdFire instruction set
architecture. Permissible values of @var{arch} for M680x0
architectures are: @samp{68000}, @samp{68010}, @samp{68020},
that runs on a family of similar processors but that is optimized
for a particular microarchitecture.
-@item -mcpu=@var{cpu}
@opindex mcpu
+@item -mcpu=@var{cpu}
Generate code for a specific M680x0 or ColdFire processor.
The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
@samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
@var{cpu} is selected. It also defines @code{__mcf_family_@var{family}},
where the value of @var{family} is given by the table above.
-@item -mtune=@var{tune}
@opindex mtune
+@item -mtune=@var{tune}
Tune the code for a particular microarchitecture within the
constraints set by @option{-march} and @option{-mcpu}.
The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
of the arguments given above.
-@item -m68000
-@itemx -mc68000
@opindex m68000
@opindex mc68000
+@item -m68000
+@itemx -mc68000
Generate output for a 68000. This is the default
when the compiler is configured for 68000-based systems.
It is equivalent to @option{-march=68000}.
Use this option for microcontrollers with a 68000 or EC000 core,
including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
-@item -m68010
@opindex m68010
+@item -m68010
Generate output for a 68010. This is the default
when the compiler is configured for 68010-based systems.
It is equivalent to @option{-march=68010}.
-@item -m68020
-@itemx -mc68020
@opindex m68020
@opindex mc68020
+@item -m68020
+@itemx -mc68020
Generate output for a 68020. This is the default
when the compiler is configured for 68020-based systems.
It is equivalent to @option{-march=68020}.
-@item -m68030
@opindex m68030
+@item -m68030
Generate output for a 68030. This is the default when the compiler is
configured for 68030-based systems. It is equivalent to
@option{-march=68030}.
-@item -m68040
@opindex m68040
+@item -m68040
Generate output for a 68040. This is the default when the compiler is
configured for 68040-based systems. It is equivalent to
@option{-march=68040}.
emulated by software on the 68040. Use this option if your 68040 does not
have code to emulate those instructions.
-@item -m68060
@opindex m68060
+@item -m68060
Generate output for a 68060. This is the default when the compiler is
configured for 68060-based systems. It is equivalent to
@option{-march=68060}.
have to be emulated by software on the 68060. Use this option if your 68060
does not have code to emulate those instructions.
-@item -mcpu32
@opindex mcpu32
+@item -mcpu32
Generate output for a CPU32. This is the default
when the compiler is configured for CPU32-based systems.
It is equivalent to @option{-march=cpu32}.
CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
68336, 68340, 68341, 68349 and 68360.
-@item -m5200
@opindex m5200
+@item -m5200
Generate output for a 520X ColdFire CPU@. This is the default
when the compiler is configured for 520X-based systems.
It is equivalent to @option{-mcpu=5206}, and is now deprecated
Use this option for microcontroller with a 5200 core, including
the MCF5202, MCF5203, MCF5204 and MCF5206.
-@item -m5206e
@opindex m5206e
+@item -m5206e
Generate output for a 5206e ColdFire CPU@. The option is now
deprecated in favor of the equivalent @option{-mcpu=5206e}.
-@item -m528x
@opindex m528x
+@item -m528x
Generate output for a member of the ColdFire 528X family.
The option is now deprecated in favor of the equivalent
@option{-mcpu=528x}.
-@item -m5307
@opindex m5307
+@item -m5307
Generate output for a ColdFire 5307 CPU@. The option is now deprecated
in favor of the equivalent @option{-mcpu=5307}.
-@item -m5407
@opindex m5407
+@item -m5407
Generate output for a ColdFire 5407 CPU@. The option is now deprecated
in favor of the equivalent @option{-mcpu=5407}.
-@item -mcfv4e
@opindex mcfv4e
+@item -mcfv4e
Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
This includes use of hardware floating-point instructions.
The option is equivalent to @option{-mcpu=547x}, and is now
deprecated in favor of that option.
-@item -m68020-40
@opindex m68020-40
+@item -m68020-40
Generate output for a 68040, without using any of the new instructions.
This results in code that can run relatively efficiently on either a
68020/68881 or a 68030 or a 68040. The generated code does use the
The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
-@item -m68020-60
@opindex m68020-60
+@item -m68020-60
Generate output for a 68060, without using any of the new instructions.
This results in code that can run relatively efficiently on either a
68020/68881 or a 68030 or a 68040. The generated code does use the
The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
-@item -mhard-float
-@itemx -m68881
@opindex mhard-float
@opindex m68881
+@item -mhard-float
+@itemx -m68881
Generate floating-point instructions. This is the default for 68020
and above, and for ColdFire devices that have an FPU@. It defines the
macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
on ColdFire targets.
-@item -msoft-float
@opindex msoft-float
+@item -msoft-float
Do not generate floating-point instructions; use library calls instead.
This is the default for 68000, 68010, and 68832 targets. It is also
the default for ColdFire devices that have no FPU.
-@item -mdiv
-@itemx -mno-div
@opindex mdiv
@opindex mno-div
+@item -mdiv
+@itemx -mno-div
Generate (do not generate) ColdFire hardware divide and remainder
instructions. If @option{-march} is used without @option{-mcpu},
the default is ``on'' for ColdFire architectures and ``off'' for M680x0
GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
-@item -mshort
@opindex mshort
+@item -mshort
Consider type @code{int} to be 16 bits wide, like @code{short int}.
Additionally, parameters passed on the stack are also aligned to a
16-bit boundary even on targets whose API mandates promotion to 32-bit.
-@item -mno-short
@opindex mno-short
+@item -mno-short
Do not consider type @code{int} to be 16 bits wide. This is the default.
-@item -mnobitfield
-@itemx -mno-bitfield
@opindex mnobitfield
@opindex mno-bitfield
+@item -mnobitfield
+@itemx -mno-bitfield
Do not use the bit-field instructions. The @option{-m68000}, @option{-mcpu32}
and @option{-m5200} options imply @w{@option{-mnobitfield}}.
-@item -mbitfield
@opindex mbitfield
+@item -mbitfield
Do use the bit-field instructions. The @option{-m68020} option implies
@option{-mbitfield}. This is the default if you use a configuration
designed for a 68020.
-@item -mrtd
@opindex mrtd
+@item -mrtd
Use a different function-calling convention, in which functions
that take a fixed number of arguments return with the @code{rtd}
instruction, which pops their arguments while returning. This
The default is @option{-mno-rtd}.
-@item -malign-int
-@itemx -mno-align-int
@opindex malign-int
@opindex mno-align-int
+@item -malign-int
+@itemx -mno-align-int
Control whether GCC aligns @code{int}, @code{long}, @code{long long},
@code{float}, @code{double}, and @code{long double} variables on a 32-bit
boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
not presently supported with @option{-mpcrel}, though this could be supported for
68020 and higher processors.
-@item -mno-strict-align
-@itemx -mstrict-align
@opindex mno-strict-align
@opindex mstrict-align
+@item -mno-strict-align
+@itemx -mstrict-align
Do not (do) assume that unaligned memory references are handled by
the system.
other values forces the allocation of that number to the current
library, but is no more space- or time-efficient than omitting this option.
-@item -mxgot
-@itemx -mno-xgot
@opindex mxgot
@opindex mno-xgot
+@item -mxgot
+@itemx -mno-xgot
When generating position-independent code for ColdFire, generate code
that works if the GOT has more than 8192 entries. This code is
larger and slower than code generated without this option. On M680x0
These options have no effect unless GCC is generating
position-independent code.
-@item -mlong-jump-table-offsets
@opindex mlong-jump-table-offsets
+@item -mlong-jump-table-offsets
Use 32-bit offsets in @code{switch} tables. The default is to use
16-bit offsets.
@table @gcctabopt
-@item -mhardlit
-@itemx -mno-hardlit
@opindex mhardlit
@opindex mno-hardlit
+@item -mhardlit
+@itemx -mno-hardlit
Inline constants into the code stream if it can be done in two
instructions or less.
-@item -mdiv
-@itemx -mno-div
@opindex mdiv
@opindex mno-div
+@item -mdiv
+@itemx -mno-div
Use the divide instruction. (Enabled by default).
-@item -mrelax-immediate
-@itemx -mno-relax-immediate
@opindex mrelax-immediate
@opindex mno-relax-immediate
+@item -mrelax-immediate
+@itemx -mno-relax-immediate
Allow arbitrary-sized immediates in bit operations.
-@item -mwide-bitfields
-@itemx -mno-wide-bitfields
@opindex mwide-bitfields
@opindex mno-wide-bitfields
+@item -mwide-bitfields
+@itemx -mno-wide-bitfields
Always treat bit-fields as @code{int}-sized.
-@item -m4byte-functions
-@itemx -mno-4byte-functions
@opindex m4byte-functions
@opindex mno-4byte-functions
+@item -m4byte-functions
+@itemx -mno-4byte-functions
Force all functions to be aligned to a 4-byte boundary.
-@item -mcallgraph-data
-@itemx -mno-callgraph-data
@opindex mcallgraph-data
@opindex mno-callgraph-data
+@item -mcallgraph-data
+@itemx -mno-callgraph-data
Emit callgraph information.
-@item -mslow-bytes
-@itemx -mno-slow-bytes
@opindex mslow-bytes
@opindex mno-slow-bytes
+@item -mslow-bytes
+@itemx -mno-slow-bytes
Prefer word access when reading byte quantities.
-@item -mlittle-endian
-@itemx -mbig-endian
@opindex mlittle-endian
@opindex mbig-endian
+@item -mlittle-endian
+@itemx -mbig-endian
Generate code for a little-endian target.
-@item -m210
-@itemx -m340
@opindex m210
@opindex m340
+@item -m210
+@itemx -m340
Generate code for the 210 processor.
-@item -mno-lsim
@opindex mno-lsim
+@item -mno-lsim
Assume that runtime support has been provided and so omit the
simulator library (@file{libsim.a)} from the linker command line.
-@item -mstack-increment=@var{size}
@opindex mstack-increment
+@item -mstack-increment=@var{size}
Set the maximum amount for a single stack increment operation. Large
values can increase the speed of programs that contain functions
that need a large amount of stack space, but they can also trigger a
@table @gcctabopt
-@item -msoft-float
@opindex msoft-float
+@item -msoft-float
Use software emulation for floating point (default).
-@item -mhard-float
@opindex mhard-float
+@item -mhard-float
Use hardware floating-point instructions.
-@item -mmemcpy
@opindex mmemcpy
+@item -mmemcpy
Do not optimize block moves, use @code{memcpy}.
-@item -mno-clearbss
@opindex mno-clearbss
+@item -mno-clearbss
This option is deprecated. Use @option{-fno-zero-initialized-in-bss} instead.
-@item -mcpu=@var{cpu-type}
@opindex mcpu=
+@item -mcpu=@var{cpu-type}
Use features of, and schedule code for, the given CPU.
Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
where @var{X} is a major version, @var{YY} is the minor version, and
@var{Z} is compatibility code. Example values are @samp{v3.00.a},
@samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v6.00.a}.
-@item -mxl-soft-mul
@opindex mxl-soft-mul
+@item -mxl-soft-mul
Use software multiply emulation (default).
-@item -mxl-soft-div
@opindex mxl-soft-div
+@item -mxl-soft-div
Use software emulation for divides (default).
-@item -mxl-barrel-shift
@opindex mxl-barrel-shift
+@item -mxl-barrel-shift
Use the hardware barrel shifter.
-@item -mxl-pattern-compare
@opindex mxl-pattern-compare
+@item -mxl-pattern-compare
Use pattern compare instructions.
-@item -msmall-divides
@opindex msmall-divides
+@item -msmall-divides
Use table lookup optimization for small signed integer divisions.
-@item -mxl-stack-check
@opindex mxl-stack-check
+@item -mxl-stack-check
This option is deprecated. Use @option{-fstack-check} instead.
-@item -mxl-gp-opt
@opindex mxl-gp-opt
+@item -mxl-gp-opt
Use GP-relative @code{.sdata}/@code{.sbss} sections.
-@item -mxl-multiply-high
@opindex mxl-multiply-high
+@item -mxl-multiply-high
Use multiply high instructions for high part of 32x32 multiply.
-@item -mxl-float-convert
@opindex mxl-float-convert
+@item -mxl-float-convert
Use hardware floating-point conversion instructions.
-@item -mxl-float-sqrt
@opindex mxl-float-sqrt
+@item -mxl-float-sqrt
Use hardware floating-point square root instruction.
-@item -mbig-endian
@opindex mbig-endian
+@item -mbig-endian
Generate code for a big-endian target.
-@item -mlittle-endian
@opindex mlittle-endian
+@item -mlittle-endian
Generate code for a little-endian target.
-@item -mxl-reorder
@opindex mxl-reorder
+@item -mxl-reorder
Use reorder instructions (swap and byte reversed load/store).
@item -mxl-mode-@var{app-model}
Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
@option{-mxl-mode-@var{app-model}}.
-@item -mpic-data-is-text-relative
@opindex mpic-data-is-text-relative
+@item -mpic-data-is-text-relative
Assume that the displacement between the text and data segments is fixed
at static link time. This allows data to be referenced by offset from start of
text address instead of GOT since PC-relative addressing is not supported.
@table @gcctabopt
-@item -EB
@opindex EB
+@item -EB
Generate big-endian code.
-@item -EL
@opindex EL
+@item -EL
Generate little-endian code. This is the default for @samp{mips*el-*-*}
configurations.
-@item -march=@var{arch}
@opindex march
+@item -march=@var{arch}
Generate code that runs on @var{arch}, which can be the name of a
generic MIPS ISA, or the name of a particular processor.
The ISA names are:
@code{"mips3"}). It names the default architecture when no
@option{-march} option is given.
-@item -mtune=@var{arch}
@opindex mtune
+@item -mtune=@var{arch}
Optimize for @var{arch}. Among other things, this option controls
the way instructions are scheduled, and the perceived cost of arithmetic
operations. The list of @var{arch} values is the same as for
@code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
@option{-march} ones described above.
-@item -mips1
@opindex mips1
+@item -mips1
Equivalent to @option{-march=mips1}.
-@item -mips2
@opindex mips2
+@item -mips2
Equivalent to @option{-march=mips2}.
-@item -mips3
@opindex mips3
+@item -mips3
Equivalent to @option{-march=mips3}.
-@item -mips4
@opindex mips4
+@item -mips4
Equivalent to @option{-march=mips4}.
-@item -mips32
@opindex mips32
+@item -mips32
Equivalent to @option{-march=mips32}.
-@item -mips32r3
@opindex mips32r3
+@item -mips32r3
Equivalent to @option{-march=mips32r3}.
-@item -mips32r5
@opindex mips32r5
+@item -mips32r5
Equivalent to @option{-march=mips32r5}.
-@item -mips32r6
@opindex mips32r6
+@item -mips32r6
Equivalent to @option{-march=mips32r6}.
-@item -mips64
@opindex mips64
+@item -mips64
Equivalent to @option{-march=mips64}.
-@item -mips64r2
@opindex mips64r2
+@item -mips64r2
Equivalent to @option{-march=mips64r2}.
-@item -mips64r3
@opindex mips64r3
+@item -mips64r3
Equivalent to @option{-march=mips64r3}.
-@item -mips64r5
@opindex mips64r5
+@item -mips64r5
Equivalent to @option{-march=mips64r5}.
-@item -mips64r6
@opindex mips64r6
+@item -mips64r6
Equivalent to @option{-march=mips64r6}.
-@item -mips16
-@itemx -mno-mips16
@opindex mips16
@opindex mno-mips16
+@item -mips16
+@itemx -mno-mips16
Generate (do not generate) MIPS16 code. If GCC is targeting a
MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
by means of @code{mips16} and @code{nomips16} attributes.
@xref{Function Attributes}, for more information.
-@item -mflip-mips16
@opindex mflip-mips16
+@item -mflip-mips16
Generate MIPS16 code on alternating functions. This option is provided
for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
not intended for ordinary use in compiling user code.
-@item -minterlink-compressed
-@itemx -mno-interlink-compressed
@opindex minterlink-compressed
@opindex mno-interlink-compressed
+@item -minterlink-compressed
+@itemx -mno-interlink-compressed
Require (do not require) that code using the standard (uncompressed) MIPS ISA
be link-compatible with MIPS16 and microMIPS code, and vice versa.
@option{-minterlink-compressed} therefore disables direct jumps unless GCC
knows that the target of the jump is not compressed.
-@item -minterlink-mips16
-@itemx -mno-interlink-mips16
@opindex minterlink-mips16
@opindex mno-interlink-mips16
+@item -minterlink-mips16
+@itemx -mno-interlink-mips16
Aliases of @option{-minterlink-compressed} and
@option{-mno-interlink-compressed}. These options predate the microMIPS ASE
and are retained for backwards compatibility.
-@item -mabi=32
-@itemx -mabi=o64
-@itemx -mabi=n32
-@itemx -mabi=64
-@itemx -mabi=eabi
@opindex mabi=32
@opindex mabi=o64
@opindex mabi=n32
@opindex mabi=64
@opindex mabi=eabi
+@item -mabi=32
+@itemx -mabi=o64
+@itemx -mabi=n32
+@itemx -mabi=64
+@itemx -mabi=eabi
Generate code for the given ABI@.
Note that the EABI has a 32-bit and a 64-bit variant. GCC normally
processors and allows both FP32 and FP64A code to interlink and
run in the same process without changing FPU modes.
-@item -mabicalls
-@itemx -mno-abicalls
@opindex mabicalls
@opindex mno-abicalls
+@item -mabicalls
+@itemx -mno-abicalls
Generate (do not generate) code that is suitable for SVR4-style
dynamic objects. @option{-mabicalls} is the default for SVR4-based
systems.
@option{-mshared} is the default.
-@item -mplt
-@itemx -mno-plt
@opindex mplt
@opindex mno-plt
+@item -mplt
+@itemx -mno-plt
Assume (do not assume) that the static and dynamic linkers
support PLTs and copy relocations. This option only affects
@option{-mno-shared -mabicalls}. For the n64 ABI, this option
GCC with @option{--with-mips-plt}. The default is
@option{-mno-plt} otherwise.
-@item -mxgot
-@itemx -mno-xgot
@opindex mxgot
@opindex mno-xgot
+@item -mxgot
+@itemx -mno-xgot
Lift (do not lift) the usual restrictions on the size of the global
offset table.
These options have no effect unless GCC is generating position
independent code.
-@item -mgp32
@opindex mgp32
+@item -mgp32
Assume that general-purpose registers are 32 bits wide.
-@item -mgp64
@opindex mgp64
+@item -mgp64
Assume that general-purpose registers are 64 bits wide.
-@item -mfp32
@opindex mfp32
+@item -mfp32
Assume that floating-point registers are 32 bits wide.
-@item -mfp64
@opindex mfp64
+@item -mfp64
Assume that floating-point registers are 64 bits wide.
-@item -mfpxx
@opindex mfpxx
+@item -mfpxx
Do not assume the width of floating-point registers.
-@item -mhard-float
@opindex mhard-float
+@item -mhard-float
Use floating-point coprocessor instructions.
-@item -msoft-float
@opindex msoft-float
+@item -msoft-float
Do not use floating-point coprocessor instructions. Implement
floating-point calculations using library calls instead.
-@item -mno-float
@opindex mno-float
+@item -mno-float
Equivalent to @option{-msoft-float}, but additionally asserts that the
program being compiled does not perform any floating-point operations.
This option is presently supported only by some bare-metal MIPS
floating-point operations, it is likely to suffer a link-time
or run-time failure.
-@item -msingle-float
@opindex msingle-float
+@item -msingle-float
Assume that the floating-point coprocessor only supports single-precision
operations.
-@item -mdouble-float
@opindex mdouble-float
+@item -mdouble-float
Assume that the floating-point coprocessor supports double-precision
operations. This is the default.
-@item -modd-spreg
-@itemx -mno-odd-spreg
@opindex modd-spreg
@opindex mno-odd-spreg
+@item -modd-spreg
+@itemx -mno-odd-spreg
Enable the use of odd-numbered single-precision floating-point registers
for the o32 ABI. This is the default for processors that are known to
support these registers. When using the o32 FPXX ABI, @option{-mno-odd-spreg}
is set by default.
-@item -mabs=2008
-@itemx -mabs=legacy
@opindex mabs=2008
@opindex mabs=legacy
+@item -mabs=2008
+@itemx -mabs=legacy
These options control the treatment of the special not-a-number (NaN)
IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
@code{neg.@i{fmt}} machine instructions.
input operand is a NaN. These instructions are therefore always used
for the respective operations.
-@item -mnan=2008
-@itemx -mnan=legacy
@opindex mnan=2008
@opindex mnan=legacy
+@item -mnan=2008
+@itemx -mnan=legacy
These options control the encoding of the special not-a-number (NaN)
IEEE 754 floating-point data.
The default is @option{-mnan=legacy} unless GCC has been configured with
@option{--with-nan=2008}.
-@item -mllsc
-@itemx -mno-llsc
@opindex mllsc
@opindex mno-llsc
+@item -mllsc
+@itemx -mno-llsc
Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
implement atomic memory built-in functions. When neither option is
specified, GCC uses the instructions if the target architecture
respectively. @option{--with-llsc} is the default for some
configurations; see the installation documentation for details.
-@item -mdsp
-@itemx -mno-dsp
@opindex mdsp
@opindex mno-dsp
+@item -mdsp
+@itemx -mno-dsp
Use (do not use) revision 1 of the MIPS DSP ASE@.
@xref{MIPS DSP Built-in Functions}. This option defines the
preprocessor macro @code{__mips_dsp}. It also defines
@code{__mips_dsp_rev} to 1.
-@item -mdspr2
-@itemx -mno-dspr2
@opindex mdspr2
@opindex mno-dspr2
+@item -mdspr2
+@itemx -mno-dspr2
Use (do not use) revision 2 of the MIPS DSP ASE@.
@xref{MIPS DSP Built-in Functions}. This option defines the
preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
It also defines @code{__mips_dsp_rev} to 2.
-@item -msmartmips
-@itemx -mno-smartmips
@opindex msmartmips
@opindex mno-smartmips
+@item -msmartmips
+@itemx -mno-smartmips
Use (do not use) the MIPS SmartMIPS ASE.
-@item -mpaired-single
-@itemx -mno-paired-single
@opindex mpaired-single
@opindex mno-paired-single
+@item -mpaired-single
+@itemx -mno-paired-single
Use (do not use) paired-single floating-point instructions.
@xref{MIPS Paired-Single Support}. This option requires
hardware floating-point support to be enabled.
-@item -mdmx
-@itemx -mno-mdmx
@opindex mdmx
@opindex mno-mdmx
+@item -mdmx
+@itemx -mno-mdmx
Use (do not use) MIPS Digital Media Extension instructions.
This option can only be used when generating 64-bit code and requires
hardware floating-point support to be enabled.
-@item -mips3d
-@itemx -mno-mips3d
@opindex mips3d
@opindex mno-mips3d
+@item -mips3d
+@itemx -mno-mips3d
Use (do not use) the MIPS-3D ASE@. @xref{MIPS-3D Built-in Functions}.
The option @option{-mips3d} implies @option{-mpaired-single}.
-@item -mmicromips
-@itemx -mno-micromips
@opindex mmicromips
@opindex mno-mmicromips
+@item -mmicromips
+@itemx -mno-micromips
Generate (do not generate) microMIPS code.
MicroMIPS code generation can also be controlled on a per-function basis
by means of @code{micromips} and @code{nomicromips} attributes.
@xref{Function Attributes}, for more information.
-@item -mmt
-@itemx -mno-mt
@opindex mmt
@opindex mno-mt
+@item -mmt
+@itemx -mno-mt
Use (do not use) MT Multithreading instructions.
-@item -mmcu
-@itemx -mno-mcu
@opindex mmcu
@opindex mno-mcu
+@item -mmcu
+@itemx -mno-mcu
Use (do not use) the MIPS MCU ASE instructions.
-@item -meva
-@itemx -mno-eva
@opindex meva
@opindex mno-eva
+@item -meva
+@itemx -mno-eva
Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
-@item -mvirt
-@itemx -mno-virt
@opindex mvirt
@opindex mno-virt
+@item -mvirt
+@itemx -mno-virt
Use (do not use) the MIPS Virtualization (VZ) instructions.
-@item -mxpa
-@itemx -mno-xpa
@opindex mxpa
@opindex mno-xpa
+@item -mxpa
+@itemx -mno-xpa
Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
-@item -mcrc
-@itemx -mno-crc
@opindex mcrc
@opindex mno-crc
+@item -mcrc
+@itemx -mno-crc
Use (do not use) the MIPS Cyclic Redundancy Check (CRC) instructions.
-@item -mginv
-@itemx -mno-ginv
@opindex mginv
@opindex mno-ginv
+@item -mginv
+@itemx -mno-ginv
Use (do not use) the MIPS Global INValidate (GINV) instructions.
-@item -mloongson-mmi
-@itemx -mno-loongson-mmi
@opindex mloongson-mmi
@opindex mno-loongson-mmi
+@item -mloongson-mmi
+@itemx -mno-loongson-mmi
Use (do not use) the MIPS Loongson MultiMedia extensions Instructions (MMI).
-@item -mloongson-ext
-@itemx -mno-loongson-ext
@opindex mloongson-ext
@opindex mno-loongson-ext
+@item -mloongson-ext
+@itemx -mno-loongson-ext
Use (do not use) the MIPS Loongson EXTensions (EXT) instructions.
-@item -mloongson-ext2
-@itemx -mno-loongson-ext2
@opindex mloongson-ext2
@opindex mno-loongson-ext2
+@item -mloongson-ext2
+@itemx -mno-loongson-ext2
Use (do not use) the MIPS Loongson EXTensions r2 (EXT2) instructions.
-@item -mlong64
@opindex mlong64
+@item -mlong64
Force @code{long} types to be 64 bits wide. See @option{-mlong32} for
an explanation of the default and the way that the pointer size is
determined.
-@item -mlong32
@opindex mlong32
+@item -mlong32
Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
The default size of @code{int}s, @code{long}s and pointers depends on
32-bit @code{long}s. Pointers are the same size as @code{long}s,
or the same size as integer registers, whichever is smaller.
-@item -msym32
-@itemx -mno-sym32
@opindex msym32
@opindex mno-sym32
+@item -msym32
+@itemx -mno-sym32
Assume (do not assume) that all symbols have 32-bit values, regardless
of the selected ABI@. This option is useful in combination with
@option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
to generate shorter and faster references to symbolic addresses.
-@item -G @var{num}
@opindex G
+@item -G @var{num}
Put definitions of externally-visible data in a small data section
if that data is no bigger than @var{num} bytes. GCC can then generate
more efficient accesses to the data; see @option{-mgpopt} for details.
The default @option{-G} option depends on the configuration.
-@item -mlocal-sdata
-@itemx -mno-local-sdata
@opindex mlocal-sdata
@opindex mno-local-sdata
+@item -mlocal-sdata
+@itemx -mno-local-sdata
Extend (do not extend) the @option{-G} behavior to local data too,
such as to static variables in C@. @option{-mlocal-sdata} is the
default for all configurations.
libraries with @option{-mno-local-sdata}, so that the libraries leave
more room for the main program.
-@item -mextern-sdata
-@itemx -mno-extern-sdata
@opindex mextern-sdata
@opindex mno-extern-sdata
+@item -mextern-sdata
+@itemx -mno-extern-sdata
Assume (do not assume) that externally-defined data is in
a small data section if the size of that data is within the @option{-G} limit.
@option{-mextern-sdata} is the default for all configurations.
@option{-mno-extern-sdata} to stop the library from making assumptions
about externally-defined data.
-@item -mgpopt
-@itemx -mno-gpopt
@opindex mgpopt
@opindex mno-gpopt
+@item -mgpopt
+@itemx -mno-gpopt
Use (do not use) GP-relative accesses for symbols that are known to be
in a small data section; see @option{-G}, @option{-mlocal-sdata} and
@option{-mextern-sdata}. @option{-mgpopt} is the default for all
@option{-mno-gpopt} implies @option{-mno-local-sdata} and
@option{-mno-extern-sdata}.
-@item -membedded-data
-@itemx -mno-embedded-data
@opindex membedded-data
@opindex mno-embedded-data
+@item -membedded-data
+@itemx -mno-embedded-data
Allocate variables to the read-only data section first if possible, then
next in the small data section if possible, otherwise in data. This gives
slightly slower code than the default, but reduces the amount of RAM required
when executing, and thus may be preferred for some embedded systems.
-@item -muninit-const-in-rodata
-@itemx -mno-uninit-const-in-rodata
@opindex muninit-const-in-rodata
@opindex mno-uninit-const-in-rodata
+@item -muninit-const-in-rodata
+@itemx -mno-uninit-const-in-rodata
Put uninitialized @code{const} variables in the read-only data section.
This option is only meaningful in conjunction with @option{-membedded-data}.
-@item -mcode-readable=@var{setting}
@opindex mcode-readable
+@item -mcode-readable=@var{setting}
Specify whether GCC may generate code that reads from executable sections.
There are three possible settings:
PC-relative loads to the instruction RAM.
@end table
-@item -msplit-addresses
-@itemx -mno-split-addresses
@opindex msplit-addresses
@opindex mno-split-addresses
+@item -msplit-addresses
+@itemx -mno-split-addresses
Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
relocation operators. This option has been superseded by
@option{-mexplicit-relocs} but is retained for backwards compatibility.
-@item -mexplicit-relocs
-@itemx -mno-explicit-relocs
@opindex mexplicit-relocs
@opindex mno-explicit-relocs
+@item -mexplicit-relocs
+@itemx -mno-explicit-relocs
Use (do not use) assembler relocation operators when dealing with symbolic
addresses. The alternative, selected by @option{-mno-explicit-relocs},
is to use assembler macros instead.
@option{-mexplicit-relocs} is the default if GCC was configured
to use an assembler that supports relocation operators.
-@item -mcheck-zero-division
-@itemx -mno-check-zero-division
@opindex mcheck-zero-division
@opindex mno-check-zero-division
+@item -mcheck-zero-division
+@itemx -mno-check-zero-division
Trap (do not trap) on integer division by zero.
The default is @option{-mcheck-zero-division}.
-@item -mdivide-traps
-@itemx -mdivide-breaks
@opindex mdivide-traps
@opindex mdivide-breaks
+@item -mdivide-traps
+@itemx -mdivide-breaks
MIPS systems check for division by zero by generating either a
conditional trap or a break instruction. Using traps results in
smaller code, but is only supported on MIPS II and later. Also, some
Divide-by-zero checks can be completely disabled using
@option{-mno-check-zero-division}.
-@item -mload-store-pairs
-@itemx -mno-load-store-pairs
@opindex mload-store-pairs
@opindex mno-load-store-pairs
+@item -mload-store-pairs
+@itemx -mno-load-store-pairs
Enable (disable) an optimization that pairs consecutive load or store
instructions to enable load/store bonding. This option is enabled by
default but only takes effect when the selected architecture is known
to support bonding.
-@item -munaligned-access
-@itemx -mno-unaligned-access
@opindex munaligned-access
@opindex mno-unaligned-access
+@item -munaligned-access
+@itemx -mno-unaligned-access
Enable (disable) direct unaligned access for MIPS Release 6.
MIPSr6 requires load/store unaligned-access support,
by hardware or trap&emulate.
So @option{-mno-unaligned-access} may be needed by kernel.
-@item -mmemcpy
-@itemx -mno-memcpy
@opindex mmemcpy
@opindex mno-memcpy
+@item -mmemcpy
+@itemx -mno-memcpy
Force (do not force) the use of @code{memcpy} for non-trivial block
moves. The default is @option{-mno-memcpy}, which allows GCC to inline
most constant-sized copies.
-@item -mlong-calls
-@itemx -mno-long-calls
@opindex mlong-calls
@opindex mno-long-calls
+@item -mlong-calls
+@itemx -mno-long-calls
Disable (do not disable) use of the @code{jal} instruction. Calling
functions using @code{jal} is more efficient but requires the caller
and callee to be in the same 256 megabyte segment.
This option has no effect on abicalls code. The default is
@option{-mno-long-calls}.
-@item -mmad
-@itemx -mno-mad
@opindex mmad
@opindex mno-mad
+@item -mmad
+@itemx -mno-mad
Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
instructions, as provided by the R4650 ISA@.
-@item -mimadd
-@itemx -mno-imadd
@opindex mimadd
@opindex mno-imadd
+@item -mimadd
+@itemx -mno-imadd
Enable (disable) use of the @code{madd} and @code{msub} integer
instructions. The default is @option{-mimadd} on architectures
that support @code{madd} and @code{msub} except for the 74k
architecture where it was found to generate slower code.
-@item -mfused-madd
-@itemx -mno-fused-madd
@opindex mfused-madd
@opindex mno-fused-madd
+@item -mfused-madd
+@itemx -mno-fused-madd
Enable (disable) use of the floating-point multiply-accumulate
instructions, when they are available. The default is
@option{-mfused-madd}.
is numerically identical to the equivalent computation using
separate multiply, add, subtract and negate instructions.
-@item -nocpp
@opindex nocpp
+@item -nocpp
Tell the MIPS assembler to not run its preprocessor over user
assembler files (with a @samp{.s} suffix) when assembling them.
-@item -mfix-24k
-@itemx -mno-fix-24k
@opindex mfix-24k
@opindex mno-fix-24k
+@item -mfix-24k
+@itemx -mno-fix-24k
Work around the 24K E48 (lost data on stores during refill) errata.
The workarounds are implemented by the assembler rather than by GCC@.
-@item -mfix-r4000
-@itemx -mno-fix-r4000
@opindex mfix-r4000
@opindex mno-fix-r4000
+@item -mfix-r4000
+@itemx -mno-fix-r4000
Work around certain R4000 CPU errata:
@itemize @minus
@item
of a taken branch or a jump.
@end itemize
-@item -mfix-r4400
-@itemx -mno-fix-r4400
@opindex mfix-r4400
@opindex mno-fix-r4400
+@item -mfix-r4400
+@itemx -mno-fix-r4400
Work around certain R4400 CPU errata:
@itemize @minus
@item
immediately after starting an integer division.
@end itemize
-@item -mfix-r10000
-@itemx -mno-fix-r10000
@opindex mfix-r10000
@opindex mno-fix-r10000
+@item -mfix-r10000
+@itemx -mno-fix-r10000
Work around certain R10000 errata:
@itemize @minus
@item
@option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
otherwise.
+@opindex mfix-r5900
@item -mfix-r5900
@itemx -mno-fix-r5900
-@opindex mfix-r5900
Do not attempt to schedule the preceding instruction into the delay slot
of a branch instruction placed at the end of a short loop of six
instructions or fewer and always schedule a @code{nop} instruction there
execute only once or twice, due to a hardware bug in the R5900 chip. The
workaround is implemented by the assembler rather than by GCC@.
+@opindex mfix-rm7000
@item -mfix-rm7000
@itemx -mno-fix-rm7000
-@opindex mfix-rm7000
Work around the RM7000 @code{dmult}/@code{dmultu} errata. The
workarounds are implemented by the assembler rather than by GCC@.
+@opindex mfix-vr4120
@item -mfix-vr4120
@itemx -mno-fix-vr4120
-@opindex mfix-vr4120
Work around certain VR4120 errata:
@itemize @minus
@item
Other VR4120 errata require a NOP to be inserted between certain pairs of
instructions. These errata are handled by the assembler, not by GCC itself.
-@item -mfix-vr4130
@opindex mfix-vr4130
+@item -mfix-vr4130
Work around the VR4130 @code{mflo}/@code{mfhi} errata. The
workarounds are implemented by the assembler rather than by GCC,
although GCC avoids using @code{mflo} and @code{mfhi} if the
VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
instructions are available instead.
+@opindex mfix-sb1
@item -mfix-sb1
@itemx -mno-fix-sb1
-@opindex mfix-sb1
Work around certain SB-1 CPU core errata.
(This flag currently works around the SB-1 revision 2
``F1'' and ``F2'' floating-point errata.)
-@item -mr10k-cache-barrier=@var{setting}
@opindex mr10k-cache-barrier
+@item -mr10k-cache-barrier=@var{setting}
Specify whether GCC should insert cache barriers to avoid the
side effects of speculation on R10K processors.
Disable the insertion of cache barriers. This is the default setting.
@end table
+@opindex mflush-func
@item -mflush-func=@var{func}
@itemx -mno-flush-func
-@opindex mflush-func
Specifies the function to call to flush the I and D caches, or to not
call any such function. If called, the function must take the same
arguments as the common @code{_flush_func}, that is, the address of the
depends on the target GCC was configured for, but commonly is either
@code{_flush_func} or @code{__cpu_flush}.
-@item mbranch-cost=@var{num}
@opindex mbranch-cost
+@item mbranch-cost=@var{num}
Set the cost of branches to roughly @var{num} ``simple'' instructions.
This cost is only a heuristic and is not guaranteed to produce
consistent results across releases. A zero cost redundantly selects
the default, which is based on the @option{-mtune} setting.
-@item -mbranch-likely
-@itemx -mno-branch-likely
@opindex mbranch-likely
@opindex mno-branch-likely
+@item -mbranch-likely
+@itemx -mno-branch-likely
Enable or disable use of Branch Likely instructions, regardless of the
default for the selected architecture. By default, Branch Likely
instructions may be generated if they are supported by the selected
Likely instructions are not be generated by default because the MIPS32
and MIPS64 architectures specifically deprecate their use.
-@item -mcompact-branches=never
-@itemx -mcompact-branches=optimal
-@itemx -mcompact-branches=always
@opindex mcompact-branches=never
@opindex mcompact-branches=optimal
@opindex mcompact-branches=always
+@item -mcompact-branches=never
+@itemx -mcompact-branches=optimal
+@itemx -mcompact-branches=always
These options control which form of branches will be generated. The
default is @option{-mcompact-branches=optimal}.
slot is successfully filled. If the delay slot is not filled, a compact
branch will be chosen if one is available.
+@opindex mfp-exceptions
@item -mfp-exceptions
@itemx -mno-fp-exceptions
-@opindex mfp-exceptions
Specifies whether FP exceptions are enabled. This affects how
FP instructions are scheduled for some processors.
The default is that FP exceptions are
64-bit code, then we can use both FP pipes. Otherwise, we can only use one
FP pipe.
+@opindex mvr4130-align
@item -mvr4130-align
@itemx -mno-vr4130-align
-@opindex mvr4130-align
The VR4130 pipeline is two-way superscalar, but can only issue two
instructions together if the first one is 8-byte aligned. When this
option is enabled, GCC aligns pairs of instructions that it
It normally makes code faster, but at the expense of making it bigger.
It is enabled by default at optimization level @option{-O3}.
+@opindex msynci
@item -msynci
@itemx -mno-synci
-@opindex msynci
Enable (disable) generation of @code{synci} instructions on
architectures that support it. The @code{synci} instructions (if
enabled) are generated when @code{__builtin___clear_cache} is
does not invalidate the instruction caches on all cores and may lead
to undefined behavior.
+@opindex mrelax-pic-calls
@item -mrelax-pic-calls
@itemx -mno-relax-pic-calls
-@opindex mrelax-pic-calls
Try to turn PIC calls that are normally dispatched via register
@code{$25} into direct calls. This is only possible if the linker can
resolve the destination at link time and if the destination is within
@option{-mno-explicit-relocs}, this optimization can be performed by the
assembler and the linker alone without help from the compiler.
-@item -mmcount-ra-address
-@itemx -mno-mcount-ra-address
@opindex mmcount-ra-address
@opindex mno-mcount-ra-address
+@item -mmcount-ra-address
+@itemx -mno-mcount-ra-address
Emit (do not emit) code that allows @code{_mcount} to modify the
calling function's return address. When enabled, this option extends
the usual @code{_mcount} interface with a new @var{ra-address}
The default is @option{-mno-mcount-ra-address}.
+@opindex mframe-header-opt
@item -mframe-header-opt
@itemx -mno-frame-header-opt
-@opindex mframe-header-opt
Enable (disable) frame header optimization in the o32 ABI. When using the
o32 ABI, calling functions will allocate 16 bytes on the stack for the called
function to write out register arguments. When enabled, this optimization
This optimization is off by default at all optimization levels.
+@opindex mlxc1-sxc1
@item -mlxc1-sxc1
@itemx -mno-lxc1-sxc1
-@opindex mlxc1-sxc1
When applicable, enable (disable) the generation of @code{lwxc1},
@code{swxc1}, @code{ldxc1}, @code{sdxc1} instructions. Enabled by default.
+@opindex mmadd4
@item -mmadd4
@itemx -mno-madd4
-@opindex mmadd4
When applicable, enable (disable) the generation of 4-operand @code{madd.s},
@code{madd.d} and related instructions. Enabled by default.
These options are defined for the MMIX:
@table @gcctabopt
-@item -mlibfuncs
-@itemx -mno-libfuncs
@opindex mlibfuncs
@opindex mno-libfuncs
+@item -mlibfuncs
+@itemx -mno-libfuncs
Specify that intrinsic library functions are being compiled, passing all
values in registers, no matter the size.
-@item -mepsilon
-@itemx -mno-epsilon
@opindex mepsilon
@opindex mno-epsilon
+@item -mepsilon
+@itemx -mno-epsilon
Generate floating-point comparison instructions that compare with respect
to the @code{rE} epsilon register.
-@item -mabi=mmixware
-@itemx -mabi=gnu
@opindex mabi=mmixware
@opindex mabi=gnu
+@item -mabi=mmixware
+@itemx -mabi=gnu
Generate code that passes function parameters and return values that (in
the called function) are seen as registers @code{$0} and up, as opposed to
the GNU ABI which uses global registers @code{$231} and up.
-@item -mzero-extend
-@itemx -mno-zero-extend
@opindex mzero-extend
@opindex mno-zero-extend
+@item -mzero-extend
+@itemx -mno-zero-extend
When reading data from memory in sizes shorter than 64 bits, use (do not
use) zero-extending load instructions by default, rather than
sign-extending ones.
-@item -mknuthdiv
-@itemx -mno-knuthdiv
@opindex mknuthdiv
@opindex mno-knuthdiv
+@item -mknuthdiv
+@itemx -mno-knuthdiv
Make the result of a division yielding a remainder have the same sign as
the divisor. With the default, @option{-mno-knuthdiv}, the sign of the
remainder follows the sign of the dividend. Both methods are
arithmetically valid, the latter being almost exclusively used.
-@item -mtoplevel-symbols
-@itemx -mno-toplevel-symbols
@opindex mtoplevel-symbols
@opindex mno-toplevel-symbols
+@item -mtoplevel-symbols
+@itemx -mno-toplevel-symbols
Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
code can be used with the @code{PREFIX} assembly directive.
-@item -melf
@opindex melf
+@item -melf
Generate an executable in the ELF format, rather than the default
@samp{mmo} format used by the @command{mmix} simulator.
-@item -mbranch-predict
-@itemx -mno-branch-predict
@opindex mbranch-predict
@opindex mno-branch-predict
+@item -mbranch-predict
+@itemx -mno-branch-predict
Use (do not use) the probable-branch instructions, when static branch
prediction indicates a probable branch.
-@item -mbase-addresses
-@itemx -mno-base-addresses
@opindex mbase-addresses
@opindex mno-base-addresses
+@item -mbase-addresses
+@itemx -mno-base-addresses
Generate (do not generate) code that uses @emph{base addresses}. Using a
base address automatically generates a request (handled by the assembler
and the linker) for a constant to be set up in a global register. The
addressed is limited. This means that a program that uses lots of static
data may require @option{-mno-base-addresses}.
-@item -msingle-exit
-@itemx -mno-single-exit
@opindex msingle-exit
@opindex mno-single-exit
+@item -msingle-exit
+@itemx -mno-single-exit
Force (do not force) generated code to have a single exit point in each
function.
@end table
These @option{-m} options are defined for Matsushita MN10300 architectures:
@table @gcctabopt
-@item -mmult-bug
@opindex mmult-bug
+@item -mmult-bug
Generate code to avoid bugs in the multiply instructions for the MN10300
processors. This is the default.
-@item -mno-mult-bug
@opindex mno-mult-bug
+@item -mno-mult-bug
Do not generate code to avoid bugs in the multiply instructions for the
MN10300 processors.
-@item -mam33
@opindex mam33
+@item -mam33
Generate code using features specific to the AM33 processor.
-@item -mno-am33
@opindex mno-am33
+@item -mno-am33
Do not generate code using features specific to the AM33 processor. This
is the default.
-@item -mam33-2
@opindex mam33-2
+@item -mam33-2
Generate code using features specific to the AM33/2.0 processor.
-@item -mam34
@opindex mam34
+@item -mam34
Generate code using features specific to the AM34 processor.
-@item -mtune=@var{cpu-type}
@opindex mtune
+@item -mtune=@var{cpu-type}
Use the timing characteristics of the indicated CPU type when
scheduling instructions. This does not change the targeted processor
type. The CPU type must be one of @samp{mn10300}, @samp{am33},
@samp{am33-2} or @samp{am34}.
-@item -mreturn-pointer-on-d0
@opindex mreturn-pointer-on-d0
+@item -mreturn-pointer-on-d0
When generating a function that returns a pointer, return the pointer
in both @code{a0} and @code{d0}. Otherwise, the pointer is returned
only in @code{a0}, and attempts to call such functions without a prototype
result in errors. Note that this option is on by default; use
@option{-mno-return-pointer-on-d0} to disable it.
-@item -mno-crt0
@opindex mno-crt0
+@item -mno-crt0
Do not link in the C run-time initialization object file.
-@item -mrelax
@opindex mrelax
+@item -mrelax
Indicate to the linker that it should perform a relaxation optimization pass
to shorten branches, calls and absolute memory addresses. This option only
has an effect when used on the command line for the final link step.
This option makes symbolic debugging impossible.
-@item -mliw
@opindex mliw
+@item -mliw
Allow the compiler to generate @emph{Long Instruction Word}
instructions if the target is the @samp{AM33} or later. This is the
default. This option defines the preprocessor macro @code{__LIW__}.
-@item -mno-liw
@opindex mno-liw
+@item -mno-liw
Do not allow the compiler to generate @emph{Long Instruction Word}
instructions. This option defines the preprocessor macro
@code{__NO_LIW__}.
-@item -msetlb
@opindex msetlb
+@item -msetlb
Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
instructions if the target is the @samp{AM33} or later. This is the
default. This option defines the preprocessor macro @code{__SETLB__}.
-@item -mno-setlb
@opindex mno-setlb
+@item -mno-setlb
Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
instructions. This option defines the preprocessor macro
@code{__NO_SETLB__}.
@table @gcctabopt
-@item -meb
@opindex meb
+@item -meb
Generate big-endian code. This is the default for @samp{moxie-*-*}
configurations.
-@item -mel
@opindex mel
+@item -mel
Generate little-endian code.
-@item -mmul.x
@opindex mmul.x
+@item -mmul.x
Generate mul.x and umul.x instructions. This is the default for
@samp{moxiebox-*-*} configurations.
-@item -mno-crt0
@opindex mno-crt0
+@item -mno-crt0
Do not link in the C run-time initialization object file.
@end table
@table @gcctabopt
-@item -masm-hex
@opindex masm-hex
+@item -masm-hex
Force assembly output to always use hex constants. Normally such
constants are signed decimals, but this option is available for
testsuite and/or aesthetic purposes.
-@item -mmcu=
@opindex mmcu=
+@item -mmcu=
Select the MCU to target. This is used to create a C preprocessor
symbol based upon the MCU name, converted to upper case and pre- and
post-fixed with @samp{__}. This in turn is used by the
hard-coded MCU data is used.
-@item -mwarn-mcu
-@itemx -mno-warn-mcu
@opindex mwarn-mcu
@opindex mno-warn-mcu
+@item -mwarn-mcu
+@itemx -mno-warn-mcu
This option enables or disables warnings about conflicts between the
MCU name specified by the @option{-mmcu} option and the ISA set by the
@option{-mcpu} option and/or the hardware multiply support set by the
@option{-mhwmult} option. It also toggles warnings about unrecognized
MCU names. This option is on by default.
-@item -mcpu=
@opindex mcpu=
+@item -mcpu=
Specifies the ISA to use. Accepted values are @samp{msp430},
@samp{msp430x} and @samp{msp430xv2}. This option is deprecated. The
@option{-mmcu=} option should be used to select the ISA.
-@item -msim
@opindex msim
+@item -msim
Link to the simulator runtime libraries and linker script. Overrides
any scripts that would be selected by the @option{-mmcu=} option.
-@item -mlarge
@opindex mlarge
+@item -mlarge
Use large-model addressing (20-bit pointers, 20-bit @code{size_t}).
-@item -msmall
@opindex msmall
+@item -msmall
Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
-@item -mrelax
@opindex mrelax
+@item -mrelax
This option is passed to the assembler and linker, and allows the
linker to perform certain optimizations that cannot be done until
the final link.
-@item mhwmult=
@opindex mhwmult=
+@item mhwmult=
Describes the type of hardware multiply supported by the target.
Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
for the original 16-bit-only multiply supported by early MCUs.
restore the previous interrupt state when they finish. This makes
them safe to use inside interrupt handlers as well as in normal code.
-@item -minrt
@opindex minrt
+@item -minrt
Enable the use of a minimum runtime environment - no static
initializers or constructors. This is intended for memory-constrained
devices. The compiler includes special symbols in some objects
that tell the linker and runtime which code fragments are required.
-@item -mtiny-printf
@opindex mtiny-printf
+@item -mtiny-printf
Enable reduced code size @code{printf} and @code{puts} library functions.
The @samp{tiny} implementations of these functions are not reentrant, so
must be used with caution in multi-threaded applications.
This option requires Newlib Nano IO, so GCC must be configured with
@samp{--enable-newlib-nano-formatted-io}.
-@item -mmax-inline-shift=
@opindex mmax-inline-shift=
+@item -mmax-inline-shift=
This option takes an integer between 0 and 64 inclusive, and sets
the maximum number of inline shift instructions which should be emitted to
perform a shift operation by a constant amount. When this value needs to be
Shifts of a 32-bit value are at least twice as costly, so the value passed for
this option is divided by 2 and the resulting value used instead.
-@item -mcode-region=
-@itemx -mdata-region=
@opindex mcode-region
@opindex mdata-region
+@item -mcode-region=
+@itemx -mdata-region=
These options tell the compiler where to place functions and data that
do not have one of the @code{lower}, @code{upper}, @code{either} or
@code{section} attributes. Possible values are @code{lower},
linker script and how it assigns the standard sections
(@code{.text}, @code{.data}, etc) to the memory regions.
-@item -msilicon-errata=
@opindex msilicon-errata
+@item -msilicon-errata=
This option passes on a request to assembler to enable the fixes for
the named silicon errata.
-@item -msilicon-errata-warn=
@opindex msilicon-errata-warn
+@item -msilicon-errata-warn=
This option passes on a request to the assembler to enable warning
messages when a silicon errata might need to be applied.
-@item -mwarn-devices-csv
-@itemx -mno-warn-devices-csv
@opindex mwarn-devices-csv
@opindex mno-warn-devices-csv
+@item -mwarn-devices-csv
+@itemx -mno-warn-devices-csv
Warn if @samp{devices.csv} is not found or there are problem parsing it
(default: on).
@table @gcctabopt
-@item -mbig-endian
@opindex mbig-endian
+@item -mbig-endian
Generate code in big-endian mode.
-@item -mlittle-endian
@opindex mlittle-endian
+@item -mlittle-endian
Generate code in little-endian mode.
-@item -mreduced-regs
@opindex mreduced-regs
+@item -mreduced-regs
Use reduced-set registers for register allocation.
-@item -mfull-regs
@opindex mfull-regs
+@item -mfull-regs
Use full-set registers for register allocation.
-@item -mcmov
@opindex mcmov
+@item -mcmov
Generate conditional move instructions.
-@item -mno-cmov
@opindex mno-cmov
+@item -mno-cmov
Do not generate conditional move instructions.
-@item -mext-perf
@opindex mext-perf
+@item -mext-perf
Generate performance extension instructions.
-@item -mno-ext-perf
@opindex mno-ext-perf
+@item -mno-ext-perf
Do not generate performance extension instructions.
-@item -mext-perf2
@opindex mext-perf2
+@item -mext-perf2
Generate performance extension 2 instructions.
-@item -mno-ext-perf2
@opindex mno-ext-perf2
+@item -mno-ext-perf2
Do not generate performance extension 2 instructions.
-@item -mext-string
@opindex mext-string
+@item -mext-string
Generate string extension instructions.
-@item -mno-ext-string
@opindex mno-ext-string
+@item -mno-ext-string
Do not generate string extension instructions.
-@item -mv3push
@opindex mv3push
+@item -mv3push
Generate v3 push25/pop25 instructions.
-@item -mno-v3push
@opindex mno-v3push
+@item -mno-v3push
Do not generate v3 push25/pop25 instructions.
-@item -m16-bit
@opindex m16-bit
+@item -m16-bit
Generate 16-bit instructions.
-@item -mno-16-bit
@opindex mno-16-bit
+@item -mno-16-bit
Do not generate 16-bit instructions.
-@item -misr-vector-size=@var{num}
@opindex misr-vector-size
+@item -misr-vector-size=@var{num}
Specify the size of each interrupt vector, which must be 4 or 16.
-@item -mcache-block-size=@var{num}
@opindex mcache-block-size
+@item -mcache-block-size=@var{num}
Specify the size of each cache block,
which must be a power of 2 between 4 and 512.
-@item -march=@var{arch}
@opindex march
+@item -march=@var{arch}
Specify the name of the target architecture.
-@item -mcmodel=@var{code-model}
@opindex mcmodel
+@item -mcmodel=@var{code-model}
Set the code model to one of
@table @asis
@item @samp{small}
All the text and data segments can be within 4GB addressing space.
@end table
-@item -mctor-dtor
@opindex mctor-dtor
+@item -mctor-dtor
Enable constructor/destructor feature.
-@item -mrelax
@opindex mrelax
+@item -mrelax
Guide linker to relax instructions.
@end table
@table @gcctabopt
-@item -G @var{num}
@opindex G
+@item -G @var{num}
@cindex smaller data references
Put global and static objects less than or equal to @var{num} bytes
into the small data or BSS sections instead of the normal data or BSS
sections. The default value of @var{num} is 8.
+@opindex mgpopt
+@opindex mno-gpopt
@item -mgpopt=@var{option}
@itemx -mgpopt
@itemx -mno-gpopt
-@opindex mgpopt
-@opindex mno-gpopt
Generate (do not generate) GP-relative accesses. The following
@var{option} names are recognized:
addressing may not be large enough to allow access to the entire
small data section.
-@item -mgprel-sec=@var{regexp}
@opindex mgprel-sec
+@item -mgprel-sec=@var{regexp}
This option specifies additional section names that can be accessed via
GP-relative addressing. It is most useful in conjunction with
@code{section} attributes on variable declarations
the specified sections are in addition to the standard @code{.sdata}
and @code{.sbss} small-data sections that are recognized by @option{-mgpopt}.
-@item -mr0rel-sec=@var{regexp}
@opindex mr0rel-sec
+@item -mr0rel-sec=@var{regexp}
This option specifies names of sections that can be accessed via a
16-bit offset from @code{r0}; that is, in the low 32K or high 32K
of the 32-bit address space. It is most useful in conjunction with
conventional section names used in standard linker scripts for sections
in the low or high areas of memory.
-@item -mel
-@itemx -meb
@opindex mel
@opindex meb
+@item -mel
+@itemx -meb
Generate little-endian (default) or big-endian (experimental) code,
respectively.
-@item -march=@var{arch}
@opindex march
+@item -march=@var{arch}
This specifies the name of the target Nios II architecture. GCC uses this
name to determine what kind of instructions it can emit when generating
assembly code. Permissible names are: @samp{r1}, @samp{r2}.
The preprocessor macro @code{__nios2_arch__} is available to programs,
with value 1 or 2, indicating the targeted ISA level.
-@item -mbypass-cache
-@itemx -mno-bypass-cache
@opindex mno-bypass-cache
@opindex mbypass-cache
+@item -mbypass-cache
+@itemx -mno-bypass-cache
Force all load and store instructions to always bypass cache by
using I/O variants of the instructions. The default is not to
bypass the cache.
-@item -mno-cache-volatile
-@itemx -mcache-volatile
@opindex mcache-volatile
@opindex mno-cache-volatile
+@item -mno-cache-volatile
+@itemx -mcache-volatile
Volatile memory access bypass the cache using the I/O variants of
the load and store instructions. The default is not to bypass the cache.
-@item -mno-fast-sw-div
-@itemx -mfast-sw-div
@opindex mno-fast-sw-div
@opindex mfast-sw-div
+@item -mno-fast-sw-div
+@itemx -mfast-sw-div
Do not use table-based fast divide for small numbers. The default
is to use the fast divide at @option{-O3} and above.
-@item -mno-hw-mul
-@itemx -mhw-mul
-@itemx -mno-hw-mulx
-@itemx -mhw-mulx
-@itemx -mno-hw-div
-@itemx -mhw-div
@opindex mno-hw-mul
@opindex mhw-mul
@opindex mno-hw-mulx
@opindex mhw-mulx
@opindex mno-hw-div
@opindex mhw-div
+@item -mno-hw-mul
+@itemx -mhw-mul
+@itemx -mno-hw-mulx
+@itemx -mhw-mulx
+@itemx -mno-hw-div
+@itemx -mhw-div
Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of
instructions by the compiler. The default is to emit @code{mul}
and not emit @code{div} and @code{mulx}.
requires @option{-march=r2}. Since these instructions are optional
extensions to the R2 architecture, the default is not to emit them.
-@item -mcustom-@var{insn}=@var{N}
-@itemx -mno-custom-@var{insn}
@opindex mcustom-@var{insn}
@opindex mno-custom-@var{insn}
+@item -mcustom-@var{insn}=@var{N}
+@itemx -mno-custom-@var{insn}
Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
custom instruction with encoding @var{N} when generating code that uses
@var{insn}. For example, @option{-mcustom-fadds=253} generates custom
(@pxref{Function Attributes})
or pragmas (@pxref{Function Specific Option Pragmas}).
-@item -mcustom-fpu-cfg=@var{name}
@opindex mcustom-fpu-cfg
+@item -mcustom-fpu-cfg=@var{name}
This option enables a predefined, named set of custom instruction encodings
(see @option{-mcustom-@var{insn}} above).
@table @gcctabopt
-@item -mhal
@opindex mhal
+@item -mhal
Link with HAL BSP. This suppresses linking with the GCC-provided C runtime
startup and termination code, and is typically used in conjunction with
@option{-msys-crt0=} to specify the location of the alternate startup code
provided by the HAL BSP.
-@item -msmallc
@opindex msmallc
+@item -msmallc
Link with a limited version of the C library, @option{-lsmallc}, rather than
Newlib.
-@item -msys-crt0=@var{startfile}
@opindex msys-crt0
+@item -msys-crt0=@var{startfile}
@var{startfile} is the file name of the startfile (crt0) to use
when linking. This option is only useful in conjunction with @option{-mhal}.
-@item -msys-lib=@var{systemlib}
@opindex msys-lib
+@item -msys-lib=@var{systemlib}
@var{systemlib} is the library name of the library that provides
low-level system calls required by the C library,
e.g.@: @code{read} and @code{write}.
@table @gcctabopt
-@item -m64
@opindex m64
+@item -m64
Ignored, but preserved for backward compatibility. Only 64-bit ABI is
supported.
-@item -march=@var{architecture-string}
@opindex march
+@item -march=@var{architecture-string}
Generate code for the specified PTX ISA target architecture
(e.g.@: @samp{sm_35}). Valid architecture strings are @samp{sm_30},
@samp{sm_35}, @samp{sm_53}, @samp{sm_70}, @samp{sm_75} and
@code{__PTX_SM__}; for instance, for @samp{sm_35}, it has the value
@samp{350}.
-@item -misa=@var{architecture-string}
@opindex misa
+@item -misa=@var{architecture-string}
Alias of @option{-march=}.
-@item -march-map=@var{architecture-string}
@opindex march
+@item -march-map=@var{architecture-string}
Select the closest available @option{-march=} value that is not more
capable. For instance, for @option{-march-map=sm_50} select
@option{-march=sm_35}, and for @option{-march-map=sm_53} select
@option{-march=sm_53}.
-@item -mptx=@var{version-string}
@opindex mptx
+@item -mptx=@var{version-string}
Generate code for the specified PTX ISA version (e.g.@: @samp{7.0}).
Valid version strings include @samp{3.1}, @samp{6.0}, @samp{6.3}, and
@samp{7.0}. The default PTX ISA version is 6.0, unless a higher
for instance, for @samp{3.1} the macros have the values @samp{3} and
@samp{1}, respectively.
-@item -mmainkernel
@opindex mmainkernel
+@item -mmainkernel
Link in code for a __main kernel. This is for stand-alone instead of
offloading execution.
-@item -moptimize
@opindex moptimize
+@item -moptimize
Apply partitioned execution optimizations. This is the default when any
level of optimization is selected.
-@item -msoft-stack
@opindex msoft-stack
+@item -msoft-stack
Generate code that does not use @code{.local} memory
directly for stack storage. Instead, a per-warp stack pointer is
maintained explicitly. This enables variable-length stack allocation (with
of testing the compiler; to generate code suitable for linking into programs
using OpenMP offloading, use option @option{-mgomp}.
-@item -muniform-simt
@opindex muniform-simt
+@item -muniform-simt
Switch to code generation variant that allows to execute all threads in each
warp, while maintaining memory state and side effects as if only one thread
in each warp was active outside of OpenMP SIMD regions. All atomic operations
regions). Each thread can bitwise-and the bitmask at position @code{tid.y}
with current lane index to compute the master lane index.
-@item -mgomp
@opindex mgomp
+@item -mgomp
Generate code for use in OpenMP offloading: enables @option{-msoft-stack} and
@option{-muniform-simt} options, and selects corresponding multilib variant.
@table @gcctabopt
-@item -mboard=@var{name}
@opindex mboard
+@item -mboard=@var{name}
Configure a board specific runtime. This will be passed to the linker for
newlib board library linking. The default is @code{or1ksim}.
-@item -mnewlib
@opindex mnewlib
+@item -mnewlib
This option is ignored; it is for compatibility purposes only. This used to
select linker and preprocessor options for use with newlib.
-@item -msoft-div
-@itemx -mhard-div
@opindex msoft-div
@opindex mhard-div
+@item -msoft-div
+@itemx -mhard-div
Select software or hardware divide (@code{l.div}, @code{l.divu}) instructions.
This default is hardware divide.
-@item -msoft-mul
-@itemx -mhard-mul
@opindex msoft-mul
@opindex mhard-mul
+@item -msoft-mul
+@itemx -mhard-mul
Select software or hardware multiply (@code{l.mul}, @code{l.muli}) instructions.
This default is hardware multiply.
-@item -msoft-float
-@itemx -mhard-float
@opindex msoft-float
@opindex mhard-float
+@item -msoft-float
+@itemx -mhard-float
Select software or hardware for floating point operations.
The default is software.
-@item -mdouble-float
@opindex mdouble-float
+@item -mdouble-float
When @option{-mhard-float} is selected, enables generation of double-precision
floating point instructions. By default functions from @file{libgcc} are used
to perform double-precision floating point operations.
-@item -munordered-float
@opindex munordered-float
+@item -munordered-float
When @option{-mhard-float} is selected, enables generation of unordered
floating point compare and set flag (@code{lf.sfun*}) instructions. By default
functions from @file{libgcc} are used to perform unordered floating point
compare and set flag operations.
-@item -mcmov
@opindex mcmov
+@item -mcmov
Enable generation of conditional move (@code{l.cmov}) instructions. By
default the equivalent will be generated using set and branch.
-@item -mror
@opindex mror
+@item -mror
Enable generation of rotate right (@code{l.ror}) instructions. By default
functions from @file{libgcc} are used to perform rotate right operations.
-@item -mrori
@opindex mrori
+@item -mrori
Enable generation of rotate right with immediate (@code{l.rori}) instructions.
By default functions from @file{libgcc} are used to perform rotate right with
immediate operations.
-@item -msext
@opindex msext
+@item -msext
Enable generation of sign extension (@code{l.ext*}) instructions. By default
memory loads are used to perform sign extension.
-@item -msfimm
@opindex msfimm
+@item -msfimm
Enable generation of compare and set flag with immediate (@code{l.sf*i})
instructions. By default extra instructions will be generated to store the
immediate to a register first.
-@item -mshftimm
@opindex mshftimm
+@item -mshftimm
Enable generation of shift with immediate (@code{l.srai}, @code{l.srli},
@code{l.slli}) instructions. By default extra instructions will be generated
to store the immediate to a register first.
-@item -mcmodel=small
@opindex mcmodel=small
+@item -mcmodel=small
Generate OpenRISC code for the small model: The GOT is limited to 64k. This is
the default model.
-@item -mcmodel=large
@opindex mcmodel=large
+@item -mcmodel=large
Generate OpenRISC code for the large model: The GOT may grow up to 4G in size.
These options are defined for the PDP-11:
@table @gcctabopt
-@item -mfpu
@opindex mfpu
+@item -mfpu
Use hardware FPP floating point. This is the default. (FIS floating
point on the PDP-11/40 is not supported.) Implies -m45.
-@item -msoft-float
@opindex msoft-float
+@item -msoft-float
Do not use hardware floating point.
-@item -mac0
@opindex mac0
+@item -mac0
Return floating-point results in ac0 (fr0 in Unix assembler syntax).
-@item -mno-ac0
@opindex mno-ac0
+@item -mno-ac0
Return floating-point results in memory. This is the default.
-@item -m40
@opindex m40
+@item -m40
Generate code for a PDP-11/40. Implies -msoft-float -mno-split.
-@item -m45
@opindex m45
+@item -m45
Generate code for a PDP-11/45. This is the default.
-@item -m10
@opindex m10
+@item -m10
Generate code for a PDP-11/10. Implies -msoft-float -mno-split.
-@item -mint16
-@itemx -mno-int32
@opindex mint16
@opindex mno-int32
+@item -mint16
+@itemx -mno-int32
Use 16-bit @code{int}. This is the default.
-@item -mint32
-@itemx -mno-int16
@opindex mint32
@opindex mno-int16
+@item -mint32
+@itemx -mno-int16
Use 32-bit @code{int}.
-@item -msplit
@opindex msplit
+@item -msplit
Target has split instruction and data space. Implies -m45.
-@item -munix-asm
@opindex munix-asm
+@item -munix-asm
Use Unix assembler syntax.
-@item -mdec-asm
@opindex mdec-asm
+@item -mdec-asm
Use DEC assembler syntax.
-@item -mgnu-asm
@opindex mgnu-asm
+@item -mgnu-asm
Use GNU assembler syntax. This is the default.
-@item -mlra
@opindex mlra
+@item -mlra
Use the new LRA register allocator. By default, the old ``reload''
allocator is used.
@end table
These command-line options are defined for PRU target:
@table @gcctabopt
-@item -minrt
@opindex minrt
+@item -minrt
Link with a minimum runtime environment, with no support for static
initializers and constructors. Using this option can significantly reduce
the size of the final ELF binary. Beware that the compiler could still
generate code with static initializers and constructors. It is up to the
programmer to ensure that the source program will not use those features.
-@item -mmcu=@var{mcu}
@opindex mmcu
+@item -mmcu=@var{mcu}
Specify the PRU MCU variant to use. Check Newlib for the exact list of
supported MCUs.
-@item -mno-relax
@opindex mno-relax
+@item -mno-relax
Make GCC pass the @option{--no-relax} command-line option to the linker
instead of the @option{--relax} option.
-@item -mloop
@opindex mloop
+@item -mloop
Allow (or do not allow) GCC to use the LOOP instruction.
-@item -mabi=@var{variant}
@opindex mabi
+@item -mabi=@var{variant}
Specify the ABI variant to output code for. @option{-mabi=ti} selects the
unmodified TI ABI while @option{-mabi=gnu} selects a GNU variant that copes
more naturally with certain GCC assumptions. These are the differences:
These command-line options are defined for RISC-V targets:
@table @gcctabopt
-@item -mbranch-cost=@var{n}
@opindex mbranch-cost
+@item -mbranch-cost=@var{n}
Set the cost of branches to roughly @var{n} instructions.
+@opindex plt
@item -mplt
@itemx -mno-plt
-@opindex plt
When generating PIC code, do or don't allow the use of PLTs. Ignored for
non-PIC. The default is @option{-mplt}.
-@item -mabi=@var{ABI-string}
@opindex mabi
+@item -mabi=@var{ABI-string}
Specify integer and floating-point calling convention. @var{ABI-string}
contains two parts: the size of integer types and the registers used for
floating-point types. For example @samp{-march=rv64ifd -mabi=lp64d} means that
only be used with the @samp{rv32e} architecture. This ABI is not well
specified at present, and is subject to change.
+@opindex mfdiv
@item -mfdiv
@itemx -mno-fdiv
-@opindex mfdiv
Do or don't use hardware floating-point divide and square root instructions.
This requires the F or D extensions for floating-point registers. The default
is to use them if the specified architecture has these instructions.
+@opindex mdiv
@item -mdiv
@itemx -mno-div
-@opindex mdiv
Do or don't use hardware instructions for integer division. This requires the
M extension. The default is to use them if the specified architecture has
these instructions.
-@item -misa-spec=@var{ISA-spec-string}
@opindex misa-spec
+@item -misa-spec=@var{ISA-spec-string}
Specify the version of the RISC-V Unprivileged (formerly User-Level)
ISA specification to produce code conforming to. The possibilities
for @var{ISA-spec-string} are:
The default is @option{-misa-spec=20191213} unless GCC has been configured
with @option{--with-isa-spec=} specifying a different default version.
-@item -march=@var{ISA-string}
@opindex march
+@item -march=@var{ISA-string}
Generate code for given RISC-V ISA (e.g.@: @samp{rv64im}). ISA strings must be
lower-case. Examples include @samp{rv64i}, @samp{rv32g}, @samp{rv32e}, and
@samp{rv32imaf}.
this argument is system dependent, users who want a specific architecture
extensions should specify one explicitly.
-@item -mcpu=@var{processor-string}
@opindex mcpu
+@item -mcpu=@var{processor-string}
Use architecture of and optimize the output for the given processor, specified
by particular CPU name.
Permissible values for this option are: @samp{sifive-e20}, @samp{sifive-e21},
@samp{sifive-s21}, @samp{sifive-s51}, @samp{sifive-s54}, @samp{sifive-s76},
@samp{sifive-u54}, and @samp{sifive-u74}.
-@item -mtune=@var{processor-string}
@opindex mtune
+@item -mtune=@var{processor-string}
Optimize the output for the given processor, specified by microarchitecture or
particular CPU name. Permissible values for this option are: @samp{rocket},
@samp{sifive-3-series}, @samp{sifive-5-series}, @samp{sifive-7-series},
provided by @option{-mtune=}, but does not override the pipeline info. This
helps reduce code size while still giving good performance.
-@item -mpreferred-stack-boundary=@var{num}
@opindex mpreferred-stack-boundary
+@item -mpreferred-stack-boundary=@var{num}
Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
byte boundary. If @option{-mpreferred-stack-boundary} is not specified,
the default is 4 (16 bytes or 128-bits).
the same value, including any libraries. This includes the system libraries
and startup modules.
-@item -msmall-data-limit=@var{n}
@opindex msmall-data-limit
+@item -msmall-data-limit=@var{n}
Put global and static data smaller than @var{n} bytes into a special section
(on some targets).
+@opindex msave-restore
@item -msave-restore
@itemx -mno-save-restore
-@opindex msave-restore
Do or don't use smaller but slower prologue and epilogue code that uses
library function calls. The default is to use fast inline prologues and
epilogues.
+@opindex mshorten-memrefs
@item -mshorten-memrefs
@itemx -mno-shorten-memrefs
-@opindex mshorten-memrefs
Do or do not attempt to make more use of compressed load/store instructions by
replacing a load/store of 'base register + large offset' with a new load/store
of 'new base + small offset'. If the new base gets stored in a compressed
register, then the new load/store can be compressed. Currently targets 32-bit
integer load/stores only.
+@opindex mstrict-align
@item -mstrict-align
@itemx -mno-strict-align
-@opindex mstrict-align
Do not or do generate unaligned memory accesses. The default is set depending
on whether the processor we are optimizing for supports fast unaligned access
or not.
-@item -mcmodel=medlow
@opindex mcmodel=medlow
+@item -mcmodel=medlow
Generate code for the medium-low code model. The program and its statically
defined symbols must lie within a single 2 GiB address range and must lie
between absolute addresses @minus{}2 GiB and +2 GiB. Programs can be
statically or dynamically linked. This is the default code model.
-@item -mcmodel=medany
@opindex mcmodel=medany
+@item -mcmodel=medany
Generate code for the medium-any code model. The program and its statically
defined symbols must be within any single 2 GiB address range. Programs can be
statically or dynamically linked.
addresses. The alternative is to use assembler macros instead, which may
limit optimization.
+@opindex mrelax
@item -mrelax
@itemx -mno-relax
-@opindex mrelax
Take advantage of linker relaxations to reduce the number of instructions
required to materialize symbol addresses. The default is to take advantage of
linker relaxations.
+@opindex mriscv-attribute
@item -mriscv-attribute
@itemx -mno-riscv-attribute
-@opindex mriscv-attribute
Emit (do not emit) RISC-V attribute to record extra information into ELF
objects. This feature requires at least binutils 2.32.
+@opindex mcsr-check
@item -mcsr-check
@itemx -mno-csr-check
-@opindex mcsr-check
Enables or disables the CSR checking.
-@item -malign-data=@var{type}
@opindex malign-data
+@item -malign-data=@var{type}
Control how GCC aligns variables and constants of array, structure, or union
types. Supported values for @var{type} are @samp{xlen} which uses x register
width as the alignment value, and @samp{natural} which uses natural alignment.
@samp{xlen} is the default.
-@item -mbig-endian
@opindex mbig-endian
+@item -mbig-endian
Generate big-endian code. This is the default when GCC is configured for a
@samp{riscv64be-*-*} or @samp{riscv32be-*-*} target.
-@item -mlittle-endian
@opindex mlittle-endian
+@item -mlittle-endian
Generate little-endian code. This is the default when GCC is configured for a
@samp{riscv64-*-*} or @samp{riscv32-*-*} but not a @samp{riscv64be-*-*} or
@samp{riscv32be-*-*} target.
-@item -mstack-protector-guard=@var{guard}
-@itemx -mstack-protector-guard-reg=@var{reg}
-@itemx -mstack-protector-guard-offset=@var{offset}
@opindex mstack-protector-guard
@opindex mstack-protector-guard-reg
@opindex mstack-protector-guard-offset
+@item -mstack-protector-guard=@var{guard}
+@itemx -mstack-protector-guard-reg=@var{reg}
+@itemx -mstack-protector-guard-offset=@var{offset}
Generate stack protection code using canary at @var{guard}. Supported
locations are @samp{global} for a global canary or @samp{tls} for per-thread
canary in the TLS block.
@table @gcctabopt
-@item -msim
@opindex msim
+@item -msim
Links in additional target libraries to support operation within a
simulator.
+@opindex mmul
@item -mmul=none
@itemx -mmul=g10
@itemx -mmul=g13
@itemx -mmul=g14
@itemx -mmul=rl78
-@opindex mmul
Specifies the type of hardware multiplication and division support to
be used. The simplest is @code{none}, which uses software for both
multiplication and division. This is the default. The @code{g13}
of this option. Possible values are: @code{__RL78_MUL_NONE__},
@code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
+@opindex mcpu
@item -mcpu=g10
@itemx -mcpu=g13
@itemx -mcpu=g14
@itemx -mcpu=rl78
-@opindex mcpu
Specifies the RL78 core to target. The default is the G14 core, also
known as an S3 core or just RL78. The G13 or S2 core does not have
multiply or divide instructions, instead it uses a hardware peripheral
of this option. Possible values are: @code{__RL78_G10__},
@code{__RL78_G13__} or @code{__RL78_G14__}.
-@item -mg10
-@itemx -mg13
-@itemx -mg14
-@itemx -mrl78
@opindex mg10
@opindex mg13
@opindex mg14
@opindex mrl78
+@item -mg10
+@itemx -mg13
+@itemx -mg14
+@itemx -mrl78
These are aliases for the corresponding @option{-mcpu=} option. They
are provided for backwards compatibility.
-@item -mallregs
@opindex mallregs
+@item -mallregs
Allow the compiler to use all of the available registers. By default
registers @code{r24..r31} are reserved for use in interrupt handlers.
With this option enabled these registers can be used in ordinary
functions as well.
-@item -m64bit-doubles
-@itemx -m32bit-doubles
@opindex m64bit-doubles
@opindex m32bit-doubles
+@item -m64bit-doubles
+@itemx -m32bit-doubles
Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
or 32 bits (@option{-m32bit-doubles}) in size. The default is
@option{-m32bit-doubles}.
-@item -msave-mduc-in-interrupts
-@itemx -mno-save-mduc-in-interrupts
@opindex msave-mduc-in-interrupts
@opindex mno-save-mduc-in-interrupts
+@item -msave-mduc-in-interrupts
+@itemx -mno-save-mduc-in-interrupts
Specifies that interrupt handler functions should preserve the
MDUC registers. This is only necessary if normal code might use
the MDUC registers, for example because it performs multiplication
@itemx -mfprnd
@itemx -mno-fprnd
@need 800
-@itemx -mcmpb
-@itemx -mno-cmpb
-@itemx -mhard-dfp
-@itemx -mno-hard-dfp
@opindex mpowerpc-gpopt
@opindex mno-powerpc-gpopt
@opindex mpowerpc-gfxopt
@opindex mno-cmpb
@opindex mhard-dfp
@opindex mno-hard-dfp
+@itemx -mcmpb
+@itemx -mno-cmpb
+@itemx -mhard-dfp
+@itemx -mno-hard-dfp
You use these options to specify which instructions are available on the
processor you are using. The default value of these options is
determined when configuring GCC@. Specifying the
and to treat GPRs as 64-bit, doubleword quantities. GCC defaults to
@option{-mno-powerpc64}.
-@item -mcpu=@var{cpu_type}
@opindex mcpu
+@item -mcpu=@var{cpu_type}
Set architecture type, register usage, and
instruction scheduling parameters for machine type @var{cpu_type}.
Supported values for @var{cpu_type} are @samp{401}, @samp{403},
enable or disable them individually if you're sure it'll work in your
environment.
-@item -mtune=@var{cpu_type}
@opindex mtune
+@item -mtune=@var{cpu_type}
Set the instruction scheduling parameters for machine type
@var{cpu_type}, but do not set the architecture type or register usage,
as @option{-mcpu=@var{cpu_type}} does. The same
architecture and registers set by @option{-mcpu}, but the
scheduling parameters set by @option{-mtune}.
-@item -mcmodel=small
@opindex mcmodel=small
+@item -mcmodel=small
Generate PowerPC64 code for the small model: The TOC is limited to
64k.
-@item -mcmodel=medium
@opindex mcmodel=medium
+@item -mcmodel=medium
Generate PowerPC64 code for the medium model: The TOC and other static
data may be up to a total of 4G in size. This is the default for 64-bit
Linux.
-@item -mcmodel=large
@opindex mcmodel=large
+@item -mcmodel=large
Generate PowerPC64 code for the large model: The TOC may be up to 4G
in size. Other data and code is only limited by the 64-bit address
space.
-@item -maltivec
-@itemx -mno-altivec
@opindex maltivec
@opindex mno-altivec
+@item -maltivec
+@itemx -mno-altivec
Generate code that uses (does not use) AltiVec instructions, and also
enable the use of built-in functions that allow more direct access to
the AltiVec instruction set. You may also need to set
the rightmost element in a vector register when targeting a
little-endian platform.
-@item -mvrsave
-@itemx -mno-vrsave
@opindex mvrsave
@opindex mno-vrsave
+@item -mvrsave
+@itemx -mno-vrsave
Generate VRSAVE instructions when generating AltiVec code.
-@item -msecure-plt
@opindex msecure-plt
+@item -msecure-plt
Generate code that allows @command{ld} and @command{ld.so}
to build executables and shared
libraries with non-executable @code{.plt} and @code{.got} sections.
This is a PowerPC
32-bit SYSV ABI option.
-@item -mbss-plt
@opindex mbss-plt
+@item -mbss-plt
Generate code that uses a BSS @code{.plt} section that @command{ld.so}
fills in, and
requires @code{.plt} and @code{.got}
sections that are both writable and executable.
This is a PowerPC 32-bit SYSV ABI option.
-@item -misel
-@itemx -mno-isel
@opindex misel
@opindex mno-isel
+@item -misel
+@itemx -mno-isel
This switch enables or disables the generation of ISEL instructions.
-@item -mvsx
-@itemx -mno-vsx
@opindex mvsx
@opindex mno-vsx
+@item -mvsx
+@itemx -mno-vsx
Generate code that uses (does not use) vector/scalar (VSX)
instructions, and also enable the use of built-in functions that allow
more direct access to the VSX instruction set.
-@item -mcrypto
-@itemx -mno-crypto
@opindex mcrypto
@opindex mno-crypto
+@item -mcrypto
+@itemx -mno-crypto
Enable the use (disable) of the built-in functions that allow direct
access to the cryptographic instructions that were added in version
2.07 of the PowerPC ISA.
-@item -mhtm
-@itemx -mno-htm
@opindex mhtm
@opindex mno-htm
+@item -mhtm
+@itemx -mno-htm
Enable (disable) the use of the built-in functions that allow direct
access to the Hardware Transactional Memory (HTM) instructions that
were added in version 2.07 of the PowerPC ISA.
-@item -mpower8-fusion
-@itemx -mno-power8-fusion
@opindex mpower8-fusion
@opindex mno-power8-fusion
+@item -mpower8-fusion
+@itemx -mno-power8-fusion
Generate code that keeps (does not keeps) some integer operations
adjacent so that the instructions can be fused together on power8 and
later processors.
-@item -mpower8-vector
-@itemx -mno-power8-vector
@opindex mpower8-vector
@opindex mno-power8-vector
+@item -mpower8-vector
+@itemx -mno-power8-vector
Generate code that uses (does not use) the vector and scalar
instructions that were added in version 2.07 of the PowerPC ISA. Also
enable the use of built-in functions that allow more direct access to
the vector instructions.
-@item -mquad-memory
-@itemx -mno-quad-memory
@opindex mquad-memory
@opindex mno-quad-memory
+@item -mquad-memory
+@itemx -mno-quad-memory
Generate code that uses (does not use) the non-atomic quad word memory
instructions. The @option{-mquad-memory} option requires use of
64-bit mode.
-@item -mquad-memory-atomic
-@itemx -mno-quad-memory-atomic
@opindex mquad-memory-atomic
@opindex mno-quad-memory-atomic
+@item -mquad-memory-atomic
+@itemx -mno-quad-memory-atomic
Generate code that uses (does not use) the atomic quad word memory
instructions. The @option{-mquad-memory-atomic} option requires use of
64-bit mode.
-@item -mfloat128
-@itemx -mno-float128
@opindex mfloat128
@opindex mno-float128
+@item -mfloat128
+@itemx -mno-float128
Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
and use either software emulation for IEEE 128-bit floating point or
hardware instructions.
system, IEEE 128-bit floating point will be done with software
emulation.
-@item -mfloat128-hardware
-@itemx -mno-float128-hardware
@opindex mfloat128-hardware
@opindex mno-float128-hardware
+@item -mfloat128-hardware
+@itemx -mno-float128-hardware
Enable/disable using ISA 3.0 hardware instructions to support the
@var{__float128} data type.
Linux systems using the ISA 3.0 instruction set, and disabled on other
systems.
-@item -m32
-@itemx -m64
@opindex m32
@opindex m64
+@item -m32
+@itemx -m64
Generate code for 32-bit or 64-bit environments of Darwin and SVR4
targets (including GNU/Linux). The 32-bit environment sets int, long
and pointer to 32 bits and generates code that runs on any PowerPC
pointer to 64 bits, and generates code for PowerPC64, as for
@option{-mpowerpc64}.
-@item -mfull-toc
-@itemx -mno-fp-in-toc
-@itemx -mno-sum-in-toc
-@itemx -mminimal-toc
@opindex mfull-toc
@opindex mno-fp-in-toc
@opindex mno-sum-in-toc
@opindex mminimal-toc
+@item -mfull-toc
+@itemx -mno-fp-in-toc
+@itemx -mno-sum-in-toc
+@itemx -mminimal-toc
Modify generation of the TOC (Table Of Contents), which is created for
every executable file. The @option{-mfull-toc} option is selected by
default. In that case, GCC allocates at least one TOC entry for
uses extremely little TOC space. You may wish to use this option
only on files that contain less frequently-executed code.
-@item -maix64
-@itemx -maix32
@opindex maix64
@opindex maix32
+@item -maix64
+@itemx -maix32
Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
@code{long} type, and the infrastructure needed to support them.
Specifying @option{-maix64} implies @option{-mpowerpc64},
while @option{-maix32} disables the 64-bit ABI and
implies @option{-mno-powerpc64}. GCC defaults to @option{-maix32}.
-@item -mxl-compat
-@itemx -mno-xl-compat
@opindex mxl-compat
@opindex mno-xl-compat
+@item -mxl-compat
+@itemx -mno-xl-compat
Produce code that conforms more closely to IBM XL compiler semantics
when using AIX-compatible ABI@. Pass floating-point arguments to
prototyped functions beyond the register save area (RSA) on the stack
default and only is necessary when calling subroutines compiled by IBM
XL compilers without optimization.
-@item -mpe
@opindex mpe
+@item -mpe
Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@. Link an
application written to use message passing with special startup code to
enable the application to run. The system must have PE installed in the
support threads, so the @option{-mpe} option and the @option{-pthread}
option are incompatible.
-@item -malign-natural
-@itemx -malign-power
@opindex malign-natural
@opindex malign-power
+@item -malign-natural
+@itemx -malign-power
On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
@option{-malign-natural} overrides the ABI-defined alignment of larger
types, such as floating-point doubles, on their natural size-based boundary.
On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
is not supported.
-@item -msoft-float
-@itemx -mhard-float
@opindex msoft-float
@opindex mhard-float
+@item -msoft-float
+@itemx -mhard-float
Generate code that does not use (uses) the floating-point register set.
Software floating-point emulation is provided if you use the
@option{-msoft-float} option, and pass the option to GCC when linking.
-@item -mmultiple
-@itemx -mno-multiple
@opindex mmultiple
@opindex mno-multiple
+@item -mmultiple
+@itemx -mno-multiple
Generate code that uses (does not use) the load multiple word
instructions and the store multiple word instructions. These
instructions are generated by default on POWER systems, and not
processor is in little-endian mode. The exceptions are PPC740 and
PPC750 which permit these instructions in little-endian mode.
-@item -mupdate
-@itemx -mno-update
@opindex mupdate
@opindex mno-update
+@item -mupdate
+@itemx -mno-update
Generate code that uses (does not use) the load or store instructions
that update the base register to the address of the calculated memory
location. These instructions are generated by default. If you use
stored, which means code that walks the stack frame across interrupts or
signals may get corrupted data.
-@item -mavoid-indexed-addresses
-@itemx -mno-avoid-indexed-addresses
@opindex mavoid-indexed-addresses
@opindex mno-avoid-indexed-addresses
+@item -mavoid-indexed-addresses
+@itemx -mno-avoid-indexed-addresses
Generate code that tries to avoid (not avoid) the use of indexed load
or store instructions. These instructions can incur a performance
penalty on Power6 processors in certain situations, such as when
stepping through large arrays that cross a 16M boundary. This option
is enabled by default when targeting Power6 and disabled otherwise.
-@item -mfused-madd
-@itemx -mno-fused-madd
@opindex mfused-madd
@opindex mno-fused-madd
+@item -mfused-madd
+@itemx -mno-fused-madd
Generate code that uses (does not use) the floating-point multiply and
accumulate instructions. These instructions are generated by default
if hardware floating point is used. The machine-dependent
@option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
mapped to @option{-ffp-contract=off}.
-@item -mmulhw
-@itemx -mno-mulhw
@opindex mmulhw
@opindex mno-mulhw
+@item -mmulhw
+@itemx -mno-mulhw
Generate code that uses (does not use) the half-word multiply and
multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
These instructions are generated by default when targeting those
processors.
-@item -mdlmzb
-@itemx -mno-dlmzb
@opindex mdlmzb
@opindex mno-dlmzb
+@item -mdlmzb
+@itemx -mno-dlmzb
Generate code that uses (does not use) the string-search @samp{dlmzb}
instruction on the IBM 405, 440, 464 and 476 processors. This instruction is
generated by default when targeting those processors.
-@item -mno-bit-align
-@itemx -mbit-align
@opindex mno-bit-align
@opindex mbit-align
+@item -mno-bit-align
+@itemx -mbit-align
On System V.4 and embedded PowerPC systems do not (do) force structures
and unions that contain bit-fields to be aligned to the base type of the
bit-field.
the structure is aligned to a 1-byte boundary and is 1 byte in
size.
-@item -mno-strict-align
-@itemx -mstrict-align
@opindex mno-strict-align
@opindex mstrict-align
+@item -mno-strict-align
+@itemx -mstrict-align
On System V.4 and embedded PowerPC systems do not (do) assume that
unaligned memory references are handled by the system.
-@item -mrelocatable
-@itemx -mno-relocatable
@opindex mrelocatable
@opindex mno-relocatable
+@item -mrelocatable
+@itemx -mno-relocatable
Generate code that allows (does not allow) a static executable to be
relocated to a different address at run time. A simple embedded
PowerPC system loader should relocate the entire contents of
@option{-mrelocatable} or @option{-mrelocatable-lib}.
@option{-mrelocatable} code aligns the stack to an 8-byte boundary.
-@item -mrelocatable-lib
-@itemx -mno-relocatable-lib
@opindex mrelocatable-lib
@opindex mno-relocatable-lib
+@item -mrelocatable-lib
+@itemx -mno-relocatable-lib
Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
@code{.fixup} section to allow static executables to be relocated at
run time, but @option{-mrelocatable-lib} does not use the smaller stack
@option{-mrelocatable-lib} may be linked with objects compiled with
any combination of the @option{-mrelocatable} options.
-@item -mno-toc
-@itemx -mtoc
@opindex mno-toc
@opindex mtoc
+@item -mno-toc
+@itemx -mtoc
On System V.4 and embedded PowerPC systems do not (do) assume that
register 2 contains a pointer to a global area pointing to the addresses
used in the program.
-@item -mlittle
-@itemx -mlittle-endian
@opindex mlittle
@opindex mlittle-endian
+@item -mlittle
+@itemx -mlittle-endian
On System V.4 and embedded PowerPC systems compile code for the
processor in little-endian mode. The @option{-mlittle-endian} option is
the same as @option{-mlittle}.
-@item -mbig
-@itemx -mbig-endian
@opindex mbig
@opindex mbig-endian
+@item -mbig
+@itemx -mbig-endian
On System V.4 and embedded PowerPC systems compile code for the
processor in big-endian mode. The @option{-mbig-endian} option is
the same as @option{-mbig}.
-@item -mdynamic-no-pic
@opindex mdynamic-no-pic
+@item -mdynamic-no-pic
On Darwin and Mac OS X systems, compile code so that it is not
relocatable, but that its external references are relocatable. The
resulting code is suitable for applications, but not shared
libraries.
-@item -msingle-pic-base
@opindex msingle-pic-base
+@item -msingle-pic-base
Treat the register used for PIC addressing as read-only, rather than
loading it in the prologue for each function. The runtime system is
responsible for initializing this register with an appropriate value
before execution begins.
-@item -mprioritize-restricted-insns=@var{priority}
@opindex mprioritize-restricted-insns
+@item -mprioritize-restricted-insns=@var{priority}
This option controls the priority that is assigned to
dispatch-slot restricted instructions during the second scheduling
pass. The argument @var{priority} takes the value @samp{0}, @samp{1},
priority to dispatch-slot restricted
instructions.
-@item -msched-costly-dep=@var{dependence_type}
@opindex msched-costly-dep
+@item -msched-costly-dep=@var{dependence_type}
This option controls which dependences are considered costly
by the target during instruction scheduling. The argument
@var{dependence_type} takes one of the following values:
@var{number} is costly.
@end table
-@item -minsert-sched-nops=@var{scheme}
@opindex minsert-sched-nops
+@item -minsert-sched-nops=@var{scheme}
This option controls which NOP insertion scheme is used during
the second scheduling pass. The argument @var{scheme} takes one of the
following values:
separate groups. Insert @var{number} NOPs to force an insn to a new group.
@end table
-@item -mcall-sysv
@opindex mcall-sysv
+@item -mcall-sysv
On System V.4 and embedded PowerPC systems compile code using calling
conventions that adhere to the March 1995 draft of the System V
Application Binary Interface, PowerPC processor supplement. This is the
default unless you configured GCC using @samp{powerpc-*-eabiaix}.
-@item -mcall-sysv-eabi
-@itemx -mcall-eabi
@opindex mcall-sysv-eabi
@opindex mcall-eabi
+@item -mcall-sysv-eabi
+@itemx -mcall-eabi
Specify both @option{-mcall-sysv} and @option{-meabi} options.
-@item -mcall-sysv-noeabi
@opindex mcall-sysv-noeabi
+@item -mcall-sysv-noeabi
Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
-@item -mcall-aixdesc
@opindex mcall-aixdesc
+@item -mcall-aixdesc
On System V.4 and embedded PowerPC systems compile code for the AIX
operating system.
-@item -mcall-linux
@opindex mcall-linux
+@item -mcall-linux
On System V.4 and embedded PowerPC systems compile code for the
Linux-based GNU system.
-@item -mcall-freebsd
@opindex mcall-freebsd
+@item -mcall-freebsd
On System V.4 and embedded PowerPC systems compile code for the
FreeBSD operating system.
-@item -mcall-netbsd
@opindex mcall-netbsd
+@item -mcall-netbsd
On System V.4 and embedded PowerPC systems compile code for the
NetBSD operating system.
-@item -mcall-openbsd
@opindex mcall-openbsd
+@item -mcall-openbsd
On System V.4 and embedded PowerPC systems compile code for the
OpenBSD operating system.
-@item -mtraceback=@var{traceback_type}
@opindex mtraceback
+@item -mtraceback=@var{traceback_type}
Select the type of traceback table. Valid values for @var{traceback_type}
are @samp{full}, @samp{part}, and @samp{no}.
-@item -maix-struct-return
@opindex maix-struct-return
+@item -maix-struct-return
Return all structures in memory (as specified by the AIX ABI)@.
-@item -msvr4-struct-return
@opindex msvr4-struct-return
+@item -msvr4-struct-return
Return structures smaller than 8 bytes in registers (as specified by the
SVR4 ABI)@.
-@item -mabi=@var{abi-type}
@opindex mabi
+@item -mabi=@var{abi-type}
Extend the current ABI with a particular extension, or remove such extension.
Valid values are: @samp{altivec}, @samp{no-altivec},
@samp{ibmlongdouble}, @samp{ieeelongdouble},
@samp{elfv1}, @samp{elfv2},
and for AIX: @samp{vec-extabi}, @samp{vec-default}@.
-@item -mabi=ibmlongdouble
@opindex mabi=ibmlongdouble
+@item -mabi=ibmlongdouble
Change the current ABI to use IBM extended-precision long double.
This is not likely to work if your system defaults to using IEEE
extended-precision long double. If you change the long double type
you use the @option{-Wno-psabi} option. Requires @option{-mlong-double-128}
to be enabled.
-@item -mabi=ieeelongdouble
@opindex mabi=ieeelongdouble
+@item -mabi=ieeelongdouble
Change the current ABI to use IEEE extended-precision long double.
This is not likely to work if your system defaults to using IBM
extended-precision long double. If you change the long double type
you use the @option{-Wno-psabi} option. Requires @option{-mlong-double-128}
to be enabled.
-@item -mabi=elfv1
@opindex mabi=elfv1
+@item -mabi=elfv1
Change the current ABI to use the ELFv1 ABI.
This is the default ABI for big-endian PowerPC 64-bit Linux.
Overriding the default ABI requires special system support and is
likely to fail in spectacular ways.
-@item -mabi=elfv2
@opindex mabi=elfv2
+@item -mabi=elfv2
Change the current ABI to use the ELFv2 ABI.
This is the default ABI for little-endian PowerPC 64-bit Linux.
Overriding the default ABI requires special system support and is
likely to fail in spectacular ways.
-@item -mgnu-attribute
-@itemx -mno-gnu-attribute
@opindex mgnu-attribute
@opindex mno-gnu-attribute
+@item -mgnu-attribute
+@itemx -mno-gnu-attribute
Emit .gnu_attribute assembly directives to set tag/value pairs in a
.gnu.attributes section that specify ABI variations in function
parameters or return values.
-@item -mprototype
-@itemx -mno-prototype
@opindex mprototype
@opindex mno-prototype
+@item -mprototype
+@itemx -mno-prototype
On System V.4 and embedded PowerPC systems assume that all calls to
variable argument functions are properly prototyped. Otherwise, the
compiler must insert an instruction before every non-prototyped call to
@option{-mprototype}, only calls to prototyped variable argument functions
set or clear the bit.
-@item -msim
@opindex msim
+@item -msim
On embedded PowerPC systems, assume that the startup module is called
@file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
@file{libc.a}. This is the default for @samp{powerpc-*-eabisim}
configurations.
-@item -mmvme
@opindex mmvme
+@item -mmvme
On embedded PowerPC systems, assume that the startup module is called
@file{crt0.o} and the standard C libraries are @file{libmvme.a} and
@file{libc.a}.
-@item -mads
@opindex mads
+@item -mads
On embedded PowerPC systems, assume that the startup module is called
@file{crt0.o} and the standard C libraries are @file{libads.a} and
@file{libc.a}.
-@item -myellowknife
@opindex myellowknife
+@item -myellowknife
On embedded PowerPC systems, assume that the startup module is called
@file{crt0.o} and the standard C libraries are @file{libyk.a} and
@file{libc.a}.
-@item -mvxworks
@opindex mvxworks
+@item -mvxworks
On System V.4 and embedded PowerPC systems, specify that you are
compiling for a VxWorks system.
-@item -memb
@opindex memb
+@item -memb
On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
header to indicate that @samp{eabi} extended relocations are used.
-@item -meabi
-@itemx -mno-eabi
@opindex meabi
@opindex mno-eabi
+@item -meabi
+@itemx -mno-eabi
On System V.4 and embedded PowerPC systems do (do not) adhere to the
Embedded Applications Binary Interface (EABI), which is a set of
modifications to the System V.4 specifications. Selecting @option{-meabi}
small data area. The @option{-meabi} option is on by default if you
configured GCC using one of the @samp{powerpc*-*-eabi*} options.
-@item -msdata=eabi
@opindex msdata=eabi
+@item -msdata=eabi
On System V.4 and embedded PowerPC systems, put small initialized
@code{const} global and static data in the @code{.sdata2} section, which
is pointed to by register @code{r2}. Put small initialized
incompatible with the @option{-mrelocatable} option. The
@option{-msdata=eabi} option also sets the @option{-memb} option.
-@item -msdata=sysv
@opindex msdata=sysv
+@item -msdata=sysv
On System V.4 and embedded PowerPC systems, put small global and static
data in the @code{.sdata} section, which is pointed to by register
@code{r13}. Put small uninitialized global and static data in the
The @option{-msdata=sysv} option is incompatible with the
@option{-mrelocatable} option.
-@item -msdata=default
-@itemx -msdata
@opindex msdata=default
@opindex msdata
+@item -msdata=default
+@itemx -msdata
On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
compile code the same as @option{-msdata=eabi}, otherwise compile code the
same as @option{-msdata=sysv}.
-@item -msdata=data
@opindex msdata=data
+@item -msdata=data
On System V.4 and embedded PowerPC systems, put small global
data in the @code{.sdata} section. Put small uninitialized global
data in the @code{.sbss} section. Do not use register @code{r13}
to address small data however. This is the default behavior unless
other @option{-msdata} options are used.
-@item -msdata=none
-@itemx -mno-sdata
@opindex msdata=none
@opindex mno-sdata
+@item -msdata=none
+@itemx -mno-sdata
On embedded PowerPC systems, put all initialized global and static data
in the @code{.data} section, and all uninitialized data in the
@code{.bss} section.
-@item -mreadonly-in-sdata
@opindex mreadonly-in-sdata
@opindex mno-readonly-in-sdata
+@item -mreadonly-in-sdata
Put read-only objects in the @code{.sdata} section as well. This is the
default.
-@item -mblock-move-inline-limit=@var{num}
@opindex mblock-move-inline-limit
+@item -mblock-move-inline-limit=@var{num}
Inline all block moves (such as calls to @code{memcpy} or structure
copies) less than or equal to @var{num} bytes. The minimum value for
@var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
targets. The default value is target-specific.
-@item -mblock-compare-inline-limit=@var{num}
@opindex mblock-compare-inline-limit
+@item -mblock-compare-inline-limit=@var{num}
Generate non-looping inline code for all block compares (such as calls
to @code{memcmp} or structure compares) less than or equal to @var{num}
bytes. If @var{num} is 0, all inline expansion (non-loop and loop) of
block compare is disabled. The default value is target-specific.
-@item -mblock-compare-inline-loop-limit=@var{num}
@opindex mblock-compare-inline-loop-limit
+@item -mblock-compare-inline-loop-limit=@var{num}
Generate an inline expansion using loop code for all block compares that
are less than or equal to @var{num} bytes, but greater than the limit
for non-loop inline block compare expansion. If the block length is not
is called to compare the remainder of the block. The default value is
target-specific.
-@item -mstring-compare-inline-limit=@var{num}
@opindex mstring-compare-inline-limit
+@item -mstring-compare-inline-limit=@var{num}
Compare at most @var{num} string bytes with inline code.
If the difference or end of string is not found at the
end of the inline compare a call to @code{strcmp} or @code{strncmp} will
take care of the rest of the comparison. The default is 64 bytes.
-@item -G @var{num}
@opindex G
+@item -G @var{num}
@cindex smaller data references (PowerPC)
@cindex .sdata/.sdata2 references (PowerPC)
On embedded PowerPC systems, put global and static items less than or
@option{-G @var{num}} switch is also passed to the linker.
All modules should be compiled with the same @option{-G @var{num}} value.
-@item -mregnames
-@itemx -mno-regnames
@opindex mregnames
@opindex mno-regnames
+@item -mregnames
+@itemx -mno-regnames
On System V.4 and embedded PowerPC systems do (do not) emit register
names in the assembly language output using symbolic forms.
-@item -mlongcall
-@itemx -mno-longcall
@opindex mlongcall
@opindex mno-longcall
+@item -mlongcall
+@itemx -mno-longcall
By default assume that all calls are far away so that a longer and more
expensive calling sequence is required. This is required for calls
farther than 32 megabytes (33,554,432 bytes) from the current location.
In the future, GCC may ignore all longcall specifications
when the linker is known to generate glue.
-@item -mpltseq
-@itemx -mno-pltseq
@opindex mpltseq
@opindex mno-pltseq
+@item -mpltseq
+@itemx -mno-pltseq
Implement (do not implement) -fno-plt and long calls using an inline
PLT call sequence that supports lazy linking and long calls to
functions in dlopen'd shared libraries. Inline PLT calls are only
and @option{-mbss-plt} 32-bit PowerPC relocatable objects may not be
linked together.
-@item -mtls-markers
-@itemx -mno-tls-markers
@opindex mtls-markers
@opindex mno-tls-markers
+@item -mtls-markers
+@itemx -mno-tls-markers
Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
specifying the function argument. The relocation allows the linker to
reliably associate function call with argument setup instructions for
TLS optimization, which in turn allows GCC to better schedule the
sequence.
+@opindex mrecip
@item -mrecip
@itemx -mno-recip
-@opindex mrecip
This option enables use of the reciprocal estimate and
reciprocal square root estimate instructions with additional
Newton-Raphson steps to increase precision instead of doing a divide or
ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
roots.
-@item -mrecip=@var{opt}
@opindex mrecip=opt
+@item -mrecip=@var{opt}
This option controls which reciprocal estimate instructions
may be used. @var{opt} is a comma-separated list of options, which may
be preceded by a @code{!} to invert the option:
@code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
which handle the double-precision reciprocal square root calculations.
+@opindex mrecip-precision
@item -mrecip-precision
@itemx -mno-recip-precision
-@opindex mrecip-precision
Assume (do not assume) that the reciprocal estimate instructions
provide higher-precision estimates than is mandated by the PowerPC
ABI. Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
default on low-precision machines, since they do not provide an
estimate that converges after three steps.
-@item -mveclibabi=@var{type}
@opindex mveclibabi
+@item -mveclibabi=@var{type}
Specifies the ABI type to use for vectorizing intrinsics using an
external library. The only type supported at present is @samp{mass},
which specifies to use IBM's Mathematical Acceleration Subsystem
@option{-funsafe-math-optimizations} must also be enabled. The MASS
libraries must be specified at link time.
+@opindex mfriz
@item -mfriz
@itemx -mno-friz
-@opindex mfriz
Generate (do not generate) the @code{friz} instruction when the
@option{-funsafe-math-optimizations} option is used to optimize
rounding of floating-point values to 64-bit integer and back to floating
point. The @code{friz} instruction does not return the same value if
the floating-point number is too large to fit in an integer.
+@opindex mpointers-to-nested-functions
@item -mpointers-to-nested-functions
@itemx -mno-pointers-to-nested-functions
-@opindex mpointers-to-nested-functions
Generate (do not generate) code to load up the static chain register
(@code{r11}) when calling through a pointer on AIX and 64-bit Linux
systems where a function pointer points to a 3-word descriptor giving
to functions compiled in other languages that use the static chain if
you use @option{-mno-pointers-to-nested-functions}.
+@opindex msave-toc-indirect
@item -msave-toc-indirect
@itemx -mno-save-toc-indirect
-@opindex msave-toc-indirect
Generate (do not generate) code to save the TOC value in the reserved
stack location in the function prologue if the function calls through
a pointer on AIX and 64-bit Linux systems. If the TOC value is not
saved in the prologue, it is saved just before the call through the
pointer. The @option{-mno-save-toc-indirect} option is the default.
+@opindex mcompat-align-parm
@item -mcompat-align-parm
@itemx -mno-compat-align-parm
-@opindex mcompat-align-parm
Generate (do not generate) code to pass structure parameters with a
maximum alignment of 64 bits, for compatibility with older versions
of GCC.
The @option{-mno-compat-align-parm} option is the default.
-@item -mstack-protector-guard=@var{guard}
-@itemx -mstack-protector-guard-reg=@var{reg}
-@itemx -mstack-protector-guard-offset=@var{offset}
-@itemx -mstack-protector-guard-symbol=@var{symbol}
@opindex mstack-protector-guard
@opindex mstack-protector-guard-reg
@opindex mstack-protector-guard-offset
@opindex mstack-protector-guard-symbol
+@item -mstack-protector-guard=@var{guard}
+@itemx -mstack-protector-guard-reg=@var{reg}
+@itemx -mstack-protector-guard-offset=@var{offset}
+@itemx -mstack-protector-guard-symbol=@var{symbol}
Generate stack protection code using canary at @var{guard}. Supported
locations are @samp{global} for global canary or @samp{tls} for per-thread
canary in the TLS block (the default with GNU libc version 2.4 or later).
relevant ABI. @option{-mstack-protector-guard-symbol=@var{symbol}} overrides
the offset with a symbol reference to a canary in the TLS block.
-@item -mpcrel
-@itemx -mno-pcrel
@opindex mpcrel
@opindex mno-pcrel
+@item -mpcrel
+@itemx -mno-pcrel
Generate (do not generate) pc-relative addressing. The @option{-mpcrel}
option requires that the medium code model (@option{-mcmodel=medium})
and prefixed addressing (@option{-mprefixed}) options are enabled.
-@item -mprefixed
-@itemx -mno-prefixed
@opindex mprefixed
@opindex mno-prefixed
+@item -mprefixed
+@itemx -mno-prefixed
Generate (do not generate) addressing modes using prefixed load and
store instructions. The @option{-mprefixed} option requires that
the option @option{-mcpu=power10} (or later) is enabled.
-@item -mmma
-@itemx -mno-mma
@opindex mmma
@opindex mno-mma
+@item -mmma
+@itemx -mno-mma
Generate (do not generate) the MMA instructions. The @option{-mma}
option requires that the option @option{-mcpu=power10} (or later)
is enabled.
-@item -mrop-protect
-@itemx -mno-rop-protect
@opindex mrop-protect
@opindex mno-rop-protect
+@item -mrop-protect
+@itemx -mno-rop-protect
Generate (do not generate) ROP protection instructions when the target
processor supports them. Currently this option disables the shrink-wrap
optimization (@option{-fshrink-wrap}).
-@item -mprivileged
-@itemx -mno-privileged
@opindex mprivileged
@opindex mno-privileged
+@item -mprivileged
+@itemx -mno-privileged
Generate (do not generate) code that will run in privileged state.
-@item -mblock-ops-unaligned-vsx
-@itemx -mno-block-ops-unaligned-vsx
@opindex block-ops-unaligned-vsx
@opindex no-block-ops-unaligned-vsx
+@item -mblock-ops-unaligned-vsx
+@itemx -mno-block-ops-unaligned-vsx
Generate (do not generate) unaligned vsx loads and stores for
inline expansion of @code{memcpy} and @code{memmove}.
These command-line options are defined for RX targets:
@table @gcctabopt
-@item -m64bit-doubles
-@itemx -m32bit-doubles
@opindex m64bit-doubles
@opindex m32bit-doubles
+@item -m64bit-doubles
+@itemx -m32bit-doubles
Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
or 32 bits (@option{-m32bit-doubles}) in size. The default is
@option{-m32bit-doubles}. @emph{Note} RX floating-point hardware only
works on 32-bit values, which is why the default is
@option{-m32bit-doubles}.
-@item -fpu
-@itemx -nofpu
@opindex fpu
@opindex nofpu
+@item -fpu
+@itemx -nofpu
Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
floating-point hardware. The default is enabled for the RX600
series and disabled for the RX200 series.
@option{-funsafe-math-optimizations} is also enabled automatically.
This is because the RX FPU instructions are themselves unsafe.
-@item -mcpu=@var{name}
@opindex mcpu
+@item -mcpu=@var{name}
Selects the type of RX CPU to be targeted. Currently three types are
supported, the generic @samp{RX600} and @samp{RX200} series hardware and
the specific @samp{RX610} CPU. The default is @samp{RX600}.
and so @option{-nofpu} is enabled by default when this type is
selected.
-@item -mbig-endian-data
-@itemx -mlittle-endian-data
@opindex mbig-endian-data
@opindex mlittle-endian-data
+@item -mbig-endian-data
+@itemx -mlittle-endian-data
Store data (but not code) in the big-endian format. The default is
@option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
format.
-@item -msmall-data-limit=@var{N}
@opindex msmall-data-limit
+@item -msmall-data-limit=@var{N}
Specifies the maximum size in bytes of global and static variables
which can be placed into the small data area. Using the small data
area can lead to smaller and faster code, but the size of area is
description of the @option{-mpid} option for a description of how the
actual register to hold the small data area pointer is chosen.
-@item -msim
-@itemx -mno-sim
@opindex msim
@opindex mno-sim
+@item -msim
+@itemx -mno-sim
Use the simulator runtime. The default is to use the libgloss
board-specific runtime.
-@item -mas100-syntax
-@itemx -mno-as100-syntax
@opindex mas100-syntax
@opindex mno-as100-syntax
+@item -mas100-syntax
+@itemx -mno-as100-syntax
When generating assembler output use a syntax that is compatible with
Renesas's AS100 assembler. This syntax can also be handled by the GAS
assembler, but it has some restrictions so it is not generated by default.
-@item -mmax-constant-size=@var{N}
@opindex mmax-constant-size
+@item -mmax-constant-size=@var{N}
Specifies the maximum size, in bytes, of a constant that can be used as
an operand in a RX instruction. Although the RX instruction set does
allow constants of up to 4 bytes in length to be used in instructions,
The value @var{N} can be between 0 and 4. A value of 0 (the default)
or 4 means that constants of any size are allowed.
-@item -mrelax
@opindex mrelax
+@item -mrelax
Enable linker relaxation. Linker relaxation is a process whereby the
linker attempts to reduce the size of a program by finding shorter
versions of various instructions. Disabled by default.
-@item -mint-register=@var{N}
@opindex mint-register
+@item -mint-register=@var{N}
Specify the number of registers to reserve for fast interrupt handler
functions. The value @var{N} can be between 0 and 4. A value of 1
means that register @code{r13} is reserved for the exclusive use
@code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
A value of 0, the default, does not reserve any registers.
-@item -msave-acc-in-interrupts
@opindex msave-acc-in-interrupts
+@item -msave-acc-in-interrupts
Specifies that interrupt handler functions should preserve the
accumulator register. This is only necessary if normal code might use
the accumulator register, for example because it performs 64-bit
multiplications. The default is to ignore the accumulator as this
makes the interrupt handlers faster.
-@item -mpid
-@itemx -mno-pid
@opindex mpid
@opindex mno-pid
+@item -mpid
+@itemx -mno-pid
Enables the generation of position independent data. When enabled any
access to constant data is done via an offset from a base address
held in a register. This allows the location of constant data to be
By default this feature is not enabled. The default can be restored
via the @option{-mno-pid} command-line option.
-@item -mno-warn-multiple-fast-interrupts
-@itemx -mwarn-multiple-fast-interrupts
@opindex mno-warn-multiple-fast-interrupts
@opindex mwarn-multiple-fast-interrupts
+@item -mno-warn-multiple-fast-interrupts
+@itemx -mwarn-multiple-fast-interrupts
Prevents GCC from issuing a warning message if it finds more than one
fast interrupt handler when it is compiling a file. The default is to
issue a warning for each extra fast interrupt handler found, as the RX
only supports one such interrupt.
-@item -mallow-string-insns
-@itemx -mno-allow-string-insns
@opindex mallow-string-insns
@opindex mno-allow-string-insns
+@item -mallow-string-insns
+@itemx -mno-allow-string-insns
Enables or disables the use of the string manipulation instructions
@code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
@code{SWHILE} and also the @code{RMPA} instruction. These
symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
symbol @code{__RX_DISALLOW_STRING_INSNS__}.
-@item -mjsr
-@itemx -mno-jsr
@opindex mjsr
@opindex mno-jsr
+@item -mjsr
+@itemx -mno-jsr
Use only (or not only) @code{JSR} instructions to access functions.
This option can be used when code size exceeds the range of @code{BSR}
instructions. Note that @option{-mno-jsr} does not mean to not use
These are the @samp{-m} options defined for the S/390 and zSeries architecture.
@table @gcctabopt
-@item -mhard-float
-@itemx -msoft-float
@opindex mhard-float
@opindex msoft-float
+@item -mhard-float
+@itemx -msoft-float
Use (do not use) the hardware floating-point instructions and registers
for floating-point operations. When @option{-msoft-float} is specified,
functions in @file{libgcc.a} are used to perform floating-point
operations. When @option{-mhard-float} is specified, the compiler
generates IEEE floating-point instructions. This is the default.
-@item -mhard-dfp
-@itemx -mno-hard-dfp
@opindex mhard-dfp
@opindex mno-hard-dfp
+@item -mhard-dfp
+@itemx -mno-hard-dfp
Use (do not use) the hardware decimal-floating-point instructions for
decimal-floating-point operations. When @option{-mno-hard-dfp} is
specified, functions in @file{libgcc.a} are used to perform
specified, the compiler generates decimal-floating-point hardware
instructions. This is the default for @option{-march=z9-ec} or higher.
-@item -mlong-double-64
-@itemx -mlong-double-128
@opindex mlong-double-64
@opindex mlong-double-128
+@item -mlong-double-64
+@itemx -mlong-double-128
These switches control the size of @code{long double} type. A size
of 64 bits makes the @code{long double} type equivalent to the @code{double}
type. This is the default.
-@item -mbackchain
-@itemx -mno-backchain
@opindex mbackchain
@opindex mno-backchain
+@item -mbackchain
+@itemx -mno-backchain
Store (do not store) the address of the caller's frame as backchain pointer
into the callee's stack frame.
A backchain may be needed to allow debugging using tools that do not understand
The default is to not maintain the backchain.
-@item -mpacked-stack
-@itemx -mno-packed-stack
@opindex mpacked-stack
@opindex mno-packed-stack
+@item -mpacked-stack
+@itemx -mno-packed-stack
Use (do not use) the packed stack layout. When @option{-mno-packed-stack} is
specified, the compiler uses the all fields of the 96/160 byte register save
area only for their default purpose; unused fields still take up stack space.
The default is to not use the packed stack layout.
-@item -msmall-exec
-@itemx -mno-small-exec
@opindex msmall-exec
@opindex mno-small-exec
+@item -msmall-exec
+@itemx -mno-small-exec
Generate (or do not generate) code using the @code{bras} instruction
to do subroutine calls.
This only works reliably if the total executable size does not
exceed 64k. The default is to use the @code{basr} instruction instead,
which does not have this limitation.
-@item -m64
-@itemx -m31
@opindex m64
@opindex m31
+@item -m64
+@itemx -m31
When @option{-m31} is specified, generate code compliant to the
GNU/Linux for S/390 ABI@. When @option{-m64} is specified, generate
code compliant to the GNU/Linux for zSeries ABI@. This allows GCC in
targets, the default is @option{-m31}, while the @samp{s390x}
targets default to @option{-m64}.
-@item -mzarch
-@itemx -mesa
@opindex mzarch
@opindex mesa
+@item -mzarch
+@itemx -mesa
When @option{-mzarch} is specified, generate code using the
instructions available on z/Architecture.
When @option{-mesa} is specified, generate code using the
the default is @option{-mesa}. When generating code compliant
to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
-@item -mhtm
-@itemx -mno-htm
@opindex mhtm
@opindex mno-htm
+@item -mhtm
+@itemx -mno-htm
The @option{-mhtm} option enables a set of builtins making use of
instructions available with the transactional execution facility
introduced with the IBM zEnterprise EC12 machine generation
@ref{S/390 System z Built-in Functions}.
@option{-mhtm} is enabled by default when using @option{-march=zEC12}.
-@item -mvx
-@itemx -mno-vx
@opindex mvx
@opindex mno-vx
+@item -mvx
+@itemx -mno-vx
When @option{-mvx} is specified, generate code using the instructions
available with the vector extension facility introduced with the IBM
z13 machine generation.
command will be added to mark the resulting binary with the ABI used.
@option{-mvx} is enabled by default when using @option{-march=z13}.
-@item -mzvector
-@itemx -mno-zvector
@opindex mzvector
@opindex mno-zvector
+@item -mzvector
+@itemx -mno-zvector
The @option{-mzvector} option enables vector language extensions and
builtins using instructions available with the vector extension
facility introduced with the IBM z13 machine generation.
builtins the header file @file{vecintrin.h} needs to be included.
@option{-mzvector} is disabled by default.
-@item -mmvcle
-@itemx -mno-mvcle
@opindex mmvcle
@opindex mno-mvcle
+@item -mmvcle
+@itemx -mno-mvcle
Generate (or do not generate) code using the @code{mvcle} instruction
to perform block moves. When @option{-mno-mvcle} is specified,
use a @code{mvc} loop instead. This is the default unless optimizing for
size.
-@item -mdebug
-@itemx -mno-debug
@opindex mdebug
@opindex mno-debug
+@item -mdebug
+@itemx -mno-debug
Print (or do not print) additional debug information when compiling.
The default is to not print debug information.
-@item -march=@var{cpu-type}
@opindex march
+@item -march=@var{cpu-type}
Generate code that runs on @var{cpu-type}, which is the name of a
system representing a certain processor type. Possible values for
@var{cpu-type} are @samp{z900}/@samp{arch5}, @samp{z990}/@samp{arch6},
@option{-march=native} has no effect if GCC does not recognize the
processor.
-@item -mtune=@var{cpu-type}
@opindex mtune
+@item -mtune=@var{cpu-type}
Tune to @var{cpu-type} everything applicable about the generated code,
except for the ABI and the set of available instructions.
The list of @var{cpu-type} values is the same as for @option{-march}.
The default is the value used for @option{-march}.
-@item -mtpf-trace
-@itemx -mno-tpf-trace
@opindex mtpf-trace
@opindex mno-tpf-trace
+@item -mtpf-trace
+@itemx -mno-tpf-trace
Generate code that adds (does not add) in TPF OS specific branches to trace
routines in the operating system. This option is off by default, even
when compiling for the TPF OS@.
-@item -mtpf-trace-skip
-@itemx -mno-tpf-trace-skip
@opindex mtpf-trace-skip
@opindex mno-tpf-trace-skip
+@item -mtpf-trace-skip
+@itemx -mno-tpf-trace-skip
Generate code that changes (does not change) the default branch
targets enabled by @option{-mtpf-trace} to point to specialized trace
routines providing the ability of selectively skipping function trace
entries for the TPF OS. This option is off by default, even when
compiling for the TPF OS and specifying @option{-mtpf-trace}.
-@item -mfused-madd
-@itemx -mno-fused-madd
@opindex mfused-madd
@opindex mno-fused-madd
+@item -mfused-madd
+@itemx -mno-fused-madd
Generate code that uses (does not use) the floating-point multiply and
accumulate instructions. These instructions are generated by default if
hardware floating point is used.
-@item -mwarn-framesize=@var{framesize}
@opindex mwarn-framesize
+@item -mwarn-framesize=@var{framesize}
Emit a warning if the current function exceeds the given frame size. Because
this is a compile-time check it doesn't need to be a real problem when the program
runs. It is intended to identify functions that most probably cause
a stack overflow. It is useful to be used in an environment with limited stack
size e.g.@: the linux kernel.
-@item -mwarn-dynamicstack
@opindex mwarn-dynamicstack
+@item -mwarn-dynamicstack
Emit a warning if the function calls @code{alloca} or uses dynamically-sized
arrays. This is generally a bad idea with a limited stack size.
-@item -mstack-guard=@var{stack-guard}
-@itemx -mstack-size=@var{stack-size}
@opindex mstack-guard
@opindex mstack-size
+@item -mstack-guard=@var{stack-guard}
+@itemx -mstack-size=@var{stack-size}
If these options are provided the S/390 back end emits additional instructions in
the function prologue that trigger a trap if the stack size is @var{stack-guard}
bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
at an address aligned to the value given by @var{stack-size}.
The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
-@item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
@opindex mhotpatch
+@item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
If the hotpatch option is enabled, a ``hot-patching'' function
prologue is generated for all functions in the compilation unit.
The funtion label is prepended with the given number of two-byte
These @samp{-m} options are defined for the SH implementations:
@table @gcctabopt
-@item -m1
@opindex m1
+@item -m1
Generate code for the SH1.
-@item -m2
@opindex m2
+@item -m2
Generate code for the SH2.
@item -m2e
Generate code for the SH2e.
-@item -m2a-nofpu
@opindex m2a-nofpu
+@item -m2a-nofpu
Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
that the floating-point unit is not used.
-@item -m2a-single-only
@opindex m2a-single-only
+@item -m2a-single-only
Generate code for the SH2a-FPU, in such a way that no double-precision
floating-point operations are used.
-@item -m2a-single
@opindex m2a-single
+@item -m2a-single
Generate code for the SH2a-FPU assuming the floating-point unit is in
single-precision mode by default.
-@item -m2a
@opindex m2a
+@item -m2a
Generate code for the SH2a-FPU assuming the floating-point unit is in
double-precision mode by default.
-@item -m3
@opindex m3
+@item -m3
Generate code for the SH3.
-@item -m3e
@opindex m3e
+@item -m3e
Generate code for the SH3e.
-@item -m4-nofpu
@opindex m4-nofpu
+@item -m4-nofpu
Generate code for the SH4 without a floating-point unit.
-@item -m4-single-only
@opindex m4-single-only
+@item -m4-single-only
Generate code for the SH4 with a floating-point unit that only
supports single-precision arithmetic.
-@item -m4-single
@opindex m4-single
+@item -m4-single
Generate code for the SH4 assuming the floating-point unit is in
single-precision mode by default.
-@item -m4
@opindex m4
+@item -m4
Generate code for the SH4.
-@item -m4-100
@opindex m4-100
+@item -m4-100
Generate code for SH4-100.
-@item -m4-100-nofpu
@opindex m4-100-nofpu
+@item -m4-100-nofpu
Generate code for SH4-100 in such a way that the
floating-point unit is not used.
-@item -m4-100-single
@opindex m4-100-single
+@item -m4-100-single
Generate code for SH4-100 assuming the floating-point unit is in
single-precision mode by default.
-@item -m4-100-single-only
@opindex m4-100-single-only
+@item -m4-100-single-only
Generate code for SH4-100 in such a way that no double-precision
floating-point operations are used.
-@item -m4-200
@opindex m4-200
+@item -m4-200
Generate code for SH4-200.
-@item -m4-200-nofpu
@opindex m4-200-nofpu
+@item -m4-200-nofpu
Generate code for SH4-200 without in such a way that the
floating-point unit is not used.
-@item -m4-200-single
@opindex m4-200-single
+@item -m4-200-single
Generate code for SH4-200 assuming the floating-point unit is in
single-precision mode by default.
-@item -m4-200-single-only
@opindex m4-200-single-only
+@item -m4-200-single-only
Generate code for SH4-200 in such a way that no double-precision
floating-point operations are used.
-@item -m4-300
@opindex m4-300
+@item -m4-300
Generate code for SH4-300.
-@item -m4-300-nofpu
@opindex m4-300-nofpu
+@item -m4-300-nofpu
Generate code for SH4-300 without in such a way that the
floating-point unit is not used.
-@item -m4-300-single
@opindex m4-300-single
+@item -m4-300-single
Generate code for SH4-300 in such a way that no double-precision
floating-point operations are used.
-@item -m4-300-single-only
@opindex m4-300-single-only
+@item -m4-300-single-only
Generate code for SH4-300 in such a way that no double-precision
floating-point operations are used.
-@item -m4-340
@opindex m4-340
+@item -m4-340
Generate code for SH4-340 (no MMU, no FPU).
-@item -m4-500
@opindex m4-500
+@item -m4-500
Generate code for SH4-500 (no FPU). Passes @option{-isa=sh4-nofpu} to the
assembler.
-@item -m4a-nofpu
@opindex m4a-nofpu
+@item -m4a-nofpu
Generate code for the SH4al-dsp, or for a SH4a in such a way that the
floating-point unit is not used.
-@item -m4a-single-only
@opindex m4a-single-only
+@item -m4a-single-only
Generate code for the SH4a, in such a way that no double-precision
floating-point operations are used.
-@item -m4a-single
@opindex m4a-single
+@item -m4a-single
Generate code for the SH4a assuming the floating-point unit is in
single-precision mode by default.
-@item -m4a
@opindex m4a
+@item -m4a
Generate code for the SH4a.
-@item -m4al
@opindex m4al
+@item -m4al
Same as @option{-m4a-nofpu}, except that it implicitly passes
@option{-dsp} to the assembler. GCC doesn't generate any DSP
instructions at the moment.
-@item -mb
@opindex mb
+@item -mb
Compile code for the processor in big-endian mode.
-@item -ml
@opindex ml
+@item -ml
Compile code for the processor in little-endian mode.
-@item -mdalign
@opindex mdalign
+@item -mdalign
Align doubles at 64-bit boundaries. Note that this changes the calling
conventions, and thus some functions from the standard C library do
not work unless you recompile it first with @option{-mdalign}.
-@item -mrelax
@opindex mrelax
+@item -mrelax
Shorten some address references at link time, when possible; uses the
linker option @option{-relax}.
-@item -mbigtable
@opindex mbigtable
+@item -mbigtable
Use 32-bit offsets in @code{switch} tables. The default is to use
16-bit offsets.
-@item -mbitops
@opindex mbitops
+@item -mbitops
Enable the use of bit manipulation instructions on SH2A.
-@item -mfmovd
@opindex mfmovd
+@item -mfmovd
Enable the use of the instruction @code{fmovd}. Check @option{-mdalign} for
alignment constraints.
-@item -mrenesas
@opindex mrenesas
+@item -mrenesas
Comply with the calling conventions defined by Renesas.
-@item -mno-renesas
@opindex mno-renesas
+@item -mno-renesas
Comply with the calling conventions defined for GCC before the Renesas
conventions were available. This option is the default for all
targets of the SH toolchain.
-@item -mnomacsave
@opindex mnomacsave
+@item -mnomacsave
Mark the @code{MAC} register as call-clobbered, even if
@option{-mrenesas} is given.
-@item -mieee
-@itemx -mno-ieee
@opindex mieee
@opindex mno-ieee
+@item -mieee
+@itemx -mno-ieee
Control the IEEE compliance of floating-point comparisons, which affects the
handling of cases where the result of a comparison is unordered. By default
@option{-mieee} is implicitly enabled. If @option{-ffinite-math-only} is
floating-point greater-equal and less-equal comparisons. The implicit settings
can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
-@item -minline-ic_invalidate
@opindex minline-ic_invalidate
+@item -minline-ic_invalidate
Inline code to invalidate instruction cache entries after setting up
nested function trampolines.
This option has no effect if @option{-musermode} is in effect and the selected
write. This not only requires privileged mode at run time, but it also
fails if the cache line had been mapped via the TLB and has become unmapped.
-@item -misize
@opindex misize
+@item -misize
Dump instruction size and location in the assembly code.
-@item -mpadstruct
@opindex mpadstruct
+@item -mpadstruct
This option is deprecated. It pads structures to multiple of 4 bytes,
which is incompatible with the SH ABI@.
-@item -matomic-model=@var{model}
@opindex matomic-model=@var{model}
+@item -matomic-model=@var{model}
Sets the model of atomic operations and additional parameters as a comma
separated list. For details on the atomic built-in functions see
@ref{__atomic Builtins}. The following models and parameters are supported:
@end table
-@item -mtas
@opindex mtas
+@item -mtas
Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
Notice that depending on the particular hardware and software configuration
this can degrade overall performance due to the operand cache line flushes
processors the @code{tas.b} instruction must be used with caution since it
can result in data corruption for certain cache configurations.
-@item -mprefergot
@opindex mprefergot
+@item -mprefergot
When generating position-independent code, emit function calls using
the Global Offset Table instead of the Procedure Linkage Table.
-@item -musermode
-@itemx -mno-usermode
@opindex musermode
@opindex mno-usermode
+@item -musermode
+@itemx -mno-usermode
Don't allow (allow) the compiler generating privileged mode code. Specifying
@option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
inlined code would not work in user mode. @option{-musermode} is the default
when the target is @code{sh*-*-linux*}. If the target is SH1* or SH2*
@option{-musermode} has no effect, since there is no user mode.
-@item -multcost=@var{number}
@opindex multcost=@var{number}
+@item -multcost=@var{number}
Set the cost to assume for a multiply insn.
-@item -mdiv=@var{strategy}
@opindex mdiv=@var{strategy}
+@item -mdiv=@var{strategy}
Set the division strategy to be used for integer division operations.
@var{strategy} can be one of:
use the @code{divs} and @code{divu} instructions instead of library function
calls.
-@item -maccumulate-outgoing-args
@opindex maccumulate-outgoing-args
+@item -maccumulate-outgoing-args
Reserve space once for outgoing arguments in the function prologue rather
than around each call. Generally beneficial for performance and size. Also
needed for unwinding to avoid changing the stack frame around conditional code.
-@item -mdivsi3_libfunc=@var{name}
@opindex mdivsi3_libfunc=@var{name}
+@item -mdivsi3_libfunc=@var{name}
Set the name of the library function used for 32-bit signed division to
@var{name}.
This only affects the name used in the @samp{call} division strategies, and
the compiler still expects the same sets of input/output/clobbered registers as
if this option were not present.
-@item -mfixed-range=@var{register-range}
@opindex mfixed-range
+@item -mfixed-range=@var{register-range}
Generate code treating the given register range as fixed registers.
A fixed register is one that the register allocator cannot use. This is
useful when compiling kernel code. A register range is specified as
two registers separated by a dash. Multiple register ranges can be
specified separated by a comma.
-@item -mbranch-cost=@var{num}
@opindex mbranch-cost=@var{num}
+@item -mbranch-cost=@var{num}
Assume @var{num} to be the cost for a branch instruction. Higher numbers
make the compiler try to generate more branch-free code if possible.
If not specified the value is selected depending on the processor type that
is being compiled for.
-@item -mzdcbranch
-@itemx -mno-zdcbranch
@opindex mzdcbranch
@opindex mno-zdcbranch
+@item -mzdcbranch
+@itemx -mno-zdcbranch
Assume (do not assume) that zero displacement conditional branch instructions
@code{bt} and @code{bf} are fast. If @option{-mzdcbranch} is specified, the
compiler prefers zero displacement branch code sequences. This is
enabled by default when generating code for SH4 and SH4A. It can be explicitly
disabled by specifying @option{-mno-zdcbranch}.
-@item -mcbranch-force-delay-slot
@opindex mcbranch-force-delay-slot
+@item -mcbranch-force-delay-slot
Force the usage of delay slots for conditional branches, which stuffs the delay
slot with a @code{nop} if a suitable instruction cannot be found. By default
this option is disabled. It can be enabled to work around hardware bugs as
found in the original SH7055.
-@item -mfused-madd
-@itemx -mno-fused-madd
@opindex mfused-madd
@opindex mno-fused-madd
+@item -mfused-madd
+@itemx -mno-fused-madd
Generate code that uses (does not use) the floating-point multiply and
accumulate instructions. These instructions are generated by default
if hardware floating point is used. The machine-dependent
@option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
mapped to @option{-ffp-contract=off}.
-@item -mfsca
-@itemx -mno-fsca
@opindex mfsca
@opindex mno-fsca
+@item -mfsca
+@itemx -mno-fsca
Allow or disallow the compiler to emit the @code{fsca} instruction for sine
and cosine approximations. The option @option{-mfsca} must be used in
combination with @option{-funsafe-math-optimizations}. It is enabled by default
when generating code for SH4A. Using @option{-mno-fsca} disables sine and cosine
approximations even if @option{-funsafe-math-optimizations} is in effect.
-@item -mfsrra
-@itemx -mno-fsrra
@opindex mfsrra
@opindex mno-fsrra
+@item -mfsrra
+@itemx -mno-fsrra
Allow or disallow the compiler to emit the @code{fsrra} instruction for
reciprocal square root approximations. The option @option{-mfsrra} must be used
in combination with @option{-funsafe-math-optimizations} and
even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
in effect.
-@item -mpretend-cmove
@opindex mpretend-cmove
+@item -mpretend-cmove
Prefer zero-displacement conditional branches for conditional move instruction
patterns. This can result in faster code on the SH4 processor.
-@item -mfdpic
@opindex fdpic
+@item -mfdpic
Generate code using the FDPIC ABI.
@end table
These @samp{-m} options are supported on Solaris 2:
@table @gcctabopt
-@item -mclear-hwcap
@opindex mclear-hwcap
+@item -mclear-hwcap
@option{-mclear-hwcap} tells the compiler to remove the hardware
capabilities generated by the Solaris assembler. This is only necessary
when object files use ISA extensions not supported by the current
machine, but check at runtime whether or not to use them.
-@item -mimpure-text
@opindex mimpure-text
+@item -mimpure-text
@option{-mimpure-text}, used in addition to @option{-shared}, tells
the compiler to not pass @option{-z text} to the linker when linking a
shared object. Using this option, you can link position-dependent
These switches are supported in addition to the above on Solaris 2:
@table @gcctabopt
-@item -pthreads
@opindex pthreads
+@item -pthreads
This is a synonym for @option{-pthread}.
@end table
These @samp{-m} options are supported on the SPARC:
@table @gcctabopt
-@item -mno-app-regs
-@itemx -mapp-regs
@opindex mno-app-regs
@opindex mapp-regs
+@item -mno-app-regs
+@itemx -mapp-regs
Specify @option{-mapp-regs} to generate output using the global registers
2 through 4, which the SPARC SVR4 ABI reserves for applications. Like the
global register 1, each global register 2 through 4 is then treated as an
specify @option{-mno-app-regs}. You should compile libraries and system
software with this option.
-@item -mflat
-@itemx -mno-flat
@opindex mflat
@opindex mno-flat
+@item -mflat
+@itemx -mno-flat
With @option{-mflat}, the compiler does not generate save/restore instructions
and uses a ``flat'' or single register window model. This model is compatible
with the regular register window model. The local registers and the input
With @option{-mno-flat} (the default), the compiler generates save/restore
instructions (except for leaf functions). This is the normal operating mode.
-@item -mfpu
-@itemx -mhard-float
@opindex mfpu
@opindex mhard-float
+@item -mfpu
+@itemx -mhard-float
Generate output containing floating-point instructions. This is the
default.
-@item -mno-fpu
-@itemx -msoft-float
@opindex mno-fpu
@opindex msoft-float
+@item -mno-fpu
+@itemx -msoft-float
Generate output containing library calls for floating point.
@strong{Warning:} the requisite libraries are not available for all SPARC
targets. Normally the facilities of the machine's usual C compiler are
library that comes with GCC, with @option{-msoft-float} in order for
this to work.
-@item -mhard-quad-float
@opindex mhard-quad-float
+@item -mhard-quad-float
Generate output containing quad-word (long double) floating-point
instructions.
-@item -msoft-quad-float
@opindex msoft-quad-float
+@item -msoft-quad-float
Generate output containing library calls for quad-word (long double)
floating-point instructions. The functions called are those specified
in the SPARC ABI@. This is the default.
this is much slower than calling the ABI library routines. Thus the
@option{-msoft-quad-float} option is the default.
-@item -mno-unaligned-doubles
-@itemx -munaligned-doubles
@opindex mno-unaligned-doubles
@opindex munaligned-doubles
+@item -mno-unaligned-doubles
+@itemx -munaligned-doubles
Assume that doubles have 8-byte alignment. This is the default.
With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
generated by other compilers. It is not the default because it results
in a performance loss, especially for floating-point code.
-@item -muser-mode
-@itemx -mno-user-mode
@opindex muser-mode
@opindex mno-user-mode
+@item -muser-mode
+@itemx -mno-user-mode
Do not generate code that can only run in supervisor mode. This is relevant
only for the @code{casa} instruction emitted for the LEON3 processor. This
is the default.
-@item -mfaster-structs
-@itemx -mno-faster-structs
@opindex mfaster-structs
@opindex mno-faster-structs
+@item -mfaster-structs
+@itemx -mno-faster-structs
With @option{-mfaster-structs}, the compiler assumes that structures
should have 8-byte alignment. This enables the use of pairs of
@code{ldd} and @code{std} instructions for copies in structure
acknowledges that their resulting code is not directly in line with
the rules of the ABI@.
-@item -mstd-struct-return
-@itemx -mno-std-struct-return
@opindex mstd-struct-return
@opindex mno-std-struct-return
+@item -mstd-struct-return
+@itemx -mno-std-struct-return
With @option{-mstd-struct-return}, the compiler generates checking code
in functions returning structures or unions to detect size mismatches
between the two sides of function calls, as per the 32-bit ABI@.
The default is @option{-mno-std-struct-return}. This option has no effect
in 64-bit mode.
-@item -mlra
-@itemx -mno-lra
@opindex mlra
@opindex mno-lra
+@item -mlra
+@itemx -mno-lra
Enable Local Register Allocation. This is the default for SPARC since GCC 7
so @option{-mno-lra} needs to be passed to get old Reload.
-@item -mcpu=@var{cpu_type}
@opindex mcpu
+@item -mcpu=@var{cpu_type}
Set the instruction set, register set, and instruction scheduling parameters
for machine type @var{cpu_type}. Supported values for @var{cpu_type} are
@samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
Oracle SPARC M7 chips. With @option{-mcpu=m8}, the compiler
additionally optimizes it for Oracle M8 chips.
-@item -mtune=@var{cpu_type}
@opindex mtune
+@item -mtune=@var{cpu_type}
Set the instruction scheduling parameters for machine type
@var{cpu_type}, but do not set the instruction set or register set that the
option @option{-mcpu=@var{cpu_type}} does.
@samp{niagara4}, @samp{niagara7} and @samp{m8}. With native Solaris
and GNU/Linux toolchains, @samp{native} can also be used.
-@item -mv8plus
-@itemx -mno-v8plus
@opindex mv8plus
@opindex mno-v8plus
+@item -mv8plus
+@itemx -mno-v8plus
With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@. The
difference from the V8 ABI is that the global and out registers are
considered 64 bits wide. This is enabled by default on Solaris in 32-bit
mode for all SPARC-V9 processors.
-@item -mvis
-@itemx -mno-vis
@opindex mvis
@opindex mno-vis
+@item -mvis
+@itemx -mno-vis
With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
Visual Instruction Set extensions. The default is @option{-mno-vis}.
-@item -mvis2
-@itemx -mno-vis2
@opindex mvis2
@opindex mno-vis2
+@item -mvis2
+@itemx -mno-vis2
With @option{-mvis2}, GCC generates code that takes advantage of
version 2.0 of the UltraSPARC Visual Instruction Set extensions. The
default is @option{-mvis2} when targeting a cpu that supports such
instructions, such as UltraSPARC-III and later. Setting @option{-mvis2}
also sets @option{-mvis}.
-@item -mvis3
-@itemx -mno-vis3
@opindex mvis3
@opindex mno-vis3
+@item -mvis3
+@itemx -mno-vis3
With @option{-mvis3}, GCC generates code that takes advantage of
version 3.0 of the UltraSPARC Visual Instruction Set extensions. The
default is @option{-mvis3} when targeting a cpu that supports such
instructions, such as niagara-3 and later. Setting @option{-mvis3}
also sets @option{-mvis2} and @option{-mvis}.
-@item -mvis4
-@itemx -mno-vis4
@opindex mvis4
@opindex mno-vis4
+@item -mvis4
+@itemx -mno-vis4
With @option{-mvis4}, GCC generates code that takes advantage of
version 4.0 of the UltraSPARC Visual Instruction Set extensions. The
default is @option{-mvis4} when targeting a cpu that supports such
instructions, such as niagara-7 and later. Setting @option{-mvis4}
also sets @option{-mvis3}, @option{-mvis2} and @option{-mvis}.
-@item -mvis4b
-@itemx -mno-vis4b
@opindex mvis4b
@opindex mno-vis4b
+@item -mvis4b
+@itemx -mno-vis4b
With @option{-mvis4b}, GCC generates code that takes advantage of
version 4.0 of the UltraSPARC Visual Instruction Set extensions, plus
the additional VIS instructions introduced in the Oracle SPARC
@option{-mvis4b} also sets @option{-mvis4}, @option{-mvis3},
@option{-mvis2} and @option{-mvis}.
-@item -mcbcond
-@itemx -mno-cbcond
@opindex mcbcond
@opindex mno-cbcond
+@item -mcbcond
+@itemx -mno-cbcond
With @option{-mcbcond}, GCC generates code that takes advantage of the UltraSPARC
Compare-and-Branch-on-Condition instructions. The default is @option{-mcbcond}
when targeting a CPU that supports such instructions, such as Niagara-4 and
later.
-@item -mfmaf
-@itemx -mno-fmaf
@opindex mfmaf
@opindex mno-fmaf
+@item -mfmaf
+@itemx -mno-fmaf
With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
Fused Multiply-Add Floating-point instructions. The default is @option{-mfmaf}
when targeting a CPU that supports such instructions, such as Niagara-3 and
later.
-@item -mfsmuld
-@itemx -mno-fsmuld
@opindex mfsmuld
@opindex mno-fsmuld
+@item -mfsmuld
+@itemx -mno-fsmuld
With @option{-mfsmuld}, GCC generates code that takes advantage of the
Floating-point Multiply Single to Double (FsMULd) instruction. The default is
@option{-mfsmuld} when targeting a CPU supporting the architecture versions V8
or V9 with FPU except @option{-mcpu=leon}.
-@item -mpopc
-@itemx -mno-popc
@opindex mpopc
@opindex mno-popc
+@item -mpopc
+@itemx -mno-popc
With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
Population Count instruction. The default is @option{-mpopc}
when targeting a CPU that supports such an instruction, such as Niagara-2 and
later.
-@item -msubxc
-@itemx -mno-subxc
@opindex msubxc
@opindex mno-subxc
+@item -msubxc
+@itemx -mno-subxc
With @option{-msubxc}, GCC generates code that takes advantage of the UltraSPARC
Subtract-Extended-with-Carry instruction. The default is @option{-msubxc}
when targeting a CPU that supports such an instruction, such as Niagara-7 and
later.
-@item -mfix-at697f
@opindex mfix-at697f
+@item -mfix-at697f
Enable the documented workaround for the single erratum of the Atmel AT697F
processor (which corresponds to erratum #13 of the AT697E processor).
-@item -mfix-ut699
@opindex mfix-ut699
+@item -mfix-ut699
Enable the documented workarounds for the floating-point errata and the data
cache nullify errata of the UT699 processor.
-@item -mfix-ut700
@opindex mfix-ut700
+@item -mfix-ut700
Enable the documented workaround for the back-to-back store errata of
the UT699E/UT700 processor.
-@item -mfix-gr712rc
@opindex mfix-gr712rc
+@item -mfix-gr712rc
Enable the documented workaround for the back-to-back store errata of
the GR712RC processor.
@end table
on SPARC-V9 processors in 64-bit environments:
@table @gcctabopt
-@item -m32
-@itemx -m64
@opindex m32
@opindex m64
+@item -m32
+@itemx -m64
Generate code for a 32-bit or 64-bit environment.
The 32-bit environment sets int, long and pointer to 32 bits.
The 64-bit environment sets int to 32 bits and long and pointer
to 64 bits.
-@item -mcmodel=@var{which}
@opindex mcmodel
+@item -mcmodel=@var{which}
Set the code model to one of
@table @samp
are statically linked and PIC is not supported.
@end table
-@item -mmemory-model=@var{mem-model}
@opindex mmemory-model
+@item -mmemory-model=@var{mem-model}
Set the memory model in force on the processor to one of
@table @samp
These memory models are formally defined in Appendix D of the SPARC-V9
architecture manual, as set in the processor's @code{PSTATE.MM} field.
-@item -mstack-bias
-@itemx -mno-stack-bias
@opindex mstack-bias
@opindex mno-stack-bias
+@item -mstack-bias
+@itemx -mno-stack-bias
With @option{-mstack-bias}, GCC assumes that the stack pointer, and
frame pointer if present, are offset by @minus{}2047 which must be added back
when making stack frame references. This is the default in 64-bit mode.
compatibility with other compilers on those systems:
@table @gcctabopt
-@item -G
@opindex G
+@item -G
Create a shared object.
It is recommended that @option{-symbolic} or @option{-shared} be used instead.
-@item -Qy
@opindex Qy
+@item -Qy
Identify the versions of each tool used by the compiler, in a
@code{.ident} assembler directive in the output.
-@item -Qn
@opindex Qn
+@item -Qn
Refrain from adding @code{.ident} directives to the output file (this is
the default).
-@item -YP,@var{dirs}
@opindex YP
+@item -YP,@var{dirs}
Search the directories @var{dirs}, and no others, for libraries
specified with @option{-l}.
-@item -Ym,@var{dir}
@opindex Ym
+@item -Ym,@var{dir}
Look in the directory @var{dir} to find the M4 preprocessor.
The assembler uses this option.
@c This is supposed to go with a -Yd for predefined M4 macro files, but
These @samp{-m} options are defined for V850 implementations:
@table @gcctabopt
-@item -mlong-calls
-@itemx -mno-long-calls
@opindex mlong-calls
@opindex mno-long-calls
+@item -mlong-calls
+@itemx -mno-long-calls
Treat all calls as being far away (near). If calls are assumed to be
far away, the compiler always loads the function's address into a
register, and calls indirect through the pointer.
-@item -mno-ep
-@itemx -mep
@opindex mno-ep
@opindex mep
+@item -mno-ep
+@itemx -mep
Do not optimize (do optimize) basic blocks that use the same index
pointer 4 or more times to copy pointer into the @code{ep} register, and
use the shorter @code{sld} and @code{sst} instructions. The @option{-mep}
option is on by default if you optimize.
-@item -mno-prolog-function
-@itemx -mprolog-function
@opindex mno-prolog-function
@opindex mprolog-function
+@item -mno-prolog-function
+@itemx -mprolog-function
Do not use (do use) external functions to save and restore registers
at the prologue and epilogue of a function. The external functions
are slower, but use less code space if more than one function saves
the same number of registers. The @option{-mprolog-function} option
is on by default if you optimize.
-@item -mspace
@opindex mspace
+@item -mspace
Try to make the code as small as possible. At present, this just turns
on the @option{-mep} and @option{-mprolog-function} options.
-@item -mtda=@var{n}
@opindex mtda
+@item -mtda=@var{n}
Put static or global variables whose size is @var{n} bytes or less into
the tiny data area that register @code{ep} points to. The tiny data
area can hold up to 256 bytes in total (128 bytes for byte references).
-@item -msda=@var{n}
@opindex msda
+@item -msda=@var{n}
Put static or global variables whose size is @var{n} bytes or less into
the small data area that register @code{gp} points to. The small data
area can hold up to 64 kilobytes.
-@item -mzda=@var{n}
@opindex mzda
+@item -mzda=@var{n}
Put static or global variables whose size is @var{n} bytes or less into
the first 32 kilobytes of memory.
-@item -mv850
@opindex mv850
+@item -mv850
Specify that the target processor is the V850.
-@item -mv850e3v5
@opindex mv850e3v5
+@item -mv850e3v5
Specify that the target processor is the V850E3V5. The preprocessor
constant @code{__v850e3v5__} is defined if this option is used.
-@item -mv850e2v4
@opindex mv850e2v4
+@item -mv850e2v4
Specify that the target processor is the V850E3V5. This is an alias for
the @option{-mv850e3v5} option.
-@item -mv850e2v3
@opindex mv850e2v3
+@item -mv850e2v3
Specify that the target processor is the V850E2V3. The preprocessor
constant @code{__v850e2v3__} is defined if this option is used.
-@item -mv850e2
@opindex mv850e2
+@item -mv850e2
Specify that the target processor is the V850E2. The preprocessor
constant @code{__v850e2__} is defined if this option is used.
-@item -mv850e1
@opindex mv850e1
+@item -mv850e1
Specify that the target processor is the V850E1. The preprocessor
constants @code{__v850e1__} and @code{__v850e__} are defined if
this option is used.
-@item -mv850es
@opindex mv850es
+@item -mv850es
Specify that the target processor is the V850ES. This is an alias for
the @option{-mv850e1} option.
-@item -mv850e
@opindex mv850e
+@item -mv850e
Specify that the target processor is the V850E@. The preprocessor
constant @code{__v850e__} is defined if this option is used.
The preprocessor constants @code{__v850} and @code{__v851__} are always
defined, regardless of which processor variant is the target.
-@item -mdisable-callt
-@itemx -mno-disable-callt
@opindex mdisable-callt
@opindex mno-disable-callt
+@item -mdisable-callt
+@itemx -mno-disable-callt
This option suppresses generation of the @code{CALLT} instruction for the
v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
architecture.
GCC ABI is in use. If @code{CALLT} instructions are being generated
then the C preprocessor symbol @code{__V850_CALLT__} is defined.
-@item -mrelax
-@itemx -mno-relax
@opindex mrelax
@opindex mno-relax
+@item -mrelax
+@itemx -mno-relax
Pass on (or do not pass on) the @option{-mrelax} command-line option
to the assembler.
-@item -mlong-jumps
-@itemx -mno-long-jumps
@opindex mlong-jumps
@opindex mno-long-jumps
+@item -mlong-jumps
+@itemx -mno-long-jumps
Disable (or re-enable) the generation of PC-relative jump instructions.
-@item -msoft-float
-@itemx -mhard-float
@opindex msoft-float
@opindex mhard-float
+@item -msoft-float
+@itemx -mhard-float
Disable (or re-enable) the generation of hardware floating point
instructions. This option is only significant when the target
architecture is @samp{V850E2V3} or higher. If hardware floating point
@code{__FPU_OK__} is defined, otherwise the symbol
@code{__NO_FPU__} is defined.
-@item -mloop
@opindex mloop
+@item -mloop
Enables the use of the e3v5 LOOP instruction. The use of this
instruction is not enabled by default when the e3v5 architecture is
selected because its use is still experimental.
-@item -mrh850-abi
-@itemx -mghs
@opindex mrh850-abi
@opindex mghs
+@item -mrh850-abi
+@itemx -mghs
Enables support for the RH850 version of the V850 ABI. This is the
default. With this version of the ABI the following rules apply:
When this version of the ABI is enabled the C preprocessor symbol
@code{__V850_RH850_ABI__} is defined.
-@item -mgcc-abi
@opindex mgcc-abi
+@item -mgcc-abi
Enables support for the old GCC version of the V850 ABI. With this
version of the ABI the following rules apply:
When this version of the ABI is enabled the C preprocessor symbol
@code{__V850_GCC_ABI__} is defined.
-@item -m8byte-align
-@itemx -mno-8byte-align
@opindex m8byte-align
@opindex mno-8byte-align
+@item -m8byte-align
+@itemx -mno-8byte-align
Enables support for @code{double} and @code{long long} types to be
aligned on 8-byte boundaries. The default is to restrict the
alignment of all objects to at most 4-bytes. When
@option{-m8byte-align} is in effect the C preprocessor symbol
@code{__V850_8BYTE_ALIGN__} is defined.
-@item -mbig-switch
@opindex mbig-switch
+@item -mbig-switch
Generate code suitable for big switch tables. Use this option only if
the assembler/linker complain about out of range branches within a switch
table.
-@item -mapp-regs
@opindex mapp-regs
+@item -mapp-regs
This option causes r2 and r5 to be used in the code generated by
the compiler. This setting is the default.
-@item -mno-app-regs
@opindex mno-app-regs
+@item -mno-app-regs
This option causes r2 and r5 to be treated as fixed registers.
@end table
These @samp{-m} options are defined for the VAX:
@table @gcctabopt
-@item -munix
@opindex munix
+@item -munix
Do not output certain jump instructions (@code{aobleq} and so on)
that the Unix assembler for the VAX cannot handle across long
ranges.
-@item -mgnu
@opindex mgnu
+@item -mgnu
Do output those jump instructions, on the assumption that the
GNU assembler is being used.
-@item -mg
@opindex mg
+@item -mg
Output code for G-format floating-point numbers instead of D-format.
-@item -mlra
-@itemx -mno-lra
@opindex mlra
@opindex mno-lra
+@item -mlra
+@itemx -mno-lra
Enable Local Register Allocation. This is still experimental for the VAX,
so by default the compiler uses standard reload.
@end table
@table @gcctabopt
-@item -mdebug
@opindex mdebug
+@item -mdebug
A program which performs file I/O and is destined to run on an MCM target
should be linked with this option. It causes the libraries libc.a and
libdebug.a to be linked. The program should be run on the target under
the control of the GDB remote debugging stub.
-@item -msim
@opindex msim
+@item -msim
A program which performs file I/O and is destined to run on the simulator
should be linked with option. This causes libraries libc.a and libsim.a to
be linked.
-@item -mfpu
-@itemx -mhard-float
@opindex mfpu
@opindex mhard-float
+@item -mfpu
+@itemx -mhard-float
Generate code containing floating-point instructions. This is the
default.
-@item -mno-fpu
-@itemx -msoft-float
@opindex mno-fpu
@opindex msoft-float
+@item -mno-fpu
+@itemx -msoft-float
Generate code containing library calls for floating-point.
@option{-msoft-float} changes the calling convention in the output file;
library that comes with GCC, with @option{-msoft-float} in order for
this to work.
-@item -mcpu=@var{cpu_type}
@opindex mcpu
+@item -mcpu=@var{cpu_type}
Set the instruction set, register set, and instruction scheduling parameters
for machine type @var{cpu_type}. Supported values for @var{cpu_type} are
@samp{mcm}, @samp{gr5} and @samp{gr6}.
architecture. The only difference from GR5 code is that the compiler will
generate block move instructions.
-@item -mtune=@var{cpu_type}
@opindex mtune
+@item -mtune=@var{cpu_type}
Set the instruction scheduling parameters for machine type @var{cpu_type},
but do not set the instruction set or register set that the option
@option{-mcpu=@var{cpu_type}} would.
-@item -msv-mode
@opindex msv-mode
+@item -msv-mode
Generate code for the supervisor mode, where there are no restrictions on
the access to general registers. This is the default.
-@item -muser-mode
@opindex muser-mode
+@item -muser-mode
Generate code for the user mode, where the access to some general registers
is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
mode; on the GR6, only registers r29 to r31 are affected.
These @samp{-m} options are defined for the VMS implementations:
@table @gcctabopt
-@item -mvms-return-codes
@opindex mvms-return-codes
+@item -mvms-return-codes
Return VMS condition codes from @code{main}. The default is to return POSIX-style
condition (e.g.@: error) codes.
-@item -mdebug-main=@var{prefix}
@opindex mdebug-main=@var{prefix}
+@item -mdebug-main=@var{prefix}
Flag the first routine whose name starts with @var{prefix} as the main
routine for the debugger.
-@item -mmalloc64
@opindex mmalloc64
+@item -mmalloc64
Default to 64-bit memory allocation routines.
-@item -mpointer-size=@var{size}
@opindex mpointer-size=@var{size}
+@item -mpointer-size=@var{size}
Set the default size of pointers. Possible options for @var{size} are
@samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
options for that target.
@table @gcctabopt
-@item -mrtp
@opindex mrtp
+@item -mrtp
GCC can generate code for both VxWorks kernels and real time processes
(RTPs). This option switches from the former to the latter. It also
defines the preprocessor macro @code{__RTP__}.
-@item -non-static
@opindex non-static
+@item -non-static
Link an RTP executable against shared libraries rather than static
libraries. The options @option{-static} and @option{-shared} can
also be used for RTPs (@pxref{Link Options}); @option{-static}
is the default.
-@item -Bstatic
-@itemx -Bdynamic
@opindex Bstatic
@opindex Bdynamic
+@item -Bstatic
+@itemx -Bdynamic
These options are passed down to the linker. They are defined for
compatibility with Diab.
-@item -Xbind-lazy
@opindex Xbind-lazy
+@item -Xbind-lazy
Enable lazy binding of function calls. This option is equivalent to
@option{-Wl,-z,now} and is defined for compatibility with Diab.
-@item -Xbind-now
@opindex Xbind-now
+@item -Xbind-now
Disable lazy binding of function calls. This option is the default and
is defined for compatibility with Diab.
@end table
@table @gcctabopt
-@item -march=@var{cpu-type}
@opindex march
+@item -march=@var{cpu-type}
Generate instructions for the machine type @var{cpu-type}. In contrast to
@option{-mtune=@var{cpu-type}}, which merely tunes the generated code
for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
@end table
-@item -mtune=@var{cpu-type}
@opindex mtune
+@item -mtune=@var{cpu-type}
Tune to @var{cpu-type} everything applicable about the generated code, except
for the ABI and the set of available instructions.
While picking a specific @var{cpu-type} schedules things appropriately
processors) for which the code is optimized.
@end table
-@item -mcpu=@var{cpu-type}
@opindex mcpu
+@item -mcpu=@var{cpu-type}
A deprecated synonym for @option{-mtune}.
-@item -mfpmath=@var{unit}
@opindex mfpmath
+@item -mfpmath=@var{unit}
Generate floating-point arithmetic for selected unit @var{unit}. The choices
for @var{unit} are:
functional units well, resulting in unstable performance.
@end table
-@item -masm=@var{dialect}
@opindex masm=@var{dialect}
+@item -masm=@var{dialect}
Output assembly instructions using selected @var{dialect}. Also affects
which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
not support @samp{intel}.
-@item -mieee-fp
-@itemx -mno-ieee-fp
@opindex mieee-fp
@opindex mno-ieee-fp
+@item -mieee-fp
+@itemx -mno-ieee-fp
Control whether or not the compiler uses IEEE floating-point
comparisons. These correctly handle the case where the result of a
comparison is unordered.
-@item -m80387
-@itemx -mhard-float
@opindex m80387
@opindex mhard-float
+@item -m80387
+@itemx -mhard-float
Generate output containing 80387 instructions for floating point.
-@item -mno-80387
-@itemx -msoft-float
@opindex no-80387
@opindex msoft-float
+@item -mno-80387
+@itemx -msoft-float
Generate output containing library calls for floating point.
@strong{Warning:} the requisite libraries are not part of GCC@.
register stack, some floating-point opcodes may be emitted even if
@option{-msoft-float} is used.
-@item -mno-fp-ret-in-387
@opindex mno-fp-ret-in-387
@opindex mfp-ret-in-387
+@item -mno-fp-ret-in-387
Do not use the FPU registers for return values of functions.
The usual calling convention has functions return values of types
The option @option{-mno-fp-ret-in-387} causes such values to be returned
in ordinary CPU registers instead.
-@item -mno-fancy-math-387
@opindex mno-fancy-math-387
@opindex mfancy-math-387
+@item -mno-fancy-math-387
Some 387 emulators do not support the @code{sin}, @code{cos} and
@code{sqrt} instructions for the 387. Specify this option to avoid
generating those instructions.
instructions are not generated unless you also use the
@option{-funsafe-math-optimizations} switch.
-@item -malign-double
-@itemx -mno-align-double
@opindex malign-double
@opindex mno-align-double
+@item -malign-double
+@itemx -mno-align-double
Control whether GCC aligns @code{double}, @code{long double}, and
@code{long long} variables on a two-word boundary or a one-word
boundary. Aligning @code{double} variables on a two-word boundary
and are not binary compatible with structures in code compiled
without that switch.
-@item -m96bit-long-double
-@itemx -m128bit-long-double
@opindex m96bit-long-double
@opindex m128bit-long-double
+@item -m96bit-long-double
+@itemx -m128bit-long-double
These switches control the size of @code{long double} type. The x86-32
application binary interface specifies the size to be 96 bits,
so @option{-m96bit-long-double} is the default in 32-bit mode.
@code{long double}. Hence they are not binary-compatible
with code compiled without that switch.
-@item -mlong-double-64
-@itemx -mlong-double-80
-@itemx -mlong-double-128
@opindex mlong-double-64
@opindex mlong-double-80
@opindex mlong-double-128
+@item -mlong-double-64
+@itemx -mlong-double-80
+@itemx -mlong-double-128
These switches control the size of @code{long double} type. A size
of 64 bits makes the @code{long double} type equivalent to the @code{double}
type. This is the default for 32-bit Bionic C library. A size
@code{long double}. Hence they are not binary-compatible
with code compiled without that switch.
-@item -malign-data=@var{type}
@opindex malign-data
+@item -malign-data=@var{type}
Control how GCC aligns variables. Supported values for @var{type} are
@samp{compat} uses increased alignment value compatible uses GCC 4.8
and earlier, @samp{abi} uses alignment value as specified by the
psABI, and @samp{cacheline} uses increased alignment value to match
the cache line size. @samp{compat} is the default.
-@item -mlarge-data-threshold=@var{threshold}
@opindex mlarge-data-threshold
+@item -mlarge-data-threshold=@var{threshold}
When @option{-mcmodel=medium} is specified, data objects larger than
@var{threshold} are placed in the large data section. This value must be the
same across all objects linked into the binary, and defaults to 65535.
-@item -mrtd
@opindex mrtd
+@item -mrtd
Use a different function-calling convention, in which functions that
take a fixed number of arguments return with the @code{ret @var{num}}
instruction, which pops their arguments while returning. This saves one
function with too many arguments. (Normally, extra arguments are
harmlessly ignored.)
-@item -mregparm=@var{num}
@opindex mregparm
+@item -mregparm=@var{num}
Control how many registers are used to pass integer arguments. By
default, no registers are used to pass arguments, and at most 3
registers can be used. You can control this behavior for a specific
value, including any libraries. This includes the system libraries and
startup modules.
-@item -msseregparm
@opindex msseregparm
+@item -msseregparm
Use SSE register passing conventions for float and double arguments
and return values. You can control this behavior for a specific
function by using the function attribute @code{sseregparm}.
modules with the same value, including any libraries. This includes
the system libraries and startup modules.
-@item -mvect8-ret-in-mem
@opindex mvect8-ret-in-mem
+@item -mvect8-ret-in-mem
Return 8-byte vectors in memory instead of MMX registers. This is the
default on VxWorks to match the ABI of the Sun Studio compilers until
version 12. @emph{Only} use this option if you need to remain
compatible with existing code produced by those previous compiler
versions or older versions of GCC@.
-@item -mpc32
-@itemx -mpc64
-@itemx -mpc80
@opindex mpc32
@opindex mpc64
@opindex mpc80
+@item -mpc32
+@itemx -mpc64
+@itemx -mpc80
Set 80387 floating-point precision to 32, 64 or 80 bits. When @option{-mpc32}
is specified, the significands of results of floating-point operations are
loss of accuracy, typically through so-called ``catastrophic cancellation'',
when this option is used to set the precision to less than extended precision.
-@item -mdaz-ftz
@opindex mdaz-ftz
+@item -mdaz-ftz
The flush-to-zero (FTZ) and denormals-are-zero (DAZ) flags in the MXCSR register
are used to control floating-point calculations.SSE and AVX instructions
when @option{-mno-daz-ftz} or @option{-shared} is specified, @option{-mdaz-ftz}
will set FTZ/DAZ flags even with @option{-shared}.
-@item -mstackrealign
@opindex mstackrealign
+@item -mstackrealign
Realign the stack at entry. On the x86, the @option{-mstackrealign}
option generates an alternate prologue and epilogue that realigns the
run-time stack if necessary. This supports mixing legacy codes that keep
SSE compatibility. See also the attribute @code{force_align_arg_pointer},
applicable to individual functions.
-@item -mpreferred-stack-boundary=@var{num}
@opindex mpreferred-stack-boundary
+@item -mpreferred-stack-boundary=@var{num}
Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
byte boundary. If @option{-mpreferred-stack-boundary} is not specified,
the default is 4 (16 bytes or 128 bits).
@option{-mpreferred-stack-boundary=3}, including any libraries. This
includes the system libraries and startup modules.
-@item -mincoming-stack-boundary=@var{num}
@opindex mincoming-stack-boundary
+@item -mincoming-stack-boundary=@var{num}
Assume the incoming stack is aligned to a 2 raised to @var{num} byte
boundary. If @option{-mincoming-stack-boundary} is not specified,
the one specified by @option{-mpreferred-stack-boundary} is used.
preferred alignment to @option{-mpreferred-stack-boundary=2}.
@need 200
-@item -mmmx
@opindex mmmx
+@item -mmmx
@need 200
-@itemx -msse
@opindex msse
+@itemx -msse
@need 200
-@itemx -msse2
@opindex msse2
+@itemx -msse2
@need 200
-@itemx -msse3
@opindex msse3
+@itemx -msse3
@need 200
-@itemx -mssse3
@opindex mssse3
+@itemx -mssse3
@need 200
-@itemx -msse4
@opindex msse4
+@itemx -msse4
@need 200
-@itemx -msse4a
@opindex msse4a
+@itemx -msse4a
@need 200
-@itemx -msse4.1
@opindex msse4.1
+@itemx -msse4.1
@need 200
-@itemx -msse4.2
@opindex msse4.2
+@itemx -msse4.2
@need 200
-@itemx -mavx
@opindex mavx
+@itemx -mavx
@need 200
-@itemx -mavx2
@opindex mavx2
+@itemx -mavx2
@need 200
-@itemx -mavx512f
@opindex mavx512f
+@itemx -mavx512f
@need 200
-@itemx -mavx512pf
@opindex mavx512pf
+@itemx -mavx512pf
@need 200
-@itemx -mavx512er
@opindex mavx512er
+@itemx -mavx512er
@need 200
-@itemx -mavx512cd
@opindex mavx512cd
+@itemx -mavx512cd
@need 200
-@itemx -mavx512vl
@opindex mavx512vl
+@itemx -mavx512vl
@need 200
-@itemx -mavx512bw
@opindex mavx512bw
+@itemx -mavx512bw
@need 200
-@itemx -mavx512dq
@opindex mavx512dq
+@itemx -mavx512dq
@need 200
-@itemx -mavx512ifma
@opindex mavx512ifma
+@itemx -mavx512ifma
@need 200
-@itemx -mavx512vbmi
@opindex mavx512vbmi
+@itemx -mavx512vbmi
@need 200
-@itemx -msha
@opindex msha
+@itemx -msha
@need 200
-@itemx -maes
@opindex maes
+@itemx -maes
@need 200
-@itemx -mpclmul
@opindex mpclmul
+@itemx -mpclmul
@need 200
-@itemx -mclflushopt
@opindex mclflushopt
+@itemx -mclflushopt
@need 200
-@itemx -mclwb
@opindex mclwb
+@itemx -mclwb
@need 200
-@itemx -mfsgsbase
@opindex mfsgsbase
+@itemx -mfsgsbase
@need 200
-@itemx -mptwrite
@opindex mptwrite
+@itemx -mptwrite
@need 200
-@itemx -mrdrnd
@opindex mrdrnd
+@itemx -mrdrnd
@need 200
-@itemx -mf16c
@opindex mf16c
+@itemx -mf16c
@need 200
-@itemx -mfma
@opindex mfma
+@itemx -mfma
@need 200
-@itemx -mpconfig
@opindex mpconfig
+@itemx -mpconfig
@need 200
-@itemx -mwbnoinvd
@opindex mwbnoinvd
+@itemx -mwbnoinvd
@need 200
-@itemx -mfma4
@opindex mfma4
+@itemx -mfma4
@need 200
-@itemx -mprfchw
@opindex mprfchw
+@itemx -mprfchw
@need 200
-@itemx -mrdpid
@opindex mrdpid
+@itemx -mrdpid
@need 200
-@itemx -mprefetchwt1
@opindex mprefetchwt1
+@itemx -mprefetchwt1
@need 200
-@itemx -mrdseed
@opindex mrdseed
+@itemx -mrdseed
@need 200
-@itemx -msgx
@opindex msgx
+@itemx -msgx
@need 200
-@itemx -mxop
@opindex mxop
+@itemx -mxop
@need 200
-@itemx -mlwp
@opindex mlwp
+@itemx -mlwp
@need 200
-@itemx -m3dnow
@opindex m3dnow
+@itemx -m3dnow
@need 200
-@itemx -m3dnowa
@opindex m3dnowa
+@itemx -m3dnowa
@need 200
-@itemx -mpopcnt
@opindex mpopcnt
+@itemx -mpopcnt
@need 200
-@itemx -mabm
@opindex mabm
+@itemx -mabm
@need 200
-@itemx -madx
@opindex madx
+@itemx -madx
@need 200
-@itemx -mbmi
@opindex mbmi
+@itemx -mbmi
@need 200
-@itemx -mbmi2
@opindex mbmi2
+@itemx -mbmi2
@need 200
-@itemx -mlzcnt
@opindex mlzcnt
+@itemx -mlzcnt
@need 200
-@itemx -mfxsr
@opindex mfxsr
+@itemx -mfxsr
@need 200
-@itemx -mxsave
@opindex mxsave
+@itemx -mxsave
@need 200
-@itemx -mxsaveopt
@opindex mxsaveopt
+@itemx -mxsaveopt
@need 200
-@itemx -mxsavec
@opindex mxsavec
+@itemx -mxsavec
@need 200
-@itemx -mxsaves
@opindex mxsaves
+@itemx -mxsaves
@need 200
-@itemx -mrtm
@opindex mrtm
+@itemx -mrtm
@need 200
-@itemx -mhle
@opindex mhle
+@itemx -mhle
@need 200
-@itemx -mtbm
@opindex mtbm
+@itemx -mtbm
@need 200
-@itemx -mmwaitx
@opindex mmwaitx
+@itemx -mmwaitx
@need 200
-@itemx -mclzero
@opindex mclzero
+@itemx -mclzero
@need 200
-@itemx -mpku
@opindex mpku
+@itemx -mpku
@need 200
-@itemx -mavx512vbmi2
@opindex mavx512vbmi2
+@itemx -mavx512vbmi2
@need 200
-@itemx -mavx512bf16
@opindex mavx512bf16
+@itemx -mavx512bf16
@need 200
-@itemx -mavx512fp16
@opindex mavx512fp16
+@itemx -mavx512fp16
@need 200
-@itemx -mgfni
@opindex mgfni
+@itemx -mgfni
@need 200
-@itemx -mvaes
@opindex mvaes
+@itemx -mvaes
@need 200
-@itemx -mwaitpkg
@opindex mwaitpkg
+@itemx -mwaitpkg
@need 200
-@itemx -mvpclmulqdq
@opindex mvpclmulqdq
+@itemx -mvpclmulqdq
@need 200
-@itemx -mavx512bitalg
@opindex mavx512bitalg
+@itemx -mavx512bitalg
@need 200
-@itemx -mmovdiri
@opindex mmovdiri
+@itemx -mmovdiri
@need 200
-@itemx -mmovdir64b
@opindex mmovdir64b
+@itemx -mmovdir64b
@need 200
-@itemx -menqcmd
@opindex menqcmd
-@itemx -muintr
@opindex muintr
+@itemx -menqcmd
+@itemx -muintr
@need 200
-@itemx -mtsxldtrk
@opindex mtsxldtrk
+@itemx -mtsxldtrk
@need 200
-@itemx -mavx512vpopcntdq
@opindex mavx512vpopcntdq
+@itemx -mavx512vpopcntdq
@need 200
-@itemx -mavx512vp2intersect
@opindex mavx512vp2intersect
+@itemx -mavx512vp2intersect
@need 200
-@itemx -mavx5124fmaps
@opindex mavx5124fmaps
+@itemx -mavx5124fmaps
@need 200
-@itemx -mavx512vnni
@opindex mavx512vnni
+@itemx -mavx512vnni
@need 200
-@itemx -mavxvnni
@opindex mavxvnni
+@itemx -mavxvnni
@need 200
-@itemx -mavx5124vnniw
@opindex mavx5124vnniw
+@itemx -mavx5124vnniw
@need 200
-@itemx -mcldemote
@opindex mcldemote
+@itemx -mcldemote
@need 200
-@itemx -mserialize
@opindex mserialize
+@itemx -mserialize
@need 200
-@itemx -mamx-tile
@opindex mamx-tile
+@itemx -mamx-tile
@need 200
-@itemx -mamx-int8
@opindex mamx-int8
+@itemx -mamx-int8
@need 200
-@itemx -mamx-bf16
@opindex mamx-bf16
+@itemx -mamx-bf16
@need 200
-@itemx -mhreset
@opindex mhreset
-@itemx -mkl
@opindex mkl
+@itemx -mhreset
+@itemx -mkl
@need 200
-@itemx -mwidekl
@opindex mwidekl
+@itemx -mwidekl
@need 200
-@itemx -mavxifma
@opindex mavxifma
+@itemx -mavxifma
@need 200
-@itemx -mavxvnniint8
@opindex mavxvnniint8
+@itemx -mavxvnniint8
@need 200
-@itemx -mavxneconvert
@opindex mavxneconvert
+@itemx -mavxneconvert
@need 200
-@itemx -mcmpccxadd
@opindex mcmpccxadd
+@itemx -mcmpccxadd
@need 200
-@itemx -mamx-fp16
@opindex mamx-fp16
+@itemx -mamx-fp16
@need 200
-@itemx -mprefetchi
@opindex mprefetchi
+@itemx -mprefetchi
@need 200
-@itemx -mraoint
@opindex mraoint
+@itemx -mraoint
These switches enable the use of instructions in the MMX, SSE,
SSE2, SSE3, SSSE3, SSE4, SSE4A, SSE4.1, SSE4.2, AVX, AVX2, AVX512F, AVX512PF,
AVX512ER, AVX512CD, AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA, AVX512VBMI, SHA,
the file containing the CPU detection code should be compiled without
these options.
-@item -mdump-tune-features
@opindex mdump-tune-features
+@item -mdump-tune-features
This option instructs GCC to dump the names of the x86 performance
tuning features and default settings. The names can be used in
@option{-mtune-ctrl=@var{feature-list}}.
-@item -mtune-ctrl=@var{feature-list}
@opindex mtune-ctrl=@var{feature-list}
+@item -mtune-ctrl=@var{feature-list}
This option is used to do fine grain control of x86 code generation features.
@var{feature-list} is a comma separated list of @var{feature} names. See also
@option{-mdump-tune-features}. When specified, the @var{feature} is turned
developers. Using it may lead to code paths not covered by testing and can
potentially result in compiler ICEs or runtime errors.
-@item -mno-default
@opindex mno-default
+@item -mno-default
This option instructs GCC to turn off all tunable features. See also
@option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
-@item -mcld
@opindex mcld
+@item -mcld
This option instructs GCC to emit a @code{cld} instruction in the prologue
of functions that use string instructions. String instructions depend on
the DF flag to select between autoincrement or autodecrement mode. While the
instructions can be suppressed with the @option{-mno-cld} compiler option
in this case.
-@item -mvzeroupper
@opindex mvzeroupper
+@item -mvzeroupper
This option instructs GCC to emit a @code{vzeroupper} instruction
before a transfer of control flow out of the function to minimize
the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
intrinsics.
-@item -mprefer-avx128
@opindex mprefer-avx128
+@item -mprefer-avx128
This option instructs GCC to use 128-bit AVX instructions instead of
256-bit AVX instructions in the auto-vectorizer.
-@item -mprefer-vector-width=@var{opt}
@opindex mprefer-vector-width
+@item -mprefer-vector-width=@var{opt}
This option instructs GCC to use @var{opt}-bit vector width in instructions
instead of default on the selected platform.
-@item -mmove-max=@var{bits}
@opindex mmove-max
+@item -mmove-max=@var{bits}
This option instructs GCC to set the maximum number of bits can be
moved from memory to memory efficiently to @var{bits}. The valid
@var{bits} are 128, 256 and 512.
-@item -mstore-max=@var{bits}
@opindex mstore-max
+@item -mstore-max=@var{bits}
This option instructs GCC to set the maximum number of bits can be
stored to memory efficiently to @var{bits}. The valid @var{bits} are
128, 256 and 512.
Prefer 512-bit vector width for instructions.
@end table
-@item -mcx16
@opindex mcx16
+@item -mcx16
This option enables GCC to generate @code{CMPXCHG16B} instructions in 64-bit
code to implement compare-and-exchange operations on 16-byte aligned 128-bit
objects. This is useful for atomic updates of data structures exceeding one
@ref{__sync Builtins}. However, for @ref{__atomic Builtins} operating on
128-bit integers, a library call is always used.
-@item -msahf
@opindex msahf
+@item -msahf
This option enables generation of @code{SAHF} instructions in 64-bit code.
Early Intel Pentium 4 CPUs with Intel 64 support,
prior to the introduction of Pentium 4 G1 step in December 2005,
@code{drem}, and @code{remainder} built-in functions;
see @ref{Other Builtins} for details.
-@item -mmovbe
@opindex mmovbe
+@item -mmovbe
This option enables use of the @code{movbe} instruction to implement
@code{__builtin_bswap32} and @code{__builtin_bswap64}.
-@item -mshstk
@opindex mshstk
+@item -mshstk
The @option{-mshstk} option enables shadow stack built-in functions
from x86 Control-flow Enforcement Technology (CET).
-@item -mcrc32
@opindex mcrc32
+@item -mcrc32
This option enables built-in functions @code{__builtin_ia32_crc32qi},
@code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
@code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
-@item -mmwait
@opindex mmwait
+@item -mmwait
This option enables built-in functions @code{__builtin_ia32_monitor},
and @code{__builtin_ia32_mwait} to generate the @code{monitor} and
@code{mwait} machine instructions.
-@item -mrecip
@opindex mrecip
+@item -mrecip
This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
(and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
with an additional Newton-Raphson step
already with @option{-ffast-math} (or the above option combination), and
doesn't need @option{-mrecip}.
-@item -mrecip=@var{opt}
@opindex mrecip=opt
+@item -mrecip=@var{opt}
This option controls which reciprocal estimate instructions
may be used. @var{opt} is a comma-separated list of options, which may
be preceded by a @samp{!} to invert the option:
So, for example, @option{-mrecip=all,!sqrt} enables
all of the reciprocal approximations, except for square root.
-@item -mveclibabi=@var{type}
@opindex mveclibabi
+@item -mveclibabi=@var{type}
Specifies the ABI type to use for vectorizing intrinsics using an
external library. Supported values for @var{type} are @samp{svml}
for the Intel short
@code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
when @option{-mveclibabi=acml} is used.
-@item -mabi=@var{name}
@opindex mabi
+@item -mabi=@var{name}
Generate code for the specified calling convention. Permissible values
are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
@samp{ms} for the Microsoft ABI. The default is to use the Microsoft
using the function attributes @code{ms_abi} and @code{sysv_abi}.
@xref{Function Attributes}.
-@item -mforce-indirect-call
@opindex mforce-indirect-call
+@item -mforce-indirect-call
Force all calls to functions to be indirect. This is useful
when using Intel Processor Trace where it generates more precise timing
information for function calls.
-@item -mmanual-endbr
@opindex mmanual-endbr
+@item -mmanual-endbr
Insert ENDBR instruction at function entry only via the @code{cf_check}
function attribute. This is useful when used with the option
@option{-fcf-protection=branch} to control ENDBR insertion at the
function entry.
-@item -mcet-switch
@opindex mcet-switch
+@item -mcet-switch
By default, CET instrumentation is turned off on switch statements that
use a jump table and indirect branch track is disabled. Since jump
tables are stored in read-only memory, this does not result in a direct
with jump tables which leads to the jump targets reachable via any indirect
jumps.
-@item -mcall-ms2sysv-xlogues
@opindex mcall-ms2sysv-xlogues
@opindex mno-call-ms2sysv-xlogues
+@item -mcall-ms2sysv-xlogues
Due to differences in 64-bit ABIs, any Microsoft ABI function that calls a
System V ABI function must consider RSI, RDI and XMM6-15 as clobbered. By
default, the code for saving and restoring these registers is emitted inline,
use stubs in the static portion of libgcc to perform these saves and restores,
thus reducing function size at the cost of a few extra instructions.
-@item -mtls-dialect=@var{type}
@opindex mtls-dialect
+@item -mtls-dialect=@var{type}
Generate code to access thread-local storage using the @samp{gnu} or
@samp{gnu2} conventions. @samp{gnu} is the conservative default;
@samp{gnu2} is more efficient, but it may add compile- and run-time
requirements that cannot be satisfied on all systems.
-@item -mpush-args
-@itemx -mno-push-args
@opindex mpush-args
@opindex mno-push-args
+@item -mpush-args
+@itemx -mno-push-args
Use PUSH operations to store outgoing parameters. This method is shorter
and usually equally fast as method using SUB/MOV operations and is enabled
by default. In some cases disabling it may improve performance because of
improved scheduling and reduced dependencies.
-@item -maccumulate-outgoing-args
@opindex maccumulate-outgoing-args
+@item -maccumulate-outgoing-args
If enabled, the maximum amount of space required for outgoing arguments is
computed in the function prologue. This is faster on most modern CPUs
because of reduced dependencies, improved scheduling and reduced stack usage
when the preferred stack boundary is not equal to 2. The drawback is a notable
increase in code size. This switch implies @option{-mno-push-args}.
-@item -mthreads
@opindex mthreads
+@item -mthreads
Support thread-safe exception handling on MinGW. Programs that rely
on thread-safe exception handling must compile and link all code with the
@option{-mthreads} option. When compiling, @option{-mthreads} defines
@option{-D_MT}; when linking, it links in a special thread helper library
@option{-lmingwthrd} which cleans up per-thread exception-handling data.
-@item -mms-bitfields
-@itemx -mno-ms-bitfields
@opindex mms-bitfields
@opindex mno-ms-bitfields
+@item -mms-bitfields
+@itemx -mno-ms-bitfields
Enable/disable bit-field layout compatible with the native Microsoft
Windows compiler.
@end enumerate
-@item -mno-align-stringops
@opindex mno-align-stringops
@opindex malign-stringops
+@item -mno-align-stringops
Do not align the destination of inlined string operations. This switch reduces
code size and improves performance in case the destination is already aligned,
but GCC doesn't know about it.
-@item -minline-all-stringops
@opindex minline-all-stringops
+@item -minline-all-stringops
By default GCC inlines string operations only when the destination is
known to be aligned to least a 4-byte boundary.
This enables more inlining and increases code
The option enables inline expansion of @code{strlen} for all
pointer alignments.
-@item -minline-stringops-dynamically
@opindex minline-stringops-dynamically
+@item -minline-stringops-dynamically
For string operations of unknown size, use run-time checks with
inline code for small blocks and a library call for large blocks.
-@item -mstringop-strategy=@var{alg}
@opindex mstringop-strategy=@var{alg}
+@item -mstringop-strategy=@var{alg}
Override the internal decision heuristic for the particular algorithm to use
for inlining string operations. The allowed values for @var{alg} are:
Always use a library call.
@end table
-@item -mmemcpy-strategy=@var{strategy}
@opindex mmemcpy-strategy=@var{strategy}
+@item -mmemcpy-strategy=@var{strategy}
Override the internal decision heuristic to decide if @code{__builtin_memcpy}
should be inlined and what inline algorithm to use when the expected size
of the copy operation is known. @var{strategy}
@var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the
preceding range.
-@item -mmemset-strategy=@var{strategy}
@opindex mmemset-strategy=@var{strategy}
+@item -mmemset-strategy=@var{strategy}
The option is similar to @option{-mmemcpy-strategy=} except that it is to control
@code{__builtin_memset} expansion.
-@item -momit-leaf-frame-pointer
@opindex momit-leaf-frame-pointer
+@item -momit-leaf-frame-pointer
Don't keep the frame pointer in a register for leaf functions. This
avoids the instructions to save, set up, and restore frame pointers and
makes an extra register available in leaf functions. The option
@option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
which might make debugging harder.
+@opindex mtls-direct-seg-refs
@item -mtls-direct-seg-refs
@itemx -mno-tls-direct-seg-refs
-@opindex mtls-direct-seg-refs
Controls whether TLS variables may be accessed with offsets from the
TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
or whether the thread base pointer must be added. Whether or not this
For systems that use the GNU C Library, the default is on.
+@opindex msse2avx
@item -msse2avx
@itemx -mno-sse2avx
-@opindex msse2avx
Specify that the assembler should encode SSE instructions with VEX
prefix. The option @option{-mavx} turns this on by default.
+@opindex mfentry
@item -mfentry
@itemx -mno-fentry
-@opindex mfentry
If profiling is active (@option{-pg}), put the profiling
counter call before the prologue.
Note: On x86 architectures the attribute @code{ms_hook_prologue}
isn't possible at the moment for @option{-mfentry} and @option{-pg}.
+@opindex mrecord-mcount
@item -mrecord-mcount
@itemx -mno-record-mcount
-@opindex mrecord-mcount
If profiling is active (@option{-pg}), generate a __mcount_loc section
that contains pointers to each profiling call. This is useful for
automatically patching and out calls.
+@opindex mnop-mcount
@item -mnop-mcount
@itemx -mno-nop-mcount
-@opindex mnop-mcount
If profiling is active (@option{-pg}), generate the calls to
the profiling functions as NOPs. This is useful when they
should be patched in later dynamically. This is likely only
useful together with @option{-mrecord-mcount}.
-@item -minstrument-return=@var{type}
@opindex minstrument-return
+@item -minstrument-return=@var{type}
Instrument function exit in -pg -mfentry instrumented functions with
call to specified function. This only instruments true returns ending
with ret, but not sibling calls ending with jump. Valid types
are @var{none} to not instrument, @var{call} to generate a call to __return__,
or @var{nop5} to generate a 5 byte nop.
+@opindex mrecord-return
@item -mrecord-return
@itemx -mno-record-return
-@opindex mrecord-return
Generate a __return_loc section pointing to all return instrumentation code.
-@item -mfentry-name=@var{name}
@opindex mfentry-name
+@item -mfentry-name=@var{name}
Set name of __fentry__ symbol called at function entry for -pg -mfentry functions.
-@item -mfentry-section=@var{name}
@opindex mfentry-section
+@item -mfentry-section=@var{name}
Set name of section to record -mrecord-mcount calls (default __mcount_loc).
+@opindex mskip-rax-setup
@item -mskip-rax-setup
@itemx -mno-skip-rax-setup
-@opindex mskip-rax-setup
When generating code for the x86-64 architecture with SSE extensions
disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
register when there are no variable arguments passed in vector registers.
misbehave or jump to a random location. GCC 4.4 or newer don't have
those issues, regardless the RAX register value.
+@opindex m8bit-idiv
@item -m8bit-idiv
@itemx -mno-8bit-idiv
-@opindex m8bit-idiv
On some processors, like Intel Atom, 8-bit unsigned integer divide is
much faster than 32-bit/64-bit integer divide. This option generates a
run-time check. If both dividend and divisor are within range of 0
to 255, 8-bit unsigned integer divide is used instead of
32-bit/64-bit integer divide.
-@item -mavx256-split-unaligned-load
-@itemx -mavx256-split-unaligned-store
@opindex mavx256-split-unaligned-load
@opindex mavx256-split-unaligned-store
+@item -mavx256-split-unaligned-load
+@itemx -mavx256-split-unaligned-store
Split 32-byte AVX unaligned load and store.
-@item -mstack-protector-guard=@var{guard}
-@itemx -mstack-protector-guard-reg=@var{reg}
-@itemx -mstack-protector-guard-offset=@var{offset}
@opindex mstack-protector-guard
@opindex mstack-protector-guard-reg
@opindex mstack-protector-guard-offset
+@item -mstack-protector-guard=@var{guard}
+@itemx -mstack-protector-guard-reg=@var{reg}
+@itemx -mstack-protector-guard-offset=@var{offset}
Generate stack protection code using canary at @var{guard}. Supported
locations are @samp{global} for global canary or @samp{tls} for per-thread
canary in the TLS block (the default). This option has effect only when
for reading the canary, and from what offset from that base register.
The default for those is as specified in the relevant ABI.
-@item -mgeneral-regs-only
@opindex mgeneral-regs-only
+@item -mgeneral-regs-only
Generate code that uses only the general-purpose registers. This
prevents the compiler from using floating-point, vector, mask and bound
registers.
-@item -mrelax-cmpxchg-loop
@opindex mrelax-cmpxchg-loop
+@item -mrelax-cmpxchg-loop
When emitting a compare-and-swap loop for @ref{__sync Builtins}
and @ref{__atomic Builtins} lacking a native instruction, optimize
for the highly contended case by issuing an atomic load before the
@code{CMPXCHG} instruction, and using the @code{PAUSE} instruction
to save CPU power when restarting the loop.
-@item -mindirect-branch=@var{choice}
@opindex mindirect-branch
+@item -mindirect-branch=@var{choice}
Convert indirect call and jump with @var{choice}. The default is
@samp{keep}, which keeps indirect call and jump unmodified.
@samp{thunk} converts indirect call and jump to call and return thunk.
@option{-fcf-protection=branch} since the external thunk can be made
to enable control-flow check.
-@item -mfunction-return=@var{choice}
@opindex mfunction-return
+@item -mfunction-return=@var{choice}
Convert function return with @var{choice}. The default is @samp{keep},
which keeps function return unmodified. @samp{thunk} converts function
return to call and return thunk. @samp{thunk-inline} converts function
not be reachable in the large code model.
-@item -mindirect-branch-register
@opindex mindirect-branch-register
+@item -mindirect-branch-register
Force indirect call and jump via register.
-@item -mharden-sls=@var{choice}
@opindex mharden-sls
+@item -mharden-sls=@var{choice}
Generate code to mitigate against straight line speculation (SLS) with
@var{choice}. The default is @samp{none} which disables all SLS
hardening. @samp{return} enables SLS hardening for function returns.
@samp{indirect-jmp} enables SLS hardening for indirect jumps.
@samp{all} enables all SLS hardening.
-@item -mindirect-branch-cs-prefix
@opindex mindirect-branch-cs-prefix
+@item -mindirect-branch-cs-prefix
Add CS prefix to call and jmp to indirect thunk with branch target in
r8-r15 registers so that the call and jmp instruction length is 6 bytes
to allow them to be replaced with @samp{lfence; call *%r8-r15} or
on x86-64 processors in 64-bit environments.
@table @gcctabopt
-@item -m32
-@itemx -m64
-@itemx -mx32
-@itemx -m16
-@itemx -miamcu
@opindex m32
@opindex m64
@opindex mx32
@opindex m16
@opindex miamcu
+@item -m32
+@itemx -m64
+@itemx -mx32
+@itemx -m16
+@itemx -miamcu
Generate code for a 16-bit, 32-bit or 64-bit environment.
The @option{-m32} option sets @code{int}, @code{long}, and pointer types
to 32 bits, and
The @option{-miamcu} option generates code which conforms to Intel MCU
psABI. It requires the @option{-m32} option to be turned on.
-@item -mno-red-zone
@opindex mno-red-zone
@opindex mred-zone
+@item -mno-red-zone
Do not use a so-called ``red zone'' for x86-64 code. The red zone is mandated
by the x86-64 ABI; it is a 128-byte area beyond the location of the
stack pointer that is not modified by signal or interrupt handlers
and therefore can be used for temporary data without adjusting the stack
pointer. The flag @option{-mno-red-zone} disables this red zone.
-@item -mcmodel=small
@opindex mcmodel=small
+@item -mcmodel=small
Generate code for the small code model: the program and its symbols must
be linked in the lower 2 GB of the address space. Pointers are 64 bits.
Programs can be statically or dynamically linked. This is the default
code model.
-@item -mcmodel=kernel
@opindex mcmodel=kernel
+@item -mcmodel=kernel
Generate code for the kernel code model. The kernel runs in the
negative 2 GB of the address space.
This model has to be used for Linux kernel code.
-@item -mcmodel=medium
@opindex mcmodel=medium
+@item -mcmodel=medium
Generate code for the medium model: the program is linked in the lower 2
GB of the address space. Small symbols are also placed there. Symbols
with sizes larger than @option{-mlarge-data-threshold} are put into
large data or BSS sections and can be located above 2GB. Programs can
be statically or dynamically linked.
-@item -mcmodel=large
@opindex mcmodel=large
+@item -mcmodel=large
Generate code for the large model. This model makes no assumptions
about addresses and sizes of sections.
-@item -maddress-mode=long
@opindex maddress-mode=long
+@item -maddress-mode=long
Generate code for long address mode. This is only supported for 64-bit
and x32 environments. It is the default address mode for 64-bit
environments.
-@item -maddress-mode=short
@opindex maddress-mode=short
+@item -maddress-mode=short
Generate code for short address mode. This is only supported for 32-bit
and x32 environments. It is the default address mode for 32-bit and
x32 environments.
+@opindex mneeded
@item -mneeded
@itemx -mno-needed
-@opindex mneeded
Emit GNU_PROPERTY_X86_ISA_1_NEEDED GNU property for Linux target to
indicate the micro-architecture ISA level required to execute the binary.
-@item -mno-direct-extern-access
@opindex mno-direct-extern-access
@opindex mdirect-extern-access
+@item -mno-direct-extern-access
Without @option{-fpic} nor @option{-fPIC}, always use the GOT pointer
to access external symbols. With @option{-fpic} or @option{-fPIC},
treat access to protected symbols as local symbols. The default is
@option{-mdirect-extern-access} may not be binary compatible if
protected symbols are used in shared libraries and executable.
-@item -munroll-only-small-loops
@opindex munroll-only-small-loops
@opindex mno-unroll-only-small-loops
+@item -munroll-only-small-loops
Controls conservative small loop unrolling. It is default enabled by
O2, and unrolls loop with less than 4 insns by 1 time. Explicit
-f[no-]unroll-[all-]loops would disable this flag to avoid any
unintended unrolling behavior that user does not want.
-@item -mlam=@var{choice}
@opindex mlam
+@item -mlam=@var{choice}
LAM(linear-address masking) allows special bits in the pointer to be used
for metadata. The default is @samp{none}. With @samp{u48}, pointer bits in
positions 62:48 can be used for metadata; With @samp{u57}, pointer bits in
These additional options are available for Microsoft Windows targets:
@table @gcctabopt
-@item -mconsole
@opindex mconsole
+@item -mconsole
This option
specifies that a console application is to be generated, by
instructing the linker to set the PE header subsystem type
This option is available for Cygwin and MinGW targets and is
enabled by default on those targets.
-@item -mdll
@opindex mdll
+@item -mdll
This option is available for Cygwin and MinGW targets. It
specifies that a DLL---a dynamic link library---is to be
generated, enabling the selection of the required runtime
startup object and entry point.
-@item -mnop-fun-dllimport
@opindex mnop-fun-dllimport
+@item -mnop-fun-dllimport
This option is available for Cygwin and MinGW targets. It
specifies that the @code{dllimport} attribute should be ignored.
-@item -mthreads
@opindex mthreads
+@item -mthreads
This option is available for MinGW targets. It specifies
that MinGW-specific thread support is to be used.
-@item -municode
@opindex municode
+@item -municode
This option is available for MinGW-w64 targets. It causes
the @code{UNICODE} preprocessor macro to be predefined, and
chooses Unicode-capable runtime startup code.
-@item -mwin32
@opindex mwin32
+@item -mwin32
This option is available for Cygwin and MinGW targets. It
specifies that the typical Microsoft Windows predefined macros are to
be set in the pre-processor, but does not influence the choice
of runtime library/startup code.
-@item -mwindows
@opindex mwindows
+@item -mwindows
This option is available for Cygwin and MinGW targets. It
specifies that a GUI application is to be generated by
instructing the linker to set the PE header subsystem type
appropriately.
-@item -fno-set-stack-executable
@opindex fno-set-stack-executable
@opindex fset-stack-executable
+@item -fno-set-stack-executable
This option is available for MinGW targets. It specifies that
the executable flag for the stack used by nested functions isn't
set. This is necessary for binaries running in kernel mode of
Microsoft Windows, as there the User32 API, which is used to set executable
privileges, isn't available.
-@item -fwritable-relocated-rdata
@opindex fno-writable-relocated-rdata
@opindex fwritable-relocated-rdata
+@item -fwritable-relocated-rdata
This option is available for MinGW and Cygwin targets. It specifies
that relocated-data in read-only section is put into the @code{.data}
section. This is a necessary for older runtimes not supporting
modification of @code{.rdata} sections for pseudo-relocation.
-@item -mpe-aligned-commons
@opindex mpe-aligned-commons
+@item -mpe-aligned-commons
This option is available for Cygwin and MinGW targets. It
specifies that the GNU extension to the PE file format that
permits the correct alignment of COMMON variables should be
These options are defined for Xstormy16:
@table @gcctabopt
-@item -msim
@opindex msim
+@item -msim
Choose startup files and linker script suitable for the simulator.
@end table
These options are supported for Xtensa targets:
@table @gcctabopt
-@item -mconst16
-@itemx -mno-const16
@opindex mconst16
@opindex mno-const16
+@item -mconst16
+@itemx -mno-const16
Enable or disable use of @code{CONST16} instructions for loading
constant values. The @code{CONST16} instruction is currently not a
standard option from Tensilica. When enabled, @code{CONST16}
instructions. The use of @code{CONST16} is enabled by default only if
the @code{L32R} instruction is not available.
-@item -mfused-madd
-@itemx -mno-fused-madd
@opindex mfused-madd
@opindex mno-fused-madd
+@item -mfused-madd
+@itemx -mno-fused-madd
Enable or disable use of fused multiply/add and multiply/subtract
instructions in the floating-point option. This has no effect if the
floating-point option is not also enabled. Disabling fused multiply/add
sensitive to the compiler's ability to combine multiply and add/subtract
operations.
-@item -mserialize-volatile
-@itemx -mno-serialize-volatile
@opindex mserialize-volatile
@opindex mno-serialize-volatile
+@item -mserialize-volatile
+@itemx -mno-serialize-volatile
When this option is enabled, GCC inserts @code{MEMW} instructions before
@code{volatile} memory references to guarantee sequential consistency.
The default is @option{-mserialize-volatile}. Use
@option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
-@item -mforce-no-pic
@opindex mforce-no-pic
+@item -mforce-no-pic
For targets, like GNU/Linux, where all user-mode Xtensa code must be
position-independent code (PIC), this option disables PIC for compiling
kernel code.
-@item -mtext-section-literals
-@itemx -mno-text-section-literals
@opindex mtext-section-literals
@opindex mno-text-section-literals
+@item -mtext-section-literals
+@itemx -mno-text-section-literals
These options control the treatment of literal pools. The default is
@option{-mno-text-section-literals}, which places literals in a separate
section in the output file. This allows the literal pool to be placed
possible to their references. This may be necessary for large assembly
files. Literals for each function are placed right before that function.
-@item -mauto-litpools
-@itemx -mno-auto-litpools
@opindex mauto-litpools
@opindex mno-auto-litpools
+@item -mauto-litpools
+@itemx -mno-auto-litpools
These options control the treatment of literal pools. The default is
@option{-mno-auto-litpools}, which places literals in a separate
section in the output file unless @option{-mtext-section-literals} is
very big functions, which may not be possible with
@option{-mtext-section-literals}.
-@item -mtarget-align
-@itemx -mno-target-align
@opindex mtarget-align
@opindex mno-target-align
+@item -mtarget-align
+@itemx -mno-target-align
When this option is enabled, GCC instructs the assembler to
automatically align instructions to reduce branch penalties at the
expense of some code density. The assembler attempts to widen density
assembler always aligns, either by widening density instructions or
by inserting NOP instructions.
-@item -mlongcalls
-@itemx -mno-longcalls
@opindex mlongcalls
@opindex mno-longcalls
+@item -mlongcalls
+@itemx -mno-longcalls
When this option is enabled, GCC instructs the assembler to translate
direct calls to indirect calls unless it can determine that the target
of a direct call is in the range allowed by the call instruction. This
instructions. Note that the assembler uses an indirect call for
every cross-file call, not just those that really are out of range.
-@item -mabi=@var{name}
@opindex mabi
+@item -mabi=@var{name}
Generate code for the specified ABI@. Permissible values are: @samp{call0},
@samp{windowed}. Default ABI is chosen by the Xtensa core configuration.
-@item -mabi=call0
@opindex mabi=call0
+@item -mabi=call0
When this option is enabled function parameters are passed in registers
@code{a2} through @code{a7}, registers @code{a12} through @code{a15} are
caller-saved, and register @code{a15} may be used as a frame pointer.
When this version of the ABI is enabled the C preprocessor symbol
@code{__XTENSA_CALL0_ABI__} is defined.
-@item -mabi=windowed
@opindex mabi=windowed
+@item -mabi=windowed
When this option is enabled function parameters are passed in registers
@code{a10} through @code{a15}, and called function rotates register window
by 8 registers on entry so that its arguments are found in registers
When this version of the ABI is enabled the C preprocessor symbol
@code{__XTENSA_WINDOWED_ABI__} is defined.
-@item -mextra-l32r-costs=@var{n}
@opindex mextra-l32r-costs
+@item -mextra-l32r-costs=@var{n}
Specify an extra cost of instruction RAM/ROM access for @code{L32R}
instructions, in clock cycles. This affects, when optimizing for speed,
whether loading a constant from literal pool using @code{L32R} or