39560 lines
1.2 MiB
39560 lines
1.2 MiB
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of GCC</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>GCC</H1>
|
|
Section: GNU (1)<BR>Updated: 2020-08-08<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
gcc - GNU project C and C++ compiler
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
gcc [<B>-c</B>|<B>-S</B>|<B>-E</B>] [<B>-std=</B><I>standard</I>]
|
|
<BR> [<B>-g</B>] [<B>-pg</B>] [<B>-O</B><I>level</I>]
|
|
<BR> [<B>-W</B><I>warn</I>...] [<B>-Wpedantic</B>]
|
|
<BR> [<B>-I</B><I>dir</I>...] [<B>-L</B><I>dir</I>...]
|
|
<BR> [<B>-D</B><I>macro</I>[=<I>defn</I>]...] [<B>-U</B><I>macro</I>]
|
|
<BR> [<B>-f</B><I>option</I>...] [<B>-m</B><I>machine-option</I>...]
|
|
<BR> [<B>-o</B> <I>outfile</I>] [@<I>file</I>] <I>infile</I>...
|
|
<P>
|
|
|
|
Only the most useful options are listed here; see below for the
|
|
remainder. <B>g++</B> accepts mostly the same options as <B>gcc</B>.
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
When you invoke <FONT SIZE="-1">GCC,</FONT> it normally does preprocessing, compilation,
|
|
assembly and linking. The ``overall options'' allow you to stop this
|
|
process at an intermediate stage. For example, the <B>-c</B> option
|
|
says not to run the linker. Then the output consists of object files
|
|
output by the assembler.
|
|
<P>
|
|
|
|
Other options are passed on to one or more stages of processing. Some options
|
|
control the preprocessor and others the compiler itself. Yet other
|
|
options control the assembler and linker; most of these are not
|
|
documented here, since you rarely need to use any of them.
|
|
<P>
|
|
|
|
Most of the command-line options that you can use with <FONT SIZE="-1">GCC</FONT> are useful
|
|
for C programs; when an option is only useful with another language
|
|
(usually C<FONT SIZE="-2">++</FONT>), the explanation says so explicitly. If the description
|
|
for a particular option does not mention a source language, you can use
|
|
that option with all supported languages.
|
|
<P>
|
|
|
|
The usual way to run <FONT SIZE="-1">GCC</FONT> is to run the executable called <B>gcc</B>, or
|
|
<I>machine</I><B>-gcc</B> when cross-compiling, or
|
|
<I>machine</I><B>-gcc-</B><I>version</I> to run a specific version of <FONT SIZE="-1">GCC.</FONT>
|
|
When you compile C<FONT SIZE="-2">++</FONT> programs, you should invoke <FONT SIZE="-1">GCC</FONT> as <B>g++</B>
|
|
instead.
|
|
<P>
|
|
|
|
The <B>gcc</B> program accepts options and file names as operands. Many
|
|
options have multi-letter names; therefore multiple single-letter options
|
|
may <I>not</I> be grouped: <B>-dv</B> is very different from <B>-d -v</B>.
|
|
<P>
|
|
|
|
You can mix options and other arguments. For the most part, the order
|
|
you use doesn't matter. Order does matter when you use several
|
|
options of the same kind; for example, if you specify <B>-L</B> more
|
|
than once, the directories are searched in the order specified. Also,
|
|
the placement of the <B>-l</B> option is significant.
|
|
<P>
|
|
|
|
Many options have long names starting with <B>-f</B> or with
|
|
<B>-W</B>---for example,
|
|
<B>-fmove-loop-invariants</B>, <B>-Wformat</B> and so on. Most of
|
|
these have both positive and negative forms; the negative form of
|
|
<B>-ffoo</B> is <B>-fno-foo</B>. This manual documents
|
|
only one of these two forms, whichever one is not the default.
|
|
<P>
|
|
|
|
Some options take one or more arguments typically separated either
|
|
by a space or by the equals sign (<B>=</B>) from the option name.
|
|
Unless documented otherwise, an argument can be either numeric or
|
|
a string. Numeric arguments must typically be small unsigned decimal
|
|
or hexadecimal integers. Hexadecimal arguments must begin with
|
|
the <B>0x</B> prefix. Arguments to options that specify a size
|
|
threshold of some sort may be arbitrarily large decimal or hexadecimal
|
|
integers followed by a byte size suffix designating a multiple of bytes
|
|
such as <TT>"kB"</TT> and <TT>"KiB"</TT> for kilobyte and kibibyte, respectively,
|
|
<TT>"MB"</TT> and <TT>"MiB"</TT> for megabyte and mebibyte, <TT>"GB"</TT> and
|
|
<TT>"GiB"</TT> for gigabyte and gigibyte, and so on. Such arguments are
|
|
designated by <I>byte-size</I> in the following text. Refer to the <FONT SIZE="-1">NIST,
|
|
IEC,</FONT> and other relevant national and international standards for the full
|
|
listing and explanation of the binary and decimal byte size prefixes.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Option Summary</H3>
|
|
|
|
|
|
|
|
Here is a summary of all the options, grouped by type. Explanations are
|
|
in the following sections.
|
|
<DL COMPACT>
|
|
<DT id="1"><I>Overall Options</I><DD>
|
|
|
|
|
|
<B>-c -S -E -o</B> <I>file</I> <B>-x</B> <I>language</I>
|
|
<B>-v -### --help</B>[<B>=</B><I>class</I>[<B>,...</B>]] <B>--target-help --version
|
|
-pass-exit-codes -pipe -specs=</B><I>file</I> <B>-wrapper
|
|
@</B><I>file</I> <B>-ffile-prefix-map=</B><I>old</I><B>=</B><I>new</I>
|
|
<B>-fplugin=</B><I>file</I> <B>-fplugin-arg-</B><I>name</I><B>=</B><I>arg</I>
|
|
<B>-fdump-ada-spec</B>[<B>-slim</B>] <B>-fada-spec-parent=</B><I>unit</I> <B>-fdump-go-spec=</B><I>file</I>
|
|
<DT id="2"><I>C Language Options</I><DD>
|
|
|
|
|
|
<B>-ansi -std=</B><I>standard</I> <B>-fgnu89-inline
|
|
-fpermitted-flt-eval-methods=</B><I>standard</I>
|
|
<B>-aux-info</B> <I>filename</I> <B>-fallow-parameterless-variadic-functions
|
|
-fno-asm -fno-builtin -fno-builtin-</B><I>function</I> <B>-fgimple
|
|
-fhosted -ffreestanding
|
|
-fopenacc -fopenacc-dim=</B><I>geom</I>
|
|
<B>-fopenmp -fopenmp-simd
|
|
-fms-extensions -fplan9-extensions -fsso-struct=</B><I>endianness</I>
|
|
<B>-fallow-single-precision -fcond-mismatch -flax-vector-conversions
|
|
-fsigned-bitfields -fsigned-char
|
|
-funsigned-bitfields -funsigned-char</B>
|
|
<DT id="3"><I>C<FONT SIZE="-2">++</FONT> Language Options</I><DD>
|
|
|
|
|
|
<B>-fabi-version=</B><I>n</I> <B>-fno-access-control
|
|
-faligned-new=</B><I>n</I> <B>-fargs-in-order=</B><I>n</I> <B>-fchar8_t -fcheck-new
|
|
-fconstexpr-depth=</B><I>n</I> <B>-fconstexpr-loop-limit=</B><I>n</I>
|
|
<B>-fconstexpr-ops-limit=</B><I>n</I> <B>-fno-elide-constructors
|
|
-fno-enforce-eh-specs
|
|
-fno-gnu-keywords
|
|
-fno-implicit-templates
|
|
-fno-implicit-inline-templates
|
|
-fno-implement-inlines -fms-extensions
|
|
-fnew-inheriting-ctors
|
|
-fnew-ttp-matching
|
|
-fno-nonansi-builtins -fnothrow-opt -fno-operator-names
|
|
-fno-optional-diags -fpermissive
|
|
-fno-pretty-templates
|
|
-frepo -fno-rtti -fsized-deallocation
|
|
-ftemplate-backtrace-limit=</B><I>n</I>
|
|
<B>-ftemplate-depth=</B><I>n</I>
|
|
<B>-fno-threadsafe-statics -fuse-cxa-atexit
|
|
-fno-weak -nostdinc++
|
|
-fvisibility-inlines-hidden
|
|
-fvisibility-ms-compat
|
|
-fext-numeric-literals
|
|
-Wabi=</B><I>n</I> <B>-Wabi-tag -Wconversion-null -Wctor-dtor-privacy
|
|
-Wdelete-non-virtual-dtor -Wdeprecated-copy -Wdeprecated-copy-dtor
|
|
-Wliteral-suffix
|
|
-Wmultiple-inheritance -Wno-init-list-lifetime
|
|
-Wnamespaces -Wnarrowing
|
|
-Wpessimizing-move -Wredundant-move
|
|
-Wnoexcept -Wnoexcept-type -Wclass-memaccess
|
|
-Wnon-virtual-dtor -Wreorder -Wregister
|
|
-Weffc++ -Wstrict-null-sentinel -Wtemplates
|
|
-Wno-non-template-friend -Wold-style-cast
|
|
-Woverloaded-virtual -Wno-pmf-conversions
|
|
-Wno-class-conversion -Wno-terminate
|
|
-Wsign-promo -Wvirtual-inheritance</B>
|
|
<DT id="4"><I>Objective-C and Objective-C<FONT SIZE="-2">++</FONT> Language Options</I><DD>
|
|
|
|
|
|
<B>-fconstant-string-class=</B><I>class-name</I>
|
|
<B>-fgnu-runtime -fnext-runtime
|
|
-fno-nil-receivers
|
|
-fobjc-abi-version=</B><I>n</I>
|
|
<B>-fobjc-call-cxx-cdtors
|
|
-fobjc-direct-dispatch
|
|
-fobjc-exceptions
|
|
-fobjc-gc
|
|
-fobjc-nilcheck
|
|
-fobjc-std=objc1
|
|
-fno-local-ivars
|
|
-fivar-visibility=</B>[<B>public</B>|<B>protected</B>|<B>private</B>|<B>package</B>]
|
|
<B>-freplace-objc-classes
|
|
-fzero-link
|
|
-gen-decls
|
|
-Wassign-intercept
|
|
-Wno-protocol -Wselector
|
|
-Wstrict-selector-match
|
|
-Wundeclared-selector</B>
|
|
<DT id="5"><I>Diagnostic Message Formatting Options</I><DD>
|
|
|
|
|
|
<B>-fmessage-length=</B><I>n</I>
|
|
<B>-fdiagnostics-show-location=</B>[<B>once</B>|<B>every-line</B>]
|
|
<B>-fdiagnostics-color=</B>[<B>auto</B>|<B>never</B>|<B>always</B>]
|
|
<B>-fdiagnostics-format=</B>[<B>text</B>|<B>json</B>]
|
|
<B>-fno-diagnostics-show-option -fno-diagnostics-show-caret
|
|
-fno-diagnostics-show-labels -fno-diagnostics-show-line-numbers
|
|
-fdiagnostics-minimum-margin-width=</B><I>width</I>
|
|
<B>-fdiagnostics-parseable-fixits -fdiagnostics-generate-patch
|
|
-fdiagnostics-show-template-tree -fno-elide-type
|
|
-fno-show-column</B>
|
|
<DT id="6"><I>Warning Options</I><DD>
|
|
|
|
|
|
<B>-fsyntax-only -fmax-errors=</B><I>n</I> <B>-Wpedantic
|
|
-pedantic-errors
|
|
-w -Wextra -Wall -Waddress -Waddress-of-packed-member
|
|
-Waggregate-return -Waligned-new
|
|
-Walloc-zero -Walloc-size-larger-than=</B><I>byte-size</I>
|
|
<B>-Walloca -Walloca-larger-than=</B><I>byte-size</I>
|
|
<B>-Wno-aggressive-loop-optimizations -Warray-bounds -Warray-bounds=</B><I>n</I>
|
|
<B>-Wno-attributes -Wattribute-alias=</B><I>n</I>
|
|
<B>-Wbool-compare -Wbool-operation
|
|
-Wno-builtin-declaration-mismatch
|
|
-Wno-builtin-macro-redefined -Wc90-c99-compat -Wc99-c11-compat
|
|
-Wc11-c2x-compat
|
|
-Wc++-compat -Wc++11-compat -Wc++14-compat -Wc++17-compat
|
|
-Wcast-align -Wcast-align=strict -Wcast-function-type -Wcast-qual
|
|
-Wchar-subscripts -Wcatch-value -Wcatch-value=</B><I>n</I>
|
|
<B>-Wclobbered -Wcomment -Wconditionally-supported
|
|
-Wconversion -Wcoverage-mismatch -Wno-cpp -Wdangling-else -Wdate-time
|
|
-Wdelete-incomplete
|
|
-Wno-attribute-warning
|
|
-Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init
|
|
-Wdisabled-optimization
|
|
-Wno-discarded-qualifiers -Wno-discarded-array-qualifiers
|
|
-Wno-div-by-zero -Wdouble-promotion
|
|
-Wduplicated-branches -Wduplicated-cond
|
|
-Wempty-body -Wenum-compare -Wno-endif-labels -Wexpansion-to-defined
|
|
-Werror -Werror=* -Wextra-semi -Wfatal-errors
|
|
-Wfloat-equal -Wformat -Wformat=2
|
|
-Wno-format-contains-nul -Wno-format-extra-args
|
|
-Wformat-nonliteral -Wformat-overflow=</B><I>n</I>
|
|
<B>-Wformat-security -Wformat-signedness -Wformat-truncation=</B><I>n</I>
|
|
<B>-Wformat-y2k -Wframe-address
|
|
-Wframe-larger-than=</B><I>byte-size</I> <B>-Wno-free-nonheap-object
|
|
-Wjump-misses-init
|
|
-Whsa -Wif-not-aligned
|
|
-Wignored-qualifiers -Wignored-attributes -Wincompatible-pointer-types
|
|
-Wimplicit -Wimplicit-fallthrough -Wimplicit-fallthrough=</B><I>n</I>
|
|
<B>-Wimplicit-function-declaration -Wimplicit-int
|
|
-Winit-self -Winline -Wno-int-conversion -Wint-in-bool-context
|
|
-Wno-int-to-pointer-cast -Winvalid-memory-model -Wno-invalid-offsetof
|
|
-Winvalid-pch -Wlarger-than=</B><I>byte-size</I>
|
|
<B>-Wlogical-op -Wlogical-not-parentheses -Wlong-long
|
|
-Wmain -Wmaybe-uninitialized -Wmemset-elt-size -Wmemset-transposed-args
|
|
-Wmisleading-indentation -Wmissing-attributes -Wmissing-braces
|
|
-Wmissing-field-initializers -Wmissing-format-attribute
|
|
-Wmissing-include-dirs -Wmissing-noreturn -Wmissing-profile
|
|
-Wno-multichar -Wmultistatement-macros -Wnonnull -Wnonnull-compare
|
|
-Wnormalized=</B>[<B>none</B>|<B>id</B>|<B>nfc</B>|<B>nfkc</B>]
|
|
<B>-Wnull-dereference -Wodr -Wno-overflow -Wopenmp-simd
|
|
-Woverride-init-side-effects -Woverlength-strings
|
|
-Wpacked -Wpacked-bitfield-compat -Wpacked-not-aligned -Wpadded
|
|
-Wparentheses -Wno-pedantic-ms-format
|
|
-Wplacement-new -Wplacement-new=</B><I>n</I>
|
|
<B>-Wpointer-arith -Wpointer-compare -Wno-pointer-to-int-cast
|
|
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls
|
|
-Wrestrict -Wno-return-local-addr
|
|
-Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar
|
|
-Wshadow=global, -Wshadow=local, -Wshadow=compatible-local
|
|
-Wshift-overflow -Wshift-overflow=</B><I>n</I>
|
|
<B>-Wshift-count-negative -Wshift-count-overflow -Wshift-negative-value
|
|
-Wsign-compare -Wsign-conversion -Wfloat-conversion
|
|
-Wno-scalar-storage-order -Wsizeof-pointer-div
|
|
-Wsizeof-pointer-memaccess -Wsizeof-array-argument
|
|
-Wstack-protector -Wstack-usage=</B><I>byte-size</I> <B>-Wstrict-aliasing
|
|
-Wstrict-aliasing=n -Wstrict-overflow -Wstrict-overflow=</B><I>n</I>
|
|
<B>-Wstringop-overflow=</B><I>n</I> <B>-Wstringop-truncation -Wsubobject-linkage
|
|
-Wsuggest-attribute=</B>[<B>pure</B>|<B>const</B>|<B>noreturn</B>|<B>format</B>|<B>malloc</B>]
|
|
<B>-Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override
|
|
-Wswitch -Wswitch-bool -Wswitch-default -Wswitch-enum
|
|
-Wswitch-unreachable -Wsync-nand
|
|
-Wsystem-headers -Wtautological-compare -Wtrampolines -Wtrigraphs
|
|
-Wtype-limits -Wundef
|
|
-Wuninitialized -Wunknown-pragmas
|
|
-Wunsuffixed-float-constants -Wunused -Wunused-function
|
|
-Wunused-label -Wunused-local-typedefs -Wunused-macros
|
|
-Wunused-parameter -Wno-unused-result
|
|
-Wunused-value -Wunused-variable
|
|
-Wunused-const-variable -Wunused-const-variable=</B><I>n</I>
|
|
<B>-Wunused-but-set-parameter -Wunused-but-set-variable
|
|
-Wuseless-cast -Wvariadic-macros -Wvector-operation-performance
|
|
-Wvla -Wvla-larger-than=</B><I>byte-size</I> <B>-Wvolatile-register-var
|
|
-Wwrite-strings
|
|
-Wzero-as-null-pointer-constant</B>
|
|
<DT id="7"><I>C and Objective-C-only Warning Options</I><DD>
|
|
|
|
|
|
<B>-Wbad-function-cast -Wmissing-declarations
|
|
-Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs
|
|
-Wold-style-declaration -Wold-style-definition
|
|
-Wstrict-prototypes -Wtraditional -Wtraditional-conversion
|
|
-Wdeclaration-after-statement -Wpointer-sign</B>
|
|
<DT id="8"><I>Debugging Options</I><DD>
|
|
|
|
|
|
<B>-g -g</B><I>level</I> <B>-gdwarf -gdwarf-</B><I>version</I>
|
|
<B>-ggdb -grecord-gcc-switches -gno-record-gcc-switches
|
|
-gstabs -gstabs+ -gstrict-dwarf -gno-strict-dwarf
|
|
-gas-loc-support -gno-as-loc-support
|
|
-gas-locview-support -gno-as-locview-support
|
|
-gcolumn-info -gno-column-info
|
|
-gstatement-frontiers -gno-statement-frontiers
|
|
-gvariable-location-views -gno-variable-location-views
|
|
-ginternal-reset-location-views -gno-internal-reset-location-views
|
|
-ginline-points -gno-inline-points
|
|
-gvms -gxcoff -gxcoff+ -gz</B>[<B>=</B><I>type</I>]
|
|
<B>-gsplit-dwarf -gdescribe-dies -gno-describe-dies
|
|
-fdebug-prefix-map=</B><I>old</I><B>=</B><I>new</I> <B>-fdebug-types-section
|
|
-fno-eliminate-unused-debug-types
|
|
-femit-struct-debug-baseonly -femit-struct-debug-reduced
|
|
-femit-struct-debug-detailed</B>[<B>=</B><I>spec-list</I>]
|
|
<B>-feliminate-unused-debug-symbols -femit-class-debug-always
|
|
-fno-merge-debug-strings -fno-dwarf2-cfi-asm
|
|
-fvar-tracking -fvar-tracking-assignments</B>
|
|
<DT id="9"><I>Optimization Options</I><DD>
|
|
|
|
|
|
<B>-faggressive-loop-optimizations
|
|
-falign-functions[=</B><I>n</I><B>[:</B><I>m</I><B>:[</B><I>n2</I><B>[:</B><I>m2</I><B>]]]]
|
|
-falign-jumps[=</B><I>n</I><B>[:</B><I>m</I><B>:[</B><I>n2</I><B>[:</B><I>m2</I><B>]]]]
|
|
-falign-labels[=</B><I>n</I><B>[:</B><I>m</I><B>:[</B><I>n2</I><B>[:</B><I>m2</I><B>]]]]
|
|
-falign-loops[=</B><I>n</I><B>[:</B><I>m</I><B>:[</B><I>n2</I><B>[:</B><I>m2</I><B>]]]]
|
|
-fassociative-math -fauto-profile -fauto-profile[=</B><I>path</I><B>]
|
|
-fauto-inc-dec -fbranch-probabilities
|
|
-fbranch-target-load-optimize -fbranch-target-load-optimize2
|
|
-fbtr-bb-exclusive -fcaller-saves
|
|
-fcombine-stack-adjustments -fconserve-stack
|
|
-fcompare-elim -fcprop-registers -fcrossjumping
|
|
-fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules
|
|
-fcx-limited-range
|
|
-fdata-sections -fdce -fdelayed-branch
|
|
-fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively
|
|
-fdevirtualize-at-ltrans -fdse
|
|
-fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects
|
|
-ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=</B><I>style</I>
|
|
<B>-fforward-propagate -ffp-contract=</B><I>style</I> <B>-ffunction-sections
|
|
-fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity
|
|
-fgcse-sm -fhoist-adjacent-loads -fif-conversion
|
|
-fif-conversion2 -findirect-inlining
|
|
-finline-functions -finline-functions-called-once -finline-limit=</B><I>n</I>
|
|
<B>-finline-small-functions -fipa-cp -fipa-cp-clone
|
|
-fipa-bit-cp -fipa-vrp -fipa-pta -fipa-profile -fipa-pure-const
|
|
-fipa-reference -fipa-reference-addressable
|
|
-fipa-stack-alignment -fipa-icf -fira-algorithm=</B><I>algorithm</I>
|
|
<B>-flive-patching=</B><I>level</I>
|
|
<B>-fira-region=</B><I>region</I> <B>-fira-hoist-pressure
|
|
-fira-loop-pressure -fno-ira-share-save-slots
|
|
-fno-ira-share-spill-slots
|
|
-fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute
|
|
-fivopts -fkeep-inline-functions -fkeep-static-functions
|
|
-fkeep-static-consts -flimit-function-alignment -flive-range-shrinkage
|
|
-floop-block -floop-interchange -floop-strip-mine
|
|
-floop-unroll-and-jam -floop-nest-optimize
|
|
-floop-parallelize-all -flra-remat -flto -flto-compression-level
|
|
-flto-partition=</B><I>alg</I> <B>-fmerge-all-constants
|
|
-fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves
|
|
-fmove-loop-invariants -fno-branch-count-reg
|
|
-fno-defer-pop -fno-fp-int-builtin-inexact -fno-function-cse
|
|
-fno-guess-branch-probability -fno-inline -fno-math-errno -fno-peephole
|
|
-fno-peephole2 -fno-printf-return-value -fno-sched-interblock
|
|
-fno-sched-spec -fno-signed-zeros
|
|
-fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss
|
|
-fomit-frame-pointer -foptimize-sibling-calls
|
|
-fpartial-inlining -fpeel-loops -fpredictive-commoning
|
|
-fprefetch-loop-arrays
|
|
-fprofile-correction
|
|
-fprofile-use -fprofile-use=</B><I>path</I> <B>-fprofile-values
|
|
-fprofile-reorder-functions
|
|
-freciprocal-math -free -frename-registers -freorder-blocks
|
|
-freorder-blocks-algorithm=</B><I>algorithm</I>
|
|
<B>-freorder-blocks-and-partition -freorder-functions
|
|
-frerun-cse-after-loop -freschedule-modulo-scheduled-loops
|
|
-frounding-math -fsave-optimization-record
|
|
-fsched2-use-superblocks -fsched-pressure
|
|
-fsched-spec-load -fsched-spec-load-dangerous
|
|
-fsched-stalled-insns-dep[=</B><I>n</I><B>] -fsched-stalled-insns[=</B><I>n</I><B>]
|
|
-fsched-group-heuristic -fsched-critical-path-heuristic
|
|
-fsched-spec-insn-heuristic -fsched-rank-heuristic
|
|
-fsched-last-insn-heuristic -fsched-dep-count-heuristic
|
|
-fschedule-fusion
|
|
-fschedule-insns -fschedule-insns2 -fsection-anchors
|
|
-fselective-scheduling -fselective-scheduling2
|
|
-fsel-sched-pipelining -fsel-sched-pipelining-outer-loops
|
|
-fsemantic-interposition -fshrink-wrap -fshrink-wrap-separate
|
|
-fsignaling-nans
|
|
-fsingle-precision-constant -fsplit-ivs-in-unroller -fsplit-loops
|
|
-fsplit-paths
|
|
-fsplit-wide-types -fssa-backprop -fssa-phiopt
|
|
-fstdarg-opt -fstore-merging -fstrict-aliasing
|
|
-fthread-jumps -ftracer -ftree-bit-ccp
|
|
-ftree-builtin-call-dce -ftree-ccp -ftree-ch
|
|
-ftree-coalesce-vars -ftree-copy-prop -ftree-dce -ftree-dominator-opts
|
|
-ftree-dse -ftree-forwprop -ftree-fre -fcode-hoisting
|
|
-ftree-loop-if-convert -ftree-loop-im
|
|
-ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns
|
|
-ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize
|
|
-ftree-loop-vectorize
|
|
-ftree-parallelize-loops=</B><I>n</I> <B>-ftree-pre -ftree-partial-pre -ftree-pta
|
|
-ftree-reassoc -ftree-scev-cprop -ftree-sink -ftree-slsr -ftree-sra
|
|
-ftree-switch-conversion -ftree-tail-merge
|
|
-ftree-ter -ftree-vectorize -ftree-vrp -funconstrained-commons
|
|
-funit-at-a-time -funroll-all-loops -funroll-loops
|
|
-funsafe-math-optimizations -funswitch-loops
|
|
-fipa-ra -fvariable-expansion-in-unroller -fvect-cost-model -fvpt
|
|
-fweb -fwhole-program -fwpa -fuse-linker-plugin
|
|
--param</B> <I>name</I><B>=</B><I>value</I>
|
|
<B>-O -O0 -O1 -O2 -O3 -Os -Ofast -Og</B>
|
|
<DT id="10"><I>Program Instrumentation Options</I><DD>
|
|
|
|
|
|
<B>-p -pg -fprofile-arcs --coverage -ftest-coverage
|
|
-fprofile-abs-path
|
|
-fprofile-dir=</B><I>path</I> <B>-fprofile-generate -fprofile-generate=</B><I>path</I>
|
|
<B>-fprofile-update=</B><I>method</I> <B>-fprofile-filter-files=</B><I>regex</I>
|
|
<B>-fprofile-exclude-files=</B><I>regex</I>
|
|
<B>-fsanitize=</B><I>style</I> <B>-fsanitize-recover -fsanitize-recover=</B><I>style</I>
|
|
<B>-fasan-shadow-offset=</B><I>number</I> <B>-fsanitize-sections=</B><I>s1</I><B>,</B><I>s2</I><B>,...
|
|
-fsanitize-undefined-trap-on-error -fbounds-check
|
|
-fcf-protection=</B>[<B>full</B>|<B>branch</B>|<B>return</B>|<B>none</B>|<B>check</B>]
|
|
<B>-fstack-protector -fstack-protector-all -fstack-protector-strong
|
|
-fstack-protector-explicit -fstack-check
|
|
-fstack-limit-register=</B><I>reg</I> <B>-fstack-limit-symbol=</B><I>sym</I>
|
|
<B>-fno-stack-limit -fsplit-stack
|
|
-fvtable-verify=</B>[<B>std</B>|<B>preinit</B>|<B>none</B>]
|
|
<B>-fvtv-counts -fvtv-debug
|
|
-finstrument-functions
|
|
-finstrument-functions-exclude-function-list=</B><I>sym</I><B>,</B><I>sym</I><B>,...
|
|
-finstrument-functions-exclude-file-list=</B><I>file</I><B>,</B><I>file</I><B>,...</B>
|
|
<DT id="11"><I>Preprocessor Options</I><DD>
|
|
|
|
|
|
<B>-A</B><I>question</I><B>=</B><I>answer</I>
|
|
<B>-A-</B><I>question</I>[<B>=</B><I>answer</I>]
|
|
<B>-C -CC -D</B><I>macro</I>[<B>=</B><I>defn</I>]
|
|
<B>-dD -dI -dM -dN -dU
|
|
-fdebug-cpp -fdirectives-only -fdollars-in-identifiers
|
|
-fexec-charset=</B><I>charset</I> <B>-fextended-identifiers
|
|
-finput-charset=</B><I>charset</I> <B>-fmacro-prefix-map=</B><I>old</I><B>=</B><I>new</I>
|
|
<B>-fno-canonical-system-headers -fpch-deps -fpch-preprocess
|
|
-fpreprocessed -ftabstop=</B><I>width</I> <B>-ftrack-macro-expansion
|
|
-fwide-exec-charset=</B><I>charset</I> <B>-fworking-directory
|
|
-H -imacros</B> <I>file</I> <B>-include</B> <I>file</I>
|
|
<B>-M -MD -MF -MG -MM -MMD -MP -MQ -MT
|
|
-no-integrated-cpp -P -pthread -remap
|
|
-traditional -traditional-cpp -trigraphs
|
|
-U</B><I>macro</I> <B>-undef
|
|
-Wp,</B><I>option</I> <B>-Xpreprocessor</B> <I>option</I>
|
|
<DT id="12"><I>Assembler Options</I><DD>
|
|
|
|
|
|
<B>-Wa,</B><I>option</I> <B>-Xassembler</B> <I>option</I>
|
|
<DT id="13"><I>Linker Options</I><DD>
|
|
|
|
|
|
<I>object-file-name</I> <B>-fuse-ld=</B><I>linker</I> <B>-l</B><I>library</I>
|
|
<B>-nostartfiles -nodefaultlibs -nolibc -nostdlib
|
|
-e</B> <I>entry</I> <B>--entry=</B><I>entry</I>
|
|
<B>-pie -pthread -r -rdynamic
|
|
-s -static -static-pie -static-libgcc -static-libstdc++
|
|
-static-libasan -static-libtsan -static-liblsan -static-libubsan
|
|
-shared -shared-libgcc -symbolic
|
|
-T</B> <I>script</I> <B>-Wl,</B><I>option</I> <B>-Xlinker</B> <I>option</I>
|
|
<B>-u</B> <I>symbol</I> <B>-z</B> <I>keyword</I>
|
|
<DT id="14"><I>Directory Options</I><DD>
|
|
|
|
|
|
<B>-B</B><I>prefix</I> <B>-I</B><I>dir</I> <B>-I-
|
|
-idirafter</B> <I>dir</I>
|
|
<B>-imacros</B> <I>file</I> <B>-imultilib</B> <I>dir</I>
|
|
<B>-iplugindir=</B><I>dir</I> <B>-iprefix</B> <I>file</I>
|
|
<B>-iquote</B> <I>dir</I> <B>-isysroot</B> <I>dir</I> <B>-isystem</B> <I>dir</I>
|
|
<B>-iwithprefix</B> <I>dir</I> <B>-iwithprefixbefore</B> <I>dir</I>
|
|
<B>-L</B><I>dir</I> <B>-no-canonical-prefixes --no-sysroot-suffix
|
|
-nostdinc -nostdinc++ --sysroot=</B><I>dir</I>
|
|
<DT id="15"><I>Code Generation Options</I><DD>
|
|
|
|
|
|
<B>-fcall-saved-</B><I>reg</I> <B>-fcall-used-</B><I>reg</I>
|
|
<B>-ffixed-</B><I>reg</I> <B>-fexceptions
|
|
-fnon-call-exceptions -fdelete-dead-exceptions -funwind-tables
|
|
-fasynchronous-unwind-tables
|
|
-fno-gnu-unique
|
|
-finhibit-size-directive -fno-common -fno-ident
|
|
-fpcc-struct-return -fpic -fPIC -fpie -fPIE -fno-plt
|
|
-fno-jump-tables
|
|
-frecord-gcc-switches
|
|
-freg-struct-return -fshort-enums -fshort-wchar
|
|
-fverbose-asm -fpack-struct[=</B><I>n</I><B>]
|
|
-fleading-underscore -ftls-model=</B><I>model</I>
|
|
<B>-fstack-reuse=</B><I>reuse_level</I>
|
|
<B>-ftrampolines -ftrapv -fwrapv
|
|
-fvisibility=</B>[<B>default</B>|<B>internal</B>|<B>hidden</B>|<B>protected</B>]
|
|
<B>-fstrict-volatile-bitfields -fsync-libcalls</B>
|
|
<DT id="16"><I>Developer Options</I><DD>
|
|
|
|
|
|
<B>-d</B><I>letters</I> <B>-dumpspecs -dumpmachine -dumpversion
|
|
-dumpfullversion -fchecking -fchecking=</B><I>n</I> <B>-fdbg-cnt-list
|
|
-fdbg-cnt=</B><I>counter-value-list</I>
|
|
<B>-fdisable-ipa-</B><I>pass_name</I>
|
|
<B>-fdisable-rtl-</B><I>pass_name</I>
|
|
<B>-fdisable-rtl-</B><I>pass-name</I><B>=</B><I>range-list</I>
|
|
<B>-fdisable-tree-</B><I>pass_name</I>
|
|
<B>-fdisable-tree-</B><I>pass-name</I><B>=</B><I>range-list</I>
|
|
<B>-fdump-debug -fdump-earlydebug
|
|
-fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links
|
|
-fdump-final-insns</B>[<B>=</B><I>file</I>]
|
|
<B>-fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline
|
|
-fdump-lang-all
|
|
-fdump-lang-</B><I>switch</I>
|
|
<B>-fdump-lang-</B><I>switch</I><B>-</B><I>options</I>
|
|
<B>-fdump-lang-</B><I>switch</I><B>-</B><I>options</I><B>=</B><I>filename</I>
|
|
<B>-fdump-passes
|
|
-fdump-rtl-</B><I>pass</I> <B>-fdump-rtl-</B><I>pass</I><B>=</B><I>filename</I>
|
|
<B>-fdump-statistics
|
|
-fdump-tree-all
|
|
-fdump-tree-</B><I>switch</I>
|
|
<B>-fdump-tree-</B><I>switch</I><B>-</B><I>options</I>
|
|
<B>-fdump-tree-</B><I>switch</I><B>-</B><I>options</I><B>=</B><I>filename</I>
|
|
<B>-fcompare-debug</B>[<B>=</B><I>opts</I>] <B>-fcompare-debug-second
|
|
-fenable-</B><I>kind</I><B>-</B><I>pass</I>
|
|
<B>-fenable-</B><I>kind</I><B>-</B><I>pass</I><B>=</B><I>range-list</I>
|
|
<B>-fira-verbose=</B><I>n</I>
|
|
<B>-flto-report -flto-report-wpa -fmem-report-wpa
|
|
-fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report
|
|
-fopt-info -fopt-info-</B><I>options</I>[<B>=</B><I>file</I>]
|
|
<B>-fprofile-report
|
|
-frandom-seed=</B><I>string</I> <B>-fsched-verbose=</B><I>n</I>
|
|
<B>-fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose
|
|
-fstats -fstack-usage -ftime-report -ftime-report-details
|
|
-fvar-tracking-assignments-toggle -gtoggle
|
|
-print-file-name=</B><I>library</I> <B>-print-libgcc-file-name
|
|
-print-multi-directory -print-multi-lib -print-multi-os-directory
|
|
-print-prog-name=</B><I>program</I> <B>-print-search-dirs -Q
|
|
-print-sysroot -print-sysroot-headers-suffix
|
|
-save-temps -save-temps=cwd -save-temps=obj -time</B>[<B>=</B><I>file</I>]
|
|
<DT id="17"><I>Machine-Dependent Options</I><DD>
|
|
|
|
|
|
<I>AArch64 Options</I>
|
|
<B>-mabi=</B><I>name</I> <B>-mbig-endian -mlittle-endian
|
|
-mgeneral-regs-only
|
|
-mcmodel=tiny -mcmodel=small -mcmodel=large
|
|
-mstrict-align -mno-strict-align
|
|
-momit-leaf-frame-pointer
|
|
-mtls-dialect=desc -mtls-dialect=traditional
|
|
-mtls-size=</B><I>size</I>
|
|
<B>-mfix-cortex-a53-835769 -mfix-cortex-a53-843419
|
|
-mlow-precision-recip-sqrt -mlow-precision-sqrt -mlow-precision-div
|
|
-mpc-relative-literal-loads
|
|
-msign-return-address=</B><I>scope</I>
|
|
<B>-mbranch-protection=</B><I>none</I><B>|</B><I>standard</I><B>|</B><I>pac-ret</I><B>[+</B><I>leaf</I><B>]|</B><I>bti</I>
|
|
<B>-mharden-sls=</B><I>opts</I>
|
|
<B>-march=</B><I>name</I> <B>-mcpu=</B><I>name</I> <B>-mtune=</B><I>name</I>
|
|
<B>-moverride=</B><I>string</I> <B>-mverbose-cost-dump
|
|
-mstack-protector-guard=</B><I>guard</I> <B>-mstack-protector-guard-reg=</B><I>sysreg</I>
|
|
<B>-mstack-protector-guard-offset=</B><I>offset</I> <B>-mtrack-speculation
|
|
-moutline-atomics</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Adapteva Epiphany Options</I>
|
|
<B>-mhalf-reg-file -mprefer-short-insn-regs
|
|
-mbranch-cost=</B><I>num</I> <B>-mcmove -mnops=</B><I>num</I> <B>-msoft-cmpsf
|
|
-msplit-lohi -mpost-inc -mpost-modify -mstack-offset=</B><I>num</I>
|
|
<B>-mround-nearest -mlong-calls -mshort-calls -msmall16
|
|
-mfp-mode=</B><I>mode</I> <B>-mvect-double -max-vect-align=</B><I>num</I>
|
|
<B>-msplit-vecmove-early -m1reg-</B><I>reg</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>AMD GCN</I></FONT><I> Options</I>
|
|
<B>-march=</B><I>gpu</I> <B>-mtune=</B><I>gpu</I> <B>-mstack-size=</B><I>bytes</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>ARC</I></FONT><I> Options</I>
|
|
<B>-mbarrel-shifter -mjli-always
|
|
-mcpu=</B><I>cpu</I> <B>-mA6 -mARC600 -mA7 -mARC700
|
|
-mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr
|
|
-mea -mno-mpy -mmul32x16 -mmul64 -matomic
|
|
-mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap
|
|
-mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape
|
|
-mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof
|
|
-mlong-calls -mmedium-calls -msdata -mirq-ctrl-saved
|
|
-mrgf-banked-regs -mlpc-width=</B><I>width</I> <B>-G</B> <I>num</I>
|
|
<B>-mvolatile-cache -mtp-regno=</B><I>regno</I>
|
|
<B>-malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc
|
|
-mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi
|
|
-mexpand-adddi -mindexed-loads -mlra -mlra-priority-none
|
|
-mlra-priority-compact mlra-priority-noncompact -mmillicode
|
|
-mmixed-code -mq-class -mRcq -mRcw -msize-level=</B><I>level</I>
|
|
<B>-mtune=</B><I>cpu</I> <B>-mmultcost=</B><I>num</I> <B>-mcode-density-frame
|
|
-munalign-prob-threshold=</B><I>probability</I> <B>-mmpy-option=</B><I>multo</I>
|
|
<B>-mdiv-rem -mcode-density -mll64 -mfpu=</B><I>fpu</I> <B>-mrf16 -mbranch-index</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>ARM</I></FONT><I> Options</I>
|
|
<B>-mapcs-frame -mno-apcs-frame
|
|
-mabi=</B><I>name</I>
|
|
<B>-mapcs-stack-check -mno-apcs-stack-check
|
|
-mapcs-reentrant -mno-apcs-reentrant
|
|
-mgeneral-regs-only
|
|
-msched-prolog -mno-sched-prolog
|
|
-mlittle-endian -mbig-endian
|
|
-mbe8 -mbe32
|
|
-mfloat-abi=</B><I>name</I>
|
|
<B>-mfp16-format=</B><I>name</I>
|
|
<B>-mthumb-interwork -mno-thumb-interwork
|
|
-mcpu=</B><I>name</I> <B>-march=</B><I>name</I> <B>-mfpu=</B><I>name</I>
|
|
<B>-mtune=</B><I>name</I> <B>-mprint-tune-info
|
|
-mstructure-size-boundary=</B><I>n</I>
|
|
<B>-mabort-on-noreturn
|
|
-mlong-calls -mno-long-calls
|
|
-msingle-pic-base -mno-single-pic-base
|
|
-mpic-register=</B><I>reg</I>
|
|
<B>-mnop-fun-dllimport
|
|
-mpoke-function-name
|
|
-mthumb -marm -mflip-thumb
|
|
-mtpcs-frame -mtpcs-leaf-frame
|
|
-mcaller-super-interworking -mcallee-super-interworking
|
|
-mtp=</B><I>name</I> <B>-mtls-dialect=</B><I>dialect</I>
|
|
<B>-mword-relocations
|
|
-mfix-cortex-m3-ldrd
|
|
-munaligned-access
|
|
-mneon-for-64bits
|
|
-mslow-flash-data
|
|
-masm-syntax-unified
|
|
-mrestrict-it
|
|
-mverbose-cost-dump
|
|
-mpure-code
|
|
-mcmse</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>AVR</I></FONT><I> Options</I>
|
|
<B>-mmcu=</B><I>mcu</I> <B>-mabsdata -maccumulate-args
|
|
-mbranch-cost=</B><I>cost</I>
|
|
<B>-mcall-prologues -mgas-isr-prologues -mint8
|
|
-mn_flash=</B><I>size</I> <B>-mno-interrupts
|
|
-mmain-is-OS_task -mrelax -mrmw -mstrict-X -mtiny-stack
|
|
-mfract-convert-truncate
|
|
-mshort-calls -nodevicelib -nodevicespecs
|
|
-Waddr-space-convert -Wmisspelled-isr</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Blackfin Options</I>
|
|
<B>-mcpu=</B><I>cpu</I>[<B>-</B><I>sirevision</I>]
|
|
<B>-msim -momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer
|
|
-mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly
|
|
-mlow-64k -mno-low64k -mstack-check-l1 -mid-shared-library
|
|
-mno-id-shared-library -mshared-library-id=</B><I>n</I>
|
|
<B>-mleaf-id-shared-library -mno-leaf-id-shared-library
|
|
-msep-data -mno-sep-data -mlong-calls -mno-long-calls
|
|
-mfast-fp -minline-plt -mmulticore -mcorea -mcoreb -msdram
|
|
-micplb</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>C6X Options</I>
|
|
<B>-mbig-endian -mlittle-endian -march=</B><I>cpu</I>
|
|
<B>-msim -msdata=</B><I>sdata-type</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>CRIS</I></FONT><I> Options</I>
|
|
<B>-mcpu=</B><I>cpu</I> <B>-march=</B><I>cpu</I> <B>-mtune=</B><I>cpu</I>
|
|
<B>-mmax-stack-frame=</B><I>n</I> <B>-melinux-stacksize=</B><I>n</I>
|
|
<B>-metrax4 -metrax100 -mpdebug -mcc-init -mno-side-effects
|
|
-mstack-align -mdata-align -mconst-align
|
|
-m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt
|
|
-melf -maout -melinux -mlinux -sim -sim2
|
|
-mmul-bug-workaround -mno-mul-bug-workaround</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>CR16</I></FONT><I> Options</I>
|
|
<B>-mmac
|
|
-mcr16cplus -mcr16c
|
|
-msim -mint32 -mbit-ops
|
|
-mdata-model=</B><I>model</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>C-SKY Options</I>
|
|
<B>-march=</B><I>arch</I> <B>-mcpu=</B><I>cpu</I>
|
|
<B>-mbig-endian -EB -mlittle-endian -EL
|
|
-mhard-float -msoft-float -mfpu=</B><I>fpu</I> <B>-mdouble-float -mfdivdu
|
|
-melrw -mistack -mmp -mcp -mcache -msecurity -mtrust
|
|
-mdsp -medsp -mvdsp
|
|
-mdiv -msmart -mhigh-registers -manchor
|
|
-mpushpop -mmultiple-stld -mconstpool -mstack-size -mccrt
|
|
-mbranch-cost=</B><I>n</I> <B>-mcse-cc -msched-prolog</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Darwin Options</I>
|
|
<B>-all_load -allowable_client -arch -arch_errors_fatal
|
|
-arch_only -bind_at_load -bundle -bundle_loader
|
|
-client_name -compatibility_version -current_version
|
|
-dead_strip
|
|
-dependency-file -dylib_file -dylinker_install_name
|
|
-dynamic -dynamiclib -exported_symbols_list
|
|
-filelist -flat_namespace -force_cpusubtype_ALL
|
|
-force_flat_namespace -headerpad_max_install_names
|
|
-iframework
|
|
-image_base -init -install_name -keep_private_externs
|
|
-multi_module -multiply_defined -multiply_defined_unused
|
|
-noall_load -no_dead_strip_inits_and_terms
|
|
-nofixprebinding -nomultidefs -noprebind -noseglinkedit
|
|
-pagezero_size -prebind -prebind_all_twolevel_modules
|
|
-private_bundle -read_only_relocs -sectalign
|
|
-sectobjectsymbols -whyload -seg1addr
|
|
-sectcreate -sectobjectsymbols -sectorder
|
|
-segaddr -segs_read_only_addr -segs_read_write_addr
|
|
-seg_addr_table -seg_addr_table_filename -seglinkedit
|
|
-segprot -segs_read_only_addr -segs_read_write_addr
|
|
-single_module -static -sub_library -sub_umbrella
|
|
-twolevel_namespace -umbrella -undefined
|
|
-unexported_symbols_list -weak_reference_mismatches
|
|
-whatsloaded -F -gused -gfull -mmacosx-version-min=</B><I>version</I>
|
|
<B>-mkernel -mone-byte-bool</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>DEC</I></FONT><I> Alpha Options</I>
|
|
<B>-mno-fp-regs -msoft-float
|
|
-mieee -mieee-with-inexact -mieee-conformant
|
|
-mfp-trap-mode=</B><I>mode</I> <B>-mfp-rounding-mode=</B><I>mode</I>
|
|
<B>-mtrap-precision=</B><I>mode</I> <B>-mbuild-constants
|
|
-mcpu=</B><I>cpu-type</I> <B>-mtune=</B><I>cpu-type</I>
|
|
<B>-mbwx -mmax -mfix -mcix
|
|
-mfloat-vax -mfloat-ieee
|
|
-mexplicit-relocs -msmall-data -mlarge-data
|
|
-msmall-text -mlarge-text
|
|
-mmemory-latency=</B><I>time</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>FR30</I></FONT><I> Options</I>
|
|
<B>-msmall-model -mno-lsim</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>FT32</I></FONT><I> Options</I>
|
|
<B>-msim -mlra -mnodiv -mft32b -mcompress -mnopm</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>FRV</I></FONT><I> Options</I>
|
|
<B>-mgpr-32 -mgpr-64 -mfpr-32 -mfpr-64
|
|
-mhard-float -msoft-float
|
|
-malloc-cc -mfixed-cc -mdword -mno-dword
|
|
-mdouble -mno-double
|
|
-mmedia -mno-media -mmuladd -mno-muladd
|
|
-mfdpic -minline-plt -mgprel-ro -multilib-library-pic
|
|
-mlinked-fp -mlong-calls -malign-labels
|
|
-mlibrary-pic -macc-4 -macc-8
|
|
-mpack -mno-pack -mno-eflags -mcond-move -mno-cond-move
|
|
-moptimize-membar -mno-optimize-membar
|
|
-mscc -mno-scc -mcond-exec -mno-cond-exec
|
|
-mvliw-branch -mno-vliw-branch
|
|
-mmulti-cond-exec -mno-multi-cond-exec -mnested-cond-exec
|
|
-mno-nested-cond-exec -mtomcat-stats
|
|
-mTLS -mtls
|
|
-mcpu=</B><I>cpu</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>GNU/Linux Options</I>
|
|
<B>-mglibc -muclibc -mmusl -mbionic -mandroid
|
|
-tno-android-cc -tno-android-ld</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>H8/300 Options</I>
|
|
<B>-mrelax -mh -ms -mn -mexr -mno-exr -mint32 -malign-300</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>HPPA</I></FONT><I> Options</I>
|
|
<B>-march=</B><I>architecture-type</I>
|
|
<B>-mcaller-copies -mdisable-fpregs -mdisable-indexing
|
|
-mfast-indirect-calls -mgas -mgnu-ld -mhp-ld
|
|
-mfixed-range=</B><I>register-range</I>
|
|
<B>-mjump-in-delay -mlinker-opt -mlong-calls
|
|
-mlong-load-store -mno-disable-fpregs
|
|
-mno-disable-indexing -mno-fast-indirect-calls -mno-gas
|
|
-mno-jump-in-delay -mno-long-load-store
|
|
-mno-portable-runtime -mno-soft-float
|
|
-mno-space-regs -msoft-float -mpa-risc-1-0
|
|
-mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime
|
|
-mschedule=</B><I>cpu-type</I> <B>-mspace-regs -msio -mwsio
|
|
-munix=</B><I>unix-std</I> <B>-nolibdld -static -threads</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>IA-64</I></FONT><I> Options</I>
|
|
<B>-mbig-endian -mlittle-endian -mgnu-as -mgnu-ld -mno-pic
|
|
-mvolatile-asm-stop -mregister-names -msdata -mno-sdata
|
|
-mconstant-gp -mauto-pic -mfused-madd
|
|
-minline-float-divide-min-latency
|
|
-minline-float-divide-max-throughput
|
|
-mno-inline-float-divide
|
|
-minline-int-divide-min-latency
|
|
-minline-int-divide-max-throughput
|
|
-mno-inline-int-divide
|
|
-minline-sqrt-min-latency -minline-sqrt-max-throughput
|
|
-mno-inline-sqrt
|
|
-mdwarf2-asm -mearly-stop-bits
|
|
-mfixed-range=</B><I>register-range</I> <B>-mtls-size=</B><I>tls-size</I>
|
|
<B>-mtune=</B><I>cpu-type</I> <B>-milp32 -mlp64
|
|
-msched-br-data-spec -msched-ar-data-spec -msched-control-spec
|
|
-msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec
|
|
-msched-spec-ldc -msched-spec-control-ldc
|
|
-msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns
|
|
-msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path
|
|
-msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost
|
|
-msched-max-memory-insns-hard-limit -msched-max-memory-insns=</B><I>max-insns</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>LM32</I></FONT><I> Options</I>
|
|
<B>-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled
|
|
-msign-extend-enabled -muser-enabled</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>M32R/D Options</I>
|
|
<B>-m32r2 -m32rx -m32r
|
|
-mdebug
|
|
-malign-loops -mno-align-loops
|
|
-missue-rate=</B><I>number</I>
|
|
<B>-mbranch-cost=</B><I>number</I>
|
|
<B>-mmodel=</B><I>code-size-model-type</I>
|
|
<B>-msdata=</B><I>sdata-type</I>
|
|
<B>-mno-flush-func -mflush-func=</B><I>name</I>
|
|
<B>-mno-flush-trap -mflush-trap=</B><I>number</I>
|
|
<B>-G</B> <I>num</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>M32C Options</I>
|
|
<B>-mcpu=</B><I>cpu</I> <B>-msim -memregs=</B><I>number</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>M680x0 Options</I>
|
|
<B>-march=</B><I>arch</I> <B>-mcpu=</B><I>cpu</I> <B>-mtune=</B><I>tune</I>
|
|
<B>-m68000 -m68020 -m68020-40 -m68020-60 -m68030 -m68040
|
|
-m68060 -mcpu32 -m5200 -m5206e -m528x -m5307 -m5407
|
|
-mcfv4e -mbitfield -mno-bitfield -mc68000 -mc68020
|
|
-mnobitfield -mrtd -mno-rtd -mdiv -mno-div -mshort
|
|
-mno-short -mhard-float -m68881 -msoft-float -mpcrel
|
|
-malign-int -mstrict-align -msep-data -mno-sep-data
|
|
-mshared-library-id=n -mid-shared-library -mno-id-shared-library
|
|
-mxgot -mno-xgot -mlong-jump-table-offsets</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>MCore Options</I>
|
|
<B>-mhardlit -mno-hardlit -mdiv -mno-div -mrelax-immediates
|
|
-mno-relax-immediates -mwide-bitfields -mno-wide-bitfields
|
|
-m4byte-functions -mno-4byte-functions -mcallgraph-data
|
|
-mno-callgraph-data -mslow-bytes -mno-slow-bytes -mno-lsim
|
|
-mlittle-endian -mbig-endian -m210 -m340 -mstack-increment</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>MeP Options</I>
|
|
<B>-mabsdiff -mall-opts -maverage -mbased=</B><I>n</I> <B>-mbitops
|
|
-mc=</B><I>n</I> <B>-mclip -mconfig=</B><I>name</I> <B>-mcop -mcop32 -mcop64 -mivc2
|
|
-mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax
|
|
-mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf
|
|
-mtiny=</B><I>n</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>MicroBlaze Options</I>
|
|
<B>-msoft-float -mhard-float -msmall-divides -mcpu=</B><I>cpu</I>
|
|
<B>-mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift
|
|
-mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss
|
|
-mxl-multiply-high -mxl-float-convert -mxl-float-sqrt
|
|
-mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-</B><I>app-model</I>
|
|
<B>-mpic-data-is-text-relative</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>MIPS</I></FONT><I> Options</I>
|
|
<B>-EL -EB -march=</B><I>arch</I> <B>-mtune=</B><I>arch</I>
|
|
<B>-mips1 -mips2 -mips3 -mips4 -mips32 -mips32r2 -mips32r3 -mips32r5
|
|
-mips32r6 -mips64 -mips64r2 -mips64r3 -mips64r5 -mips64r6
|
|
-mips16 -mno-mips16 -mflip-mips16
|
|
-minterlink-compressed -mno-interlink-compressed
|
|
-minterlink-mips16 -mno-interlink-mips16
|
|
-mabi=</B><I>abi</I> <B>-mabicalls -mno-abicalls
|
|
-mshared -mno-shared -mplt -mno-plt -mxgot -mno-xgot
|
|
-mgp32 -mgp64 -mfp32 -mfpxx -mfp64 -mhard-float -msoft-float
|
|
-mno-float -msingle-float -mdouble-float
|
|
-modd-spreg -mno-odd-spreg
|
|
-mabs=</B><I>mode</I> <B>-mnan=</B><I>encoding</I>
|
|
<B>-mdsp -mno-dsp -mdspr2 -mno-dspr2
|
|
-mmcu -mmno-mcu
|
|
-meva -mno-eva
|
|
-mvirt -mno-virt
|
|
-mxpa -mno-xpa
|
|
-mcrc -mno-crc
|
|
-mginv -mno-ginv
|
|
-mmicromips -mno-micromips
|
|
-mmsa -mno-msa
|
|
-mloongson-mmi -mno-loongson-mmi
|
|
-mloongson-ext -mno-loongson-ext
|
|
-mloongson-ext2 -mno-loongson-ext2
|
|
-mfpu=</B><I>fpu-type</I>
|
|
<B>-msmartmips -mno-smartmips
|
|
-mpaired-single -mno-paired-single -mdmx -mno-mdmx
|
|
-mips3d -mno-mips3d -mmt -mno-mt -mllsc -mno-llsc
|
|
-mlong64 -mlong32 -msym32 -mno-sym32
|
|
-G</B><I>num</I> <B>-mlocal-sdata -mno-local-sdata
|
|
-mextern-sdata -mno-extern-sdata -mgpopt -mno-gopt
|
|
-membedded-data -mno-embedded-data
|
|
-muninit-const-in-rodata -mno-uninit-const-in-rodata
|
|
-mcode-readable=</B><I>setting</I>
|
|
<B>-msplit-addresses -mno-split-addresses
|
|
-mexplicit-relocs -mno-explicit-relocs
|
|
-mcheck-zero-division -mno-check-zero-division
|
|
-mdivide-traps -mdivide-breaks
|
|
-mload-store-pairs -mno-load-store-pairs
|
|
-mmemcpy -mno-memcpy -mlong-calls -mno-long-calls
|
|
-mmad -mno-mad -mimadd -mno-imadd -mfused-madd -mno-fused-madd -nocpp
|
|
-mfix-24k -mno-fix-24k
|
|
-mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400
|
|
-mfix-r5900 -mno-fix-r5900
|
|
-mfix-r10000 -mno-fix-r10000 -mfix-rm7000 -mno-fix-rm7000
|
|
-mfix-vr4120 -mno-fix-vr4120
|
|
-mfix-vr4130 -mno-fix-vr4130 -mfix-sb1 -mno-fix-sb1
|
|
-mflush-func=</B><I>func</I> <B>-mno-flush-func
|
|
-mbranch-cost=</B><I>num</I> <B>-mbranch-likely -mno-branch-likely
|
|
-mcompact-branches=</B><I>policy</I>
|
|
<B>-mfp-exceptions -mno-fp-exceptions
|
|
-mvr4130-align -mno-vr4130-align -msynci -mno-synci
|
|
-mlxc1-sxc1 -mno-lxc1-sxc1 -mmadd4 -mno-madd4
|
|
-mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address
|
|
-mframe-header-opt -mno-frame-header-opt</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>MMIX</I></FONT><I> Options</I>
|
|
<B>-mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon -mabi=gnu
|
|
-mabi=mmixware -mzero-extend -mknuthdiv -mtoplevel-symbols
|
|
-melf -mbranch-predict -mno-branch-predict -mbase-addresses
|
|
-mno-base-addresses -msingle-exit -mno-single-exit</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>MN10300</I></FONT><I> Options</I>
|
|
<B>-mmult-bug -mno-mult-bug
|
|
-mno-am33 -mam33 -mam33-2 -mam34
|
|
-mtune=</B><I>cpu-type</I>
|
|
<B>-mreturn-pointer-on-d0
|
|
-mno-crt0 -mrelax -mliw -msetlb</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Moxie Options</I>
|
|
<B>-meb -mel -mmul.x -mno-crt0</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>MSP430</I></FONT><I> Options</I>
|
|
<B>-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax
|
|
-mwarn-mcu
|
|
-mcode-region= -mdata-region=
|
|
-msilicon-errata= -msilicon-errata-warn=
|
|
-mhwmult= -minrt</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>NDS32</I></FONT><I> Options</I>
|
|
<B>-mbig-endian -mlittle-endian
|
|
-mreduced-regs -mfull-regs
|
|
-mcmov -mno-cmov
|
|
-mext-perf -mno-ext-perf
|
|
-mext-perf2 -mno-ext-perf2
|
|
-mext-string -mno-ext-string
|
|
-mv3push -mno-v3push
|
|
-m16bit -mno-16bit
|
|
-misr-vector-size=</B><I>num</I>
|
|
<B>-mcache-block-size=</B><I>num</I>
|
|
<B>-march=</B><I>arch</I>
|
|
<B>-mcmodel=</B><I>code-model</I>
|
|
<B>-mctor-dtor -mrelax</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Nios </I><FONT SIZE="-1"><I>II</I></FONT><I> Options</I>
|
|
<B>-G</B> <I>num</I> <B>-mgpopt=</B><I>option</I> <B>-mgpopt -mno-gpopt
|
|
-mgprel-sec=</B><I>regexp</I> <B>-mr0rel-sec=</B><I>regexp</I>
|
|
<B>-mel -meb
|
|
-mno-bypass-cache -mbypass-cache
|
|
-mno-cache-volatile -mcache-volatile
|
|
-mno-fast-sw-div -mfast-sw-div
|
|
-mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div
|
|
-mcustom-</B><I>insn</I><B>=</B><I>N</I> <B>-mno-custom-</B><I>insn</I>
|
|
<B>-mcustom-fpu-cfg=</B><I>name</I>
|
|
<B>-mhal -msmallc -msys-crt0=</B><I>name</I> <B>-msys-lib=</B><I>name</I>
|
|
<B>-march=</B><I>arch</I> <B>-mbmx -mno-bmx -mcdx -mno-cdx</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Nvidia </I><FONT SIZE="-1"><I>PTX</I></FONT><I> Options</I>
|
|
<B>-m32 -m64 -mmainkernel -moptimize</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>OpenRISC Options</I>
|
|
<B>-mboard=</B><I>name</I> <B>-mnewlib -mhard-mul -mhard-div
|
|
-msoft-mul -msoft-div
|
|
-mcmov -mror -msext -msfimm -mshftimm</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>PDP-11</I></FONT><I> Options</I>
|
|
<B>-mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45 -m10
|
|
-mint32 -mno-int16 -mint16 -mno-int32
|
|
-msplit -munix-asm -mdec-asm -mgnu-asm -mlra</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>picoChip Options</I>
|
|
<B>-mae=</B><I>ae_type</I> <B>-mvliw-lookahead=</B><I>N</I>
|
|
<B>-msymbol-as-address -mno-inefficient-warnings</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>PowerPC Options</I>
|
|
See <FONT SIZE="-1">RS/6000</FONT> and PowerPC Options.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>RISC-V Options</I>
|
|
<B>-mbranch-cost=</B><I>N-instruction</I>
|
|
<B>-mplt -mno-plt
|
|
-mabi=</B><I>ABI-string</I>
|
|
<B>-mfdiv -mno-fdiv
|
|
-mdiv -mno-div
|
|
-march=</B><I>ISA-string</I>
|
|
<B>-mtune=</B><I>processor-string</I>
|
|
<B>-mpreferred-stack-boundary=</B><I>num</I>
|
|
<B>-msmall-data-limit=</B><I>N-bytes</I>
|
|
<B>-msave-restore -mno-save-restore
|
|
-mstrict-align -mno-strict-align
|
|
-mcmodel=medlow -mcmodel=medany
|
|
-mexplicit-relocs -mno-explicit-relocs
|
|
-mrelax -mno-relax
|
|
-mriscv-attribute -mmo-riscv-attribute</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>RL78</I></FONT><I> Options</I>
|
|
<B>-msim -mmul=none -mmul=g13 -mmul=g14 -mallregs
|
|
-mcpu=g10 -mcpu=g13 -mcpu=g14 -mg10 -mg13 -mg14
|
|
-m64bit-doubles -m32bit-doubles -msave-mduc-in-interrupts</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>RS/6000</I></FONT><I> and PowerPC Options</I>
|
|
<B>-mcpu=</B><I>cpu-type</I>
|
|
<B>-mtune=</B><I>cpu-type</I>
|
|
<B>-mcmodel=</B><I>code-model</I>
|
|
<B>-mpowerpc64
|
|
-maltivec -mno-altivec
|
|
-mpowerpc-gpopt -mno-powerpc-gpopt
|
|
-mpowerpc-gfxopt -mno-powerpc-gfxopt
|
|
-mmfcrf -mno-mfcrf -mpopcntb -mno-popcntb -mpopcntd -mno-popcntd
|
|
-mfprnd -mno-fprnd
|
|
-mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp
|
|
-mfull-toc -mminimal-toc -mno-fp-in-toc -mno-sum-in-toc
|
|
-m64 -m32 -mxl-compat -mno-xl-compat -mpe
|
|
-malign-power -malign-natural
|
|
-msoft-float -mhard-float -mmultiple -mno-multiple
|
|
-mupdate -mno-update
|
|
-mavoid-indexed-addresses -mno-avoid-indexed-addresses
|
|
-mfused-madd -mno-fused-madd -mbit-align -mno-bit-align
|
|
-mstrict-align -mno-strict-align -mrelocatable
|
|
-mno-relocatable -mrelocatable-lib -mno-relocatable-lib
|
|
-mtoc -mno-toc -mlittle -mlittle-endian -mbig -mbig-endian
|
|
-mdynamic-no-pic -mswdiv -msingle-pic-base
|
|
-mprioritize-restricted-insns=</B><I>priority</I>
|
|
<B>-msched-costly-dep=</B><I>dependence_type</I>
|
|
<B>-minsert-sched-nops=</B><I>scheme</I>
|
|
<B>-mcall-aixdesc -mcall-eabi -mcall-freebsd
|
|
-mcall-linux -mcall-netbsd -mcall-openbsd
|
|
-mcall-sysv -mcall-sysv-eabi -mcall-sysv-noeabi
|
|
-mtraceback=</B><I>traceback_type</I>
|
|
<B>-maix-struct-return -msvr4-struct-return
|
|
-mabi=</B><I>abi-type</I> <B>-msecure-plt -mbss-plt
|
|
-mlongcall -mno-longcall -mpltseq -mno-pltseq
|
|
-mblock-move-inline-limit=</B><I>num</I>
|
|
<B>-mblock-compare-inline-limit=</B><I>num</I>
|
|
<B>-mblock-compare-inline-loop-limit=</B><I>num</I>
|
|
<B>-mstring-compare-inline-limit=</B><I>num</I>
|
|
<B>-misel -mno-isel
|
|
-mvrsave -mno-vrsave
|
|
-mmulhw -mno-mulhw
|
|
-mdlmzb -mno-dlmzb
|
|
-mprototype -mno-prototype
|
|
-msim -mmvme -mads -myellowknife -memb -msdata
|
|
-msdata=</B><I>opt</I> <B>-mreadonly-in-sdata -mvxworks -G</B> <I>num</I>
|
|
<B>-mrecip -mrecip=</B><I>opt</I> <B>-mno-recip -mrecip-precision
|
|
-mno-recip-precision
|
|
-mveclibabi=</B><I>type</I> <B>-mfriz -mno-friz
|
|
-mpointers-to-nested-functions -mno-pointers-to-nested-functions
|
|
-msave-toc-indirect -mno-save-toc-indirect
|
|
-mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector
|
|
-mcrypto -mno-crypto -mhtm -mno-htm
|
|
-mquad-memory -mno-quad-memory
|
|
-mquad-memory-atomic -mno-quad-memory-atomic
|
|
-mcompat-align-parm -mno-compat-align-parm
|
|
-mfloat128 -mno-float128 -mfloat128-hardware -mno-float128-hardware
|
|
-mgnu-attribute -mno-gnu-attribute
|
|
-mstack-protector-guard=</B><I>guard</I> <B>-mstack-protector-guard-reg=</B><I>reg</I>
|
|
<B>-mstack-protector-guard-offset=</B><I>offset</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>RX</I></FONT><I> Options</I>
|
|
<B>-m64bit-doubles -m32bit-doubles -fpu -nofpu
|
|
-mcpu=
|
|
-mbig-endian-data -mlittle-endian-data
|
|
-msmall-data
|
|
-msim -mno-sim
|
|
-mas100-syntax -mno-as100-syntax
|
|
-mrelax
|
|
-mmax-constant-size=
|
|
-mint-register=
|
|
-mpid
|
|
-mallow-string-insns -mno-allow-string-insns
|
|
-mjsr
|
|
-mno-warn-multiple-fast-interrupts
|
|
-msave-acc-in-interrupts</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>S/390 and zSeries Options</I>
|
|
<B>-mtune=</B><I>cpu-type</I> <B>-march=</B><I>cpu-type</I>
|
|
<B>-mhard-float -msoft-float -mhard-dfp -mno-hard-dfp
|
|
-mlong-double-64 -mlong-double-128
|
|
-mbackchain -mno-backchain -mpacked-stack -mno-packed-stack
|
|
-msmall-exec -mno-small-exec -mmvcle -mno-mvcle
|
|
-m64 -m31 -mdebug -mno-debug -mesa -mzarch
|
|
-mhtm -mvx -mzvector
|
|
-mtpf-trace -mno-tpf-trace -mfused-madd -mno-fused-madd
|
|
-mwarn-framesize -mwarn-dynamicstack -mstack-size -mstack-guard
|
|
-mhotpatch=</B><I>halfwords</I><B>,</B><I>halfwords</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Score Options</I>
|
|
<B>-meb -mel
|
|
-mnhwloop
|
|
-muls
|
|
-mmac
|
|
-mscore5 -mscore5u -mscore7 -mscore7d</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>SH</I></FONT><I> Options</I>
|
|
<B>-m1 -m2 -m2e
|
|
-m2a-nofpu -m2a-single-only -m2a-single -m2a
|
|
-m3 -m3e
|
|
-m4-nofpu -m4-single-only -m4-single -m4
|
|
-m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al
|
|
-mb -ml -mdalign -mrelax
|
|
-mbigtable -mfmovd -mrenesas -mno-renesas -mnomacsave
|
|
-mieee -mno-ieee -mbitops -misize -minline-ic_invalidate -mpadstruct
|
|
-mprefergot -musermode -multcost=</B><I>number</I> <B>-mdiv=</B><I>strategy</I>
|
|
<B>-mdivsi3_libfunc=</B><I>name</I> <B>-mfixed-range=</B><I>register-range</I>
|
|
<B>-maccumulate-outgoing-args
|
|
-matomic-model=</B><I>atomic-model</I>
|
|
<B>-mbranch-cost=</B><I>num</I> <B>-mzdcbranch -mno-zdcbranch
|
|
-mcbranch-force-delay-slot
|
|
-mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra
|
|
-mpretend-cmove -mtas</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Solaris 2 Options</I>
|
|
<B>-mclear-hwcap -mno-clear-hwcap -mimpure-text -mno-impure-text
|
|
-pthreads</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>SPARC</I></FONT><I> Options</I>
|
|
<B>-mcpu=</B><I>cpu-type</I>
|
|
<B>-mtune=</B><I>cpu-type</I>
|
|
<B>-mcmodel=</B><I>code-model</I>
|
|
<B>-mmemory-model=</B><I>mem-model</I>
|
|
<B>-m32 -m64 -mapp-regs -mno-app-regs
|
|
-mfaster-structs -mno-faster-structs -mflat -mno-flat
|
|
-mfpu -mno-fpu -mhard-float -msoft-float
|
|
-mhard-quad-float -msoft-quad-float
|
|
-mstack-bias -mno-stack-bias
|
|
-mstd-struct-return -mno-std-struct-return
|
|
-munaligned-doubles -mno-unaligned-doubles
|
|
-muser-mode -mno-user-mode
|
|
-mv8plus -mno-v8plus -mvis -mno-vis
|
|
-mvis2 -mno-vis2 -mvis3 -mno-vis3
|
|
-mvis4 -mno-vis4 -mvis4b -mno-vis4b
|
|
-mcbcond -mno-cbcond -mfmaf -mno-fmaf -mfsmuld -mno-fsmuld
|
|
-mpopc -mno-popc -msubxc -mno-subxc
|
|
-mfix-at697f -mfix-ut699 -mfix-ut700 -mfix-gr712rc
|
|
-mlra -mno-lra</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>SPU</I></FONT><I> Options</I>
|
|
<B>-mwarn-reloc -merror-reloc
|
|
-msafe-dma -munsafe-dma
|
|
-mbranch-hints
|
|
-msmall-mem -mlarge-mem -mstdmain
|
|
-mfixed-range=</B><I>register-range</I>
|
|
<B>-mea32 -mea64
|
|
-maddress-space-conversion -mno-address-space-conversion
|
|
-mcache-size=</B><I>cache-size</I>
|
|
<B>-matomic-updates -mno-atomic-updates</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>System V Options</I>
|
|
<B>-Qy -Qn -YP,</B><I>paths</I> <B>-Ym,</B><I>dir</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>TILE-Gx Options</I>
|
|
<B>-mcpu=CPU -m32 -m64 -mbig-endian -mlittle-endian
|
|
-mcmodel=</B><I>code-model</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>TILEPro Options</I>
|
|
<B>-mcpu=</B><I>cpu</I> <B>-m32</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>V850 Options</I>
|
|
<B>-mlong-calls -mno-long-calls -mep -mno-ep
|
|
-mprolog-function -mno-prolog-function -mspace
|
|
-mtda=</B><I>n</I> <B>-msda=</B><I>n</I> <B>-mzda=</B><I>n</I>
|
|
<B>-mapp-regs -mno-app-regs
|
|
-mdisable-callt -mno-disable-callt
|
|
-mv850e2v3 -mv850e2 -mv850e1 -mv850es
|
|
-mv850e -mv850 -mv850e3v5
|
|
-mloop
|
|
-mrelax
|
|
-mlong-jumps
|
|
-msoft-float
|
|
-mhard-float
|
|
-mgcc-abi
|
|
-mrh850-abi
|
|
-mbig-switch</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>VAX</I></FONT><I> Options</I>
|
|
<B>-mg -mgnu -munix</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Visium Options</I>
|
|
<B>-mdebug -msim -mfpu -mno-fpu -mhard-float -msoft-float
|
|
-mcpu=</B><I>cpu-type</I> <B>-mtune=</B><I>cpu-type</I> <B>-msv-mode -muser-mode</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I></I><FONT SIZE="-1"><I>VMS</I></FONT><I> Options</I>
|
|
<B>-mvms-return-codes -mdebug-main=</B><I>prefix</I> <B>-mmalloc64
|
|
-mpointer-size=</B><I>size</I>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>VxWorks Options</I>
|
|
<B>-mrtp -non-static -Bstatic -Bdynamic
|
|
-Xbind-lazy -Xbind-now</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>x86 Options</I>
|
|
<B>-mtune=</B><I>cpu-type</I> <B>-march=</B><I>cpu-type</I>
|
|
<B>-mtune-ctrl=</B><I>feature-list</I> <B>-mdump-tune-features -mno-default
|
|
-mfpmath=</B><I>unit</I>
|
|
<B>-masm=</B><I>dialect</I> <B>-mno-fancy-math-387
|
|
-mno-fp-ret-in-387 -m80387 -mhard-float -msoft-float
|
|
-mno-wide-multiply -mrtd -malign-double
|
|
-mpreferred-stack-boundary=</B><I>num</I>
|
|
<B>-mincoming-stack-boundary=</B><I>num</I>
|
|
<B>-mcld -mcx16 -msahf -mmovbe -mcrc32
|
|
-mrecip -mrecip=</B><I>opt</I>
|
|
<B>-mvzeroupper -mprefer-avx128 -mprefer-vector-width=</B><I>opt</I>
|
|
<B>-mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx
|
|
-mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -mavx512vl
|
|
-mavx512bw -mavx512dq -mavx512ifma -mavx512vbmi -msha -maes
|
|
-mpclmul -mfsgsbase -mrdrnd -mf16c -mfma -mpconfig -mwbnoinvd
|
|
-mptwrite -mprefetchwt1 -mclflushopt -mclwb -mxsavec -mxsaves
|
|
-msse4a -m3dnow -m3dnowa -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop
|
|
-madx -mlzcnt -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mhle -mlwp
|
|
-mmwaitx -mclzero -mpku -mthreads -mgfni -mvaes -mwaitpkg
|
|
-mshstk -mmanual-endbr -mforce-indirect-call -mavx512vbmi2
|
|
-mvpclmulqdq -mavx512bitalg -mmovdiri -mmovdir64b -mavx512vpopcntdq
|
|
-mavx5124fmaps -mavx512vnni -mavx5124vnniw -mprfchw -mrdpid
|
|
-mrdseed -msgx
|
|
-mcldemote -mms-bitfields -mno-align-stringops -minline-all-stringops
|
|
-minline-stringops-dynamically -mstringop-strategy=</B><I>alg</I>
|
|
<B>-mmemcpy-strategy=</B><I>strategy</I> <B>-mmemset-strategy=</B><I>strategy</I>
|
|
<B>-mpush-args -maccumulate-outgoing-args -m128bit-long-double
|
|
-m96bit-long-double -mlong-double-64 -mlong-double-80 -mlong-double-128
|
|
-mregparm=</B><I>num</I> <B>-msseregparm
|
|
-mveclibabi=</B><I>type</I> <B>-mvect8-ret-in-mem
|
|
-mpc32 -mpc64 -mpc80 -mstackrealign
|
|
-momit-leaf-frame-pointer -mno-red-zone -mno-tls-direct-seg-refs
|
|
-mcmodel=</B><I>code-model</I> <B>-mabi=</B><I>name</I> <B>-maddress-mode=</B><I>mode</I>
|
|
<B>-m32 -m64 -mx32 -m16 -miamcu -mlarge-data-threshold=</B><I>num</I>
|
|
<B>-msse2avx -mfentry -mrecord-mcount -mnop-mcount -m8bit-idiv
|
|
-minstrument-return=</B><I>type</I> <B>-mfentry-name=</B><I>name</I> <B>-mfentry-section=</B><I>name</I>
|
|
<B>-mavx256-split-unaligned-load -mavx256-split-unaligned-store
|
|
-malign-data=</B><I>type</I> <B>-mstack-protector-guard=</B><I>guard</I>
|
|
<B>-mstack-protector-guard-reg=</B><I>reg</I>
|
|
<B>-mstack-protector-guard-offset=</B><I>offset</I>
|
|
<B>-mstack-protector-guard-symbol=</B><I>symbol</I>
|
|
<B>-mgeneral-regs-only -mcall-ms2sysv-xlogues
|
|
-mindirect-branch=</B><I>choice</I> <B>-mfunction-return=</B><I>choice</I>
|
|
<B>-mindirect-branch-register</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>x86 Windows Options</I>
|
|
<B>-mconsole -mcygwin -mno-cygwin -mdll
|
|
-mnop-fun-dllimport -mthread
|
|
-municode -mwin32 -mwindows -fno-set-stack-executable</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Xstormy16 Options</I>
|
|
<B>-msim</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Xtensa Options</I>
|
|
<B>-mconst16 -mno-const16
|
|
-mfused-madd -mno-fused-madd
|
|
-mforce-no-pic
|
|
-mserialize-volatile -mno-serialize-volatile
|
|
-mtext-section-literals -mno-text-section-literals
|
|
-mauto-litpools -mno-auto-litpools
|
|
-mtarget-align -mno-target-align
|
|
-mlongcalls -mno-longcalls</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>zSeries Options</I>
|
|
See S/390 and zSeries Options.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H3>Options Controlling the Kind of Output</H3>
|
|
|
|
|
|
|
|
Compilation can involve up to four stages: preprocessing, compilation
|
|
proper, assembly and linking, always in that order. <FONT SIZE="-1">GCC</FONT> is capable of
|
|
preprocessing and compiling several files either into several
|
|
assembler input files, or into one assembler input file; then each
|
|
assembler input file produces an object file, and linking combines all
|
|
the object files (those newly compiled, and those specified as input)
|
|
into an executable file.
|
|
<P>
|
|
|
|
For any given input file, the file name suffix determines what kind of
|
|
compilation is done:
|
|
<DL COMPACT>
|
|
<DT id="18"><I>file</I><B>.c</B><DD>
|
|
|
|
|
|
C source code that must be preprocessed.
|
|
<DT id="19"><I>file</I><B>.i</B><DD>
|
|
|
|
|
|
C source code that should not be preprocessed.
|
|
<DT id="20"><I>file</I><B>.ii</B><DD>
|
|
|
|
|
|
C<FONT SIZE="-2">++</FONT> source code that should not be preprocessed.
|
|
<DT id="21"><I>file</I><B>.m</B><DD>
|
|
|
|
|
|
Objective-C source code. Note that you must link with the <I>libobjc</I>
|
|
library to make an Objective-C program work.
|
|
<DT id="22"><I>file</I><B>.mi</B><DD>
|
|
|
|
|
|
Objective-C source code that should not be preprocessed.
|
|
<DT id="23"><I>file</I><B>.mm</B><DD>
|
|
|
|
|
|
|
|
<DT id="24"><I>file</I><B>.M</B><DD>
|
|
|
|
|
|
|
|
Objective-C<FONT SIZE="-2">++</FONT> source code. Note that you must link with the <I>libobjc</I>
|
|
library to make an Objective-C<FONT SIZE="-2">++</FONT> program work. Note that <B>.M</B> refers
|
|
to a literal capital M.
|
|
<DT id="25"><I>file</I><B>.mii</B><DD>
|
|
|
|
|
|
Objective-C<FONT SIZE="-2">++</FONT> source code that should not be preprocessed.
|
|
<DT id="26"><I>file</I><B>.h</B><DD>
|
|
|
|
|
|
C, C<FONT SIZE="-2">++</FONT>, Objective-C or Objective-C<FONT SIZE="-2">++</FONT> header file to be turned into a
|
|
precompiled header (default), or C, C<FONT SIZE="-2">++</FONT> header file to be turned into an
|
|
Ada spec (via the <B>-fdump-ada-spec</B> switch).
|
|
<DT id="27"><I>file</I><B>.cc</B><DD>
|
|
|
|
|
|
|
|
<DT id="28"><I>file</I><B>.cp</B><DD>
|
|
|
|
|
|
<DT id="29"><I>file</I><B>.cxx</B><DD>
|
|
|
|
|
|
<DT id="30"><I>file</I><B>.cpp</B><DD>
|
|
|
|
|
|
<DT id="31"><I>file</I><B>.CPP</B><DD>
|
|
|
|
|
|
<DT id="32"><I>file</I><B>.c++</B><DD>
|
|
|
|
|
|
<DT id="33"><I>file</I><B>.C</B><DD>
|
|
|
|
|
|
|
|
C<FONT SIZE="-2">++</FONT> source code that must be preprocessed. Note that in <B>.cxx</B>,
|
|
the last two letters must both be literally <B>x</B>. Likewise,
|
|
<B>.C</B> refers to a literal capital C.
|
|
<DT id="34"><I>file</I><B>.mm</B><DD>
|
|
|
|
|
|
|
|
<DT id="35"><I>file</I><B>.M</B><DD>
|
|
|
|
|
|
|
|
Objective-C<FONT SIZE="-2">++</FONT> source code that must be preprocessed.
|
|
<DT id="36"><I>file</I><B>.mii</B><DD>
|
|
|
|
|
|
Objective-C<FONT SIZE="-2">++</FONT> source code that should not be preprocessed.
|
|
<DT id="37"><I>file</I><B>.hh</B><DD>
|
|
|
|
|
|
|
|
<DT id="38"><I>file</I><B>.H</B><DD>
|
|
|
|
|
|
<DT id="39"><I>file</I><B>.hp</B><DD>
|
|
|
|
|
|
<DT id="40"><I>file</I><B>.hxx</B><DD>
|
|
|
|
|
|
<DT id="41"><I>file</I><B>.hpp</B><DD>
|
|
|
|
|
|
<DT id="42"><I>file</I><B>.HPP</B><DD>
|
|
|
|
|
|
<DT id="43"><I>file</I><B>.h++</B><DD>
|
|
|
|
|
|
<DT id="44"><I>file</I><B>.tcc</B><DD>
|
|
|
|
|
|
|
|
C<FONT SIZE="-2">++</FONT> header file to be turned into a precompiled header or Ada spec.
|
|
<DT id="45"><I>file</I><B>.f</B><DD>
|
|
|
|
|
|
|
|
<DT id="46"><I>file</I><B>.for</B><DD>
|
|
|
|
|
|
<DT id="47"><I>file</I><B>.ftn</B><DD>
|
|
|
|
|
|
|
|
Fixed form Fortran source code that should not be preprocessed.
|
|
<DT id="48"><I>file</I><B>.F</B><DD>
|
|
|
|
|
|
|
|
<DT id="49"><I>file</I><B>.FOR</B><DD>
|
|
|
|
|
|
<DT id="50"><I>file</I><B>.fpp</B><DD>
|
|
|
|
|
|
<DT id="51"><I>file</I><B>.FPP</B><DD>
|
|
|
|
|
|
<DT id="52"><I>file</I><B>.FTN</B><DD>
|
|
|
|
|
|
|
|
Fixed form Fortran source code that must be preprocessed (with the traditional
|
|
preprocessor).
|
|
<DT id="53"><I>file</I><B>.f90</B><DD>
|
|
|
|
|
|
|
|
<DT id="54"><I>file</I><B>.f95</B><DD>
|
|
|
|
|
|
<DT id="55"><I>file</I><B>.f03</B><DD>
|
|
|
|
|
|
<DT id="56"><I>file</I><B>.f08</B><DD>
|
|
|
|
|
|
|
|
Free form Fortran source code that should not be preprocessed.
|
|
<DT id="57"><I>file</I><B>.F90</B><DD>
|
|
|
|
|
|
|
|
<DT id="58"><I>file</I><B>.F95</B><DD>
|
|
|
|
|
|
<DT id="59"><I>file</I><B>.F03</B><DD>
|
|
|
|
|
|
<DT id="60"><I>file</I><B>.F08</B><DD>
|
|
|
|
|
|
|
|
Free form Fortran source code that must be preprocessed (with the
|
|
traditional preprocessor).
|
|
<DT id="61"><I>file</I><B>.go</B><DD>
|
|
|
|
|
|
Go source code.
|
|
<DT id="62"><I>file</I><B>.brig</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">BRIG</FONT> files (binary representation of <FONT SIZE="-1">HSAIL</FONT>).
|
|
<DT id="63"><I>file</I><B>.d</B><DD>
|
|
|
|
|
|
D source code.
|
|
<DT id="64"><I>file</I><B>.di</B><DD>
|
|
|
|
|
|
D interface file.
|
|
<DT id="65"><I>file</I><B>.dd</B><DD>
|
|
|
|
|
|
D documentation code (Ddoc).
|
|
<DT id="66"><I>file</I><B>.ads</B><DD>
|
|
|
|
|
|
Ada source code file that contains a library unit declaration (a
|
|
declaration of a package, subprogram, or generic, or a generic
|
|
instantiation), or a library unit renaming declaration (a package,
|
|
generic, or subprogram renaming declaration). Such files are also
|
|
called <I>specs</I>.
|
|
<DT id="67"><I>file</I><B>.adb</B><DD>
|
|
|
|
|
|
Ada source code file containing a library unit body (a subprogram or
|
|
package body). Such files are also called <I>bodies</I>.
|
|
<DT id="68"><I>file</I><B>.s</B><DD>
|
|
|
|
|
|
Assembler code.
|
|
<DT id="69"><I>file</I><B>.S</B><DD>
|
|
|
|
|
|
|
|
<DT id="70"><I>file</I><B>.sx</B><DD>
|
|
|
|
|
|
|
|
Assembler code that must be preprocessed.
|
|
<DT id="71"><I>other</I><DD>
|
|
|
|
|
|
An object file to be fed straight into linking.
|
|
Any file name with no recognized suffix is treated this way.
|
|
</DL>
|
|
<P>
|
|
|
|
You can specify the input language explicitly with the <B>-x</B> option:
|
|
<DL COMPACT>
|
|
<DT id="72"><B>-x</B> <I>language</I><DD>
|
|
|
|
|
|
Specify explicitly the <I>language</I> for the following input files
|
|
(rather than letting the compiler choose a default based on the file
|
|
name suffix). This option applies to all following input files until
|
|
the next <B>-x</B> option. Possible values for <I>language</I> are:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
c c-header cpp-output
|
|
c++ c++-header c++-cpp-output
|
|
objective-c objective-c-header objective-c-cpp-output
|
|
objective-c++ objective-c++-header objective-c++-cpp-output
|
|
assembler assembler-with-cpp
|
|
ada
|
|
d
|
|
f77 f77-cpp-input f95 f95-cpp-input
|
|
go
|
|
brig
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="73"><B>-x none</B><DD>
|
|
|
|
|
|
Turn off any specification of a language, so that subsequent files are
|
|
handled according to their file name suffixes (as they are if <B>-x</B>
|
|
has not been used at all).
|
|
</DL>
|
|
<P>
|
|
|
|
If you only want some of the stages of compilation, you can use
|
|
<B>-x</B> (or filename suffixes) to tell <B>gcc</B> where to start, and
|
|
one of the options <B>-c</B>, <B>-S</B>, or <B>-E</B> to say where
|
|
<B>gcc</B> is to stop. Note that some combinations (for example,
|
|
<B>-x cpp-output -E</B>) instruct <B>gcc</B> to do nothing at all.
|
|
<DL COMPACT>
|
|
<DT id="74"><B>-c</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
By default, the object file name for a source file is made by replacing
|
|
the suffix <B>.c</B>, <B>.i</B>, <B>.s</B>, etc., with <B>.o</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Unrecognized input files, not requiring compilation or assembly, are
|
|
ignored.
|
|
<DT id="75"><B>-S</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
By default, the assembler file name for a source file is made by
|
|
replacing the suffix <B>.c</B>, <B>.i</B>, etc., with <B>.s</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Input files that don't require compilation are ignored.
|
|
<DT id="76"><B>-E</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Input files that don't require preprocessing are ignored.
|
|
<DT id="77"><B>-o</B> <I>file</I><DD>
|
|
|
|
|
|
Place output in file <I>file</I>. 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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <B>-o</B> is not specified, the default is to put an executable
|
|
file in <I>a.out</I>, the object file for
|
|
<I>source.suffix</I> in <I>source.o</I>, its
|
|
assembler file in <I>source.s</I>, a precompiled header file in
|
|
<I>source.suffix.gch</I>, and all preprocessed C source on
|
|
standard output.
|
|
<DT id="78"><B>-v</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="79"><B>-###</B><DD>
|
|
|
|
|
|
Like <B>-v</B> except the commands are not executed and arguments
|
|
are quoted unless they contain only alphanumeric characters or <TT>"./-_"</TT>.
|
|
This is useful for shell scripts to capture the driver-generated command lines.
|
|
<DT id="80"><B>--help</B><DD>
|
|
|
|
|
|
Print (on the standard output) a description of the command-line options
|
|
understood by <B>gcc</B>. If the <B>-v</B> option is also specified
|
|
then <B>--help</B> is also passed on to the various processes
|
|
invoked by <B>gcc</B>, so that they can display the command-line options
|
|
they accept. If the <B>-Wextra</B> option has also been specified
|
|
(prior to the <B>--help</B> option), then command-line options that
|
|
have no documentation associated with them are also displayed.
|
|
<DT id="81"><B>--target-help</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="82"><B>--help={</B><I>class</I>|[<B>^</B>]<I>qualifier</I><B>}</B>[<B>,...</B>]<DD>
|
|
|
|
|
|
Print (on the standard output) a description of the command-line
|
|
options understood by the compiler that fit into all specified classes
|
|
and qualifiers. These are the supported classes:
|
|
<DL COMPACT><DT id="83"><DD>
|
|
<DL COMPACT>
|
|
<DT id="84"><B>optimizers</B><DD>
|
|
|
|
|
|
Display all of the optimization options supported by the
|
|
compiler.
|
|
<DT id="85"><B>warnings</B><DD>
|
|
|
|
|
|
Display all of the options controlling warning messages
|
|
produced by the compiler.
|
|
<DT id="86"><B>target</B><DD>
|
|
|
|
|
|
Display target-specific options. Unlike the
|
|
<B>--target-help</B> option however, target-specific options of the
|
|
linker and assembler are not displayed. This is because those
|
|
tools do not currently support the extended <B>--help=</B> syntax.
|
|
<DT id="87"><B>params</B><DD>
|
|
|
|
|
|
Display the values recognized by the <B>--param</B>
|
|
option.
|
|
<DT id="88"><I>language</I><DD>
|
|
|
|
|
|
Display the options supported for <I>language</I>, where
|
|
<I>language</I> is the name of one of the languages supported in this
|
|
version of <FONT SIZE="-1">GCC.</FONT>
|
|
<DT id="89"><B>common</B><DD>
|
|
|
|
|
|
Display the options that are common to all languages.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="90"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
These are the supported qualifiers:
|
|
<DL COMPACT>
|
|
<DT id="91"><B>undocumented</B><DD>
|
|
|
|
|
|
Display only those options that are undocumented.
|
|
<DT id="92"><B>joined</B><DD>
|
|
|
|
|
|
Display options taking an argument that appears after an equal
|
|
sign in the same continuous piece of text, such as:
|
|
<B>--help=target</B>.
|
|
<DT id="93"><B>separate</B><DD>
|
|
|
|
|
|
Display options taking an argument that appears as a separate word
|
|
following the original option, such as: <B>-o output-file</B>.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="94"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Thus for example to display all the undocumented target-specific
|
|
switches supported by the compiler, use:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
--help=target,undocumented
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The sense of a qualifier can be inverted by prefixing it with the
|
|
<B>^</B> character, so for example to display all binary warning
|
|
options (i.e., ones that are either on or off and that do not take an
|
|
argument) that have a description, use:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
--help=warnings,^joined,^undocumented
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The argument to <B>--help=</B> should not consist solely of inverted
|
|
qualifiers.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Combining several classes is possible, although this usually
|
|
restricts the output so much that there is nothing to display. One
|
|
case where it does work, however, is when one of the classes is
|
|
<I>target</I>. For example, to display all the target-specific
|
|
optimization options, use:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
--help=target,optimizers
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>--help=</B> option can be repeated on the command line. Each
|
|
successive use displays its requested class of options, skipping
|
|
those that have already been displayed. If <B>--help</B> is also
|
|
specified anywhere on the command line then this takes precedence
|
|
over any <B>--help=</B> option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If the <B>-Q</B> option appears on the command line before the
|
|
<B>--help=</B> option, then the descriptive text displayed by
|
|
<B>--help=</B> is changed. Instead of describing the displayed
|
|
options, an indication is given as to whether the option is enabled,
|
|
disabled or set to a specific value (assuming that the compiler
|
|
knows this at the point where the <B>--help=</B> option is used).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Here is a truncated example from the <FONT SIZE="-1">ARM</FONT> port of <B>gcc</B>:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
% gcc -Q -mabi=2 --help=target -c
|
|
The following options are target specific:
|
|
-mabi= 2
|
|
-mabort-on-noreturn [disabled]
|
|
-mapcs [disabled]
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The output is sensitive to the effects of previous command-line
|
|
options, so for example it is possible to find out which optimizations
|
|
are enabled at <B>-O2</B> by using:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
-Q -O2 --help=optimizers
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Alternatively you can discover which binary optimizations are enabled
|
|
by <B>-O3</B> by using:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
|
|
gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
|
|
diff /tmp/O2-opts /tmp/O3-opts | grep enabled
|
|
|
|
</PRE>
|
|
|
|
|
|
</DL>
|
|
|
|
<DT id="95"><B>--version</B><DD>
|
|
|
|
|
|
Display the version number and copyrights of the invoked <FONT SIZE="-1">GCC.</FONT>
|
|
<DT id="96"><B>-pass-exit-codes</B><DD>
|
|
|
|
|
|
Normally the <B>gcc</B> program exits with the code of 1 if any
|
|
phase of the compiler returns a non-success return code. If you specify
|
|
<B>-pass-exit-codes</B>, the <B>gcc</B> program instead returns with
|
|
the numerically highest error produced by any phase returning an error
|
|
indication. The C, C<FONT SIZE="-2">++</FONT>, and Fortran front ends return 4 if an internal
|
|
compiler error is encountered.
|
|
<DT id="97"><B>-pipe</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">GNU</FONT> assembler has
|
|
no trouble.
|
|
<DT id="98"><B>-specs=</B><I>file</I><DD>
|
|
|
|
|
|
Process <I>file</I> after the compiler reads in the standard <I>specs</I>
|
|
file, in order to override the defaults which the <B>gcc</B> driver
|
|
program uses when determining what switches to pass to <B>cc1</B>,
|
|
<B>cc1plus</B>, <B>as</B>, <B>ld</B>, etc. More than one
|
|
<B>-specs=</B><I>file</I> can be specified on the command line, and they
|
|
are processed in order, from left to right.
|
|
<DT id="99"><B>-wrapper</B><DD>
|
|
|
|
|
|
Invoke all subcommands under a wrapper program. The name of the
|
|
wrapper program and its parameters are passed as a comma separated
|
|
list.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -c t.c -wrapper gdb,--args
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This invokes all subprograms of <B>gcc</B> under
|
|
<B>gdb --args</B>, thus the invocation of <B>cc1</B> is
|
|
<B>gdb --args cc1 ...</B>.
|
|
<DT id="100"><B>-ffile-prefix-map=</B><I>old</I><B>=</B><I>new</I><DD>
|
|
|
|
|
|
When compiling files residing in directory <I>old</I>, record
|
|
any references to them in the result of the compilation as if the
|
|
files resided in directory <I>new</I> instead. Specifying this
|
|
option is equivalent to specifying all the individual
|
|
<B>-f*-prefix-map</B> options. This can be used to make reproducible
|
|
builds that are location independent. See also
|
|
<B>-fmacro-prefix-map</B> and <B>-fdebug-prefix-map</B>.
|
|
<DT id="101"><B>-fplugin=</B><I>name</I><B>.so</B><DD>
|
|
|
|
|
|
Load the plugin code in file <I>name</I>.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
|
|
purposes of argument parsing (See
|
|
<B>-fplugin-arg-</B><I>name</I><B>-</B><I>key</I><B>=</B><I>value</I> below).
|
|
Each plugin should define the callback functions specified in the
|
|
Plugins <FONT SIZE="-1">API.</FONT>
|
|
<DT id="102"><B>-fplugin-arg-</B><I>name</I><B>-</B><I>key</I><B>=</B><I>value</I><DD>
|
|
|
|
|
|
Define an argument called <I>key</I> with a value of <I>value</I>
|
|
for the plugin called <I>name</I>.
|
|
<DT id="103"><B>-fdump-ada-spec</B>[<B>-slim</B>]<DD>
|
|
|
|
|
|
For C and C<FONT SIZE="-2">++</FONT> source and include files, generate corresponding Ada specs.
|
|
<DT id="104"><B>-fada-spec-parent=</B><I>unit</I><DD>
|
|
|
|
|
|
In conjunction with <B>-fdump-ada-spec</B>[<B>-slim</B>] above, generate
|
|
Ada specs as child units of parent <I>unit</I>.
|
|
<DT id="105"><B>-fdump-go-spec=</B><I>file</I><DD>
|
|
|
|
|
|
For input files in any language, generate corresponding Go
|
|
declarations in <I>file</I>. This generates Go <TT>"const"</TT>,
|
|
<TT>"type"</TT>, <TT>"var"</TT>, and <TT>"func"</TT> declarations which may be a
|
|
useful way to start writing a Go interface to code written in some
|
|
other language.
|
|
<DT id="106"><B>@</B><I>file</I><DD>
|
|
|
|
|
|
Read command-line options from <I>file</I>. The options read are
|
|
inserted in place of the original @<I>file</I> option. If <I>file</I>
|
|
does not exist, or cannot be read, then the option will be treated
|
|
literally, and not removed.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Options in <I>file</I> are separated by whitespace. A whitespace
|
|
character may be included in an option by surrounding the entire
|
|
option in either single or double quotes. Any character (including a
|
|
backslash) may be included by prefixing the character to be included
|
|
with a backslash. The <I>file</I> may itself contain additional
|
|
@<I>file</I> options; any such options will be processed recursively.
|
|
</DL>
|
|
<A NAME="lbAH"> </A>
|
|
<H3>Compiling C<FONT SIZE="-2">++</FONT> Programs</H3>
|
|
|
|
|
|
|
|
C<FONT SIZE="-2">++</FONT> source files conventionally use one of the suffixes <B>.C</B>,
|
|
<B>.cc</B>, <B>.cpp</B>, <B>.CPP</B>, <B>.c++</B>, <B>.cp</B>, or
|
|
<B>.cxx</B>; C<FONT SIZE="-2">++</FONT> header files often use <B>.hh</B>, <B>.hpp</B>,
|
|
<B>.H</B>, or (for shared template code) <B>.tcc</B>; and
|
|
preprocessed C<FONT SIZE="-2">++</FONT> files use the suffix <B>.ii</B>. <FONT SIZE="-1">GCC</FONT> recognizes
|
|
files with these names and compiles them as C<FONT SIZE="-2">++</FONT> programs even if you
|
|
call the compiler the same way as for compiling C programs (usually
|
|
with the name <B>gcc</B>).
|
|
<P>
|
|
|
|
However, the use of <B>gcc</B> does not add the C<FONT SIZE="-2">++</FONT> library.
|
|
<B>g++</B> is a program that calls <FONT SIZE="-1">GCC</FONT> and automatically specifies linking
|
|
against the C<FONT SIZE="-2">++</FONT> library. It treats <B>.c</B>,
|
|
<B>.h</B> and <B>.i</B> files as C<FONT SIZE="-2">++</FONT> source files instead of C source
|
|
files unless <B>-x</B> is used. This program is also useful when
|
|
precompiling a C header file with a <B>.h</B> extension for use in C<FONT SIZE="-2">++</FONT>
|
|
compilations. On many systems, <B>g++</B> is also installed with
|
|
the name <B>c++</B>.
|
|
<P>
|
|
|
|
When you compile C<FONT SIZE="-2">++</FONT> programs, you may specify many of the same
|
|
command-line options that you use for compiling programs in any
|
|
language; or command-line options meaningful for C and related
|
|
languages; or options that are meaningful only for C<FONT SIZE="-2">++</FONT> programs.
|
|
<A NAME="lbAI"> </A>
|
|
<H3>Options Controlling C Dialect</H3>
|
|
|
|
|
|
|
|
The following options control the dialect of C (or languages derived
|
|
from C, such as C<FONT SIZE="-2">++</FONT>, Objective-C and Objective-C<FONT SIZE="-2">++</FONT>) that the compiler
|
|
accepts:
|
|
<DL COMPACT>
|
|
<DT id="107"><B>-ansi</B><DD>
|
|
|
|
|
|
In C mode, this is equivalent to <B>-std=c90</B>. In C<FONT SIZE="-2">++</FONT> mode, it is
|
|
equivalent to <B>-std=c++98</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This turns off certain features of <FONT SIZE="-1">GCC</FONT> that are incompatible with <FONT SIZE="-1">ISO
|
|
C90</FONT> (when compiling C code), or of standard C<FONT SIZE="-2">++</FONT> (when compiling C<FONT SIZE="-2">++</FONT> code),
|
|
such as the <TT>"asm"</TT> and <TT>"typeof"</TT> keywords, and
|
|
predefined macros such as <TT>"unix"</TT> and <TT>"vax"</TT> that identify the
|
|
type of system you are using. It also enables the undesirable and
|
|
rarely used <FONT SIZE="-1">ISO</FONT> trigraph feature. For the C compiler,
|
|
it disables recognition of C<FONT SIZE="-2">++</FONT> style <B>//</B> comments as well as
|
|
the <TT>"inline"</TT> keyword.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The alternate keywords <TT>"__asm__"</TT>, <TT>"__extension__"</TT>,
|
|
<TT>"__inline__"</TT> and <TT>"__typeof__"</TT> continue to work despite
|
|
<B>-ansi</B>. You would not want to use them in an <FONT SIZE="-1">ISO C</FONT> program, of
|
|
course, but it is useful to put them in header files that might be included
|
|
in compilations done with <B>-ansi</B>. Alternate predefined macros
|
|
such as <TT>"__unix__"</TT> and <TT>"__vax__"</TT> are also available, with or
|
|
without <B>-ansi</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-ansi</B> option does not cause non-ISO programs to be
|
|
rejected gratuitously. For that, <B>-Wpedantic</B> is required in
|
|
addition to <B>-ansi</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The macro <TT>"__STRICT_ANSI__"</TT> is predefined when the <B>-ansi</B>
|
|
option is used. Some header files may notice this macro and refrain
|
|
from declaring certain functions or defining certain macros that the
|
|
<FONT SIZE="-1">ISO</FONT> standard doesn't call for; this is to avoid interfering with any
|
|
programs that might use these names for other things.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Functions that are normally built in but do not have semantics
|
|
defined by <FONT SIZE="-1">ISO C</FONT> (such as <TT>"alloca"</TT> and <TT>"ffs"</TT>) are not built-in
|
|
functions when <B>-ansi</B> is used.
|
|
<DT id="108"><B>-std=</B><DD>
|
|
|
|
|
|
Determine the language standard. This option
|
|
is currently only supported when compiling C or C<FONT SIZE="-2">++</FONT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The compiler can accept several base standards, such as <B>c90</B> or
|
|
<B>c++98</B>, and <FONT SIZE="-1">GNU</FONT> dialects of those standards, such as
|
|
<B>gnu90</B> or <B>gnu++98</B>. When a base standard is specified, the
|
|
compiler accepts all programs following that standard plus those
|
|
using <FONT SIZE="-1">GNU</FONT> extensions that do not contradict it. For example,
|
|
<B>-std=c90</B> turns off certain features of <FONT SIZE="-1">GCC</FONT> that are
|
|
incompatible with <FONT SIZE="-1">ISO C90,</FONT> such as the <TT>"asm"</TT> and <TT>"typeof"</TT>
|
|
keywords, but not other <FONT SIZE="-1">GNU</FONT> extensions that do not have a meaning in
|
|
<FONT SIZE="-1">ISO C90,</FONT> such as omitting the middle term of a <TT>"?:"</TT>
|
|
expression. On the other hand, when a <FONT SIZE="-1">GNU</FONT> dialect of a standard is
|
|
specified, all features supported by the compiler are enabled, even when
|
|
those features change the meaning of the base standard. As a result, some
|
|
strict-conforming programs may be rejected. The particular standard
|
|
is used by <B>-Wpedantic</B> to identify which features are <FONT SIZE="-1">GNU</FONT>
|
|
extensions given that version of the standard. For example
|
|
<B>-std=gnu90 -Wpedantic</B> warns about C<FONT SIZE="-2">++</FONT> style <B>//</B>
|
|
comments, while <B>-std=gnu99 -Wpedantic</B> does not.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
A value for this option must be provided; possible values are
|
|
<DL COMPACT><DT id="109"><DD>
|
|
<DL COMPACT>
|
|
<DT id="110"><B>c90</B><DD>
|
|
|
|
|
|
|
|
<DT id="111"><B>c89</B><DD>
|
|
|
|
|
|
<DT id="112"><B>iso9899:1990</B><DD>
|
|
|
|
|
|
|
|
Support all <FONT SIZE="-1">ISO C90</FONT> programs (certain <FONT SIZE="-1">GNU</FONT> extensions that conflict
|
|
with <FONT SIZE="-1">ISO C90</FONT> are disabled). Same as <B>-ansi</B> for C code.
|
|
<DT id="113"><B>iso9899:199409</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">ISO C90</FONT> as modified in amendment 1.
|
|
<DT id="114"><B>c99</B><DD>
|
|
|
|
|
|
|
|
<DT id="115"><B>c9x</B><DD>
|
|
|
|
|
|
<DT id="116"><B>iso9899:1999</B><DD>
|
|
|
|
|
|
<DT id="117"><B>iso9899:199x</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">ISO C99.</FONT> This standard is substantially completely supported, modulo
|
|
bugs and floating-point issues
|
|
(mainly but not entirely relating to optional C99 features from
|
|
Annexes F and G). See
|
|
<<B><A HREF="http://gcc.gnu.org/c99status.html">http://gcc.gnu.org/c99status.html</A></B>> for more information. The
|
|
names <B>c9x</B> and <B>iso9899:199x</B> are deprecated.
|
|
<DT id="118"><B>c11</B><DD>
|
|
|
|
|
|
|
|
<DT id="119"><B>c1x</B><DD>
|
|
|
|
|
|
<DT id="120"><B>iso9899:2011</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">ISO C11,</FONT> the 2011 revision of the <FONT SIZE="-1">ISO C</FONT> standard. This standard is
|
|
substantially completely supported, modulo bugs, floating-point issues
|
|
(mainly but not entirely relating to optional C11 features from
|
|
Annexes F and G) and the optional Annexes K (Bounds-checking
|
|
interfaces) and L (Analyzability). The name <B>c1x</B> is deprecated.
|
|
<DT id="121"><B>c17</B><DD>
|
|
|
|
|
|
|
|
<DT id="122"><B>c18</B><DD>
|
|
|
|
|
|
<DT id="123"><B>iso9899:2017</B><DD>
|
|
|
|
|
|
<DT id="124"><B>iso9899:2018</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">ISO C17,</FONT> the 2017 revision of the <FONT SIZE="-1">ISO C</FONT> standard
|
|
(published in 2018). This standard is
|
|
same as C11 except for corrections of defects (all of which are also
|
|
applied with <B>-std=c11</B>) and a new value of
|
|
<TT>"__STDC_VERSION__"</TT>, and so is supported to the same extent as C11.
|
|
<DT id="125"><B>c2x</B><DD>
|
|
|
|
|
|
The next version of the <FONT SIZE="-1">ISO C</FONT> standard, still under development. The
|
|
support for this version is experimental and incomplete.
|
|
<DT id="126"><B>gnu90</B><DD>
|
|
|
|
|
|
|
|
<DT id="127"><B>gnu89</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">GNU</FONT> dialect of <FONT SIZE="-1">ISO C90</FONT> (including some C99 features).
|
|
<DT id="128"><B>gnu99</B><DD>
|
|
|
|
|
|
|
|
<DT id="129"><B>gnu9x</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">GNU</FONT> dialect of <FONT SIZE="-1">ISO C99.</FONT> The name <B>gnu9x</B> is deprecated.
|
|
<DT id="130"><B>gnu11</B><DD>
|
|
|
|
|
|
|
|
<DT id="131"><B>gnu1x</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">GNU</FONT> dialect of <FONT SIZE="-1">ISO C11.</FONT>
|
|
The name <B>gnu1x</B> is deprecated.
|
|
<DT id="132"><B>gnu17</B><DD>
|
|
|
|
|
|
|
|
<DT id="133"><B>gnu18</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">GNU</FONT> dialect of <FONT SIZE="-1">ISO C17.</FONT> This is the default for C code.
|
|
<DT id="134"><B>gnu2x</B><DD>
|
|
|
|
|
|
The next version of the <FONT SIZE="-1">ISO C</FONT> standard, still under development, plus
|
|
<FONT SIZE="-1">GNU</FONT> extensions. The support for this version is experimental and
|
|
incomplete.
|
|
<DT id="135"><B>c++98</B><DD>
|
|
|
|
|
|
|
|
<DT id="136"><B>c++03</B><DD>
|
|
|
|
|
|
|
|
The 1998 <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT></FONT> standard plus the 2003 technical corrigendum and some
|
|
additional defect reports. Same as <B>-ansi</B> for C<FONT SIZE="-2">++</FONT> code.
|
|
<DT id="137"><B>gnu++98</B><DD>
|
|
|
|
|
|
|
|
<DT id="138"><B>gnu++03</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">GNU</FONT> dialect of <B>-std=c++98</B>.
|
|
<DT id="139"><B>c++11</B><DD>
|
|
|
|
|
|
|
|
<DT id="140"><B>c++0x</B><DD>
|
|
|
|
|
|
|
|
The 2011 <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT></FONT> standard plus amendments.
|
|
The name <B>c++0x</B> is deprecated.
|
|
<DT id="141"><B>gnu++11</B><DD>
|
|
|
|
|
|
|
|
<DT id="142"><B>gnu++0x</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">GNU</FONT> dialect of <B>-std=c++11</B>.
|
|
The name <B>gnu++0x</B> is deprecated.
|
|
<DT id="143"><B>c++14</B><DD>
|
|
|
|
|
|
|
|
<DT id="144"><B>c++1y</B><DD>
|
|
|
|
|
|
|
|
The 2014 <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT></FONT> standard plus amendments.
|
|
The name <B>c++1y</B> is deprecated.
|
|
<DT id="145"><B>gnu++14</B><DD>
|
|
|
|
|
|
|
|
<DT id="146"><B>gnu++1y</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">GNU</FONT> dialect of <B>-std=c++14</B>.
|
|
This is the default for C<FONT SIZE="-2">++</FONT> code.
|
|
The name <B>gnu++1y</B> is deprecated.
|
|
<DT id="147"><B>c++17</B><DD>
|
|
|
|
|
|
|
|
<DT id="148"><B>c++1z</B><DD>
|
|
|
|
|
|
|
|
The 2017 <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT></FONT> standard plus amendments.
|
|
The name <B>c++1z</B> is deprecated.
|
|
<DT id="149"><B>gnu++17</B><DD>
|
|
|
|
|
|
|
|
<DT id="150"><B>gnu++1z</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">GNU</FONT> dialect of <B>-std=c++17</B>.
|
|
The name <B>gnu++1z</B> is deprecated.
|
|
<DT id="151"><B>c++2a</B><DD>
|
|
|
|
|
|
The next revision of the <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT></FONT> standard, tentatively planned for
|
|
2020. Support is highly experimental, and will almost certainly
|
|
change in incompatible ways in future releases.
|
|
<DT id="152"><B>gnu++2a</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">GNU</FONT> dialect of <B>-std=c++2a</B>. Support is highly experimental,
|
|
and will almost certainly change in incompatible ways in future
|
|
releases.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="153"><DD>
|
|
</DL>
|
|
|
|
<DT id="154"><B>-fgnu89-inline</B><DD>
|
|
|
|
|
|
The option <B>-fgnu89-inline</B> tells <FONT SIZE="-1">GCC</FONT> to use the traditional
|
|
<FONT SIZE="-1">GNU</FONT> semantics for <TT>"inline"</TT> functions when in C99 mode.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Using this option is roughly equivalent to adding the
|
|
<TT>"gnu_inline"</TT> function attribute to all inline functions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The option <B>-fno-gnu89-inline</B> explicitly tells <FONT SIZE="-1">GCC</FONT> to use the
|
|
C99 semantics for <TT>"inline"</TT> when in C99 or gnu99 mode (i.e., it
|
|
specifies the default behavior).
|
|
This option is not supported in <B>-std=c90</B> or
|
|
<B>-std=gnu90</B> mode.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The preprocessor macros <TT>"__GNUC_GNU_INLINE__"</TT> and
|
|
<TT>"__GNUC_STDC_INLINE__"</TT> may be used to check which semantics are
|
|
in effect for <TT>"inline"</TT> functions.
|
|
<DT id="155"><B>-fpermitted-flt-eval-methods=</B><I>style</I><DD>
|
|
|
|
|
|
<FONT SIZE="-1">ISO/IEC TS 18661-3</FONT> defines new permissible values for
|
|
<TT>"FLT_EVAL_METHOD"</TT> that indicate that operations and constants with
|
|
a semantic type that is an interchange or extended format should be
|
|
evaluated to the precision and range of that type. These new values are
|
|
a superset of those permitted under C99/C11, which does not specify the
|
|
meaning of other positive values of <TT>"FLT_EVAL_METHOD"</TT>. As such, code
|
|
conforming to C11 may not have been written expecting the possibility of
|
|
the new values.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fpermitted-flt-eval-methods</B> specifies whether the compiler
|
|
should allow only the values of <TT>"FLT_EVAL_METHOD"</TT> specified in C99/C11,
|
|
or the extended set of values specified in <FONT SIZE="-1">ISO/IEC TS 18661-3.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>style</I> is either <TT>"c11"</TT> or <TT>"ts-18661-3"</TT> as appropriate.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default when in a standards compliant mode (<B>-std=c11</B> or similar)
|
|
is <B>-fpermitted-flt-eval-methods=c11</B>. The default when in a <FONT SIZE="-1">GNU</FONT>
|
|
dialect (<B>-std=gnu11</B> or similar) is
|
|
<B>-fpermitted-flt-eval-methods=ts-18661-3</B>.
|
|
<DT id="156"><B>-aux-info</B> <I>filename</I><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Besides declarations, the file indicates, in comments, the origin of
|
|
each declaration (source file and line), whether the declaration was
|
|
implicit, prototyped or unprototyped (<B>I</B>, <B>N</B> for new or
|
|
<B>O</B> for old, respectively, in the first character after the line
|
|
number and the colon), and whether it came from a declaration or a
|
|
definition (<B>C</B> or <B>F</B>, respectively, in the following
|
|
character). In the case of function definitions, a K&R-style list of
|
|
arguments followed by their declarations is also provided, inside
|
|
comments, after the declaration.
|
|
<DT id="157"><B>-fallow-parameterless-variadic-functions</B><DD>
|
|
|
|
|
|
Accept variadic functions without named parameters.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Although it is possible to define such a function, this is not very
|
|
useful as it is not possible to read the arguments. This is only
|
|
supported for C as this construct is allowed by C<FONT SIZE="-2">++</FONT>.
|
|
<DT id="158"><B>-fno-asm</B><DD>
|
|
|
|
|
|
Do not recognize <TT>"asm"</TT>, <TT>"inline"</TT> or <TT>"typeof"</TT> as a
|
|
keyword, so that code can use these words as identifiers. You can use
|
|
the keywords <TT>"__asm__"</TT>, <TT>"__inline__"</TT> and <TT>"__typeof__"</TT>
|
|
instead. <B>-ansi</B> implies <B>-fno-asm</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In C<FONT SIZE="-2">++</FONT>, this switch only affects the <TT>"typeof"</TT> keyword, since
|
|
<TT>"asm"</TT> and <TT>"inline"</TT> are standard keywords. You may want to
|
|
use the <B>-fno-gnu-keywords</B> flag instead, which has the same
|
|
effect. In C99 mode (<B>-std=c99</B> or <B>-std=gnu99</B>), this
|
|
switch only affects the <TT>"asm"</TT> and <TT>"typeof"</TT> keywords, since
|
|
<TT>"inline"</TT> is a standard keyword in <FONT SIZE="-1">ISO C99.</FONT>
|
|
<DT id="159"><B>-fno-builtin</B><DD>
|
|
|
|
|
|
|
|
<DT id="160"><B>-fno-builtin-</B><I>function</I><DD>
|
|
|
|
|
|
|
|
Don't recognize built-in functions that do not begin with
|
|
<B>__builtin_</B> as prefix.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> normally generates special code to handle certain built-in functions
|
|
more efficiently; for instance, calls to <TT>"alloca"</TT> may become single
|
|
instructions which adjust the stack directly, and calls to <TT>"memcpy"</TT>
|
|
may become inline copy loops. The resulting code is often both smaller
|
|
and faster, but since the function calls no longer appear as such, you
|
|
cannot set a breakpoint on those calls, nor can you change the behavior
|
|
of the functions by linking with a different library. In addition,
|
|
when a function is recognized as a built-in function, <FONT SIZE="-1">GCC</FONT> may use
|
|
information about that function to warn about problems with calls to
|
|
that function, or to generate more efficient code, even if the
|
|
resulting code still contains calls to that function. For example,
|
|
warnings are given with <B>-Wformat</B> for bad calls to
|
|
<TT>"printf"</TT> when <TT>"printf"</TT> is built in and <TT>"strlen"</TT> is
|
|
known not to modify global memory.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With the <B>-fno-builtin-</B><I>function</I> option
|
|
only the built-in function <I>function</I> is
|
|
disabled. <I>function</I> must not begin with <B>__builtin_</B>. If a
|
|
function is named that is not built-in in this version of <FONT SIZE="-1">GCC,</FONT> this
|
|
option is ignored. There is no corresponding
|
|
<B>-fbuiltin-</B><I>function</I> option; if you wish to enable
|
|
built-in functions selectively when using <B>-fno-builtin</B> or
|
|
<B>-ffreestanding</B>, you may define macros such as:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
#define <A HREF="/cgi-bin/man/man2html?n+abs">abs</A>(n) __builtin_abs ((n))
|
|
#define strcpy(d, s) __builtin_strcpy ((d), (s))
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="161"><B>-fgimple</B><DD>
|
|
|
|
|
|
Enable parsing of function definitions marked with <TT>"__GIMPLE"</TT>.
|
|
This is an experimental feature that allows unit testing of <FONT SIZE="-1">GIMPLE</FONT>
|
|
passes.
|
|
<DT id="162"><B>-fhosted</B><DD>
|
|
|
|
|
|
Assert that compilation targets a hosted environment. This implies
|
|
<B>-fbuiltin</B>. A hosted environment is one in which the
|
|
entire standard library is available, and in which <TT>"main"</TT> has a return
|
|
type of <TT>"int"</TT>. Examples are nearly everything except a kernel.
|
|
This is equivalent to <B>-fno-freestanding</B>.
|
|
<DT id="163"><B>-ffreestanding</B><DD>
|
|
|
|
|
|
Assert that compilation targets a freestanding environment. This
|
|
implies <B>-fno-builtin</B>. A freestanding environment
|
|
is one in which the standard library may not exist, and program startup may
|
|
not necessarily be at <TT>"main"</TT>. The most obvious example is an <FONT SIZE="-1">OS</FONT> kernel.
|
|
This is equivalent to <B>-fno-hosted</B>.
|
|
<DT id="164"><B>-fopenacc</B><DD>
|
|
|
|
|
|
Enable handling of OpenACC directives <TT>"#pragma acc"</TT> in C/C<FONT SIZE="-2">++</FONT> and
|
|
<TT>"!$acc"</TT> in Fortran. When <B>-fopenacc</B> is specified, the
|
|
compiler generates accelerated code according to the OpenACC Application
|
|
Programming Interface v2.0 <<B><A HREF="https://www.openacc.org">https://www.openacc.org</A></B>>. This option
|
|
implies <B>-pthread</B>, and thus is only supported on targets that
|
|
have support for <B>-pthread</B>.
|
|
<DT id="165"><B>-fopenacc-dim=</B><I>geom</I><DD>
|
|
|
|
|
|
Specify default compute dimensions for parallel offload regions that do
|
|
not explicitly specify. The <I>geom</I> 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.
|
|
<DT id="166"><B>-fopenmp</B><DD>
|
|
|
|
|
|
Enable handling of OpenMP directives <TT>"#pragma omp"</TT> in C/C<FONT SIZE="-2">++</FONT> and
|
|
<TT>"!$omp"</TT> in Fortran. When <B>-fopenmp</B> is specified, the
|
|
compiler generates parallel code according to the OpenMP Application
|
|
Program Interface v4.5 <<B><A HREF="https://www.openmp.org">https://www.openmp.org</A></B>>. This option
|
|
implies <B>-pthread</B>, and thus is only supported on targets that
|
|
have support for <B>-pthread</B>. <B>-fopenmp</B> implies
|
|
<B>-fopenmp-simd</B>.
|
|
<DT id="167"><B>-fopenmp-simd</B><DD>
|
|
|
|
|
|
Enable handling of OpenMP's <FONT SIZE="-1">SIMD</FONT> directives with <TT>"#pragma omp"</TT>
|
|
in C/C<FONT SIZE="-2">++</FONT> and <TT>"!$omp"</TT> in Fortran. Other OpenMP directives
|
|
are ignored.
|
|
<DT id="168"><B>-fgnu-tm</B><DD>
|
|
|
|
|
|
When the option <B>-fgnu-tm</B> is specified, the compiler
|
|
generates code for the Linux variant of Intel's current Transactional
|
|
Memory <FONT SIZE="-1">ABI</FONT> specification document (Revision 1.1, May 6 2009). This is
|
|
an experimental feature whose interface may change in future versions
|
|
of <FONT SIZE="-1">GCC,</FONT> as the official specification changes. Please note that not
|
|
all architectures are supported for this feature.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For more information on <FONT SIZE="-1">GCC</FONT>'s support for transactional memory,
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that the transactional memory feature is not supported with
|
|
non-call exceptions (<B>-fnon-call-exceptions</B>).
|
|
<DT id="169"><B>-fms-extensions</B><DD>
|
|
|
|
|
|
Accept some non-standard constructs used in Microsoft header files.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In C<FONT SIZE="-2">++</FONT> code, this allows member names in structures to be similar
|
|
to previous types declarations.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
typedef int UOW;
|
|
struct ABC {
|
|
UOW UOW;
|
|
};
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Some cases of unnamed fields in structures and unions are only
|
|
accepted with this option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that this option is off for all targets but x86
|
|
targets using ms-abi.
|
|
<DT id="170"><B>-fplan9-extensions</B><DD>
|
|
|
|
|
|
Accept some non-standard constructs used in Plan 9 code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This enables <B>-fms-extensions</B>, permits passing pointers to
|
|
structures with anonymous fields to functions that expect pointers to
|
|
elements of the type of the field, and permits referring to anonymous
|
|
fields declared using a typedef. This is only
|
|
supported for C, not C<FONT SIZE="-2">++</FONT>.
|
|
<DT id="171"><B>-fcond-mismatch</B><DD>
|
|
|
|
|
|
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<FONT SIZE="-2">++</FONT>.
|
|
<DT id="172"><B>-flax-vector-conversions</B><DD>
|
|
|
|
|
|
Allow implicit conversions between vectors with differing numbers of
|
|
elements and/or incompatible element types. This option should not be
|
|
used for new code.
|
|
<DT id="173"><B>-funsigned-char</B><DD>
|
|
|
|
|
|
Let the type <TT>"char"</TT> be unsigned, like <TT>"unsigned char"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Each kind of machine has a default for what <TT>"char"</TT> should
|
|
be. It is either like <TT>"unsigned char"</TT> by default or like
|
|
<TT>"signed char"</TT> by default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Ideally, a portable program should always use <TT>"signed char"</TT> or
|
|
<TT>"unsigned char"</TT> when it depends on the signedness of an object.
|
|
But many programs have been written to use plain <TT>"char"</TT> and
|
|
expect it to be signed, or expect it to be unsigned, depending on the
|
|
machines they were written for. This option, and its inverse, let you
|
|
make such a program work with the opposite default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The type <TT>"char"</TT> is always a distinct type from each of
|
|
<TT>"signed char"</TT> or <TT>"unsigned char"</TT>, even though its behavior
|
|
is always just like one of those two.
|
|
<DT id="174"><B>-fsigned-char</B><DD>
|
|
|
|
|
|
Let the type <TT>"char"</TT> be signed, like <TT>"signed char"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that this is equivalent to <B>-fno-unsigned-char</B>, which is
|
|
the negative form of <B>-funsigned-char</B>. Likewise, the option
|
|
<B>-fno-signed-char</B> is equivalent to <B>-funsigned-char</B>.
|
|
<DT id="175"><B>-fsigned-bitfields</B><DD>
|
|
|
|
|
|
|
|
<DT id="176"><B>-funsigned-bitfields</B><DD>
|
|
|
|
|
|
<DT id="177"><B>-fno-signed-bitfields</B><DD>
|
|
|
|
|
|
<DT id="178"><B>-fno-unsigned-bitfields</B><DD>
|
|
|
|
|
|
|
|
These options control whether a bit-field is signed or unsigned, when the
|
|
declaration does not use either <TT>"signed"</TT> or <TT>"unsigned"</TT>. By
|
|
default, such a bit-field is signed, because this is consistent: the
|
|
basic integer types such as <TT>"int"</TT> are signed types.
|
|
<DT id="179"><B>-fsso-struct=</B><I>endianness</I><DD>
|
|
|
|
|
|
Set the default scalar storage order of structures and unions to the
|
|
specified endianness. The accepted values are <B>big-endian</B>,
|
|
<B>little-endian</B> and <B>native</B> for the native endianness of
|
|
the target (the default). This option is not supported for C<FONT SIZE="-2">++</FONT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> the <B>-fsso-struct</B> switch causes <FONT SIZE="-1">GCC</FONT> to generate
|
|
code that is not binary compatible with code generated without it if the
|
|
specified endianness is not the native endianness of the target.
|
|
</DL>
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>Options Controlling C<FONT SIZE="-2">++</FONT> Dialect</H3>
|
|
|
|
|
|
|
|
This section describes the command-line options that are only meaningful
|
|
for C<FONT SIZE="-2">++</FONT> programs. You can also use most of the <FONT SIZE="-1">GNU</FONT> compiler options
|
|
regardless of what language your program is in. For example, you
|
|
might compile a file <I>firstClass.C</I> like this:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
g++ -g -fstrict-enums -O -c firstClass.C
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
In this example, only <B>-fstrict-enums</B> is an option meant
|
|
only for C<FONT SIZE="-2">++</FONT> programs; you can use the other options with any
|
|
language supported by <FONT SIZE="-1">GCC.</FONT>
|
|
<P>
|
|
|
|
Some options for compiling C programs, such as <B>-std</B>, are also
|
|
relevant for C<FONT SIZE="-2">++</FONT> programs.
|
|
<P>
|
|
|
|
Here is a list of options that are <I>only</I> for compiling C<FONT SIZE="-2">++</FONT> programs:
|
|
<DL COMPACT>
|
|
<DT id="180"><B>-fabi-version=</B><I>n</I><DD>
|
|
|
|
|
|
Use version <I>n</I> of the C<FONT SIZE="-2">++</FONT> <FONT SIZE="-1">ABI.</FONT> The default is version 0.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 0 refers to the version conforming most closely to
|
|
the C<FONT SIZE="-2">++</FONT> <FONT SIZE="-1">ABI</FONT> specification. Therefore, the <FONT SIZE="-1">ABI</FONT> obtained using version 0
|
|
will change in different versions of G++ as <FONT SIZE="-1">ABI</FONT> bugs are fixed.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 1 is the version of the C<FONT SIZE="-2">++</FONT> <FONT SIZE="-1">ABI</FONT> that first appeared in G++ 3.2.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 2 is the version of the C<FONT SIZE="-2">++</FONT> <FONT SIZE="-1">ABI</FONT> that first appeared in G++
|
|
3.4, and was the default through G++ 4.9.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 3 corrects an error in mangling a constant address as a
|
|
template argument.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 4, which first appeared in G++ 4.5, implements a standard
|
|
mangling for vector types.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 5, which first appeared in G++ 4.6, corrects the mangling of
|
|
attribute const/volatile on function pointer types, decltype of a
|
|
plain decl, and use of a function parameter in the declaration of
|
|
another parameter.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 6, which first appeared in G++ 4.7, corrects the promotion
|
|
behavior of C<FONT SIZE="-2">++</FONT>11 scoped enums and the mangling of template argument
|
|
packs, const/static_cast, prefix ++ and --, and a class scope function
|
|
used as a template argument.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
|
|
builtin type and corrects the mangling of lambdas in default argument
|
|
scope.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 8, which first appeared in G++ 4.9, corrects the substitution
|
|
behavior of function types with function-cv-qualifiers.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 9, which first appeared in G++ 5.2, corrects the alignment of
|
|
<TT>"nullptr_t"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 10, which first appeared in G++ 6.1, adds mangling of
|
|
attributes that affect type identity, such as ia32 calling convention
|
|
attributes (e.g. <B>stdcall</B>).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 11, which first appeared in G++ 7, corrects the mangling of
|
|
sizeof... expressions and operator names. For multiple entities with
|
|
the same name within a function, that are declared in different scopes,
|
|
the mangling now changes starting with the twelfth occurrence. It also
|
|
implies <B>-fnew-inheriting-ctors</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 12, which first appeared in G++ 8, corrects the calling
|
|
conventions for empty classes on the x86_64 target and for classes
|
|
with only deleted copy/move constructors. It accidentally changes the
|
|
calling convention for classes with a deleted copy constructor and a
|
|
trivial move constructor.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 13, which first appeared in G++ 8.2, fixes the accidental
|
|
change in version 12.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
See also <B>-Wabi</B>.
|
|
<DT id="181"><B>-fabi-compat-version=</B><I>n</I><DD>
|
|
|
|
|
|
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.
|
|
This switch specifies which <FONT SIZE="-1">ABI</FONT> version to use for the alias.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-fabi-version=0</B> (the default), this defaults to 11 (<FONT SIZE="-1">GCC 7</FONT>
|
|
compatibility). If another <FONT SIZE="-1">ABI</FONT> version is explicitly selected, this
|
|
defaults to 0. For compatibility with <FONT SIZE="-1">GCC</FONT> versions 3.2 through 4.9,
|
|
use <B>-fabi-compat-version=2</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If this option is not provided but <B>-Wabi=</B><I>n</I> is, that
|
|
version is used for compatibility aliases. If this option is provided
|
|
along with <B>-Wabi</B> (without the version), the version from this
|
|
option is used for the warning.
|
|
<DT id="182"><B>-fno-access-control</B><DD>
|
|
|
|
|
|
Turn off all access checking. This switch is mainly useful for working
|
|
around bugs in the access control code.
|
|
<DT id="183"><B>-faligned-new</B><DD>
|
|
|
|
|
|
Enable support for C<FONT SIZE="-2">++</FONT>17 <TT>"new"</TT> of types that require more
|
|
alignment than <TT>"void* ::operator new(std::size_t)"</TT> provides. A
|
|
numeric argument such as <TT>"-faligned-new=32"</TT> can be used to
|
|
specify how much alignment (in bytes) is provided by that function,
|
|
but few users will need to override the default of
|
|
<TT>"alignof(std::max_align_t)"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This flag is enabled by default for <B>-std=c++17</B>.
|
|
<DT id="184"><B>-fchar8_t</B><DD>
|
|
|
|
|
|
|
|
<DT id="185"><B>-fno-char8_t</B><DD>
|
|
|
|
|
|
|
|
Enable support for <TT>"char8_t"</TT> as adopted for C<FONT SIZE="-2">++</FONT>2a. This includes
|
|
the addition of a new <TT>"char8_t"</TT> fundamental type, changes to the
|
|
types of <FONT SIZE="-1">UTF-8</FONT> string and character literals, new signatures for
|
|
user-defined literals, associated standard library updates, and new
|
|
<TT>"__cpp_char8_t"</TT> and <TT>"__cpp_lib_char8_t"</TT> feature test macros.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option enables functions to be overloaded for ordinary and <FONT SIZE="-1">UTF-8</FONT>
|
|
strings:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int f(const char *); // #1
|
|
int f(const char8_t *); // #2
|
|
int v1 = f("text"); // Calls #1
|
|
int v2 = f(u8"text"); // Calls #2
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
and introduces new signatures for user-defined literals:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int operator""_udl1(char8_t);
|
|
int v3 = u8'x'_udl1;
|
|
int operator""_udl2(const char8_t*, std::size_t);
|
|
int v4 = u8"text"_udl2;
|
|
template<typename T, T...> int operator""_udl3();
|
|
int v5 = u8"text"_udl3;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The change to the types of <FONT SIZE="-1">UTF-8</FONT> string and character literals introduces
|
|
incompatibilities with <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT>11</FONT> and later standards. For example, the
|
|
following code is well-formed under <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT>11,</FONT> but is ill-formed when
|
|
<B>-fchar8_t</B> is specified.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
char ca[] = u8"xx"; // error: char-array initialized from wide
|
|
// string
|
|
const char *cp = u8"xx";// error: invalid conversion from
|
|
// `const char8_t*' to `const char*'
|
|
int f(const char*);
|
|
auto v = f(u8"xx"); // error: invalid conversion from
|
|
// `const char8_t*' to `const char*'
|
|
std::string s{u8"xx"}; // error: no matching function for call to
|
|
// `std::basic_string<char>::basic_string()'
|
|
using namespace std::literals;
|
|
s = u8"xx"s; // error: conversion from
|
|
// `basic_string<char8_t>' to non-scalar
|
|
// type `basic_string<char>' requested
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="186"><B>-fcheck-new</B><DD>
|
|
|
|
|
|
Check that the pointer returned by <TT>"operator new"</TT> is non-null
|
|
before attempting to modify the storage allocated. This check is
|
|
normally unnecessary because the C<FONT SIZE="-2">++</FONT> standard specifies that
|
|
<TT>"operator new"</TT> only returns <TT>0</TT> if it is declared
|
|
<TT>"throw()"</TT>, in which case the compiler always checks the
|
|
return value even without this option. In all other cases, when
|
|
<TT>"operator new"</TT> has a non-empty exception specification, memory
|
|
exhaustion is signalled by throwing <TT>"std::bad_alloc"</TT>. See also
|
|
<B>new (nothrow)</B>.
|
|
<DT id="187"><B>-fconcepts</B><DD>
|
|
|
|
|
|
Enable support for the C<FONT SIZE="-2">++</FONT> Extensions for Concepts Technical
|
|
Specification, <FONT SIZE="-1">ISO 19217</FONT> (2015), which allows code like
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
template <class T> concept bool Addable = requires (T t) { t + t; };
|
|
template <Addable T> T add (T a, T b) { return a + b; }
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="188"><B>-fconstexpr-depth=</B><I>n</I><DD>
|
|
|
|
|
|
Set the maximum nested evaluation depth for C<FONT SIZE="-2">++</FONT>11 constexpr functions
|
|
to <I>n</I>. A limit is needed to detect endless recursion during
|
|
constant expression evaluation. The minimum specified by the standard
|
|
is 512.
|
|
<DT id="189"><B>-fconstexpr-loop-limit=</B><I>n</I><DD>
|
|
|
|
|
|
Set the maximum number of iterations for a loop in C<FONT SIZE="-2">++</FONT>14 constexpr functions
|
|
to <I>n</I>. A limit is needed to detect infinite loops during
|
|
constant expression evaluation. The default is 262144 (1<<18).
|
|
<DT id="190"><B>-fconstexpr-ops-limit=</B><I>n</I><DD>
|
|
|
|
|
|
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
|
|
smaller than the above limit, or if in a body of some loop or even outside
|
|
of a loop too many expressions need to be evaluated, the resulting constexpr
|
|
evaluation might take too long.
|
|
The default is 33554432 (1<<25).
|
|
<DT id="191"><B>-fdeduce-init-list</B><DD>
|
|
|
|
|
|
Enable deduction of a template type parameter as
|
|
<TT>"std::initializer_list"</TT> from a brace-enclosed initializer list, i.e.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
template <class T> auto forward(T t) -> decltype (realfn (t))
|
|
{
|
|
return realfn (t);
|
|
}
|
|
|
|
void f()
|
|
{
|
|
forward({1,2}); // call forward<std::initializer_list<int>>
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This deduction was implemented as a possible extension to the
|
|
originally proposed semantics for the C<FONT SIZE="-2">++</FONT>11 standard, but was not part
|
|
of the final standard, so it is disabled by default. This option is
|
|
deprecated, and may be removed in a future version of G++.
|
|
<DT id="192"><B>-fno-elide-constructors</B><DD>
|
|
|
|
|
|
The C<FONT SIZE="-2">++</FONT> 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
|
|
call the copy constructor in all cases. This option also causes G++
|
|
to call trivial member functions which otherwise would be expanded inline.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In C<FONT SIZE="-2">++</FONT>17, the compiler is required to omit these temporaries, but this
|
|
option still affects trivial member functions.
|
|
<DT id="193"><B>-fno-enforce-eh-specs</B><DD>
|
|
|
|
|
|
Don't generate code to check for violation of exception specifications
|
|
at run time. This option violates the C<FONT SIZE="-2">++</FONT> standard, but may be useful
|
|
for reducing code size in production builds, much like defining
|
|
<TT>"NDEBUG"</TT>. This does not give user code permission to throw
|
|
exceptions in violation of the exception specifications; the compiler
|
|
still optimizes based on the specifications, so throwing an
|
|
unexpected exception results in undefined behavior at run time.
|
|
<DT id="194"><B>-fextern-tls-init</B><DD>
|
|
|
|
|
|
|
|
<DT id="195"><B>-fno-extern-tls-init</B><DD>
|
|
|
|
|
|
|
|
The C<FONT SIZE="-2">++</FONT>11 and OpenMP standards allow <TT>"thread_local"</TT> and
|
|
<TT>"threadprivate"</TT> variables to have dynamic (runtime)
|
|
initialization. To support this, any use of such a variable goes
|
|
through a wrapper function that performs any necessary initialization.
|
|
When the use and definition of the variable are in the same
|
|
translation unit, this overhead can be optimized away, but when the
|
|
use is in a different translation unit there is significant overhead
|
|
even if the variable doesn't actually need dynamic initialization. If
|
|
the programmer can be sure that no use of the variable in a
|
|
non-defining <FONT SIZE="-1">TU</FONT> needs to trigger dynamic initialization (either
|
|
because the variable is statically initialized, or a use of the
|
|
variable in the defining <FONT SIZE="-1">TU</FONT> will be executed before any uses in
|
|
another <FONT SIZE="-1">TU</FONT>), they can avoid this overhead with the
|
|
<B>-fno-extern-tls-init</B> option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On targets that support symbol aliases, the default is
|
|
<B>-fextern-tls-init</B>. On targets that do not support symbol
|
|
aliases, the default is <B>-fno-extern-tls-init</B>.
|
|
<DT id="196"><B>-fno-gnu-keywords</B><DD>
|
|
|
|
|
|
Do not recognize <TT>"typeof"</TT> as a keyword, so that code can use this
|
|
word as an identifier. You can use the keyword <TT>"__typeof__"</TT> instead.
|
|
This option is implied by the strict <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT></FONT> dialects: <B>-ansi</B>,
|
|
<B>-std=c++98</B>, <B>-std=c++11</B>, etc.
|
|
<DT id="197"><B>-fno-implicit-templates</B><DD>
|
|
|
|
|
|
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
|
|
include all the necessary explicit instantiations to avoid getting
|
|
undefined symbols at link time.
|
|
<DT id="198"><B>-fno-implicit-inline-templates</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="199"><B>-fno-implement-inlines</B><DD>
|
|
|
|
|
|
To save space, do not emit out-of-line copies of inline functions
|
|
controlled by <TT>"#pragma implementation"</TT>. This causes linker
|
|
errors if these functions are not inlined everywhere they are called.
|
|
<DT id="200"><B>-fms-extensions</B><DD>
|
|
|
|
|
|
Disable Wpedantic warnings about constructs used in <FONT SIZE="-1">MFC,</FONT> such as implicit
|
|
int and getting a pointer to member function via non-standard syntax.
|
|
<DT id="201"><B>-fnew-inheriting-ctors</B><DD>
|
|
|
|
|
|
Enable the P0136 adjustment to the semantics of C<FONT SIZE="-2">++</FONT>11 constructor
|
|
inheritance. This is part of C<FONT SIZE="-2">++</FONT>17 but also considered to be a Defect
|
|
Report against C<FONT SIZE="-2">++</FONT>11 and C<FONT SIZE="-2">++</FONT>14. This flag is enabled by default
|
|
unless <B>-fabi-version=10</B> or lower is specified.
|
|
<DT id="202"><B>-fnew-ttp-matching</B><DD>
|
|
|
|
|
|
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
|
|
<B>-std=c++17</B>.
|
|
<DT id="203"><B>-fno-nonansi-builtins</B><DD>
|
|
|
|
|
|
Disable built-in declarations of functions that are not mandated by
|
|
<FONT SIZE="-1">ANSI/ISO C.</FONT> These include <TT>"ffs"</TT>, <TT>"alloca"</TT>, <TT>"_exit"</TT>,
|
|
<TT>"index"</TT>, <TT>"bzero"</TT>, <TT>"conjf"</TT>, and other related functions.
|
|
<DT id="204"><B>-fnothrow-opt</B><DD>
|
|
|
|
|
|
Treat a <TT>"throw()"</TT> exception specification as if it were a
|
|
<TT>"noexcept"</TT> specification to reduce or eliminate the text size
|
|
overhead relative to a function with no exception specification. If
|
|
the function has local variables of types with non-trivial
|
|
destructors, the exception specification actually makes the
|
|
function smaller because the <FONT SIZE="-1">EH</FONT> cleanups for those variables can be
|
|
optimized away. The semantic effect is that an exception thrown out of
|
|
a function with such an exception specification results in a call
|
|
to <TT>"terminate"</TT> rather than <TT>"unexpected"</TT>.
|
|
<DT id="205"><B>-fno-operator-names</B><DD>
|
|
|
|
|
|
Do not treat the operator name keywords <TT>"and"</TT>, <TT>"bitand"</TT>,
|
|
<TT>"bitor"</TT>, <TT>"compl"</TT>, <TT>"not"</TT>, <TT>"or"</TT> and <TT>"xor"</TT> as
|
|
synonyms as keywords.
|
|
<DT id="206"><B>-fno-optional-diags</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="207"><B>-fpermissive</B><DD>
|
|
|
|
|
|
Downgrade some diagnostics about nonconformant code from errors to
|
|
warnings. Thus, using <B>-fpermissive</B> allows some
|
|
nonconforming code to compile.
|
|
<DT id="208"><B>-fno-pretty-templates</B><DD>
|
|
|
|
|
|
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
|
|
typenames in the signature (e.g. <TT>"void f(T) [with T = int]"</TT>
|
|
rather than <TT>"void f(int)"</TT>) so that it's clear which template is
|
|
involved. When an error message refers to a specialization of a class
|
|
template, the compiler omits any template arguments that match
|
|
the default template arguments for that template. If either of these
|
|
behaviors make it harder to understand the error message rather than
|
|
easier, you can use <B>-fno-pretty-templates</B> to disable them.
|
|
<DT id="209"><B>-frepo</B><DD>
|
|
|
|
|
|
Enable automatic template instantiation at link time. This option also
|
|
implies <B>-fno-implicit-templates</B>.
|
|
<DT id="210"><B>-fno-rtti</B><DD>
|
|
|
|
|
|
Disable generation of information about every class with virtual
|
|
functions for use by the C<FONT SIZE="-2">++</FONT> run-time type identification features
|
|
(<TT>"dynamic_cast"</TT> and <TT>"typeid"</TT>). If you don't use those parts
|
|
of the language, you can save some space by using this flag. Note that
|
|
exception handling uses the same information, but G++ generates it as
|
|
needed. The <TT>"dynamic_cast"</TT> operator can still be used for casts that
|
|
do not require run-time type information, i.e. casts to <TT>"void *"</TT> or to
|
|
unambiguous base classes.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Mixing code compiled with <B>-frtti</B> with that compiled with
|
|
<B>-fno-rtti</B> may not work. For example, programs may
|
|
fail to link if a class compiled with <B>-fno-rtti</B> is used as a base
|
|
for a class compiled with <B>-frtti</B>.
|
|
<DT id="211"><B>-fsized-deallocation</B><DD>
|
|
|
|
|
|
Enable the built-in global declarations
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void operator delete (void *, std::size_t) noexcept;
|
|
void operator delete[] (void *, std::size_t) noexcept;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
as introduced in C<FONT SIZE="-2">++</FONT>14. This is useful for user-defined replacement
|
|
deallocation functions that, for example, use the size of the object
|
|
to make deallocation faster. Enabled by default under
|
|
<B>-std=c++14</B> and above. The flag <B>-Wsized-deallocation</B>
|
|
warns about places that might want to add a definition.
|
|
<DT id="212"><B>-fstrict-enums</B><DD>
|
|
|
|
|
|
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<FONT SIZE="-2">++</FONT> standard; basically, a value that can be
|
|
represented in the minimum number of bits needed to represent all the
|
|
enumerators). This assumption may not be valid if the program uses a
|
|
cast to convert an arbitrary integer value to the enumerated type.
|
|
<DT id="213"><B>-fstrong-eval-order</B><DD>
|
|
|
|
|
|
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<FONT SIZE="-2">++</FONT>17. Enabled by default with <B>-std=c++17</B>.
|
|
<B>-fstrong-eval-order=some</B> enables just the ordering of member
|
|
access and shift expressions, and is the default without
|
|
<B>-std=c++17</B>.
|
|
<DT id="214"><B>-ftemplate-backtrace-limit=</B><I>n</I><DD>
|
|
|
|
|
|
Set the maximum number of template instantiation notes for a single
|
|
warning or error to <I>n</I>. The default value is 10.
|
|
<DT id="215"><B>-ftemplate-depth=</B><I>n</I><DD>
|
|
|
|
|
|
Set the maximum instantiation depth for template classes to <I>n</I>.
|
|
A limit on the template instantiation depth is needed to detect
|
|
endless recursions during template class instantiation. <FONT SIZE="-1">ANSI/ISO C<FONT SIZE="-2">++</FONT></FONT>
|
|
conforming programs must not rely on a maximum depth greater than 17
|
|
(changed to 1024 in C<FONT SIZE="-2">++</FONT>11). The default value is 900, as the compiler
|
|
can run out of stack space before hitting 1024 in some situations.
|
|
<DT id="216"><B>-fno-threadsafe-statics</B><DD>
|
|
|
|
|
|
Do not emit the extra code to use the routines specified in the C<FONT SIZE="-2">++</FONT>
|
|
<FONT SIZE="-1">ABI</FONT> 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.
|
|
<DT id="217"><B>-fuse-cxa-atexit</B><DD>
|
|
|
|
|
|
Register destructors for objects with static storage duration with the
|
|
<TT>"__cxa_atexit"</TT> function rather than the <TT>"atexit"</TT> function.
|
|
This option is required for fully standards-compliant handling of static
|
|
destructors, but only works if your C library supports
|
|
<TT>"__cxa_atexit"</TT>.
|
|
<DT id="218"><B>-fno-use-cxa-get-exception-ptr</B><DD>
|
|
|
|
|
|
Don't use the <TT>"__cxa_get_exception_ptr"</TT> runtime routine. This
|
|
causes <TT>"std::uncaught_exception"</TT> to be incorrect, but is necessary
|
|
if the runtime routine is not available.
|
|
<DT id="219"><B>-fvisibility-inlines-hidden</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The effect of this is that <FONT SIZE="-1">GCC</FONT> may, effectively, mark inline methods with
|
|
<TT>"__attribute__ ((visibility ("hidden")))"</TT> so that they do not
|
|
appear in the export table of a <FONT SIZE="-1">DSO</FONT> and do not require a <FONT SIZE="-1">PLT</FONT> indirection
|
|
when used within the <FONT SIZE="-1">DSO.</FONT> Enabling this option can have a dramatic effect
|
|
on load and link times of a <FONT SIZE="-1">DSO</FONT> as it massively reduces the size of the
|
|
dynamic export table when the library makes heavy use of templates.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The behavior of this switch is not quite the same as marking the
|
|
methods as hidden directly, because it does not affect static variables
|
|
local to the function or cause the compiler to deduce that
|
|
the function is defined in only one shared object.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You may mark a method as having a visibility explicitly to negate the
|
|
effect of the switch for that method. For example, if you do want to
|
|
compare pointers to a particular inline method, you might mark it as
|
|
having default visibility. Marking the enclosing class with explicit
|
|
visibility has no effect.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Explicitly instantiated inline methods are unaffected by this option
|
|
as their linkage might otherwise cross a shared library boundary.
|
|
<DT id="220"><B>-fvisibility-ms-compat</B><DD>
|
|
|
|
|
|
This flag attempts to use visibility settings to make <FONT SIZE="-1">GCC</FONT>'s C<FONT SIZE="-2">++</FONT>
|
|
linkage model compatible with that of Microsoft Visual Studio.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The flag makes these changes to <FONT SIZE="-1">GCC</FONT>'s linkage model:
|
|
<DL COMPACT><DT id="221"><DD>
|
|
<DL COMPACT>
|
|
<DT id="222">1.<DD>
|
|
|
|
|
|
It sets the default visibility to <TT>"hidden"</TT>, like
|
|
<B>-fvisibility=hidden</B>.
|
|
<DT id="223">2.<DD>
|
|
|
|
|
|
Types, but not their members, are not hidden by default.
|
|
<DT id="224">3.<DD>
|
|
|
|
|
|
The One Definition Rule is relaxed for types without explicit
|
|
visibility specifications that are defined in more than one
|
|
shared object: those declarations are permitted if they are
|
|
permitted when this option is not used.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="225"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In new code it is better to use <B>-fvisibility=hidden</B> and
|
|
export those classes that are intended to be externally visible.
|
|
Unfortunately it is possible for code to rely, perhaps accidentally,
|
|
on the Visual Studio behavior.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Among the consequences of these changes are that static data members
|
|
of the same type with the same name but defined in different shared
|
|
objects are different, so changing one does not change the other;
|
|
and that pointers to function members defined in different shared
|
|
objects may not compare equal. When this flag is given, it is a
|
|
violation of the <FONT SIZE="-1">ODR</FONT> to define types with the same name differently.
|
|
</DL>
|
|
|
|
<DT id="226"><B>-fno-weak</B><DD>
|
|
|
|
|
|
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++.
|
|
<DT id="227"><B>-nostdinc++</B><DD>
|
|
|
|
|
|
Do not search for header files in the standard directories specific to
|
|
C<FONT SIZE="-2">++</FONT>, but do still search the other standard directories. (This option
|
|
is used when building the C<FONT SIZE="-2">++</FONT> library.)
|
|
</DL>
|
|
<P>
|
|
|
|
In addition, these optimization, warning, and code generation options
|
|
have meanings only for C<FONT SIZE="-2">++</FONT> programs:
|
|
<DL COMPACT>
|
|
<DT id="228"><B>-Wabi</B> (C, Objective-C, C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when G++ it generates code that is probably not compatible with
|
|
the vendor-neutral C<FONT SIZE="-2">++</FONT> <FONT SIZE="-1">ABI.</FONT> Since G++ now defaults to updating the
|
|
<FONT SIZE="-1">ABI</FONT> with each major release, normally <B>-Wabi</B> will warn only if
|
|
there is a check added later in a release series for an <FONT SIZE="-1">ABI</FONT> issue
|
|
discovered since the initial release. <B>-Wabi</B> will warn about
|
|
more things if an older <FONT SIZE="-1">ABI</FONT> version is selected (with
|
|
<B>-fabi-version=</B><I>n</I>).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Wabi</B> can also be used with an explicit version number to
|
|
warn about compatibility with a particular <B>-fabi-version</B>
|
|
level, e.g. <B>-Wabi=2</B> to warn about changes relative to
|
|
<B>-fabi-version=2</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If an explicit version number is provided and
|
|
<B>-fabi-compat-version</B> is not specified, the version number
|
|
from this option is used for compatibility aliases. If no explicit
|
|
version number is provided with this option, but
|
|
<B>-fabi-compat-version</B> is specified, that version number is
|
|
used for <FONT SIZE="-1">ABI</FONT> warnings.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Although an effort has been made to warn about
|
|
all such cases, there are probably some cases that are not warned about,
|
|
even though G++ is generating incompatible code. There may also be
|
|
cases where warnings are emitted even though the code that is generated
|
|
is compatible.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You should rewrite your code to avoid these warnings if you are
|
|
concerned about the fact that code generated by G++ may not be binary
|
|
compatible with code generated by other compilers.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Known incompatibilities in <B>-fabi-version=2</B> (which was the
|
|
default from <FONT SIZE="-1">GCC 3.4</FONT> to 4.9) include:
|
|
<DL COMPACT><DT id="229"><DD>
|
|
<DL COMPACT>
|
|
<DT id="230">*<DD>
|
|
A template with a non-type template parameter of reference type was
|
|
mangled incorrectly:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
extern int N;
|
|
template <int &> struct S {};
|
|
void n (S<N>) {2}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This was fixed in <B>-fabi-version=3</B>.
|
|
<DT id="231">*<DD>
|
|
<FONT SIZE="-1">SIMD</FONT> vector types declared using <TT>"__attribute ((vector_size))"</TT> were
|
|
mangled in a non-standard way that does not allow for overloading of
|
|
functions taking vectors of different sizes.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The mangling was changed in <B>-fabi-version=4</B>.
|
|
<DT id="232">*<DD>
|
|
<TT>"__attribute ((const))"</TT> and <TT>"noreturn"</TT> were mangled as type
|
|
qualifiers, and <TT>"decltype"</TT> of a plain declaration was folded away.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
These mangling issues were fixed in <B>-fabi-version=5</B>.
|
|
<DT id="233">*<DD>
|
|
Scoped enumerators passed as arguments to a variadic function are
|
|
promoted like unscoped enumerators, causing <TT>"va_arg"</TT> to complain.
|
|
On most targets this does not actually affect the parameter passing
|
|
<FONT SIZE="-1">ABI,</FONT> as there is no way to pass an argument smaller than <TT>"int"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Also, the <FONT SIZE="-1">ABI</FONT> changed the mangling of template argument packs,
|
|
<TT>"const_cast"</TT>, <TT>"static_cast"</TT>, prefix increment/decrement, and
|
|
a class scope function used as a template argument.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
These issues were corrected in <B>-fabi-version=6</B>.
|
|
<DT id="234">*<DD>
|
|
Lambdas in default argument scope were mangled incorrectly, and the
|
|
<FONT SIZE="-1">ABI</FONT> changed the mangling of <TT>"nullptr_t"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
These issues were corrected in <B>-fabi-version=7</B>.
|
|
<DT id="235">*<DD>
|
|
When mangling a function type with function-cv-qualifiers, the
|
|
un-qualified function type was incorrectly treated as a substitution
|
|
candidate.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This was fixed in <B>-fabi-version=8</B>, the default for <FONT SIZE="-1">GCC 5.1.</FONT>
|
|
<DT id="236">*<DD>
|
|
<TT>"decltype(nullptr)"</TT> incorrectly had an alignment of 1, leading to
|
|
unaligned accesses. Note that this did not affect the <FONT SIZE="-1">ABI</FONT> of a
|
|
function with a <TT>"nullptr_t"</TT> parameter, as parameters have a
|
|
minimum alignment.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This was fixed in <B>-fabi-version=9</B>, the default for <FONT SIZE="-1">GCC 5.2.</FONT>
|
|
<DT id="237">*<DD>
|
|
Target-specific attributes that affect the identity of a type, such as
|
|
ia32 calling conventions on a function type (stdcall, regparm, etc.),
|
|
did not affect the mangled name, leading to name collisions when
|
|
function pointers were used as template arguments.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This was fixed in <B>-fabi-version=10</B>, the default for <FONT SIZE="-1">GCC 6.1.</FONT>
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="238"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It also warns about psABI-related changes. The known psABI changes at this
|
|
point include:
|
|
<DL COMPACT>
|
|
<DT id="239">*<DD>
|
|
For SysV/x86-64, unions with <TT>"long double"</TT> members are
|
|
passed in memory as specified in psABI. For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
union U {
|
|
long double ld;
|
|
int i;
|
|
};
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<TT>"union U"</TT> is always passed in memory.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="240"><DD>
|
|
</DL>
|
|
|
|
<DT id="241"><B>-Wabi-tag</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when a type with an <FONT SIZE="-1">ABI</FONT> tag is used in a context that does not
|
|
have that <FONT SIZE="-1">ABI</FONT> tag. See <B>C<FONT SIZE="-2">++</FONT> Attributes</B> for more information
|
|
about <FONT SIZE="-1">ABI</FONT> tags.
|
|
<DT id="242"><B>-Wctor-dtor-privacy</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
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.
|
|
<DT id="243"><B>-Wdelete-non-virtual-dtor</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when <TT>"delete"</TT> 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 <B>-Wall</B>.
|
|
<DT id="244"><B>-Wdeprecated-copy</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
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<FONT SIZE="-2">++</FONT>11 and up. This
|
|
warning is enabled by <B>-Wextra</B>. With
|
|
<B>-Wdeprecated-copy-dtor</B>, also deprecate if the class has a
|
|
user-provided destructor.
|
|
<DT id="245"><B>-Wno-init-list-lifetime</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Do not warn about uses of <TT>"std::initializer_list"</TT> that are likely
|
|
to result in dangling pointers. Since the underlying array for an
|
|
<TT>"initializer_list"</TT> is handled like a normal C<FONT SIZE="-2">++</FONT> temporary object,
|
|
it is easy to inadvertently keep a pointer to the array past the end
|
|
of the array's lifetime. For example:
|
|
<DL COMPACT><DT id="246"><DD>
|
|
<DL COMPACT>
|
|
<DT id="247">*<DD>
|
|
If a function returns a temporary <TT>"initializer_list"</TT>, or a local
|
|
<TT>"initializer_list"</TT> variable, the array's lifetime ends at the end
|
|
of the return statement, so the value returned has a dangling pointer.
|
|
<DT id="248">*<DD>
|
|
If a new-expression creates an <TT>"initializer_list"</TT>, the array only
|
|
lives until the end of the enclosing full-expression, so the
|
|
<TT>"initializer_list"</TT> in the heap has a dangling pointer.
|
|
<DT id="249">*<DD>
|
|
When an <TT>"initializer_list"</TT> variable is assigned from a
|
|
brace-enclosed initializer list, the temporary array created for the
|
|
right side of the assignment only lives until the end of the
|
|
full-expression, so at the next statement the <TT>"initializer_list"</TT>
|
|
variable has a dangling pointer.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
// li's initial underlying array lives as long as li
|
|
std::initializer_list<int> li = { 1,2,3 };
|
|
// assignment changes li to point to a temporary array
|
|
li = { 4, 5 };
|
|
// now the temporary is gone and li has a dangling pointer
|
|
int i = li.begin()[0] // undefined behavior
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="250">*<DD>
|
|
When a list constructor stores the <TT>"begin"</TT> pointer from the
|
|
<TT>"initializer_list"</TT> argument, this doesn't extend the lifetime of
|
|
the array, so if a class variable is constructed from a temporary
|
|
<TT>"initializer_list"</TT>, the pointer is left dangling by the end of
|
|
the variable declaration statement.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="251"><DD>
|
|
</DL>
|
|
|
|
<DT id="252"><B>-Wliteral-suffix</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when a string or character literal is followed by a ud-suffix which does
|
|
not begin with an underscore. As a conforming extension, <FONT SIZE="-1">GCC</FONT> treats such
|
|
suffixes as separate preprocessing tokens in order to maintain backwards
|
|
compatibility with code that uses formatting macros from <TT>"<<A HREF="file:///usr/include/inttypes.h">inttypes.h</A>>"</TT>.
|
|
For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
#define __STDC_FORMAT_MACROS
|
|
#include <<A HREF="file:///usr/include/inttypes.h">inttypes.h</A>>
|
|
#include <<A HREF="file:///usr/include/stdio.h">stdio.h</A>>
|
|
|
|
int main() {
|
|
int64_t i64 = 123;
|
|
printf("My int64: %" PRId64"\n", i64);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In this case, <TT>"PRId64"</TT> is treated as a separate preprocessing token.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Additionally, warn when a user-defined literal operator is declared with
|
|
a literal suffix identifier that doesn't begin with an underscore. Literal
|
|
suffix identifiers that don't begin with an underscore are reserved for
|
|
future standardization.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by default.
|
|
<DT id="253"><B>-Wlto-type-mismatch</B><DD>
|
|
|
|
|
|
During the link-time optimization warn about type mismatches in
|
|
global declarations from different compilation units.
|
|
Requires <B>-flto</B> to be enabled. Enabled by default.
|
|
<DT id="254"><B>-Wno-narrowing</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
For C<FONT SIZE="-2">++</FONT>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,
|
|
but <B>-Wno-narrowing</B> suppresses the diagnostic.
|
|
Note that this does not affect the meaning of well-formed code;
|
|
narrowing conversions are still considered ill-formed in <FONT SIZE="-1">SFINAE</FONT> contexts.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-Wnarrowing</B> in C<FONT SIZE="-2">++</FONT>98, warn when a narrowing
|
|
conversion prohibited by C<FONT SIZE="-2">++</FONT>11 occurs within
|
|
<B>{ }</B>, e.g.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int i = { 2.2 }; // error: narrowing from double to int
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This flag is included in <B>-Wall</B> and <B>-Wc++11-compat</B>.
|
|
<DT id="255"><B>-Wnoexcept</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
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. <TT>"throw()"</TT> or <TT>"noexcept"</TT>) but is known by
|
|
the compiler to never throw an exception.
|
|
<DT id="256"><B>-Wnoexcept-type</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn if the C<FONT SIZE="-2">++</FONT>17 feature making <TT>"noexcept"</TT> part of a function
|
|
type changes the mangled name of a symbol relative to C<FONT SIZE="-2">++</FONT>14. Enabled
|
|
by <B>-Wabi</B> and <B>-Wc++17-compat</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
As an example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
template <class T> void f(T t) { t(); };
|
|
void g() noexcept;
|
|
void h() { f(g); }
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In C<FONT SIZE="-2">++</FONT>14, <TT>"f"</TT> calls <TT>"f<void(*)()>"</TT>, but in
|
|
C<FONT SIZE="-2">++</FONT>17 it calls <TT>"f<void(*)()noexcept>"</TT>.
|
|
<DT id="257"><B>-Wclass-memaccess</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when the destination of a call to a raw memory function such as
|
|
<TT>"memset"</TT> or <TT>"memcpy"</TT> is an object of class type, and when writing
|
|
into such an object might bypass the class non-trivial or deleted constructor
|
|
or copy assignment, violate const-correctness or encapsulation, or corrupt
|
|
virtual table pointers. Modifying the representation of such objects may
|
|
violate invariants maintained by member functions of the class. For example,
|
|
the call to <TT>"memset"</TT> below is undefined because it modifies a non-trivial
|
|
class object and is, therefore, diagnosed. The safe way to either initialize
|
|
or clear the storage of objects of such types is by using the appropriate
|
|
constructor or assignment operator, if one is available.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
std::string str = "abc";
|
|
memset (&str, 0, sizeof str);
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-Wclass-memaccess</B> option is enabled by <B>-Wall</B>.
|
|
Explicitly casting the pointer to the class object to <TT>"void *"</TT> or
|
|
to a type that can be safely accessed by the raw memory function suppresses
|
|
the warning.
|
|
<DT id="258"><B>-Wnon-virtual-dtor</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
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
|
|
class through a pointer to the class itself or base class. This
|
|
warning is automatically enabled if <B>-Weffc++</B> is specified.
|
|
<DT id="259"><B>-Wregister</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn on uses of the <TT>"register"</TT> storage class specifier, except
|
|
when it is part of the <FONT SIZE="-1">GNU</FONT> <B>Explicit Register Variables</B> extension.
|
|
The use of the <TT>"register"</TT> keyword as storage class specifier has
|
|
been deprecated in C<FONT SIZE="-2">++</FONT>11 and removed in C<FONT SIZE="-2">++</FONT>17.
|
|
Enabled by default with <B>-std=c++17</B>.
|
|
<DT id="260"><B>-Wreorder</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when the order of member initializers given in the code does not
|
|
match the order in which they must be executed. For instance:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct A {
|
|
int i;
|
|
int j;
|
|
A(): j (0), i (1) { }
|
|
};
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The compiler rearranges the member initializers for <TT>"i"</TT>
|
|
and <TT>"j"</TT> to match the declaration order of the members, emitting
|
|
a warning to that effect. This warning is enabled by <B>-Wall</B>.
|
|
<DT id="261"><B>-Wno-pessimizing-move</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
This warning warns when a call to <TT>"std::move"</TT> 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
|
|
name of a non-volatile automatic object, and is not a function parameter, and
|
|
has the same type as the function return type.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct T {
|
|
...
|
|
};
|
|
T fn()
|
|
{
|
|
T t;
|
|
...
|
|
return std::move (t);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
But in this example, the <TT>"std::move"</TT> call prevents copy elision.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="262"><B>-Wno-redundant-move</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
This warning warns about redundant calls to <TT>"std::move"</TT>; that is, when
|
|
a move operation would have been performed even without the <TT>"std::move"</TT>
|
|
call. This happens because the compiler is forced to treat the object as if
|
|
it were an rvalue in certain situations such as returning a local variable,
|
|
where copy elision isn't applicable. Consider:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct T {
|
|
...
|
|
};
|
|
T fn(T t)
|
|
{
|
|
...
|
|
return std::move (t);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Here, the <TT>"std::move"</TT> call is redundant. Because G++ implements Core
|
|
Issue 1579, another example is:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct T { // convertible to U
|
|
...
|
|
};
|
|
struct U {
|
|
...
|
|
};
|
|
U fn()
|
|
{
|
|
T t;
|
|
...
|
|
return std::move (t);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In this example, copy elision isn't applicable because the type of the
|
|
expression being returned and the function return type differ, yet G++
|
|
treats the return value as if it were designated by an rvalue.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wextra</B>.
|
|
<DT id="263"><B>-fext-numeric-literals</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Accept imaginary, fixed-point, or machine-defined
|
|
literal number suffixes as <FONT SIZE="-1">GNU</FONT> extensions.
|
|
When this option is turned off these suffixes are treated
|
|
as C<FONT SIZE="-2">++</FONT>11 user-defined literal numeric suffixes.
|
|
This is on by default for all pre-C<FONT SIZE="-2">++</FONT>11 dialects and all <FONT SIZE="-1">GNU</FONT> dialects:
|
|
<B>-std=c++98</B>, <B>-std=gnu++98</B>, <B>-std=gnu++11</B>,
|
|
<B>-std=gnu++14</B>.
|
|
This option is off by default
|
|
for <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT>11</FONT> onwards (<B>-std=c++11</B>, ...).
|
|
</DL>
|
|
<P>
|
|
|
|
The following <B>-W...</B> options are not affected by <B>-Wall</B>.
|
|
<DL COMPACT>
|
|
<DT id="264"><B>-Weffc++</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn about violations of the following style guidelines from Scott Meyers'
|
|
<I>Effective C<FONT SIZE="-2">++</FONT></I> series of books:
|
|
<DL COMPACT><DT id="265"><DD>
|
|
<DL COMPACT>
|
|
<DT id="266">*<DD>
|
|
Define a copy constructor and an assignment operator for classes
|
|
with dynamically-allocated memory.
|
|
<DT id="267">*<DD>
|
|
Prefer initialization to assignment in constructors.
|
|
<DT id="268">*<DD>
|
|
Have <TT>"operator="</TT> return a reference to <TT>*this</TT>.
|
|
<DT id="269">*<DD>
|
|
Don't try to return a reference when you must return an object.
|
|
<DT id="270">*<DD>
|
|
Distinguish between prefix and postfix forms of increment and
|
|
decrement operators.
|
|
<DT id="271">*<DD>
|
|
Never overload <TT>"&&"</TT>, <TT>"||"</TT>, or <TT>","</TT>.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="272"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option also enables <B>-Wnon-virtual-dtor</B>, which is also
|
|
one of the effective C<FONT SIZE="-2">++</FONT> recommendations. However, the check is
|
|
extended to warn about the lack of virtual destructor in accessible
|
|
non-polymorphic bases classes too.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When selecting this option, be aware that the standard library
|
|
headers do not obey all of these guidelines; use <B>grep -v</B>
|
|
to filter out those warnings.
|
|
</DL>
|
|
|
|
<DT id="273"><B>-Wstrict-null-sentinel</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn about the use of an uncasted <TT>"NULL"</TT> as sentinel. When
|
|
compiling only with <FONT SIZE="-1">GCC</FONT> this is a valid sentinel, as <TT>"NULL"</TT> is defined
|
|
to <TT>"__null"</TT>. 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.
|
|
<DT id="274"><B>-Wno-non-template-friend</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Disable warnings when non-template friend functions are declared
|
|
within a template. In very old versions of <FONT SIZE="-1">GCC</FONT> that predate implementation
|
|
of the <FONT SIZE="-1">ISO</FONT> standard, declarations such as
|
|
<B>friend int foo(int)</B>, where the name of the friend is an unqualified-id,
|
|
could be interpreted as a particular specialization of a template
|
|
function; the warning exists to diagnose compatibility problems,
|
|
and is enabled by default.
|
|
<DT id="275"><B>-Wold-style-cast</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn if an old-style (C-style) cast to a non-void type is used within
|
|
a C<FONT SIZE="-2">++</FONT> program. The new-style casts (<TT>"dynamic_cast"</TT>,
|
|
<TT>"static_cast"</TT>, <TT>"reinterpret_cast"</TT>, and <TT>"const_cast"</TT>) are
|
|
less vulnerable to unintended effects and much easier to search for.
|
|
<DT id="276"><B>-Woverloaded-virtual</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when a function declaration hides virtual functions from a
|
|
base class. For example, in:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct A {
|
|
virtual void f();
|
|
};
|
|
|
|
struct B: public A {
|
|
void f(int);
|
|
};
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
the <TT>"A"</TT> class version of <TT>"f"</TT> is hidden in <TT>"B"</TT>, and code
|
|
like:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
B* b;
|
|
b->f();
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
fails to compile.
|
|
<DT id="277"><B>-Wno-pmf-conversions</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Disable the diagnostic for converting a bound pointer to member function
|
|
to a plain pointer.
|
|
<DT id="278"><B>-Wsign-promo</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
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.
|
|
<DT id="279"><B>-Wtemplates</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">STL,</FONT> so
|
|
one can still use the <FONT SIZE="-1">STL.</FONT> One may also instantiate or specialize
|
|
templates.
|
|
<DT id="280"><B>-Wmultiple-inheritance</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">STL,</FONT> so one can still use the <FONT SIZE="-1">STL.</FONT> One may also define
|
|
classes that indirectly use multiple inheritance.
|
|
<DT id="281"><B>-Wvirtual-inheritance</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">STL,</FONT> so one can still use the <FONT SIZE="-1">STL.</FONT> One may also define
|
|
classes that indirectly use virtual inheritance.
|
|
<DT id="282"><B>-Wnamespaces</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">STL,</FONT> so one can still
|
|
use the <FONT SIZE="-1">STL.</FONT> One may also use using directives and qualified names.
|
|
<DT id="283"><B>-Wno-terminate</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Disable the warning about a throw-expression that will immediately
|
|
result in a call to <TT>"terminate"</TT>.
|
|
<DT id="284"><B>-Wno-class-conversion</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Disable the warning about the case 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.
|
|
</DL>
|
|
<A NAME="lbAK"> </A>
|
|
<H3>Options Controlling Objective-C and Objective-C<FONT SIZE="-2">++</FONT> Dialects</H3>
|
|
|
|
|
|
|
|
(<FONT SIZE="-1">NOTE:</FONT> This manual does not describe the Objective-C and Objective-C<FONT SIZE="-2">++</FONT>
|
|
languages themselves.
|
|
<P>
|
|
|
|
This section describes the command-line options that are only meaningful
|
|
for Objective-C and Objective-C<FONT SIZE="-2">++</FONT> programs. You can also use most of
|
|
the language-independent <FONT SIZE="-1">GNU</FONT> compiler options.
|
|
For example, you might compile a file <I>some_class.m</I> like this:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -g -fgnu-runtime -O -c some_class.m
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
In this example, <B>-fgnu-runtime</B> is an option meant only for
|
|
Objective-C and Objective-C<FONT SIZE="-2">++</FONT> programs; you can use the other options with
|
|
any language supported by <FONT SIZE="-1">GCC.</FONT>
|
|
<P>
|
|
|
|
Note that since Objective-C is an extension of the C language, Objective-C
|
|
compilations may also use options specific to the C front-end (e.g.,
|
|
<B>-Wtraditional</B>). Similarly, Objective-C<FONT SIZE="-2">++</FONT> compilations may use
|
|
C<FONT SIZE="-2">++</FONT>-specific options (e.g., <B>-Wabi</B>).
|
|
<P>
|
|
|
|
Here is a list of options that are <I>only</I> for compiling Objective-C
|
|
and Objective-C<FONT SIZE="-2">++</FONT> programs:
|
|
<DL COMPACT>
|
|
<DT id="285"><B>-fconstant-string-class=</B><I>class-name</I><DD>
|
|
|
|
|
|
Use <I>class-name</I> as the name of the class to instantiate for each
|
|
literal string specified with the syntax <TT>"@"...""</TT>. The default
|
|
class name is <TT>"NXConstantString"</TT> if the <FONT SIZE="-1">GNU</FONT> runtime is being used, and
|
|
<TT>"NSConstantString"</TT> if the NeXT runtime is being used (see below). The
|
|
<B>-fconstant-cfstrings</B> option, if also present, overrides the
|
|
<B>-fconstant-string-class</B> setting and cause <TT>"@"...""</TT> literals
|
|
to be laid out as constant CoreFoundation strings.
|
|
<DT id="286"><B>-fgnu-runtime</B><DD>
|
|
|
|
|
|
Generate object code compatible with the standard <FONT SIZE="-1">GNU</FONT> Objective-C
|
|
runtime. This is the default for most types of systems.
|
|
<DT id="287"><B>-fnext-runtime</B><DD>
|
|
|
|
|
|
Generate output compatible with the NeXT runtime. This is the default
|
|
for NeXT-based systems, including Darwin and Mac <FONT SIZE="-1">OS X.</FONT> The macro
|
|
<TT>"__NEXT_RUNTIME__"</TT> is predefined if (and only if) this option is
|
|
used.
|
|
<DT id="288"><B>-fno-nil-receivers</B><DD>
|
|
|
|
|
|
Assume that all Objective-C message dispatches (<TT>"[receiver
|
|
message:arg]"</TT>) in this translation unit ensure that the receiver is
|
|
not <TT>"nil"</TT>. 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 <FONT SIZE="-1">ABI</FONT> version 0 or 1.
|
|
<DT id="289"><B>-fobjc-abi-version=</B><I>n</I><DD>
|
|
|
|
|
|
Use version <I>n</I> of the Objective-C <FONT SIZE="-1">ABI</FONT> for the selected runtime.
|
|
This option is currently supported only for the NeXT runtime. In that
|
|
case, Version 0 is the traditional (32-bit) <FONT SIZE="-1">ABI</FONT> without support for
|
|
properties and other Objective-C 2.0 additions. Version 1 is the
|
|
traditional (32-bit) <FONT SIZE="-1">ABI</FONT> with support for properties and other
|
|
Objective-C 2.0 additions. Version 2 is the modern (64-bit) <FONT SIZE="-1">ABI.</FONT> If
|
|
nothing is specified, the default is Version 0 on 32-bit target
|
|
machines, and Version 2 on 64-bit target machines.
|
|
<DT id="290"><B>-fobjc-call-cxx-cdtors</B><DD>
|
|
|
|
|
|
For each Objective-C class, check if any of its instance variables is a
|
|
C<FONT SIZE="-2">++</FONT> object with a non-trivial default constructor. If so, synthesize a
|
|
special <TT>"- (id) .cxx_construct"</TT> instance method which runs
|
|
non-trivial default constructors on any such instance variables, in order,
|
|
and then return <TT>"self"</TT>. Similarly, check if any instance variable
|
|
is a C<FONT SIZE="-2">++</FONT> object with a non-trivial destructor, and if so, synthesize a
|
|
special <TT>"- (void) .cxx_destruct"</TT> method which runs
|
|
all such default destructors, in reverse order.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <TT>"- (id) .cxx_construct"</TT> and <TT>"- (void) .cxx_destruct"</TT>
|
|
methods thusly generated only operate on instance variables
|
|
declared in the current Objective-C class, and not those inherited
|
|
from superclasses. It is the responsibility of the Objective-C
|
|
runtime to invoke all such methods in an object's inheritance
|
|
hierarchy. The <TT>"- (id) .cxx_construct"</TT> methods are invoked
|
|
by the runtime immediately after a new object instance is allocated;
|
|
the <TT>"- (void) .cxx_destruct"</TT> methods are invoked immediately
|
|
before the runtime deallocates an object instance.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
As of this writing, only the NeXT runtime on Mac <FONT SIZE="-1">OS X 10.4</FONT> and later has
|
|
support for invoking the <TT>"- (id) .cxx_construct"</TT> and
|
|
<TT>"- (void) .cxx_destruct"</TT> methods.
|
|
<DT id="291"><B>-fobjc-direct-dispatch</B><DD>
|
|
|
|
|
|
Allow fast jumps to the message dispatcher. On Darwin this is
|
|
accomplished via the comm page.
|
|
<DT id="292"><B>-fobjc-exceptions</B><DD>
|
|
|
|
|
|
Enable syntactic support for structured exception handling in
|
|
Objective-C, similar to what is offered by C<FONT SIZE="-2">++</FONT>. This option
|
|
is required to use the Objective-C keywords <TT>@try</TT>,
|
|
<TT>@throw</TT>, <TT>@catch</TT>, <TT>@finally</TT> and
|
|
<TT>@synchronized</TT>. This option is available with both the <FONT SIZE="-1">GNU</FONT>
|
|
runtime and the NeXT runtime (but not available in conjunction with
|
|
the NeXT runtime on Mac <FONT SIZE="-1">OS X 10.2</FONT> and earlier).
|
|
<DT id="293"><B>-fobjc-gc</B><DD>
|
|
|
|
|
|
Enable garbage collection (<FONT SIZE="-1">GC</FONT>) in Objective-C and Objective-C<FONT SIZE="-2">++</FONT>
|
|
programs. This option is only available with the NeXT runtime; the
|
|
<FONT SIZE="-1">GNU</FONT> runtime has a different garbage collection implementation that
|
|
does not require special compiler flags.
|
|
<DT id="294"><B>-fobjc-nilcheck</B><DD>
|
|
|
|
|
|
For the NeXT runtime with version 2 of the <FONT SIZE="-1">ABI,</FONT> check for a nil
|
|
receiver in method invocations before doing the actual method call.
|
|
This is the default and can be disabled using
|
|
<B>-fno-objc-nilcheck</B>. Class methods and super calls are never
|
|
checked for nil in this way no matter what this flag is set to.
|
|
Currently this flag does nothing when the <FONT SIZE="-1">GNU</FONT> runtime, or an older
|
|
version of the NeXT runtime <FONT SIZE="-1">ABI,</FONT> is used.
|
|
<DT id="295"><B>-fobjc-std=objc1</B><DD>
|
|
|
|
|
|
Conform to the language syntax of Objective-C 1.0, the language
|
|
recognized by <FONT SIZE="-1">GCC 4.0.</FONT> This only affects the Objective-C additions to
|
|
the C/C<FONT SIZE="-2">++</FONT> language; it does not affect conformance to C/C<FONT SIZE="-2">++</FONT> standards,
|
|
which is controlled by the separate C/C<FONT SIZE="-2">++</FONT> dialect option flags. When
|
|
this option is used with the Objective-C or Objective-C<FONT SIZE="-2">++</FONT> compiler,
|
|
any Objective-C syntax that is not recognized by <FONT SIZE="-1">GCC 4.0</FONT> is rejected.
|
|
This is useful if you need to make sure that your Objective-C code can
|
|
be compiled with older versions of <FONT SIZE="-1">GCC.</FONT>
|
|
<DT id="296"><B>-freplace-objc-classes</B><DD>
|
|
|
|
|
|
Emit a special marker instructing <B><A HREF="/cgi-bin/man/man2html?1+ld">ld</A>(1)</B> not to statically link in
|
|
the resulting object file, and allow <B><A HREF="/cgi-bin/man/man2html?1+dyld">dyld</A>(1)</B> to load it in at
|
|
run time instead. This is used in conjunction with the Fix-and-Continue
|
|
debugging mode, where the object file in question may be recompiled and
|
|
dynamically reloaded in the course of program execution, without the need
|
|
to restart the program itself. Currently, Fix-and-Continue functionality
|
|
is only available in conjunction with the NeXT runtime on Mac <FONT SIZE="-1">OS X 10.3</FONT>
|
|
and later.
|
|
<DT id="297"><B>-fzero-link</B><DD>
|
|
|
|
|
|
When compiling for the NeXT runtime, the compiler ordinarily replaces calls
|
|
to <TT>"objc_getClass("...")"</TT> (when the name of the class is known at
|
|
compile time) with static class references that get initialized at load time,
|
|
which improves run-time performance. Specifying the <B>-fzero-link</B> flag
|
|
suppresses this behavior and causes calls to <TT>"objc_getClass("...")"</TT>
|
|
to be retained. This is useful in Zero-Link debugging mode, since it allows
|
|
for individual class implementations to be modified during program execution.
|
|
The <FONT SIZE="-1">GNU</FONT> runtime currently always retains calls to <TT>"objc_get_class("...")"</TT>
|
|
regardless of command-line options.
|
|
<DT id="298"><B>-fno-local-ivars</B><DD>
|
|
|
|
|
|
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
|
|
and other variables declared either locally inside a class method or
|
|
globally with the same name. Specifying the <B>-fno-local-ivars</B>
|
|
flag disables this behavior thus avoiding variable shadowing issues.
|
|
<DT id="299"><B>-fivar-visibility=</B>[<B>public</B>|<B>protected</B>|<B>private</B>|<B>package</B>]<DD>
|
|
|
|
|
|
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.
|
|
<DT id="300"><B>-gen-decls</B><DD>
|
|
|
|
|
|
Dump interface declarations for all classes seen in the source file to a
|
|
file named <I>sourcename.decl</I>.
|
|
<DT id="301"><B>-Wassign-intercept</B> (Objective-C and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn whenever an Objective-C assignment is being intercepted by the
|
|
garbage collector.
|
|
<DT id="302"><B>-Wno-protocol</B> (Objective-C and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
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
|
|
implemented in the class, even if a method implementation is inherited
|
|
from the superclass. If you use the <B>-Wno-protocol</B> option, then
|
|
methods inherited from the superclass are considered to be implemented,
|
|
and no warning is issued for them.
|
|
<DT id="303"><B>-Wselector</B> (Objective-C and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
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
|
|
for each selector appearing in a <TT>"@selector(...)"</TT>
|
|
expression, and a corresponding method for that selector has been found
|
|
during compilation. Because these checks scan the method table only at
|
|
the end of compilation, these warnings are not produced if the final
|
|
stage of compilation is not reached, for example because an error is
|
|
found during compilation, or because the <B>-fsyntax-only</B> option is
|
|
being used.
|
|
<DT id="304"><B>-Wstrict-selector-match</B> (Objective-C and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
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 <TT>"id"</TT> or <TT>"Class"</TT>. When this flag
|
|
is off (which is the default behavior), the compiler omits such warnings
|
|
if any differences found are confined to types that share the same size
|
|
and alignment.
|
|
<DT id="305"><B>-Wundeclared-selector</B> (Objective-C and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn if a <TT>"@selector(...)"</TT> expression referring to an
|
|
undeclared selector is found. A selector is considered undeclared if no
|
|
method with that name has been declared before the
|
|
<TT>"@selector(...)"</TT> expression, either explicitly in an
|
|
<TT>@interface</TT> or <TT>@protocol</TT> declaration, or implicitly in
|
|
an <TT>@implementation</TT> section. This option always performs its
|
|
checks as soon as a <TT>"@selector(...)"</TT> expression is found,
|
|
while <B>-Wselector</B> only performs its checks in the final stage of
|
|
compilation. This also enforces the coding style convention
|
|
that methods and selectors must be declared before being used.
|
|
<DT id="306"><B>-print-objc-runtime-info</B><DD>
|
|
|
|
|
|
Generate C header describing the largest structure that is passed by
|
|
value, if any.
|
|
</DL>
|
|
<A NAME="lbAL"> </A>
|
|
<H3>Options to Control Diagnostic Messages Formatting</H3>
|
|
|
|
|
|
|
|
Traditionally, diagnostic messages have been formatted irrespective of
|
|
the output device's aspect (e.g. its width, ...). You can use the
|
|
options described below
|
|
to control the formatting algorithm for diagnostic messages,
|
|
e.g. how many characters per line, how often source location
|
|
information should be reported. Note that some language front ends may not
|
|
honor these options.
|
|
<DL COMPACT>
|
|
<DT id="307"><B>-fmessage-length=</B><I>n</I><DD>
|
|
|
|
|
|
Try to format error messages so that they fit on lines of about
|
|
<I>n</I> characters. If <I>n</I> is zero, then no line-wrapping is
|
|
done; each error message appears on a single line. This is the
|
|
default for all front ends.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note - this option also affects the display of the <B>#error</B> and
|
|
<B>#warning</B> pre-processor directives, and the <B>deprecated</B>
|
|
function/type/variable attribute. It does not however affect the
|
|
<B>pragma </B><FONT SIZE="-1"><B>GCC</B></FONT><B> warning</B> and <B>pragma </B><FONT SIZE="-1"><B>GCC</B></FONT><B> error</B> pragmas.
|
|
<DT id="308"><B>-fdiagnostics-show-location=once</B><DD>
|
|
|
|
|
|
Only meaningful in line-wrapping mode. Instructs the diagnostic messages
|
|
reporter to emit source location information <I>once</I>; that is, in
|
|
case the message is too long to fit on a single physical line and has to
|
|
be wrapped, the source location won't be emitted (as prefix) again,
|
|
over and over, in subsequent continuation lines. This is the default
|
|
behavior.
|
|
<DT id="309"><B>-fdiagnostics-show-location=every-line</B><DD>
|
|
|
|
|
|
Only meaningful in line-wrapping mode. Instructs the diagnostic
|
|
messages reporter to emit the same source location information (as
|
|
prefix) for physical lines that result from the process of breaking
|
|
a message which is too long to fit on a single line.
|
|
<DT id="310"><B>-fdiagnostics-color[=</B><I></I><FONT SIZE="-1"><I>WHEN</I></FONT><I></I><B>]</B><DD>
|
|
|
|
|
|
|
|
<DT id="311"><B>-fno-diagnostics-color</B><DD>
|
|
|
|
|
|
|
|
Use color in diagnostics. <I></I><FONT SIZE="-1"><I>WHEN</I></FONT><I></I> is <B>never</B>, <B>always</B>,
|
|
or <B>auto</B>. The default depends on how the compiler has been configured,
|
|
it can be any of the above <I></I><FONT SIZE="-1"><I>WHEN</I></FONT><I></I> options or also <B>never</B>
|
|
if <B></B><FONT SIZE="-1"><B>GCC_COLORS</B></FONT><B></B> environment variable isn't present in the environment,
|
|
and <B>auto</B> otherwise.
|
|
<B>auto</B> means to use color only when the standard error is a terminal.
|
|
The forms <B>-fdiagnostics-color</B> and <B>-fno-diagnostics-color</B> are
|
|
aliases for <B>-fdiagnostics-color=always</B> and
|
|
<B>-fdiagnostics-color=never</B>, respectively.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The colors are defined by the environment variable <B></B><FONT SIZE="-1"><B>GCC_COLORS</B></FONT><B></B>.
|
|
Its value is a colon-separated list of capabilities and Select Graphic
|
|
Rendition (<FONT SIZE="-1">SGR</FONT>) substrings. <FONT SIZE="-1">SGR</FONT> commands are interpreted by the
|
|
terminal or terminal emulator. (See the section in the documentation
|
|
of your text terminal for permitted values and their meanings as
|
|
character attributes.) These substring values are integers in decimal
|
|
representation and can be concatenated with semicolons.
|
|
Common values to concatenate include
|
|
<B>1</B> for bold,
|
|
<B>4</B> for underline,
|
|
<B>5</B> for blink,
|
|
<B>7</B> for inverse,
|
|
<B>39</B> for default foreground color,
|
|
<B>30</B> to <B>37</B> for foreground colors,
|
|
<B>90</B> to <B>97</B> for 16-color mode foreground colors,
|
|
<B>38;5;0</B> to <B>38;5;255</B>
|
|
for 88-color and 256-color modes foreground colors,
|
|
<B>49</B> for default background color,
|
|
<B>40</B> to <B>47</B> for background colors,
|
|
<B>100</B> to <B>107</B> for 16-color mode background colors,
|
|
and <B>48;5;0</B> to <B>48;5;255</B>
|
|
for 88-color and 256-color modes background colors.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default <B></B><FONT SIZE="-1"><B>GCC_COLORS</B></FONT><B></B> is
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:\
|
|
quote=01:fixit-insert=32:fixit-delete=31:\
|
|
diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32:\
|
|
type-diff=01;32
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
where <B>01;31</B> is bold red, <B>01;35</B> is bold magenta,
|
|
<B>01;36</B> is bold cyan, <B>32</B> is green, <B>34</B> is blue,
|
|
<B>01</B> is bold, and <B>31</B> is red.
|
|
Setting <B></B><FONT SIZE="-1"><B>GCC_COLORS</B></FONT><B></B> to the empty string disables colors.
|
|
Supported capabilities are as follows.
|
|
<DL COMPACT><DT id="312"><DD>
|
|
<DL COMPACT>
|
|
<DT id="313">"error="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for error: markers.
|
|
<DT id="314">"warning="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for warning: markers.
|
|
<DT id="315">"note="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for note: markers.
|
|
<DT id="316">"range1="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for first additional range.
|
|
<DT id="317">"range2="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for second additional range.
|
|
<DT id="318">"locus="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for location information, <B>file:line</B> or
|
|
<B>file:line:column</B> etc.
|
|
<DT id="319">"quote="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for information printed within quotes.
|
|
<DT id="320">"fixit-insert="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for fix-it hints suggesting text to
|
|
be inserted or replaced.
|
|
<DT id="321">"fixit-delete="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for fix-it hints suggesting text to
|
|
be deleted.
|
|
<DT id="322">"diff-filename="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for filename headers within generated patches.
|
|
<DT id="323">"diff-hunk="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for the starts of hunks within generated patches.
|
|
<DT id="324">"diff-delete="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for deleted lines within generated patches.
|
|
<DT id="325">"diff-insert="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for inserted lines within generated patches.
|
|
<DT id="326">"type-diff="<DD>
|
|
|
|
|
|
|
|
|
|
<FONT SIZE="-1">SGR</FONT> substring for highlighting mismatching types within template
|
|
arguments in the C<FONT SIZE="-2">++</FONT> frontend.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="327"><DD>
|
|
</DL>
|
|
|
|
<DT id="328"><B>-fno-diagnostics-show-option</B><DD>
|
|
|
|
|
|
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
|
|
<B>-fno-diagnostics-show-option</B> flag suppresses that behavior.
|
|
<DT id="329"><B>-fno-diagnostics-show-caret</B><DD>
|
|
|
|
|
|
By default, each diagnostic emitted includes the original source line
|
|
and a caret <B>^</B> indicating the column. This option suppresses this
|
|
information. The source line is truncated to <I>n</I> characters, if
|
|
the <B>-fmessage-length=n</B> option is given. When the output is done
|
|
to the terminal, the width is limited to the width given by the
|
|
<B></B><FONT SIZE="-1"><B>COLUMNS</B></FONT><B></B> environment variable or, if not set, to the terminal width.
|
|
<DT id="330"><B>-fno-diagnostics-show-labels</B><DD>
|
|
|
|
|
|
By default, when printing source code (via <B>-fdiagnostics-show-caret</B>),
|
|
diagnostics can label ranges of source code with pertinent information, such
|
|
as the types of expressions:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
printf ("foo %s bar", long_i + long_j);
|
|
~^ ~~~~~~~~~~~~~~~
|
|
| |
|
|
char * long int
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option suppresses the printing of these labels (in the example above,
|
|
the vertical bars and the ``char *'' and ``long int'' text).
|
|
<DT id="331"><B>-fno-diagnostics-show-line-numbers</B><DD>
|
|
|
|
|
|
By default, when printing source code (via <B>-fdiagnostics-show-caret</B>),
|
|
a left margin is printed, showing line numbers. This option suppresses this
|
|
left margin.
|
|
<DT id="332"><B>-fdiagnostics-minimum-margin-width=</B><I>width</I><DD>
|
|
|
|
|
|
This option controls the minimum width of the left margin printed by
|
|
<B>-fdiagnostics-show-line-numbers</B>. It defaults to 6.
|
|
<DT id="333"><B>-fdiagnostics-parseable-fixits</B><DD>
|
|
|
|
|
|
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:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
fix-it:"test.c":{45:3-45:21}:"gtk_widget_show_all"
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The location is expressed as a half-open range, expressed as a count of
|
|
bytes, starting at byte 1 for the initial column. In the above example,
|
|
bytes 3 through 20 of line 45 of ``test.c'' are to be replaced with the
|
|
given string:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
00000000011111111112222222222
|
|
12345678901234567890123456789
|
|
gtk_widget_showall (dlg);
|
|
^^^^^^^^^^^^^^^^^^
|
|
gtk_widget_show_all
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The filename and replacement string escape backslash as ``\\'', tab as ``\t'',
|
|
newline as ``\n'', double quotes as ``\''``, non-printable characters as octal
|
|
(e.g. vertical tab as ''\013").
|
|
|
|
|
|
<P>
|
|
|
|
|
|
An empty replacement string indicates that the given range is to be removed.
|
|
An empty range (e.g. ``45:3-45:3'') indicates that the string is to
|
|
be inserted at the given position.
|
|
<DT id="334"><B>-fdiagnostics-generate-patch</B><DD>
|
|
|
|
|
|
Print fix-it hints to stderr in unified diff format, after any diagnostics
|
|
are printed. For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
--- test.c
|
|
+++ test.c
|
|
@ -42,5 +42,5 @
|
|
|
|
void show_cb(GtkDialog *dlg)
|
|
{
|
|
- gtk_widget_showall(dlg);
|
|
+ gtk_widget_show_all(dlg);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The diff may or may not be colorized, following the same rules
|
|
as for diagnostics (see <B>-fdiagnostics-color</B>).
|
|
<DT id="335"><B>-fdiagnostics-show-template-tree</B><DD>
|
|
|
|
|
|
In the C<FONT SIZE="-2">++</FONT> frontend, when printing diagnostics showing mismatching
|
|
template types, such as:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
could not convert 'std::map<int, std::vector<double> >()'
|
|
from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
the <B>-fdiagnostics-show-template-tree</B> flag enables printing a
|
|
tree-like structure showing the common and differing parts of the types,
|
|
such as:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
map<
|
|
[...],
|
|
vector<
|
|
[double != float]>>
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The parts that differ are highlighted with color (``double'' and
|
|
``float'' in this case).
|
|
<DT id="336"><B>-fno-elide-type</B><DD>
|
|
|
|
|
|
By default when the C<FONT SIZE="-2">++</FONT> frontend prints diagnostics showing mismatching
|
|
template types, common parts of the types are printed as ``[...]'' to
|
|
simplify the error message. For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
could not convert 'std::map<int, std::vector<double> >()'
|
|
from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Specifying the <B>-fno-elide-type</B> flag suppresses that behavior.
|
|
This flag also affects the output of the
|
|
<B>-fdiagnostics-show-template-tree</B> flag.
|
|
<DT id="337"><B>-fno-show-column</B><DD>
|
|
|
|
|
|
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 <B>dejagnu</B>.
|
|
<DT id="338"><B>-fdiagnostics-format=</B><I></I><FONT SIZE="-1"><I>FORMAT</I></FONT><I></I><DD>
|
|
|
|
|
|
Select a different format for printing diagnostics.
|
|
<I></I><FONT SIZE="-1"><I>FORMAT</I></FONT><I></I> is <B>text</B> or <B>json</B>.
|
|
The default is <B>text</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>json</B> format consists of a top-level <FONT SIZE="-1">JSON</FONT> array containing <FONT SIZE="-1">JSON</FONT>
|
|
objects representing the diagnostics.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <FONT SIZE="-1">JSON</FONT> is emitted as one line, without formatting; the examples below
|
|
have been formatted for clarity.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Diagnostics can have child diagnostics. For example, this error and note:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
misleading-indentation.c:15:3: warning: this 'if' clause does not
|
|
guard... [-Wmisleading-indentation]
|
|
15 | if (flag)
|
|
| ^~
|
|
misleading-indentation.c:17:5: note: ...this statement, but the latter
|
|
is misleadingly indented as if it were guarded by the 'if'
|
|
17 | y = 2;
|
|
| ^
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
might be printed in <FONT SIZE="-1">JSON</FONT> form (after formatting) like this:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
[
|
|
{
|
|
"kind": "warning",
|
|
"locations": [
|
|
{
|
|
"caret": {
|
|
"column": 3,
|
|
"file": "misleading-indentation.c",
|
|
"line": 15
|
|
},
|
|
"finish": {
|
|
"column": 4,
|
|
"file": "misleading-indentation.c",
|
|
"line": 15
|
|
}
|
|
}
|
|
],
|
|
"message": "this \u2018if\u2019 clause does not guard...",
|
|
"option": "-Wmisleading-indentation",
|
|
"children": [
|
|
{
|
|
"kind": "note",
|
|
"locations": [
|
|
{
|
|
"caret": {
|
|
"column": 5,
|
|
"file": "misleading-indentation.c",
|
|
"line": 17
|
|
}
|
|
}
|
|
],
|
|
"message": "...this statement, but the latter is ..."
|
|
}
|
|
]
|
|
},
|
|
...
|
|
]
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
where the <TT>"note"</TT> is a child of the <TT>"warning"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
A diagnostic has a <TT>"kind"</TT>. If this is <TT>"warning"</TT>, then there is
|
|
an <TT>"option"</TT> key describing the command-line option controlling the
|
|
warning.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
A diagnostic can contain zero or more locations. Each location has up
|
|
to three positions within it: a <TT>"caret"</TT> position and optional
|
|
<TT>"start"</TT> and <TT>"finish"</TT> positions. A location can also have
|
|
an optional <TT>"label"</TT> string. For example, this error:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
bad-binary-ops.c:64:23: error: invalid operands to binary + (have 'S' {aka
|
|
'struct s'} and 'T' {aka 'struct t'})
|
|
64 | return callee_4a () + callee_4b ();
|
|
| ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
|
|
| | |
|
|
| | T {aka struct t}
|
|
| S {aka struct s}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
has three locations. Its primary location is at the ``+'' token at column
|
|
23. It has two secondary locations, describing the left and right-hand sides
|
|
of the expression, which have labels. It might be printed in <FONT SIZE="-1">JSON</FONT> form as:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
{
|
|
"children": [],
|
|
"kind": "error",
|
|
"locations": [
|
|
{
|
|
"caret": {
|
|
"column": 23, "file": "bad-binary-ops.c", "line": 64
|
|
}
|
|
},
|
|
{
|
|
"caret": {
|
|
"column": 10, "file": "bad-binary-ops.c", "line": 64
|
|
},
|
|
"finish": {
|
|
"column": 21, "file": "bad-binary-ops.c", "line": 64
|
|
},
|
|
"label": "S {aka struct s}"
|
|
},
|
|
{
|
|
"caret": {
|
|
"column": 25, "file": "bad-binary-ops.c", "line": 64
|
|
},
|
|
"finish": {
|
|
"column": 36, "file": "bad-binary-ops.c", "line": 64
|
|
},
|
|
"label": "T {aka struct t}"
|
|
}
|
|
],
|
|
"message": "invalid operands to binary + ..."
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If a diagnostic contains fix-it hints, it has a <TT>"fixits"</TT> array,
|
|
consisting of half-open intervals, similar to the output of
|
|
<B>-fdiagnostics-parseable-fixits</B>. For example, this diagnostic
|
|
with a replacement fix-it hint:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
demo.c:8:15: error: 'struct s' has no member named 'colour'; did you
|
|
mean 'color'?
|
|
8 | return ptr->colour;
|
|
| ^~~~~~
|
|
| color
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
might be printed in <FONT SIZE="-1">JSON</FONT> form as:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
{
|
|
"children": [],
|
|
"fixits": [
|
|
{
|
|
"next": {
|
|
"column": 21,
|
|
"file": "demo.c",
|
|
"line": 8
|
|
},
|
|
"start": {
|
|
"column": 15,
|
|
"file": "demo.c",
|
|
"line": 8
|
|
},
|
|
"string": "color"
|
|
}
|
|
],
|
|
"kind": "error",
|
|
"locations": [
|
|
{
|
|
"caret": {
|
|
"column": 15,
|
|
"file": "demo.c",
|
|
"line": 8
|
|
},
|
|
"finish": {
|
|
"column": 20,
|
|
"file": "demo.c",
|
|
"line": 8
|
|
}
|
|
}
|
|
],
|
|
"message": "\u2018struct s\u2019 has no member named ..."
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
where the fix-it hint suggests replacing the text from <TT>"start"</TT> up
|
|
to but not including <TT>"next"</TT> with <TT>"string"</TT>'s value. Deletions
|
|
are expressed via an empty value for <TT>"string"</TT>, insertions by
|
|
having <TT>"start"</TT> equal <TT>"next"</TT>.
|
|
</DL>
|
|
<A NAME="lbAM"> </A>
|
|
<H3>Options to Request or Suppress Warnings</H3>
|
|
|
|
|
|
|
|
Warnings are diagnostic messages that report constructions that
|
|
are not inherently erroneous but that are risky or suggest there
|
|
may have been an error.
|
|
<P>
|
|
|
|
The following language-independent options do not enable specific
|
|
warnings but control the kinds of diagnostics produced by <FONT SIZE="-1">GCC.</FONT>
|
|
<DL COMPACT>
|
|
<DT id="339"><B>-fsyntax-only</B><DD>
|
|
|
|
|
|
Check the code for syntax errors, but don't do anything beyond that.
|
|
<DT id="340"><B>-fmax-errors=</B><I>n</I><DD>
|
|
|
|
|
|
Limits the maximum number of error messages to <I>n</I>, at which point
|
|
<FONT SIZE="-1">GCC</FONT> bails out rather than attempting to continue processing the source
|
|
code. If <I>n</I> is 0 (the default), there is no limit on the number
|
|
of error messages produced. If <B>-Wfatal-errors</B> is also
|
|
specified, then <B>-Wfatal-errors</B> takes precedence over this
|
|
option.
|
|
<DT id="341"><B>-w</B><DD>
|
|
|
|
|
|
Inhibit all warning messages.
|
|
<DT id="342"><B>-Werror</B><DD>
|
|
|
|
|
|
Make all warnings into errors.
|
|
<DT id="343"><B>-Werror=</B><DD>
|
|
|
|
|
|
Make the specified warning into an error. The specifier for a warning
|
|
is appended; for example <B>-Werror=switch</B> turns the warnings
|
|
controlled by <B>-Wswitch</B> into errors. This switch takes a
|
|
negative form, to be used to negate <B>-Werror</B> for specific
|
|
warnings; for example <B>-Wno-error=switch</B> makes
|
|
<B>-Wswitch</B> warnings not be errors, even when <B>-Werror</B>
|
|
is in effect.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The warning message for each controllable warning includes the
|
|
option that controls the warning. That option can then be used with
|
|
<B>-Werror=</B> and <B>-Wno-error=</B> as described above.
|
|
(Printing of the option in the warning message can be disabled using the
|
|
<B>-fno-diagnostics-show-option</B> flag.)
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that specifying <B>-Werror=</B><I>foo</I> automatically implies
|
|
<B>-W</B><I>foo</I>. However, <B>-Wno-error=</B><I>foo</I> does not
|
|
imply anything.
|
|
<DT id="344"><B>-Wfatal-errors</B><DD>
|
|
|
|
|
|
This option causes the compiler to abort compilation on the first error
|
|
occurred rather than trying to keep going and printing further error
|
|
messages.
|
|
</DL>
|
|
<P>
|
|
|
|
You can request many specific warnings with options beginning with
|
|
<B>-W</B>, for example <B>-Wimplicit</B> to request warnings on
|
|
implicit declarations. Each of these specific warning options also
|
|
has a negative form beginning <B>-Wno-</B> to turn off warnings; for
|
|
example, <B>-Wno-implicit</B>. This manual lists only one of the
|
|
two forms, whichever is not the default. For further
|
|
language-specific options also refer to <B>C<FONT SIZE="-2">++</FONT> Dialect Options</B> and
|
|
<B>Objective-C and Objective-C<FONT SIZE="-2">++</FONT> Dialect Options</B>.
|
|
<P>
|
|
|
|
Some options, such as <B>-Wall</B> and <B>-Wextra</B>, turn on other
|
|
options, such as <B>-Wunused</B>, which may turn on further options,
|
|
such as <B>-Wunused-value</B>. The combined effect of positive and
|
|
negative forms is that more specific options have priority over less
|
|
specific ones, independently of their position in the command-line. For
|
|
options of the same specificity, the last one takes effect. Options
|
|
enabled or disabled via pragmas take effect
|
|
as if they appeared at the end of the command-line.
|
|
<P>
|
|
|
|
When an unrecognized warning option is requested (e.g.,
|
|
<B>-Wunknown-warning</B>), <FONT SIZE="-1">GCC</FONT> emits a diagnostic stating
|
|
that the option is not recognized. However, if the <B>-Wno-</B> form
|
|
is used, the behavior is slightly different: no diagnostic is
|
|
produced for <B>-Wno-unknown-warning</B> unless other diagnostics
|
|
are being produced. This allows the use of new <B>-Wno-</B> options
|
|
with old compilers, but if something goes wrong, the compiler
|
|
warns that an unrecognized option is present.
|
|
<P>
|
|
|
|
The effectiveness of some warnings depends on optimizations also being
|
|
enabled. For example <B>-Wsuggest-final-types</B> is more effective
|
|
with link-time optimization and <B>-Wmaybe-uninitialized</B> will not
|
|
warn at all unless optimization is enabled.
|
|
<DL COMPACT>
|
|
<DT id="345"><B>-Wpedantic</B><DD>
|
|
|
|
|
|
|
|
<DT id="346"><B>-pedantic</B><DD>
|
|
|
|
|
|
|
|
Issue all the warnings demanded by strict <FONT SIZE="-1">ISO C</FONT> and <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT></FONT>;
|
|
reject all programs that use forbidden extensions, and some other
|
|
programs that do not follow <FONT SIZE="-1">ISO C</FONT> and <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT>.</FONT> For <FONT SIZE="-1">ISO C,</FONT> follows the
|
|
version of the <FONT SIZE="-1">ISO C</FONT> standard specified by any <B>-std</B> option used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Valid <FONT SIZE="-1">ISO C</FONT> and <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT></FONT> programs should compile properly with or without
|
|
this option (though a rare few require <B>-ansi</B> or a
|
|
<B>-std</B> option specifying the required version of <FONT SIZE="-1">ISO C</FONT>). However,
|
|
without this option, certain <FONT SIZE="-1">GNU</FONT> extensions and traditional C and C<FONT SIZE="-2">++</FONT>
|
|
features are supported as well. With this option, they are rejected.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Wpedantic</B> does not cause warning messages for use of the
|
|
alternate keywords whose names begin and end with <B>__</B>. Pedantic
|
|
warnings are also disabled in the expression that follows
|
|
<TT>"__extension__"</TT>. However, only system header files should use
|
|
these escape routes; application programs should avoid them.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Some users try to use <B>-Wpedantic</B> to check programs for strict <FONT SIZE="-1">ISO
|
|
C</FONT> conformance. They soon find that it does not do quite what they want:
|
|
it finds some non-ISO practices, but not all---only those for which
|
|
<FONT SIZE="-1">ISO C</FONT> <I>requires</I> a diagnostic, and some others for which
|
|
diagnostics have been added.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
A feature to report any failure to conform to <FONT SIZE="-1">ISO C</FONT> might be useful in
|
|
some instances, but would require considerable additional work and would
|
|
be quite different from <B>-Wpedantic</B>. We don't have plans to
|
|
support such a feature in the near future.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Where the standard specified with <B>-std</B> represents a <FONT SIZE="-1">GNU</FONT>
|
|
extended dialect of C, such as <B>gnu90</B> or <B>gnu99</B>, there is a
|
|
corresponding <I>base standard</I>, the version of <FONT SIZE="-1">ISO C</FONT> on which the <FONT SIZE="-1">GNU</FONT>
|
|
extended dialect is based. Warnings from <B>-Wpedantic</B> are given
|
|
where they are required by the base standard. (It does not make sense
|
|
for such warnings to be given only for features not in the specified <FONT SIZE="-1">GNU
|
|
C</FONT> dialect, since by definition the <FONT SIZE="-1">GNU</FONT> dialects of C include all
|
|
features the compiler supports with the given option, and there would be
|
|
nothing to warn about.)
|
|
<DT id="347"><B>-pedantic-errors</B><DD>
|
|
|
|
|
|
Give an error whenever the <I>base standard</I> (see <B>-Wpedantic</B>)
|
|
requires a diagnostic, in some cases where there is undefined behavior
|
|
at compile-time and in some other cases that do not prevent compilation
|
|
of programs that are valid according to the standard. This is not
|
|
equivalent to <B>-Werror=pedantic</B>, since there are errors enabled
|
|
by this option and not enabled by the latter and vice versa.
|
|
<DT id="348"><B>-Wall</B><DD>
|
|
|
|
|
|
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
|
|
enables some language-specific warnings described in <B>C<FONT SIZE="-2">++</FONT> Dialect
|
|
Options</B> and <B>Objective-C and Objective-C<FONT SIZE="-2">++</FONT> Dialect Options</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Wall</B> turns on the following warning flags:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Waddress
|
|
-Warray-bounds=1</B> (only with<B> </B><B>-O2</B>)
|
|
<B>-Wbool-compare
|
|
-Wbool-operation
|
|
-Wc++11-compat -Wc++14-compat
|
|
-Wcatch-value</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)
|
|
<B>-Wchar-subscripts
|
|
-Wcomment
|
|
-Wduplicate-decl-specifier</B> (C and Objective-C only)
|
|
<B>-Wenum-compare</B> (in C/ObjC; this is on by default in C<FONT SIZE="-2">++</FONT>)
|
|
<B>-Wformat
|
|
-Wint-in-bool-context
|
|
-Wimplicit</B> (C and Objective-C only)
|
|
<B>-Wimplicit-int</B> (C and Objective-C only)
|
|
<B>-Wimplicit-function-declaration</B> (C and Objective-C only)
|
|
<B>-Winit-self</B> (only for C<FONT SIZE="-2">++</FONT>)
|
|
<B>-Wlogical-not-parentheses
|
|
-Wmain</B> (only for C/ObjC and unless<B> </B><B>-ffreestanding</B>)
|
|
<B>-Wmaybe-uninitialized
|
|
-Wmemset-elt-size
|
|
-Wmemset-transposed-args
|
|
-Wmisleading-indentation</B> (only for C/C<FONT SIZE="-2">++</FONT>)
|
|
<B>-Wmissing-attributes
|
|
-Wmissing-braces</B> (only for C/ObjC)
|
|
<B>-Wmultistatement-macros
|
|
-Wnarrowing</B> (only for C<FONT SIZE="-2">++</FONT>)
|
|
<B>-Wnonnull
|
|
-Wnonnull-compare
|
|
-Wopenmp-simd
|
|
-Wparentheses
|
|
-Wpessimizing-move</B> (only for C<FONT SIZE="-2">++</FONT>)
|
|
<B>-Wpointer-sign
|
|
-Wreorder
|
|
-Wrestrict
|
|
-Wreturn-type
|
|
-Wsequence-point
|
|
-Wsign-compare</B> (only in C<FONT SIZE="-2">++</FONT>)
|
|
<B>-Wsizeof-pointer-div
|
|
-Wsizeof-pointer-memaccess
|
|
-Wstrict-aliasing
|
|
-Wstrict-overflow=1
|
|
-Wswitch
|
|
-Wtautological-compare
|
|
-Wtrigraphs
|
|
-Wuninitialized
|
|
-Wunknown-pragmas
|
|
-Wunused-function
|
|
-Wunused-label
|
|
-Wunused-value
|
|
-Wunused-variable
|
|
-Wvolatile-register-var</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that some warning flags are not implied by <B>-Wall</B>. Some of
|
|
them warn about constructions that users generally do not consider
|
|
questionable, but which occasionally you might wish to check for;
|
|
others warn about constructions that are necessary or hard to avoid in
|
|
some cases, and there is no simple way to modify the code to suppress
|
|
the warning. Some of them are enabled by <B>-Wextra</B> but many of
|
|
them must be enabled individually.
|
|
<DT id="349"><B>-Wextra</B><DD>
|
|
|
|
|
|
This enables some extra warning flags that are not enabled by
|
|
<B>-Wall</B>. (This option used to be called <B>-W</B>. The older
|
|
name is still supported, but the newer name is more descriptive.)
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Wclobbered
|
|
-Wcast-function-type
|
|
-Wdeprecated-copy</B> (C<FONT SIZE="-2">++</FONT> only)
|
|
<B>-Wempty-body
|
|
-Wignored-qualifiers
|
|
-Wimplicit-fallthrough=3
|
|
-Wmissing-field-initializers
|
|
-Wmissing-parameter-type</B> (C only)
|
|
<B>-Wold-style-declaration</B> (C only)
|
|
<B>-Woverride-init
|
|
-Wsign-compare</B> (C only)
|
|
<B>-Wredundant-move</B> (only for C<FONT SIZE="-2">++</FONT>)
|
|
<B>-Wtype-limits
|
|
-Wuninitialized
|
|
-Wshift-negative-value</B> (in C<FONT SIZE="-2">++</FONT>03 and in C99 and newer)
|
|
<B>-Wunused-parameter</B> (only with<B> </B><B>-Wunused</B><B> </B>or<B> </B><B>-Wall</B>)
|
|
<B>-Wunused-but-set-parameter</B> (only with<B> </B><B>-Wunused</B><B> </B>or<B> </B><B>-Wall</B>)
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The option <B>-Wextra</B> also prints warning messages for the
|
|
following cases:
|
|
<DL COMPACT><DT id="350"><DD>
|
|
<DL COMPACT>
|
|
<DT id="351">*<DD>
|
|
A pointer is compared against integer zero with <TT>"<"</TT>, <TT>"<="</TT>,
|
|
<TT>">"</TT>, or <TT>">="</TT>.
|
|
<DT id="352">*<DD>
|
|
(C<FONT SIZE="-2">++</FONT> only) An enumerator and a non-enumerator both appear in a
|
|
conditional expression.
|
|
<DT id="353">*<DD>
|
|
(C<FONT SIZE="-2">++</FONT> only) Ambiguous virtual bases.
|
|
<DT id="354">*<DD>
|
|
(C<FONT SIZE="-2">++</FONT> only) Subscripting an array that has been declared <TT>"register"</TT>.
|
|
<DT id="355">*<DD>
|
|
(C<FONT SIZE="-2">++</FONT> only) Taking the address of a variable that has been declared
|
|
<TT>"register"</TT>.
|
|
<DT id="356">*<DD>
|
|
(C<FONT SIZE="-2">++</FONT> only) A base class is not initialized in the copy constructor
|
|
of a derived class.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="357"><DD>
|
|
</DL>
|
|
|
|
<DT id="358"><B>-Wchar-subscripts</B><DD>
|
|
|
|
|
|
Warn if an array subscript has type <TT>"char"</TT>. This is a common cause
|
|
of error, as programmers often forget that this type is signed on some
|
|
machines.
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="359"><B>-Wno-coverage-mismatch</B><DD>
|
|
|
|
|
|
Warn if feedback profiles do not match when using the
|
|
<B>-fprofile-use</B> option.
|
|
If a source file is changed between compiling with <B>-fprofile-generate</B>
|
|
and with <B>-fprofile-use</B>, the files with the profile feedback can fail
|
|
to match the source file and <FONT SIZE="-1">GCC</FONT> cannot use the profile feedback
|
|
information. By default, this warning is enabled and is treated as an
|
|
error. <B>-Wno-coverage-mismatch</B> can be used to disable the
|
|
warning or <B>-Wno-error=coverage-mismatch</B> can be used to
|
|
disable the error. Disabling the error for this warning can result in
|
|
poorly optimized code and is useful only in the
|
|
case of very minor changes such as bug fixes to an existing code-base.
|
|
Completely disabling the warning is not recommended.
|
|
<DT id="360"><B>-Wno-cpp</B><DD>
|
|
|
|
|
|
(C, Objective-C, C<FONT SIZE="-2">++</FONT>, Objective-C<FONT SIZE="-2">++</FONT> and Fortran only)
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Suppress warning messages emitted by <TT>"#warning"</TT> directives.
|
|
<DT id="361"><B>-Wdouble-promotion</B> (C, C<FONT SIZE="-2">++</FONT>, Objective-C and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Give a warning when a value of type <TT>"float"</TT> is implicitly
|
|
promoted to <TT>"double"</TT>. CPUs with a 32-bit ``single-precision''
|
|
floating-point unit implement <TT>"float"</TT> in hardware, but emulate
|
|
<TT>"double"</TT> in software. On such a machine, doing computations
|
|
using <TT>"double"</TT> values is much more expensive because of the
|
|
overhead required for software emulation.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It is easy to accidentally do computations with <TT>"double"</TT> because
|
|
floating-point literals are implicitly of type <TT>"double"</TT>. For
|
|
example, in:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
float area(float radius)
|
|
{
|
|
return 3.14159 * radius * radius;
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
the compiler performs the entire computation with <TT>"double"</TT>
|
|
because the floating-point literal is a <TT>"double"</TT>.
|
|
<DT id="362"><B>-Wduplicate-decl-specifier</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn if a declaration has duplicate <TT>"const"</TT>, <TT>"volatile"</TT>,
|
|
<TT>"restrict"</TT> or <TT>"_Atomic"</TT> specifier. This warning is enabled by
|
|
<B>-Wall</B>.
|
|
<DT id="363"><B>-Wformat</B><DD>
|
|
|
|
|
|
|
|
<DT id="364"><B>-Wformat=</B><I>n</I><DD>
|
|
|
|
|
|
|
|
Check calls to <TT>"printf"</TT> and <TT>"scanf"</TT>, 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
|
|
sense. This includes standard functions, and others specified by format
|
|
attributes, in the <TT>"printf"</TT>,
|
|
<TT>"scanf"</TT>, <TT>"strftime"</TT> and <TT>"strfmon"</TT> (an X/Open extension,
|
|
not in the C standard) families (or other target-specific families).
|
|
Which functions are checked without format attributes having been
|
|
specified depends on the standard version selected, and such checks of
|
|
functions without the attribute specified are disabled by
|
|
<B>-ffreestanding</B> or <B>-fno-builtin</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The formats are checked against the format features supported by <FONT SIZE="-1">GNU</FONT>
|
|
libc version 2.2. These include all <FONT SIZE="-1">ISO C90</FONT> and C99 features, as well
|
|
as features from the Single Unix Specification and some <FONT SIZE="-1">BSD</FONT> and <FONT SIZE="-1">GNU</FONT>
|
|
extensions. Other library implementations may not support all these
|
|
features; <FONT SIZE="-1">GCC</FONT> does not support warning about features that go beyond a
|
|
particular library's limitations. However, if <B>-Wpedantic</B> is used
|
|
with <B>-Wformat</B>, warnings are given about format features not
|
|
in the selected standard version (but not for <TT>"strfmon"</TT> formats,
|
|
since those are not in any version of the C standard).
|
|
<DL COMPACT><DT id="365"><DD>
|
|
<DL COMPACT>
|
|
<DT id="366"><B>-Wformat=1</B><DD>
|
|
|
|
|
|
|
|
<DT id="367"><B>-Wformat</B><DD>
|
|
|
|
|
|
|
|
Option <B>-Wformat</B> is equivalent to <B>-Wformat=1</B>, and
|
|
<B>-Wno-format</B> is equivalent to <B>-Wformat=0</B>. Since
|
|
<B>-Wformat</B> also checks for null format arguments for several
|
|
functions, <B>-Wformat</B> also implies <B>-Wnonnull</B>. Some
|
|
aspects of this level of format checking can be disabled by the
|
|
options: <B>-Wno-format-contains-nul</B>,
|
|
<B>-Wno-format-extra-args</B>, and <B>-Wno-format-zero-length</B>.
|
|
<B>-Wformat</B> is enabled by <B>-Wall</B>.
|
|
<DT id="368"><B>-Wno-format-contains-nul</B><DD>
|
|
|
|
|
|
If <B>-Wformat</B> is specified, do not warn about format strings that
|
|
contain <FONT SIZE="-1">NUL</FONT> bytes.
|
|
<DT id="369"><B>-Wno-format-extra-args</B><DD>
|
|
|
|
|
|
If <B>-Wformat</B> is specified, do not warn about excess arguments to a
|
|
<TT>"printf"</TT> or <TT>"scanf"</TT> format function. The C standard specifies
|
|
that such arguments are ignored.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Where the unused arguments lie between used arguments that are
|
|
specified with <B>$</B> operand number specifications, normally
|
|
warnings are still given, since the implementation could not know what
|
|
type to pass to <TT>"va_arg"</TT> to skip the unused arguments. However,
|
|
in the case of <TT>"scanf"</TT> formats, this option suppresses the
|
|
warning if the unused arguments are all pointers, since the Single
|
|
Unix Specification says that such unused arguments are allowed.
|
|
<DT id="370"><B>-Wformat-overflow</B><DD>
|
|
|
|
|
|
|
|
<DT id="371"><B>-Wformat-overflow=</B><I>level</I><DD>
|
|
|
|
|
|
|
|
Warn about calls to formatted input/output functions such as <TT>"sprintf"</TT>
|
|
and <TT>"vsprintf"</TT> that might overflow the destination buffer. When the
|
|
exact number of bytes written by a format directive cannot be determined
|
|
at compile-time it is estimated based on heuristics that depend on the
|
|
<I>level</I> argument and on optimization. While enabling optimization
|
|
will in most cases improve the accuracy of the warning, it may also
|
|
result in false positives.
|
|
<DL COMPACT><DT id="372"><DD>
|
|
<DL COMPACT>
|
|
<DT id="373"><B>-Wformat-overflow</B><DD>
|
|
|
|
|
|
|
|
<DT id="374"><B>-Wformat-overflow=1</B><DD>
|
|
|
|
|
|
|
|
Level <I>1</I> of <B>-Wformat-overflow</B> enabled by <B>-Wformat</B>
|
|
employs a conservative approach that warns only about calls that most
|
|
likely overflow the buffer. At this level, numeric arguments to format
|
|
directives with unknown values are assumed to have the value of one, and
|
|
strings of unknown length to be empty. Numeric arguments that are known
|
|
to be bounded to a subrange of their type, or string arguments whose output
|
|
is bounded either by their directive's precision or by a finite set of
|
|
string literals, are assumed to take on the value within the range that
|
|
results in the most bytes on output. For example, the call to <TT>"sprintf"</TT>
|
|
below is diagnosed because even with both <I>a</I> and <I>b</I> equal to zero,
|
|
the terminating <FONT SIZE="-1">NUL</FONT> character (<TT>'\0'</TT>) appended by the function
|
|
to the destination buffer will be written past its end. Increasing
|
|
the size of the buffer by a single byte is sufficient to avoid the
|
|
warning, though it may not be sufficient to avoid the overflow.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void f (int a, int b)
|
|
{
|
|
char buf [13];
|
|
sprintf (buf, "a = %i, b = %i\n", a, b);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="375"><B>-Wformat-overflow=2</B><DD>
|
|
|
|
|
|
Level <I>2</I> warns also about calls that might overflow the destination
|
|
buffer given an argument of sufficient length or magnitude. At level
|
|
<I>2</I>, unknown numeric arguments are assumed to have the minimum
|
|
representable value for signed types with a precision greater than 1, and
|
|
the maximum representable value otherwise. Unknown string arguments whose
|
|
length cannot be assumed to be bounded either by the directive's precision,
|
|
or by a finite set of string literals they may evaluate to, or the character
|
|
array they may point to, are assumed to be 1 character long.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
At level <I>2</I>, the call in the example above is again diagnosed, but
|
|
this time because with <I>a</I> equal to a 32-bit <TT>"INT_MIN"</TT> the first
|
|
<TT>%i</TT> directive will write some of its digits beyond the end of
|
|
the destination buffer. To make the call safe regardless of the values
|
|
of the two variables, the size of the destination buffer must be increased
|
|
to at least 34 bytes. <FONT SIZE="-1">GCC</FONT> includes the minimum size of the buffer in
|
|
an informational note following the warning.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
An alternative to increasing the size of the destination buffer is to
|
|
constrain the range of formatted values. The maximum length of string
|
|
arguments can be bounded by specifying the precision in the format
|
|
directive. When numeric arguments of format directives can be assumed
|
|
to be bounded by less than the precision of their type, choosing
|
|
an appropriate length modifier to the format specifier will reduce
|
|
the required buffer size. For example, if <I>a</I> and <I>b</I> in the
|
|
example above can be assumed to be within the precision of
|
|
the <TT>"short int"</TT> type then using either the <TT>%hi</TT> format
|
|
directive or casting the argument to <TT>"short"</TT> reduces the maximum
|
|
required size of the buffer to 24 bytes.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void f (int a, int b)
|
|
{
|
|
char buf [23];
|
|
sprintf (buf, "a = %hi, b = %i\n", a, (short)b);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="376"><DD>
|
|
</DL>
|
|
|
|
<DT id="377"><B>-Wno-format-zero-length</B><DD>
|
|
|
|
|
|
If <B>-Wformat</B> is specified, do not warn about zero-length formats.
|
|
The C standard specifies that zero-length formats are allowed.
|
|
<DT id="378"><B>-Wformat=2</B><DD>
|
|
|
|
|
|
Enable <B>-Wformat</B> plus additional format checks. Currently
|
|
equivalent to <B>-Wformat -Wformat-nonliteral -Wformat-security
|
|
-Wformat-y2k</B>.
|
|
<DT id="379"><B>-Wformat-nonliteral</B><DD>
|
|
|
|
|
|
If <B>-Wformat</B> 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 <TT>"va_list"</TT>.
|
|
<DT id="380"><B>-Wformat-security</B><DD>
|
|
|
|
|
|
If <B>-Wformat</B> is specified, also warn about uses of format
|
|
functions that represent possible security problems. At present, this
|
|
warns about calls to <TT>"printf"</TT> and <TT>"scanf"</TT> functions where the
|
|
format string is not a string literal and there are no format arguments,
|
|
as in <TT>"printf (foo);"</TT>. This may be a security hole if the format
|
|
string came from untrusted input and contains <B></B>%n<B></B>. (This is
|
|
currently a subset of what <B>-Wformat-nonliteral</B> warns about, but
|
|
in future warnings may be added to <B>-Wformat-security</B> that are not
|
|
included in <B>-Wformat-nonliteral</B>.)
|
|
<DT id="381"><B>-Wformat-signedness</B><DD>
|
|
|
|
|
|
If <B>-Wformat</B> is specified, also warn if the format string
|
|
requires an unsigned argument and the argument is signed and vice versa.
|
|
<DT id="382"><B>-Wformat-truncation</B><DD>
|
|
|
|
|
|
|
|
<DT id="383"><B>-Wformat-truncation=</B><I>level</I><DD>
|
|
|
|
|
|
|
|
Warn about calls to formatted input/output functions such as <TT>"snprintf"</TT>
|
|
and <TT>"vsnprintf"</TT> that might result in output truncation. When the exact
|
|
number of bytes written by a format directive cannot be determined at
|
|
compile-time it is estimated based on heuristics that depend on
|
|
the <I>level</I> argument and on optimization. While enabling optimization
|
|
will in most cases improve the accuracy of the warning, it may also result
|
|
in false positives. Except as noted otherwise, the option uses the same
|
|
logic <B>-Wformat-overflow</B>.
|
|
<DL COMPACT><DT id="384"><DD>
|
|
<DL COMPACT>
|
|
<DT id="385"><B>-Wformat-truncation</B><DD>
|
|
|
|
|
|
|
|
<DT id="386"><B>-Wformat-truncation=1</B><DD>
|
|
|
|
|
|
|
|
Level <I>1</I> of <B>-Wformat-truncation</B> enabled by <B>-Wformat</B>
|
|
employs a conservative approach that warns only about calls to bounded
|
|
functions whose return value is unused and that will most likely result
|
|
in output truncation.
|
|
<DT id="387"><B>-Wformat-truncation=2</B><DD>
|
|
|
|
|
|
Level <I>2</I> warns also about calls to bounded functions whose return
|
|
value is used and that might result in truncation given an argument of
|
|
sufficient length or magnitude.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="388"><DD>
|
|
</DL>
|
|
|
|
<DT id="389"><B>-Wformat-y2k</B><DD>
|
|
|
|
|
|
If <B>-Wformat</B> is specified, also warn about <TT>"strftime"</TT>
|
|
formats that may yield only a two-digit year.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="390"><DD>
|
|
</DL>
|
|
|
|
<DT id="391"><B>-Wnonnull</B><DD>
|
|
|
|
|
|
Warn about passing a null pointer for arguments marked as
|
|
requiring a non-null value by the <TT>"nonnull"</TT> function attribute.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Wnonnull</B> is included in <B>-Wall</B> and <B>-Wformat</B>. It
|
|
can be disabled with the <B>-Wno-nonnull</B> option.
|
|
<DT id="392"><B>-Wnonnull-compare</B><DD>
|
|
|
|
|
|
Warn when comparing an argument marked with the <TT>"nonnull"</TT>
|
|
function attribute against null inside the function.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Wnonnull-compare</B> is included in <B>-Wall</B>. It
|
|
can be disabled with the <B>-Wno-nonnull-compare</B> option.
|
|
<DT id="393"><B>-Wnull-dereference</B><DD>
|
|
|
|
|
|
Warn if the compiler detects paths that trigger erroneous or
|
|
undefined behavior due to dereferencing a null pointer. This option
|
|
is only active when <B>-fdelete-null-pointer-checks</B> is active,
|
|
which is enabled by optimizations in most targets. The precision of
|
|
the warnings depends on the optimization options used.
|
|
<DT id="394"><B>-Winit-self</B> (C, C<FONT SIZE="-2">++</FONT>, Objective-C and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn about uninitialized variables that are initialized with themselves.
|
|
Note this option can only be used with the <B>-Wuninitialized</B> option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, <FONT SIZE="-1">GCC</FONT> warns about <TT>"i"</TT> being uninitialized in the
|
|
following snippet only when <B>-Winit-self</B> has been specified:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int f()
|
|
{
|
|
int i = i;
|
|
return i;
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B> in C<FONT SIZE="-2">++</FONT>.
|
|
<DT id="395"><B>-Wimplicit-int</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn when a declaration does not specify a type.
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="396"><B>-Wimplicit-function-declaration</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Give a warning whenever a function is used before being declared. In
|
|
C99 mode (<B>-std=c99</B> or <B>-std=gnu99</B>), this warning is
|
|
enabled by default and it is made into an error by
|
|
<B>-pedantic-errors</B>. This warning is also enabled by
|
|
<B>-Wall</B>.
|
|
<DT id="397"><B>-Wimplicit</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Same as <B>-Wimplicit-int</B> and <B>-Wimplicit-function-declaration</B>.
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="398"><B>-Wimplicit-fallthrough</B><DD>
|
|
|
|
|
|
<B>-Wimplicit-fallthrough</B> is the same as <B>-Wimplicit-fallthrough=3</B>
|
|
and <B>-Wno-implicit-fallthrough</B> is the same as
|
|
<B>-Wimplicit-fallthrough=0</B>.
|
|
<DT id="399"><B>-Wimplicit-fallthrough=</B><I>n</I><DD>
|
|
|
|
|
|
Warn when a switch case falls through. For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
switch (cond)
|
|
{
|
|
case 1:
|
|
a = 1;
|
|
break;
|
|
case 2:
|
|
a = 2;
|
|
case 3:
|
|
a = 3;
|
|
break;
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning does not warn when the last statement of a case cannot
|
|
fall through, e.g. when there is a return statement or a call to function
|
|
declared with the noreturn attribute. <B>-Wimplicit-fallthrough=</B>
|
|
also takes into account control flow statements, such as ifs, and only
|
|
warns when appropriate. E.g.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
switch (cond)
|
|
{
|
|
case 1:
|
|
if (i > 3) {
|
|
bar (5);
|
|
break;
|
|
} else if (i < 1) {
|
|
bar (0);
|
|
} else
|
|
return;
|
|
default:
|
|
...
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Since there are occasions where a switch case fall through is desirable,
|
|
<FONT SIZE="-1">GCC</FONT> provides an attribute, <TT>"__attribute__ ((fallthrough))"</TT>, that is
|
|
to be used along with a null statement to suppress this warning that
|
|
would normally occur:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
switch (cond)
|
|
{
|
|
case 1:
|
|
bar (0);
|
|
__attribute__ ((fallthrough));
|
|
default:
|
|
...
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
C<FONT SIZE="-2">++</FONT>17 provides a standard way to suppress the <B>-Wimplicit-fallthrough</B>
|
|
warning using <TT>"[[fallthrough]];"</TT> instead of the <FONT SIZE="-1">GNU</FONT> attribute. In C<FONT SIZE="-2">++</FONT>11
|
|
or C<FONT SIZE="-2">++</FONT>14 users can use <TT>"[[gnu::fallthrough]];"</TT>, which is a <FONT SIZE="-1">GNU</FONT> extension.
|
|
Instead of these attributes, it is also possible to add a fallthrough comment
|
|
to silence the warning. The whole body of the C or C<FONT SIZE="-2">++</FONT> style comment should
|
|
match the given regular expressions listed below. The option argument <I>n</I>
|
|
specifies what kind of comments are accepted:
|
|
<DL COMPACT><DT id="400"><DD>
|
|
<DL COMPACT>
|
|
<DT id="401">*<<B>-Wimplicit-fallthrough=0</B> disables the warning altogether.><DD>
|
|
|
|
|
|
|
|
<DT id="402">*<<B>-Wimplicit-fallthrough=1</B> matches ".*" regular><DD>
|
|
|
|
|
|
|
|
|
|
|
|
expression, any comment is used as fallthrough comment.
|
|
<DT id="403">*<<B>-Wimplicit-fallthrough=2</B> case insensitively matches><DD>
|
|
|
|
|
|
<TT>".*falls?[ \t-]*thr(ough|u).*"</TT> regular expression.
|
|
<DT id="404">*<<B>-Wimplicit-fallthrough=3</B> case sensitively matches one of the><DD>
|
|
|
|
|
|
following regular expressions:
|
|
<DL COMPACT><DT id="405"><DD>
|
|
<DL COMPACT>
|
|
<DT id="406">*<"-fallthrough"><DD>
|
|
|
|
|
|
|
|
|
|
|
|
<DT id="407">*<"@fallthrough@"><DD>
|
|
|
|
|
|
|
|
|
|
<DT id="408">*<"lint -fallthrough[ \t]*"><DD>
|
|
|
|
|
|
|
|
|
|
<DT id="409">*<"[ \t.!]*(ELSE,? |INTENTIONAL(LY)? )?FALL(S | |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?"><DD>
|
|
|
|
|
|
|
|
|
|
<DT id="410">*<"[ \t.!]*(Else,? |Intentional(ly)? )?Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?"><DD>
|
|
|
|
|
|
|
|
|
|
<DT id="411">*<"[ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?"><DD>
|
|
|
|
|
|
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="412"><DD>
|
|
</DL>
|
|
|
|
<DT id="413">*<<B>-Wimplicit-fallthrough=4</B> case sensitively matches one of the><DD>
|
|
|
|
|
|
|
|
following regular expressions:
|
|
<DL COMPACT><DT id="414"><DD>
|
|
<DL COMPACT>
|
|
<DT id="415">*<"-fallthrough"><DD>
|
|
|
|
|
|
|
|
|
|
|
|
<DT id="416">*<"@fallthrough@"><DD>
|
|
|
|
|
|
|
|
|
|
<DT id="417">*<"lint -fallthrough[ \t]*"><DD>
|
|
|
|
|
|
|
|
|
|
<DT id="418">*<"[ \t]*FALLTHR(OUGH|U)[ \t]*"><DD>
|
|
|
|
|
|
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="419"><DD>
|
|
</DL>
|
|
|
|
<DT id="420">*<<B>-Wimplicit-fallthrough=5</B> doesn't recognize any comments as><DD>
|
|
|
|
|
|
|
|
fallthrough comments, only attributes disable the warning.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="421"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The comment needs to be followed after optional whitespace and other comments
|
|
by <TT>"case"</TT> or <TT>"default"</TT> keywords or by a user label that precedes some
|
|
<TT>"case"</TT> or <TT>"default"</TT> label.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
switch (cond)
|
|
{
|
|
case 1:
|
|
bar (0);
|
|
/* FALLTHRU */
|
|
default:
|
|
...
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-Wimplicit-fallthrough=3</B> warning is enabled by <B>-Wextra</B>.
|
|
</DL>
|
|
|
|
<DT id="422"><B>-Wif-not-aligned</B> (C, C<FONT SIZE="-2">++</FONT>, Objective-C and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Control if warning triggered by the <TT>"warn_if_not_aligned"</TT> attribute
|
|
should be issued. This is enabled by default.
|
|
Use <B>-Wno-if-not-aligned</B> to disable it.
|
|
<DT id="423"><B>-Wignored-qualifiers</B> (C and C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn if the return type of a function has a type qualifier
|
|
such as <TT>"const"</TT>. For <FONT SIZE="-1">ISO C</FONT> such a type qualifier has no effect,
|
|
since the value returned by a function is not an lvalue.
|
|
For C<FONT SIZE="-2">++</FONT>, the warning is only emitted for scalar types or <TT>"void"</TT>.
|
|
<FONT SIZE="-1">ISO C</FONT> prohibits qualified <TT>"void"</TT> return types on function
|
|
definitions, so such return types always receive a warning
|
|
even without this option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is also enabled by <B>-Wextra</B>.
|
|
<DT id="424"><B>-Wignored-attributes</B> (C and C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when an attribute is ignored. This is different from the
|
|
<B>-Wattributes</B> 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.
|
|
<DT id="425"><B>-Wmain</B><DD>
|
|
|
|
|
|
Warn if the type of <TT>"main"</TT> is suspicious. <TT>"main"</TT> 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<FONT SIZE="-2">++</FONT> and is enabled by either <B>-Wall</B>
|
|
or <B>-Wpedantic</B>.
|
|
<DT id="426"><B>-Wmisleading-indentation</B> (C and C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when the indentation of the code does not reflect the block structure.
|
|
Specifically, a warning is issued for <TT>"if"</TT>, <TT>"else"</TT>, <TT>"while"</TT>, and
|
|
<TT>"for"</TT> clauses with a guarded statement that does not use braces,
|
|
followed by an unguarded statement with the same indentation.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In the following example, the call to ``bar'' is misleadingly indented as
|
|
if it were guarded by the ``if'' conditional.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
if (some_condition ())
|
|
foo ();
|
|
bar (); /* Gotcha: this is not guarded by the "if". */
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In the case of mixed tabs and spaces, the warning uses the
|
|
<B>-ftabstop=</B> option to determine if the statements line up
|
|
(defaulting to 8).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The warning is not issued for code involving multiline preprocessor logic
|
|
such as the following example.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
if (flagA)
|
|
foo (0);
|
|
#if SOME_CONDITION_THAT_DOES_NOT_HOLD
|
|
if (flagB)
|
|
#endif
|
|
foo (1);
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The warning is not issued after a <TT>"#line"</TT> directive, since this
|
|
typically indicates autogenerated code, and no assumptions can be made
|
|
about the layout of the file that the directive references.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B> in C and C<FONT SIZE="-2">++</FONT>.
|
|
<DT id="427"><B>-Wmissing-attributes</B><DD>
|
|
|
|
|
|
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,
|
|
the warning is issued for declarations of aliases that use attributes
|
|
to specify less restrictive requirements than those of their targets.
|
|
This typically represents a potential optimization opportunity.
|
|
By contrast, the <B>-Wattribute-alias=2</B> option controls warnings
|
|
issued when the alias is more restrictive than the target, which could
|
|
lead to incorrect code generation.
|
|
Attributes considered include <TT>"alloc_align"</TT>, <TT>"alloc_size"</TT>,
|
|
<TT>"cold"</TT>, <TT>"const"</TT>, <TT>"hot"</TT>, <TT>"leaf"</TT>, <TT>"malloc"</TT>,
|
|
<TT>"nonnull"</TT>, <TT>"noreturn"</TT>, <TT>"nothrow"</TT>, <TT>"pure"</TT>,
|
|
<TT>"returns_nonnull"</TT>, and <TT>"returns_twice"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In C<FONT SIZE="-2">++</FONT>, the warning is issued when an explicit specialization of a primary
|
|
template declared with attribute <TT>"alloc_align"</TT>, <TT>"alloc_size"</TT>,
|
|
<TT>"assume_aligned"</TT>, <TT>"format"</TT>, <TT>"format_arg"</TT>, <TT>"malloc"</TT>,
|
|
or <TT>"nonnull"</TT> is declared without it. Attributes <TT>"deprecated"</TT>,
|
|
<TT>"error"</TT>, and <TT>"warning"</TT> suppress the warning..
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can use the <TT>"copy"</TT> attribute to apply the same
|
|
set of attributes to a declaration as that on another declaration without
|
|
explicitly enumerating the attributes. This attribute can be applied
|
|
to declarations of functions,
|
|
variables, or types.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Wmissing-attributes</B> is enabled by <B>-Wall</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, since the declaration of the primary function template
|
|
below makes use of both attribute <TT>"malloc"</TT> and <TT>"alloc_size"</TT>
|
|
the declaration of the explicit specialization of the template is
|
|
diagnosed because it is missing one of the attributes.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
template <class T>
|
|
T* __attribute__ ((malloc, alloc_size (1)))
|
|
allocate (size_t);
|
|
|
|
template <>
|
|
void* __attribute__ ((malloc)) // missing alloc_size
|
|
allocate<void> (size_t);
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="428"><B>-Wmissing-braces</B><DD>
|
|
|
|
|
|
Warn if an aggregate or union initializer is not fully bracketed. In
|
|
the following example, the initializer for <TT>"a"</TT> is not fully
|
|
bracketed, but that for <TT>"b"</TT> is fully bracketed. This warning is
|
|
enabled by <B>-Wall</B> in C.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int a[2][2] = { 0, 1, 2, 3 };
|
|
int b[2][2] = { { 0, 1 }, { 2, 3 } };
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="429"><B>-Wmissing-include-dirs</B> (C, C<FONT SIZE="-2">++</FONT>, Objective-C and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn if a user-supplied include directory does not exist.
|
|
<DT id="430"><B>-Wmissing-profile</B><DD>
|
|
|
|
|
|
Warn if feedback profiles are missing when using the
|
|
<B>-fprofile-use</B> option.
|
|
This option diagnoses those cases where a new function or a new file is added
|
|
to the user code between compiling with <B>-fprofile-generate</B> and with
|
|
<B>-fprofile-use</B>, without regenerating the profiles. In these cases, the
|
|
profile feedback data files do not contain any profile feedback information for
|
|
the newly added function or file respectively. Also, in the case when profile
|
|
count data (.gcda) files are removed, <FONT SIZE="-1">GCC</FONT> cannot use any profile feedback
|
|
information. In all these cases, warnings are issued to inform the user that a
|
|
profile generation step is due. <B>-Wno-missing-profile</B> can be used to
|
|
disable the warning. Ignoring the warning can result in poorly optimized code.
|
|
Completely disabling the warning is not recommended and should be done only
|
|
when non-existent profile data is justified.
|
|
<DT id="431"><B>-Wmultistatement-macros</B><DD>
|
|
|
|
|
|
Warn about unsafe multiple statement macros that appear to be guarded
|
|
by a clause such as <TT>"if"</TT>, <TT>"else"</TT>, <TT>"for"</TT>, <TT>"switch"</TT>, or
|
|
<TT>"while"</TT>, in which only the first statement is actually guarded after
|
|
the macro is expanded.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
#define DOIT x++; y++
|
|
if (c)
|
|
DOIT;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
will increment <TT>"y"</TT> unconditionally, not just when <TT>"c"</TT> holds.
|
|
The can usually be fixed by wrapping the macro in a do-while loop:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
#define DOIT do { x++; y++; } while (0)
|
|
if (c)
|
|
DOIT;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B> in C and C<FONT SIZE="-2">++</FONT>.
|
|
<DT id="432"><B>-Wparentheses</B><DD>
|
|
|
|
|
|
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
|
|
often get confused about.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Also warn if a comparison like <TT>"x<=y<=z"</TT> appears; this is
|
|
equivalent to <TT>"(x<=y ? 1 : 0) <= z"</TT>, which is a different
|
|
interpretation from that of ordinary mathematical notation.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Also warn for dangerous uses of the <FONT SIZE="-1">GNU</FONT> extension to
|
|
<TT>"?:"</TT> with omitted middle operand. When the condition
|
|
in the <TT>"?"</TT>: operator is a boolean expression, the omitted value is
|
|
always 1. Often programmers expect it to be a value computed
|
|
inside the conditional expression instead.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For C<FONT SIZE="-2">++</FONT> this also warns for some cases of unnecessary parentheses in
|
|
declarations, which can indicate an attempt at a function call instead
|
|
of a declaration:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
{
|
|
// Declares a local variable called mymutex.
|
|
std::unique_lock<std::mutex> (mymutex);
|
|
// User meant std::unique_lock<std::mutex> lock (mymutex);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="433"><B>-Wsequence-point</B><DD>
|
|
|
|
|
|
Warn about code that may have undefined semantics because of violations
|
|
of sequence point rules in the C and C<FONT SIZE="-2">++</FONT> standards.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The C and C<FONT SIZE="-2">++</FONT> standards define the order in which expressions in a C/C<FONT SIZE="-2">++</FONT>
|
|
program are evaluated in terms of <I>sequence points</I>, which represent
|
|
a partial ordering between the execution of parts of the program: those
|
|
executed before the sequence point, and those executed after it. These
|
|
occur after the evaluation of a full expression (one which is not part
|
|
of a larger expression), after the evaluation of the first operand of a
|
|
<TT>"&&"</TT>, <TT>"||"</TT>, <TT>"? :"</TT> or <TT>","</TT> (comma) operator, before a
|
|
function is called (but after the evaluation of its arguments and the
|
|
expression denoting the called function), and in certain other places.
|
|
Other than as expressed by the sequence point rules, the order of
|
|
evaluation of subexpressions of an expression is not specified. All
|
|
these rules describe only a partial order rather than a total order,
|
|
since, for example, if two functions are called within one expression
|
|
with no sequence point between them, the order in which the functions
|
|
are called is not specified. However, the standards committee have
|
|
ruled that function calls do not overlap.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It is not specified when between sequence points modifications to the
|
|
values of objects take effect. Programs whose behavior depends on this
|
|
have undefined behavior; the C and C<FONT SIZE="-2">++</FONT> standards specify that ``Between
|
|
the previous and next sequence point an object shall have its stored
|
|
value modified at most once by the evaluation of an expression.
|
|
Furthermore, the prior value shall be read only to determine the value
|
|
to be stored.''. If a program breaks these rules, the results on any
|
|
particular implementation are entirely unpredictable.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Examples of code with undefined behavior are <TT>"a = a++;"</TT>, <TT>"a[n]
|
|
= b[n++]"</TT> and <TT>"a[i++] = i;"</TT>. Some more complicated cases are not
|
|
diagnosed by this option, and it may give an occasional false positive
|
|
result, but in general it has been found fairly effective at detecting
|
|
this sort of problem in programs.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The C<FONT SIZE="-2">++</FONT>17 standard will define the order of evaluation of operands in
|
|
more cases: in particular it requires that the right-hand side of an
|
|
assignment be evaluated before the left-hand side, so the above
|
|
examples are no longer undefined. But this warning will still warn
|
|
about them, to help people avoid writing code that is undefined in C
|
|
and earlier revisions of C<FONT SIZE="-2">++</FONT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The standard is worded confusingly, therefore there is some debate
|
|
over the precise meaning of the sequence point rules in subtle cases.
|
|
Links to discussions of the problem, including proposed formal
|
|
definitions, may be found on the <FONT SIZE="-1">GCC</FONT> readings page, at
|
|
<<B><A HREF="http://gcc.gnu.org/readings.html">http://gcc.gnu.org/readings.html</A></B>>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B> for C and C<FONT SIZE="-2">++</FONT>.
|
|
<DT id="434"><B>-Wno-return-local-addr</B><DD>
|
|
|
|
|
|
Do not warn about returning a pointer (or in C<FONT SIZE="-2">++</FONT>, a reference) to a
|
|
variable that goes out of scope after the function returns.
|
|
<DT id="435"><B>-Wreturn-type</B><DD>
|
|
|
|
|
|
Warn whenever a function is defined with a return type that defaults
|
|
to <TT>"int"</TT>. Also warn about any <TT>"return"</TT> statement with no
|
|
return value in a function whose return type is not <TT>"void"</TT>
|
|
(falling off the end of the function body is considered returning
|
|
without a value).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For C only, warn about a <TT>"return"</TT> statement with an expression in a
|
|
function whose return type is <TT>"void"</TT>, unless the expression type is
|
|
also <TT>"void"</TT>. As a <FONT SIZE="-1">GNU</FONT> extension, the latter case is accepted
|
|
without a warning unless <B>-Wpedantic</B> is used. Attempting
|
|
to use the return value of a non-<TT>"void"</TT> function other than <TT>"main"</TT>
|
|
that flows off the end by reaching the closing curly brace that terminates
|
|
the function is undefined.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Unlike in C, in C<FONT SIZE="-2">++</FONT>, flowing off the end of a non-<TT>"void"</TT> function other
|
|
than <TT>"main"</TT> results in undefined behavior even when the value of
|
|
the function is not used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by default in C<FONT SIZE="-2">++</FONT> and by <B>-Wall</B> otherwise.
|
|
<DT id="436"><B>-Wshift-count-negative</B><DD>
|
|
|
|
|
|
Warn if shift count is negative. This warning is enabled by default.
|
|
<DT id="437"><B>-Wshift-count-overflow</B><DD>
|
|
|
|
|
|
Warn if shift count >= width of type. This warning is enabled by default.
|
|
<DT id="438"><B>-Wshift-negative-value</B><DD>
|
|
|
|
|
|
Warn if left shifting a negative value. This warning is enabled by
|
|
<B>-Wextra</B> in C99 and C<FONT SIZE="-2">++</FONT>11 modes (and newer).
|
|
<DT id="439"><B>-Wshift-overflow</B><DD>
|
|
|
|
|
|
|
|
<DT id="440"><B>-Wshift-overflow=</B><I>n</I><DD>
|
|
|
|
|
|
|
|
Warn about left shift overflows. This warning is enabled by
|
|
default in C99 and C<FONT SIZE="-2">++</FONT>11 modes (and newer).
|
|
<DL COMPACT><DT id="441"><DD>
|
|
<DL COMPACT>
|
|
<DT id="442"><B>-Wshift-overflow=1</B><DD>
|
|
|
|
|
|
This is the warning level of <B>-Wshift-overflow</B> and is enabled
|
|
by default in C99 and C<FONT SIZE="-2">++</FONT>11 modes (and newer). This warning level does
|
|
not warn about left-shifting 1 into the sign bit. (However, in C, such
|
|
an overflow is still rejected in contexts where an integer constant expression
|
|
is required.) No warning is emitted in C<FONT SIZE="-2">++</FONT>2A mode (and newer), as signed left
|
|
shifts always wrap.
|
|
<DT id="443"><B>-Wshift-overflow=2</B><DD>
|
|
|
|
|
|
This warning level also warns about left-shifting 1 into the sign bit,
|
|
unless C<FONT SIZE="-2">++</FONT>14 mode (or newer) is active.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="444"><DD>
|
|
</DL>
|
|
|
|
<DT id="445"><B>-Wswitch</B><DD>
|
|
|
|
|
|
Warn whenever a <TT>"switch"</TT> statement has an index of enumerated type
|
|
and lacks a <TT>"case"</TT> for one or more of the named codes of that
|
|
enumeration. (The presence of a <TT>"default"</TT> label prevents this
|
|
warning.) <TT>"case"</TT> labels outside the enumeration range also
|
|
provoke warnings when this option is used (even if there is a
|
|
<TT>"default"</TT> label).
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="446"><B>-Wswitch-default</B><DD>
|
|
|
|
|
|
Warn whenever a <TT>"switch"</TT> statement does not have a <TT>"default"</TT>
|
|
case.
|
|
<DT id="447"><B>-Wswitch-enum</B><DD>
|
|
|
|
|
|
Warn whenever a <TT>"switch"</TT> statement has an index of enumerated type
|
|
and lacks a <TT>"case"</TT> for one or more of the named codes of that
|
|
enumeration. <TT>"case"</TT> labels outside the enumeration range also
|
|
provoke warnings when this option is used. The only difference
|
|
between <B>-Wswitch</B> and this option is that this option gives a
|
|
warning about an omitted enumeration code even if there is a
|
|
<TT>"default"</TT> label.
|
|
<DT id="448"><B>-Wswitch-bool</B><DD>
|
|
|
|
|
|
Warn whenever a <TT>"switch"</TT> 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
|
|
expression to a type other than <TT>"bool"</TT>. For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
switch ((int) (a == 4))
|
|
{
|
|
...
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by default for C and C<FONT SIZE="-2">++</FONT> programs.
|
|
<DT id="449"><B>-Wswitch-unreachable</B><DD>
|
|
|
|
|
|
Warn whenever a <TT>"switch"</TT> statement contains statements between the
|
|
controlling expression and the first case label, which will never be
|
|
executed. For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
switch (cond)
|
|
{
|
|
i = 15;
|
|
...
|
|
case 5:
|
|
...
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Wswitch-unreachable</B> does not warn if the statement between the
|
|
controlling expression and the first case label is just a declaration:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
switch (cond)
|
|
{
|
|
int i;
|
|
...
|
|
case 5:
|
|
i = 5;
|
|
...
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by default for C and C<FONT SIZE="-2">++</FONT> programs.
|
|
<DT id="450"><B>-Wsync-nand</B> (C and C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when <TT>"__sync_fetch_and_nand"</TT> and <TT>"__sync_nand_and_fetch"</TT>
|
|
built-in functions are used. These functions changed semantics in <FONT SIZE="-1">GCC 4.4.</FONT>
|
|
<DT id="451"><B>-Wunused-but-set-parameter</B><DD>
|
|
|
|
|
|
Warn whenever a function parameter is assigned to, but otherwise unused
|
|
(aside from its declaration).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To suppress this warning use the <TT>"unused"</TT> attribute.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is also enabled by <B>-Wunused</B> together with
|
|
<B>-Wextra</B>.
|
|
<DT id="452"><B>-Wunused-but-set-variable</B><DD>
|
|
|
|
|
|
Warn whenever a local variable is assigned to, but otherwise unused
|
|
(aside from its declaration).
|
|
This warning is enabled by <B>-Wall</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To suppress this warning use the <TT>"unused"</TT> attribute.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is also enabled by <B>-Wunused</B>, which is enabled
|
|
by <B>-Wall</B>.
|
|
<DT id="453"><B>-Wunused-function</B><DD>
|
|
|
|
|
|
Warn whenever a static function is declared but not defined or a
|
|
non-inline static function is unused.
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="454"><B>-Wunused-label</B><DD>
|
|
|
|
|
|
Warn whenever a label is declared but not used.
|
|
This warning is enabled by <B>-Wall</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To suppress this warning use the <TT>"unused"</TT> attribute.
|
|
<DT id="455"><B>-Wunused-local-typedefs</B> (C, Objective-C, C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when a typedef locally defined in a function is not used.
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="456"><B>-Wunused-parameter</B><DD>
|
|
|
|
|
|
Warn whenever a function parameter is unused aside from its declaration.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To suppress this warning use the <TT>"unused"</TT> attribute.
|
|
<DT id="457"><B>-Wno-unused-result</B><DD>
|
|
|
|
|
|
Do not warn if a caller of a function marked with attribute
|
|
<TT>"warn_unused_result"</TT> does not use
|
|
its return value. The default is <B>-Wunused-result</B>.
|
|
<DT id="458"><B>-Wunused-variable</B><DD>
|
|
|
|
|
|
Warn whenever a local or static variable is unused aside from its
|
|
declaration. This option implies <B>-Wunused-const-variable=1</B> for C,
|
|
but not for C<FONT SIZE="-2">++</FONT>. This warning is enabled by <B>-Wall</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To suppress this warning use the <TT>"unused"</TT> attribute.
|
|
<DT id="459"><B>-Wunused-const-variable</B><DD>
|
|
|
|
|
|
|
|
<DT id="460"><B>-Wunused-const-variable=</B><I>n</I><DD>
|
|
|
|
|
|
|
|
Warn whenever a constant static variable is unused aside from its declaration.
|
|
<B>-Wunused-const-variable=1</B> is enabled by <B>-Wunused-variable</B>
|
|
for C, but not for C<FONT SIZE="-2">++</FONT>. In C this declares variable storage, but in C<FONT SIZE="-2">++</FONT> this
|
|
is not an error since const variables take the place of <TT>"#define"</TT>s.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To suppress this warning use the <TT>"unused"</TT> attribute.
|
|
<DL COMPACT><DT id="461"><DD>
|
|
<DL COMPACT>
|
|
<DT id="462"><B>-Wunused-const-variable=1</B><DD>
|
|
|
|
|
|
This is the warning level that is enabled by <B>-Wunused-variable</B> for
|
|
C. It warns only about unused static const variables defined in the main
|
|
compilation unit, but not about static const variables declared in any
|
|
header included.
|
|
<DT id="463"><B>-Wunused-const-variable=2</B><DD>
|
|
|
|
|
|
This warning level also warns for unused constant static variables in
|
|
headers (excluding system headers). This is the warning level of
|
|
<B>-Wunused-const-variable</B> and must be explicitly requested since
|
|
in C<FONT SIZE="-2">++</FONT> this isn't an error and in C it might be harder to clean up all
|
|
headers included.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="464"><DD>
|
|
</DL>
|
|
|
|
<DT id="465"><B>-Wunused-value</B><DD>
|
|
|
|
|
|
Warn whenever a statement computes a result that is explicitly not
|
|
used. To suppress this warning cast the unused expression to
|
|
<TT>"void"</TT>. This includes an expression-statement or the left-hand
|
|
side of a comma expression that contains no side effects. For example,
|
|
an expression such as <TT>"x[i,j]"</TT> causes a warning, while
|
|
<TT>"x[(void)i,j]"</TT> does not.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="466"><B>-Wunused</B><DD>
|
|
|
|
|
|
All the above <B>-Wunused</B> options combined.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In order to get a warning about an unused function parameter, you must
|
|
either specify <B>-Wextra -Wunused</B> (note that <B>-Wall</B> implies
|
|
<B>-Wunused</B>), or separately specify <B>-Wunused-parameter</B>.
|
|
<DT id="467"><B>-Wuninitialized</B><DD>
|
|
|
|
|
|
Warn if an automatic variable is used without first being initialized
|
|
or if a variable may be clobbered by a <TT>"setjmp"</TT> call. In C<FONT SIZE="-2">++</FONT>,
|
|
warn if a non-static reference or non-static <TT>"const"</TT> member
|
|
appears in a class without constructors.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you want to warn about code that uses the uninitialized value of the
|
|
variable in its own initializer, use the <B>-Winit-self</B> option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
These warnings occur for individual uninitialized or clobbered
|
|
elements of structure, union or array variables as well as for
|
|
variables that are uninitialized or clobbered as a whole. They do
|
|
not occur for variables or elements declared <TT>"volatile"</TT>. Because
|
|
these warnings depend on optimization, the exact variables or elements
|
|
for which there are warnings depends on the precise optimization
|
|
options and version of <FONT SIZE="-1">GCC</FONT> used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that there may be no warning about a variable that is used only
|
|
to compute a value that itself is never used, because such
|
|
computations may be deleted by data flow analysis before the warnings
|
|
are printed.
|
|
<DT id="468"><B>-Winvalid-memory-model</B><DD>
|
|
|
|
|
|
Warn for invocations of <B>__atomic Builtins</B>, <B>__sync Builtins</B>,
|
|
and the C11 atomic generic functions with a memory consistency argument
|
|
that is either invalid for the operation or outside the range of values
|
|
of the <TT>"memory_order"</TT> enumeration. For example, since the
|
|
<TT>"__atomic_store"</TT> and <TT>"__atomic_store_n"</TT> built-ins are only
|
|
defined for the relaxed, release, and sequentially consistent memory
|
|
orders the following code is diagnosed:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void store (int *i)
|
|
{
|
|
__atomic_store_n (i, 0, memory_order_consume);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Winvalid-memory-model</B> is enabled by default.
|
|
<DT id="469"><B>-Wmaybe-uninitialized</B><DD>
|
|
|
|
|
|
For an automatic (i.e. local) variable, if there exists a path from the
|
|
function entry to a use of the variable that is initialized, but there exist
|
|
some other paths for which the variable is not initialized, the compiler
|
|
emits a warning if it cannot prove the uninitialized paths are not
|
|
executed at run time.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
These warnings are only possible in optimizing compilation, because otherwise
|
|
<FONT SIZE="-1">GCC</FONT> does not keep track of the state of variables.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
These warnings are made optional because <FONT SIZE="-1">GCC</FONT> may not be able to determine when
|
|
the code is correct in spite of appearing to have an error. Here is one
|
|
example of how this can happen:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
{
|
|
int x;
|
|
switch (y)
|
|
{
|
|
case 1: x = 1;
|
|
break;
|
|
case 2: x = 4;
|
|
break;
|
|
case 3: x = 5;
|
|
}
|
|
foo (x);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If the value of <TT>"y"</TT> is always 1, 2 or 3, then <TT>"x"</TT> is
|
|
always initialized, but <FONT SIZE="-1">GCC</FONT> doesn't know this. To suppress the
|
|
warning, you need to provide a default case with <B>assert</B>(0) or
|
|
similar code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option also warns when a non-volatile automatic variable might be
|
|
changed by a call to <TT>"longjmp"</TT>.
|
|
The compiler sees only the calls to <TT>"setjmp"</TT>. It cannot know
|
|
where <TT>"longjmp"</TT> will be called; in fact, a signal handler could
|
|
call it at any point in the code. As a result, you may get a warning
|
|
even when there is in fact no problem because <TT>"longjmp"</TT> cannot
|
|
in fact be called at the place that would cause a problem.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Some spurious warnings can be avoided if you declare all the functions
|
|
you use that never return as <TT>"noreturn"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B> or <B>-Wextra</B>.
|
|
<DT id="470"><B>-Wunknown-pragmas</B><DD>
|
|
|
|
|
|
Warn when a <TT>"#pragma"</TT> directive is encountered that is not understood by
|
|
<FONT SIZE="-1">GCC.</FONT> If this command-line option is used, warnings are even issued
|
|
for unknown pragmas in system header files. This is not the case if
|
|
the warnings are only enabled by the <B>-Wall</B> command-line option.
|
|
<DT id="471"><B>-Wno-pragmas</B><DD>
|
|
|
|
|
|
Do not warn about misuses of pragmas, such as incorrect parameters,
|
|
invalid syntax, or conflicts between pragmas. See also
|
|
<B>-Wunknown-pragmas</B>.
|
|
<DT id="472"><B>-Wno-prio-ctor-dtor</B><DD>
|
|
|
|
|
|
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
|
|
before <TT>"main"</TT> is called or after it returns. The priority values must be
|
|
greater than 100 as the compiler reserves priority values between 0--100 for
|
|
the implementation.
|
|
<DT id="473"><B>-Wstrict-aliasing</B><DD>
|
|
|
|
|
|
This option is only active when <B>-fstrict-aliasing</B> 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
|
|
cases, but does attempt to catch the more common pitfalls. It is
|
|
included in <B>-Wall</B>.
|
|
It is equivalent to <B>-Wstrict-aliasing=3</B>
|
|
<DT id="474"><B>-Wstrict-aliasing=n</B><DD>
|
|
|
|
|
|
This option is only active when <B>-fstrict-aliasing</B> is active.
|
|
It warns about code that might break the strict aliasing rules that the
|
|
compiler is using for optimization.
|
|
Higher levels correspond to higher accuracy (fewer false positives).
|
|
Higher levels also correspond to more effort, similar to the way <B>-O</B>
|
|
works.
|
|
<B>-Wstrict-aliasing</B> is equivalent to <B>-Wstrict-aliasing=3</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Level 1: Most aggressive, quick, least accurate.
|
|
Possibly useful when higher levels
|
|
do not warn but <B>-fstrict-aliasing</B> still breaks the code, as it has very few
|
|
false negatives. However, it has many false positives.
|
|
Warns for all pointer conversions between possibly incompatible types,
|
|
even if never dereferenced. Runs in the front end only.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Level 2: Aggressive, quick, not too precise.
|
|
May still have many false positives (not as many as level 1 though),
|
|
and few false negatives (but possibly more than level 1).
|
|
Unlike level 1, it only warns when an address is taken. Warns about
|
|
incomplete types. Runs in the front end only.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Level 3 (default for <B>-Wstrict-aliasing</B>):
|
|
Should have very few false positives and few false
|
|
negatives. Slightly slower than levels 1 or 2 when optimization is enabled.
|
|
Takes care of the common pun+dereference pattern in the front end:
|
|
<TT>"*(int*)&some_float"</TT>.
|
|
If optimization is enabled, it also runs in the back end, where it deals
|
|
with multiple statement cases using flow-sensitive points-to information.
|
|
Only warns when the converted pointer is dereferenced.
|
|
Does not warn about incomplete types.
|
|
<DT id="475"><B>-Wstrict-overflow</B><DD>
|
|
|
|
|
|
|
|
<DT id="476"><B>-Wstrict-overflow=</B><I>n</I><DD>
|
|
|
|
|
|
|
|
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
|
|
warn about all cases where the code might overflow: it only warns
|
|
about cases where the compiler implements some optimization. Thus
|
|
this warning depends on the optimization level.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
An optimization that assumes that signed overflow does not occur is
|
|
perfectly safe if the values of the variables involved are such that
|
|
overflow never does, in fact, occur. Therefore this warning can
|
|
easily give a false positive: a warning about code that is not
|
|
actually a problem. To help focus on important issues, several
|
|
warning levels are defined. No warnings are issued for the use of
|
|
undefined signed overflow when estimating how many iterations a loop
|
|
requires, in particular when determining whether a loop will be
|
|
executed at all.
|
|
<DL COMPACT><DT id="477"><DD>
|
|
<DL COMPACT>
|
|
<DT id="478"><B>-Wstrict-overflow=1</B><DD>
|
|
|
|
|
|
Warn about cases that are both questionable and easy to avoid. For
|
|
example the compiler simplifies
|
|
<TT>"x + 1 > x"</TT> to <TT>1</TT>. This level of
|
|
<B>-Wstrict-overflow</B> is enabled by <B>-Wall</B>; higher levels
|
|
are not, and must be explicitly requested.
|
|
<DT id="479"><B>-Wstrict-overflow=2</B><DD>
|
|
|
|
|
|
Also warn about other cases where a comparison is simplified to a
|
|
constant. For example: <TT>"abs (x) >= 0"</TT>. This can only be
|
|
simplified when signed integer overflow is undefined, because
|
|
<TT>"abs (INT_MIN)"</TT> overflows to <TT>"INT_MIN"</TT>, which is less than
|
|
zero. <B>-Wstrict-overflow</B> (with no level) is the same as
|
|
<B>-Wstrict-overflow=2</B>.
|
|
<DT id="480"><B>-Wstrict-overflow=3</B><DD>
|
|
|
|
|
|
Also warn about other cases where a comparison is simplified. For
|
|
example: <TT>"x + 1 > 1"</TT> is simplified to <TT>"x > 0"</TT>.
|
|
<DT id="481"><B>-Wstrict-overflow=4</B><DD>
|
|
|
|
|
|
Also warn about other simplifications not covered by the above cases.
|
|
For example: <TT>"(x * 10) / 5"</TT> is simplified to <TT>"x * 2"</TT>.
|
|
<DT id="482"><B>-Wstrict-overflow=5</B><DD>
|
|
|
|
|
|
Also warn about cases where the compiler reduces the magnitude of a
|
|
constant involved in a comparison. For example: <TT>"x + 2 > y"</TT> is
|
|
simplified to <TT>"x + 1 >= y"</TT>. This is reported only at the
|
|
highest warning level because this simplification applies to many
|
|
comparisons, so this warning level gives a very large number of
|
|
false positives.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="483"><DD>
|
|
</DL>
|
|
|
|
<DT id="484"><B>-Wstringop-overflow</B><DD>
|
|
|
|
|
|
|
|
<DT id="485"><B>-Wstringop-overflow=</B><I>type</I><DD>
|
|
|
|
|
|
|
|
Warn for calls to string manipulation functions such as <TT>"memcpy"</TT> and
|
|
<TT>"strcpy"</TT> that are determined to overflow the destination buffer. The
|
|
optional argument is one greater than the type of Object Size Checking to
|
|
perform to determine the size of the destination.
|
|
The argument is meaningful only for functions that operate on character arrays
|
|
but not for raw memory functions like <TT>"memcpy"</TT> which always make use
|
|
of Object Size type-0. The option also warns for calls that specify a size
|
|
in excess of the largest possible object or at most <TT>"SIZE_MAX / 2"</TT> bytes.
|
|
The option produces the best results with optimization enabled but can detect
|
|
a small subset of simple buffer overflows even without optimization in
|
|
calls to the <FONT SIZE="-1">GCC</FONT> built-in functions like <TT>"__builtin_memcpy"</TT> that
|
|
correspond to the standard functions. In any case, the option warns about
|
|
just a subset of buffer overflows detected by the corresponding overflow
|
|
checking built-ins. For example, the option will issue a warning for
|
|
the <TT>"strcpy"</TT> call below because it copies at least 5 characters
|
|
(the string <TT>"blue"</TT> including the terminating <FONT SIZE="-1">NUL</FONT>) into the buffer
|
|
of size 4.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
enum Color { blue, purple, yellow };
|
|
const char* f (enum Color clr)
|
|
{
|
|
static char buf [4];
|
|
const char *str;
|
|
switch (clr)
|
|
{
|
|
case blue: str = "blue"; break;
|
|
case purple: str = "purple"; break;
|
|
case yellow: str = "yellow"; break;
|
|
}
|
|
|
|
return strcpy (buf, str); // warning here
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Option <B>-Wstringop-overflow=2</B> is enabled by default.
|
|
<DL COMPACT><DT id="486"><DD>
|
|
<DL COMPACT>
|
|
<DT id="487"><B>-Wstringop-overflow</B><DD>
|
|
|
|
|
|
|
|
<DT id="488"><B>-Wstringop-overflow=1</B><DD>
|
|
|
|
|
|
|
|
The <B>-Wstringop-overflow=1</B> option uses type-zero Object Size Checking
|
|
to determine the sizes of destination objects. This is the default setting
|
|
of the option. At this setting the option will not warn for writes past
|
|
the end of subobjects of larger objects accessed by pointers unless the
|
|
size of the largest surrounding object is known. When the destination may
|
|
be one of several objects it is assumed to be the largest one of them. On
|
|
Linux systems, when optimization is enabled at this setting the option warns
|
|
for the same code as when the <TT>"_FORTIFY_SOURCE"</TT> macro is defined to
|
|
a non-zero value.
|
|
<DT id="489"><B>-Wstringop-overflow=2</B><DD>
|
|
|
|
|
|
The <B>-Wstringop-overflow=2</B> option uses type-one Object Size Checking
|
|
to determine the sizes of destination objects. At this setting the option
|
|
will warn about overflows when writing to members of the largest complete
|
|
objects whose exact size is known. It will, however, not warn for excessive
|
|
writes to the same members of unknown objects referenced by pointers since
|
|
they may point to arrays containing unknown numbers of elements.
|
|
<DT id="490"><B>-Wstringop-overflow=3</B><DD>
|
|
|
|
|
|
The <B>-Wstringop-overflow=3</B> option uses type-two Object Size Checking
|
|
to determine the sizes of destination objects. At this setting the option
|
|
warns about overflowing the smallest object or data member. This is the
|
|
most restrictive setting of the option that may result in warnings for safe
|
|
code.
|
|
<DT id="491"><B>-Wstringop-overflow=4</B><DD>
|
|
|
|
|
|
The <B>-Wstringop-overflow=4</B> option uses type-three Object Size Checking
|
|
to determine the sizes of destination objects. At this setting the option
|
|
will warn about overflowing any data members, and when the destination is
|
|
one of several objects it uses the size of the largest of them to decide
|
|
whether to issue a warning. Similarly to <B>-Wstringop-overflow=3</B> this
|
|
setting of the option may result in warnings for benign code.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="492"><DD>
|
|
</DL>
|
|
|
|
<DT id="493"><B>-Wstringop-truncation</B><DD>
|
|
|
|
|
|
Warn for calls to bounded string manipulation functions such as <TT>"strncat"</TT>,
|
|
<TT>"strncpy"</TT>, and <TT>"stpncpy"</TT> that may either truncate the copied string
|
|
or leave the destination unchanged.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In the following example, the call to <TT>"strncat"</TT> specifies a bound that
|
|
is less than the length of the source string. As a result, the copy of
|
|
the source will be truncated and so the call is diagnosed. To avoid the
|
|
warning use <TT>"bufsize - strlen (buf) - 1)"</TT> as the bound.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void append (char *buf, size_t bufsize)
|
|
{
|
|
strncat (buf, ".txt", 3);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
As another example, the following call to <TT>"strncpy"</TT> results in copying
|
|
to <TT>"d"</TT> just the characters preceding the terminating <FONT SIZE="-1">NUL,</FONT> without
|
|
appending the <FONT SIZE="-1">NUL</FONT> to the end. Assuming the result of <TT>"strncpy"</TT> is
|
|
necessarily a NUL-terminated string is a common mistake, and so the call
|
|
is diagnosed. To avoid the warning when the result is not expected to be
|
|
NUL-terminated, call <TT>"memcpy"</TT> instead.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void copy (char *d, const char *s)
|
|
{
|
|
strncpy (d, s, strlen (s));
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In the following example, the call to <TT>"strncpy"</TT> specifies the size
|
|
of the destination buffer as the bound. If the length of the source
|
|
string is equal to or greater than this size the result of the copy will
|
|
not be NUL-terminated. Therefore, the call is also diagnosed. To avoid
|
|
the warning, specify <TT>"sizeof buf - 1"</TT> as the bound and set the last
|
|
element of the buffer to <TT>"NUL"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void copy (const char *s)
|
|
{
|
|
char buf[80];
|
|
strncpy (buf, s, sizeof buf);
|
|
...
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In situations where a character array is intended to store a sequence
|
|
of bytes with no terminating <TT>"NUL"</TT> such an array may be annotated
|
|
with attribute <TT>"nonstring"</TT> to avoid this warning. Such arrays,
|
|
however, are not suitable arguments to functions that expect
|
|
<TT>"NUL"</TT>-terminated strings. To help detect accidental misuses of
|
|
such arrays <FONT SIZE="-1">GCC</FONT> issues warnings unless it can prove that the use is
|
|
safe.
|
|
<DT id="494"><B>-Wsuggest-attribute=</B>[<B>pure</B>|<B>const</B>|<B>noreturn</B>|<B>format</B>|<B>cold</B>|<B>malloc</B>]<DD>
|
|
|
|
|
|
Warn for cases where adding an attribute may be beneficial. The
|
|
attributes currently supported are listed below.
|
|
<DL COMPACT><DT id="495"><DD>
|
|
<DL COMPACT>
|
|
<DT id="496"><B>-Wsuggest-attribute=pure</B><DD>
|
|
|
|
|
|
|
|
<DT id="497"><B>-Wsuggest-attribute=const</B><DD>
|
|
|
|
|
|
<DT id="498"><B>-Wsuggest-attribute=noreturn</B><DD>
|
|
|
|
|
|
<DT id="499"><B>-Wmissing-noreturn</B><DD>
|
|
|
|
|
|
<DT id="500"><B>-Wsuggest-attribute=malloc</B><DD>
|
|
|
|
|
|
|
|
Warn about functions that might be candidates for attributes
|
|
<TT>"pure"</TT>, <TT>"const"</TT> or <TT>"noreturn"</TT> or <TT>"malloc"</TT>. The compiler
|
|
only warns for functions visible in other compilation units or (in the case of
|
|
<TT>"pure"</TT> and <TT>"const"</TT>) if it cannot prove that the function returns
|
|
normally. A function returns normally if it doesn't contain an infinite loop or
|
|
return abnormally by throwing, calling <TT>"abort"</TT> or trapping. This analysis
|
|
requires option <B>-fipa-pure-const</B>, which is enabled by default at
|
|
<B>-O</B> and higher. Higher optimization levels improve the accuracy
|
|
of the analysis.
|
|
<DT id="501"><B>-Wsuggest-attribute=format</B><DD>
|
|
|
|
|
|
|
|
<DT id="502"><B>-Wmissing-format-attribute</B><DD>
|
|
|
|
|
|
|
|
Warn about function pointers that might be candidates for <TT>"format"</TT>
|
|
attributes. Note these are only possible candidates, not absolute ones.
|
|
<FONT SIZE="-1">GCC</FONT> guesses that function pointers with <TT>"format"</TT> attributes that
|
|
are used in assignment, initialization, parameter passing or return
|
|
statements should have a corresponding <TT>"format"</TT> attribute in the
|
|
resulting type. I.e. the left-hand side of the assignment or
|
|
initialization, the type of the parameter variable, or the return type
|
|
of the containing function respectively should also have a <TT>"format"</TT>
|
|
attribute to avoid the warning.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> also warns about function definitions that might be
|
|
candidates for <TT>"format"</TT> attributes. Again, these are only
|
|
possible candidates. <FONT SIZE="-1">GCC</FONT> guesses that <TT>"format"</TT> attributes
|
|
might be appropriate for any function that calls a function like
|
|
<TT>"vprintf"</TT> or <TT>"vscanf"</TT>, but this might not always be the
|
|
case, and some functions for which <TT>"format"</TT> attributes are
|
|
appropriate may not be detected.
|
|
<DT id="503"><B>-Wsuggest-attribute=cold</B><DD>
|
|
|
|
|
|
Warn about functions that might be candidates for <TT>"cold"</TT> attribute. This
|
|
is based on static detection and generally will only warn about functions which
|
|
always leads to a call to another <TT>"cold"</TT> function such as wrappers of
|
|
C<FONT SIZE="-2">++</FONT> <TT>"throw"</TT> or fatal error reporting functions leading to <TT>"abort"</TT>.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="504"><DD>
|
|
</DL>
|
|
|
|
<DT id="505"><B>-Wsuggest-final-types</B><DD>
|
|
|
|
|
|
Warn about types with virtual methods where code quality would be improved
|
|
if the type were declared with the C<FONT SIZE="-2">++</FONT>11 <TT>"final"</TT> specifier,
|
|
or, if possible,
|
|
declared in an anonymous namespace. This allows <FONT SIZE="-1">GCC</FONT> to more aggressively
|
|
devirtualize the polymorphic calls. This warning is more effective with link
|
|
time optimization, where the information about the class hierarchy graph is
|
|
more complete.
|
|
<DT id="506"><B>-Wsuggest-final-methods</B><DD>
|
|
|
|
|
|
Warn about virtual methods where code quality would be improved if the method
|
|
were declared with the C<FONT SIZE="-2">++</FONT>11 <TT>"final"</TT> specifier,
|
|
or, if possible, its type were
|
|
declared in an anonymous namespace or with the <TT>"final"</TT> specifier.
|
|
This warning is
|
|
more effective with link-time optimization, where the information about the
|
|
class hierarchy graph is more complete. It is recommended to first consider
|
|
suggestions of <B>-Wsuggest-final-types</B> and then rebuild with new
|
|
annotations.
|
|
<DT id="507"><B>-Wsuggest-override</B><DD>
|
|
|
|
|
|
Warn about overriding virtual functions that are not marked with the override
|
|
keyword.
|
|
<DT id="508"><B>-Walloc-zero</B><DD>
|
|
|
|
|
|
Warn about calls to allocation functions decorated with attribute
|
|
<TT>"alloc_size"</TT> that specify zero bytes, including those to the built-in
|
|
forms of the functions <TT>"aligned_alloc"</TT>, <TT>"alloca"</TT>, <TT>"calloc"</TT>,
|
|
<TT>"malloc"</TT>, and <TT>"realloc"</TT>. Because the behavior of these functions
|
|
when called with a zero size differs among implementations (and in the case
|
|
of <TT>"realloc"</TT> has been deprecated) relying on it may result in subtle
|
|
portability bugs and should be avoided.
|
|
<DT id="509"><B>-Walloc-size-larger-than=</B><I>byte-size</I><DD>
|
|
|
|
|
|
Warn about calls to functions decorated with attribute <TT>"alloc_size"</TT>
|
|
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
|
|
precision would exceed the value of <B></B><FONT SIZE="-1"><B>PTRDIFF_MAX</B></FONT><B></B> on the target.
|
|
<B>-Walloc-size-larger-than=</B><B></B><FONT SIZE="-1"><B>PTRDIFF_MAX</B></FONT><B></B> is enabled by default.
|
|
Warnings controlled by the option can be disabled either by specifying
|
|
<I>byte-size</I> of <B></B><FONT SIZE="-1"><B>SIZE_MAX</B></FONT><B></B> or more or by
|
|
<B>-Wno-alloc-size-larger-than</B>.
|
|
<DT id="510"><B>-Wno-alloc-size-larger-than</B><DD>
|
|
|
|
|
|
Disable <B>-Walloc-size-larger-than=</B> warnings. The option is
|
|
equivalent to <B>-Walloc-size-larger-than=</B><B></B><FONT SIZE="-1"><B>SIZE_MAX</B></FONT><B></B> or
|
|
larger.
|
|
<DT id="511"><B>-Walloca</B><DD>
|
|
|
|
|
|
This option warns on all uses of <TT>"alloca"</TT> in the source.
|
|
<DT id="512"><B>-Walloca-larger-than=</B><I>byte-size</I><DD>
|
|
|
|
|
|
This option warns on calls to <TT>"alloca"</TT> 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 <I>byte-size</I>. It also warns for calls
|
|
to <TT>"alloca"</TT> where the bound value is unknown. Arguments of non-integer
|
|
types are considered unbounded even if they appear to be constrained to
|
|
the expected range.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, a bounded case of <TT>"alloca"</TT> could be:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void func (size_t n)
|
|
{
|
|
void *p;
|
|
if (n <= 1000)
|
|
p = alloca (n);
|
|
else
|
|
p = malloc (n);
|
|
f (p);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In the above example, passing <TT>"-Walloca-larger-than=1000"</TT> would not
|
|
issue a warning because the call to <TT>"alloca"</TT> is known to be at most
|
|
1000 bytes. However, if <TT>"-Walloca-larger-than=500"</TT> were passed,
|
|
the compiler would emit a warning.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Unbounded uses, on the other hand, are uses of <TT>"alloca"</TT> with no
|
|
controlling predicate constraining its integer argument. For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void func ()
|
|
{
|
|
void *p = alloca (n);
|
|
f (p);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <TT>"-Walloca-larger-than=500"</TT> were passed, the above would trigger
|
|
a warning, but this time because of the lack of bounds checking.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note, that even seemingly correct code involving signed integers could
|
|
cause a warning:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void func (signed int n)
|
|
{
|
|
if (n < 500)
|
|
{
|
|
p = alloca (n);
|
|
f (p);
|
|
}
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In the above example, <I>n</I> could be negative, causing a larger than
|
|
expected argument to be implicitly cast into the <TT>"alloca"</TT> call.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option also warns when <TT>"alloca"</TT> is used in a loop.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Walloca-larger-than=</B><B></B><FONT SIZE="-1"><B>PTRDIFF_MAX</B></FONT><B></B> is enabled by default
|
|
but is usually only effective when <B>-ftree-vrp</B> is active (default
|
|
for <B>-O2</B> and above).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
See also <B>-Wvla-larger-than=</B><B>byte-size</B>.
|
|
<DT id="513"><B>-Wno-alloca-larger-than</B><DD>
|
|
|
|
|
|
Disable <B>-Walloca-larger-than=</B> warnings. The option is
|
|
equivalent to <B>-Walloca-larger-than=</B><B></B><FONT SIZE="-1"><B>SIZE_MAX</B></FONT><B></B> or larger.
|
|
<DT id="514"><B>-Warray-bounds</B><DD>
|
|
|
|
|
|
|
|
<DT id="515"><B>-Warray-bounds=</B><I>n</I><DD>
|
|
|
|
|
|
|
|
This option is only active when <B>-ftree-vrp</B> is active
|
|
(default for <B>-O2</B> and above). It warns about subscripts to arrays
|
|
that are always out of bounds. This warning is enabled by <B>-Wall</B>.
|
|
<DL COMPACT><DT id="516"><DD>
|
|
<DL COMPACT>
|
|
<DT id="517"><B>-Warray-bounds=1</B><DD>
|
|
|
|
|
|
This is the warning level of <B>-Warray-bounds</B> and is enabled
|
|
by <B>-Wall</B>; higher levels are not, and must be explicitly requested.
|
|
<DT id="518"><B>-Warray-bounds=2</B><DD>
|
|
|
|
|
|
This warning level also warns about out of bounds access for
|
|
arrays at the end of a struct and for arrays accessed through
|
|
pointers. This warning level may give a larger number of
|
|
false positives and is deactivated by default.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="519"><DD>
|
|
</DL>
|
|
|
|
<DT id="520"><B>-Wattribute-alias=</B><I>n</I><DD>
|
|
|
|
|
|
|
|
<DT id="521"><B>-Wno-attribute-alias</B><DD>
|
|
|
|
|
|
|
|
Warn about declarations using the <TT>"alias"</TT> and similar attributes whose
|
|
target is incompatible with the type of the alias.
|
|
<DL COMPACT><DT id="522"><DD>
|
|
<DL COMPACT>
|
|
<DT id="523"><B>-Wattribute-alias=1</B><DD>
|
|
|
|
|
|
The default warning level of the <B>-Wattribute-alias</B> option diagnoses
|
|
incompatibilities between the type of the alias declaration and that of its
|
|
target. Such incompatibilities are typically indicative of bugs.
|
|
<DT id="524"><B>-Wattribute-alias=2</B><DD>
|
|
|
|
|
|
At this level <B>-Wattribute-alias</B> also diagnoses cases where
|
|
the attributes of the alias declaration are more restrictive than the
|
|
attributes applied to its target. These mismatches can potentially
|
|
result in incorrect code generation. In other cases they may be
|
|
benign and could be resolved simply by adding the missing attribute to
|
|
the target. For comparison, see the <B>-Wmissing-attributes</B>
|
|
option, which controls diagnostics when the alias declaration is less
|
|
restrictive than the target, rather than more restrictive.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Attributes considered include <TT>"alloc_align"</TT>, <TT>"alloc_size"</TT>,
|
|
<TT>"cold"</TT>, <TT>"const"</TT>, <TT>"hot"</TT>, <TT>"leaf"</TT>, <TT>"malloc"</TT>,
|
|
<TT>"nonnull"</TT>, <TT>"noreturn"</TT>, <TT>"nothrow"</TT>, <TT>"pure"</TT>,
|
|
<TT>"returns_nonnull"</TT>, and <TT>"returns_twice"</TT>.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="525"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Wattribute-alias</B> is equivalent to <B>-Wattribute-alias=1</B>.
|
|
This is the default. You can disable these warnings with either
|
|
<B>-Wno-attribute-alias</B> or <B>-Wattribute-alias=0</B>.
|
|
</DL>
|
|
|
|
<DT id="526"><B>-Wbool-compare</B><DD>
|
|
|
|
|
|
Warn about boolean expression compared with an integer value different from
|
|
<TT>"true"</TT>/<TT>"false"</TT>. For instance, the following comparison is
|
|
always false:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int n = 5;
|
|
...
|
|
if ((n > 1) == 2) { ... }
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="527"><B>-Wbool-operation</B><DD>
|
|
|
|
|
|
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,
|
|
which rarely makes sense. (In C<FONT SIZE="-2">++</FONT>, decrementing a boolean is always invalid.
|
|
Incrementing a boolean is invalid in C<FONT SIZE="-2">++</FONT>17, and deprecated otherwise.)
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="528"><B>-Wduplicated-branches</B><DD>
|
|
|
|
|
|
Warn when an if-else has identical branches. This warning detects cases like
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
if (p != NULL)
|
|
return 0;
|
|
else
|
|
return 0;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It doesn't warn when both branches contain just a null statement. This warning
|
|
also warn for conditional operators:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int i = x ? *p : *p;
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="529"><B>-Wduplicated-cond</B><DD>
|
|
|
|
|
|
Warn about duplicated conditions in an if-else-if chain. For instance,
|
|
warn for the following code:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
if (p->q != NULL) { ... }
|
|
else if (p->q != NULL) { ... }
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="530"><B>-Wframe-address</B><DD>
|
|
|
|
|
|
Warn when the <B>__builtin_frame_address</B> or <B>__builtin_return_address</B>
|
|
is called with an argument greater than 0. Such calls may return indeterminate
|
|
values or crash the program. The warning is included in <B>-Wall</B>.
|
|
<DT id="531"><B>-Wno-discarded-qualifiers</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Do not warn if type qualifiers on pointers are being discarded.
|
|
Typically, the compiler warns if a <TT>"const char *"</TT> variable is
|
|
passed to a function that takes a <TT>"char *"</TT> parameter. This option
|
|
can be used to suppress such a warning.
|
|
<DT id="532"><B>-Wno-discarded-array-qualifiers</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Do not warn if type qualifiers on arrays which are pointer targets
|
|
are being discarded. Typically, the compiler warns if a
|
|
<TT>"const int (*)[]"</TT> variable is passed to a function that
|
|
takes a <TT>"int (*)[]"</TT> parameter. This option can be used to
|
|
suppress such a warning.
|
|
<DT id="533"><B>-Wno-incompatible-pointer-types</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Do not warn when there is a conversion between pointers that have incompatible
|
|
types. This warning is for cases not covered by <B>-Wno-pointer-sign</B>,
|
|
which warns for pointer argument passing or assignment with different
|
|
signedness.
|
|
<DT id="534"><B>-Wno-int-conversion</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Do not warn about incompatible integer to pointer and pointer to integer
|
|
conversions. This warning is about implicit conversions; for explicit
|
|
conversions the warnings <B>-Wno-int-to-pointer-cast</B> and
|
|
<B>-Wno-pointer-to-int-cast</B> may be used.
|
|
<DT id="535"><B>-Wno-div-by-zero</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="536"><B>-Wsystem-headers</B><DD>
|
|
|
|
|
|
Print warning messages for constructs found in system header files.
|
|
Warnings from system headers are normally suppressed, on the assumption
|
|
that they usually do not indicate real problems and would only make the
|
|
compiler output harder to read. Using this command-line option tells
|
|
<FONT SIZE="-1">GCC</FONT> to emit warnings from system headers as if they occurred in user
|
|
code. However, note that using <B>-Wall</B> in conjunction with this
|
|
option does <I>not</I> warn about unknown pragmas in system
|
|
headers---for that, <B>-Wunknown-pragmas</B> must also be used.
|
|
<DT id="537"><B>-Wtautological-compare</B><DD>
|
|
|
|
|
|
Warn if a self-comparison always evaluates to true or false. This
|
|
warning detects various mistakes such as:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int i = 1;
|
|
...
|
|
if (i > i) { ... }
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning also warns about bitwise comparisons that always evaluate
|
|
to true or false, for instance:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
if ((a & 16) == 10) { ... }
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
will always be false.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="538"><B>-Wtrampolines</B><DD>
|
|
|
|
|
|
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
|
|
used to call the nested function indirectly. For some targets, it is
|
|
made up of data only and thus requires no special treatment. But, for
|
|
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.
|
|
<DT id="539"><B>-Wfloat-equal</B><DD>
|
|
|
|
|
|
Warn if floating-point values are used in equality comparisons.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The idea behind this is that sometimes it is convenient (for the
|
|
programmer) to consider floating-point values as approximations to
|
|
infinitely precise real numbers. If you are doing this, then you need
|
|
to compute (by analyzing the code, or in some other way) the maximum or
|
|
likely maximum error that the computation introduces, and allow for it
|
|
when performing comparisons (and when producing output, but that's a
|
|
different problem). In particular, instead of testing for equality, you
|
|
should check to see whether the two values have ranges that overlap; and
|
|
this is done with the relational operators, so equality comparisons are
|
|
probably mistaken.
|
|
<DT id="540"><B>-Wtraditional</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn about certain constructs that behave differently in traditional and
|
|
<FONT SIZE="-1">ISO C.</FONT> Also warn about <FONT SIZE="-1">ISO C</FONT> constructs that have no traditional C
|
|
equivalent, and/or problematic constructs that should be avoided.
|
|
<DL COMPACT><DT id="541"><DD>
|
|
<DL COMPACT>
|
|
<DT id="542">*<DD>
|
|
Macro parameters that appear within string literals in the macro body.
|
|
In traditional C macro replacement takes place within string literals,
|
|
but in <FONT SIZE="-1">ISO C</FONT> it does not.
|
|
<DT id="543">*<DD>
|
|
In traditional C, some preprocessor directives did not exist.
|
|
Traditional preprocessors only considered a line to be a directive
|
|
if the <B>#</B> appeared in column 1 on the line. Therefore
|
|
<B>-Wtraditional</B> warns about directives that traditional C
|
|
understands but ignores because the <B>#</B> does not appear as the
|
|
first character on the line. It also suggests you hide directives like
|
|
<TT>"#pragma"</TT> not understood by traditional C by indenting them. Some
|
|
traditional implementations do not recognize <TT>"#elif"</TT>, so this option
|
|
suggests avoiding it altogether.
|
|
<DT id="544">*<DD>
|
|
A function-like macro that appears without arguments.
|
|
<DT id="545">*<DD>
|
|
The unary plus operator.
|
|
<DT id="546">*<DD>
|
|
The <B>U</B> integer constant suffix, or the <B>F</B> or <B>L</B> floating-point
|
|
constant suffixes. (Traditional C does support the <B>L</B> suffix on integer
|
|
constants.) Note, these suffixes appear in macros defined in the system
|
|
headers of most modern systems, e.g. the <B>_MIN</B>/<B>_MAX</B> macros in <TT>"<<A HREF="file:///usr/include/limits.h">limits.h</A>>"</TT>.
|
|
Use of these macros in user code might normally lead to spurious
|
|
warnings, however <FONT SIZE="-1">GCC</FONT>'s integrated preprocessor has enough context to
|
|
avoid warning in these cases.
|
|
<DT id="547">*<DD>
|
|
A function declared external in one block and then used after the end of
|
|
the block.
|
|
<DT id="548">*<DD>
|
|
A <TT>"switch"</TT> statement has an operand of type <TT>"long"</TT>.
|
|
<DT id="549">*<DD>
|
|
A non-<TT>"static"</TT> function declaration follows a <TT>"static"</TT> one.
|
|
This construct is not accepted by some traditional C compilers.
|
|
<DT id="550">*<DD>
|
|
The <FONT SIZE="-1">ISO</FONT> type of an integer constant has a different width or
|
|
signedness from its traditional type. This warning is only issued if
|
|
the base of the constant is ten. I.e. hexadecimal or octal values, which
|
|
typically represent bit patterns, are not warned about.
|
|
<DT id="551">*<DD>
|
|
Usage of <FONT SIZE="-1">ISO</FONT> string concatenation is detected.
|
|
<DT id="552">*<DD>
|
|
Initialization of automatic aggregates.
|
|
<DT id="553">*<DD>
|
|
Identifier conflicts with labels. Traditional C lacks a separate
|
|
namespace for labels.
|
|
<DT id="554">*<DD>
|
|
Initialization of unions. If the initializer is zero, the warning is
|
|
omitted. This is done under the assumption that the zero initializer in
|
|
user code appears conditioned on e.g. <TT>"__STDC__"</TT> to avoid missing
|
|
initializer warnings and relies on default initialization to zero in the
|
|
traditional C case.
|
|
<DT id="555">*<DD>
|
|
Conversions by prototypes between fixed/floating-point values and vice
|
|
versa. The absence of these prototypes when compiling with traditional
|
|
C causes serious problems. This is a subset of the possible
|
|
conversion warnings; for the full set use <B>-Wtraditional-conversion</B>.
|
|
<DT id="556">*<DD>
|
|
Use of <FONT SIZE="-1">ISO C</FONT> style function definitions. This warning intentionally is
|
|
<I>not</I> issued for prototype declarations or variadic functions
|
|
because these <FONT SIZE="-1">ISO C</FONT> features appear in your code when using
|
|
libiberty's traditional C compatibility macros, <TT>"PARAMS"</TT> and
|
|
<TT>"VPARAMS"</TT>. This warning is also bypassed for nested functions
|
|
because that feature is already a <FONT SIZE="-1">GCC</FONT> extension and thus not relevant to
|
|
traditional C compatibility.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="557"><DD>
|
|
</DL>
|
|
|
|
<DT id="558"><B>-Wtraditional-conversion</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
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.
|
|
<DT id="559"><B>-Wdeclaration-after-statement</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn when a declaration is found after a statement in a block. This
|
|
construct, known from C<FONT SIZE="-2">++</FONT>, was introduced with <FONT SIZE="-1">ISO C99</FONT> and is by default
|
|
allowed in <FONT SIZE="-1">GCC.</FONT> It is not supported by <FONT SIZE="-1">ISO C90.</FONT>
|
|
<DT id="560"><B>-Wshadow</B><DD>
|
|
|
|
|
|
Warn whenever a local variable or type declaration shadows another
|
|
variable, parameter, type, class member (in C<FONT SIZE="-2">++</FONT>), or instance variable
|
|
(in Objective-C) or whenever a built-in function is shadowed. Note
|
|
that in C<FONT SIZE="-2">++</FONT>, the compiler warns if a local variable shadows an
|
|
explicit typedef, but not if it shadows a struct/class/enum.
|
|
Same as <B>-Wshadow=global</B>.
|
|
<DT id="561"><B>-Wno-shadow-ivar</B> (Objective-C only)<DD>
|
|
|
|
|
|
Do not warn whenever a local variable shadows an instance variable in an
|
|
Objective-C method.
|
|
<DT id="562"><B>-Wshadow=global</B><DD>
|
|
|
|
|
|
The default for <B>-Wshadow</B>. Warns for any (global) shadowing.
|
|
<DT id="563"><B>-Wshadow=local</B><DD>
|
|
|
|
|
|
Warn when a local variable shadows another local variable or parameter.
|
|
This warning is enabled by <B>-Wshadow=global</B>.
|
|
<DT id="564"><B>-Wshadow=compatible-local</B><DD>
|
|
|
|
|
|
Warn when a local variable shadows another local variable or parameter
|
|
whose type is compatible with that of the shadowing variable. In C<FONT SIZE="-2">++</FONT>,
|
|
type compatibility here means the type of the shadowing variable can be
|
|
converted to that of the shadowed variable. The creation of this flag
|
|
(in addition to <B>-Wshadow=local</B>) is based on the idea that when
|
|
a local variable shadows another one of incompatible type, it is most
|
|
likely intentional, not a bug or typo, as shown in the following example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
for (SomeIterator i = SomeObj.begin(); i != SomeObj.end(); ++i)
|
|
{
|
|
for (int i = 0; i < N; ++i)
|
|
{
|
|
...
|
|
}
|
|
...
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Since the two variable <TT>"i"</TT> in the example above have incompatible types,
|
|
enabling only <B>-Wshadow=compatible-local</B> will not emit a warning.
|
|
Because their types are incompatible, if a programmer accidentally uses one
|
|
in place of the other, type checking will catch that and emit an error or
|
|
warning. So not warning (about shadowing) in this case will not lead to
|
|
undetected bugs. Use of this flag instead of <B>-Wshadow=local</B> can
|
|
possibly reduce the number of warnings triggered by intentional shadowing.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wshadow=local</B>.
|
|
<DT id="565"><B>-Wlarger-than=</B><I>byte-size</I><DD>
|
|
|
|
|
|
Warn whenever an object is defined whose size exceeds <I>byte-size</I>.
|
|
<B>-Wlarger-than=</B><B></B><FONT SIZE="-1"><B>PTRDIFF_MAX</B></FONT><B></B> is enabled by default.
|
|
Warnings controlled by the option can be disabled either by specifying
|
|
<I>byte-size</I> of <B></B><FONT SIZE="-1"><B>SIZE_MAX</B></FONT><B></B> or more or by
|
|
<B>-Wno-larger-than</B>.
|
|
<DT id="566"><B>-Wno-larger-than</B><DD>
|
|
|
|
|
|
Disable <B>-Wlarger-than=</B> warnings. The option is equivalent
|
|
to <B>-Wlarger-than=</B><B></B><FONT SIZE="-1"><B>SIZE_MAX</B></FONT><B></B> or larger.
|
|
<DT id="567"><B>-Wframe-larger-than=</B><I>byte-size</I><DD>
|
|
|
|
|
|
Warn if the size of a function frame exceeds <I>byte-size</I>.
|
|
The computation done to determine the stack frame size is approximate
|
|
and not conservative.
|
|
The actual requirements may be somewhat greater than <I>byte-size</I>
|
|
even if you do not get a warning. In addition, any space allocated
|
|
via <TT>"alloca"</TT>, variable-length arrays, or related constructs
|
|
is not included by the compiler when determining
|
|
whether or not to issue a warning.
|
|
<B>-Wframe-larger-than=</B><B></B><FONT SIZE="-1"><B>PTRDIFF_MAX</B></FONT><B></B> is enabled by default.
|
|
Warnings controlled by the option can be disabled either by specifying
|
|
<I>byte-size</I> of <B></B><FONT SIZE="-1"><B>SIZE_MAX</B></FONT><B></B> or more or by
|
|
<B>-Wno-frame-larger-than</B>.
|
|
<DT id="568"><B>-Wno-frame-larger-than</B><DD>
|
|
|
|
|
|
Disable <B>-Wframe-larger-than=</B> warnings. The option is equivalent
|
|
to <B>-Wframe-larger-than=</B><B></B><FONT SIZE="-1"><B>SIZE_MAX</B></FONT><B></B> or larger.
|
|
<DT id="569"><B>-Wno-free-nonheap-object</B><DD>
|
|
|
|
|
|
Do not warn when attempting to free an object that was not allocated
|
|
on the heap.
|
|
<DT id="570"><B>-Wstack-usage=</B><I>byte-size</I><DD>
|
|
|
|
|
|
Warn if the stack usage of a function might exceed <I>byte-size</I>.
|
|
The computation done to determine the stack usage is conservative.
|
|
Any space allocated via <TT>"alloca"</TT>, variable-length arrays, or related
|
|
constructs is included by the compiler when determining whether or not to
|
|
issue a warning.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The message is in keeping with the output of <B>-fstack-usage</B>.
|
|
<DL COMPACT><DT id="571"><DD>
|
|
<DL COMPACT>
|
|
<DT id="572">*<DD>
|
|
If the stack usage is fully static but exceeds the specified amount, it's:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
warning: stack usage is 1120 bytes
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="573">*<DD>
|
|
If the stack usage is (partly) dynamic but bounded, it's:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
warning: stack usage might be 1648 bytes
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="574">*<DD>
|
|
If the stack usage is (partly) dynamic and not bounded, it's:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
warning: stack usage might be unbounded
|
|
|
|
</PRE>
|
|
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="575"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Wstack-usage=</B><B></B><FONT SIZE="-1"><B>PTRDIFF_MAX</B></FONT><B></B> is enabled by default.
|
|
Warnings controlled by the option can be disabled either by specifying
|
|
<I>byte-size</I> of <B></B><FONT SIZE="-1"><B>SIZE_MAX</B></FONT><B></B> or more or by
|
|
<B>-Wno-stack-usage</B>.
|
|
</DL>
|
|
|
|
<DT id="576"><B>-Wno-stack-usage</B><DD>
|
|
|
|
|
|
Disable <B>-Wstack-usage=</B> warnings. The option is equivalent
|
|
to <B>-Wstack-usage=</B><B></B><FONT SIZE="-1"><B>SIZE_MAX</B></FONT><B></B> or larger.
|
|
<DT id="577"><B>-Wunsafe-loop-optimizations</B><DD>
|
|
|
|
|
|
Warn if the loop cannot be optimized because the compiler cannot
|
|
assume anything on the bounds of the loop indices. With
|
|
<B>-funsafe-loop-optimizations</B> warn if the compiler makes
|
|
such assumptions.
|
|
<DT id="578"><B>-Wno-pedantic-ms-format</B> (MinGW targets only)<DD>
|
|
|
|
|
|
When used in combination with <B>-Wformat</B>
|
|
and <B>-pedantic</B> without <FONT SIZE="-1">GNU</FONT> extensions, this option
|
|
disables the warnings about non-ISO <TT>"printf"</TT> / <TT>"scanf"</TT> format
|
|
width specifiers <TT>"I32"</TT>, <TT>"I64"</TT>, and <TT>"I"</TT> used on Windows targets,
|
|
which depend on the <FONT SIZE="-1">MS</FONT> runtime.
|
|
<DT id="579"><B>-Waligned-new</B><DD>
|
|
|
|
|
|
Warn about a new-expression of a type that requires greater alignment
|
|
than the <TT>"alignof(std::max_align_t)"</TT> but uses an allocation
|
|
function without an explicit alignment parameter. This option is
|
|
enabled by <B>-Wall</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Normally this only warns about global allocation functions, but
|
|
<B>-Waligned-new=all</B> also warns about class member allocation
|
|
functions.
|
|
<DT id="580"><B>-Wplacement-new</B><DD>
|
|
|
|
|
|
|
|
<DT id="581"><B>-Wplacement-new=</B><I>n</I><DD>
|
|
|
|
|
|
|
|
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
|
|
because it attempts to construct an array of 64 integers in a buffer only
|
|
64 bytes large.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
char buf [64];
|
|
new (buf) int[64];
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by default.
|
|
<DL COMPACT><DT id="582"><DD>
|
|
<DL COMPACT>
|
|
<DT id="583"><B>-Wplacement-new=1</B><DD>
|
|
|
|
|
|
This is the default warning level of <B>-Wplacement-new</B>. At this
|
|
level the warning is not issued for some strictly undefined constructs that
|
|
<FONT SIZE="-1">GCC</FONT> allows as extensions for compatibility with legacy code. For example,
|
|
the following <TT>"new"</TT> expression is not diagnosed at this level even
|
|
though it has undefined behavior according to the C<FONT SIZE="-2">++</FONT> standard because
|
|
it writes past the end of the one-element array.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct S { int n, a[1]; };
|
|
S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
|
|
new (s->a)int [32]();
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="584"><B>-Wplacement-new=2</B><DD>
|
|
|
|
|
|
At this level, in addition to diagnosing all the same constructs as at level
|
|
1, a diagnostic is also issued for placement new expressions that construct
|
|
an object in the last member of structure whose type is an array of a single
|
|
element and whose size is less than the size of the object being constructed.
|
|
While the previous example would be diagnosed, the following construct makes
|
|
use of the flexible member array extension to avoid the warning at level 2.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct S { int n, a[]; };
|
|
S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
|
|
new (s->a)int [32]();
|
|
|
|
</PRE>
|
|
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="585"><DD>
|
|
</DL>
|
|
|
|
<DT id="586"><B>-Wpointer-arith</B><DD>
|
|
|
|
|
|
Warn about anything that depends on the ``size of'' a function type or
|
|
of <TT>"void"</TT>. <FONT SIZE="-1">GNU C</FONT> assigns these types a size of 1, for
|
|
convenience in calculations with <TT>"void *"</TT> pointers and pointers
|
|
to functions. In C<FONT SIZE="-2">++</FONT>, warn also when an arithmetic operation involves
|
|
<TT>"NULL"</TT>. This warning is also enabled by <B>-Wpedantic</B>.
|
|
<DT id="587"><B>-Wpointer-compare</B><DD>
|
|
|
|
|
|
Warn if a pointer is compared with a zero character constant. This usually
|
|
means that the pointer was meant to be dereferenced. For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
const char *p = foo ();
|
|
if (p == '\0')
|
|
return 42;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that the code above is invalid in C<FONT SIZE="-2">++</FONT>11.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by default.
|
|
<DT id="588"><B>-Wtype-limits</B><DD>
|
|
|
|
|
|
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
|
|
<TT>"<"</TT> or <TT>">="</TT>. This warning is also enabled by
|
|
<B>-Wextra</B>.
|
|
<DT id="589"><B>-Wabsolute-value</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
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 <TT>"abs(3.14)"</TT> triggers the warning because the
|
|
appropriate function to call to compute the absolute value of a double
|
|
argument is <TT>"fabs"</TT>. The option also triggers warnings when the
|
|
argument in a call to such a function has an unsigned type. This
|
|
warning can be suppressed with an explicit type cast and it is also
|
|
enabled by <B>-Wextra</B>.
|
|
<DT id="590"><B>-Wcomment</B><DD>
|
|
|
|
|
|
|
|
<DT id="591"><B>-Wcomments</B><DD>
|
|
|
|
|
|
|
|
Warn whenever a comment-start sequence <B>/*</B> appears in a <B>/*</B>
|
|
comment, or whenever a backslash-newline appears in a <B>//</B> comment.
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="592"><B>-Wtrigraphs</B><DD>
|
|
|
|
|
|
Warn if any trigraphs are encountered that might change the meaning of
|
|
the program. Trigraphs within comments are not warned about,
|
|
except those that would form escaped newlines.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is implied by <B>-Wall</B>. If <B>-Wall</B> is not
|
|
given, this option is still enabled unless trigraphs are enabled. To
|
|
get trigraph conversion without warnings, but get the other
|
|
<B>-Wall</B> warnings, use <B>-trigraphs -Wall -Wno-trigraphs</B>.
|
|
<DT id="593"><B>-Wundef</B><DD>
|
|
|
|
|
|
Warn if an undefined identifier is evaluated in an <TT>"#if"</TT> directive.
|
|
Such identifiers are replaced with zero.
|
|
<DT id="594"><B>-Wexpansion-to-defined</B><DD>
|
|
|
|
|
|
Warn whenever <B>defined</B> is encountered in the expansion of a macro
|
|
(including the case where the macro is expanded by an <B>#if</B> directive).
|
|
Such usage is not portable.
|
|
This warning is also enabled by <B>-Wpedantic</B> and <B>-Wextra</B>.
|
|
<DT id="595"><B>-Wunused-macros</B><DD>
|
|
|
|
|
|
Warn about macros defined in the main file that are unused. A macro
|
|
is <I>used</I> if it is expanded or tested for existence at least once.
|
|
The preprocessor also warns if the macro has not been used at the
|
|
time it is redefined or undefined.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Built-in macros, macros defined on the command line, and macros
|
|
defined in include files are not warned about.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Note:</I> If a macro is actually used, but only used in skipped
|
|
conditional blocks, then the preprocessor reports it as unused. To avoid the
|
|
warning in such a case, you might improve the scope of the macro's
|
|
definition by, for example, moving it into the first skipped block.
|
|
Alternatively, you could provide a dummy use with something like:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
#if defined the_macro_causing_the_warning
|
|
#endif
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="596"><B>-Wno-endif-labels</B><DD>
|
|
|
|
|
|
Do not warn whenever an <TT>"#else"</TT> or an <TT>"#endif"</TT> are followed by text.
|
|
This sometimes happens in older programs with code of the form
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
#if FOO
|
|
...
|
|
#else FOO
|
|
...
|
|
#endif FOO
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The second and third <TT>"FOO"</TT> should be in comments.
|
|
This warning is on by default.
|
|
<DT id="597"><B>-Wbad-function-cast</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
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.
|
|
<DT id="598"><B>-Wc90-c99-compat</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn about features not present in <FONT SIZE="-1">ISO C90,</FONT> but present in <FONT SIZE="-1">ISO C99.</FONT>
|
|
For instance, warn about use of variable length arrays, <TT>"long long"</TT>
|
|
type, <TT>"bool"</TT> type, compound literals, designated initializers, and so
|
|
on. This option is independent of the standards mode. Warnings are disabled
|
|
in the expression that follows <TT>"__extension__"</TT>.
|
|
<DT id="599"><B>-Wc99-c11-compat</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn about features not present in <FONT SIZE="-1">ISO C99,</FONT> but present in <FONT SIZE="-1">ISO C11.</FONT>
|
|
For instance, warn about use of anonymous structures and unions,
|
|
<TT>"_Atomic"</TT> type qualifier, <TT>"_Thread_local"</TT> storage-class specifier,
|
|
<TT>"_Alignas"</TT> specifier, <TT>"Alignof"</TT> operator, <TT>"_Generic"</TT> keyword,
|
|
and so on. This option is independent of the standards mode. Warnings are
|
|
disabled in the expression that follows <TT>"__extension__"</TT>.
|
|
<DT id="600"><B>-Wc11-c2x-compat</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn about features not present in <FONT SIZE="-1">ISO C11,</FONT> but present in <FONT SIZE="-1">ISO C2X.</FONT>
|
|
For instance, warn about omitting the string in <TT>"_Static_assert"</TT>.
|
|
This option is independent of the standards mode. Warnings are
|
|
disabled in the expression that follows <TT>"__extension__"</TT>.
|
|
<DT id="601"><B>-Wc++-compat</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn about <FONT SIZE="-1">ISO C</FONT> constructs that are outside of the common subset of
|
|
<FONT SIZE="-1">ISO C</FONT> and <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT>,</FONT> e.g. request for implicit conversion from
|
|
<TT>"void *"</TT> to a pointer to non-<TT>"void"</TT> type.
|
|
<DT id="602"><B>-Wc++11-compat</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn about C<FONT SIZE="-2">++</FONT> constructs whose meaning differs between <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT> 1998</FONT>
|
|
and <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT> 2011,</FONT> e.g., identifiers in <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT> 1998</FONT> that are keywords
|
|
in <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT> 2011.</FONT> This warning turns on <B>-Wnarrowing</B> and is
|
|
enabled by <B>-Wall</B>.
|
|
<DT id="603"><B>-Wc++14-compat</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn about C<FONT SIZE="-2">++</FONT> constructs whose meaning differs between <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT> 2011</FONT>
|
|
and <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT> 2014.</FONT> This warning is enabled by <B>-Wall</B>.
|
|
<DT id="604"><B>-Wc++17-compat</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn about C<FONT SIZE="-2">++</FONT> constructs whose meaning differs between <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT> 2014</FONT>
|
|
and <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT> 2017.</FONT> This warning is enabled by <B>-Wall</B>.
|
|
<DT id="605"><B>-Wcast-qual</B><DD>
|
|
|
|
|
|
Warn whenever a pointer is cast so as to remove a type qualifier from
|
|
the target type. For example, warn if a <TT>"const char *"</TT> is cast
|
|
to an ordinary <TT>"char *"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Also warn when making a cast that introduces a type qualifier in an
|
|
unsafe way. For example, casting <TT>"char **"</TT> to <TT>"const char **"</TT>
|
|
is unsafe, as in this example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
/* p is char ** value. */
|
|
const char **q = (const char **) p;
|
|
/* Assignment of readonly string to const char * is OK. */
|
|
*q = "string";
|
|
/* Now char** pointer points to read-only memory. */
|
|
**p = 'b';
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="606"><B>-Wcast-align</B><DD>
|
|
|
|
|
|
Warn whenever a pointer is cast such that the required alignment of the
|
|
target is increased. For example, warn if a <TT>"char *"</TT> is cast to
|
|
an <TT>"int *"</TT> on machines where integers can only be accessed at
|
|
two- or four-byte boundaries.
|
|
<DT id="607"><B>-Wcast-align=strict</B><DD>
|
|
|
|
|
|
Warn whenever a pointer is cast such that the required alignment of the
|
|
target is increased. For example, warn if a <TT>"char *"</TT> is cast to
|
|
an <TT>"int *"</TT> regardless of the target machine.
|
|
<DT id="608"><B>-Wcast-function-type</B><DD>
|
|
|
|
|
|
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.
|
|
Any parameter of pointer-type matches any other pointer-type. Any benign
|
|
differences in integral types are ignored, like <TT>"int"</TT> vs. <TT>"long"</TT>
|
|
on <FONT SIZE="-1">ILP32</FONT> targets. Likewise type qualifiers are ignored. The function
|
|
type <TT>"void (*) (void)"</TT> is special and matches everything, which can
|
|
be used to suppress this warning.
|
|
In a cast involving pointer to member types this warning warns whenever
|
|
the type cast is changing the pointer to member type.
|
|
This warning is enabled by <B>-Wextra</B>.
|
|
<DT id="609"><B>-Wwrite-strings</B><DD>
|
|
|
|
|
|
When compiling C, give string constants the type <TT>"const
|
|
char[</TT>length<TT>]"</TT> so that copying the address of one into a
|
|
non-<TT>"const"</TT> <TT>"char *"</TT> pointer produces a warning. These
|
|
warnings help you find at compile time code that can try to write
|
|
into a string constant, but only if you have been very careful about
|
|
using <TT>"const"</TT> in declarations and prototypes. Otherwise, it is
|
|
just a nuisance. This is why we did not make <B>-Wall</B> request
|
|
these warnings.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When compiling C<FONT SIZE="-2">++</FONT>, warn about the deprecated conversion from string
|
|
literals to <TT>"char *"</TT>. This warning is enabled by default for C<FONT SIZE="-2">++</FONT>
|
|
programs.
|
|
<DT id="610"><B>-Wcatch-value</B><DD>
|
|
|
|
|
|
|
|
<DT id="611"><B>-Wcatch-value=</B><I>n</I><B> </B>(C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
|
|
Warn about catch handlers that do not catch via reference.
|
|
With <B>-Wcatch-value=1</B> (or <B>-Wcatch-value</B> for short)
|
|
warn about polymorphic class types that are caught by value.
|
|
With <B>-Wcatch-value=2</B> warn about all class types that are caught
|
|
by value. With <B>-Wcatch-value=3</B> warn about all types that are
|
|
not caught by reference. <B>-Wcatch-value</B> is enabled by <B>-Wall</B>.
|
|
<DT id="612"><B>-Wclobbered</B><DD>
|
|
|
|
|
|
Warn for variables that might be changed by <TT>"longjmp"</TT> or
|
|
<TT>"vfork"</TT>. This warning is also enabled by <B>-Wextra</B>.
|
|
<DT id="613"><B>-Wconditionally-supported</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn for conditionally-supported (C<FONT SIZE="-2">++</FONT>11 [intro.defs]) constructs.
|
|
<DT id="614"><B>-Wconversion</B><DD>
|
|
|
|
|
|
Warn for implicit conversions that may alter a value. This includes
|
|
conversions between real and integer, like <TT>"abs (x)"</TT> when
|
|
<TT>"x"</TT> is <TT>"double"</TT>; conversions between signed and unsigned,
|
|
like <TT>"unsigned ui = -1"</TT>; and conversions to smaller types, like
|
|
<TT>"sqrtf (M_PI)"</TT>. Do not warn for explicit casts like <TT>"abs
|
|
((int) x)"</TT> and <TT>"ui = (unsigned) -1"</TT>, or if the value is not
|
|
changed by the conversion like in <TT>"abs (2.0)"</TT>. Warnings about
|
|
conversions between signed and unsigned integers can be disabled by
|
|
using <B>-Wno-sign-conversion</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For C<FONT SIZE="-2">++</FONT>, also warn for confusing overload resolution for user-defined
|
|
conversions; and conversions that never use a type conversion
|
|
operator: conversions to <TT>"void"</TT>, the same type, a base class or a
|
|
reference to them. Warnings about conversions between signed and
|
|
unsigned integers are disabled by default in C<FONT SIZE="-2">++</FONT> unless
|
|
<B>-Wsign-conversion</B> is explicitly enabled.
|
|
<DT id="615"><B>-Wno-conversion-null</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Do not warn for conversions between <TT>"NULL"</TT> and non-pointer
|
|
types. <B>-Wconversion-null</B> is enabled by default.
|
|
<DT id="616"><B>-Wzero-as-null-pointer-constant</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when a literal <B>0</B> is used as null pointer constant. This can
|
|
be useful to facilitate the conversion to <TT>"nullptr"</TT> in C<FONT SIZE="-2">++</FONT>11.
|
|
<DT id="617"><B>-Wsubobject-linkage</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
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
|
|
a type B with no or internal linkage, defining it in multiple
|
|
translation units would be an <FONT SIZE="-1">ODR</FONT> violation because the meaning of B
|
|
is different in each translation unit. If A only appears in a single
|
|
translation unit, the best way to silence the warning is to give it
|
|
internal linkage by putting it in an anonymous namespace as well. The
|
|
compiler doesn't give this warning for types defined in the main .C
|
|
file, as those are unlikely to have multiple definitions.
|
|
<B>-Wsubobject-linkage</B> is enabled by default.
|
|
<DT id="618"><B>-Wdangling-else</B><DD>
|
|
|
|
|
|
Warn about constructions where there may be confusion to which
|
|
<TT>"if"</TT> statement an <TT>"else"</TT> branch belongs. Here is an example of
|
|
such a case:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
{
|
|
if (a)
|
|
if (b)
|
|
foo ();
|
|
else
|
|
bar ();
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In C/C<FONT SIZE="-2">++</FONT>, every <TT>"else"</TT> branch belongs to the innermost possible
|
|
<TT>"if"</TT> statement, which in this example is <TT>"if (b)"</TT>. This is
|
|
often not what the programmer expected, as illustrated in the above
|
|
example by indentation the programmer chose. When there is the
|
|
potential for this confusion, <FONT SIZE="-1">GCC</FONT> issues a warning when this flag
|
|
is specified. To eliminate the warning, add explicit braces around
|
|
the innermost <TT>"if"</TT> statement so there is no way the <TT>"else"</TT>
|
|
can belong to the enclosing <TT>"if"</TT>. The resulting code
|
|
looks like this:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
{
|
|
if (a)
|
|
{
|
|
if (b)
|
|
foo ();
|
|
else
|
|
bar ();
|
|
}
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wparentheses</B>.
|
|
<DT id="619"><B>-Wdate-time</B><DD>
|
|
|
|
|
|
Warn when macros <TT>"__TIME__"</TT>, <TT>"__DATE__"</TT> or <TT>"__TIMESTAMP__"</TT>
|
|
are encountered as they might prevent bit-wise-identical reproducible
|
|
compilations.
|
|
<DT id="620"><B>-Wdelete-incomplete</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when deleting a pointer to incomplete type, which may cause
|
|
undefined behavior at runtime. This warning is enabled by default.
|
|
<DT id="621"><B>-Wuseless-cast</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn when an expression is casted to its own type.
|
|
<DT id="622"><B>-Wempty-body</B><DD>
|
|
|
|
|
|
Warn if an empty body occurs in an <TT>"if"</TT>, <TT>"else"</TT> or <TT>"do
|
|
while"</TT> statement. This warning is also enabled by <B>-Wextra</B>.
|
|
<DT id="623"><B>-Wenum-compare</B><DD>
|
|
|
|
|
|
Warn about a comparison between values of different enumerated types.
|
|
In C<FONT SIZE="-2">++</FONT> enumerated type mismatches in conditional expressions are also
|
|
diagnosed and the warning is enabled by default. In C this warning is
|
|
enabled by <B>-Wall</B>.
|
|
<DT id="624"><B>-Wextra-semi</B> (C<FONT SIZE="-2">++</FONT>, Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn about redundant semicolon after in-class function definition.
|
|
<DT id="625"><B>-Wjump-misses-init</B> (C, Objective-C only)<DD>
|
|
|
|
|
|
Warn if a <TT>"goto"</TT> statement or a <TT>"switch"</TT> 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
|
|
variables that are initialized when they are declared. This warning is
|
|
only supported for C and Objective-C; in C<FONT SIZE="-2">++</FONT> this sort of branch is an
|
|
error in any case.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Wjump-misses-init</B> is included in <B>-Wc++-compat</B>. It
|
|
can be disabled with the <B>-Wno-jump-misses-init</B> option.
|
|
<DT id="626"><B>-Wsign-compare</B><DD>
|
|
|
|
|
|
Warn when a comparison between signed and unsigned values could produce
|
|
an incorrect result when the signed value is converted to unsigned.
|
|
In C<FONT SIZE="-2">++</FONT>, this warning is also enabled by <B>-Wall</B>. In C, it is
|
|
also enabled by <B>-Wextra</B>.
|
|
<DT id="627"><B>-Wsign-conversion</B><DD>
|
|
|
|
|
|
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 <B>-Wconversion</B>.
|
|
<DT id="628"><B>-Wfloat-conversion</B><DD>
|
|
|
|
|
|
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
|
|
<B>-Wconversion</B>.
|
|
<DT id="629"><B>-Wno-scalar-storage-order</B><DD>
|
|
|
|
|
|
Do not warn on suspicious constructs involving reverse scalar storage order.
|
|
<DT id="630"><B>-Wsized-deallocation</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Warn about a definition of an unsized deallocation function
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void operator delete (void *) noexcept;
|
|
void operator delete[] (void *) noexcept;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
without a definition of the corresponding sized deallocation function
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void operator delete (void *, std::size_t) noexcept;
|
|
void operator delete[] (void *, std::size_t) noexcept;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
or vice versa. Enabled by <B>-Wextra</B> along with
|
|
<B>-fsized-deallocation</B>.
|
|
<DT id="631"><B>-Wsizeof-pointer-div</B><DD>
|
|
|
|
|
|
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 <TT>"sizeof (ptr) / sizeof (ptr[0])"</TT> if <TT>"ptr"</TT> is
|
|
not an array, but a pointer. This warning is enabled by <B>-Wall</B>.
|
|
<DT id="632"><B>-Wsizeof-pointer-memaccess</B><DD>
|
|
|
|
|
|
Warn for suspicious length parameters to certain string and memory built-in
|
|
functions if the argument uses <TT>"sizeof"</TT>. This warning triggers for
|
|
example for <TT>"memset (ptr, 0, sizeof (ptr));"</TT> if <TT>"ptr"</TT> is not
|
|
an array, but a pointer, and suggests a possible fix, or about
|
|
<TT>"memcpy (&foo, ptr, sizeof (&foo));"</TT>. <B>-Wsizeof-pointer-memaccess</B>
|
|
also warns about calls to bounded string copy functions like <TT>"strncat"</TT>
|
|
or <TT>"strncpy"</TT> that specify as the bound a <TT>"sizeof"</TT> expression of
|
|
the source array. For example, in the following function the call to
|
|
<TT>"strncat"</TT> specifies the size of the source string as the bound. That
|
|
is almost certainly a mistake and so the call is diagnosed.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void make_file (const char *name)
|
|
{
|
|
char path[PATH_MAX];
|
|
strncpy (path, name, sizeof path - 1);
|
|
strncat (path, ".text", sizeof ".text");
|
|
...
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-Wsizeof-pointer-memaccess</B> option is enabled by <B>-Wall</B>.
|
|
<DT id="633"><B>-Wsizeof-array-argument</B><DD>
|
|
|
|
|
|
Warn when the <TT>"sizeof"</TT> 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<FONT SIZE="-2">++</FONT> programs.
|
|
<DT id="634"><B>-Wmemset-elt-size</B><DD>
|
|
|
|
|
|
Warn for suspicious calls to the <TT>"memset"</TT> 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 <B>-Wall</B>.
|
|
<DT id="635"><B>-Wmemset-transposed-args</B><DD>
|
|
|
|
|
|
Warn for suspicious calls to the <TT>"memset"</TT> built-in function where
|
|
the second argument is not zero and the third argument is zero. For
|
|
example, the call <TT>"memset (buf, sizeof buf, 0)"</TT> is diagnosed because
|
|
<TT>"memset (buf, 0, sizeof buf)"</TT> was meant instead. The diagnostic
|
|
is only emitted if the third argument is a literal zero. Otherwise, if
|
|
it is an expression that is folded to zero, or a cast of zero to some
|
|
type, it is far less likely that the arguments have been mistakenly
|
|
transposed and no warning is emitted. This warning is enabled
|
|
by <B>-Wall</B>.
|
|
<DT id="636"><B>-Waddress</B><DD>
|
|
|
|
|
|
Warn about suspicious uses of memory addresses. These include using
|
|
the address of a function in a conditional expression, such as
|
|
<TT>"void func(void); if (func)"</TT>, and comparisons against the memory
|
|
address of a string literal, such as <TT>"if (x == "abc")"</TT>. Such
|
|
uses typically indicate a programmer error: the address of a function
|
|
always evaluates to true, so their use in a conditional usually
|
|
indicate that the programmer forgot the parentheses in a function
|
|
call; and comparisons against string literals result in unspecified
|
|
behavior and are not portable in C, so they usually indicate that the
|
|
programmer intended to use <TT>"strcmp"</TT>. This warning is enabled by
|
|
<B>-Wall</B>.
|
|
<DT id="637"><B>-Waddress-of-packed-member</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="638"><B>-Wlogical-op</B><DD>
|
|
|
|
|
|
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
|
|
the operands of a logical operator are the same:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
extern int a;
|
|
if (a < 0 && a < 0) { ... }
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="639"><B>-Wlogical-not-parentheses</B><DD>
|
|
|
|
|
|
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:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int a;
|
|
...
|
|
if (!a > 1) { ... }
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It is possible to suppress the warning by wrapping the <FONT SIZE="-1">LHS</FONT> into
|
|
parentheses:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
if ((!a) > 1) { ... }
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="640"><B>-Waggregate-return</B><DD>
|
|
|
|
|
|
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.)
|
|
<DT id="641"><B>-Wno-aggressive-loop-optimizations</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="642"><B>-Wno-attributes</B><DD>
|
|
|
|
|
|
Do not warn if an unexpected <TT>"__attribute__"</TT> is used, such as
|
|
unrecognized attributes, function attributes applied to variables,
|
|
etc. This does not stop errors for incorrect use of supported
|
|
attributes.
|
|
<DT id="643"><B>-Wno-builtin-declaration-mismatch</B><DD>
|
|
|
|
|
|
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
|
|
types do not match those expected by the function. When <B>-Wextra</B>
|
|
is specified, also warn when a built-in function that takes arguments is
|
|
declared without a prototype. The <B>-Wno-builtin-declaration-mismatch</B>
|
|
warning is enabled by default. To avoid the warning include the appropriate
|
|
header to bring the prototypes of built-in functions into scope.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, the call to <TT>"memset"</TT> below is diagnosed by the warning
|
|
because the function expects a value of type <TT>"size_t"</TT> as its argument
|
|
but the type of <TT>32</TT> is <TT>"int"</TT>. With <B>-Wextra</B>,
|
|
the declaration of the function is diagnosed as well.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
extern void* memset ();
|
|
void f (void *d)
|
|
{
|
|
memset (d, '\0', 32);
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="644"><B>-Wno-builtin-macro-redefined</B><DD>
|
|
|
|
|
|
Do not warn if certain built-in macros are redefined. This suppresses
|
|
warnings for redefinition of <TT>"__TIMESTAMP__"</TT>, <TT>"__TIME__"</TT>,
|
|
<TT>"__DATE__"</TT>, <TT>"__FILE__"</TT>, and <TT>"__BASE_FILE__"</TT>.
|
|
<DT id="645"><B>-Wstrict-prototypes</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
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.)
|
|
<DT id="646"><B>-Wold-style-declaration</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn for obsolescent usages, according to the C Standard, in a
|
|
declaration. For example, warn if storage-class specifiers like
|
|
<TT>"static"</TT> are not the first things in a declaration. This warning
|
|
is also enabled by <B>-Wextra</B>.
|
|
<DT id="647"><B>-Wold-style-definition</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn if an old-style function definition is used. A warning is given
|
|
even if there is a previous prototype.
|
|
<DT id="648"><B>-Wmissing-parameter-type</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
A function parameter is declared without a type specifier in K&R-style
|
|
functions:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void foo(bar) { }
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is also enabled by <B>-Wextra</B>.
|
|
<DT id="649"><B>-Wmissing-prototypes</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
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
|
|
that do not have a matching prototype declaration in a header file.
|
|
This option is not valid for C<FONT SIZE="-2">++</FONT> because all function declarations
|
|
provide prototypes and a non-matching declaration declares an
|
|
overload rather than conflict with an earlier declaration.
|
|
Use <B>-Wmissing-declarations</B> to detect missing declarations in C<FONT SIZE="-2">++</FONT>.
|
|
<DT id="650"><B>-Wmissing-declarations</B><DD>
|
|
|
|
|
|
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
|
|
header files. In C, no warnings are issued for functions with previous
|
|
non-prototype declarations; use <B>-Wmissing-prototypes</B> to detect
|
|
missing prototypes. In C<FONT SIZE="-2">++</FONT>, no warnings are issued for function templates,
|
|
or for inline functions, or for functions in anonymous namespaces.
|
|
<DT id="651"><B>-Wmissing-field-initializers</B><DD>
|
|
|
|
|
|
Warn if a structure's initializer has some fields missing. For
|
|
example, the following code causes such a warning, because
|
|
<TT>"x.h"</TT> is implicitly zero:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct s { int f, g, h; };
|
|
struct s x = { 3, 4 };
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option does not warn about designated initializers, so the following
|
|
modification does not trigger a warning:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct s { int f, g, h; };
|
|
struct s x = { .f = 3, .g = 4 };
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In C this option does not warn about the universal zero initializer
|
|
<B>{ 0 }</B>:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct s { int f, g, h; };
|
|
struct s x = { 0 };
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Likewise, in C<FONT SIZE="-2">++</FONT> this option does not warn about the empty { }
|
|
initializer, for example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct s { int f, g, h; };
|
|
s x = { };
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is included in <B>-Wextra</B>. To get other <B>-Wextra</B>
|
|
warnings without this one, use <B>-Wextra -Wno-missing-field-initializers</B>.
|
|
<DT id="652"><B>-Wno-multichar</B><DD>
|
|
|
|
|
|
Do not warn if a multicharacter constant (<B>'</B><FONT SIZE="-1"><B>FOOF</B></FONT><B>'</B>) 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.
|
|
<DT id="653"><B>-Wnormalized=</B>[<B>none</B>|<B>id</B>|<B>nfc</B>|<B>nfkc</B>]<DD>
|
|
|
|
|
|
In <FONT SIZE="-1">ISO C</FONT> and <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT>,</FONT> two identifiers are different if they are
|
|
different sequences of characters. However, sometimes when characters
|
|
outside the basic <FONT SIZE="-1">ASCII</FONT> character set are used, you can have two
|
|
different character sequences that look the same. To avoid confusion,
|
|
the <FONT SIZE="-1">ISO 10646</FONT> standard sets out some <I>normalization rules</I> which
|
|
when applied ensure that two sequences that look the same are turned into
|
|
the same sequence. <FONT SIZE="-1">GCC</FONT> can warn you if you are using identifiers that
|
|
have not been normalized; this option controls that warning.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
There are four levels of warning supported by <FONT SIZE="-1">GCC.</FONT> The default is
|
|
<B>-Wnormalized=nfc</B>, which warns about any identifier that is
|
|
not in the <FONT SIZE="-1">ISO 10646 ``C''</FONT> normalized form, <I></I><FONT SIZE="-1"><I>NFC</I></FONT><I></I>. <FONT SIZE="-1">NFC</FONT> is the
|
|
recommended form for most uses. It is equivalent to
|
|
<B>-Wnormalized</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Unfortunately, there are some characters allowed in identifiers by
|
|
<FONT SIZE="-1">ISO C</FONT> and <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT></FONT> that, when turned into <FONT SIZE="-1">NFC,</FONT> are not allowed in
|
|
identifiers. That is, there's no way to use these symbols in portable
|
|
<FONT SIZE="-1">ISO C</FONT> or C<FONT SIZE="-2">++</FONT> and have all your identifiers in <FONT SIZE="-1">NFC.</FONT>
|
|
<B>-Wnormalized=id</B> suppresses the warning for these characters.
|
|
It is hoped that future versions of the standards involved will correct
|
|
this, which is why this option is not the default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can switch the warning off for all characters by writing
|
|
<B>-Wnormalized=none</B> or <B>-Wno-normalized</B>. You should
|
|
only do this if you are using some other normalization scheme (like
|
|
``D''), because otherwise you can easily create bugs that are
|
|
literally impossible to see.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Some characters in <FONT SIZE="-1">ISO 10646</FONT> have distinct meanings but look identical
|
|
in some fonts or display methodologies, especially once formatting has
|
|
been applied. For instance <TT>"\u207F"</TT>, ``<FONT SIZE="-1">SUPERSCRIPT LATIN SMALL
|
|
LETTER N'',</FONT> displays just like a regular <TT>"n"</TT> that has been
|
|
placed in a superscript. <FONT SIZE="-1">ISO 10646</FONT> defines the <I></I><FONT SIZE="-1"><I>NFKC</I></FONT><I></I>
|
|
normalization scheme to convert all these into a standard form as
|
|
well, and <FONT SIZE="-1">GCC</FONT> warns if your code is not in <FONT SIZE="-1">NFKC</FONT> if you use
|
|
<B>-Wnormalized=nfkc</B>. This warning is comparable to warning
|
|
about every identifier that contains the letter O because it might be
|
|
confused with the digit 0, and so is not the default, but may be
|
|
useful as a local coding convention if the programming environment
|
|
cannot be fixed to display these characters distinctly.
|
|
<DT id="654"><B>-Wno-attribute-warning</B><DD>
|
|
|
|
|
|
Do not warn about usage of functions
|
|
declared with <TT>"warning"</TT> attribute. By default, this warning is
|
|
enabled. <B>-Wno-attribute-warning</B> can be used to disable the
|
|
warning or <B>-Wno-error=attribute-warning</B> can be used to
|
|
disable the error when compiled with <B>-Werror</B> flag.
|
|
<DT id="655"><B>-Wno-deprecated</B><DD>
|
|
|
|
|
|
Do not warn about usage of deprecated features.
|
|
<DT id="656"><B>-Wno-deprecated-declarations</B><DD>
|
|
|
|
|
|
Do not warn about uses of functions,
|
|
variables, and types marked as deprecated by using the <TT>"deprecated"</TT>
|
|
attribute.
|
|
<DT id="657"><B>-Wno-overflow</B><DD>
|
|
|
|
|
|
Do not warn about compile-time overflow in constant expressions.
|
|
<DT id="658"><B>-Wno-odr</B><DD>
|
|
|
|
|
|
Warn about One Definition Rule violations during link-time optimization.
|
|
Requires <B>-flto-odr-type-merging</B> to be enabled. Enabled by default.
|
|
<DT id="659"><B>-Wopenmp-simd</B><DD>
|
|
|
|
|
|
Warn if the vectorizer cost model overrides the OpenMP
|
|
simd directive set by user. The <B>-fsimd-cost-model=unlimited</B>
|
|
option can be used to relax the cost model.
|
|
<DT id="660"><B>-Woverride-init</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn if an initialized field without side effects is overridden when
|
|
using designated initializers.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is included in <B>-Wextra</B>. To get other
|
|
<B>-Wextra</B> warnings without this one, use <B>-Wextra
|
|
-Wno-override-init</B>.
|
|
<DT id="661"><B>-Woverride-init-side-effects</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn if an initialized field with side effects is overridden when
|
|
using designated initializers. This warning is enabled by default.
|
|
<DT id="662"><B>-Wpacked</B><DD>
|
|
|
|
|
|
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
|
|
instance, in this code, the variable <TT>"f.x"</TT> in <TT>"struct bar"</TT>
|
|
is misaligned even though <TT>"struct bar"</TT> does not itself
|
|
have the packed attribute:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct foo {
|
|
int x;
|
|
char a, b, c, d;
|
|
} __attribute__((packed));
|
|
struct bar {
|
|
char z;
|
|
struct foo f;
|
|
};
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="663"><B>-Wpacked-bitfield-compat</B><DD>
|
|
|
|
|
|
The 4.1, 4.2 and 4.3 series of <FONT SIZE="-1">GCC</FONT> ignore the <TT>"packed"</TT> attribute
|
|
on bit-fields of type <TT>"char"</TT>. This has been fixed in <FONT SIZE="-1">GCC 4.4</FONT> but
|
|
the change can lead to differences in the structure layout. <FONT SIZE="-1">GCC</FONT>
|
|
informs you when the offset of such a field has changed in <FONT SIZE="-1">GCC 4.4.</FONT>
|
|
For example there is no longer a 4-bit padding between field <TT>"a"</TT>
|
|
and <TT>"b"</TT> in this structure:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct foo
|
|
{
|
|
char a:4;
|
|
char b:8;
|
|
} __attribute__ ((packed));
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by default. Use
|
|
<B>-Wno-packed-bitfield-compat</B> to disable this warning.
|
|
<DT id="664"><B>-Wpacked-not-aligned</B> (C, C<FONT SIZE="-2">++</FONT>, Objective-C and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
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 <TT>"struct S"</TT>, like, <TT>"warning: alignment 1 of
|
|
'struct S' is less than 8"</TT>, in this code:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct __attribute__ ((aligned (8))) S8 { char a[8]; };
|
|
struct __attribute__ ((packed)) S {
|
|
struct S8 s8;
|
|
};
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="665"><B>-Wpadded</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="666"><B>-Wredundant-decls</B><DD>
|
|
|
|
|
|
Warn if anything is declared more than once in the same scope, even in
|
|
cases where multiple declaration is valid and changes nothing.
|
|
<DT id="667"><B>-Wno-restrict</B><DD>
|
|
|
|
|
|
Warn when an object referenced by a <TT>"restrict"</TT>-qualified parameter
|
|
(or, in C<FONT SIZE="-2">++</FONT>, a <TT>"__restrict"</TT>-qualified parameter) is aliased by another
|
|
argument, or when copies between such objects overlap. For example,
|
|
the call to the <TT>"strcpy"</TT> function below attempts to truncate the string
|
|
by replacing its initial characters with the last four. However, because
|
|
the call writes the terminating <FONT SIZE="-1">NUL</FONT> into <TT>"a[4]"</TT>, the copies overlap and
|
|
the call is diagnosed.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void foo (void)
|
|
{
|
|
char a[] = "abcd1234";
|
|
strcpy (a, a + 4);
|
|
...
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-Wrestrict</B> option detects some instances of simple overlap
|
|
even without optimization but works best at <B>-O2</B> and above. It
|
|
is included in <B>-Wall</B>.
|
|
<DT id="668"><B>-Wnested-externs</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn if an <TT>"extern"</TT> declaration is encountered within a function.
|
|
<DT id="669"><B>-Wno-inherited-variadic-ctor</B><DD>
|
|
|
|
|
|
Suppress warnings about use of C<FONT SIZE="-2">++</FONT>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.
|
|
<DT id="670"><B>-Winline</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The compiler uses a variety of heuristics to determine whether or not
|
|
to inline a function. For example, the compiler takes into account
|
|
the size of the function being inlined and the amount of inlining
|
|
that has already been done in the current function. Therefore,
|
|
seemingly insignificant changes in the source program can cause the
|
|
warnings produced by <B>-Winline</B> to appear or disappear.
|
|
<DT id="671"><B>-Wno-invalid-offsetof</B> (C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT> only)<DD>
|
|
|
|
|
|
Suppress warnings from applying the <TT>"offsetof"</TT> macro to a non-POD
|
|
type. According to the 2014 <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT></FONT> standard, applying <TT>"offsetof"</TT>
|
|
to a non-standard-layout type is undefined. In existing C<FONT SIZE="-2">++</FONT> implementations,
|
|
however, <TT>"offsetof"</TT> typically gives meaningful results.
|
|
This flag is for users who are aware that they are
|
|
writing nonportable code and who have deliberately chosen to ignore the
|
|
warning about it.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The restrictions on <TT>"offsetof"</TT> may be relaxed in a future version
|
|
of the C<FONT SIZE="-2">++</FONT> standard.
|
|
<DT id="672"><B>-Wint-in-bool-context</B><DD>
|
|
|
|
|
|
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 <TT>"if (a <= b ? 2 : 3)"</TT>. Or left shifting of signed
|
|
integers in boolean context, like <TT>"for (a = 0; 1 << a; a++);"</TT>. Likewise
|
|
for all kinds of multiplications regardless of the data type.
|
|
This warning is enabled by <B>-Wall</B>.
|
|
<DT id="673"><B>-Wno-int-to-pointer-cast</B><DD>
|
|
|
|
|
|
Suppress warnings from casts to pointer type of an integer of a
|
|
different size. In C<FONT SIZE="-2">++</FONT>, casting to a pointer type of smaller size is
|
|
an error. <B>Wint-to-pointer-cast</B> is enabled by default.
|
|
<DT id="674"><B>-Wno-pointer-to-int-cast</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Suppress warnings from casts from a pointer to an integer type of a
|
|
different size.
|
|
<DT id="675"><B>-Winvalid-pch</B><DD>
|
|
|
|
|
|
Warn if a precompiled header is found in
|
|
the search path but cannot be used.
|
|
<DT id="676"><B>-Wlong-long</B><DD>
|
|
|
|
|
|
Warn if <TT>"long long"</TT> type is used. This is enabled by either
|
|
<B>-Wpedantic</B> or <B>-Wtraditional</B> in <FONT SIZE="-1">ISO C90</FONT> and C<FONT SIZE="-2">++</FONT>98
|
|
modes. To inhibit the warning messages, use <B>-Wno-long-long</B>.
|
|
<DT id="677"><B>-Wvariadic-macros</B><DD>
|
|
|
|
|
|
Warn if variadic macros are used in <FONT SIZE="-1">ISO C90</FONT> mode, or if the <FONT SIZE="-1">GNU</FONT>
|
|
alternate syntax is used in <FONT SIZE="-1">ISO C99</FONT> mode. This is enabled by either
|
|
<B>-Wpedantic</B> or <B>-Wtraditional</B>. To inhibit the warning
|
|
messages, use <B>-Wno-variadic-macros</B>.
|
|
<DT id="678"><B>-Wvarargs</B><DD>
|
|
|
|
|
|
Warn upon questionable usage of the macros used to handle variable
|
|
arguments like <TT>"va_start"</TT>. This is default. To inhibit the
|
|
warning messages, use <B>-Wno-varargs</B>.
|
|
<DT id="679"><B>-Wvector-operation-performance</B><DD>
|
|
|
|
|
|
Warn if vector operation is not implemented via <FONT SIZE="-1">SIMD</FONT> capabilities of the
|
|
architecture. Mainly useful for the performance tuning.
|
|
Vector operation can be implemented <TT>"piecewise"</TT>, which means that the
|
|
scalar operation is performed on every vector element;
|
|
<TT>"in parallel"</TT>, which means that the vector operation is implemented
|
|
using scalars of wider type, which normally is more performance efficient;
|
|
and <TT>"as a single scalar"</TT>, which means that vector fits into a
|
|
scalar type.
|
|
<DT id="680"><B>-Wno-virtual-move-assign</B><DD>
|
|
|
|
|
|
Suppress warnings about inheriting from a virtual base with a
|
|
non-trivial C<FONT SIZE="-2">++</FONT>11 move assignment operator. This is dangerous because
|
|
if the virtual base is reachable along more than one path, it is
|
|
moved multiple times, which can mean both objects end up in the
|
|
moved-from state. If the move assignment operator is written to avoid
|
|
moving from a moved-from object, this warning can be disabled.
|
|
<DT id="681"><B>-Wvla</B><DD>
|
|
|
|
|
|
Warn if a variable-length array is used in the code.
|
|
<B>-Wno-vla</B> prevents the <B>-Wpedantic</B> warning of
|
|
the variable-length array.
|
|
<DT id="682"><B>-Wvla-larger-than=</B><I>byte-size</I><DD>
|
|
|
|
|
|
If this option is used, the compiler will warn for declarations of
|
|
variable-length arrays whose size is either unbounded, or bounded
|
|
by an argument that allows the array size to exceed <I>byte-size</I>
|
|
bytes. This is similar to how <B>-Walloca-larger-than=</B><I>byte-size</I>
|
|
works, but with variable-length arrays.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that <FONT SIZE="-1">GCC</FONT> may optimize small variable-length arrays of a known
|
|
value into plain arrays, so this warning may not get triggered for
|
|
such arrays.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-Wvla-larger-than=</B><B></B><FONT SIZE="-1"><B>PTRDIFF_MAX</B></FONT><B></B> is enabled by default but
|
|
is typically only effective when <B>-ftree-vrp</B> is active (default
|
|
for <B>-O2</B> and above).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
See also <B>-Walloca-larger-than=</B><I>byte-size</I>.
|
|
<DT id="683"><B>-Wno-vla-larger-than</B><DD>
|
|
|
|
|
|
Disable <B>-Wvla-larger-than=</B> warnings. The option is equivalent
|
|
to <B>-Wvla-larger-than=</B><B></B><FONT SIZE="-1"><B>SIZE_MAX</B></FONT><B></B> or larger.
|
|
<DT id="684"><B>-Wvolatile-register-var</B><DD>
|
|
|
|
|
|
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
|
|
<B>-Wall</B>.
|
|
<DT id="685"><B>-Wdisabled-optimization</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">GCC</FONT>'s optimizers are unable to handle the code
|
|
effectively. Often, the problem is that your code is too big or too
|
|
complex; <FONT SIZE="-1">GCC</FONT> refuses to optimize programs when the optimization
|
|
itself is likely to take inordinate amounts of time.
|
|
<DT id="686"><B>-Wpointer-sign</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Warn for pointer argument passing or assignment with different signedness.
|
|
This option is only supported for C and Objective-C. It is implied by
|
|
<B>-Wall</B> and by <B>-Wpedantic</B>, which can be disabled with
|
|
<B>-Wno-pointer-sign</B>.
|
|
<DT id="687"><B>-Wstack-protector</B><DD>
|
|
|
|
|
|
This option is only active when <B>-fstack-protector</B> is active. It
|
|
warns about functions that are not protected against stack smashing.
|
|
<DT id="688"><B>-Woverlength-strings</B><DD>
|
|
|
|
|
|
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
|
|
standard's minimum limit, but very portable programs should avoid
|
|
using longer strings.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The limit applies <I>after</I> string constant concatenation, and does
|
|
not count the trailing <FONT SIZE="-1">NUL.</FONT> In C90, the limit was 509 characters; in
|
|
C99, it was raised to 4095. C<FONT SIZE="-2">++</FONT>98 does not specify a normative
|
|
minimum maximum, so we do not diagnose overlength strings in C<FONT SIZE="-2">++</FONT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is implied by <B>-Wpedantic</B>, and can be disabled with
|
|
<B>-Wno-overlength-strings</B>.
|
|
<DT id="689"><B>-Wunsuffixed-float-constants</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Issue a warning for any floating constant that does not have
|
|
a suffix. When used together with <B>-Wsystem-headers</B> it
|
|
warns about such constants in system header files. This can be useful
|
|
when preparing code to use with the <TT>"FLOAT_CONST_DECIMAL64"</TT> pragma
|
|
from the decimal floating-point extension to C99.
|
|
<DT id="690"><B>-Wno-designated-init</B> (C and Objective-C only)<DD>
|
|
|
|
|
|
Suppress warnings when a positional initializer is used to initialize
|
|
a structure that has been marked with the <TT>"designated_init"</TT>
|
|
attribute.
|
|
<DT id="691"><B>-Whsa</B><DD>
|
|
|
|
|
|
Issue a warning when <FONT SIZE="-1">HSAIL</FONT> cannot be emitted for the compiled function or
|
|
OpenMP construct.
|
|
</DL>
|
|
<A NAME="lbAN"> </A>
|
|
<H3>Options for Debugging Your Program</H3>
|
|
|
|
|
|
|
|
To tell <FONT SIZE="-1">GCC</FONT> to emit extra information for use by a debugger, in almost
|
|
all cases you need only to add <B>-g</B> to your other options.
|
|
<P>
|
|
|
|
<FONT SIZE="-1">GCC</FONT> allows you to use <B>-g</B> with
|
|
<B>-O</B>. The shortcuts taken by optimized code may occasionally
|
|
be surprising: some variables you declared may not exist
|
|
at all; flow of control may briefly move where you did not expect it;
|
|
some statements may not be executed because they compute constant
|
|
results or their values are already at hand; some statements may
|
|
execute in different places because they have been moved out of loops.
|
|
Nevertheless it is possible to debug optimized output. This makes
|
|
it reasonable to use the optimizer for programs that might have bugs.
|
|
<P>
|
|
|
|
If you are not using some other optimization option, consider
|
|
using <B>-Og</B> with <B>-g</B>.
|
|
With no <B>-O</B> option at all, some compiler passes that collect
|
|
information useful for debugging do not run at all, so that
|
|
<B>-Og</B> may result in a better debugging experience.
|
|
<DL COMPACT>
|
|
<DT id="692"><B>-g</B><DD>
|
|
|
|
|
|
Produce debugging information in the operating system's native format
|
|
(stabs, <FONT SIZE="-1">COFF, XCOFF,</FONT> or <FONT SIZE="-1">DWARF</FONT>). <FONT SIZE="-1">GDB</FONT> can work with this debugging
|
|
information.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On most systems that use stabs format, <B>-g</B> enables use of extra
|
|
debugging information that only <FONT SIZE="-1">GDB</FONT> can use; this extra information
|
|
makes debugging work better in <FONT SIZE="-1">GDB</FONT> but probably makes other debuggers
|
|
crash or
|
|
refuse to read the program. If you want to control for certain whether
|
|
to generate the extra information, use <B>-gstabs+</B>, <B>-gstabs</B>,
|
|
<B>-gxcoff+</B>, <B>-gxcoff</B>, or <B>-gvms</B> (see below).
|
|
<DT id="693"><B>-ggdb</B><DD>
|
|
|
|
|
|
Produce debugging information for use by <FONT SIZE="-1">GDB.</FONT> This means to use the
|
|
most expressive format available (<FONT SIZE="-1">DWARF,</FONT> stabs, or the native format
|
|
if neither of those are supported), including <FONT SIZE="-1">GDB</FONT> extensions if at all
|
|
possible.
|
|
<DT id="694"><B>-gdwarf</B><DD>
|
|
|
|
|
|
|
|
<DT id="695"><B>-gdwarf-</B><I>version</I><DD>
|
|
|
|
|
|
|
|
Produce debugging information in <FONT SIZE="-1">DWARF</FONT> format (if that is supported).
|
|
The value of <I>version</I> may be either 2, 3, 4 or 5; the default version
|
|
for most targets is 4. <FONT SIZE="-1">DWARF</FONT> Version 5 is only experimental.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that with <FONT SIZE="-1">DWARF</FONT> Version 2, some ports require and always
|
|
use some non-conflicting <FONT SIZE="-1">DWARF 3</FONT> extensions in the unwind tables.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Version 4 may require <FONT SIZE="-1">GDB 7.0</FONT> and <B>-fvar-tracking-assignments</B>
|
|
for maximum benefit.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> no longer supports <FONT SIZE="-1">DWARF</FONT> Version 1, which is substantially
|
|
different than Version 2 and later. For historical reasons, some
|
|
other DWARF-related options such as
|
|
<B>-fno-dwarf2-cfi-asm</B>) retain a reference to <FONT SIZE="-1">DWARF</FONT> Version 2
|
|
in their names, but apply to all currently-supported versions of <FONT SIZE="-1">DWARF.</FONT>
|
|
<DT id="696"><B>-gstabs</B><DD>
|
|
|
|
|
|
Produce debugging information in stabs format (if that is supported),
|
|
without <FONT SIZE="-1">GDB</FONT> extensions. This is the format used by <FONT SIZE="-1">DBX</FONT> on most <FONT SIZE="-1">BSD</FONT>
|
|
systems. On <FONT SIZE="-1">MIPS,</FONT> Alpha and System V Release 4 systems this option
|
|
produces stabs debugging output that is not understood by <FONT SIZE="-1">DBX.</FONT>
|
|
On System V Release 4 systems this option requires the <FONT SIZE="-1">GNU</FONT> assembler.
|
|
<DT id="697"><B>-gstabs+</B><DD>
|
|
|
|
|
|
Produce debugging information in stabs format (if that is supported),
|
|
using <FONT SIZE="-1">GNU</FONT> extensions understood only by the <FONT SIZE="-1">GNU</FONT> debugger (<FONT SIZE="-1">GDB</FONT>). The
|
|
use of these extensions is likely to make other debuggers crash or
|
|
refuse to read the program.
|
|
<DT id="698"><B>-gxcoff</B><DD>
|
|
|
|
|
|
Produce debugging information in <FONT SIZE="-1">XCOFF</FONT> format (if that is supported).
|
|
This is the format used by the <FONT SIZE="-1">DBX</FONT> debugger on <FONT SIZE="-1">IBM RS/6000</FONT> systems.
|
|
<DT id="699"><B>-gxcoff+</B><DD>
|
|
|
|
|
|
Produce debugging information in <FONT SIZE="-1">XCOFF</FONT> format (if that is supported),
|
|
using <FONT SIZE="-1">GNU</FONT> extensions understood only by the <FONT SIZE="-1">GNU</FONT> debugger (<FONT SIZE="-1">GDB</FONT>). The
|
|
use of these extensions is likely to make other debuggers crash or
|
|
refuse to read the program, and may cause assemblers other than the <FONT SIZE="-1">GNU</FONT>
|
|
assembler (<FONT SIZE="-1">GAS</FONT>) to fail with an error.
|
|
<DT id="700"><B>-gvms</B><DD>
|
|
|
|
|
|
Produce debugging information in Alpha/VMS debug format (if that is
|
|
supported). This is the format used by <FONT SIZE="-1">DEBUG</FONT> on Alpha/VMS systems.
|
|
<DT id="701"><B>-g</B><I>level</I><DD>
|
|
|
|
|
|
|
|
<DT id="702"><B>-ggdb</B><I>level</I><DD>
|
|
|
|
|
|
<DT id="703"><B>-gstabs</B><I>level</I><DD>
|
|
|
|
|
|
<DT id="704"><B>-gxcoff</B><I>level</I><DD>
|
|
|
|
|
|
<DT id="705"><B>-gvms</B><I>level</I><DD>
|
|
|
|
|
|
|
|
Request debugging information and also use <I>level</I> to specify how
|
|
much information. The default level is 2.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Level 0 produces no debug information at all. Thus, <B>-g0</B> negates
|
|
<B>-g</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Level 1 produces minimal information, enough for making backtraces in
|
|
parts of the program that you don't plan to debug. This includes
|
|
descriptions of functions and external variables, and line number
|
|
tables, but no information about local variables.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Level 3 includes extra information, such as all the macro definitions
|
|
present in the program. Some debuggers support macro expansion when
|
|
you use <B>-g3</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you use multiple <B>-g</B> options, with or without level numbers,
|
|
the last such option is the one that is effective.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-gdwarf</B> does not accept a concatenated debug level, to avoid
|
|
confusion with <B>-gdwarf-</B><I>level</I>.
|
|
Instead use an additional <B>-g</B><I>level</I> option to change the
|
|
debug level for <FONT SIZE="-1">DWARF.</FONT>
|
|
<DT id="706"><B>-feliminate-unused-debug-symbols</B><DD>
|
|
|
|
|
|
Produce debugging information in stabs format (if that is supported),
|
|
for only symbols that are actually used.
|
|
<DT id="707"><B>-femit-class-debug-always</B><DD>
|
|
|
|
|
|
Instead of emitting debugging information for a C<FONT SIZE="-2">++</FONT> 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 <FONT SIZE="-1">GCC</FONT>
|
|
normally emits debugging information for classes because using this
|
|
option increases the size of debugging information by as much as a
|
|
factor of two.
|
|
<DT id="708"><B>-fno-merge-debug-strings</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="709"><B>-fdebug-prefix-map=</B><I>old</I><B>=</B><I>new</I><DD>
|
|
|
|
|
|
When compiling files residing in directory <I>old</I>, record
|
|
debugging information describing them as if the files resided in
|
|
directory <I>new</I> instead. This can be used to replace a
|
|
build-time path with an install-time path in the debug info. It can
|
|
also be used to change an absolute path to a relative path by using
|
|
<I>.</I> for <I>new</I>. This can give more reproducible builds, which
|
|
are location independent, but may require an extra command to tell <FONT SIZE="-1">GDB</FONT>
|
|
where to find the source files. See also <B>-ffile-prefix-map</B>.
|
|
<DT id="710"><B>-fvar-tracking</B><DD>
|
|
|
|
|
|
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).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It is enabled by default when compiling with optimization (<B>-Os</B>,
|
|
<B>-O</B>, <B>-O2</B>, ...), debugging information (<B>-g</B>) and
|
|
the debug info format supports it.
|
|
<DT id="711"><B>-fvar-tracking-assignments</B><DD>
|
|
|
|
|
|
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
|
|
optimizing. Use of <B>-gdwarf-4</B> is recommended along with it.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It can be enabled even if var-tracking is disabled, in which case
|
|
annotations are created and maintained, but discarded at the end.
|
|
By default, this flag is enabled together with <B>-fvar-tracking</B>,
|
|
except when selective scheduling is enabled.
|
|
<DT id="712"><B>-gsplit-dwarf</B><DD>
|
|
|
|
|
|
Separate as much <FONT SIZE="-1">DWARF</FONT> debugging information as possible into a
|
|
separate output file with the extension <I>.dwo</I>. This option allows
|
|
the build system to avoid linking files with debug information. To
|
|
be useful, this option requires a debugger capable of reading <I>.dwo</I>
|
|
files.
|
|
<DT id="713"><B>-gdescribe-dies</B><DD>
|
|
|
|
|
|
Add description attributes to some <FONT SIZE="-1">DWARF</FONT> DIEs that have no name attribute,
|
|
such as artificial variables, external references and call site
|
|
parameter DIEs.
|
|
<DT id="714"><B>-gpubnames</B><DD>
|
|
|
|
|
|
Generate <FONT SIZE="-1">DWARF</FONT> <TT>".debug_pubnames"</TT> and <TT>".debug_pubtypes"</TT> sections.
|
|
<DT id="715"><B>-ggnu-pubnames</B><DD>
|
|
|
|
|
|
Generate <TT>".debug_pubnames"</TT> and <TT>".debug_pubtypes"</TT> sections in a format
|
|
suitable for conversion into a <FONT SIZE="-1">GDB</FONT> index. This option is only useful
|
|
with a linker that can produce <FONT SIZE="-1">GDB</FONT> index version 7.
|
|
<DT id="716"><B>-fdebug-types-section</B><DD>
|
|
|
|
|
|
When using <FONT SIZE="-1">DWARF</FONT> Version 4 or higher, type DIEs can be put into
|
|
their own <TT>".debug_types"</TT> section instead of making them part of the
|
|
<TT>".debug_info"</TT> section. It is more efficient to put them in a separate
|
|
comdat section since the linker can then remove duplicates.
|
|
But not all <FONT SIZE="-1">DWARF</FONT> consumers support <TT>".debug_types"</TT> sections yet
|
|
and on some objects <TT>".debug_types"</TT> produces larger instead of smaller
|
|
debugging information.
|
|
<DT id="717"><B>-grecord-gcc-switches</B><DD>
|
|
|
|
|
|
|
|
<DT id="718"><B>-gno-record-gcc-switches</B><DD>
|
|
|
|
|
|
|
|
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 <FONT SIZE="-1">DWARF</FONT> debugging information. The options
|
|
are concatenated with spaces separating them from each other and from
|
|
the compiler version.
|
|
It is enabled by default.
|
|
See also <B>-frecord-gcc-switches</B> for another
|
|
way of storing compiler options into the object file.
|
|
<DT id="719"><B>-gstrict-dwarf</B><DD>
|
|
|
|
|
|
Disallow using extensions of later <FONT SIZE="-1">DWARF</FONT> standard version than selected
|
|
with <B>-gdwarf-</B><I>version</I>. On most targets using non-conflicting
|
|
<FONT SIZE="-1">DWARF</FONT> extensions from later standard versions is allowed.
|
|
<DT id="720"><B>-gno-strict-dwarf</B><DD>
|
|
|
|
|
|
Allow using extensions of later <FONT SIZE="-1">DWARF</FONT> standard version than selected with
|
|
<B>-gdwarf-</B><I>version</I>.
|
|
<DT id="721"><B>-gas-loc-support</B><DD>
|
|
|
|
|
|
Inform the compiler that the assembler supports <TT>".loc"</TT> directives.
|
|
It may then use them for the assembler to generate <FONT SIZE="-1">DWARF2+</FONT> line number
|
|
tables.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This is generally desirable, because assembler-generated line-number
|
|
tables are a lot more compact than those the compiler can generate
|
|
itself.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option will be enabled by default if, at <FONT SIZE="-1">GCC</FONT> configure time, the
|
|
assembler was found to support such directives.
|
|
<DT id="722"><B>-gno-as-loc-support</B><DD>
|
|
|
|
|
|
Force <FONT SIZE="-1">GCC</FONT> to generate <FONT SIZE="-1">DWARF2+</FONT> line number tables internally, if <FONT SIZE="-1">DWARF2+</FONT>
|
|
line number tables are to be generated.
|
|
<DT id="723"><B>gas-locview-support</B><DD>
|
|
|
|
|
|
Inform the compiler that the assembler supports <TT>"view"</TT> assignment
|
|
and reset assertion checking in <TT>".loc"</TT> directives.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option will be enabled by default if, at <FONT SIZE="-1">GCC</FONT> configure time, the
|
|
assembler was found to support them.
|
|
<DT id="724"><B>gno-as-locview-support</B><DD>
|
|
|
|
|
|
Force <FONT SIZE="-1">GCC</FONT> to assign view numbers internally, if
|
|
<B>-gvariable-location-views</B> are explicitly requested.
|
|
<DT id="725"><B>-gcolumn-info</B><DD>
|
|
|
|
|
|
|
|
<DT id="726"><B>-gno-column-info</B><DD>
|
|
|
|
|
|
|
|
Emit location column information into <FONT SIZE="-1">DWARF</FONT> debugging information, rather
|
|
than just file and line.
|
|
This option is enabled by default.
|
|
<DT id="727"><B>-gstatement-frontiers</B><DD>
|
|
|
|
|
|
|
|
<DT id="728"><B>-gno-statement-frontiers</B><DD>
|
|
|
|
|
|
|
|
This option causes <FONT SIZE="-1">GCC</FONT> 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 <TT>"is_stmt"</TT>
|
|
markers in the line number table. This is enabled by default when
|
|
compiling with optimization (<B>-Os</B>, <B>-O</B>, <B>-O2</B>,
|
|
...), and outputting <FONT SIZE="-1">DWARF 2</FONT> debug information at the normal level.
|
|
<DT id="729"><B>-gvariable-location-views</B><DD>
|
|
|
|
|
|
|
|
<DT id="730"><B>-gvariable-location-views=incompat5</B><DD>
|
|
|
|
|
|
<DT id="731"><B>-gno-variable-location-views</B><DD>
|
|
|
|
|
|
|
|
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
|
|
associated with the corresponding source locations are present at that
|
|
point. If the assembler lacks support for view numbers in line number
|
|
tables, this will cause the compiler to emit the line number table,
|
|
which generally makes them somewhat less compact. The augmented line
|
|
number tables and location lists are fully backward-compatible, so they
|
|
can be consumed by debug information consumers that are not aware of
|
|
these augmentations, but they won't derive any benefit from them either.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This is enabled by default when outputting <FONT SIZE="-1">DWARF 2</FONT> debug information at
|
|
the normal level, as long as there is assembler support,
|
|
<B>-fvar-tracking-assignments</B> is enabled and
|
|
<B>-gstrict-dwarf</B> is not. When assembler support is not
|
|
available, this may still be enabled, but it will force <FONT SIZE="-1">GCC</FONT> to output
|
|
internal line number tables, and if
|
|
<B>-ginternal-reset-location-views</B> is not enabled, that will most
|
|
certainly lead to silently mismatching location views.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
There is a proposed representation for view numbers that is not backward
|
|
compatible with the location list format introduced in <FONT SIZE="-1">DWARF 5,</FONT> that can
|
|
be enabled with <B>-gvariable-location-views=incompat5</B>. This
|
|
option may be removed in the future, is only provided as a reference
|
|
implementation of the proposed representation. Debug information
|
|
consumers are not expected to support this extended format, and they
|
|
would be rendered unable to decode location lists using it.
|
|
<DT id="732"><B>-ginternal-reset-location-views</B><DD>
|
|
|
|
|
|
|
|
<DT id="733"><B>-gno-internal-reset-location-views</B><DD>
|
|
|
|
|
|
|
|
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
|
|
incorrect view lists to be generated silently when using an assembler
|
|
that does not support location view lists. The <FONT SIZE="-1">GNU</FONT> assembler will flag
|
|
any such error as a <TT>"view number mismatch"</TT>. This is only enabled
|
|
on ports that define a reliable estimation function.
|
|
<DT id="734"><B>-ginline-points</B><DD>
|
|
|
|
|
|
|
|
<DT id="735"><B>-gno-inline-points</B><DD>
|
|
|
|
|
|
|
|
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
|
|
information. This can be enabled independently of location views, in
|
|
which case the view numbers won't be output, but it can only be enabled
|
|
along with statement frontiers, and it is only enabled by default if
|
|
location views are enabled.
|
|
<DT id="736"><B>-gz</B>[<B>=</B><I>type</I>]<DD>
|
|
|
|
|
|
Produce compressed debug sections in <FONT SIZE="-1">DWARF</FONT> format, if that is supported.
|
|
If <I>type</I> is not given, the default type depends on the capabilities
|
|
of the assembler and linker used. <I>type</I> may be one of
|
|
<B>none</B> (don't compress debug sections), <B>zlib</B> (use zlib
|
|
compression in <FONT SIZE="-1">ELF</FONT> gABI format), or <B>zlib-gnu</B> (use zlib
|
|
compression in traditional <FONT SIZE="-1">GNU</FONT> format). If the linker doesn't support
|
|
writing compressed debug sections, the option is rejected. Otherwise,
|
|
if the assembler does not support them, <B>-gz</B> is silently ignored
|
|
when producing object files.
|
|
<DT id="737"><B>-femit-struct-debug-baseonly</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option substantially reduces the size of debugging information,
|
|
but at significant potential loss in type information to the debugger.
|
|
See <B>-femit-struct-debug-reduced</B> for a less aggressive option.
|
|
See <B>-femit-struct-debug-detailed</B> for more detailed control.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option works only with <FONT SIZE="-1">DWARF</FONT> debug output.
|
|
<DT id="738"><B>-femit-struct-debug-reduced</B><DD>
|
|
|
|
|
|
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,
|
|
unless the struct is a template or defined in a system header.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option significantly reduces the size of debugging information,
|
|
with some potential loss in type information to the debugger.
|
|
See <B>-femit-struct-debug-baseonly</B> for a more aggressive option.
|
|
See <B>-femit-struct-debug-detailed</B> for more detailed control.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option works only with <FONT SIZE="-1">DWARF</FONT> debug output.
|
|
<DT id="739"><B>-femit-struct-debug-detailed</B>[<B>=</B><I>spec-list</I>]<DD>
|
|
|
|
|
|
Specify the struct-like types
|
|
for which the compiler generates debug information.
|
|
The intent is to reduce duplicate struct debug information
|
|
between different object files within the same program.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is a detailed version of
|
|
<B>-femit-struct-debug-reduced</B> and <B>-femit-struct-debug-baseonly</B>,
|
|
which serves for most needs.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
A specification has the syntax[<B>dir:</B>|<B>ind:</B>][<B>ord:</B>|<B>gen:</B>](<B>any</B>|<B>sys</B>|<B>base</B>|<B>none</B>)
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The optional first word limits the specification to
|
|
structs that are used directly (<B>dir:</B>) or used indirectly (<B>ind:</B>).
|
|
A struct type is used directly when it is the type of a variable, member.
|
|
Indirect uses arise through pointers to structs.
|
|
That is, when use of an incomplete struct is valid, the use is indirect.
|
|
An example is
|
|
<B>struct one direct; struct two * indirect;</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The optional second word limits the specification to
|
|
ordinary structs (<B>ord:</B>) or generic structs (<B>gen:</B>).
|
|
Generic structs are a bit complicated to explain.
|
|
For C<FONT SIZE="-2">++</FONT>, these are non-explicit specializations of template classes,
|
|
or non-template classes within the above.
|
|
Other programming languages have generics,
|
|
but <B>-femit-struct-debug-detailed</B> does not yet implement them.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The third word specifies the source files for those
|
|
structs for which the compiler should emit debug information.
|
|
The values <B>none</B> and <B>any</B> have the normal meaning.
|
|
The value <B>base</B> means that
|
|
the base of name of the file in which the type declaration appears
|
|
must match the base of the name of the main compilation file.
|
|
In practice, this means that when compiling <I>foo.c</I>, debug information
|
|
is generated for types declared in that file and <I>foo.h</I>,
|
|
but not other header files.
|
|
The value <B>sys</B> means those types satisfying <B>base</B>
|
|
or declared in system or compiler headers.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You may need to experiment to determine the best settings for your application.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-femit-struct-debug-detailed=all</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option works only with <FONT SIZE="-1">DWARF</FONT> debug output.
|
|
<DT id="740"><B>-fno-dwarf2-cfi-asm</B><DD>
|
|
|
|
|
|
Emit <FONT SIZE="-1">DWARF</FONT> unwind info as compiler generated <TT>".eh_frame"</TT> section
|
|
instead of using <FONT SIZE="-1">GAS</FONT> <TT>".cfi_*"</TT> directives.
|
|
<DT id="741"><B>-fno-eliminate-unused-debug-types</B><DD>
|
|
|
|
|
|
Normally, when producing <FONT SIZE="-1">DWARF</FONT> output, <FONT SIZE="-1">GCC</FONT> avoids producing debug symbol
|
|
output for types that are nowhere used in the source file being compiled.
|
|
Sometimes it is useful to have <FONT SIZE="-1">GCC</FONT> emit debugging
|
|
information for all types declared in a compilation
|
|
unit, regardless of whether or not they are actually used
|
|
in that compilation unit, for example
|
|
if, in the debugger, you want to cast a value to a type that is
|
|
not actually used in your program (but is declared). More often,
|
|
however, this results in a significant amount of wasted space.
|
|
</DL>
|
|
<A NAME="lbAO"> </A>
|
|
<H3>Options That Control Optimization</H3>
|
|
|
|
|
|
|
|
These options control various sorts of optimizations.
|
|
<P>
|
|
|
|
Without any optimization option, the compiler's goal is to reduce the
|
|
cost of compilation and to make debugging produce the expected
|
|
results. Statements are independent: if you stop the program with a
|
|
breakpoint between statements, you can then assign a new value to any
|
|
variable or change the program counter to any other statement in the
|
|
function and get exactly the results you expect from the source
|
|
code.
|
|
<P>
|
|
|
|
Turning on optimization flags makes the compiler attempt to improve
|
|
the performance and/or code size at the expense of compilation time
|
|
and possibly the ability to debug the program.
|
|
<P>
|
|
|
|
The compiler performs optimization based on the knowledge it has of the
|
|
program. Compiling multiple files at once to a single output file mode allows
|
|
the compiler to use information gained from all of the files when compiling
|
|
each of them.
|
|
<P>
|
|
|
|
Not all optimizations are controlled directly by a flag. Only
|
|
optimizations that have a flag are listed in this section.
|
|
<P>
|
|
|
|
Most optimizations are completely disabled at <B>-O0</B> or if an
|
|
<B>-O</B> level is not set on the command line, even if individual
|
|
optimization flags are specified. Similarly, <B>-Og</B> suppresses
|
|
many optimization passes.
|
|
<P>
|
|
|
|
Depending on the target and how <FONT SIZE="-1">GCC</FONT> was configured, a slightly different
|
|
set of optimizations may be enabled at each <B>-O</B> level than
|
|
those listed here. You can invoke <FONT SIZE="-1">GCC</FONT> with <B>-Q --help=optimizers</B>
|
|
to find out the exact set of optimizations that are enabled at each level.
|
|
<DL COMPACT>
|
|
<DT id="742"><B>-O</B><DD>
|
|
|
|
|
|
|
|
<DT id="743"><B>-O1</B><DD>
|
|
|
|
|
|
|
|
Optimize. Optimizing compilation takes somewhat more time, and a lot
|
|
more memory for a large function.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-O</B>, the compiler tries to reduce code size and execution
|
|
time, without performing any optimizations that take a great deal of
|
|
compilation time.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-O</B> turns on the following optimization flags:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fauto-inc-dec
|
|
-fbranch-count-reg
|
|
-fcombine-stack-adjustments
|
|
-fcompare-elim
|
|
-fcprop-registers
|
|
-fdce
|
|
-fdefer-pop
|
|
-fdelayed-branch
|
|
-fdse
|
|
-fforward-propagate
|
|
-fguess-branch-probability
|
|
-fif-conversion
|
|
-fif-conversion2
|
|
-finline-functions-called-once
|
|
-fipa-profile
|
|
-fipa-pure-const
|
|
-fipa-reference
|
|
-fipa-reference-addressable
|
|
-fmerge-constants
|
|
-fmove-loop-invariants
|
|
-fomit-frame-pointer
|
|
-freorder-blocks
|
|
-fshrink-wrap
|
|
-fshrink-wrap-separate
|
|
-fsplit-wide-types
|
|
-fssa-backprop
|
|
-fssa-phiopt
|
|
-ftree-bit-ccp
|
|
-ftree-ccp
|
|
-ftree-ch
|
|
-ftree-coalesce-vars
|
|
-ftree-copy-prop
|
|
-ftree-dce
|
|
-ftree-dominator-opts
|
|
-ftree-dse
|
|
-ftree-forwprop
|
|
-ftree-fre
|
|
-ftree-phiprop
|
|
-ftree-pta
|
|
-ftree-scev-cprop
|
|
-ftree-sink
|
|
-ftree-slsr
|
|
-ftree-sra
|
|
-ftree-ter
|
|
-funit-at-a-time</B>
|
|
<DT id="744"><B>-O2</B><DD>
|
|
|
|
|
|
Optimize even more. <FONT SIZE="-1">GCC</FONT> performs nearly all supported optimizations
|
|
that do not involve a space-speed tradeoff.
|
|
As compared to <B>-O</B>, this option increases both compilation time
|
|
and the performance of the generated code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-O2</B> turns on all optimization flags specified by <B>-O</B>. It
|
|
also turns on the following optimization flags:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-falign-functions -falign-jumps
|
|
-falign-labels -falign-loops
|
|
-fcaller-saves
|
|
-fcode-hoisting
|
|
-fcrossjumping
|
|
-fcse-follow-jumps -fcse-skip-blocks
|
|
-fdelete-null-pointer-checks
|
|
-fdevirtualize -fdevirtualize-speculatively
|
|
-fexpensive-optimizations
|
|
-fgcse -fgcse-lm
|
|
-fhoist-adjacent-loads
|
|
-finline-small-functions
|
|
-findirect-inlining
|
|
-fipa-bit-cp -fipa-cp -fipa-icf
|
|
-fipa-ra -fipa-sra -fipa-vrp
|
|
-fisolate-erroneous-paths-dereference
|
|
-flra-remat
|
|
-foptimize-sibling-calls
|
|
-foptimize-strlen
|
|
-fpartial-inlining
|
|
-fpeephole2
|
|
-freorder-blocks-algorithm=stc
|
|
-freorder-blocks-and-partition -freorder-functions
|
|
-frerun-cse-after-loop
|
|
-fschedule-insns -fschedule-insns2
|
|
-fsched-interblock -fsched-spec
|
|
-fstore-merging
|
|
-fstrict-aliasing
|
|
-fthread-jumps
|
|
-ftree-builtin-call-dce
|
|
-ftree-pre
|
|
-ftree-switch-conversion -ftree-tail-merge
|
|
-ftree-vrp</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Please note the warning under <B>-fgcse</B> about
|
|
invoking <B>-O2</B> on programs that use computed gotos.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">NOTE:</FONT> In Ubuntu 8.10 and later versions, <B>-D_FORTIFY_SOURCE=2</B> is
|
|
set by default, and is activated when <B>-O</B> is set to 2 or higher.
|
|
This enables additional compile-time and run-time checks for several libc
|
|
functions. To disable, specify either <B>-U_FORTIFY_SOURCE</B> or
|
|
<B>-D_FORTIFY_SOURCE=0</B>.
|
|
<DT id="745"><B>-O3</B><DD>
|
|
|
|
|
|
Optimize yet more. <B>-O3</B> turns on all optimizations specified
|
|
by <B>-O2</B> and also turns on the following optimization flags:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fgcse-after-reload
|
|
-finline-functions
|
|
-fipa-cp-clone
|
|
-floop-interchange
|
|
-floop-unroll-and-jam
|
|
-fpeel-loops
|
|
-fpredictive-commoning
|
|
-fsplit-paths
|
|
-ftree-loop-distribute-patterns
|
|
-ftree-loop-distribution
|
|
-ftree-loop-vectorize
|
|
-ftree-partial-pre
|
|
-ftree-slp-vectorize
|
|
-funswitch-loops
|
|
-fvect-cost-model
|
|
-fversion-loops-for-strides</B>
|
|
<DT id="746"><B>-O0</B><DD>
|
|
|
|
|
|
Reduce compilation time and make debugging produce the expected
|
|
results. This is the default.
|
|
<DT id="747"><B>-Os</B><DD>
|
|
|
|
|
|
Optimize for size. <B>-Os</B> enables all <B>-O2</B> optimizations
|
|
except those that often increase code size:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-falign-functions -falign-jumps
|
|
-falign-labels -falign-loops
|
|
-fprefetch-loop-arrays -freorder-blocks-algorithm=stc</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It also enables <B>-finline-functions</B>, causes the compiler to tune for
|
|
code size rather than execution speed, and performs further optimizations
|
|
designed to reduce code size.
|
|
<DT id="748"><B>-Ofast</B><DD>
|
|
|
|
|
|
Disregard strict standards compliance. <B>-Ofast</B> enables all
|
|
<B>-O3</B> optimizations. It also enables optimizations that are not
|
|
valid for all standard-compliant programs.
|
|
It turns on <B>-ffast-math</B> and the Fortran-specific
|
|
<B>-fstack-arrays</B>, unless <B>-fmax-stack-var-size</B> is
|
|
specified, and <B>-fno-protect-parens</B>.
|
|
<DT id="749"><B>-Og</B><DD>
|
|
|
|
|
|
Optimize debugging experience. <B>-Og</B> should be the optimization
|
|
level of choice for the standard edit-compile-debug cycle, offering
|
|
a reasonable level of optimization while maintaining fast compilation
|
|
and a good debugging experience. It is a better choice than <B>-O0</B>
|
|
for producing debuggable code because some compiler passes
|
|
that collect debug information are disabled at <B>-O0</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Like <B>-O0</B>, <B>-Og</B> completely disables a number of
|
|
optimization passes so that individual options controlling them have
|
|
no effect. Otherwise <B>-Og</B> enables all <B>-O1</B>
|
|
optimization flags except for those that may interfere with debugging:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fbranch-count-reg -fdelayed-branch
|
|
-fif-conversion -fif-conversion2
|
|
-finline-functions-called-once
|
|
-fmove-loop-invariants -fssa-phiopt
|
|
-ftree-bit-ccp -ftree-pta -ftree-sra</B>
|
|
</DL>
|
|
<P>
|
|
|
|
If you use multiple <B>-O</B> options, with or without level numbers,
|
|
the last such option is the one that is effective.
|
|
<P>
|
|
|
|
Options of the form <B>-f</B><I>flag</I> specify machine-independent
|
|
flags. Most flags have both positive and negative forms; the negative
|
|
form of <B>-ffoo</B> is <B>-fno-foo</B>. In the table
|
|
below, only one of the forms is listed---the one you typically
|
|
use. You can figure out the other form by either removing <B>no-</B>
|
|
or adding it.
|
|
<P>
|
|
|
|
The following options control specific optimizations. They are either
|
|
activated by <B>-O</B> options or are related to ones that are. You
|
|
can use the following flags in the rare cases when ``fine-tuning'' of
|
|
optimizations to be performed is desired.
|
|
<DL COMPACT>
|
|
<DT id="750"><B>-fno-defer-pop</B><DD>
|
|
|
|
|
|
For machines that must pop arguments after a function call, always pop
|
|
the arguments as soon as each function returns.
|
|
At levels <B>-O1</B> and higher, <B>-fdefer-pop</B> is the default;
|
|
this allows the compiler to let arguments accumulate on the stack for several
|
|
function calls and pop them all at once.
|
|
<DT id="751"><B>-fforward-propagate</B><DD>
|
|
|
|
|
|
Perform a forward propagation pass on <FONT SIZE="-1">RTL.</FONT> 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
|
|
loop unrolling.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is enabled by default at optimization levels <B>-O</B>,
|
|
<B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="752"><B>-ffp-contract=</B><I>style</I><DD>
|
|
|
|
|
|
<B>-ffp-contract=off</B> disables floating-point expression contraction.
|
|
<B>-ffp-contract=fast</B> enables floating-point expression contraction
|
|
such as forming of fused multiply-add operations if the target has
|
|
native support for them.
|
|
<B>-ffp-contract=on</B> enables floating-point expression contraction
|
|
if allowed by the language standard. This is currently not implemented
|
|
and treated equal to <B>-ffp-contract=off</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-ffp-contract=fast</B>.
|
|
<DT id="753"><B>-fomit-frame-pointer</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On some targets this flag has no effect because the standard calling sequence
|
|
always uses a frame pointer, so it cannot be omitted.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that <B>-fno-omit-frame-pointer</B> doesn't guarantee the frame pointer
|
|
is used in all functions. Several targets always omit the frame pointer in
|
|
leaf functions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by default at <B>-O</B> and higher.
|
|
<DT id="754"><B>-foptimize-sibling-calls</B><DD>
|
|
|
|
|
|
Optimize sibling and tail recursive calls.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="755"><B>-foptimize-strlen</B><DD>
|
|
|
|
|
|
Optimize various standard C string functions (e.g. <TT>"strlen"</TT>,
|
|
<TT>"strchr"</TT> or <TT>"strcpy"</TT>) and
|
|
their <TT>"_FORTIFY_SOURCE"</TT> counterparts into faster alternatives.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>.
|
|
<DT id="756"><B>-fno-inline</B><DD>
|
|
|
|
|
|
Do not expand any functions inline apart from those marked with
|
|
the <TT>"always_inline"</TT> attribute. This is the default when not
|
|
optimizing.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Single functions can be exempted from inlining by marking them
|
|
with the <TT>"noinline"</TT> attribute.
|
|
<DT id="757"><B>-finline-small-functions</B><DD>
|
|
|
|
|
|
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
|
|
in this way. This inlining applies to all functions, even those not declared
|
|
inline.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="758"><B>-findirect-inlining</B><DD>
|
|
|
|
|
|
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 <B>-finline-functions</B>
|
|
or <B>-finline-small-functions</B> options.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="759"><B>-finline-functions</B><DD>
|
|
|
|
|
|
Consider all functions for inlining, even if they are not declared inline.
|
|
The compiler heuristically decides which functions are worth integrating
|
|
in this way.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If all calls to a given function are integrated, and the function is
|
|
declared <TT>"static"</TT>, then the function is normally not output as
|
|
assembler code in its own right.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O3</B>, <B>-Os</B>. Also enabled
|
|
by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="760"><B>-finline-functions-called-once</B><DD>
|
|
|
|
|
|
Consider all <TT>"static"</TT> functions called once for inlining into their
|
|
caller even if they are not marked <TT>"inline"</TT>. If a call to a given
|
|
function is integrated, then the function is not output as assembler code
|
|
in its own right.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O1</B>, <B>-O2</B>, <B>-O3</B> and <B>-Os</B>,
|
|
but not <B>-Og</B>.
|
|
<DT id="761"><B>-fearly-inlining</B><DD>
|
|
|
|
|
|
Inline functions marked by <TT>"always_inline"</TT> and functions whose body seems
|
|
smaller than the function call overhead early before doing
|
|
<B>-fprofile-generate</B> instrumentation and real inlining pass. Doing so
|
|
makes profiling significantly cheaper and usually inlining faster on programs
|
|
having large chains of nested wrapper functions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by default.
|
|
<DT id="762"><B>-fipa-sra</B><DD>
|
|
|
|
|
|
Perform interprocedural scalar replacement of aggregates, removal of
|
|
unused parameters and replacement of parameters passed by reference
|
|
by parameters passed by value.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B> and <B>-Os</B>.
|
|
<DT id="763"><B>-finline-limit=</B><I>n</I><DD>
|
|
|
|
|
|
By default, <FONT SIZE="-1">GCC</FONT> limits the size of functions that can be inlined. This flag
|
|
allows coarse control of this limit. <I>n</I> is the size of functions that
|
|
can be inlined in number of pseudo instructions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Inlining is actually controlled by a number of parameters, which may be
|
|
specified individually by using <B>--param</B> <I>name</I><B>=</B><I>value</I>.
|
|
The <B>-finline-limit=</B><I>n</I> option sets some of these parameters
|
|
as follows:
|
|
<DL COMPACT><DT id="764"><DD>
|
|
<DL COMPACT>
|
|
<DT id="765"><B>max-inline-insns-single</B><DD>
|
|
|
|
|
|
is set to <I>n</I>/2.
|
|
<DT id="766"><B>max-inline-insns-auto</B><DD>
|
|
|
|
|
|
is set to <I>n</I>/2.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="767"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
See below for a documentation of the individual
|
|
parameters controlling inlining and for the defaults of these parameters.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Note:</I> there may be no value to <B>-finline-limit</B> that results
|
|
in default behavior.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Note:</I> pseudo instruction represents, in this particular context, an
|
|
abstract measurement of function's size. In no way does it represent a count
|
|
of assembly instructions and as such its exact meaning might change from one
|
|
release to an another.
|
|
</DL>
|
|
|
|
<DT id="768"><B>-fno-keep-inline-dllexport</B><DD>
|
|
|
|
|
|
This is a more fine-grained version of <B>-fkeep-inline-functions</B>,
|
|
which applies only to functions that are declared using the <TT>"dllexport"</TT>
|
|
attribute or declspec.
|
|
<DT id="769"><B>-fkeep-inline-functions</B><DD>
|
|
|
|
|
|
In C, emit <TT>"static"</TT> functions that are declared <TT>"inline"</TT>
|
|
into the object file, even if the function has been inlined into all
|
|
of its callers. This switch does not affect functions using the
|
|
<TT>"extern inline"</TT> extension in <FONT SIZE="-1">GNU C90.</FONT> In C<FONT SIZE="-2">++</FONT>, emit any and all
|
|
inline functions into the object file.
|
|
<DT id="770"><B>-fkeep-static-functions</B><DD>
|
|
|
|
|
|
Emit <TT>"static"</TT> functions into the object file, even if the function
|
|
is never used.
|
|
<DT id="771"><B>-fkeep-static-consts</B><DD>
|
|
|
|
|
|
Emit variables declared <TT>"static const"</TT> when optimization isn't turned
|
|
on, even if the variables aren't referenced.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> enables this option by default. If you want to force the compiler to
|
|
check if a variable is referenced, regardless of whether or not
|
|
optimization is turned on, use the <B>-fno-keep-static-consts</B> option.
|
|
<DT id="772"><B>-fmerge-constants</B><DD>
|
|
|
|
|
|
Attempt to merge identical constants (string constants and floating-point
|
|
constants) across compilation units.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is the default for optimized compilation if the assembler and
|
|
linker support it. Use <B>-fno-merge-constants</B> to inhibit this
|
|
behavior.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O</B>, <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="773"><B>-fmerge-all-constants</B><DD>
|
|
|
|
|
|
Attempt to merge identical constants and identical variables.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option implies <B>-fmerge-constants</B>. In addition to
|
|
<B>-fmerge-constants</B> this considers e.g. even constant initialized
|
|
arrays or initialized constant variables with integral or floating-point
|
|
types. Languages like C or C<FONT SIZE="-2">++</FONT> require each variable, including multiple
|
|
instances of the same variable in recursive calls, to have distinct locations,
|
|
so using this option results in non-conforming
|
|
behavior.
|
|
<DT id="774"><B>-fmodulo-sched</B><DD>
|
|
|
|
|
|
Perform swing modulo scheduling immediately before the first scheduling
|
|
pass. This pass looks at innermost loops and reorders their
|
|
instructions by overlapping different iterations.
|
|
<DT id="775"><B>-fmodulo-sched-allow-regmoves</B><DD>
|
|
|
|
|
|
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
|
|
<B>-fmodulo-sched</B> enabled.
|
|
<DT id="776"><B>-fno-branch-count-reg</B><DD>
|
|
|
|
|
|
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
|
|
then branch based upon the result. This option is only meaningful on
|
|
architectures that support such instructions, which include x86, PowerPC,
|
|
<FONT SIZE="-1">IA-64</FONT> and S/390. Note that the <B>-fno-branch-count-reg</B> option
|
|
doesn't remove the decrement and branch instructions from the generated
|
|
instruction stream introduced by other optimization passes.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-fbranch-count-reg</B> at <B>-O1</B> and higher,
|
|
except for <B>-Og</B>.
|
|
<DT id="777"><B>-fno-function-cse</B><DD>
|
|
|
|
|
|
Do not put function addresses in registers; make each instruction that
|
|
calls a constant function contain the function's address explicitly.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option results in less efficient code, but some strange hacks
|
|
that alter the assembler output may be confused by the optimizations
|
|
performed when this option is not used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-ffunction-cse</B>
|
|
<DT id="778"><B>-fno-zero-initialized-in-bss</B><DD>
|
|
|
|
|
|
If the target supports a <FONT SIZE="-1">BSS</FONT> section, <FONT SIZE="-1">GCC</FONT> by default puts variables that
|
|
are initialized to zero into <FONT SIZE="-1">BSS.</FONT> This can save space in the resulting
|
|
code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option turns off this behavior because some programs explicitly
|
|
rely on variables going to the data section---e.g., so that the
|
|
resulting executable can find the beginning of that section and/or make
|
|
assumptions based on that.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-fzero-initialized-in-bss</B>.
|
|
<DT id="779"><B>-fthread-jumps</B><DD>
|
|
|
|
|
|
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
|
|
second branch or a point immediately following it, depending on whether
|
|
the condition is known to be true or false.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="780"><B>-fsplit-wide-types</B><DD>
|
|
|
|
|
|
When using a type that occupies multiple registers, such as <TT>"long
|
|
long"</TT> on a 32-bit system, split the registers apart and allocate them
|
|
independently. This normally generates better code for those types,
|
|
but may make debugging more difficult.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O</B>, <B>-O2</B>, <B>-O3</B>,
|
|
<B>-Os</B>.
|
|
<DT id="781"><B>-fcse-follow-jumps</B><DD>
|
|
|
|
|
|
In common subexpression elimination (<FONT SIZE="-1">CSE</FONT>), scan through jump instructions
|
|
when the target of the jump is not reached by any other path. For
|
|
example, when <FONT SIZE="-1">CSE</FONT> encounters an <TT>"if"</TT> statement with an
|
|
<TT>"else"</TT> clause, <FONT SIZE="-1">CSE</FONT> follows the jump when the condition
|
|
tested is false.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="782"><B>-fcse-skip-blocks</B><DD>
|
|
|
|
|
|
This is similar to <B>-fcse-follow-jumps</B>, but causes <FONT SIZE="-1">CSE</FONT> to
|
|
follow jumps that conditionally skip over blocks. When <FONT SIZE="-1">CSE</FONT>
|
|
encounters a simple <TT>"if"</TT> statement with no else clause,
|
|
<B>-fcse-skip-blocks</B> causes <FONT SIZE="-1">CSE</FONT> to follow the jump around the
|
|
body of the <TT>"if"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="783"><B>-frerun-cse-after-loop</B><DD>
|
|
|
|
|
|
Re-run common subexpression elimination after loop optimizations are
|
|
performed.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="784"><B>-fgcse</B><DD>
|
|
|
|
|
|
Perform a global common subexpression elimination pass.
|
|
This pass also performs global constant and copy propagation.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Note:</I> When compiling a program using computed gotos, a <FONT SIZE="-1">GCC</FONT>
|
|
extension, you may get better run-time performance if you disable
|
|
the global common subexpression elimination pass by adding
|
|
<B>-fno-gcse</B> to the command line.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="785"><B>-fgcse-lm</B><DD>
|
|
|
|
|
|
When <B>-fgcse-lm</B> 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
|
|
the loop, and a copy/store within the loop.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by default when <B>-fgcse</B> is enabled.
|
|
<DT id="786"><B>-fgcse-sm</B><DD>
|
|
|
|
|
|
When <B>-fgcse-sm</B> 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 <B>-fgcse-lm</B>,
|
|
loops containing a load/store sequence can be changed to a load before
|
|
the loop and a store after the loop.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Not enabled at any optimization level.
|
|
<DT id="787"><B>-fgcse-las</B><DD>
|
|
|
|
|
|
When <B>-fgcse-las</B> 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).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Not enabled at any optimization level.
|
|
<DT id="788"><B>-fgcse-after-reload</B><DD>
|
|
|
|
|
|
When <B>-fgcse-after-reload</B> is enabled, a redundant load elimination
|
|
pass is performed after reload. The purpose of this pass is to clean up
|
|
redundant spilling.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="789"><B>-faggressive-loop-optimizations</B><DD>
|
|
|
|
|
|
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
|
|
integer overflows or out-of-bound array accesses. The bounds for the
|
|
number of iterations of a loop are used to guide loop unrolling and peeling
|
|
and loop exit test optimizations.
|
|
This option is enabled by default.
|
|
<DT id="790"><B>-funconstrained-commons</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="791"><B>-fcrossjumping</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="792"><B>-fauto-inc-dec</B><DD>
|
|
|
|
|
|
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 <B>-O</B> and
|
|
higher on architectures that support this.
|
|
<DT id="793"><B>-fdce</B><DD>
|
|
|
|
|
|
Perform dead code elimination (<FONT SIZE="-1">DCE</FONT>) on <FONT SIZE="-1">RTL.</FONT>
|
|
Enabled by default at <B>-O</B> and higher.
|
|
<DT id="794"><B>-fdse</B><DD>
|
|
|
|
|
|
Perform dead store elimination (<FONT SIZE="-1">DSE</FONT>) on <FONT SIZE="-1">RTL.</FONT>
|
|
Enabled by default at <B>-O</B> and higher.
|
|
<DT id="795"><B>-fif-conversion</B><DD>
|
|
|
|
|
|
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
|
|
on chips where it is available is controlled by <B>-fif-conversion2</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O</B>, <B>-O2</B>, <B>-O3</B>, <B>-Os</B>, but
|
|
not with <B>-Og</B>.
|
|
<DT id="796"><B>-fif-conversion2</B><DD>
|
|
|
|
|
|
Use conditional execution (where available) to transform conditional jumps into
|
|
branch-less equivalents.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O</B>, <B>-O2</B>, <B>-O3</B>, <B>-Os</B>, but
|
|
not with <B>-Og</B>.
|
|
<DT id="797"><B>-fdeclone-ctor-dtor</B><DD>
|
|
|
|
|
|
The C<FONT SIZE="-2">++</FONT> <FONT SIZE="-1">ABI</FONT> 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.
|
|
For a hierarchy with virtual bases, the base and complete variants are
|
|
clones, which means two copies of the function. With this option, the
|
|
base and complete variants are changed to be thunks that call a common
|
|
implementation.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by <B>-Os</B>.
|
|
<DT id="798"><B>-fdelete-null-pointer-checks</B><DD>
|
|
|
|
|
|
Assume that programs cannot safely dereference null pointers, and that
|
|
no code or data element resides at address zero.
|
|
This option enables simple constant
|
|
folding optimizations at all optimization levels. In addition, other
|
|
optimization passes in <FONT SIZE="-1">GCC</FONT> use this flag to control global dataflow
|
|
analyses that eliminate useless checks for null pointers; these assume
|
|
that a memory access to address zero always results in a trap, so
|
|
that if a pointer is checked after it has already been dereferenced,
|
|
it cannot be null.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note however that in some environments this assumption is not true.
|
|
Use <B>-fno-delete-null-pointer-checks</B> to disable this optimization
|
|
for programs that depend on that behavior.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is enabled by default on most targets. On Nios <FONT SIZE="-1">II ELF,</FONT> it
|
|
defaults to off. On <FONT SIZE="-1">AVR, CR16,</FONT> and <FONT SIZE="-1">MSP430,</FONT> this option is completely disabled.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Passes that use the dataflow information
|
|
are enabled independently at different optimization levels.
|
|
<DT id="799"><B>-fdevirtualize</B><DD>
|
|
|
|
|
|
Attempt to convert calls to virtual functions to direct calls. This
|
|
is done both within a procedure and interprocedurally as part of
|
|
indirect inlining (<B>-findirect-inlining</B>) and interprocedural constant
|
|
propagation (<B>-fipa-cp</B>).
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="800"><B>-fdevirtualize-speculatively</B><DD>
|
|
|
|
|
|
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
|
|
the call into a conditional deciding between direct and indirect calls. The
|
|
speculative calls enable more optimizations, such as inlining. When they seem
|
|
useless after further optimization, they are converted back into original form.
|
|
<DT id="801"><B>-fdevirtualize-at-ltrans</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="802"><B>-fexpensive-optimizations</B><DD>
|
|
|
|
|
|
Perform a number of minor optimizations that are relatively expensive.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="803"><B>-free</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled for Alpha, AArch64 and x86 at levels <B>-O2</B>,
|
|
<B>-O3</B>, <B>-Os</B>.
|
|
<DT id="804"><B>-fno-lifetime-dse</B><DD>
|
|
|
|
|
|
In C<FONT SIZE="-2">++</FONT> 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
|
|
the object is destroyed. Normally dead store elimination will take
|
|
advantage of this; if your code relies on the value of the object
|
|
storage persisting beyond the lifetime of the object, you can use this
|
|
flag to disable this optimization. To preserve stores before the
|
|
constructor starts (e.g. because your operator new clears the object
|
|
storage) but still treat the object as dead after the destructor you,
|
|
can use <B>-flifetime-dse=1</B>. The default behavior can be
|
|
explicitly selected with <B>-flifetime-dse=2</B>.
|
|
<B>-flifetime-dse=0</B> is equivalent to <B>-fno-lifetime-dse</B>.
|
|
<DT id="805"><B>-flive-range-shrinkage</B><DD>
|
|
|
|
|
|
Attempt to decrease register pressure through register live range
|
|
shrinkage. This is helpful for fast processors with small or moderate
|
|
size register sets.
|
|
<DT id="806"><B>-fira-algorithm=</B><I>algorithm</I><DD>
|
|
|
|
|
|
Use the specified coloring algorithm for the integrated register
|
|
allocator. The <I>algorithm</I> argument can be <B>priority</B>, which
|
|
specifies Chow's priority coloring, or <B></B><FONT SIZE="-1"><B>CB</B></FONT><B></B>, which specifies
|
|
Chaitin-Briggs coloring. Chaitin-Briggs coloring is not implemented
|
|
for all architectures, but for those targets that do support it, it is
|
|
the default because it generates better code.
|
|
<DT id="807"><B>-fira-region=</B><I>region</I><DD>
|
|
|
|
|
|
Use specified regions for the integrated register allocator. The
|
|
<I>region</I> argument should be one of the following:
|
|
<DL COMPACT><DT id="808"><DD>
|
|
<DL COMPACT>
|
|
<DT id="809"><B>all</B><DD>
|
|
|
|
|
|
Use all loops as register allocation regions.
|
|
This can give the best results for machines with a small and/or
|
|
irregular register set.
|
|
<DT id="810"><B>mixed</B><DD>
|
|
|
|
|
|
Use all loops except for loops with small register pressure
|
|
as the regions. This value usually gives
|
|
the best results in most cases and for most architectures,
|
|
and is enabled by default when compiling with optimization for speed
|
|
(<B>-O</B>, <B>-O2</B>, ...).
|
|
<DT id="811"><B>one</B><DD>
|
|
|
|
|
|
Use all functions as a single region.
|
|
This typically results in the smallest code size, and is enabled by default for
|
|
<B>-Os</B> or <B>-O0</B>.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="812"><DD>
|
|
</DL>
|
|
|
|
<DT id="813"><B>-fira-hoist-pressure</B><DD>
|
|
|
|
|
|
Use <FONT SIZE="-1">IRA</FONT> 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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is enabled at level <B>-Os</B> for all targets.
|
|
<DT id="814"><B>-fira-loop-pressure</B><DD>
|
|
|
|
|
|
Use <FONT SIZE="-1">IRA</FONT> 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
|
|
registers), but it can slow the compiler down.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is enabled at level <B>-O3</B> for some targets.
|
|
<DT id="815"><B>-fno-ira-share-save-slots</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="816"><B>-fno-ira-share-spill-slots</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="817"><B>-flra-remat</B><DD>
|
|
|
|
|
|
Enable CFG-sensitive rematerialization in <FONT SIZE="-1">LRA.</FONT> Instead of loading
|
|
values of spilled pseudos, <FONT SIZE="-1">LRA</FONT> tries to rematerialize (recalculate)
|
|
values if it is profitable.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="818"><B>-fdelayed-branch</B><DD>
|
|
|
|
|
|
If supported for the target machine, attempt to reorder instructions
|
|
to exploit instruction slots available after delayed branch
|
|
instructions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O</B>, <B>-O2</B>, <B>-O3</B>, <B>-Os</B>,
|
|
but not at <B>-Og</B>.
|
|
<DT id="819"><B>-fschedule-insns</B><DD>
|
|
|
|
|
|
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
|
|
by allowing other instructions to be issued until the result of the load
|
|
or floating-point instruction is required.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>.
|
|
<DT id="820"><B>-fschedule-insns2</B><DD>
|
|
|
|
|
|
Similar to <B>-fschedule-insns</B>, 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
|
|
registers and where memory load instructions take more than one cycle.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="821"><B>-fno-sched-interblock</B><DD>
|
|
|
|
|
|
Disable instruction scheduling across basic blocks, which
|
|
is normally enabled when scheduling before register allocation, i.e.
|
|
with <B>-fschedule-insns</B> or at <B>-O2</B> or higher.
|
|
<DT id="822"><B>-fno-sched-spec</B><DD>
|
|
|
|
|
|
Disable speculative motion of non-load instructions, which
|
|
is normally enabled when scheduling before register allocation, i.e.
|
|
with <B>-fschedule-insns</B> or at <B>-O2</B> or higher.
|
|
<DT id="823"><B>-fsched-pressure</B><DD>
|
|
|
|
|
|
Enable register pressure sensitive insn scheduling before register
|
|
allocation. This only makes sense when scheduling before register
|
|
allocation is enabled, i.e. with <B>-fschedule-insns</B> or at
|
|
<B>-O2</B> or higher. Usage of this option can improve the
|
|
generated code and decrease its size by preventing register pressure
|
|
increase above the number of available hard registers and subsequent
|
|
spills in register allocation.
|
|
<DT id="824"><B>-fsched-spec-load</B><DD>
|
|
|
|
|
|
Allow speculative motion of some load instructions. This only makes
|
|
sense when scheduling before register allocation, i.e. with
|
|
<B>-fschedule-insns</B> or at <B>-O2</B> or higher.
|
|
<DT id="825"><B>-fsched-spec-load-dangerous</B><DD>
|
|
|
|
|
|
Allow speculative motion of more load instructions. This only makes
|
|
sense when scheduling before register allocation, i.e. with
|
|
<B>-fschedule-insns</B> or at <B>-O2</B> or higher.
|
|
<DT id="826"><B>-fsched-stalled-insns</B><DD>
|
|
|
|
|
|
|
|
<DT id="827"><B>-fsched-stalled-insns=</B><I>n</I><DD>
|
|
|
|
|
|
|
|
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.
|
|
<B>-fno-sched-stalled-insns</B> means that no insns are moved
|
|
prematurely, <B>-fsched-stalled-insns=0</B> means there is no limit
|
|
on how many queued insns can be moved prematurely.
|
|
<B>-fsched-stalled-insns</B> without a value is equivalent to
|
|
<B>-fsched-stalled-insns=1</B>.
|
|
<DT id="828"><B>-fsched-stalled-insns-dep</B><DD>
|
|
|
|
|
|
|
|
<DT id="829"><B>-fsched-stalled-insns-dep=</B><I>n</I><DD>
|
|
|
|
|
|
|
|
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,
|
|
and only if <B>-fsched-stalled-insns</B> is used.
|
|
<B>-fno-sched-stalled-insns-dep</B> is equivalent to
|
|
<B>-fsched-stalled-insns-dep=0</B>.
|
|
<B>-fsched-stalled-insns-dep</B> without a value is equivalent to
|
|
<B>-fsched-stalled-insns-dep=1</B>.
|
|
<DT id="830"><B>-fsched2-use-superblocks</B><DD>
|
|
|
|
|
|
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
|
|
descriptions used by <FONT SIZE="-1">GCC</FONT> model the <FONT SIZE="-1">CPU</FONT> closely enough to avoid unreliable
|
|
results from the algorithm.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This only makes sense when scheduling after register allocation, i.e. with
|
|
<B>-fschedule-insns2</B> or at <B>-O2</B> or higher.
|
|
<DT id="831"><B>-fsched-group-heuristic</B><DD>
|
|
|
|
|
|
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 <B>-fschedule-insns</B>
|
|
or <B>-fschedule-insns2</B> or at <B>-O2</B> or higher.
|
|
<DT id="832"><B>-fsched-critical-path-heuristic</B><DD>
|
|
|
|
|
|
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 <B>-fschedule-insns</B>
|
|
or <B>-fschedule-insns2</B> or at <B>-O2</B> or higher.
|
|
<DT id="833"><B>-fsched-spec-insn-heuristic</B><DD>
|
|
|
|
|
|
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 <B>-fschedule-insns</B> or <B>-fschedule-insns2</B>
|
|
or at <B>-O2</B> or higher.
|
|
<DT id="834"><B>-fsched-rank-heuristic</B><DD>
|
|
|
|
|
|
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 <B>-fschedule-insns</B> or <B>-fschedule-insns2</B> or
|
|
at <B>-O2</B> or higher.
|
|
<DT id="835"><B>-fsched-last-insn-heuristic</B><DD>
|
|
|
|
|
|
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 <B>-fschedule-insns</B> or <B>-fschedule-insns2</B> or
|
|
at <B>-O2</B> or higher.
|
|
<DT id="836"><B>-fsched-dep-count-heuristic</B><DD>
|
|
|
|
|
|
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 <B>-fschedule-insns</B> or <B>-fschedule-insns2</B> or
|
|
at <B>-O2</B> or higher.
|
|
<DT id="837"><B>-freschedule-modulo-scheduled-loops</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="838"><B>-fselective-scheduling</B><DD>
|
|
|
|
|
|
Schedule instructions using selective scheduling algorithm. Selective
|
|
scheduling runs instead of the first scheduler pass.
|
|
<DT id="839"><B>-fselective-scheduling2</B><DD>
|
|
|
|
|
|
Schedule instructions using selective scheduling algorithm. Selective
|
|
scheduling runs instead of the second scheduler pass.
|
|
<DT id="840"><B>-fsel-sched-pipelining</B><DD>
|
|
|
|
|
|
Enable software pipelining of innermost loops during selective scheduling.
|
|
This option has no effect unless one of <B>-fselective-scheduling</B> or
|
|
<B>-fselective-scheduling2</B> is turned on.
|
|
<DT id="841"><B>-fsel-sched-pipelining-outer-loops</B><DD>
|
|
|
|
|
|
When pipelining loops during selective scheduling, also pipeline outer loops.
|
|
This option has no effect unless <B>-fsel-sched-pipelining</B> is turned on.
|
|
<DT id="842"><B>-fsemantic-interposition</B><DD>
|
|
|
|
|
|
Some object formats, like <FONT SIZE="-1">ELF,</FONT> allow interposing of symbols by the
|
|
dynamic linker.
|
|
This means that for symbols exported from the <FONT SIZE="-1">DSO,</FONT> the compiler cannot perform
|
|
interprocedural propagation, inlining and other optimizations in anticipation
|
|
that the function or variable in question may change. While this feature is
|
|
useful, for example, to rewrite memory allocation functions by a debugging
|
|
implementation, it is expensive in the terms of code quality.
|
|
With <B>-fno-semantic-interposition</B> the compiler assumes that
|
|
if interposition happens for functions the overwriting function will have
|
|
precisely the same semantics (and side effects).
|
|
Similarly if interposition happens
|
|
for variables, the constructor of the variable will be the same. The flag
|
|
has no effect for functions explicitly declared inline
|
|
(where it is never allowed for interposition to change semantics)
|
|
and for symbols explicitly declared weak.
|
|
<DT id="843"><B>-fshrink-wrap</B><DD>
|
|
|
|
|
|
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
|
|
<B>-O</B> and higher.
|
|
<DT id="844"><B>-fshrink-wrap-separate</B><DD>
|
|
|
|
|
|
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 <B>-fshrink-wrap</B>
|
|
is also turned on and the target supports this.
|
|
<DT id="845"><B>-fcaller-saves</B><DD>
|
|
|
|
|
|
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
|
|
seems to result in better code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is always enabled by default on certain machines, usually
|
|
those which have no call-preserved registers to use instead.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="846"><B>-fcombine-stack-adjustments</B><DD>
|
|
|
|
|
|
Tracks stack adjustments (pushes and pops) and stack memory references
|
|
and then tries to find ways to combine them.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by default at <B>-O1</B> and higher.
|
|
<DT id="847"><B>-fipa-ra</B><DD>
|
|
|
|
|
|
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
|
|
same compilation unit as current function and they are compiled before it.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>, however the option
|
|
is disabled if generated code will be instrumented for profiling
|
|
(<B>-p</B>, or <B>-pg</B>) or if callee's register usage cannot be known
|
|
exactly (this happens on targets that do not expose prologues
|
|
and epilogues in <FONT SIZE="-1">RTL</FONT>).
|
|
<DT id="848"><B>-fconserve-stack</B><DD>
|
|
|
|
|
|
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 <B>large-stack-frame</B> parameter to 100
|
|
and the <B>large-stack-frame-growth</B> parameter to 400.
|
|
<DT id="849"><B>-ftree-reassoc</B><DD>
|
|
|
|
|
|
Perform reassociation on trees. This flag is enabled by default
|
|
at <B>-O</B> and higher.
|
|
<DT id="850"><B>-fcode-hoisting</B><DD>
|
|
|
|
|
|
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 <B>-O2</B> and higher.
|
|
<DT id="851"><B>-ftree-pre</B><DD>
|
|
|
|
|
|
Perform partial redundancy elimination (<FONT SIZE="-1">PRE</FONT>) on trees. This flag is
|
|
enabled by default at <B>-O2</B> and <B>-O3</B>.
|
|
<DT id="852"><B>-ftree-partial-pre</B><DD>
|
|
|
|
|
|
Make partial redundancy elimination (<FONT SIZE="-1">PRE</FONT>) more aggressive. This flag is
|
|
enabled by default at <B>-O3</B>.
|
|
<DT id="853"><B>-ftree-forwprop</B><DD>
|
|
|
|
|
|
Perform forward propagation on trees. This flag is enabled by default
|
|
at <B>-O</B> and higher.
|
|
<DT id="854"><B>-ftree-fre</B><DD>
|
|
|
|
|
|
Perform full redundancy elimination (<FONT SIZE="-1">FRE</FONT>) on trees. The difference
|
|
between <FONT SIZE="-1">FRE</FONT> and <FONT SIZE="-1">PRE</FONT> is that <FONT SIZE="-1">FRE</FONT> only considers expressions
|
|
that are computed on all paths leading to the redundant computation.
|
|
This analysis is faster than <FONT SIZE="-1">PRE,</FONT> though it exposes fewer redundancies.
|
|
This flag is enabled by default at <B>-O</B> and higher.
|
|
<DT id="855"><B>-ftree-phiprop</B><DD>
|
|
|
|
|
|
Perform hoisting of loads from conditional pointers on trees. This
|
|
pass is enabled by default at <B>-O</B> and higher.
|
|
<DT id="856"><B>-fhoist-adjacent-loads</B><DD>
|
|
|
|
|
|
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 <B>-O2</B> and higher.
|
|
<DT id="857"><B>-ftree-copy-prop</B><DD>
|
|
|
|
|
|
Perform copy propagation on trees. This pass eliminates unnecessary
|
|
copy operations. This flag is enabled by default at <B>-O</B> and
|
|
higher.
|
|
<DT id="858"><B>-fipa-pure-const</B><DD>
|
|
|
|
|
|
Discover which functions are pure or constant.
|
|
Enabled by default at <B>-O</B> and higher.
|
|
<DT id="859"><B>-fipa-reference</B><DD>
|
|
|
|
|
|
Discover which static variables do not escape the
|
|
compilation unit.
|
|
Enabled by default at <B>-O</B> and higher.
|
|
<DT id="860"><B>-fipa-reference-addressable</B><DD>
|
|
|
|
|
|
Discover read-only, write-only and non-addressable static variables.
|
|
Enabled by default at <B>-O</B> and higher.
|
|
<DT id="861"><B>-fipa-stack-alignment</B><DD>
|
|
|
|
|
|
Reduce stack alignment on call sites if possible.
|
|
Enabled by default.
|
|
<DT id="862"><B>-fipa-pta</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="863"><B>-fipa-profile</B><DD>
|
|
|
|
|
|
Perform interprocedural profile propagation. The functions called only from
|
|
cold functions are marked as cold. Also functions executed once (such as
|
|
<TT>"cold"</TT>, <TT>"noreturn"</TT>, static constructors or destructors) are identified. Cold
|
|
functions and loop less parts of functions executed once are then optimized for
|
|
size.
|
|
Enabled by default at <B>-O</B> and higher.
|
|
<DT id="864"><B>-fipa-cp</B><DD>
|
|
|
|
|
|
Perform interprocedural constant propagation.
|
|
This optimization analyzes the program to determine when values passed
|
|
to functions are constants and then optimizes accordingly.
|
|
This optimization can substantially increase performance
|
|
if the application has constants passed to functions.
|
|
This flag is enabled by default at <B>-O2</B>, <B>-Os</B> and <B>-O3</B>.
|
|
It is also enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="865"><B>-fipa-cp-clone</B><DD>
|
|
|
|
|
|
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.
|
|
Because this optimization can create multiple copies of functions,
|
|
it may significantly increase code size
|
|
(see <B>--param ipcp-unit-growth=</B><I>value</I>).
|
|
This flag is enabled by default at <B>-O3</B>.
|
|
It is also enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="866"><B>-fipa-bit-cp</B><DD>
|
|
|
|
|
|
When enabled, perform interprocedural bitwise constant
|
|
propagation. This flag is enabled by default at <B>-O2</B> and
|
|
by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
It requires that <B>-fipa-cp</B> is enabled.
|
|
<DT id="867"><B>-fipa-vrp</B><DD>
|
|
|
|
|
|
When enabled, perform interprocedural propagation of value
|
|
ranges. This flag is enabled by default at <B>-O2</B>. It requires
|
|
that <B>-fipa-cp</B> is enabled.
|
|
<DT id="868"><B>-fipa-icf</B><DD>
|
|
|
|
|
|
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
|
|
more effectively with link-time optimization enabled.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Although the behavior is similar to the Gold Linker's <FONT SIZE="-1">ICF</FONT> optimization, <FONT SIZE="-1">GCC ICF</FONT>
|
|
works on different levels and thus the optimizations are not same - there are
|
|
equivalences that are found only by <FONT SIZE="-1">GCC</FONT> and equivalences found only by Gold.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This flag is enabled by default at <B>-O2</B> and <B>-Os</B>.
|
|
<DT id="869"><B>-flive-patching=</B><I>level</I><DD>
|
|
|
|
|
|
Control <FONT SIZE="-1">GCC</FONT>'s optimizations to produce output suitable for live-patching.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If the compiler's optimization uses a function's body or information extracted
|
|
from its body to optimize/change another function, the latter is called an
|
|
impacted function of the former. If a function is patched, its impacted
|
|
functions should be patched too.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The impacted functions are determined by the compiler's interprocedural
|
|
optimizations. For example, a caller is impacted when inlining a function
|
|
into its caller,
|
|
cloning a function and changing its caller to call this new clone,
|
|
or extracting a function's pureness/constness information to optimize
|
|
its direct or indirect callers, etc.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Usually, the more <FONT SIZE="-1">IPA</FONT> optimizations enabled, the larger the number of
|
|
impacted functions for each function. In order to control the number of
|
|
impacted functions and more easily compute the list of impacted function,
|
|
<FONT SIZE="-1">IPA</FONT> optimizations can be partially enabled at two different levels.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <I>level</I> argument should be one of the following:
|
|
<DL COMPACT><DT id="870"><DD>
|
|
<DL COMPACT>
|
|
<DT id="871"><B>inline-clone</B><DD>
|
|
|
|
|
|
Only enable inlining and cloning optimizations, which includes inlining,
|
|
cloning, interprocedural scalar replacement of aggregates and partial inlining.
|
|
As a result, when patching a function, all its callers and its clones'
|
|
callers are impacted, therefore need to be patched as well.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-flive-patching=inline-clone</B> disables the following optimization flags:
|
|
<B>-fwhole-program -fipa-pta -fipa-reference -fipa-ra
|
|
-fipa-icf -fipa-icf-functions -fipa-icf-variables
|
|
-fipa-bit-cp -fipa-vrp -fipa-pure-const -fipa-reference-addressable
|
|
-fipa-stack-alignment</B>
|
|
<DT id="872"><B>inline-only-static</B><DD>
|
|
|
|
|
|
Only enable inlining of static functions.
|
|
As a result, when patching a static function, all its callers are impacted
|
|
and so need to be patched as well.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In addition to all the flags that <B>-flive-patching=inline-clone</B>
|
|
disables,
|
|
<B>-flive-patching=inline-only-static</B> disables the following additional
|
|
optimization flags:
|
|
<B>-fipa-cp-clone -fipa-sra -fpartial-inlining -fipa-cp</B>
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="873"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When <B>-flive-patching</B> is specified without any value, the default value
|
|
is <I>inline-clone</I>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This flag is disabled by default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that <B>-flive-patching</B> is not supported with link-time optimization
|
|
(<B>-flto</B>).
|
|
</DL>
|
|
|
|
<DT id="874"><B>-fisolate-erroneous-paths-dereference</B><DD>
|
|
|
|
|
|
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 <B>-O2</B> and higher and depends on
|
|
<B>-fdelete-null-pointer-checks</B> also being enabled.
|
|
<DT id="875"><B>-fisolate-erroneous-paths-attribute</B><DD>
|
|
|
|
|
|
Detect paths that trigger erroneous or undefined behavior due to a null value
|
|
being used in a way forbidden by a <TT>"returns_nonnull"</TT> or <TT>"nonnull"</TT>
|
|
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 <B>-O2</B> in the future.
|
|
<DT id="876"><B>-ftree-sink</B><DD>
|
|
|
|
|
|
Perform forward store motion on trees. This flag is
|
|
enabled by default at <B>-O</B> and higher.
|
|
<DT id="877"><B>-ftree-bit-ccp</B><DD>
|
|
|
|
|
|
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 <B>-O1</B> and higher, except for <B>-Og</B>.
|
|
It requires that <B>-ftree-ccp</B> is enabled.
|
|
<DT id="878"><B>-ftree-ccp</B><DD>
|
|
|
|
|
|
Perform sparse conditional constant propagation (<FONT SIZE="-1">CCP</FONT>) on trees. This
|
|
pass only operates on local scalar variables and is enabled by default
|
|
at <B>-O</B> and higher.
|
|
<DT id="879"><B>-fssa-backprop</B><DD>
|
|
|
|
|
|
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 <B>-O</B> and higher.
|
|
<DT id="880"><B>-fssa-phiopt</B><DD>
|
|
|
|
|
|
Perform pattern matching on <FONT SIZE="-1">SSA PHI</FONT> nodes to optimize conditional
|
|
code. This pass is enabled by default at <B>-O1</B> and higher,
|
|
except for <B>-Og</B>.
|
|
<DT id="881"><B>-ftree-switch-conversion</B><DD>
|
|
|
|
|
|
Perform conversion of simple initializations in a switch to
|
|
initializations from a scalar array. This flag is enabled by default
|
|
at <B>-O2</B> and higher.
|
|
<DT id="882"><B>-ftree-tail-merge</B><DD>
|
|
|
|
|
|
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 <B>-O2</B> and higher. The compilation time
|
|
in this pass can
|
|
be limited using <B>max-tail-merge-comparisons</B> parameter and
|
|
<B>max-tail-merge-iterations</B> parameter.
|
|
<DT id="883"><B>-ftree-dce</B><DD>
|
|
|
|
|
|
Perform dead code elimination (<FONT SIZE="-1">DCE</FONT>) on trees. This flag is enabled by
|
|
default at <B>-O</B> and higher.
|
|
<DT id="884"><B>-ftree-builtin-call-dce</B><DD>
|
|
|
|
|
|
Perform conditional dead code elimination (<FONT SIZE="-1">DCE</FONT>) for calls to built-in functions
|
|
that may set <TT>"errno"</TT> but are otherwise free of side effects. This flag is
|
|
enabled by default at <B>-O2</B> and higher if <B>-Os</B> is not also
|
|
specified.
|
|
<DT id="885"><B>-ftree-dominator-opts</B><DD>
|
|
|
|
|
|
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 <B>-O</B> and higher.
|
|
<DT id="886"><B>-ftree-dse</B><DD>
|
|
|
|
|
|
Perform dead store elimination (<FONT SIZE="-1">DSE</FONT>) 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 <B>-O</B> and higher.
|
|
<DT id="887"><B>-ftree-ch</B><DD>
|
|
|
|
|
|
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 <B>-O</B> and higher. It is not enabled
|
|
for <B>-Os</B>, since it usually increases code size.
|
|
<DT id="888"><B>-ftree-loop-optimize</B><DD>
|
|
|
|
|
|
Perform loop optimizations on trees. This flag is enabled by default
|
|
at <B>-O</B> and higher.
|
|
<DT id="889"><B>-ftree-loop-linear</B><DD>
|
|
|
|
|
|
|
|
<DT id="890"><B>-floop-strip-mine</B><DD>
|
|
|
|
|
|
<DT id="891"><B>-floop-block</B><DD>
|
|
|
|
|
|
|
|
Perform loop nest optimizations. Same as
|
|
<B>-floop-nest-optimize</B>. To use this code transformation, <FONT SIZE="-1">GCC</FONT> has
|
|
to be configured with <B>--with-isl</B> to enable the Graphite loop
|
|
transformation infrastructure.
|
|
<DT id="892"><B>-fgraphite-identity</B><DD>
|
|
|
|
|
|
Enable the identity transformation for graphite. For every SCoP we generate
|
|
the polyhedral representation and transform it back to gimple. Using
|
|
<B>-fgraphite-identity</B> we can check the costs or benefits of the
|
|
<FONT SIZE="-1">GIMPLE</FONT> -> <FONT SIZE="-1">GRAPHITE</FONT> -> <FONT SIZE="-1">GIMPLE</FONT> transformation. Some minimal optimizations
|
|
are also performed by the code generator isl, like index splitting and
|
|
dead code elimination in loops.
|
|
<DT id="893"><B>-floop-nest-optimize</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="894"><B>-floop-parallelize-all</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="895"><B>-ftree-coalesce-vars</B><DD>
|
|
|
|
|
|
While transforming the program out of the <FONT SIZE="-1">SSA</FONT> representation, attempt to
|
|
reduce copying by coalescing versions of different user-defined
|
|
variables, instead of just compiler temporaries. This may severely
|
|
limit the ability to debug an optimized program compiled with
|
|
<B>-fno-var-tracking-assignments</B>. In the negated form, this flag
|
|
prevents <FONT SIZE="-1">SSA</FONT> coalescing of user variables. This option is enabled by
|
|
default if optimization is enabled, and it does very little otherwise.
|
|
<DT id="896"><B>-ftree-loop-if-convert</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="897"><B>-ftree-loop-distribution</B><DD>
|
|
|
|
|
|
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
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
DO I = 1, N
|
|
A(I) = B(I) + C
|
|
D(I) = E(I) * F
|
|
ENDDO
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
is transformed to
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
DO I = 1, N
|
|
A(I) = B(I) + C
|
|
ENDDO
|
|
DO I = 1, N
|
|
D(I) = E(I) * F
|
|
ENDDO
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This flag is enabled by default at <B>-O3</B>.
|
|
It is also enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="898"><B>-ftree-loop-distribute-patterns</B><DD>
|
|
|
|
|
|
Perform loop distribution of patterns that can be code generated with
|
|
calls to a library. This flag is enabled by default at <B>-O3</B>, and
|
|
by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This pass distributes the initialization loops and generates a call to
|
|
memset zero. For example, the loop
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
DO I = 1, N
|
|
A(I) = 0
|
|
B(I) = A(I) + I
|
|
ENDDO
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
is transformed to
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
DO I = 1, N
|
|
A(I) = 0
|
|
ENDDO
|
|
DO I = 1, N
|
|
B(I) = A(I) + I
|
|
ENDDO
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
and the initialization loop is transformed into a call to memset zero.
|
|
This flag is enabled by default at <B>-O3</B>.
|
|
It is also enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="899"><B>-floop-interchange</B><DD>
|
|
|
|
|
|
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
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
for (int i = 0; i < N; i++)
|
|
for (int j = 0; j < N; j++)
|
|
for (int k = 0; k < N; k++)
|
|
c[i][j] = c[i][j] + a[i][k]*b[k][j];
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
is transformed to
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
for (int i = 0; i < N; i++)
|
|
for (int k = 0; k < N; k++)
|
|
for (int j = 0; j < N; j++)
|
|
c[i][j] = c[i][j] + a[i][k]*b[k][j];
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This flag is enabled by default at <B>-O3</B>.
|
|
It is also enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="900"><B>-floop-unroll-and-jam</B><DD>
|
|
|
|
|
|
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 <B>-O3</B>.
|
|
It is also enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="901"><B>-ftree-loop-im</B><DD>
|
|
|
|
|
|
Perform loop invariant motion on trees. This pass moves only invariants that
|
|
are hard to handle at <FONT SIZE="-1">RTL</FONT> level (function calls, operations that expand to
|
|
nontrivial sequences of insns). With <B>-funswitch-loops</B> it also moves
|
|
operands of conditions that are invariant out of the loop, so that we can use
|
|
just trivial invariantness analysis in loop unswitching. The pass also includes
|
|
store motion.
|
|
<DT id="902"><B>-ftree-loop-ivcanon</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="903"><B>-ftree-scev-cprop</B><DD>
|
|
|
|
|
|
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
|
|
the final value by such a computation, provided it is sufficiently cheap.
|
|
This reduces data dependencies and may allow further simplifications.
|
|
Enabled by default at <B>-O</B> and higher.
|
|
<DT id="904"><B>-fivopts</B><DD>
|
|
|
|
|
|
Perform induction variable optimizations (strength reduction, induction
|
|
variable merging and induction variable elimination) on trees.
|
|
<DT id="905"><B>-ftree-parallelize-loops=n</B><DD>
|
|
|
|
|
|
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
|
|
profitable on multiprocessor machines, for loops that are CPU-intensive,
|
|
rather than constrained e.g. by memory bandwidth. This option
|
|
implies <B>-pthread</B>, and thus is only supported on targets
|
|
that have support for <B>-pthread</B>.
|
|
<DT id="906"><B>-ftree-pta</B><DD>
|
|
|
|
|
|
Perform function-local points-to analysis on trees. This flag is
|
|
enabled by default at <B>-O1</B> and higher, except for <B>-Og</B>.
|
|
<DT id="907"><B>-ftree-sra</B><DD>
|
|
|
|
|
|
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 <B>-O1</B> and higher,
|
|
except for <B>-Og</B>.
|
|
<DT id="908"><B>-fstore-merging</B><DD>
|
|
|
|
|
|
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 <B>-O2</B> and higher as well as <B>-Os</B>.
|
|
<DT id="909"><B>-ftree-ter</B><DD>
|
|
|
|
|
|
Perform temporary expression replacement during the <FONT SIZE="-1">SSA-</FONT>>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 <FONT SIZE="-1">RTL</FONT> generation. This is
|
|
enabled by default at <B>-O</B> and higher.
|
|
<DT id="910"><B>-ftree-slsr</B><DD>
|
|
|
|
|
|
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 <B>-O</B> and
|
|
higher.
|
|
<DT id="911"><B>-ftree-vectorize</B><DD>
|
|
|
|
|
|
Perform vectorization on trees. This flag enables <B>-ftree-loop-vectorize</B>
|
|
and <B>-ftree-slp-vectorize</B> if not explicitly specified.
|
|
<DT id="912"><B>-ftree-loop-vectorize</B><DD>
|
|
|
|
|
|
Perform loop vectorization on trees. This flag is enabled by default at
|
|
<B>-O3</B> and by <B>-ftree-vectorize</B>, <B>-fprofile-use</B>,
|
|
and <B>-fauto-profile</B>.
|
|
<DT id="913"><B>-ftree-slp-vectorize</B><DD>
|
|
|
|
|
|
Perform basic block vectorization on trees. This flag is enabled by default at
|
|
<B>-O3</B> and by <B>-ftree-vectorize</B>, <B>-fprofile-use</B>,
|
|
and <B>-fauto-profile</B>.
|
|
<DT id="914"><B>-fvect-cost-model=</B><I>model</I><DD>
|
|
|
|
|
|
Alter the cost model used for vectorization. The <I>model</I> argument
|
|
should be one of <B>unlimited</B>, <B>dynamic</B> or <B>cheap</B>.
|
|
With the <B>unlimited</B> model the vectorized code-path is assumed
|
|
to be profitable while with the <B>dynamic</B> model a runtime check
|
|
guards the vectorized code-path to enable it only for iteration
|
|
counts that will likely execute faster than when executing the original
|
|
scalar loop. The <B>cheap</B> model disables vectorization of
|
|
loops where doing so would be cost prohibitive for example due to
|
|
required runtime checks for data dependence or alignment but otherwise
|
|
is equal to the <B>dynamic</B> model.
|
|
The default cost model depends on other optimization flags and is
|
|
either <B>dynamic</B> or <B>cheap</B>.
|
|
<DT id="915"><B>-fsimd-cost-model=</B><I>model</I><DD>
|
|
|
|
|
|
Alter the cost model used for vectorization of loops marked with the OpenMP
|
|
simd directive. The <I>model</I> argument should be one of
|
|
<B>unlimited</B>, <B>dynamic</B>, <B>cheap</B>. All values of <I>model</I>
|
|
have the same meaning as described in <B>-fvect-cost-model</B> and by
|
|
default a cost model defined with <B>-fvect-cost-model</B> is used.
|
|
<DT id="916"><B>-ftree-vrp</B><DD>
|
|
|
|
|
|
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
|
|
checks like array bound checks and null pointer checks. This is
|
|
enabled by default at <B>-O2</B> and higher. Null pointer check
|
|
elimination is only done if <B>-fdelete-null-pointer-checks</B> is
|
|
enabled.
|
|
<DT id="917"><B>-fsplit-paths</B><DD>
|
|
|
|
|
|
Split paths leading to loop backedges. This can improve dead code
|
|
elimination and common subexpression elimination. This is enabled by
|
|
default at <B>-O3</B> and above.
|
|
<DT id="918"><B>-fsplit-ivs-in-unroller</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
A combination of <B>-fweb</B> and <FONT SIZE="-1">CSE</FONT> is often sufficient to obtain the
|
|
same effect. However, that is not reliable in cases where the loop body
|
|
is more complicated than a single basic block. It also does not work at all
|
|
on some architectures due to restrictions in the <FONT SIZE="-1">CSE</FONT> pass.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This optimization is enabled by default.
|
|
<DT id="919"><B>-fvariable-expansion-in-unroller</B><DD>
|
|
|
|
|
|
With this option, the compiler creates multiple copies of some
|
|
local variables when unrolling a loop, which can result in superior code.
|
|
<DT id="920"><B>-fpartial-inlining</B><DD>
|
|
|
|
|
|
Inline parts of functions. This option has any effect only
|
|
when inlining itself is turned on by the <B>-finline-functions</B>
|
|
or <B>-finline-small-functions</B> options.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="921"><B>-fpredictive-commoning</B><DD>
|
|
|
|
|
|
Perform predictive commoning optimization, i.e., reusing computations
|
|
(especially memory loads and stores) performed in previous
|
|
iterations of loops.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is enabled at level <B>-O3</B>.
|
|
It is also enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="922"><B>-fprefetch-loop-arrays</B><DD>
|
|
|
|
|
|
If supported by the target machine, generate instructions to prefetch
|
|
memory to improve the performance of loops that access large arrays.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option may generate better or worse code; results are highly
|
|
dependent on the structure of loops within the source code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Disabled at level <B>-Os</B>.
|
|
<DT id="923"><B>-fno-printf-return-value</B><DD>
|
|
|
|
|
|
Do not substitute constants for known return value of formatted output
|
|
functions such as <TT>"sprintf"</TT>, <TT>"snprintf"</TT>, <TT>"vsprintf"</TT>, and
|
|
<TT>"vsnprintf"</TT> (but not <TT>"printf"</TT> of <TT>"fprintf"</TT>). This
|
|
transformation allows <FONT SIZE="-1">GCC</FONT> to optimize or even eliminate branches based
|
|
on the known return value of these functions called with arguments that
|
|
are either constant, or whose values are known to be in a range that
|
|
makes determining the exact return value possible. For example, when
|
|
<B>-fprintf-return-value</B> is in effect, both the branch and the
|
|
body of the <TT>"if"</TT> statement (but not the call to <TT>"snprint"</TT>)
|
|
can be optimized away when <TT>"i"</TT> is a 32-bit or smaller integer
|
|
because the return value is guaranteed to be at most 8.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
char buf[9];
|
|
if (snprintf (buf, "%08x", i) >= sizeof buf)
|
|
...
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-fprintf-return-value</B> option relies on other optimizations
|
|
and yields best results with <B>-O2</B> and above. It works in tandem
|
|
with the <B>-Wformat-overflow</B> and <B>-Wformat-truncation</B>
|
|
options. The <B>-fprintf-return-value</B> option is enabled by default.
|
|
<DT id="924"><B>-fno-peephole</B><DD>
|
|
|
|
|
|
|
|
<DT id="925"><B>-fno-peephole2</B><DD>
|
|
|
|
|
|
|
|
Disable any machine-specific peephole optimizations. The difference
|
|
between <B>-fno-peephole</B> and <B>-fno-peephole2</B> is in how they
|
|
are implemented in the compiler; some targets use one, some use the
|
|
other, a few use both.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fpeephole</B> is enabled by default.
|
|
<B>-fpeephole2</B> enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="926"><B>-fno-guess-branch-probability</B><DD>
|
|
|
|
|
|
Do not guess branch probabilities using heuristics.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> uses heuristics to guess branch probabilities if they are
|
|
not provided by profiling feedback (<B>-fprofile-arcs</B>). These
|
|
heuristics are based on the control flow graph. If some branch probabilities
|
|
are specified by <TT>"__builtin_expect"</TT>, then the heuristics are
|
|
used to guess branch probabilities for the rest of the control flow graph,
|
|
taking the <TT>"__builtin_expect"</TT> info into account. The interactions
|
|
between the heuristics and <TT>"__builtin_expect"</TT> can be complex, and in
|
|
some cases, it may be useful to disable the heuristics so that the effects
|
|
of <TT>"__builtin_expect"</TT> are easier to understand.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It is also possible to specify expected probability of the expression
|
|
with <TT>"__builtin_expect_with_probability"</TT> built-in function.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-fguess-branch-probability</B> at levels
|
|
<B>-O</B>, <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="927"><B>-freorder-blocks</B><DD>
|
|
|
|
|
|
Reorder basic blocks in the compiled function in order to reduce number of
|
|
taken branches and improve code locality.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O</B>, <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="928"><B>-freorder-blocks-algorithm=</B><I>algorithm</I><DD>
|
|
|
|
|
|
Use the specified algorithm for basic block reordering. The
|
|
<I>algorithm</I> argument can be <B>simple</B>, which does not increase
|
|
code size (except sometimes due to secondary effects like alignment),
|
|
or <B>stc</B>, the ``software trace cache'' algorithm, which tries to
|
|
put all often executed code together, minimizing the number of branches
|
|
executed by making extra copies of code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>simple</B> at levels <B>-O</B>, <B>-Os</B>, and
|
|
<B>stc</B> at levels <B>-O2</B>, <B>-O3</B>.
|
|
<DT id="929"><B>-freorder-blocks-and-partition</B><DD>
|
|
|
|
|
|
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 <I>.o</I> files, to improve
|
|
paging and cache locality performance.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This optimization is automatically turned off in the presence of
|
|
exception handling or unwind tables (on targets using setjump/longjump or target specific scheme), for linkonce sections, for functions with a user-defined
|
|
section attribute and on any architecture that does not support named
|
|
sections. When <B>-fsplit-stack</B> is used this option is not
|
|
enabled by default (to avoid linker errors), but may be enabled
|
|
explicitly (if using a working linker).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled for x86 at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="930"><B>-freorder-functions</B><DD>
|
|
|
|
|
|
Reorder functions in the object file in order to
|
|
improve code locality. This is implemented by using special
|
|
subsections <TT>".text.hot"</TT> for most frequently executed functions and
|
|
<TT>".text.unlikely"</TT> for unlikely executed functions. Reordering is done by
|
|
the linker so object file format must support named sections and linker must
|
|
place them in a reasonable way.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option isn't effective unless you either provide profile feedback
|
|
(see <B>-fprofile-arcs</B> for details) or manually annotate functions with
|
|
<TT>"hot"</TT> or <TT>"cold"</TT> attributes.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="931"><B>-fstrict-aliasing</B><DD>
|
|
|
|
|
|
Allow the compiler to assume the strictest aliasing rules applicable to
|
|
the language being compiled. For C (and C<FONT SIZE="-2">++</FONT>), this activates
|
|
optimizations based on the type of expressions. In particular, an
|
|
object of one type is assumed never to reside at the same address as an
|
|
object of a different type, unless the types are almost the same. For
|
|
example, an <TT>"unsigned int"</TT> can alias an <TT>"int"</TT>, but not a
|
|
<TT>"void*"</TT> or a <TT>"double"</TT>. A character type may alias any other
|
|
type.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Pay special attention to code like this:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
union a_union {
|
|
int i;
|
|
double d;
|
|
};
|
|
|
|
int f() {
|
|
union a_union t;
|
|
t.d = 3.0;
|
|
return t.i;
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The practice of reading from a different union member than the one most
|
|
recently written to (called ``type-punning'') is common. Even with
|
|
<B>-fstrict-aliasing</B>, type-punning is allowed, provided the memory
|
|
is accessed through the union type. So, the code above works as
|
|
expected. However, this code might not:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int f() {
|
|
union a_union t;
|
|
int* ip;
|
|
t.d = 3.0;
|
|
ip = &t.i;
|
|
return *ip;
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Similarly, access by taking the address, casting the resulting pointer
|
|
and dereferencing the result has undefined behavior, even if the cast
|
|
uses a union type, e.g.:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int f() {
|
|
double d = 3.0;
|
|
return ((union a_union *) &d)->i;
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-fstrict-aliasing</B> option is enabled at levels
|
|
<B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="932"><B>-falign-functions</B><DD>
|
|
|
|
|
|
|
|
<DT id="933"><B>-falign-functions=</B><I>n</I><DD>
|
|
|
|
|
|
<DT id="934"><B>-falign-functions=</B><I>n</I><B>:</B><I>m</I><DD>
|
|
|
|
|
|
<DT id="935"><B>-falign-functions=</B><I>n</I><B>:</B><I>m</I><B>:</B><I>n2</I><DD>
|
|
|
|
|
|
<DT id="936"><B>-falign-functions=</B><I>n</I><B>:</B><I>m</I><B>:</B><I>n2</I><B>:</B><I>m2</I><DD>
|
|
|
|
|
|
|
|
Align the start of functions to the next power-of-two greater than
|
|
<I>n</I>, skipping up to <I>m</I>-1 bytes. This ensures that at least
|
|
the first <I>m</I> bytes of the function can be fetched by the <FONT SIZE="-1">CPU</FONT>
|
|
without crossing an <I>n</I>-byte alignment boundary.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>m</I> is not specified, it defaults to <I>n</I>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Examples: <B>-falign-functions=32</B> aligns functions to the next
|
|
32-byte boundary, <B>-falign-functions=24</B> aligns to the next
|
|
32-byte boundary only if this can be done by skipping 23 bytes or less,
|
|
<B>-falign-functions=32:7</B> aligns to the next
|
|
32-byte boundary only if this can be done by skipping 6 bytes or less.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The second pair of <I>n2</I>:<I>m2</I> values allows you to specify
|
|
a secondary alignment: <B>-falign-functions=64:7:32:3</B> aligns to
|
|
the next 64-byte boundary if this can be done by skipping 6 bytes or less,
|
|
otherwise aligns to the next 32-byte boundary if this can be done
|
|
by skipping 2 bytes or less.
|
|
If <I>m2</I> is not specified, it defaults to <I>n2</I>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Some assemblers only support this flag when <I>n</I> is a power of two;
|
|
in that case, it is rounded up.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fno-align-functions</B> and <B>-falign-functions=1</B> are
|
|
equivalent and mean that functions are not aligned.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>n</I> is not specified or is zero, use a machine-dependent default.
|
|
The maximum allowed <I>n</I> option value is 65536.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>.
|
|
<DT id="937"><B>-flimit-function-alignment</B><DD>
|
|
|
|
|
|
If this option is enabled, the compiler tries to avoid unnecessarily
|
|
overaligning functions. It attempts to instruct the assembler to align
|
|
by the amount specified by <B>-falign-functions</B>, but not to
|
|
skip more bytes than the size of the function.
|
|
<DT id="938"><B>-falign-labels</B><DD>
|
|
|
|
|
|
|
|
<DT id="939"><B>-falign-labels=</B><I>n</I><DD>
|
|
|
|
|
|
<DT id="940"><B>-falign-labels=</B><I>n</I><B>:</B><I>m</I><DD>
|
|
|
|
|
|
<DT id="941"><B>-falign-labels=</B><I>n</I><B>:</B><I>m</I><B>:</B><I>n2</I><DD>
|
|
|
|
|
|
<DT id="942"><B>-falign-labels=</B><I>n</I><B>:</B><I>m</I><B>:</B><I>n2</I><B>:</B><I>m2</I><DD>
|
|
|
|
|
|
|
|
Align all branch targets to a power-of-two boundary.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Parameters of this option are analogous to the <B>-falign-functions</B> option.
|
|
<B>-fno-align-labels</B> and <B>-falign-labels=1</B> are
|
|
equivalent and mean that labels are not aligned.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <B>-falign-loops</B> or <B>-falign-jumps</B> are applicable and
|
|
are greater than this value, then their values are used instead.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>n</I> is not specified or is zero, use a machine-dependent default
|
|
which is very likely to be <B>1</B>, meaning no alignment.
|
|
The maximum allowed <I>n</I> option value is 65536.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>.
|
|
<DT id="943"><B>-falign-loops</B><DD>
|
|
|
|
|
|
|
|
<DT id="944"><B>-falign-loops=</B><I>n</I><DD>
|
|
|
|
|
|
<DT id="945"><B>-falign-loops=</B><I>n</I><B>:</B><I>m</I><DD>
|
|
|
|
|
|
<DT id="946"><B>-falign-loops=</B><I>n</I><B>:</B><I>m</I><B>:</B><I>n2</I><DD>
|
|
|
|
|
|
<DT id="947"><B>-falign-loops=</B><I>n</I><B>:</B><I>m</I><B>:</B><I>n2</I><B>:</B><I>m2</I><DD>
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Parameters of this option are analogous to the <B>-falign-functions</B> option.
|
|
<B>-fno-align-loops</B> and <B>-falign-loops=1</B> are
|
|
equivalent and mean that loops are not aligned.
|
|
The maximum allowed <I>n</I> option value is 65536.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>n</I> is not specified or is zero, use a machine-dependent default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>.
|
|
<DT id="948"><B>-falign-jumps</B><DD>
|
|
|
|
|
|
|
|
<DT id="949"><B>-falign-jumps=</B><I>n</I><DD>
|
|
|
|
|
|
<DT id="950"><B>-falign-jumps=</B><I>n</I><B>:</B><I>m</I><DD>
|
|
|
|
|
|
<DT id="951"><B>-falign-jumps=</B><I>n</I><B>:</B><I>m</I><B>:</B><I>n2</I><DD>
|
|
|
|
|
|
<DT id="952"><B>-falign-jumps=</B><I>n</I><B>:</B><I>m</I><B>:</B><I>n2</I><B>:</B><I>m2</I><DD>
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Parameters of this option are analogous to the <B>-falign-functions</B> option.
|
|
<B>-fno-align-jumps</B> and <B>-falign-jumps=1</B> are
|
|
equivalent and mean that loops are not aligned.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>n</I> is not specified or is zero, use a machine-dependent default.
|
|
The maximum allowed <I>n</I> option value is 65536.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>.
|
|
<DT id="953"><B>-funit-at-a-time</B><DD>
|
|
|
|
|
|
This option is left for compatibility reasons. <B>-funit-at-a-time</B>
|
|
has no effect, while <B>-fno-unit-at-a-time</B> implies
|
|
<B>-fno-toplevel-reorder</B> and <B>-fno-section-anchors</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by default.
|
|
<DT id="954"><B>-fno-toplevel-reorder</B><DD>
|
|
|
|
|
|
Do not reorder top-level functions, variables, and <TT>"asm"</TT>
|
|
statements. Output them in the same order that they appear in the
|
|
input file. When this option is used, unreferenced static variables
|
|
are not removed. This option is intended to support existing code
|
|
that relies on a particular ordering. For new code, it is better to
|
|
use attributes when possible.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-ftoplevel-reorder</B> is the default at <B>-O1</B> and higher, and
|
|
also at <B>-O0</B> if <B>-fsection-anchors</B> is explicitly requested.
|
|
Additionally <B>-fno-toplevel-reorder</B> implies
|
|
<B>-fno-section-anchors</B>.
|
|
<DT id="955"><B>-fweb</B><DD>
|
|
|
|
|
|
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
|
|
passes, such as <FONT SIZE="-1">CSE,</FONT> loop optimizer and trivial dead code remover. It can,
|
|
however, make debugging impossible, since variables no longer stay in a
|
|
``home register''.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by default with <B>-funroll-loops</B>.
|
|
<DT id="956"><B>-fwhole-program</B><DD>
|
|
|
|
|
|
Assume that the current compilation unit represents the whole program being
|
|
compiled. All public functions and variables with the exception of <TT>"main"</TT>
|
|
and those merged by attribute <TT>"externally_visible"</TT> become static functions
|
|
and in effect are optimized more aggressively by interprocedural optimizers.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option should not be used in combination with <B>-flto</B>.
|
|
Instead relying on a linker plugin should provide safer and more precise
|
|
information.
|
|
<DT id="957"><B>-flto[=</B><I>n</I><B>]</B><DD>
|
|
|
|
|
|
This option runs the standard link-time optimizer. When invoked
|
|
with source code, it generates <FONT SIZE="-1">GIMPLE</FONT> (one of <FONT SIZE="-1">GCC</FONT>'s internal
|
|
representations) and writes it to special <FONT SIZE="-1">ELF</FONT> sections in the object
|
|
file. When the object files are linked together, all the function
|
|
bodies are read from these <FONT SIZE="-1">ELF</FONT> sections and instantiated as if they
|
|
had been part of the same translation unit.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To use the link-time optimizer, <B>-flto</B> and optimization
|
|
options should be specified at compile time and during the final link.
|
|
It is recommended that you compile all the files participating in the
|
|
same link with the same options and also specify those options at
|
|
link time.
|
|
For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -c -O2 -flto foo.c
|
|
gcc -c -O2 -flto bar.c
|
|
gcc -o myprog -flto -O2 foo.o bar.o
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The first two invocations to <FONT SIZE="-1">GCC</FONT> save a bytecode representation
|
|
of <FONT SIZE="-1">GIMPLE</FONT> into special <FONT SIZE="-1">ELF</FONT> sections inside <I>foo.o</I> and
|
|
<I>bar.o</I>. The final invocation reads the <FONT SIZE="-1">GIMPLE</FONT> bytecode from
|
|
<I>foo.o</I> and <I>bar.o</I>, merges the two files into a single
|
|
internal image, and compiles the result as usual. Since both
|
|
<I>foo.o</I> and <I>bar.o</I> are merged into a single image, this
|
|
causes all the interprocedural analyses and optimizations in <FONT SIZE="-1">GCC</FONT> to
|
|
work across the two files as if they were a single one. This means,
|
|
for example, that the inliner is able to inline functions in
|
|
<I>bar.o</I> into functions in <I>foo.o</I> and vice-versa.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Another (simpler) way to enable link-time optimization is:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -o myprog -flto -O2 foo.c bar.c
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The above generates bytecode for <I>foo.c</I> and <I>bar.c</I>,
|
|
merges them together into a single <FONT SIZE="-1">GIMPLE</FONT> representation and optimizes
|
|
them as usual to produce <I>myprog</I>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The important thing to keep in mind is that to enable link-time
|
|
optimizations you need to use the <FONT SIZE="-1">GCC</FONT> driver to perform the link step.
|
|
<FONT SIZE="-1">GCC</FONT> automatically performs link-time optimization if any of the
|
|
objects involved were compiled with the <B>-flto</B> command-line option.
|
|
You can always override
|
|
the automatic decision to do link-time optimization
|
|
by passing <B>-fno-lto</B> to the link command.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To make whole program optimization effective, it is necessary to make
|
|
certain whole program assumptions. The compiler needs to know
|
|
what functions and variables can be accessed by libraries and runtime
|
|
outside of the link-time optimized unit. When supported by the linker,
|
|
the linker plugin (see <B>-fuse-linker-plugin</B>) passes information
|
|
to the compiler about used and externally visible symbols. When
|
|
the linker plugin is not available, <B>-fwhole-program</B> should be
|
|
used to allow the compiler to make these assumptions, which leads
|
|
to more aggressive optimization decisions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When a file is compiled with <B>-flto</B> without
|
|
<B>-fuse-linker-plugin</B>, the generated object file is larger than
|
|
a regular object file because it contains <FONT SIZE="-1">GIMPLE</FONT> bytecodes and the usual
|
|
final code (see <B>-ffat-lto-objects</B>. This means that
|
|
object files with <FONT SIZE="-1">LTO</FONT> information can be linked as normal object
|
|
files; if <B>-fno-lto</B> is passed to the linker, no
|
|
interprocedural optimizations are applied. Note that when
|
|
<B>-fno-fat-lto-objects</B> is enabled the compile stage is faster
|
|
but you cannot perform a regular, non-LTO link on them.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When producing the final binary, <FONT SIZE="-1">GCC</FONT> only
|
|
applies link-time optimizations to those files that contain bytecode.
|
|
Therefore, you can mix and match object files and libraries with
|
|
<FONT SIZE="-1">GIMPLE</FONT> bytecodes and final object code. <FONT SIZE="-1">GCC</FONT> automatically selects
|
|
which files to optimize in <FONT SIZE="-1">LTO</FONT> mode and which files to link without
|
|
further processing.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Generally, options specified at link time override those
|
|
specified at compile time, although in some cases <FONT SIZE="-1">GCC</FONT> attempts to infer
|
|
link-time options from the settings used to compile the input files.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you do not specify an optimization level option <B>-O</B> at
|
|
link time, then <FONT SIZE="-1">GCC</FONT> uses the highest optimization level
|
|
used when compiling the object files. Note that it is generally
|
|
ineffective to specify an optimization level option only at link time and
|
|
not at compile time, for two reasons. First, compiling without
|
|
optimization suppresses compiler passes that gather information
|
|
needed for effective optimization at link time. Second, some early
|
|
optimization passes can be performed only at compile time and
|
|
not at link time.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
There are some code generation flags preserved by <FONT SIZE="-1">GCC</FONT> when
|
|
generating bytecodes, as they need to be used during the final link.
|
|
Currently, the following options and their settings are taken from
|
|
the first object file that explicitly specifies them:
|
|
<B>-fPIC</B>, <B>-fpic</B>, <B>-fpie</B>, <B>-fcommon</B>,
|
|
<B>-fexceptions</B>, <B>-fnon-call-exceptions</B>, <B>-fgnu-tm</B>
|
|
and all the <B>-m</B> target flags.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Certain ABI-changing flags are required to match in all compilation units,
|
|
and trying to override this at link time with a conflicting value
|
|
is ignored. This includes options such as <B>-freg-struct-return</B>
|
|
and <B>-fpcc-struct-return</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Other options such as <B>-ffp-contract</B>, <B>-fno-strict-overflow</B>,
|
|
<B>-fwrapv</B>, <B>-fno-trapv</B> or <B>-fno-strict-aliasing</B>
|
|
are passed through to the link stage and merged conservatively for
|
|
conflicting translation units. Specifically
|
|
<B>-fno-strict-overflow</B>, <B>-fwrapv</B> and <B>-fno-trapv</B> take
|
|
precedence; and for example <B>-ffp-contract=off</B> takes precedence
|
|
over <B>-ffp-contract=fast</B>. You can override them at link time.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To enable debug info generation you need to supply <B>-g</B> at
|
|
compile-time. If any of the input files at link time were built
|
|
with debug info generation enabled the link will enable debug info
|
|
generation as well. Any elaborate debug info settings
|
|
like the dwarf level <B>-gdwarf-5</B> need to be explicitely repeated
|
|
at the linker command line and mixing different settings in different
|
|
translation units is discouraged.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <FONT SIZE="-1">LTO</FONT> encounters objects with C linkage declared with incompatible
|
|
types in separate translation units to be linked together (undefined
|
|
behavior according to <FONT SIZE="-1">ISO C99 6.2.7</FONT>), a non-fatal diagnostic may be
|
|
issued. The behavior is still undefined at run time. Similar
|
|
diagnostics may be raised for other languages.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Another feature of <FONT SIZE="-1">LTO</FONT> is that it is possible to apply interprocedural
|
|
optimizations on files written in different languages:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -c -flto foo.c
|
|
g++ -c -flto bar.cc
|
|
gfortran -c -flto baz.f90
|
|
g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Notice that the final link is done with <B>g++</B> to get the C<FONT SIZE="-2">++</FONT>
|
|
runtime libraries and <B>-lgfortran</B> is added to get the Fortran
|
|
runtime libraries. In general, when mixing languages in <FONT SIZE="-1">LTO</FONT> mode, you
|
|
should use the same link command options as when mixing languages in a
|
|
regular (non-LTO) compilation.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If object files containing <FONT SIZE="-1">GIMPLE</FONT> bytecode are stored in a library archive, say
|
|
<I>libfoo.a</I>, it is possible to extract and use them in an <FONT SIZE="-1">LTO</FONT> link if you
|
|
are using a linker with plugin support. To create static libraries suitable
|
|
for <FONT SIZE="-1">LTO,</FONT> use <B>gcc-ar</B> and <B>gcc-ranlib</B> instead of <B>ar</B>
|
|
and <B>ranlib</B>;
|
|
to show the symbols of object files with <FONT SIZE="-1">GIMPLE</FONT> bytecode, use
|
|
<B>gcc-nm</B>. Those commands require that <B>ar</B>, <B>ranlib</B>
|
|
and <B>nm</B> have been compiled with plugin support. At link time, use the
|
|
flag <B>-fuse-linker-plugin</B> to ensure that the library participates in
|
|
the <FONT SIZE="-1">LTO</FONT> optimization process:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With the linker plugin enabled, the linker extracts the needed
|
|
<FONT SIZE="-1">GIMPLE</FONT> files from <I>libfoo.a</I> and passes them on to the running <FONT SIZE="-1">GCC</FONT>
|
|
to make them part of the aggregated <FONT SIZE="-1">GIMPLE</FONT> image to be optimized.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you are not using a linker with plugin support and/or do not
|
|
enable the linker plugin, then the objects inside <I>libfoo.a</I>
|
|
are extracted and linked as usual, but they do not participate
|
|
in the <FONT SIZE="-1">LTO</FONT> optimization process. In order to make a static library suitable
|
|
for both <FONT SIZE="-1">LTO</FONT> optimization and usual linkage, compile its object files with
|
|
<B>-flto</B> <B>-ffat-lto-objects</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Link-time optimizations do not require the presence of the whole program to
|
|
operate. If the program does not require any symbols to be exported, it is
|
|
possible to combine <B>-flto</B> and <B>-fwhole-program</B> to allow
|
|
the interprocedural optimizers to use more aggressive assumptions which may
|
|
lead to improved optimization opportunities.
|
|
Use of <B>-fwhole-program</B> is not needed when linker plugin is
|
|
active (see <B>-fuse-linker-plugin</B>).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The current implementation of <FONT SIZE="-1">LTO</FONT> makes no
|
|
attempt to generate bytecode that is portable between different
|
|
types of hosts. The bytecode files are versioned and there is a
|
|
strict version check, so bytecode files generated in one version of
|
|
<FONT SIZE="-1">GCC</FONT> do not work with an older or newer version of <FONT SIZE="-1">GCC.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Link-time optimization does not work well with generation of debugging
|
|
information on systems other than those using a combination of <FONT SIZE="-1">ELF</FONT> and
|
|
<FONT SIZE="-1">DWARF.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you specify the optional <I>n</I>, the optimization and code
|
|
generation done at link time is executed in parallel using <I>n</I>
|
|
parallel jobs by utilizing an installed <B>make</B> program. The
|
|
environment variable <B></B><FONT SIZE="-1"><B>MAKE</B></FONT><B></B> may be used to override the program
|
|
used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can also specify <B>-flto=jobserver</B> to use <FONT SIZE="-1">GNU</FONT> make's
|
|
job server mode to determine the number of parallel jobs. This
|
|
is useful when the Makefile calling <FONT SIZE="-1">GCC</FONT> is already executing in parallel.
|
|
You must prepend a <B>+</B> to the command recipe in the parent Makefile
|
|
for this to work. This option likely only works if <B></B><FONT SIZE="-1"><B>MAKE</B></FONT><B></B> is
|
|
<FONT SIZE="-1">GNU</FONT> make.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Use <B>-flto=auto</B> to use <FONT SIZE="-1">GNU</FONT> make's job server, if available,
|
|
or otherwise fall back to autodetection of the number of <FONT SIZE="-1">CPU</FONT> threads
|
|
present in your system.
|
|
<DT id="958"><B>-flto-partition=</B><I>alg</I><DD>
|
|
|
|
|
|
Specify the partitioning algorithm used by the link-time optimizer.
|
|
The value is either <B>1to1</B> to specify a partitioning mirroring
|
|
the original source files or <B>balanced</B> to specify partitioning
|
|
into equally sized chunks (whenever possible) or <B>max</B> to create
|
|
new partition for every symbol where possible. Specifying <B>none</B>
|
|
as an algorithm disables partitioning and streaming completely.
|
|
The default value is <B>balanced</B>. While <B>1to1</B> can be used
|
|
as an workaround for various code ordering issues, the <B>max</B>
|
|
partitioning is intended for internal testing only.
|
|
The value <B>one</B> specifies that exactly one partition should be
|
|
used while the value <B>none</B> bypasses partitioning and executes
|
|
the link-time optimization step directly from the <FONT SIZE="-1">WPA</FONT> phase.
|
|
<DT id="959"><B>-flto-odr-type-merging</B><DD>
|
|
|
|
|
|
Enable streaming of mangled types names of C<FONT SIZE="-2">++</FONT> types and their unification
|
|
at link time. This increases size of <FONT SIZE="-1">LTO</FONT> object files, but enables
|
|
diagnostics about One Definition Rule violations.
|
|
<DT id="960"><B>-flto-compression-level=</B><I>n</I><DD>
|
|
|
|
|
|
This option specifies the level of compression used for intermediate
|
|
language written to <FONT SIZE="-1">LTO</FONT> object files, and is only meaningful in
|
|
conjunction with <FONT SIZE="-1">LTO</FONT> mode (<B>-flto</B>). Valid
|
|
values are 0 (no compression) to 9 (maximum compression). Values
|
|
outside this range are clamped to either 0 or 9. If the option is not
|
|
given, a default balanced compression setting is used.
|
|
<DT id="961"><B>-fuse-linker-plugin</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">GNU</FONT> ld 2.21 or newer.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option enables the extraction of object files with <FONT SIZE="-1">GIMPLE</FONT> bytecode out
|
|
of library archives. This improves the quality of optimization by exposing
|
|
more code to the link-time optimizer. This information specifies what
|
|
symbols can be accessed externally (by non-LTO object or during dynamic
|
|
linking). Resulting code quality improvements on binaries (and shared
|
|
libraries that use hidden visibility) are similar to <B>-fwhole-program</B>.
|
|
See <B>-flto</B> for a description of the effect of this flag and how to
|
|
use it.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is enabled by default when <FONT SIZE="-1">LTO</FONT> support in <FONT SIZE="-1">GCC</FONT> is enabled
|
|
and <FONT SIZE="-1">GCC</FONT> was configured for use with
|
|
a linker supporting plugins (<FONT SIZE="-1">GNU</FONT> ld 2.21 or newer or gold).
|
|
<DT id="962"><B>-ffat-lto-objects</B><DD>
|
|
|
|
|
|
Fat <FONT SIZE="-1">LTO</FONT> objects are object files that contain both the intermediate language
|
|
and the object code. This makes them usable for both <FONT SIZE="-1">LTO</FONT> linking and normal
|
|
linking. This option is effective only when compiling with <B>-flto</B>
|
|
and is ignored at link time.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fno-fat-lto-objects</B> improves compilation time over plain <FONT SIZE="-1">LTO,</FONT> but
|
|
requires the complete toolchain to be aware of <FONT SIZE="-1">LTO.</FONT> It requires a linker with
|
|
linker plugin support for basic functionality. Additionally,
|
|
<B>nm</B>, <B>ar</B> and <B>ranlib</B>
|
|
need to support linker plugins to allow a full-featured build environment
|
|
(capable of building static libraries etc). <FONT SIZE="-1">GCC</FONT> provides the <B>gcc-ar</B>,
|
|
<B>gcc-nm</B>, <B>gcc-ranlib</B> wrappers to pass the right options
|
|
to these tools. With non fat <FONT SIZE="-1">LTO</FONT> makefiles need to be modified to use them.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that modern binutils provide plugin auto-load mechanism.
|
|
Installing the linker plugin into <I></I>$libdir<I>/bfd-plugins</I> has the same
|
|
effect as usage of the command wrappers (<B>gcc-ar</B>, <B>gcc-nm</B> and
|
|
<B>gcc-ranlib</B>).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-fno-fat-lto-objects</B> on targets with linker plugin
|
|
support.
|
|
<DT id="963"><B>-fcompare-elim</B><DD>
|
|
|
|
|
|
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
|
|
explicit comparison operation.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This pass only applies to certain targets that cannot explicitly represent
|
|
the comparison operation before register allocation is complete.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O</B>, <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="964"><B>-fcprop-registers</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O</B>, <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="965"><B>-fprofile-correction</B><DD>
|
|
|
|
|
|
Profiles collected using an instrumented binary for multi-threaded programs may
|
|
be inconsistent due to missed counter updates. When this option is specified,
|
|
<FONT SIZE="-1">GCC</FONT> uses heuristics to correct or smooth out such inconsistencies. By
|
|
default, <FONT SIZE="-1">GCC</FONT> emits an error message when an inconsistent profile is detected.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is enabled by <B>-fauto-profile</B>.
|
|
<DT id="966"><B>-fprofile-use</B><DD>
|
|
|
|
|
|
|
|
<DT id="967"><B>-fprofile-use=</B><I>path</I><DD>
|
|
|
|
|
|
|
|
Enable profile feedback-directed optimizations,
|
|
and the following optimizations, many of which
|
|
are generally profitable only with profile feedback available:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fbranch-probabilities -fprofile-values
|
|
-funroll-loops -fpeel-loops -ftracer -fvpt
|
|
-finline-functions -fipa-cp -fipa-cp-clone -fipa-bit-cp
|
|
-fpredictive-commoning -fsplit-loops -funswitch-loops
|
|
-fgcse-after-reload -ftree-loop-vectorize -ftree-slp-vectorize
|
|
-fvect-cost-model=dynamic -ftree-loop-distribute-patterns
|
|
-fprofile-reorder-functions</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Before you can use this option, you must first generate profiling information.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
By default, <FONT SIZE="-1">GCC</FONT> emits an error message if the feedback profiles do not
|
|
match the source code. This error can be turned into a warning by using
|
|
<B>-Wno-error=coverage-mismatch</B>. Note this may result in poorly
|
|
optimized code. Additionally, by default, <FONT SIZE="-1">GCC</FONT> also emits a warning message if
|
|
the feedback profiles do not exist (see <B>-Wmissing-profile</B>).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>path</I> is specified, <FONT SIZE="-1">GCC</FONT> looks at the <I>path</I> to find
|
|
the profile feedback data files. See <B>-fprofile-dir</B>.
|
|
<DT id="968"><B>-fauto-profile</B><DD>
|
|
|
|
|
|
|
|
<DT id="969"><B>-fauto-profile=</B><I>path</I><DD>
|
|
|
|
|
|
|
|
Enable sampling-based feedback-directed optimizations,
|
|
and the following optimizations,
|
|
many of which are generally profitable only with profile feedback available:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fbranch-probabilities -fprofile-values
|
|
-funroll-loops -fpeel-loops -ftracer -fvpt
|
|
-finline-functions -fipa-cp -fipa-cp-clone -fipa-bit-cp
|
|
-fpredictive-commoning -fsplit-loops -funswitch-loops
|
|
-fgcse-after-reload -ftree-loop-vectorize -ftree-slp-vectorize
|
|
-fvect-cost-model=dynamic -ftree-loop-distribute-patterns
|
|
-fprofile-correction</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>path</I> is the name of a file containing AutoFDO profile information.
|
|
If omitted, it defaults to <I>fbdata.afdo</I> in the current directory.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Producing an AutoFDO profile data file requires running your program
|
|
with the <B>perf</B> utility on a supported GNU/Linux target system.
|
|
For more information, see <<B><A HREF="https://perf.wiki.kernel.org/">https://perf.wiki.kernel.org/</A></B>>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
E.g.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
perf record -e br_inst_retired:near_taken -b -o perf.data \
|
|
-- your_program
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Then use the <B>create_gcov</B> tool to convert the raw profile data
|
|
to a format that can be used by <FONT SIZE="-1">GCC.</FONT> You must also supply the
|
|
unstripped binary for your program to this tool.
|
|
See <<B><A HREF="https://github.com/google/autofdo">https://github.com/google/autofdo</A></B>>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
E.g.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
create_gcov --binary=your_program.unstripped --profile=perf.data \
|
|
--gcov=profile.afdo
|
|
|
|
</PRE>
|
|
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
The following options control compiler behavior regarding floating-point
|
|
arithmetic. These options trade off between speed and
|
|
correctness. All must be specifically enabled.
|
|
<DL COMPACT>
|
|
<DT id="970"><B>-ffloat-store</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option prevents undesirable excess precision on machines such as
|
|
the 68000 where the floating registers (of the 68881) keep more
|
|
precision than a <TT>"double"</TT> is supposed to have. Similarly for the
|
|
x86 architecture. For most programs, the excess precision does only
|
|
good, but a few programs rely on the precise definition of <FONT SIZE="-1">IEEE</FONT> floating
|
|
point. Use <B>-ffloat-store</B> for such programs, after modifying
|
|
them to store all pertinent intermediate computations into variables.
|
|
<DT id="971"><B>-fexcess-precision=</B><I>style</I><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">IEEE</FONT> standard and interchange floating-point types. By
|
|
default, <B>-fexcess-precision=fast</B> is in effect; this means that
|
|
operations may be carried out in a wider precision than the types specified
|
|
in the source if that would result in faster code, and it is unpredictable
|
|
when rounding to the types specified in the source code takes place.
|
|
When compiling C, if <B>-fexcess-precision=standard</B> is specified then
|
|
excess precision follows the rules specified in <FONT SIZE="-1">ISO C99</FONT>; in particular,
|
|
both casts and assignments cause values to be rounded to their
|
|
semantic types (whereas <B>-ffloat-store</B> only affects
|
|
assignments). This option is enabled by default for C if a strict
|
|
conformance option such as <B>-std=c99</B> is used.
|
|
<B>-ffast-math</B> enables <B>-fexcess-precision=fast</B> by default
|
|
regardless of whether a strict conformance option is used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fexcess-precision=standard</B> is not implemented for languages
|
|
other than C. On the x86, it has no effect if <B>-mfpmath=sse</B>
|
|
or <B>-mfpmath=sse+387</B> is specified; in the former case, <FONT SIZE="-1">IEEE</FONT>
|
|
semantics apply without excess precision, and in the latter, rounding
|
|
is unpredictable.
|
|
<DT id="972"><B>-ffast-math</B><DD>
|
|
|
|
|
|
Sets the options <B>-fno-math-errno</B>, <B>-funsafe-math-optimizations</B>,
|
|
<B>-ffinite-math-only</B>, <B>-fno-rounding-math</B>,
|
|
<B>-fno-signaling-nans</B>, <B>-fcx-limited-range</B> and
|
|
<B>-fexcess-precision=fast</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option causes the preprocessor macro <TT>"__FAST_MATH__"</TT> to be defined.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is not turned on by any <B>-O</B> option besides
|
|
<B>-Ofast</B> since it can result in incorrect output for programs
|
|
that depend on an exact implementation of <FONT SIZE="-1">IEEE</FONT> or <FONT SIZE="-1">ISO</FONT> rules/specifications
|
|
for math functions. It may, however, yield faster code for programs
|
|
that do not require the guarantees of these specifications.
|
|
<DT id="973"><B>-fno-math-errno</B><DD>
|
|
|
|
|
|
Do not set <TT>"errno"</TT> after calling math functions that are executed
|
|
with a single instruction, e.g., <TT>"sqrt"</TT>. A program that relies on
|
|
<FONT SIZE="-1">IEEE</FONT> exceptions for math error handling may want to use this flag
|
|
for speed while maintaining <FONT SIZE="-1">IEEE</FONT> arithmetic compatibility.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is not turned on by any <B>-O</B> option since
|
|
it can result in incorrect output for programs that depend on
|
|
an exact implementation of <FONT SIZE="-1">IEEE</FONT> or <FONT SIZE="-1">ISO</FONT> rules/specifications for
|
|
math functions. It may, however, yield faster code for programs
|
|
that do not require the guarantees of these specifications.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-fmath-errno</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On Darwin systems, the math library never sets <TT>"errno"</TT>. There is
|
|
therefore no reason for the compiler to consider the possibility that
|
|
it might, and <B>-fno-math-errno</B> is the default.
|
|
<DT id="974"><B>-funsafe-math-optimizations</B><DD>
|
|
|
|
|
|
Allow optimizations for floating-point arithmetic that (a) assume
|
|
that arguments and results are valid and (b) may violate <FONT SIZE="-1">IEEE</FONT> or
|
|
<FONT SIZE="-1">ANSI</FONT> standards. When used at link time, it may include libraries
|
|
or startup files that change the default <FONT SIZE="-1">FPU</FONT> control word or other
|
|
similar optimizations.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is not turned on by any <B>-O</B> option since
|
|
it can result in incorrect output for programs that depend on
|
|
an exact implementation of <FONT SIZE="-1">IEEE</FONT> or <FONT SIZE="-1">ISO</FONT> rules/specifications for
|
|
math functions. It may, however, yield faster code for programs
|
|
that do not require the guarantees of these specifications.
|
|
Enables <B>-fno-signed-zeros</B>, <B>-fno-trapping-math</B>,
|
|
<B>-fassociative-math</B> and <B>-freciprocal-math</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-fno-unsafe-math-optimizations</B>.
|
|
<DT id="975"><B>-fassociative-math</B><DD>
|
|
|
|
|
|
Allow re-association of operands in series of floating-point operations.
|
|
This violates the <FONT SIZE="-1">ISO C</FONT> and C<FONT SIZE="-2">++</FONT> language standard by possibly changing
|
|
computation result. <FONT SIZE="-1">NOTE:</FONT> re-ordering may change the sign of zero as
|
|
well as ignore NaNs and inhibit or create underflow or overflow (and
|
|
thus cannot be used on code that relies on rounding behavior like
|
|
<TT>"(x + 2**52) - 2**52"</TT>. May also reorder floating-point comparisons
|
|
and thus may not be used when ordered comparisons are required.
|
|
This option requires that both <B>-fno-signed-zeros</B> and
|
|
<B>-fno-trapping-math</B> be in effect. Moreover, it doesn't make
|
|
much sense with <B>-frounding-math</B>. For Fortran the option
|
|
is automatically enabled when both <B>-fno-signed-zeros</B> and
|
|
<B>-fno-trapping-math</B> are in effect.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-fno-associative-math</B>.
|
|
<DT id="976"><B>-freciprocal-math</B><DD>
|
|
|
|
|
|
Allow the reciprocal of a value to be used instead of dividing by
|
|
the value if this enables optimizations. For example <TT>"x / y"</TT>
|
|
can be replaced with <TT>"x * (1/y)"</TT>, which is useful if <TT>"(1/y)"</TT>
|
|
is subject to common subexpression elimination. Note that this loses
|
|
precision and increases the number of flops operating on the value.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-fno-reciprocal-math</B>.
|
|
<DT id="977"><B>-ffinite-math-only</B><DD>
|
|
|
|
|
|
Allow optimizations for floating-point arithmetic that assume
|
|
that arguments and results are not NaNs or +-Infs.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is not turned on by any <B>-O</B> option since
|
|
it can result in incorrect output for programs that depend on
|
|
an exact implementation of <FONT SIZE="-1">IEEE</FONT> or <FONT SIZE="-1">ISO</FONT> rules/specifications for
|
|
math functions. It may, however, yield faster code for programs
|
|
that do not require the guarantees of these specifications.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-fno-finite-math-only</B>.
|
|
<DT id="978"><B>-fno-signed-zeros</B><DD>
|
|
|
|
|
|
Allow optimizations for floating-point arithmetic that ignore the
|
|
signedness of zero. <FONT SIZE="-1">IEEE</FONT> arithmetic specifies the behavior of
|
|
distinct +0.0 and -0.0 values, which then prohibits simplification
|
|
of expressions such as x+0.0 or 0.0*x (even with <B>-ffinite-math-only</B>).
|
|
This option implies that the sign of a zero result isn't significant.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-fsigned-zeros</B>.
|
|
<DT id="979"><B>-fno-trapping-math</B><DD>
|
|
|
|
|
|
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
|
|
that <B>-fno-signaling-nans</B> be in effect. Setting this option may
|
|
allow faster code if one relies on ``non-stop'' <FONT SIZE="-1">IEEE</FONT> arithmetic, for example.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option should never be turned on by any <B>-O</B> option since
|
|
it can result in incorrect output for programs that depend on
|
|
an exact implementation of <FONT SIZE="-1">IEEE</FONT> or <FONT SIZE="-1">ISO</FONT> rules/specifications for
|
|
math functions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-ftrapping-math</B>.
|
|
<DT id="980"><B>-frounding-math</B><DD>
|
|
|
|
|
|
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
|
|
truncations. This option should be specified for programs that change
|
|
the <FONT SIZE="-1">FP</FONT> rounding mode dynamically, or that may be executed with a
|
|
non-default rounding mode. This option disables constant folding of
|
|
floating-point expressions at compile time (which may be affected by
|
|
rounding mode) and arithmetic transformations that are unsafe in the
|
|
presence of sign-dependent rounding modes.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-fno-rounding-math</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is experimental and does not currently guarantee to
|
|
disable all <FONT SIZE="-1">GCC</FONT> optimizations that are affected by rounding mode.
|
|
Future versions of <FONT SIZE="-1">GCC</FONT> may provide finer control of this setting
|
|
using C99's <TT>"FENV_ACCESS"</TT> pragma. This command-line option
|
|
will be used to specify the default state for <TT>"FENV_ACCESS"</TT>.
|
|
<DT id="981"><B>-fsignaling-nans</B><DD>
|
|
|
|
|
|
Compile code assuming that <FONT SIZE="-1">IEEE</FONT> 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
|
|
signaling NaNs. This option implies <B>-ftrapping-math</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option causes the preprocessor macro <TT>"__SUPPORT_SNAN__"</TT> to
|
|
be defined.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-fno-signaling-nans</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is experimental and does not currently guarantee to
|
|
disable all <FONT SIZE="-1">GCC</FONT> optimizations that affect signaling NaN behavior.
|
|
<DT id="982"><B>-fno-fp-int-builtin-inexact</B><DD>
|
|
|
|
|
|
Do not allow the built-in functions <TT>"ceil"</TT>, <TT>"floor"</TT>,
|
|
<TT>"round"</TT> and <TT>"trunc"</TT>, and their <TT>"float"</TT> and <TT>"long
|
|
double"</TT> variants, to generate code that raises the ``inexact''
|
|
floating-point exception for noninteger arguments. <FONT SIZE="-1">ISO C99</FONT> and C11
|
|
allow these functions to raise the ``inexact'' exception, but <FONT SIZE="-1">ISO/IEC
|
|
TS 18661-1:2014,</FONT> the C bindings to <FONT SIZE="-1">IEEE 754-2008,</FONT> does not allow these
|
|
functions to do so.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-ffp-int-builtin-inexact</B>, allowing the
|
|
exception to be raised. This option does nothing unless
|
|
<B>-ftrapping-math</B> is in effect.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Even if <B>-fno-fp-int-builtin-inexact</B> is used, if the functions
|
|
generate a call to a library function then the ``inexact'' exception
|
|
may be raised if the library implementation does not follow <FONT SIZE="-1">TS 18661.</FONT>
|
|
<DT id="983"><B>-fsingle-precision-constant</B><DD>
|
|
|
|
|
|
Treat floating-point constants as single precision instead of
|
|
implicitly converting them to double-precision constants.
|
|
<DT id="984"><B>-fcx-limited-range</B><DD>
|
|
|
|
|
|
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 <TT>"NaN
|
|
+ I*NaN"</TT>, with an attempt to rescue the situation in that case. The
|
|
default is <B>-fno-cx-limited-range</B>, but is enabled by
|
|
<B>-ffast-math</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option controls the default setting of the <FONT SIZE="-1">ISO C99</FONT>
|
|
<TT>"CX_LIMITED_RANGE"</TT> pragma. Nevertheless, the option applies to
|
|
all languages.
|
|
<DT id="985"><B>-fcx-fortran-rules</B><DD>
|
|
|
|
|
|
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 <TT>"NaN
|
|
+ I*NaN"</TT>, with an attempt to rescue the situation in that case.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-fno-cx-fortran-rules</B>.
|
|
</DL>
|
|
<P>
|
|
|
|
The following options control optimizations that may improve
|
|
performance, but are not enabled by any <B>-O</B> options. This
|
|
section includes experimental options that may produce broken code.
|
|
<DL COMPACT>
|
|
<DT id="986"><B>-fbranch-probabilities</B><DD>
|
|
|
|
|
|
After running a program compiled with <B>-fprofile-arcs</B>,
|
|
you can compile it a second time using
|
|
<B>-fbranch-probabilities</B>, to improve optimizations based on
|
|
the number of times each branch was taken. When a program
|
|
compiled with <B>-fprofile-arcs</B> exits, it saves arc execution
|
|
counts to a file called <I>sourcename.gcda</I> for each source
|
|
file. The information in this data file is very dependent on the
|
|
structure of the generated code, so you must use the same source code
|
|
and the same optimization options for both compilations.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-fbranch-probabilities</B>, <FONT SIZE="-1">GCC</FONT> puts a
|
|
<B></B><FONT SIZE="-1"><B>REG_BR_PROB</B></FONT><B></B> note on each <B></B><FONT SIZE="-1"><B>JUMP_INSN</B></FONT><B></B> and <B></B><FONT SIZE="-1"><B>CALL_INSN</B></FONT><B></B>.
|
|
These can be used to improve optimization. Currently, they are only
|
|
used in one place: in <I>reorg.c</I>, instead of guessing which path a
|
|
branch is most likely to take, the <B></B><FONT SIZE="-1"><B>REG_BR_PROB</B></FONT><B></B> values are used to
|
|
exactly determine which path is taken more often.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="987"><B>-fprofile-values</B><DD>
|
|
|
|
|
|
If combined with <B>-fprofile-arcs</B>, it adds code so that some
|
|
data about values of expressions in the program is gathered.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-fbranch-probabilities</B>, it reads back the data gathered
|
|
from profiling values of expressions for usage in optimizations.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by <B>-fprofile-generate</B>, <B>-fprofile-use</B>, and
|
|
<B>-fauto-profile</B>.
|
|
<DT id="988"><B>-fprofile-reorder-functions</B><DD>
|
|
|
|
|
|
Function reordering based on profile instrumentation collects
|
|
first time of execution of a function and orders these functions
|
|
in ascending order.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled with <B>-fprofile-use</B>.
|
|
<DT id="989"><B>-fvpt</B><DD>
|
|
|
|
|
|
If combined with <B>-fprofile-arcs</B>, this option instructs the compiler
|
|
to add code to gather information about values of expressions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-fbranch-probabilities</B>, it reads back the data gathered
|
|
and actually performs the optimizations based on them.
|
|
Currently the optimizations include specialization of division operations
|
|
using the knowledge about the value of the denominator.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled with <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="990"><B>-frename-registers</B><DD>
|
|
|
|
|
|
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
|
|
debug information format adopted by the target, however, it can
|
|
make debugging impossible, since variables no longer stay in
|
|
a ``home register''.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by default with <B>-funroll-loops</B>.
|
|
<DT id="991"><B>-fschedule-fusion</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled at levels <B>-O2</B>, <B>-O3</B>, <B>-Os</B>.
|
|
<DT id="992"><B>-ftracer</B><DD>
|
|
|
|
|
|
Perform tail duplication to enlarge superblock size. This transformation
|
|
simplifies the control flow of the function allowing other optimizations to do
|
|
a better job.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="993"><B>-funroll-loops</B><DD>
|
|
|
|
|
|
Unroll loops whose number of iterations can be determined at compile time or
|
|
upon entry to the loop. <B>-funroll-loops</B> implies
|
|
<B>-frerun-cse-after-loop</B>, <B>-fweb</B> and <B>-frename-registers</B>.
|
|
It also turns on complete loop peeling (i.e. complete removal of loops with
|
|
a small constant number of iterations). This option makes code larger, and may
|
|
or may not make it run faster.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="994"><B>-funroll-all-loops</B><DD>
|
|
|
|
|
|
Unroll all loops, even if their number of iterations is uncertain when
|
|
the loop is entered. This usually makes programs run more slowly.
|
|
<B>-funroll-all-loops</B> implies the same options as
|
|
<B>-funroll-loops</B>.
|
|
<DT id="995"><B>-fpeel-loops</B><DD>
|
|
|
|
|
|
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
|
|
number of iterations).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by <B>-O3</B>, <B>-fprofile-use</B>, and <B>-fauto-profile</B>.
|
|
<DT id="996"><B>-fmove-loop-invariants</B><DD>
|
|
|
|
|
|
Enables the loop invariant motion pass in the <FONT SIZE="-1">RTL</FONT> loop optimizer. Enabled
|
|
at level <B>-O1</B> and higher, except for <B>-Og</B>.
|
|
<DT id="997"><B>-fsplit-loops</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="998"><B>-funswitch-loops</B><DD>
|
|
|
|
|
|
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).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="999"><B>-fversion-loops-for-strides</B><DD>
|
|
|
|
|
|
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:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
for (int i = 0; i < n; ++i)
|
|
x[i * stride] = ...;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
becomes:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
if (stride == 1)
|
|
for (int i = 0; i < n; ++i)
|
|
x[i] = ...;
|
|
else
|
|
for (int i = 0; i < n; ++i)
|
|
x[i * stride] = ...;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This is particularly useful for assumed-shape arrays in Fortran where
|
|
(for example) it allows better vectorization assuming contiguous accesses.
|
|
This flag is enabled by default at <B>-O3</B>.
|
|
It is also enabled by <B>-fprofile-use</B> and <B>-fauto-profile</B>.
|
|
<DT id="1000"><B>-ffunction-sections</B><DD>
|
|
|
|
|
|
|
|
<DT id="1001"><B>-fdata-sections</B><DD>
|
|
|
|
|
|
|
|
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
|
|
in the output file.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Use these options on systems where the linker can perform optimizations to
|
|
improve locality of reference in the instruction space. Most systems using the
|
|
<FONT SIZE="-1">ELF</FONT> object format have linkers with such optimizations. On <FONT SIZE="-1">AIX,</FONT> the linker
|
|
rearranges sections (CSECTs) based on the call graph. The performance impact
|
|
varies.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Together with a linker garbage collection (linker <B>--gc-sections</B>
|
|
option) these options may lead to smaller statically-linked executables (after
|
|
stripping).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On <FONT SIZE="-1">ELF/DWARF</FONT> systems these options do not degenerate the quality of the debug
|
|
information. There could be issues with other object files/debug info formats.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Only use these options when there are significant benefits from doing so. When
|
|
you specify these options, the assembler and linker create larger object and
|
|
executable files and are also slower. These options affect code generation.
|
|
They prevent optimizations by the compiler and assembler using relative
|
|
locations inside a translation unit since the locations are unknown until
|
|
link time. An example of such an optimization is relaxing calls to short call
|
|
instructions.
|
|
<DT id="1002"><B>-fbranch-target-load-optimize</B><DD>
|
|
|
|
|
|
Perform branch target register load optimization before prologue / epilogue
|
|
threading.
|
|
The use of target registers can typically be exposed only during reload,
|
|
thus hoisting loads out of loops and doing inter-block scheduling needs
|
|
a separate optimization pass.
|
|
<DT id="1003"><B>-fbranch-target-load-optimize2</B><DD>
|
|
|
|
|
|
Perform branch target register load optimization after prologue / epilogue
|
|
threading.
|
|
<DT id="1004"><B>-fbtr-bb-exclusive</B><DD>
|
|
|
|
|
|
When performing branch target register load optimization, don't reuse
|
|
branch target registers within any basic block.
|
|
<DT id="1005"><B>-fstdarg-opt</B><DD>
|
|
|
|
|
|
Optimize the prologue of variadic argument functions with respect to usage of
|
|
those arguments.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">NOTE:</FONT> In Ubuntu 14.10 and later versions,
|
|
<B>-fstack-protector-strong</B> is enabled by default for C,
|
|
C<FONT SIZE="-2">++</FONT>, ObjC, ObjC++, if none of <B>-fno-stack-protector</B>,
|
|
<B>-nostdlib</B>, nor <B>-ffreestanding</B> are found.
|
|
<DT id="1006"><B>-fsection-anchors</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">GOT</FONT> entries and <FONT SIZE="-1">GOT</FONT> accesses on some
|
|
targets.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, the implementation of the following function <TT>"foo"</TT>:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
static int a, b, c;
|
|
int foo (void) { return a + b + c; }
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
usually calculates the addresses of all three variables, but if you
|
|
compile it with <B>-fsection-anchors</B>, it accesses the variables
|
|
from a common anchor point instead. The effect is similar to the
|
|
following pseudocode (which isn't valid C):
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int foo (void)
|
|
{
|
|
register int *xr = &x;
|
|
return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Not all targets support this option.
|
|
<DT id="1007"><B>--param</B> <I>name</I><B>=</B><I>value</I><DD>
|
|
|
|
|
|
In some places, <FONT SIZE="-1">GCC</FONT> uses various constants to control the amount of
|
|
optimization that is done. For example, <FONT SIZE="-1">GCC</FONT> does not inline functions
|
|
that contain more than a certain number of instructions. You can
|
|
control some of these constants on the command line using the
|
|
<B>--param</B> option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The names of specific parameters, and the meaning of the values, are
|
|
tied to the internals of the compiler, and are subject to change
|
|
without notice in future releases.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In order to get minimal, maximal and default value of a parameter,
|
|
one can use <B>--help=param -Q</B> options.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In each case, the <I>value</I> is an integer. The allowable choices for
|
|
<I>name</I> are:
|
|
<DL COMPACT><DT id="1008"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1009"><B>predictable-branch-outcome</B><DD>
|
|
|
|
|
|
When branch is predicted to be taken with probability lower than this threshold
|
|
(in percent), then it is considered well predictable.
|
|
<DT id="1010"><B>max-rtl-if-conversion-insns</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">RTL</FONT> if-conversion tries to remove conditional branches around a block and
|
|
replace them with conditionally executed instructions. This parameter
|
|
gives the maximum number of instructions in a block which should be
|
|
considered for if-conversion. The compiler will
|
|
also use other heuristics to decide whether if-conversion is likely to be
|
|
profitable.
|
|
<DT id="1011"><B>max-rtl-if-conversion-predictable-cost</B><DD>
|
|
|
|
|
|
|
|
<DT id="1012"><B>max-rtl-if-conversion-unpredictable-cost</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">RTL</FONT> if-conversion will try to remove conditional branches around a block
|
|
and replace them with conditionally executed instructions. These parameters
|
|
give the maximum permissible cost for the sequence that would be generated
|
|
by if-conversion depending on whether the branch is statically determined
|
|
to be predictable or not. The units for this parameter are the same as
|
|
those for the <FONT SIZE="-1">GCC</FONT> internal seq_cost metric. The compiler will try to
|
|
provide a reasonable default for this parameter using the <FONT SIZE="-1">BRANCH_COST</FONT>
|
|
target macro.
|
|
<DT id="1013"><B>max-crossjump-edges</B><DD>
|
|
|
|
|
|
The maximum number of incoming edges to consider for cross-jumping.
|
|
The algorithm used by <B>-fcrossjumping</B> is O(N^2) in
|
|
the number of edges incoming to each block. Increasing values mean
|
|
more aggressive optimization, making the compilation time increase with
|
|
probably small improvement in executable size.
|
|
<DT id="1014"><B>min-crossjump-insns</B><DD>
|
|
|
|
|
|
The minimum number of instructions that must be matched at the end
|
|
of two blocks before cross-jumping is performed on them. This
|
|
value is ignored in the case where all instructions in the block being
|
|
cross-jumped from are matched.
|
|
<DT id="1015"><B>max-grow-copy-bb-insns</B><DD>
|
|
|
|
|
|
The maximum code size expansion factor when copying basic blocks
|
|
instead of jumping. The expansion is relative to a jump instruction.
|
|
<DT id="1016"><B>max-goto-duplication-insns</B><DD>
|
|
|
|
|
|
The maximum number of instructions to duplicate to a block that jumps
|
|
to a computed goto. To avoid O(N^2) behavior in a number of
|
|
passes, <FONT SIZE="-1">GCC</FONT> factors computed gotos early in the compilation process,
|
|
and unfactors them as late as possible. Only computed jumps at the
|
|
end of a basic blocks with no more than max-goto-duplication-insns are
|
|
unfactored.
|
|
<DT id="1017"><B>max-delay-slot-insn-search</B><DD>
|
|
|
|
|
|
The maximum number of instructions to consider when looking for an
|
|
instruction to fill a delay slot. If more than this arbitrary number of
|
|
instructions are searched, the time savings from filling the delay slot
|
|
are minimal, so stop searching. Increasing values mean more
|
|
aggressive optimization, making the compilation time increase with probably
|
|
small improvement in execution time.
|
|
<DT id="1018"><B>max-delay-slot-live-search</B><DD>
|
|
|
|
|
|
When trying to fill delay slots, the maximum number of instructions to
|
|
consider when searching for a block with valid live register
|
|
information. Increasing this arbitrarily chosen value means more
|
|
aggressive optimization, increasing the compilation time. This parameter
|
|
should be removed when the delay slot code is rewritten to maintain the
|
|
control-flow graph.
|
|
<DT id="1019"><B>max-gcse-memory</B><DD>
|
|
|
|
|
|
The approximate maximum amount of memory that can be allocated in
|
|
order to perform the global common subexpression elimination
|
|
optimization. If more memory than specified is required, the
|
|
optimization is not done.
|
|
<DT id="1020"><B>max-gcse-insertion-ratio</B><DD>
|
|
|
|
|
|
If the ratio of expression insertions to deletions is larger than this value
|
|
for any expression, then <FONT SIZE="-1">RTL PRE</FONT> inserts or removes the expression and thus
|
|
leaves partially redundant computations in the instruction stream.
|
|
<DT id="1021"><B>max-pending-list-length</B><DD>
|
|
|
|
|
|
The maximum number of pending dependencies scheduling allows
|
|
before flushing the current state and starting over. Large functions
|
|
with few branches or calls can create excessively large lists which
|
|
needlessly consume memory and resources.
|
|
<DT id="1022"><B>max-modulo-backtrack-attempts</B><DD>
|
|
|
|
|
|
The maximum number of backtrack attempts the scheduler should make
|
|
when modulo scheduling a loop. Larger values can exponentially increase
|
|
compilation time.
|
|
<DT id="1023"><B>max-inline-insns-single</B><DD>
|
|
|
|
|
|
Several parameters control the tree inliner used in <FONT SIZE="-1">GCC.</FONT>
|
|
This number sets the maximum number of instructions (counted in <FONT SIZE="-1">GCC</FONT>'s
|
|
internal representation) in a single function that the tree inliner
|
|
considers for inlining. This only affects functions declared
|
|
inline and methods implemented in a class declaration (C<FONT SIZE="-2">++</FONT>).
|
|
<DT id="1024"><B>max-inline-insns-auto</B><DD>
|
|
|
|
|
|
When you use <B>-finline-functions</B> (included in <B>-O3</B>),
|
|
a lot of functions that would otherwise not be considered for inlining
|
|
by the compiler are investigated. To those functions, a different
|
|
(more restrictive) limit compared to functions declared inline can
|
|
be applied.
|
|
<DT id="1025"><B>max-inline-insns-small</B><DD>
|
|
|
|
|
|
This is bound applied to calls which are considered relevant with
|
|
<B>-finline-small-functions</B>.
|
|
<DT id="1026"><B>max-inline-insns-size</B><DD>
|
|
|
|
|
|
This is bound applied to calls which are optimized for size. Small growth
|
|
may be desirable to anticipate optimization oppurtunities exposed by inlining.
|
|
<DT id="1027"><B>uninlined-function-insns</B><DD>
|
|
|
|
|
|
Number of instructions accounted by inliner for function overhead such as
|
|
function prologue and epilogue.
|
|
<DT id="1028"><B>uninlined-function-time</B><DD>
|
|
|
|
|
|
Extra time accounted by inliner for function overhead such as time needed to
|
|
execute function prologue and epilogue
|
|
<DT id="1029"><B>uninlined-thunk-insns</B><DD>
|
|
|
|
|
|
|
|
<DT id="1030"><B>uninlined-thunk-time</B><DD>
|
|
|
|
|
|
|
|
Same as <B>--param uninlined-function-insns</B> and
|
|
<B>--param uninlined-function-time</B> but applied to function thunks
|
|
<DT id="1031"><B>inline-min-speedup</B><DD>
|
|
|
|
|
|
When estimated performance improvement of caller + callee runtime exceeds this
|
|
threshold (in percent), the function can be inlined regardless of the limit on
|
|
<B>--param max-inline-insns-single</B> and <B>--param
|
|
max-inline-insns-auto</B>.
|
|
<DT id="1032"><B>large-function-insns</B><DD>
|
|
|
|
|
|
The limit specifying really large functions. For functions larger than this
|
|
limit after inlining, inlining is constrained by
|
|
<B>--param large-function-growth</B>. This parameter is useful primarily
|
|
to avoid extreme compilation time caused by non-linear algorithms used by the
|
|
back end.
|
|
<DT id="1033"><B>large-function-growth</B><DD>
|
|
|
|
|
|
Specifies maximal growth of large function caused by inlining in percents.
|
|
For example, parameter value 100 limits large function growth to 2.0 times
|
|
the original size.
|
|
<DT id="1034"><B>large-unit-insns</B><DD>
|
|
|
|
|
|
The limit specifying large translation unit. Growth caused by inlining of
|
|
units larger than this limit is limited by <B>--param inline-unit-growth</B>.
|
|
For small units this might be too tight.
|
|
For example, consider a unit consisting of function A
|
|
that is inline and B that just calls A three times. If B is small relative to
|
|
A, the growth of unit is 300\% and yet such inlining is very sane. For very
|
|
large units consisting of small inlineable functions, however, the overall unit
|
|
growth limit is needed to avoid exponential explosion of code size. Thus for
|
|
smaller units, the size is increased to <B>--param large-unit-insns</B>
|
|
before applying <B>--param inline-unit-growth</B>.
|
|
<DT id="1035"><B>inline-unit-growth</B><DD>
|
|
|
|
|
|
Specifies maximal overall growth of the compilation unit caused by inlining.
|
|
For example, parameter value 20 limits unit growth to 1.2 times the original
|
|
size. Cold functions (either marked cold via an attribute or by profile
|
|
feedback) are not accounted into the unit size.
|
|
<DT id="1036"><B>ipcp-unit-growth</B><DD>
|
|
|
|
|
|
Specifies maximal overall growth of the compilation unit caused by
|
|
interprocedural constant propagation. For example, parameter value 10 limits
|
|
unit growth to 1.1 times the original size.
|
|
<DT id="1037"><B>large-stack-frame</B><DD>
|
|
|
|
|
|
The limit specifying large stack frames. While inlining the algorithm is trying
|
|
to not grow past this limit too much.
|
|
<DT id="1038"><B>large-stack-frame-growth</B><DD>
|
|
|
|
|
|
Specifies maximal growth of large stack frames caused by inlining in percents.
|
|
For example, parameter value 1000 limits large stack frame growth to 11 times
|
|
the original size.
|
|
<DT id="1039"><B>max-inline-insns-recursive</B><DD>
|
|
|
|
|
|
|
|
<DT id="1040"><B>max-inline-insns-recursive-auto</B><DD>
|
|
|
|
|
|
|
|
Specifies the maximum number of instructions an out-of-line copy of a
|
|
self-recursive inline
|
|
function can grow into by performing recursive inlining.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>--param max-inline-insns-recursive</B> applies to functions
|
|
declared inline.
|
|
For functions not declared inline, recursive inlining
|
|
happens only when <B>-finline-functions</B> (included in <B>-O3</B>) is
|
|
enabled; <B>--param max-inline-insns-recursive-auto</B> applies instead.
|
|
<DT id="1041"><B>max-inline-recursive-depth</B><DD>
|
|
|
|
|
|
|
|
<DT id="1042"><B>max-inline-recursive-depth-auto</B><DD>
|
|
|
|
|
|
|
|
Specifies the maximum recursion depth used for recursive inlining.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>--param max-inline-recursive-depth</B> applies to functions
|
|
declared inline. For functions not declared inline, recursive inlining
|
|
happens only when <B>-finline-functions</B> (included in <B>-O3</B>) is
|
|
enabled; <B>--param max-inline-recursive-depth-auto</B> applies instead.
|
|
<DT id="1043"><B>min-inline-recursive-probability</B><DD>
|
|
|
|
|
|
Recursive inlining is profitable only for function having deep recursion
|
|
in average and can hurt for function having little recursion depth by
|
|
increasing the prologue size or complexity of function body to other
|
|
optimizers.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When profile feedback is available (see <B>-fprofile-generate</B>) the actual
|
|
recursion depth can be guessed from the probability that function recurses
|
|
via a given call expression. This parameter limits inlining only to call
|
|
expressions whose probability exceeds the given threshold (in percents).
|
|
<DT id="1044"><B>early-inlining-insns</B><DD>
|
|
|
|
|
|
Specify growth that the early inliner can make. In effect it increases
|
|
the amount of inlining for code having a large abstraction penalty.
|
|
<DT id="1045"><B>max-early-inliner-iterations</B><DD>
|
|
|
|
|
|
Limit of iterations of the early inliner. This basically bounds
|
|
the number of nested indirect calls the early inliner can resolve.
|
|
Deeper chains are still handled by late inlining.
|
|
<DT id="1046"><B>comdat-sharing-probability</B><DD>
|
|
|
|
|
|
Probability (in percent) that C<FONT SIZE="-2">++</FONT> inline function with comdat visibility
|
|
are shared across multiple compilation units.
|
|
<DT id="1047"><B>profile-func-internal-id</B><DD>
|
|
|
|
|
|
A parameter to control whether to use function internal id in profile
|
|
database lookup. If the value is 0, the compiler uses an id that
|
|
is based on function assembler name and filename, which makes old profile
|
|
data more tolerant to source changes such as function reordering etc.
|
|
<DT id="1048"><B>min-vect-loop-bound</B><DD>
|
|
|
|
|
|
The minimum number of iterations under which loops are not vectorized
|
|
when <B>-ftree-vectorize</B> is used. The number of iterations after
|
|
vectorization needs to be greater than the value specified by this option
|
|
to allow vectorization.
|
|
<DT id="1049"><B>gcse-cost-distance-ratio</B><DD>
|
|
|
|
|
|
Scaling factor in calculation of maximum distance an expression
|
|
can be moved by <FONT SIZE="-1">GCSE</FONT> optimizations. This is currently supported only in the
|
|
code hoisting pass. The bigger the ratio, the more aggressive code hoisting
|
|
is with simple expressions, i.e., the expressions that have cost
|
|
less than <B>gcse-unrestricted-cost</B>. Specifying 0 disables
|
|
hoisting of simple expressions.
|
|
<DT id="1050"><B>gcse-unrestricted-cost</B><DD>
|
|
|
|
|
|
Cost, roughly measured as the cost of a single typical machine
|
|
instruction, at which <FONT SIZE="-1">GCSE</FONT> optimizations do not constrain
|
|
the distance an expression can travel. This is currently
|
|
supported only in the code hoisting pass. The lesser the cost,
|
|
the more aggressive code hoisting is. Specifying 0
|
|
allows all expressions to travel unrestricted distances.
|
|
<DT id="1051"><B>max-hoist-depth</B><DD>
|
|
|
|
|
|
The depth of search in the dominator tree for expressions to hoist.
|
|
This is used to avoid quadratic behavior in hoisting algorithm.
|
|
The value of 0 does not limit on the search, but may slow down compilation
|
|
of huge functions.
|
|
<DT id="1052"><B>max-tail-merge-comparisons</B><DD>
|
|
|
|
|
|
The maximum amount of similar bbs to compare a bb with. This is used to
|
|
avoid quadratic behavior in tree tail merging.
|
|
<DT id="1053"><B>max-tail-merge-iterations</B><DD>
|
|
|
|
|
|
The maximum amount of iterations of the pass over the function. This is used to
|
|
limit compilation time in tree tail merging.
|
|
<DT id="1054"><B>store-merging-allow-unaligned</B><DD>
|
|
|
|
|
|
Allow the store merging pass to introduce unaligned stores if it is legal to
|
|
do so.
|
|
<DT id="1055"><B>max-stores-to-merge</B><DD>
|
|
|
|
|
|
The maximum number of stores to attempt to merge into wider stores in the store
|
|
merging pass.
|
|
<DT id="1056"><B>max-unrolled-insns</B><DD>
|
|
|
|
|
|
The maximum number of instructions that a loop may have to be unrolled.
|
|
If a loop is unrolled, this parameter also determines how many times
|
|
the loop code is unrolled.
|
|
<DT id="1057"><B>max-average-unrolled-insns</B><DD>
|
|
|
|
|
|
The maximum number of instructions biased by probabilities of their execution
|
|
that a loop may have to be unrolled. If a loop is unrolled,
|
|
this parameter also determines how many times the loop code is unrolled.
|
|
<DT id="1058"><B>max-unroll-times</B><DD>
|
|
|
|
|
|
The maximum number of unrollings of a single loop.
|
|
<DT id="1059"><B>max-peeled-insns</B><DD>
|
|
|
|
|
|
The maximum number of instructions that a loop may have to be peeled.
|
|
If a loop is peeled, this parameter also determines how many times
|
|
the loop code is peeled.
|
|
<DT id="1060"><B>max-peel-times</B><DD>
|
|
|
|
|
|
The maximum number of peelings of a single loop.
|
|
<DT id="1061"><B>max-peel-branches</B><DD>
|
|
|
|
|
|
The maximum number of branches on the hot path through the peeled sequence.
|
|
<DT id="1062"><B>max-completely-peeled-insns</B><DD>
|
|
|
|
|
|
The maximum number of insns of a completely peeled loop.
|
|
<DT id="1063"><B>max-completely-peel-times</B><DD>
|
|
|
|
|
|
The maximum number of iterations of a loop to be suitable for complete peeling.
|
|
<DT id="1064"><B>max-completely-peel-loop-nest-depth</B><DD>
|
|
|
|
|
|
The maximum depth of a loop nest suitable for complete peeling.
|
|
<DT id="1065"><B>max-unswitch-insns</B><DD>
|
|
|
|
|
|
The maximum number of insns of an unswitched loop.
|
|
<DT id="1066"><B>max-unswitch-level</B><DD>
|
|
|
|
|
|
The maximum number of branches unswitched in a single loop.
|
|
<DT id="1067"><B>lim-expensive</B><DD>
|
|
|
|
|
|
The minimum cost of an expensive expression in the loop invariant motion.
|
|
<DT id="1068"><B>iv-consider-all-candidates-bound</B><DD>
|
|
|
|
|
|
Bound on number of candidates for induction variables, below which
|
|
all candidates are considered for each use in induction variable
|
|
optimizations. If there are more candidates than this,
|
|
only the most relevant ones are considered to avoid quadratic time complexity.
|
|
<DT id="1069"><B>iv-max-considered-uses</B><DD>
|
|
|
|
|
|
The induction variable optimizations give up on loops that contain more
|
|
induction variable uses.
|
|
<DT id="1070"><B>iv-always-prune-cand-set-bound</B><DD>
|
|
|
|
|
|
If the number of candidates in the set is smaller than this value,
|
|
always try to remove unnecessary ivs from the set
|
|
when adding a new one.
|
|
<DT id="1071"><B>avg-loop-niter</B><DD>
|
|
|
|
|
|
Average number of iterations of a loop.
|
|
<DT id="1072"><B>dse-max-object-size</B><DD>
|
|
|
|
|
|
Maximum size (in bytes) of objects tracked bytewise by dead store elimination.
|
|
Larger values may result in larger compilation times.
|
|
<DT id="1073"><B>dse-max-alias-queries-per-store</B><DD>
|
|
|
|
|
|
Maximum number of queries into the alias oracle per store.
|
|
Larger values result in larger compilation times and may result in more
|
|
removed dead stores.
|
|
<DT id="1074"><B>scev-max-expr-size</B><DD>
|
|
|
|
|
|
Bound on size of expressions used in the scalar evolutions analyzer.
|
|
Large expressions slow the analyzer.
|
|
<DT id="1075"><B>scev-max-expr-complexity</B><DD>
|
|
|
|
|
|
Bound on the complexity of the expressions in the scalar evolutions analyzer.
|
|
Complex expressions slow the analyzer.
|
|
<DT id="1076"><B>max-tree-if-conversion-phi-args</B><DD>
|
|
|
|
|
|
Maximum number of arguments in a <FONT SIZE="-1">PHI</FONT> supported by <FONT SIZE="-1">TREE</FONT> if conversion
|
|
unless the loop is marked with simd pragma.
|
|
<DT id="1077"><B>vect-max-version-for-alignment-checks</B><DD>
|
|
|
|
|
|
The maximum number of run-time checks that can be performed when
|
|
doing loop versioning for alignment in the vectorizer.
|
|
<DT id="1078"><B>vect-max-version-for-alias-checks</B><DD>
|
|
|
|
|
|
The maximum number of run-time checks that can be performed when
|
|
doing loop versioning for alias in the vectorizer.
|
|
<DT id="1079"><B>vect-max-peeling-for-alignment</B><DD>
|
|
|
|
|
|
The maximum number of loop peels to enhance access alignment
|
|
for vectorizer. Value -1 means no limit.
|
|
<DT id="1080"><B>max-iterations-to-track</B><DD>
|
|
|
|
|
|
The maximum number of iterations of a loop the brute-force algorithm
|
|
for analysis of the number of iterations of the loop tries to evaluate.
|
|
<DT id="1081"><B>hot-bb-count-ws-permille</B><DD>
|
|
|
|
|
|
A basic block profile count is considered hot if it contributes to
|
|
the given permillage (i.e. 0...1000) of the entire profiled execution.
|
|
<DT id="1082"><B>hot-bb-frequency-fraction</B><DD>
|
|
|
|
|
|
Select fraction of the entry block frequency of executions of basic block in
|
|
function given basic block needs to have to be considered hot.
|
|
<DT id="1083"><B>max-predicted-iterations</B><DD>
|
|
|
|
|
|
The maximum number of loop iterations we predict statically. This is useful
|
|
in cases where a function contains a single loop with known bound and
|
|
another loop with unknown bound.
|
|
The known number of iterations is predicted correctly, while
|
|
the unknown number of iterations average to roughly 10. This means that the
|
|
loop without bounds appears artificially cold relative to the other one.
|
|
<DT id="1084"><B>builtin-expect-probability</B><DD>
|
|
|
|
|
|
Control the probability of the expression having the specified value. This
|
|
parameter takes a percentage (i.e. 0 ... 100) as input.
|
|
<DT id="1085"><B>builtin-string-cmp-inline-length</B><DD>
|
|
|
|
|
|
The maximum length of a constant string for a builtin string cmp call
|
|
eligible for inlining.
|
|
<DT id="1086"><B>align-threshold</B><DD>
|
|
|
|
|
|
Select fraction of the maximal frequency of executions of a basic block in
|
|
a function to align the basic block.
|
|
<DT id="1087"><B>align-loop-iterations</B><DD>
|
|
|
|
|
|
A loop expected to iterate at least the selected number of iterations is
|
|
aligned.
|
|
<DT id="1088"><B>tracer-dynamic-coverage</B><DD>
|
|
|
|
|
|
|
|
<DT id="1089"><B>tracer-dynamic-coverage-feedback</B><DD>
|
|
|
|
|
|
|
|
This value is used to limit superblock formation once the given percentage of
|
|
executed instructions is covered. This limits unnecessary code size
|
|
expansion.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>tracer-dynamic-coverage-feedback</B> parameter
|
|
is used only when profile
|
|
feedback is available. The real profiles (as opposed to statically estimated
|
|
ones) are much less balanced allowing the threshold to be larger value.
|
|
<DT id="1090"><B>tracer-max-code-growth</B><DD>
|
|
|
|
|
|
Stop tail duplication once code growth has reached given percentage. This is
|
|
a rather artificial limit, as most of the duplicates are eliminated later in
|
|
cross jumping, so it may be set to much higher values than is the desired code
|
|
growth.
|
|
<DT id="1091"><B>tracer-min-branch-ratio</B><DD>
|
|
|
|
|
|
Stop reverse growth when the reverse probability of best edge is less than this
|
|
threshold (in percent).
|
|
<DT id="1092"><B>tracer-min-branch-probability</B><DD>
|
|
|
|
|
|
|
|
<DT id="1093"><B>tracer-min-branch-probability-feedback</B><DD>
|
|
|
|
|
|
|
|
Stop forward growth if the best edge has probability lower than this
|
|
threshold.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Similarly to <B>tracer-dynamic-coverage</B> two parameters are
|
|
provided. <B>tracer-min-branch-probability-feedback</B> is used for
|
|
compilation with profile feedback and <B>tracer-min-branch-probability</B>
|
|
compilation without. The value for compilation with profile feedback
|
|
needs to be more conservative (higher) in order to make tracer
|
|
effective.
|
|
<DT id="1094"><B>stack-clash-protection-guard-size</B><DD>
|
|
|
|
|
|
Specify the size of the operating system provided stack guard as
|
|
2 raised to <I>num</I> bytes. Higher values may reduce the
|
|
number of explicit probes, but a value larger than the operating system
|
|
provided guard will leave code vulnerable to stack clash style attacks.
|
|
<DT id="1095"><B>stack-clash-protection-probe-interval</B><DD>
|
|
|
|
|
|
Stack clash protection involves probing stack space as it is allocated. This
|
|
param controls the maximum distance between probes into the stack as 2 raised
|
|
to <I>num</I> bytes. Higher values may reduce the number of explicit probes, but a value
|
|
larger than the operating system provided guard will leave code vulnerable to
|
|
stack clash style attacks.
|
|
<DT id="1096"><B>max-cse-path-length</B><DD>
|
|
|
|
|
|
The maximum number of basic blocks on path that <FONT SIZE="-1">CSE</FONT> considers.
|
|
<DT id="1097"><B>max-cse-insns</B><DD>
|
|
|
|
|
|
The maximum number of instructions <FONT SIZE="-1">CSE</FONT> processes before flushing.
|
|
<DT id="1098"><B>ggc-min-expand</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> uses a garbage collector to manage its own memory allocation. This
|
|
parameter specifies the minimum percentage by which the garbage
|
|
collector's heap should be allowed to expand between collections.
|
|
Tuning this may improve compilation speed; it has no effect on code
|
|
generation.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is 30% + 70% * (<FONT SIZE="-1">RAM/1GB</FONT>) with an upper bound of 100% when
|
|
<FONT SIZE="-1">RAM</FONT> >= 1GB. If <TT>"getrlimit"</TT> is available, the notion of ``<FONT SIZE="-1">RAM''</FONT> is
|
|
the smallest of actual <FONT SIZE="-1">RAM</FONT> and <TT>"RLIMIT_DATA"</TT> or <TT>"RLIMIT_AS"</TT>. If
|
|
<FONT SIZE="-1">GCC</FONT> is not able to calculate <FONT SIZE="-1">RAM</FONT> on a particular platform, the lower
|
|
bound of 30% is used. Setting this parameter and
|
|
<B>ggc-min-heapsize</B> to zero causes a full collection to occur at
|
|
every opportunity. This is extremely slow, but can be useful for
|
|
debugging.
|
|
<DT id="1099"><B>ggc-min-heapsize</B><DD>
|
|
|
|
|
|
Minimum size of the garbage collector's heap before it begins bothering
|
|
to collect garbage. The first collection occurs after the heap expands
|
|
by <B>ggc-min-expand</B>% beyond <B>ggc-min-heapsize</B>. Again,
|
|
tuning this may improve compilation speed, and has no effect on code
|
|
generation.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is the smaller of <FONT SIZE="-1">RAM/8, RLIMIT_RSS,</FONT> or a limit that
|
|
tries to ensure that <FONT SIZE="-1">RLIMIT_DATA</FONT> or <FONT SIZE="-1">RLIMIT_AS</FONT> are not exceeded, but
|
|
with a lower bound of 4096 (four megabytes) and an upper bound of
|
|
131072 (128 megabytes). If <FONT SIZE="-1">GCC</FONT> is not able to calculate <FONT SIZE="-1">RAM</FONT> on a
|
|
particular platform, the lower bound is used. Setting this parameter
|
|
very large effectively disables garbage collection. Setting this
|
|
parameter and <B>ggc-min-expand</B> to zero causes a full collection
|
|
to occur at every opportunity.
|
|
<DT id="1100"><B>max-reload-search-insns</B><DD>
|
|
|
|
|
|
The maximum number of instruction reload should look backward for equivalent
|
|
register. Increasing values mean more aggressive optimization, making the
|
|
compilation time increase with probably slightly better performance.
|
|
<DT id="1101"><B>max-cselib-memory-locations</B><DD>
|
|
|
|
|
|
The maximum number of memory locations cselib should take into account.
|
|
Increasing values mean more aggressive optimization, making the compilation time
|
|
increase with probably slightly better performance.
|
|
<DT id="1102"><B>max-sched-ready-insns</B><DD>
|
|
|
|
|
|
The maximum number of instructions ready to be issued the scheduler should
|
|
consider at any given time during the first scheduling pass. Increasing
|
|
values mean more thorough searches, making the compilation time increase
|
|
with probably little benefit.
|
|
<DT id="1103"><B>max-sched-region-blocks</B><DD>
|
|
|
|
|
|
The maximum number of blocks in a region to be considered for
|
|
interblock scheduling.
|
|
<DT id="1104"><B>max-pipeline-region-blocks</B><DD>
|
|
|
|
|
|
The maximum number of blocks in a region to be considered for
|
|
pipelining in the selective scheduler.
|
|
<DT id="1105"><B>max-sched-region-insns</B><DD>
|
|
|
|
|
|
The maximum number of insns in a region to be considered for
|
|
interblock scheduling.
|
|
<DT id="1106"><B>max-pipeline-region-insns</B><DD>
|
|
|
|
|
|
The maximum number of insns in a region to be considered for
|
|
pipelining in the selective scheduler.
|
|
<DT id="1107"><B>min-spec-prob</B><DD>
|
|
|
|
|
|
The minimum probability (in percents) of reaching a source block
|
|
for interblock speculative scheduling.
|
|
<DT id="1108"><B>max-sched-extend-regions-iters</B><DD>
|
|
|
|
|
|
The maximum number of iterations through <FONT SIZE="-1">CFG</FONT> to extend regions.
|
|
A value of 0 disables region extensions.
|
|
<DT id="1109"><B>max-sched-insn-conflict-delay</B><DD>
|
|
|
|
|
|
The maximum conflict delay for an insn to be considered for speculative motion.
|
|
<DT id="1110"><B>sched-spec-prob-cutoff</B><DD>
|
|
|
|
|
|
The minimal probability of speculation success (in percents), so that
|
|
speculative insns are scheduled.
|
|
<DT id="1111"><B>sched-state-edge-prob-cutoff</B><DD>
|
|
|
|
|
|
The minimum probability an edge must have for the scheduler to save its
|
|
state across it.
|
|
<DT id="1112"><B>sched-mem-true-dep-cost</B><DD>
|
|
|
|
|
|
Minimal distance (in <FONT SIZE="-1">CPU</FONT> cycles) between store and load targeting same
|
|
memory locations.
|
|
<DT id="1113"><B>selsched-max-lookahead</B><DD>
|
|
|
|
|
|
The maximum size of the lookahead window of selective scheduling. It is a
|
|
depth of search for available instructions.
|
|
<DT id="1114"><B>selsched-max-sched-times</B><DD>
|
|
|
|
|
|
The maximum number of times that an instruction is scheduled during
|
|
selective scheduling. This is the limit on the number of iterations
|
|
through which the instruction may be pipelined.
|
|
<DT id="1115"><B>selsched-insns-to-rename</B><DD>
|
|
|
|
|
|
The maximum number of best instructions in the ready list that are considered
|
|
for renaming in the selective scheduler.
|
|
<DT id="1116"><B>sms-min-sc</B><DD>
|
|
|
|
|
|
The minimum value of stage count that swing modulo scheduler
|
|
generates.
|
|
<DT id="1117"><B>max-last-value-rtl</B><DD>
|
|
|
|
|
|
The maximum size measured as number of RTLs that can be recorded in an expression
|
|
in combiner for a pseudo register as last known value of that register.
|
|
<DT id="1118"><B>max-combine-insns</B><DD>
|
|
|
|
|
|
The maximum number of instructions the <FONT SIZE="-1">RTL</FONT> combiner tries to combine.
|
|
<DT id="1119"><B>integer-share-limit</B><DD>
|
|
|
|
|
|
Small integer constants can use a shared data structure, reducing the
|
|
compiler's memory usage and increasing its speed. This sets the maximum
|
|
value of a shared integer constant.
|
|
<DT id="1120"><B>ssp-buffer-size</B><DD>
|
|
|
|
|
|
The minimum size of buffers (i.e. arrays) that receive stack smashing
|
|
protection when <B>-fstack-protection</B> is used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This default before Ubuntu 10.10 was ``8''. Currently it is ``4'', to increase
|
|
the number of functions protected by the stack protector.
|
|
<DT id="1121"><B>min-size-for-stack-sharing</B><DD>
|
|
|
|
|
|
The minimum size of variables taking part in stack slot sharing when not
|
|
optimizing.
|
|
<DT id="1122"><B>max-jump-thread-duplication-stmts</B><DD>
|
|
|
|
|
|
Maximum number of statements allowed in a block that needs to be
|
|
duplicated when threading jumps.
|
|
<DT id="1123"><B>max-fields-for-field-sensitive</B><DD>
|
|
|
|
|
|
Maximum number of fields in a structure treated in
|
|
a field sensitive manner during pointer analysis.
|
|
<DT id="1124"><B>prefetch-latency</B><DD>
|
|
|
|
|
|
Estimate on average number of instructions that are executed before
|
|
prefetch finishes. The distance prefetched ahead is proportional
|
|
to this constant. Increasing this number may also lead to less
|
|
streams being prefetched (see <B>simultaneous-prefetches</B>).
|
|
<DT id="1125"><B>simultaneous-prefetches</B><DD>
|
|
|
|
|
|
Maximum number of prefetches that can run at the same time.
|
|
<DT id="1126"><B>l1-cache-line-size</B><DD>
|
|
|
|
|
|
The size of cache line in L1 data cache, in bytes.
|
|
<DT id="1127"><B>l1-cache-size</B><DD>
|
|
|
|
|
|
The size of L1 data cache, in kilobytes.
|
|
<DT id="1128"><B>l2-cache-size</B><DD>
|
|
|
|
|
|
The size of L2 data cache, in kilobytes.
|
|
<DT id="1129"><B>prefetch-dynamic-strides</B><DD>
|
|
|
|
|
|
Whether the loop array prefetch pass should issue software prefetch hints
|
|
for strides that are non-constant. In some cases this may be
|
|
beneficial, though the fact the stride is non-constant may make it
|
|
hard to predict when there is clear benefit to issuing these hints.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Set to 1 if the prefetch hints should be issued for non-constant
|
|
strides. Set to 0 if prefetch hints should be issued only for strides that
|
|
are known to be constant and below <B>prefetch-minimum-stride</B>.
|
|
<DT id="1130"><B>prefetch-minimum-stride</B><DD>
|
|
|
|
|
|
Minimum constant stride, in bytes, to start using prefetch hints for. If
|
|
the stride is less than this threshold, prefetch hints will not be issued.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This setting is useful for processors that have hardware prefetchers, in
|
|
which case there may be conflicts between the hardware prefetchers and
|
|
the software prefetchers. If the hardware prefetchers have a maximum
|
|
stride they can handle, it should be used here to improve the use of
|
|
software prefetchers.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
A value of -1 means we don't have a threshold and therefore
|
|
prefetch hints can be issued for any constant stride.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This setting is only useful for strides that are known and constant.
|
|
<DT id="1131"><B>loop-interchange-max-num-stmts</B><DD>
|
|
|
|
|
|
The maximum number of stmts in a loop to be interchanged.
|
|
<DT id="1132"><B>loop-interchange-stride-ratio</B><DD>
|
|
|
|
|
|
The minimum ratio between stride of two loops for interchange to be profitable.
|
|
<DT id="1133"><B>min-insn-to-prefetch-ratio</B><DD>
|
|
|
|
|
|
The minimum ratio between the number of instructions and the
|
|
number of prefetches to enable prefetching in a loop.
|
|
<DT id="1134"><B>prefetch-min-insn-to-mem-ratio</B><DD>
|
|
|
|
|
|
The minimum ratio between the number of instructions and the
|
|
number of memory references to enable prefetching in a loop.
|
|
<DT id="1135"><B>use-canonical-types</B><DD>
|
|
|
|
|
|
Whether the compiler should use the ``canonical'' type system.
|
|
Should always be 1, which uses a more efficient internal
|
|
mechanism for comparing types in C<FONT SIZE="-2">++</FONT> and Objective-C<FONT SIZE="-2">++</FONT>. However, if
|
|
bugs in the canonical type system are causing compilation failures,
|
|
set this value to 0 to disable canonical types.
|
|
<DT id="1136"><B>switch-conversion-max-branch-ratio</B><DD>
|
|
|
|
|
|
Switch initialization conversion refuses to create arrays that are
|
|
bigger than <B>switch-conversion-max-branch-ratio</B> times the number of
|
|
branches in the switch.
|
|
<DT id="1137"><B>max-partial-antic-length</B><DD>
|
|
|
|
|
|
Maximum length of the partial antic set computed during the tree
|
|
partial redundancy elimination optimization (<B>-ftree-pre</B>) when
|
|
optimizing at <B>-O3</B> and above. For some sorts of source code
|
|
the enhanced partial redundancy elimination optimization can run away,
|
|
consuming all of the memory available on the host machine. This
|
|
parameter sets a limit on the length of the sets that are computed,
|
|
which prevents the runaway behavior. Setting a value of 0 for
|
|
this parameter allows an unlimited set length.
|
|
<DT id="1138"><B>rpo-vn-max-loop-depth</B><DD>
|
|
|
|
|
|
Maximum loop depth that is value-numbered optimistically.
|
|
When the limit hits the innermost
|
|
<I>rpo-vn-max-loop-depth</I> loops and the outermost loop in the
|
|
loop nest are value-numbered optimistically and the remaining ones not.
|
|
<DT id="1139"><B>sccvn-max-alias-queries-per-access</B><DD>
|
|
|
|
|
|
Maximum number of alias-oracle queries we perform when looking for
|
|
redundancies for loads and stores. If this limit is hit the search
|
|
is aborted and the load or store is not considered redundant. The
|
|
number of queries is algorithmically limited to the number of
|
|
stores on all paths from the load to the function entry.
|
|
<DT id="1140"><B>ira-max-loops-num</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">IRA</FONT> uses regional register allocation by default. If a function
|
|
contains more loops than the number given by this parameter, only at most
|
|
the given number of the most frequently-executed loops form regions
|
|
for regional register allocation.
|
|
<DT id="1141"><B>ira-max-conflict-table-size</B><DD>
|
|
|
|
|
|
Although <FONT SIZE="-1">IRA</FONT> uses a sophisticated algorithm to compress the conflict
|
|
table, the table can still require excessive amounts of memory for
|
|
huge functions. If the conflict table for a function could be more
|
|
than the size in <FONT SIZE="-1">MB</FONT> given by this parameter, the register allocator
|
|
instead uses a faster, simpler, and lower-quality
|
|
algorithm that does not require building a pseudo-register conflict table.
|
|
<DT id="1142"><B>ira-loop-reserved-regs</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">IRA</FONT> can be used to evaluate more accurate register pressure in loops
|
|
for decisions to move loop invariants (see <B>-O3</B>). The number
|
|
of available registers reserved for some other purposes is given
|
|
by this parameter. Default of the parameter
|
|
is the best found from numerous experiments.
|
|
<DT id="1143"><B>lra-inheritance-ebb-probability-cutoff</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">LRA</FONT> tries to reuse values reloaded in registers in subsequent insns.
|
|
This optimization is called inheritance. <FONT SIZE="-1">EBB</FONT> is used as a region to
|
|
do this optimization. The parameter defines a minimal fall-through
|
|
edge probability in percentage used to add <FONT SIZE="-1">BB</FONT> to inheritance <FONT SIZE="-1">EBB</FONT> in
|
|
<FONT SIZE="-1">LRA.</FONT> The default value was chosen
|
|
from numerous runs of <FONT SIZE="-1">SPEC2000</FONT> on x86-64.
|
|
<DT id="1144"><B>loop-invariant-max-bbs-in-loop</B><DD>
|
|
|
|
|
|
Loop invariant motion can be very expensive, both in compilation time and
|
|
in amount of needed compile-time memory, with very large loops. Loops
|
|
with more basic blocks than this parameter won't have loop invariant
|
|
motion optimization performed on them.
|
|
<DT id="1145"><B>loop-max-datarefs-for-datadeps</B><DD>
|
|
|
|
|
|
Building data dependencies is expensive for very large loops. This
|
|
parameter limits the number of data references in loops that are
|
|
considered for data dependence analysis. These large loops are no
|
|
handled by the optimizations using loop data dependencies.
|
|
<DT id="1146"><B>max-vartrack-size</B><DD>
|
|
|
|
|
|
Sets a maximum number of hash table slots to use during variable
|
|
tracking dataflow analysis of any function. If this limit is exceeded
|
|
with variable tracking at assignments enabled, analysis for that
|
|
function is retried without it, after removing all debug insns from
|
|
the function. If the limit is exceeded even without debug insns, var
|
|
tracking analysis is completely disabled for the function. Setting
|
|
the parameter to zero makes it unlimited.
|
|
<DT id="1147"><B>max-vartrack-expr-depth</B><DD>
|
|
|
|
|
|
Sets a maximum number of recursion levels when attempting to map
|
|
variable names or debug temporaries to value expressions. This trades
|
|
compilation time for more complete debug information. If this is set too
|
|
low, value expressions that are available and could be represented in
|
|
debug information may end up not being used; setting this higher may
|
|
enable the compiler to find more complex debug expressions, but compile
|
|
time and memory use may grow.
|
|
<DT id="1148"><B>max-debug-marker-count</B><DD>
|
|
|
|
|
|
Sets a threshold on the number of debug markers (e.g. begin stmt
|
|
markers) to avoid complexity explosion at inlining or expanding to <FONT SIZE="-1">RTL.</FONT>
|
|
If a function has more such gimple stmts than the set limit, such stmts
|
|
will be dropped from the inlined copy of a function, and from its <FONT SIZE="-1">RTL</FONT>
|
|
expansion.
|
|
<DT id="1149"><B>min-nondebug-insn-uid</B><DD>
|
|
|
|
|
|
Use uids starting at this parameter for nondebug insns. The range below
|
|
the parameter is reserved exclusively for debug insns created by
|
|
<B>-fvar-tracking-assignments</B>, but debug insns may get
|
|
(non-overlapping) uids above it if the reserved range is exhausted.
|
|
<DT id="1150"><B>ipa-sra-ptr-growth-factor</B><DD>
|
|
|
|
|
|
IPA-SRA replaces a pointer to an aggregate with one or more new
|
|
parameters only when their cumulative size is less or equal to
|
|
<B>ipa-sra-ptr-growth-factor</B> times the size of the original
|
|
pointer parameter.
|
|
<DT id="1151"><B>sra-max-scalarization-size-Ospeed</B><DD>
|
|
|
|
|
|
|
|
<DT id="1152"><B>sra-max-scalarization-size-Osize</B><DD>
|
|
|
|
|
|
|
|
The two Scalar Reduction of Aggregates passes (<FONT SIZE="-1">SRA</FONT> and IPA-SRA) aim to
|
|
replace scalar parts of aggregates with uses of independent scalar
|
|
variables. These parameters control the maximum size, in storage units,
|
|
of aggregate which is considered for replacement when compiling for
|
|
speed
|
|
(<B>sra-max-scalarization-size-Ospeed</B>) or size
|
|
(<B>sra-max-scalarization-size-Osize</B>) respectively.
|
|
<DT id="1153"><B>sra-max-propagations</B><DD>
|
|
|
|
|
|
The maximum number of artificial accesses that Scalar Replacement of
|
|
Aggregates (<FONT SIZE="-1">SRA</FONT>) will track, per one local variable, in order to
|
|
facilitate copy propagation.
|
|
<DT id="1154"><B>tm-max-aggregate-size</B><DD>
|
|
|
|
|
|
When making copies of thread-local variables in a transaction, this
|
|
parameter specifies the size in bytes after which variables are
|
|
saved with the logging functions as opposed to save/restore code
|
|
sequence pairs. This option only applies when using
|
|
<B>-fgnu-tm</B>.
|
|
<DT id="1155"><B>graphite-max-nb-scop-params</B><DD>
|
|
|
|
|
|
To avoid exponential effects in the Graphite loop transforms, the
|
|
number of parameters in a Static Control Part (SCoP) is bounded.
|
|
A value of zero can be used to lift
|
|
the bound. A variable whose value is unknown at compilation time and
|
|
defined outside a SCoP is a parameter of the SCoP.
|
|
<DT id="1156"><B>loop-block-tile-size</B><DD>
|
|
|
|
|
|
Loop blocking or strip mining transforms, enabled with
|
|
<B>-floop-block</B> or <B>-floop-strip-mine</B>, strip mine each
|
|
loop in the loop nest by a given number of iterations. The strip
|
|
length can be changed using the <B>loop-block-tile-size</B>
|
|
parameter.
|
|
<DT id="1157"><B>ipa-cp-value-list-size</B><DD>
|
|
|
|
|
|
IPA-CP attempts to track all possible values and types passed to a function's
|
|
parameter in order to propagate them and perform devirtualization.
|
|
<B>ipa-cp-value-list-size</B> is the maximum number of values and types it
|
|
stores per one formal parameter of a function.
|
|
<DT id="1158"><B>ipa-cp-eval-threshold</B><DD>
|
|
|
|
|
|
IPA-CP calculates its own score of cloning profitability heuristics
|
|
and performs those cloning opportunities with scores that exceed
|
|
<B>ipa-cp-eval-threshold</B>.
|
|
<DT id="1159"><B>ipa-cp-recursion-penalty</B><DD>
|
|
|
|
|
|
Percentage penalty the recursive functions will receive when they
|
|
are evaluated for cloning.
|
|
<DT id="1160"><B>ipa-cp-single-call-penalty</B><DD>
|
|
|
|
|
|
Percentage penalty functions containing a single call to another
|
|
function will receive when they are evaluated for cloning.
|
|
<DT id="1161"><B>ipa-max-agg-items</B><DD>
|
|
|
|
|
|
IPA-CP is also capable to propagate a number of scalar values passed
|
|
in an aggregate. <B>ipa-max-agg-items</B> controls the maximum
|
|
number of such values per one parameter.
|
|
<DT id="1162"><B>ipa-cp-loop-hint-bonus</B><DD>
|
|
|
|
|
|
When IPA-CP determines that a cloning candidate would make the number
|
|
of iterations of a loop known, it adds a bonus of
|
|
<B>ipa-cp-loop-hint-bonus</B> to the profitability score of
|
|
the candidate.
|
|
<DT id="1163"><B>ipa-cp-array-index-hint-bonus</B><DD>
|
|
|
|
|
|
When IPA-CP determines that a cloning candidate would make the index of
|
|
an array access known, it adds a bonus of
|
|
<B>ipa-cp-array-index-hint-bonus</B> to the profitability
|
|
score of the candidate.
|
|
<DT id="1164"><B>ipa-max-aa-steps</B><DD>
|
|
|
|
|
|
During its analysis of function bodies, IPA-CP employs alias analysis
|
|
in order to track values pointed to by function parameters. In order
|
|
not spend too much time analyzing huge functions, it gives up and
|
|
consider all memory clobbered after examining
|
|
<B>ipa-max-aa-steps</B> statements modifying memory.
|
|
<DT id="1165"><B>lto-partitions</B><DD>
|
|
|
|
|
|
Specify desired number of partitions produced during <FONT SIZE="-1">WHOPR</FONT> compilation.
|
|
The number of partitions should exceed the number of CPUs used for compilation.
|
|
<DT id="1166"><B>lto-min-partition</B><DD>
|
|
|
|
|
|
Size of minimal partition for <FONT SIZE="-1">WHOPR</FONT> (in estimated instructions).
|
|
This prevents expenses of splitting very small programs into too many
|
|
partitions.
|
|
<DT id="1167"><B>lto-max-partition</B><DD>
|
|
|
|
|
|
Size of max partition for <FONT SIZE="-1">WHOPR</FONT> (in estimated instructions).
|
|
to provide an upper bound for individual size of partition.
|
|
Meant to be used only with balanced partitioning.
|
|
<DT id="1168"><B>lto-max-streaming-parallelism</B><DD>
|
|
|
|
|
|
Maximal number of parallel processes used for <FONT SIZE="-1">LTO</FONT> streaming.
|
|
<DT id="1169"><B>cxx-max-namespaces-for-diagnostic-help</B><DD>
|
|
|
|
|
|
The maximum number of namespaces to consult for suggestions when C<FONT SIZE="-2">++</FONT>
|
|
name lookup fails for an identifier.
|
|
<DT id="1170"><B>sink-frequency-threshold</B><DD>
|
|
|
|
|
|
The maximum relative execution frequency (in percents) of the target block
|
|
relative to a statement's original block to allow statement sinking of a
|
|
statement. Larger numbers result in more aggressive statement sinking.
|
|
A small positive adjustment is applied for
|
|
statements with memory operands as those are even more profitable so sink.
|
|
<DT id="1171"><B>max-stores-to-sink</B><DD>
|
|
|
|
|
|
The maximum number of conditional store pairs that can be sunk. Set to 0
|
|
if either vectorization (<B>-ftree-vectorize</B>) or if-conversion
|
|
(<B>-ftree-loop-if-convert</B>) is disabled.
|
|
<DT id="1172"><B>allow-store-data-races</B><DD>
|
|
|
|
|
|
Allow optimizers to introduce new data races on stores.
|
|
Set to 1 to allow, otherwise to 0.
|
|
<DT id="1173"><B>case-values-threshold</B><DD>
|
|
|
|
|
|
The smallest number of different values for which it is best to use a
|
|
jump-table instead of a tree of conditional branches. If the value is
|
|
0, use the default for the machine.
|
|
<DT id="1174"><B>tree-reassoc-width</B><DD>
|
|
|
|
|
|
Set the maximum number of instructions executed in parallel in
|
|
reassociated tree. This parameter overrides target dependent
|
|
heuristics used by default if has non zero value.
|
|
<DT id="1175"><B>sched-pressure-algorithm</B><DD>
|
|
|
|
|
|
Choose between the two available implementations of
|
|
<B>-fsched-pressure</B>. Algorithm 1 is the original implementation
|
|
and is the more likely to prevent instructions from being reordered.
|
|
Algorithm 2 was designed to be a compromise between the relatively
|
|
conservative approach taken by algorithm 1 and the rather aggressive
|
|
approach taken by the default scheduler. It relies more heavily on
|
|
having a regular register file and accurate register pressure classes.
|
|
See <I>haifa-sched.c</I> in the <FONT SIZE="-1">GCC</FONT> sources for more details.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default choice depends on the target.
|
|
<DT id="1176"><B>max-slsr-cand-scan</B><DD>
|
|
|
|
|
|
Set the maximum number of existing candidates that are considered when
|
|
seeking a basis for a new straight-line strength reduction candidate.
|
|
<DT id="1177"><B>asan-globals</B><DD>
|
|
|
|
|
|
Enable buffer overflow detection for global objects. This kind
|
|
of protection is enabled by default if you are using
|
|
<B>-fsanitize=address</B> option.
|
|
To disable global objects protection use <B>--param asan-globals=0</B>.
|
|
<DT id="1178"><B>asan-stack</B><DD>
|
|
|
|
|
|
Enable buffer overflow detection for stack objects. This kind of
|
|
protection is enabled by default when using <B>-fsanitize=address</B>.
|
|
To disable stack protection use <B>--param asan-stack=0</B> option.
|
|
<DT id="1179"><B>asan-instrument-reads</B><DD>
|
|
|
|
|
|
Enable buffer overflow detection for memory reads. This kind of
|
|
protection is enabled by default when using <B>-fsanitize=address</B>.
|
|
To disable memory reads protection use
|
|
<B>--param asan-instrument-reads=0</B>.
|
|
<DT id="1180"><B>asan-instrument-writes</B><DD>
|
|
|
|
|
|
Enable buffer overflow detection for memory writes. This kind of
|
|
protection is enabled by default when using <B>-fsanitize=address</B>.
|
|
To disable memory writes protection use
|
|
<B>--param asan-instrument-writes=0</B> option.
|
|
<DT id="1181"><B>asan-memintrin</B><DD>
|
|
|
|
|
|
Enable detection for built-in functions. This kind of protection
|
|
is enabled by default when using <B>-fsanitize=address</B>.
|
|
To disable built-in functions protection use
|
|
<B>--param asan-memintrin=0</B>.
|
|
<DT id="1182"><B>asan-use-after-return</B><DD>
|
|
|
|
|
|
Enable detection of use-after-return. This kind of protection
|
|
is enabled by default when using the <B>-fsanitize=address</B> option.
|
|
To disable it use <B>--param asan-use-after-return=0</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note: By default the check is disabled at run time. To enable it,
|
|
add <TT>"detect_stack_use_after_return=1"</TT> to the environment variable
|
|
<B></B><FONT SIZE="-1"><B>ASAN_OPTIONS</B></FONT><B></B>.
|
|
<DT id="1183"><B>asan-instrumentation-with-call-threshold</B><DD>
|
|
|
|
|
|
If number of memory accesses in function being instrumented
|
|
is greater or equal to this number, use callbacks instead of inline checks.
|
|
E.g. to disable inline code use
|
|
<B>--param asan-instrumentation-with-call-threshold=0</B>.
|
|
<DT id="1184"><B>use-after-scope-direct-emission-threshold</B><DD>
|
|
|
|
|
|
If the size of a local variable in bytes is smaller or equal to this
|
|
number, directly poison (or unpoison) shadow memory instead of using
|
|
run-time callbacks.
|
|
<DT id="1185"><B>max-fsm-thread-path-insns</B><DD>
|
|
|
|
|
|
Maximum number of instructions to copy when duplicating blocks on a
|
|
finite state automaton jump thread path.
|
|
<DT id="1186"><B>max-fsm-thread-length</B><DD>
|
|
|
|
|
|
Maximum number of basic blocks on a finite state automaton jump thread
|
|
path.
|
|
<DT id="1187"><B>max-fsm-thread-paths</B><DD>
|
|
|
|
|
|
Maximum number of new jump thread paths to create for a finite state
|
|
automaton.
|
|
<DT id="1188"><B>parloops-chunk-size</B><DD>
|
|
|
|
|
|
Chunk size of omp schedule for loops parallelized by parloops.
|
|
<DT id="1189"><B>parloops-schedule</B><DD>
|
|
|
|
|
|
Schedule type of omp schedule for loops parallelized by parloops (static,
|
|
dynamic, guided, auto, runtime).
|
|
<DT id="1190"><B>parloops-min-per-thread</B><DD>
|
|
|
|
|
|
The minimum number of iterations per thread of an innermost parallelized
|
|
loop for which the parallelized variant is preferred over the single threaded
|
|
one. Note that for a parallelized loop nest the
|
|
minimum number of iterations of the outermost loop per thread is two.
|
|
<DT id="1191"><B>max-ssa-name-query-depth</B><DD>
|
|
|
|
|
|
Maximum depth of recursion when querying properties of <FONT SIZE="-1">SSA</FONT> names in things
|
|
like fold routines. One level of recursion corresponds to following a
|
|
use-def chain.
|
|
<DT id="1192"><B>hsa-gen-debug-stores</B><DD>
|
|
|
|
|
|
Enable emission of special debug stores within <FONT SIZE="-1">HSA</FONT> kernels which are
|
|
then read and reported by libgomp plugin. Generation of these stores
|
|
is disabled by default, use <B>--param hsa-gen-debug-stores=1</B> to
|
|
enable it.
|
|
<DT id="1193"><B>max-speculative-devirt-maydefs</B><DD>
|
|
|
|
|
|
The maximum number of may-defs we analyze when looking for a must-def
|
|
specifying the dynamic type of an object that invokes a virtual call
|
|
we may be able to devirtualize speculatively.
|
|
<DT id="1194"><B>max-vrp-switch-assertions</B><DD>
|
|
|
|
|
|
The maximum number of assertions to add along the default edge of a switch
|
|
statement during <FONT SIZE="-1">VRP.</FONT>
|
|
<DT id="1195"><B>unroll-jam-min-percent</B><DD>
|
|
|
|
|
|
The minimum percentage of memory references that must be optimized
|
|
away for the unroll-and-jam transformation to be considered profitable.
|
|
<DT id="1196"><B>unroll-jam-max-unroll</B><DD>
|
|
|
|
|
|
The maximum number of times the outer loop should be unrolled by
|
|
the unroll-and-jam transformation.
|
|
<DT id="1197"><B>max-rtl-if-conversion-unpredictable-cost</B><DD>
|
|
|
|
|
|
Maximum permissible cost for the sequence that would be generated
|
|
by the <FONT SIZE="-1">RTL</FONT> if-conversion pass for a branch that is considered unpredictable.
|
|
<DT id="1198"><B>max-variable-expansions-in-unroller</B><DD>
|
|
|
|
|
|
If <B>-fvariable-expansion-in-unroller</B> is used, the maximum number
|
|
of times that an individual variable will be expanded during loop unrolling.
|
|
<DT id="1199"><B>tracer-min-branch-probability-feedback</B><DD>
|
|
|
|
|
|
Stop forward growth if the probability of best edge is less than
|
|
this threshold (in percent). Used when profile feedback is available.
|
|
<DT id="1200"><B>partial-inlining-entry-probability</B><DD>
|
|
|
|
|
|
Maximum probability of the entry <FONT SIZE="-1">BB</FONT> of split region
|
|
(in percent relative to entry <FONT SIZE="-1">BB</FONT> of the function)
|
|
to make partial inlining happen.
|
|
<DT id="1201"><B>max-tracked-strlens</B><DD>
|
|
|
|
|
|
Maximum number of strings for which strlen optimization pass will
|
|
track string lengths.
|
|
<DT id="1202"><B>gcse-after-reload-partial-fraction</B><DD>
|
|
|
|
|
|
The threshold ratio for performing partial redundancy
|
|
elimination after reload.
|
|
<DT id="1203"><B>gcse-after-reload-critical-fraction</B><DD>
|
|
|
|
|
|
The threshold ratio of critical edges execution count that
|
|
permit performing redundancy elimination after reload.
|
|
<DT id="1204"><B>max-loop-header-insns</B><DD>
|
|
|
|
|
|
The maximum number of insns in loop header duplicated
|
|
by the copy loop headers pass.
|
|
<DT id="1205"><B>vect-epilogues-nomask</B><DD>
|
|
|
|
|
|
Enable loop epilogue vectorization using smaller vector size.
|
|
<DT id="1206"><B>slp-max-insns-in-bb</B><DD>
|
|
|
|
|
|
Maximum number of instructions in basic block to be
|
|
considered for <FONT SIZE="-1">SLP</FONT> vectorization.
|
|
<DT id="1207"><B>avoid-fma-max-bits</B><DD>
|
|
|
|
|
|
Maximum number of bits for which we avoid creating FMAs.
|
|
<DT id="1208"><B>sms-loop-average-count-threshold</B><DD>
|
|
|
|
|
|
A threshold on the average loop count considered by the swing modulo scheduler.
|
|
<DT id="1209"><B>sms-dfa-history</B><DD>
|
|
|
|
|
|
The number of cycles the swing modulo scheduler considers when checking
|
|
conflicts using <FONT SIZE="-1">DFA.</FONT>
|
|
<DT id="1210"><B>hot-bb-count-fraction</B><DD>
|
|
|
|
|
|
Select fraction of the maximal count of repetitions of basic block
|
|
in program given basic block needs
|
|
to have to be considered hot (used in non-LTO mode)
|
|
<DT id="1211"><B>max-inline-insns-recursive-auto</B><DD>
|
|
|
|
|
|
The maximum number of instructions non-inline function
|
|
can grow to via recursive inlining.
|
|
<DT id="1212"><B>graphite-allow-codegen-errors</B><DD>
|
|
|
|
|
|
Whether codegen errors should be ICEs when <B>-fchecking</B>.
|
|
<DT id="1213"><B>sms-max-ii-factor</B><DD>
|
|
|
|
|
|
A factor for tuning the upper bound that swing modulo scheduler
|
|
uses for scheduling a loop.
|
|
<DT id="1214"><B>lra-max-considered-reload-pseudos</B><DD>
|
|
|
|
|
|
The max number of reload pseudos which are considered during
|
|
spilling a non-reload pseudo.
|
|
<DT id="1215"><B>max-pow-sqrt-depth</B><DD>
|
|
|
|
|
|
Maximum depth of sqrt chains to use when synthesizing exponentiation
|
|
by a real constant.
|
|
<DT id="1216"><B>max-dse-active-local-stores</B><DD>
|
|
|
|
|
|
Maximum number of active local stores in <FONT SIZE="-1">RTL</FONT> dead store elimination.
|
|
<DT id="1217"><B>asan-instrument-allocas</B><DD>
|
|
|
|
|
|
Enable asan allocas/VLAs protection.
|
|
<DT id="1218"><B>max-iterations-computation-cost</B><DD>
|
|
|
|
|
|
Bound on the cost of an expression to compute the number of iterations.
|
|
<DT id="1219"><B>max-isl-operations</B><DD>
|
|
|
|
|
|
Maximum number of isl operations, 0 means unlimited.
|
|
<DT id="1220"><B>graphite-max-arrays-per-scop</B><DD>
|
|
|
|
|
|
Maximum number of arrays per scop.
|
|
<DT id="1221"><B>max-vartrack-reverse-op-size</B><DD>
|
|
|
|
|
|
Max. size of loc list for which reverse ops should be added.
|
|
<DT id="1222"><B>unlikely-bb-count-fraction</B><DD>
|
|
|
|
|
|
The minimum fraction of profile runs a given basic block execution count
|
|
must be not to be considered unlikely.
|
|
<DT id="1223"><B>tracer-dynamic-coverage-feedback</B><DD>
|
|
|
|
|
|
The percentage of function, weighted by execution frequency,
|
|
that must be covered by trace formation.
|
|
Used when profile feedback is available.
|
|
<DT id="1224"><B>max-inline-recursive-depth-auto</B><DD>
|
|
|
|
|
|
The maximum depth of recursive inlining for non-inline functions.
|
|
<DT id="1225"><B>fsm-scale-path-stmts</B><DD>
|
|
|
|
|
|
Scale factor to apply to the number of statements in a threading path
|
|
when comparing to the number of (scaled) blocks.
|
|
<DT id="1226"><B>fsm-maximum-phi-arguments</B><DD>
|
|
|
|
|
|
Maximum number of arguments a <FONT SIZE="-1">PHI</FONT> may have before the <FONT SIZE="-1">FSM</FONT> threader
|
|
will not try to thread through its block.
|
|
<DT id="1227"><B>uninit-control-dep-attempts</B><DD>
|
|
|
|
|
|
Maximum number of nested calls to search for control dependencies
|
|
during uninitialized variable analysis.
|
|
<DT id="1228"><B>indir-call-topn-profile</B><DD>
|
|
|
|
|
|
Track top N target addresses in indirect-call profile.
|
|
<DT id="1229"><B>max-once-peeled-insns</B><DD>
|
|
|
|
|
|
The maximum number of insns of a peeled loop that rolls only once.
|
|
<DT id="1230"><B>sra-max-scalarization-size-Osize</B><DD>
|
|
|
|
|
|
Maximum size, in storage units, of an aggregate
|
|
which should be considered for scalarization when compiling for size.
|
|
<DT id="1231"><B>fsm-scale-path-blocks</B><DD>
|
|
|
|
|
|
Scale factor to apply to the number of blocks in a threading path
|
|
when comparing to the number of (scaled) statements.
|
|
<DT id="1232"><B>sched-autopref-queue-depth</B><DD>
|
|
|
|
|
|
Hardware autoprefetcher scheduler model control flag.
|
|
Number of lookahead cycles the model looks into; at '
|
|
' only enable instruction sorting heuristic.
|
|
<DT id="1233"><B>loop-versioning-max-inner-insns</B><DD>
|
|
|
|
|
|
The maximum number of instructions that an inner loop can have
|
|
before the loop versioning pass considers it too big to copy.
|
|
<DT id="1234"><B>loop-versioning-max-outer-insns</B><DD>
|
|
|
|
|
|
The maximum number of instructions that an outer loop can have
|
|
before the loop versioning pass considers it too big to copy,
|
|
discounting any instructions in inner loops that directly benefit
|
|
from versioning.
|
|
<DT id="1235"><B>ssa-name-def-chain-limit</B><DD>
|
|
|
|
|
|
The maximum number of <FONT SIZE="-1">SSA_NAME</FONT> assignments to follow in determining
|
|
a property of a variable such as its value. This limits the number
|
|
of iterations or recursive calls <FONT SIZE="-1">GCC</FONT> performs when optimizing certain
|
|
statements or when determining their validity prior to issuing
|
|
diagnostics.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1236"><DD>
|
|
</DL>
|
|
|
|
</DL>
|
|
<A NAME="lbAP"> </A>
|
|
<H3>Program Instrumentation Options</H3>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> supports a number of command-line options that control adding
|
|
run-time instrumentation to the code it normally generates.
|
|
For example, one purpose of instrumentation is collect profiling
|
|
statistics for use in finding program hot spots, code coverage
|
|
analysis, or profile-guided optimizations.
|
|
Another class of program instrumentation is adding run-time checking
|
|
to detect programming errors like invalid pointer
|
|
dereferences or out-of-bounds array accesses, as well as deliberately
|
|
hostile attacks such as stack smashing or C<FONT SIZE="-2">++</FONT> vtable hijacking.
|
|
There is also a general hook which can be used to implement other
|
|
forms of tracing or function-level instrumentation for debug or
|
|
program analysis purposes.
|
|
<DL COMPACT>
|
|
<DT id="1237"><B>-p</B><DD>
|
|
|
|
|
|
|
|
<DT id="1238"><B>-pg</B><DD>
|
|
|
|
|
|
|
|
Generate extra code to write profile information suitable for the
|
|
analysis program <B>prof</B> (for <B>-p</B>) or <B>gprof</B>
|
|
(for <B>-pg</B>). You must use this option when compiling
|
|
the source files you want data about, and you must also use it when
|
|
linking.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can use the function attribute <TT>"no_instrument_function"</TT> to
|
|
suppress profiling of individual functions when compiling with these options.
|
|
<DT id="1239"><B>-fprofile-arcs</B><DD>
|
|
|
|
|
|
Add code so that program flow <I>arcs</I> 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
|
|
constructors with priority support, profiling properly handles constructors,
|
|
destructors and C<FONT SIZE="-2">++</FONT> constructors (and destructors) of classes which are used
|
|
as a type of a global variable.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When the compiled
|
|
program exits it saves this data to a file called
|
|
<I>auxname.gcda</I> for each source file. The data may be used for
|
|
profile-directed optimizations (<B>-fbranch-probabilities</B>), or for
|
|
test coverage analysis (<B>-ftest-coverage</B>). Each object file's
|
|
<I>auxname</I> is generated from the name of the output file, if
|
|
explicitly specified and it is not the final executable, otherwise it is
|
|
the basename of the source file. In both cases any suffix is removed
|
|
(e.g. <I>foo.gcda</I> for input file <I>dir/foo.c</I>, or
|
|
<I>dir/foo.gcda</I> for output file specified as <B>-o dir/foo.o</B>).
|
|
<DT id="1240"><B>--coverage</B><DD>
|
|
|
|
|
|
This option is used to compile and link code instrumented for coverage
|
|
analysis. The option is a synonym for <B>-fprofile-arcs</B>
|
|
<B>-ftest-coverage</B> (when compiling) and <B>-lgcov</B> (when
|
|
linking). See the documentation for those options for more details.
|
|
<DL COMPACT><DT id="1241"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1242">*<DD>
|
|
Compile the source files with <B>-fprofile-arcs</B> plus optimization
|
|
and code generation options. For test coverage analysis, use the
|
|
additional <B>-ftest-coverage</B> option. You do not need to profile
|
|
every source file in a program.
|
|
<DT id="1243">*<DD>
|
|
Compile the source files additionally with <B>-fprofile-abs-path</B>
|
|
to create absolute path names in the <I>.gcno</I> files. This allows
|
|
<B>gcov</B> to find the correct sources in projects where compilations
|
|
occur with different working directories.
|
|
<DT id="1244">*<DD>
|
|
Link your object files with <B>-lgcov</B> or <B>-fprofile-arcs</B>
|
|
(the latter implies the former).
|
|
<DT id="1245">*<DD>
|
|
Run the program on a representative workload to generate the arc profile
|
|
information. This may be repeated any number of times. You can run
|
|
concurrent instances of your program, and provided that the file system
|
|
supports locking, the data files will be correctly updated. Unless
|
|
a strict <FONT SIZE="-1">ISO C</FONT> dialect option is in effect, <TT>"fork"</TT> calls are
|
|
detected and correctly handled without double counting.
|
|
<DT id="1246">*<DD>
|
|
For profile-directed optimizations, compile the source files again with
|
|
the same optimization and code generation options plus
|
|
<B>-fbranch-probabilities</B>.
|
|
<DT id="1247">*<DD>
|
|
For test coverage analysis, use <B>gcov</B> to produce human readable
|
|
information from the <I>.gcno</I> and <I>.gcda</I> files. Refer to the
|
|
<B>gcov</B> documentation for further information.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1248"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-fprofile-arcs</B>, for each function of your program <FONT SIZE="-1">GCC</FONT>
|
|
creates a program flow graph, then finds a spanning tree for the graph.
|
|
Only arcs that are not on the spanning tree have to be instrumented: the
|
|
compiler adds code to count the number of times that these arcs are
|
|
executed. When an arc is the only exit or only entrance to a block, the
|
|
instrumentation code can be added to the block; otherwise, a new basic
|
|
block must be created to hold the instrumentation code.
|
|
</DL>
|
|
|
|
<DT id="1249"><B>-ftest-coverage</B><DD>
|
|
|
|
|
|
Produce a notes file that the <B>gcov</B> code-coverage utility can use to
|
|
show program coverage. Each source file's note file is called
|
|
<I>auxname.gcno</I>. Refer to the <B>-fprofile-arcs</B> option
|
|
above for a description of <I>auxname</I> and instructions on how to
|
|
generate test coverage data. Coverage data matches the source files
|
|
more closely if you do not optimize.
|
|
<DT id="1250"><B>-fprofile-abs-path</B><DD>
|
|
|
|
|
|
Automatically convert relative source file names to absolute path names
|
|
in the <I>.gcno</I> files. This allows <B>gcov</B> to find the correct
|
|
sources in projects where compilations occur with different working
|
|
directories.
|
|
<DT id="1251"><B>-fprofile-dir=</B><I>path</I><DD>
|
|
|
|
|
|
Set the directory to search for the profile data files in to <I>path</I>.
|
|
This option affects only the profile data generated by
|
|
<B>-fprofile-generate</B>, <B>-ftest-coverage</B>, <B>-fprofile-arcs</B>
|
|
and used by <B>-fprofile-use</B> and <B>-fbranch-probabilities</B>
|
|
and its related options. Both absolute and relative paths can be used.
|
|
By default, <FONT SIZE="-1">GCC</FONT> uses the current directory as <I>path</I>, thus the
|
|
profile data file appears in the same directory as the object file.
|
|
In order to prevent the file name clashing, if the object file name is
|
|
not an absolute path, we mangle the absolute path of the
|
|
<I>sourcename.gcda</I> file and use it as the file name of a
|
|
<I>.gcda</I> file.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When an executable is run in a massive parallel environment, it is recommended
|
|
to save profile to different folders. That can be done with variables
|
|
in <I>path</I> that are exported during run-time:
|
|
<DL COMPACT><DT id="1252"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1253"><B></B>%p<B></B><DD>
|
|
|
|
|
|
process <FONT SIZE="-1">ID.</FONT>
|
|
<DT id="1254"><B></B>%q<B>{</B><FONT SIZE="-1"><B>VAR</B></FONT><B>}</B><DD>
|
|
|
|
|
|
value of environment variable <I></I><FONT SIZE="-1"><I>VAR</I></FONT><I></I>
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1255"><DD>
|
|
</DL>
|
|
|
|
<DT id="1256"><B>-fprofile-generate</B><DD>
|
|
|
|
|
|
|
|
<DT id="1257"><B>-fprofile-generate=</B><I>path</I><DD>
|
|
|
|
|
|
|
|
Enable options usually used for instrumenting application to produce
|
|
profile useful for later recompilation with profile feedback based
|
|
optimization. You must use <B>-fprofile-generate</B> both when
|
|
compiling and when linking your program.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The following options are enabled:
|
|
<B>-fprofile-arcs</B>, <B>-fprofile-values</B>,
|
|
<B>-finline-functions</B>, and <B>-fipa-bit-cp</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>path</I> is specified, <FONT SIZE="-1">GCC</FONT> looks at the <I>path</I> to find
|
|
the profile feedback data files. See <B>-fprofile-dir</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To optimize the program based on the collected profile information, use
|
|
<B>-fprofile-use</B>.
|
|
<DT id="1258"><B>-fprofile-update=</B><I>method</I><DD>
|
|
|
|
|
|
Alter the update method for an application instrumented for profile
|
|
feedback based optimization. The <I>method</I> argument should be one of
|
|
<B>single</B>, <B>atomic</B> or <B>prefer-atomic</B>.
|
|
The first one is useful for single-threaded applications,
|
|
while the second one prevents profile corruption by emitting thread-safe code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> When an application does not properly join all threads
|
|
(or creates an detached thread), a profile file can be still corrupted.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Using <B>prefer-atomic</B> would be transformed either to <B>atomic</B>,
|
|
when supported by a target, or to <B>single</B> otherwise. The <FONT SIZE="-1">GCC</FONT> driver
|
|
automatically selects <B>prefer-atomic</B> when <B>-pthread</B>
|
|
is present in the command line.
|
|
<DT id="1259"><B>-fprofile-filter-files=</B><I>regex</I><DD>
|
|
|
|
|
|
Instrument only functions from files where names match
|
|
any regular expression (separated by a semi-colon).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, <B>-fprofile-filter-files=main.c;module.*.c</B> will instrument
|
|
only <I>main.c</I> and all C files starting with 'module'.
|
|
<DT id="1260"><B>-fprofile-exclude-files=</B><I>regex</I><DD>
|
|
|
|
|
|
Instrument only functions from files where names do not match
|
|
all the regular expressions (separated by a semi-colon).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, <B>-fprofile-exclude-files=/usr/*</B> will prevent instrumentation
|
|
of all files that are located in <I>/usr/</I> folder.
|
|
<DT id="1261"><B>-fsanitize=address</B><DD>
|
|
|
|
|
|
Enable AddressSanitizer, a fast memory error detector.
|
|
Memory access instructions are instrumented to detect
|
|
out-of-bounds and use-after-free bugs.
|
|
The option enables <B>-fsanitize-address-use-after-scope</B>.
|
|
See <<B><A HREF="https://github.com/google/sanitizers/wiki/AddressSanitizer">https://github.com/google/sanitizers/wiki/AddressSanitizer</A></B>> for
|
|
more details. The run-time behavior can be influenced using the
|
|
<B></B><FONT SIZE="-1"><B>ASAN_OPTIONS</B></FONT><B></B> environment variable. When set to <TT>"help=1"</TT>,
|
|
the available options are shown at startup of the instrumented program. See
|
|
<<B><A HREF="https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags">https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags</A></B>>
|
|
for a list of supported options.
|
|
The option cannot be combined with <B>-fsanitize=thread</B>.
|
|
<DT id="1262"><B>-fsanitize=kernel-address</B><DD>
|
|
|
|
|
|
Enable AddressSanitizer for Linux kernel.
|
|
See <<B><A HREF="https://github.com/google/kasan/wiki">https://github.com/google/kasan/wiki</A></B>> for more details.
|
|
<DT id="1263"><B>-fsanitize=pointer-compare</B><DD>
|
|
|
|
|
|
Instrument comparison operation (<, <=, >, >=) with pointer operands.
|
|
The option must be combined with either <B>-fsanitize=kernel-address</B> or
|
|
<B>-fsanitize=address</B>
|
|
The option cannot be combined with <B>-fsanitize=thread</B>.
|
|
Note: By default the check is disabled at run time. To enable it,
|
|
add <TT>"detect_invalid_pointer_pairs=2"</TT> to the environment variable
|
|
<B></B><FONT SIZE="-1"><B>ASAN_OPTIONS</B></FONT><B></B>. Using <TT>"detect_invalid_pointer_pairs=1"</TT> detects
|
|
invalid operation only when both pointers are non-null.
|
|
<DT id="1264"><B>-fsanitize=pointer-subtract</B><DD>
|
|
|
|
|
|
Instrument subtraction with pointer operands.
|
|
The option must be combined with either <B>-fsanitize=kernel-address</B> or
|
|
<B>-fsanitize=address</B>
|
|
The option cannot be combined with <B>-fsanitize=thread</B>.
|
|
Note: By default the check is disabled at run time. To enable it,
|
|
add <TT>"detect_invalid_pointer_pairs=2"</TT> to the environment variable
|
|
<B></B><FONT SIZE="-1"><B>ASAN_OPTIONS</B></FONT><B></B>. Using <TT>"detect_invalid_pointer_pairs=1"</TT> detects
|
|
invalid operation only when both pointers are non-null.
|
|
<DT id="1265"><B>-fsanitize=thread</B><DD>
|
|
|
|
|
|
Enable ThreadSanitizer, a fast data race detector.
|
|
Memory access instructions are instrumented to detect
|
|
data race bugs. See <<B><A HREF="https://github.com/google/sanitizers/wiki#threadsanitizer">https://github.com/google/sanitizers/wiki#threadsanitizer</A></B>> for more
|
|
details. The run-time behavior can be influenced using the <B></B><FONT SIZE="-1"><B>TSAN_OPTIONS</B></FONT><B></B>
|
|
environment variable; see
|
|
<<B><A HREF="https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags">https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags</A></B>> for a list of
|
|
supported options.
|
|
The option cannot be combined with <B>-fsanitize=address</B>,
|
|
<B>-fsanitize=leak</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that sanitized atomic builtins cannot throw exceptions when
|
|
operating on invalid memory addresses with non-call exceptions
|
|
(<B>-fnon-call-exceptions</B>).
|
|
<DT id="1266"><B>-fsanitize=leak</B><DD>
|
|
|
|
|
|
Enable LeakSanitizer, a memory leak detector.
|
|
This option only matters for linking of executables and
|
|
the executable is linked against a library that overrides <TT>"malloc"</TT>
|
|
and other allocator functions. See
|
|
<<B><A HREF="https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer">https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer</A></B>> for more
|
|
details. The run-time behavior can be influenced using the
|
|
<B></B><FONT SIZE="-1"><B>LSAN_OPTIONS</B></FONT><B></B> environment variable.
|
|
The option cannot be combined with <B>-fsanitize=thread</B>.
|
|
<DT id="1267"><B>-fsanitize=undefined</B><DD>
|
|
|
|
|
|
Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
|
|
Various computations are instrumented to detect undefined behavior
|
|
at runtime. Current suboptions are:
|
|
<DL COMPACT><DT id="1268"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1269"><B>-fsanitize=shift</B><DD>
|
|
|
|
|
|
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<FONT SIZE="-2">++</FONT>, as well as between <FONT SIZE="-1">ISO C90</FONT> and C99, etc.
|
|
This option has two suboptions, <B>-fsanitize=shift-base</B> and
|
|
<B>-fsanitize=shift-exponent</B>.
|
|
<DT id="1270"><B>-fsanitize=shift-exponent</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="1271"><B>-fsanitize=shift-base</B><DD>
|
|
|
|
|
|
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<FONT SIZE="-2">++</FONT>, as well as between
|
|
<FONT SIZE="-1">ISO C90</FONT> and C99, etc.
|
|
<DT id="1272"><B>-fsanitize=integer-divide-by-zero</B><DD>
|
|
|
|
|
|
Detect integer division by zero as well as <TT>"INT_MIN / -1"</TT> division.
|
|
<DT id="1273"><B>-fsanitize=unreachable</B><DD>
|
|
|
|
|
|
With this option, the compiler turns the <TT>"__builtin_unreachable"</TT>
|
|
call into a diagnostics message call instead. When reaching the
|
|
<TT>"__builtin_unreachable"</TT> call, the behavior is undefined.
|
|
<DT id="1274"><B>-fsanitize=vla-bound</B><DD>
|
|
|
|
|
|
This option instructs the compiler to check that the size of a variable
|
|
length array is positive.
|
|
<DT id="1275"><B>-fsanitize=null</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">NULL</FONT> pointer, or if a reference (possibly an
|
|
rvalue reference) is bound to a <FONT SIZE="-1">NULL</FONT> pointer, or if a method is invoked
|
|
on an object pointed by a <FONT SIZE="-1">NULL</FONT> pointer.
|
|
<DT id="1276"><B>-fsanitize=return</B><DD>
|
|
|
|
|
|
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<FONT SIZE="-2">++</FONT> only.
|
|
<DT id="1277"><B>-fsanitize=signed-integer-overflow</B><DD>
|
|
|
|
|
|
This option enables signed integer overflow checking. We check that
|
|
the result of <TT>"+"</TT>, <TT>"*"</TT>, and both unary and binary <TT>"-"</TT>
|
|
does not overflow in the signed arithmetics. Note, integer promotion
|
|
rules must be taken into account. That is, the following is not an
|
|
overflow:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
signed char a = SCHAR_MAX;
|
|
a++;
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="1278"><B>-fsanitize=bounds</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="1279"><B>-fsanitize=bounds-strict</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="1280"><B>-fsanitize=alignment</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="1281"><B>-fsanitize=object-size</B><DD>
|
|
|
|
|
|
This option enables instrumentation of memory references using the
|
|
<TT>"__builtin_object_size"</TT> function. Various out of bounds pointer
|
|
accesses are detected.
|
|
<DT id="1282"><B>-fsanitize=float-divide-by-zero</B><DD>
|
|
|
|
|
|
Detect floating-point division by zero. Unlike other similar options,
|
|
<B>-fsanitize=float-divide-by-zero</B> is not enabled by
|
|
<B>-fsanitize=undefined</B>, since floating-point division by zero can
|
|
be a legitimate way of obtaining infinities and NaNs.
|
|
<DT id="1283"><B>-fsanitize=float-cast-overflow</B><DD>
|
|
|
|
|
|
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, <B>-fsanitize=float-cast-overflow</B> is
|
|
not enabled by <B>-fsanitize=undefined</B>.
|
|
This option does not work well with <TT>"FE_INVALID"</TT> exceptions enabled.
|
|
<DT id="1284"><B>-fsanitize=nonnull-attribute</B><DD>
|
|
|
|
|
|
This option enables instrumentation of calls, checking whether null values
|
|
are not passed to arguments marked as requiring a non-null value by the
|
|
<TT>"nonnull"</TT> function attribute.
|
|
<DT id="1285"><B>-fsanitize=returns-nonnull-attribute</B><DD>
|
|
|
|
|
|
This option enables instrumentation of return statements in functions
|
|
marked with <TT>"returns_nonnull"</TT> function attribute, to detect returning
|
|
of null values from such functions.
|
|
<DT id="1286"><B>-fsanitize=bool</B><DD>
|
|
|
|
|
|
This option enables instrumentation of loads from bool. If a value other
|
|
than 0/1 is loaded, a run-time error is issued.
|
|
<DT id="1287"><B>-fsanitize=enum</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="1288"><B>-fsanitize=vptr</B><DD>
|
|
|
|
|
|
This option enables instrumentation of C<FONT SIZE="-2">++</FONT> 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.
|
|
<DT id="1289"><B>-fsanitize=pointer-overflow</B><DD>
|
|
|
|
|
|
This option enables instrumentation of pointer arithmetics. If the pointer
|
|
arithmetics overflows, a run-time error is issued.
|
|
<DT id="1290"><B>-fsanitize=builtin</B><DD>
|
|
|
|
|
|
This option enables instrumentation of arguments to selected builtin
|
|
functions. If an invalid value is passed to such arguments, a run-time
|
|
error is issued. E.g. passing 0 as the argument to <TT>"__builtin_ctz"</TT>
|
|
or <TT>"__builtin_clz"</TT> invokes undefined behavior and is diagnosed
|
|
by this option.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1291"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
While <B>-ftrapv</B> causes traps for signed overflows to be emitted,
|
|
<B>-fsanitize=undefined</B> gives a diagnostic message.
|
|
This currently works only for the C family of languages.
|
|
</DL>
|
|
|
|
<DT id="1292"><B>-fno-sanitize=all</B><DD>
|
|
|
|
|
|
This option disables all previously enabled sanitizers.
|
|
<B>-fsanitize=all</B> is not allowed, as some sanitizers cannot be used
|
|
together.
|
|
<DT id="1293"><B>-fasan-shadow-offset=</B><I>number</I><DD>
|
|
|
|
|
|
This option forces <FONT SIZE="-1">GCC</FONT> to use custom shadow offset in AddressSanitizer checks.
|
|
It is useful for experimenting with different shadow memory layouts in
|
|
Kernel AddressSanitizer.
|
|
<DT id="1294"><B>-fsanitize-sections=</B><I>s1</I><B>,</B><I>s2</I><B>,...</B><DD>
|
|
|
|
|
|
Sanitize global variables in selected user-defined sections. <I>si</I> may
|
|
contain wildcards.
|
|
<DT id="1295"><B>-fsanitize-recover</B>[<B>=</B><I>opts</I>]<DD>
|
|
|
|
|
|
<B>-fsanitize-recover=</B> controls error recovery mode for sanitizers
|
|
mentioned in comma-separated list of <I>opts</I>. Enabling this option
|
|
for a sanitizer component causes it to attempt to continue
|
|
running the program as if no error happened. This means multiple
|
|
runtime errors can be reported in a single program run, and the exit
|
|
code of the program may indicate success even when errors
|
|
have been reported. The <B>-fno-sanitize-recover=</B> option
|
|
can be used to alter
|
|
this behavior: only the first detected error is reported
|
|
and program then exits with a non-zero exit code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Currently this feature only works for <B>-fsanitize=undefined</B> (and its suboptions
|
|
except for <B>-fsanitize=unreachable</B> and <B>-fsanitize=return</B>),
|
|
<B>-fsanitize=float-cast-overflow</B>, <B>-fsanitize=float-divide-by-zero</B>,
|
|
<B>-fsanitize=bounds-strict</B>,
|
|
<B>-fsanitize=kernel-address</B> and <B>-fsanitize=address</B>.
|
|
For these sanitizers error recovery is turned on by default,
|
|
except <B>-fsanitize=address</B>, for which this feature is experimental.
|
|
<B>-fsanitize-recover=all</B> and <B>-fno-sanitize-recover=all</B> is also
|
|
accepted, the former enables recovery for all sanitizers that support it,
|
|
the latter disables recovery for all sanitizers that support it.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Even if a recovery mode is turned on the compiler side, it needs to be also
|
|
enabled on the runtime library side, otherwise the failures are still fatal.
|
|
The runtime library defaults to <TT>"halt_on_error=0"</TT> for
|
|
ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
|
|
AddressSanitizer is <TT>"halt_on_error=1"</TT>. This can be overridden through
|
|
setting the <TT>"halt_on_error"</TT> flag in the corresponding environment variable.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Syntax without an explicit <I>opts</I> parameter is deprecated. It is
|
|
equivalent to specifying an <I>opts</I> list of:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="1296"><B>-fsanitize-address-use-after-scope</B><DD>
|
|
|
|
|
|
Enable sanitization of local variables to detect use-after-scope bugs.
|
|
The option sets <B>-fstack-reuse</B> to <B>none</B>.
|
|
<DT id="1297"><B>-fsanitize-undefined-trap-on-error</B><DD>
|
|
|
|
|
|
The <B>-fsanitize-undefined-trap-on-error</B> option instructs the compiler to
|
|
report undefined behavior using <TT>"__builtin_trap"</TT> rather than
|
|
a <TT>"libubsan"</TT> library routine. The advantage of this is that the
|
|
<TT>"libubsan"</TT> library is not needed and is not linked in, so this
|
|
is usable even in freestanding environments.
|
|
<DT id="1298"><B>-fsanitize-coverage=trace-pc</B><DD>
|
|
|
|
|
|
Enable coverage-guided fuzzing code instrumentation.
|
|
Inserts a call to <TT>"__sanitizer_cov_trace_pc"</TT> into every basic block.
|
|
<DT id="1299"><B>-fsanitize-coverage=trace-cmp</B><DD>
|
|
|
|
|
|
Enable dataflow guided fuzzing code instrumentation.
|
|
Inserts a call to <TT>"__sanitizer_cov_trace_cmp1"</TT>,
|
|
<TT>"__sanitizer_cov_trace_cmp2"</TT>, <TT>"__sanitizer_cov_trace_cmp4"</TT> or
|
|
<TT>"__sanitizer_cov_trace_cmp8"</TT> for integral comparison with both operands
|
|
variable or <TT>"__sanitizer_cov_trace_const_cmp1"</TT>,
|
|
<TT>"__sanitizer_cov_trace_const_cmp2"</TT>,
|
|
<TT>"__sanitizer_cov_trace_const_cmp4"</TT> or
|
|
<TT>"__sanitizer_cov_trace_const_cmp8"</TT> for integral comparison with one
|
|
operand constant, <TT>"__sanitizer_cov_trace_cmpf"</TT> or
|
|
<TT>"__sanitizer_cov_trace_cmpd"</TT> for float or double comparisons and
|
|
<TT>"__sanitizer_cov_trace_switch"</TT> for switch statements.
|
|
<DT id="1300"><B>-fcf-protection=</B>[<B>full</B>|<B>branch</B>|<B>return</B>|<B>none</B>|<B>check</B>]<DD>
|
|
|
|
|
|
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,
|
|
indirect jump) are valid. This prevents diverting the flow of control
|
|
to an unexpected target. This is intended to protect against such
|
|
threats as Return-oriented Programming (<FONT SIZE="-1">ROP</FONT>), and similarly
|
|
call/jmp-oriented programming (<FONT SIZE="-1">COP/JOP</FONT>).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The value <TT>"branch"</TT> tells the compiler to implement checking of
|
|
validity of control-flow transfer at the point of indirect branch
|
|
instructions, i.e. call/jmp instructions. The value <TT>"return"</TT>
|
|
implements checking of validity at the point of returning from a
|
|
function. The value <TT>"full"</TT> is an alias for specifying both
|
|
<TT>"branch"</TT> and <TT>"return"</TT>. The value <TT>"none"</TT> turns off
|
|
instrumentation.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The value <TT>"check"</TT> is used for the final link with link-time
|
|
optimization (<FONT SIZE="-1">LTO</FONT>). An error is issued if <FONT SIZE="-1">LTO</FONT> object files are
|
|
compiled with different <B>-fcf-protection</B> values. The
|
|
value <TT>"check"</TT> is ignored at the compile time.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The macro <TT>"__CET__"</TT> is defined when <B>-fcf-protection</B> is
|
|
used. The first bit of <TT>"__CET__"</TT> is set to 1 for the value
|
|
<TT>"branch"</TT> and the second bit of <TT>"__CET__"</TT> is set to 1 for
|
|
the <TT>"return"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can also use the <TT>"nocf_check"</TT> attribute to identify
|
|
which functions and calls should be skipped from instrumentation.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Currently the x86 GNU/Linux target provides an implementation based
|
|
on Intel Control-flow Enforcement Technology (<FONT SIZE="-1">CET</FONT>).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">NOTE:</FONT> In Ubuntu 19.10 and later versions, <B>-fcf-protection</B>
|
|
is enabled by default for C, C<FONT SIZE="-2">++</FONT>, ObjC, ObjC++, if none of
|
|
<B>-fno-cf-protection</B> nor <B>-fcf-protection=*</B> are found.
|
|
<DT id="1301"><B>-fstack-protector</B><DD>
|
|
|
|
|
|
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 <TT>"alloca"</TT>, and
|
|
functions with buffers larger than 8 bytes. The guards are initialized
|
|
when a function is entered and then checked when the function exits.
|
|
If a guard check fails, an error message is printed and the program exits.
|
|
<DT id="1302"><B>-fstack-protector-all</B><DD>
|
|
|
|
|
|
Like <B>-fstack-protector</B> except that all functions are protected.
|
|
<DT id="1303"><B>-fstack-protector-strong</B><DD>
|
|
|
|
|
|
Like <B>-fstack-protector</B> but includes additional functions to
|
|
be protected --- those that have local array definitions, or have
|
|
references to local frame addresses.
|
|
<DT id="1304"><B>-fstack-protector-explicit</B><DD>
|
|
|
|
|
|
Like <B>-fstack-protector</B> but only protects those functions which
|
|
have the <TT>"stack_protect"</TT> attribute.
|
|
<DT id="1305"><B>-fstack-check</B><DD>
|
|
|
|
|
|
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
|
|
a single-threaded environment since stack overflow is automatically
|
|
detected on nearly all systems if there is only one stack.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that this switch does not actually cause checking to be done; the
|
|
operating system or the language runtime must do that. The switch causes
|
|
generation of code to ensure that they see the stack being extended.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can additionally specify a string parameter: <B>no</B> means no
|
|
checking, <B>generic</B> means force the use of old-style checking,
|
|
<B>specific</B> means use the best checking method and is equivalent
|
|
to bare <B>-fstack-check</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Old-style checking is a generic mechanism that requires no specific
|
|
target support in the compiler but comes with the following drawbacks:
|
|
<DL COMPACT><DT id="1306"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1307">1.<DD>
|
|
|
|
|
|
Modified allocation strategy for large objects: they are always
|
|
allocated dynamically if their size exceeds a fixed threshold. Note this
|
|
may change the semantics of some code.
|
|
<DT id="1308">2.<DD>
|
|
|
|
|
|
Fixed limit on the size of the static frame of functions: when it is
|
|
topped by a particular function, stack checking is not reliable and
|
|
a warning is issued by the compiler.
|
|
<DT id="1309">3.<DD>
|
|
|
|
|
|
Inefficiency: because of both the modified allocation strategy and the
|
|
generic implementation, code performance is hampered.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1310"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that old-style stack checking is also the fallback method for
|
|
<B>specific</B> if no target support has been added in the compiler.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fstack-check=</B> is designed for Ada's needs to detect infinite recursion
|
|
and stack overflows. <B>specific</B> is an excellent choice when compiling
|
|
Ada code. It is not generally sufficient to protect against stack-clash
|
|
attacks. To protect against those you want <B>-fstack-clash-protection</B>.
|
|
</DL>
|
|
|
|
<DT id="1311"><B>-fstack-clash-protection</B><DD>
|
|
|
|
|
|
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
|
|
allocations from jumping over any stack guard page provided by the
|
|
operating system.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Most targets do not fully support stack clash protection. However, on
|
|
those targets <B>-fstack-clash-protection</B> will protect dynamic stack
|
|
allocations. <B>-fstack-clash-protection</B> may also provide limited
|
|
protection for static stack allocations if the target supports
|
|
<B>-fstack-check=specific</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">NOTE:</FONT> In Ubuntu 19.10 and later versions,
|
|
<B>-fstack-clash-protection</B> is enabled by default for C,
|
|
C<FONT SIZE="-2">++</FONT>, ObjC, ObjC++, unless <B>-fno-stack-clash-protection</B> is found.
|
|
<DT id="1312"><B>-fstack-limit-register=</B><I>reg</I><DD>
|
|
|
|
|
|
|
|
<DT id="1313"><B>-fstack-limit-symbol=</B><I>sym</I><DD>
|
|
|
|
|
|
<DT id="1314"><B>-fno-stack-limit</B><DD>
|
|
|
|
|
|
|
|
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,
|
|
the signal is raised before the stack overruns the boundary, so
|
|
it is possible to catch the signal without taking special precautions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For instance, if the stack starts at absolute address <B>0x80000000</B>
|
|
and grows downwards, you can use the flags
|
|
<B>-fstack-limit-symbol=__stack_limit</B> and
|
|
<B>-Wl,--defsym,__stack_limit=0x7ffe0000</B> to enforce a stack limit
|
|
of 128KB. Note that this may only work with the <FONT SIZE="-1">GNU</FONT> linker.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can locally override stack limit checking by using the
|
|
<TT>"no_stack_limit"</TT> function attribute.
|
|
<DT id="1315"><B>-fsplit-stack</B><DD>
|
|
|
|
|
|
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
|
|
is most useful when running threaded programs, as it is no longer
|
|
necessary to calculate a good stack size to use for each thread. This
|
|
is currently only implemented for the x86 targets running
|
|
GNU/Linux.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When code compiled with <B>-fsplit-stack</B> calls code compiled
|
|
without <B>-fsplit-stack</B>, there may not be much stack space
|
|
available for the latter code to run. If compiling all code,
|
|
including library code, with <B>-fsplit-stack</B> is not an option,
|
|
then the linker can fix up these calls so that the code compiled
|
|
without <B>-fsplit-stack</B> always has a large stack. Support for
|
|
this is implemented in the gold linker in <FONT SIZE="-1">GNU</FONT> binutils release 2.21
|
|
and later.
|
|
<DT id="1316"><B>-fvtable-verify=</B>[<B>std</B>|<B>preinit</B>|<B>none</B>]<DD>
|
|
|
|
|
|
This option is only available when compiling C<FONT SIZE="-2">++</FONT> code.
|
|
It turns on (or off, if using <B>-fvtable-verify=none</B>) the security
|
|
feature that verifies at run time, for every virtual call, that
|
|
the vtable pointer through which the call is made is valid for the type of
|
|
the object, and has not been corrupted or overwritten. If an invalid vtable
|
|
pointer is detected at run time, an error is reported and execution of the
|
|
program is immediately halted.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option causes run-time data structures to be built at program startup,
|
|
which are used for verifying the vtable pointers.
|
|
The options <B>std</B> and <B>preinit</B>
|
|
control the timing of when these data structures are built. In both cases the
|
|
data structures are built before execution reaches <TT>"main"</TT>. Using
|
|
<B>-fvtable-verify=std</B> causes the data structures to be built after
|
|
shared libraries have been loaded and initialized.
|
|
<B>-fvtable-verify=preinit</B> causes them to be built before shared
|
|
libraries have been loaded and initialized.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If this option appears multiple times in the command line with different
|
|
values specified, <B>none</B> takes highest priority over both <B>std</B> and
|
|
<B>preinit</B>; <B>preinit</B> takes priority over <B>std</B>.
|
|
<DT id="1317"><B>-fvtv-debug</B><DD>
|
|
|
|
|
|
When used in conjunction with <B>-fvtable-verify=std</B> or
|
|
<B>-fvtable-verify=preinit</B>, causes debug versions of the
|
|
runtime functions for the vtable verification feature to be called.
|
|
This flag also causes the compiler to log information about which
|
|
vtable pointers it finds for each class.
|
|
This information is written to a file named <I>vtv_set_ptr_data.log</I>
|
|
in the directory named by the environment variable <B></B><FONT SIZE="-1"><B>VTV_LOGS_DIR</B></FONT><B></B>
|
|
if that is defined or the current working directory otherwise.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note: This feature <I>appends</I> data to the log file. If you want a fresh log
|
|
file, be sure to delete any existing one.
|
|
<DT id="1318"><B>-fvtv-counts</B><DD>
|
|
|
|
|
|
This is a debugging flag. When used in conjunction with
|
|
<B>-fvtable-verify=std</B> or <B>-fvtable-verify=preinit</B>, this
|
|
causes the compiler to keep track of the total number of virtual calls
|
|
it encounters and the number of verifications it inserts. It also
|
|
counts the number of calls to certain run-time library functions
|
|
that it inserts and logs this information for each compilation unit.
|
|
The compiler writes this information to a file named
|
|
<I>vtv_count_data.log</I> in the directory named by the environment
|
|
variable <B></B><FONT SIZE="-1"><B>VTV_LOGS_DIR</B></FONT><B></B> if that is defined or the current working
|
|
directory otherwise. It also counts the size of the vtable pointer sets
|
|
for each class, and writes this information to <I>vtv_class_set_sizes.log</I>
|
|
in the same directory.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note: This feature <I>appends</I> data to the log files. To get fresh log
|
|
files, be sure to delete any existing ones.
|
|
<DT id="1319"><B>-finstrument-functions</B><DD>
|
|
|
|
|
|
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
|
|
function and its call site. (On some platforms,
|
|
<TT>"__builtin_return_address"</TT> does not work beyond the current
|
|
function, so the call site information may not be available to the
|
|
profiling functions otherwise.)
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void __cyg_profile_func_enter (void *this_fn,
|
|
void *call_site);
|
|
void __cyg_profile_func_exit (void *this_fn,
|
|
void *call_site);
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The first argument is the address of the start of the current function,
|
|
which may be looked up exactly in the symbol table.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This instrumentation is also done for functions expanded inline in other
|
|
functions. The profiling calls indicate where, conceptually, the
|
|
inline function is entered and exited. This means that addressable
|
|
versions of such functions must be available. If all your uses of a
|
|
function are expanded inline, this may mean an additional expansion of
|
|
code size. If you use <TT>"extern inline"</TT> in your C code, an
|
|
addressable version of such functions must be provided. (This is
|
|
normally the case anyway, but if you get lucky and the optimizer always
|
|
expands the functions inline, you might have gotten away without
|
|
providing static copies.)
|
|
|
|
|
|
<P>
|
|
|
|
|
|
A function may be given the attribute <TT>"no_instrument_function"</TT>, in
|
|
which case this instrumentation is not done. This can be used, for
|
|
example, for the profiling functions listed above, high-priority
|
|
interrupt routines, and any functions from which the profiling functions
|
|
cannot safely be called (perhaps signal handlers, if the profiling
|
|
routines generate output or allocate memory).
|
|
<DT id="1320"><B>-finstrument-functions-exclude-file-list=</B><I>file</I><B>,</B><I>file</I><B>,...</B><DD>
|
|
|
|
|
|
Set the list of functions that are excluded from instrumentation (see
|
|
the description of <B>-finstrument-functions</B>). If the file that
|
|
contains a function definition matches with one of <I>file</I>, then
|
|
that function is not instrumented. The match is done on substrings:
|
|
if the <I>file</I> parameter is a substring of the file name, it is
|
|
considered to be a match.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
-finstrument-functions-exclude-file-list=/bits/stl,include/sys
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
excludes any inline function defined in files whose pathnames
|
|
contain <I>/bits/stl</I> or <I>include/sys</I>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If, for some reason, you want to include letter <B>,</B> in one of
|
|
<I>sym</I>, write <B>,</B>. For example,
|
|
<B>-finstrument-functions-exclude-file-list=',,tmp'</B>
|
|
(note the single quote surrounding the option).
|
|
<DT id="1321"><B>-finstrument-functions-exclude-function-list=</B><I>sym</I><B>,</B><I>sym</I><B>,...</B><DD>
|
|
|
|
|
|
This is similar to <B>-finstrument-functions-exclude-file-list</B>,
|
|
but this option sets the list of function names to be excluded from
|
|
instrumentation. The function name to be matched is its user-visible
|
|
name, such as <TT>"vector<int> blah(const vector<int> &)"</TT>, not the
|
|
internal mangled name (e.g., <TT>"_Z4blahRSt6vectorIiSaIiEE"</TT>). The
|
|
match is done on substrings: if the <I>sym</I> parameter is a substring
|
|
of the function name, it is considered to be a match. For C99 and C<FONT SIZE="-2">++</FONT>
|
|
extended identifiers, the function name must be given in <FONT SIZE="-1">UTF-8,</FONT> not
|
|
using universal character names.
|
|
<DT id="1322"><B>-fpatchable-function-entry=</B><I>N</I><B>[,</B><I>M</I><B>]</B><DD>
|
|
|
|
|
|
Generate <I>N</I> NOPs right at the beginning
|
|
of each function, with the function entry point before the <I>M</I>th <FONT SIZE="-1">NOP.</FONT>
|
|
If <I>M</I> is omitted, it defaults to <TT>0</TT> so the
|
|
function entry points to the address just at the first <FONT SIZE="-1">NOP.</FONT>
|
|
The <FONT SIZE="-1">NOP</FONT> instructions reserve extra space which can be used to patch in
|
|
any desired instrumentation at run time, provided that the code segment
|
|
is writable. The amount of space is controllable indirectly via
|
|
the number of NOPs; the <FONT SIZE="-1">NOP</FONT> instruction used corresponds to the instruction
|
|
emitted by the internal <FONT SIZE="-1">GCC</FONT> back-end interface <TT>"gen_nop"</TT>. This behavior
|
|
is target-specific and may also depend on the architecture variant and/or
|
|
other compilation options.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For run-time identification, the starting addresses of these areas,
|
|
which correspond to their respective function entries minus <I>M</I>,
|
|
are additionally collected in the <TT>"__patchable_function_entries"</TT>
|
|
section of the resulting binary.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that the value of <TT>"__attribute__ ((patchable_function_entry
|
|
(N,M)))"</TT> takes precedence over command-line option
|
|
<B>-fpatchable-function-entry=N,M</B>. This can be used to increase
|
|
the area size or to remove it completely on a single function.
|
|
If <TT>"N=0"</TT>, no pad location is recorded.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <FONT SIZE="-1">NOP</FONT> instructions are inserted at---and maybe before, depending on
|
|
<I>M</I>---the function entry address, even before the prologue.
|
|
</DL>
|
|
<A NAME="lbAQ"> </A>
|
|
<H3>Options Controlling the Preprocessor</H3>
|
|
|
|
|
|
|
|
These options control the C preprocessor, which is run on each C source
|
|
file before actual compilation.
|
|
<P>
|
|
|
|
If you use the <B>-E</B> option, nothing is done except preprocessing.
|
|
Some of these options make sense only together with <B>-E</B> because
|
|
they cause the preprocessor output to be unsuitable for actual
|
|
compilation.
|
|
<P>
|
|
|
|
In addition to the options listed here, there are a number of options
|
|
to control search paths for include files documented in
|
|
<B>Directory Options</B>.
|
|
Options to control preprocessor diagnostics are listed in
|
|
<B>Warning Options</B>.
|
|
<DL COMPACT>
|
|
<DT id="1323"><B>-D</B> <I>name</I><DD>
|
|
|
|
|
|
Predefine <I>name</I> as a macro, with definition <TT>1</TT>.
|
|
<DT id="1324"><B>-D</B> <I>name</I><B>=</B><I>definition</I><DD>
|
|
|
|
|
|
The contents of <I>definition</I> are tokenized and processed as if
|
|
they appeared during translation phase three in a <B>#define</B>
|
|
directive. In particular, the definition is truncated by
|
|
embedded newline characters.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you are invoking the preprocessor from a shell or shell-like
|
|
program you may need to use the shell's quoting syntax to protect
|
|
characters such as spaces that have a meaning in the shell syntax.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you wish to define a function-like macro on the command line, write
|
|
its argument list with surrounding parentheses before the equals sign
|
|
(if any). Parentheses are meaningful to most shells, so you should
|
|
quote the option. With <B>sh</B> and <B>csh</B>,
|
|
<B>-D'</B><I>name</I><B>(</B><I>args...</I><B>)=</B><I>definition</I><B>'</B> works.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-D</B> and <B>-U</B> options are processed in the order they
|
|
are given on the command line. All <B>-imacros</B> <I>file</I> and
|
|
<B>-include</B> <I>file</I> options are processed after all
|
|
<B>-D</B> and <B>-U</B> options.
|
|
<DT id="1325"><B>-U</B> <I>name</I><DD>
|
|
|
|
|
|
Cancel any previous definition of <I>name</I>, either built in or
|
|
provided with a <B>-D</B> option.
|
|
<DT id="1326"><B>-include</B> <I>file</I><DD>
|
|
|
|
|
|
Process <I>file</I> as if <TT>"#include "file""</TT> appeared as the first
|
|
line of the primary source file. However, the first directory searched
|
|
for <I>file</I> is the preprocessor's working directory <I>instead of</I>
|
|
the directory containing the main source file. If not found there, it
|
|
is searched for in the remainder of the <TT>"#include "...""</TT> search
|
|
chain as normal.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If multiple <B>-include</B> options are given, the files are included
|
|
in the order they appear on the command line.
|
|
<DT id="1327"><B>-imacros</B> <I>file</I><DD>
|
|
|
|
|
|
Exactly like <B>-include</B>, except that any output produced by
|
|
scanning <I>file</I> is thrown away. Macros it defines remain defined.
|
|
This allows you to acquire all the macros from a header without also
|
|
processing its declarations.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
All files specified by <B>-imacros</B> are processed before all files
|
|
specified by <B>-include</B>.
|
|
<DT id="1328"><B>-undef</B><DD>
|
|
|
|
|
|
Do not predefine any system-specific or GCC-specific macros. The
|
|
standard predefined macros remain defined.
|
|
<DT id="1329"><B>-pthread</B><DD>
|
|
|
|
|
|
Define additional macros required for using the <FONT SIZE="-1">POSIX</FONT> threads library.
|
|
You should use this option consistently for both compilation and linking.
|
|
This option is supported on GNU/Linux targets, most other Unix derivatives,
|
|
and also on x86 Cygwin and MinGW targets.
|
|
<DT id="1330"><B>-M</B><DD>
|
|
|
|
|
|
Instead of outputting the result of preprocessing, output a rule
|
|
suitable for <B>make</B> describing the dependencies of the main
|
|
source file. The preprocessor outputs one <B>make</B> rule containing
|
|
the object file name for that source file, a colon, and the names of all
|
|
the included files, including those coming from <B>-include</B> or
|
|
<B>-imacros</B> command-line options.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Unless specified explicitly (with <B>-MT</B> or <B>-MQ</B>), the
|
|
object file name consists of the name of the source file with any
|
|
suffix replaced with object file suffix and with any leading directory
|
|
parts removed. If there are many included files then the rule is
|
|
split into several lines using <B>\</B>-newline. The rule has no
|
|
commands.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option does not suppress the preprocessor's debug output, such as
|
|
<B>-dM</B>. To avoid mixing such debug output with the dependency
|
|
rules you should explicitly specify the dependency output file with
|
|
<B>-MF</B>, or use an environment variable like
|
|
<B></B><FONT SIZE="-1"><B>DEPENDENCIES_OUTPUT</B></FONT><B></B>. Debug output
|
|
is still sent to the regular output stream as normal.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Passing <B>-M</B> to the driver implies <B>-E</B>, and suppresses
|
|
warnings with an implicit <B>-w</B>.
|
|
<DT id="1331"><B>-MM</B><DD>
|
|
|
|
|
|
Like <B>-M</B> but do not mention header files that are found in
|
|
system header directories, nor header files that are included,
|
|
directly or indirectly, from such a header.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This implies that the choice of angle brackets or double quotes in an
|
|
<B>#include</B> directive does not in itself determine whether that
|
|
header appears in <B>-MM</B> dependency output.
|
|
<DT id="1332"><B>-MF</B> <I>file</I><DD>
|
|
|
|
|
|
When used with <B>-M</B> or <B>-MM</B>, specifies a
|
|
file to write the dependencies to. If no <B>-MF</B> switch is given
|
|
the preprocessor sends the rules to the same place it would send
|
|
preprocessed output.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When used with the driver options <B>-MD</B> or <B>-MMD</B>,
|
|
<B>-MF</B> overrides the default dependency output file.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>file</I> is <I>-</I>, then the dependencies are written to <I>stdout</I>.
|
|
<DT id="1333"><B>-MG</B><DD>
|
|
|
|
|
|
In conjunction with an option such as <B>-M</B> requesting
|
|
dependency generation, <B>-MG</B> assumes missing header files are
|
|
generated files and adds them to the dependency list without raising
|
|
an error. The dependency filename is taken directly from the
|
|
<TT>"#include"</TT> directive without prepending any path. <B>-MG</B>
|
|
also suppresses preprocessed output, as a missing header file renders
|
|
this useless.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This feature is used in automatic updating of makefiles.
|
|
<DT id="1334"><B>-MP</B><DD>
|
|
|
|
|
|
This option instructs <FONT SIZE="-1">CPP</FONT> to add a phony target for each dependency
|
|
other than the main file, causing each to depend on nothing. These
|
|
dummy rules work around errors <B>make</B> gives if you remove header
|
|
files without updating the <I>Makefile</I> to match.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This is typical output:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
test.o: test.c test.h
|
|
|
|
test.h:
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="1335"><B>-MT</B> <I>target</I><DD>
|
|
|
|
|
|
Change the target of the rule emitted by dependency generation. By
|
|
default <FONT SIZE="-1">CPP</FONT> takes the name of the main input file, deletes any
|
|
directory components and any file suffix such as <B>.c</B>, and
|
|
appends the platform's usual object suffix. The result is the target.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
An <B>-MT</B> option sets the target to be exactly the string you
|
|
specify. If you want multiple targets, you can specify them as a single
|
|
argument to <B>-MT</B>, or use multiple <B>-MT</B> options.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, <B>-MT '$(objpfx)foo.o'</B> might give
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
$(objpfx)foo.o: foo.c
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="1336"><B>-MQ</B> <I>target</I><DD>
|
|
|
|
|
|
Same as <B>-MT</B>, but it quotes any characters which are special to
|
|
Make. <B>-MQ '$(objpfx)foo.o'</B> gives
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
$$(objpfx)foo.o: foo.c
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default target is automatically quoted, as if it were given with
|
|
<B>-MQ</B>.
|
|
<DT id="1337"><B>-MD</B><DD>
|
|
|
|
|
|
<B>-MD</B> is equivalent to <B>-M -MF</B> <I>file</I>, except that
|
|
<B>-E</B> is not implied. The driver determines <I>file</I> based on
|
|
whether an <B>-o</B> option is given. If it is, the driver uses its
|
|
argument but with a suffix of <I>.d</I>, otherwise it takes the name
|
|
of the input file, removes any directory components and suffix, and
|
|
applies a <I>.d</I> suffix.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <B>-MD</B> is used in conjunction with <B>-E</B>, any
|
|
<B>-o</B> switch is understood to specify the dependency output file, but if used without <B>-E</B>, each <B>-o</B>
|
|
is understood to specify a target object file.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Since <B>-E</B> is not implied, <B>-MD</B> can be used to generate
|
|
a dependency output file as a side effect of the compilation process.
|
|
<DT id="1338"><B>-MMD</B><DD>
|
|
|
|
|
|
Like <B>-MD</B> except mention only user header files, not system
|
|
header files.
|
|
<DT id="1339"><B>-fpreprocessed</B><DD>
|
|
|
|
|
|
Indicate to the preprocessor that the input file has already been
|
|
preprocessed. This suppresses things like macro expansion, trigraph
|
|
conversion, escaped newline splicing, and processing of most directives.
|
|
The preprocessor still recognizes and removes comments, so that you can
|
|
pass a file preprocessed with <B>-C</B> to the compiler without
|
|
problems. In this mode the integrated preprocessor is little more than
|
|
a tokenizer for the front ends.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fpreprocessed</B> is implicit if the input file has one of the
|
|
extensions <B>.i</B>, <B>.ii</B> or <B>.mi</B>. These are the
|
|
extensions that <FONT SIZE="-1">GCC</FONT> uses for preprocessed files created by
|
|
<B>-save-temps</B>.
|
|
<DT id="1340"><B>-fdirectives-only</B><DD>
|
|
|
|
|
|
When preprocessing, handle directives, but do not expand macros.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The option's behavior depends on the <B>-E</B> and <B>-fpreprocessed</B>
|
|
options.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-E</B>, preprocessing is limited to the handling of directives
|
|
such as <TT>"#define"</TT>, <TT>"#ifdef"</TT>, and <TT>"#error"</TT>. Other
|
|
preprocessor operations, such as macro expansion and trigraph
|
|
conversion are not performed. In addition, the <B>-dD</B> option is
|
|
implicitly enabled.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-fpreprocessed</B>, predefinition of command line and most
|
|
builtin macros is disabled. Macros such as <TT>"__LINE__"</TT>, which are
|
|
contextually dependent, are handled normally. This enables compilation of
|
|
files previously preprocessed with <TT>"-E -fdirectives-only"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With both <B>-E</B> and <B>-fpreprocessed</B>, the rules for
|
|
<B>-fpreprocessed</B> take precedence. This enables full preprocessing of
|
|
files previously preprocessed with <TT>"-E -fdirectives-only"</TT>.
|
|
<DT id="1341"><B>-fdollars-in-identifiers</B><DD>
|
|
|
|
|
|
Accept <B>$</B> in identifiers.
|
|
<DT id="1342"><B>-fextended-identifiers</B><DD>
|
|
|
|
|
|
Accept universal character names in identifiers. This option is
|
|
enabled by default for C99 (and later C standard versions) and C<FONT SIZE="-2">++</FONT>.
|
|
<DT id="1343"><B>-fno-canonical-system-headers</B><DD>
|
|
|
|
|
|
When preprocessing, do not shorten system header paths with canonicalization.
|
|
<DT id="1344"><B>-ftabstop=</B><I>width</I><DD>
|
|
|
|
|
|
Set the distance between tab stops. This helps the preprocessor report
|
|
correct column numbers in warnings or errors, even if tabs appear on the
|
|
line. If the value is less than 1 or greater than 100, the option is
|
|
ignored. The default is 8.
|
|
<DT id="1345"><B>-ftrack-macro-expansion</B>[<B>=</B><I>level</I>]<DD>
|
|
|
|
|
|
Track locations of tokens across macro expansions. This allows the
|
|
compiler to emit diagnostic about the current macro expansion stack
|
|
when a compilation error occurs in a macro expansion. Using this
|
|
option makes the preprocessor and the compiler consume more
|
|
memory. The <I>level</I> parameter can be used to choose the level of
|
|
precision of token location tracking thus decreasing the memory
|
|
consumption if necessary. Value <B>0</B> of <I>level</I> de-activates
|
|
this option. Value <B>1</B> tracks tokens locations in a
|
|
degraded mode for the sake of minimal memory overhead. In this mode
|
|
all tokens resulting from the expansion of an argument of a
|
|
function-like macro have the same location. Value <B>2</B> tracks
|
|
tokens locations completely. This value is the most memory hungry.
|
|
When this option is given no argument, the default parameter value is
|
|
<B>2</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that <TT>"-ftrack-macro-expansion=2"</TT> is activated by default.
|
|
<DT id="1346"><B>-fmacro-prefix-map=</B><I>old</I><B>=</B><I>new</I><DD>
|
|
|
|
|
|
When preprocessing files residing in directory <I>old</I>,
|
|
expand the <TT>"__FILE__"</TT> and <TT>"__BASE_FILE__"</TT> macros as if the
|
|
files resided in directory <I>new</I> instead. This can be used
|
|
to change an absolute path to a relative path by using <I>.</I> for
|
|
<I>new</I> which can result in more reproducible builds that are
|
|
location independent. This option also affects
|
|
<TT>"__builtin_FILE()"</TT> during compilation. See also
|
|
<B>-ffile-prefix-map</B>.
|
|
<DT id="1347"><B>-fexec-charset=</B><I>charset</I><DD>
|
|
|
|
|
|
Set the execution character set, used for string and character
|
|
constants. The default is <FONT SIZE="-1">UTF-8.</FONT> <I>charset</I> can be any encoding
|
|
supported by the system's <TT>"iconv"</TT> library routine.
|
|
<DT id="1348"><B>-fwide-exec-charset=</B><I>charset</I><DD>
|
|
|
|
|
|
Set the wide execution character set, used for wide string and
|
|
character constants. The default is <FONT SIZE="-1">UTF-32</FONT> or <FONT SIZE="-1">UTF-16,</FONT> whichever
|
|
corresponds to the width of <TT>"wchar_t"</TT>. As with
|
|
<B>-fexec-charset</B>, <I>charset</I> can be any encoding supported
|
|
by the system's <TT>"iconv"</TT> library routine; however, you will have
|
|
problems with encodings that do not fit exactly in <TT>"wchar_t"</TT>.
|
|
<DT id="1349"><B>-finput-charset=</B><I>charset</I><DD>
|
|
|
|
|
|
Set the input character set, used for translation from the character
|
|
set of the input file to the source character set used by <FONT SIZE="-1">GCC.</FONT> If the
|
|
locale does not specify, or <FONT SIZE="-1">GCC</FONT> cannot get this information from the
|
|
locale, the default is <FONT SIZE="-1">UTF-8.</FONT> This can be overridden by either the locale
|
|
or this command-line option. Currently the command-line option takes
|
|
precedence if there's a conflict. <I>charset</I> can be any encoding
|
|
supported by the system's <TT>"iconv"</TT> library routine.
|
|
<DT id="1350"><B>-fpch-deps</B><DD>
|
|
|
|
|
|
When using precompiled headers, this flag
|
|
causes the dependency-output flags to also list the files from the
|
|
precompiled header's dependencies. If not specified, only the
|
|
precompiled header are listed and not the files that were used to
|
|
create it, because those files are not consulted when a precompiled
|
|
header is used.
|
|
<DT id="1351"><B>-fpch-preprocess</B><DD>
|
|
|
|
|
|
This option allows use of a precompiled header together with <B>-E</B>. It inserts a special <TT>"#pragma"</TT>,
|
|
<TT>"#pragma GCC pch_preprocess "</TT>filename<TT>""</TT> in the output to mark
|
|
the place where the precompiled header was found, and its <I>filename</I>.
|
|
When <B>-fpreprocessed</B> is in use, <FONT SIZE="-1">GCC</FONT> recognizes this <TT>"#pragma"</TT>
|
|
and loads the <FONT SIZE="-1">PCH.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is off by default, because the resulting preprocessed output
|
|
is only really suitable as input to <FONT SIZE="-1">GCC.</FONT> It is switched on by
|
|
<B>-save-temps</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You should not write this <TT>"#pragma"</TT> in your own code, but it is
|
|
safe to edit the filename if the <FONT SIZE="-1">PCH</FONT> file is available in a different
|
|
location. The filename may be absolute or it may be relative to <FONT SIZE="-1">GCC</FONT>'s
|
|
current directory.
|
|
<DT id="1352"><B>-fworking-directory</B><DD>
|
|
|
|
|
|
Enable generation of linemarkers in the preprocessor output that
|
|
let the compiler know the current working directory at the time of
|
|
preprocessing. When this option is enabled, the preprocessor
|
|
emits, after the initial linemarker, a second linemarker with the
|
|
current working directory followed by two slashes. <FONT SIZE="-1">GCC</FONT> uses this
|
|
directory, when it's present in the preprocessed input, as the
|
|
directory emitted as the current working directory in some debugging
|
|
information formats. This option is implicitly enabled if debugging
|
|
information is enabled, but this can be inhibited with the negated
|
|
form <B>-fno-working-directory</B>. If the <B>-P</B> flag is
|
|
present in the command line, this option has no effect, since no
|
|
<TT>"#line"</TT> directives are emitted whatsoever.
|
|
<DT id="1353"><B>-A</B> <I>predicate</I><B>=</B><I>answer</I><DD>
|
|
|
|
|
|
Make an assertion with the predicate <I>predicate</I> and answer
|
|
<I>answer</I>. This form is preferred to the older form <B>-A</B>
|
|
<I>predicate</I><B>(</B><I>answer</I><B>)</B>, which is still supported, because
|
|
it does not use shell special characters.
|
|
<DT id="1354"><B>-A -</B><I>predicate</I><B>=</B><I>answer</I><DD>
|
|
|
|
|
|
Cancel an assertion with the predicate <I>predicate</I> and answer
|
|
<I>answer</I>.
|
|
<DT id="1355"><B>-C</B><DD>
|
|
|
|
|
|
Do not discard comments. All comments are passed through to the output
|
|
file, except for comments in processed directives, which are deleted
|
|
along with the directive.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You should be prepared for side effects when using <B>-C</B>; it
|
|
causes the preprocessor to treat comments as tokens in their own right.
|
|
For example, comments appearing at the start of what would be a
|
|
directive line have the effect of turning that line into an ordinary
|
|
source line, since the first token on the line is no longer a <B>#</B>.
|
|
<DT id="1356"><B>-CC</B><DD>
|
|
|
|
|
|
Do not discard comments, including during macro expansion. This is
|
|
like <B>-C</B>, except that comments contained within macros are
|
|
also passed through to the output file where the macro is expanded.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In addition to the side effects of the <B>-C</B> option, the
|
|
<B>-CC</B> option causes all C<FONT SIZE="-2">++</FONT>-style comments inside a macro
|
|
to be converted to C-style comments. This is to prevent later use
|
|
of that macro from inadvertently commenting out the remainder of
|
|
the source line.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-CC</B> option is generally used to support lint comments.
|
|
<DT id="1357"><B>-P</B><DD>
|
|
|
|
|
|
Inhibit generation of linemarkers in the output from the preprocessor.
|
|
This might be useful when running the preprocessor on something that is
|
|
not C code, and will be sent to a program which might be confused by the
|
|
linemarkers.
|
|
<DT id="1358"><B>-traditional</B><DD>
|
|
|
|
|
|
|
|
<DT id="1359"><B>-traditional-cpp</B><DD>
|
|
|
|
|
|
|
|
Try to imitate the behavior of pre-standard C preprocessors, as
|
|
opposed to <FONT SIZE="-1">ISO C</FONT> preprocessors.
|
|
See the <FONT SIZE="-1">GNU CPP</FONT> manual for details.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that <FONT SIZE="-1">GCC</FONT> does not otherwise attempt to emulate a pre-standard
|
|
C compiler, and these options are only supported with the <B>-E</B>
|
|
switch, or when invoking <FONT SIZE="-1">CPP</FONT> explicitly.
|
|
<DT id="1360"><B>-trigraphs</B><DD>
|
|
|
|
|
|
Support <FONT SIZE="-1">ISO C</FONT> trigraphs.
|
|
These are three-character sequences, all starting with <B>??</B>, that
|
|
are defined by <FONT SIZE="-1">ISO C</FONT> to stand for single characters. For example,
|
|
<B>??/</B> stands for <B>\</B>, so <B>'??/n'</B> is a character
|
|
constant for a newline.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The nine trigraphs and their replacements are
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
Trigraph: ??( ??) ??< ??> ??= ??/ ??' ??! ??-
|
|
Replacement: [ ] { } # \ ^ | ~
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
By default, <FONT SIZE="-1">GCC</FONT> ignores trigraphs, but in
|
|
standard-conforming modes it converts them. See the <B>-std</B> and
|
|
<B>-ansi</B> options.
|
|
<DT id="1361"><B>-remap</B><DD>
|
|
|
|
|
|
Enable special code to work around file systems which only permit very
|
|
short file names, such as MS-DOS.
|
|
<DT id="1362"><B>-H</B><DD>
|
|
|
|
|
|
Print the name of each header file used, in addition to other normal
|
|
activities. Each name is indented to show how deep in the
|
|
<B>#include</B> stack it is. Precompiled header files are also
|
|
printed, even if they are found to be invalid; an invalid precompiled
|
|
header file is printed with <B>...x</B> and a valid one with <B>...!</B> .
|
|
<DT id="1363"><B>-d</B><I>letters</I><DD>
|
|
|
|
|
|
Says to make debugging dumps during compilation as specified by
|
|
<I>letters</I>. The flags documented here are those relevant to the
|
|
preprocessor. Other <I>letters</I> are interpreted
|
|
by the compiler proper, or reserved for future versions of <FONT SIZE="-1">GCC,</FONT> and so
|
|
are silently ignored. If you specify <I>letters</I> whose behavior
|
|
conflicts, the result is undefined.
|
|
<DL COMPACT><DT id="1364"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1365"><B>-dM</B><DD>
|
|
|
|
|
|
Instead of the normal output, generate a list of <B>#define</B>
|
|
directives for all the macros defined during the execution of the
|
|
preprocessor, including predefined macros. This gives you a way of
|
|
finding out what is predefined in your version of the preprocessor.
|
|
Assuming you have no file <I>foo.h</I>, the command
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
touch foo.h; cpp -dM foo.h
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
shows all the predefined macros.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you use <B>-dM</B> without the <B>-E</B> option, <B>-dM</B> is
|
|
interpreted as a synonym for <B>-fdump-rtl-mach</B>.
|
|
<DT id="1366"><B>-dD</B><DD>
|
|
|
|
|
|
Like <B>-dM</B> except in two respects: it does <I>not</I> include the
|
|
predefined macros, and it outputs <I>both</I> the <B>#define</B>
|
|
directives and the result of preprocessing. Both kinds of output go to
|
|
the standard output file.
|
|
<DT id="1367"><B>-dN</B><DD>
|
|
|
|
|
|
Like <B>-dD</B>, but emit only the macro names, not their expansions.
|
|
<DT id="1368"><B>-dI</B><DD>
|
|
|
|
|
|
Output <B>#include</B> directives in addition to the result of
|
|
preprocessing.
|
|
<DT id="1369"><B>-dU</B><DD>
|
|
|
|
|
|
Like <B>-dD</B> except that only macros that are expanded, or whose
|
|
definedness is tested in preprocessor directives, are output; the
|
|
output is delayed until the use or test of the macro; and
|
|
<B>#undef</B> directives are also output for macros tested but
|
|
undefined at the time.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1370"><DD>
|
|
</DL>
|
|
|
|
<DT id="1371"><B>-fdebug-cpp</B><DD>
|
|
|
|
|
|
This option is only useful for debugging <FONT SIZE="-1">GCC.</FONT> When used from <FONT SIZE="-1">CPP</FONT> or with
|
|
<B>-E</B>, it dumps debugging information about location maps. Every
|
|
token in the output is preceded by the dump of the map its location
|
|
belongs to.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When used from <FONT SIZE="-1">GCC</FONT> without <B>-E</B>, this option has no effect.
|
|
<DT id="1372"><B>-Wp,</B><I>option</I><DD>
|
|
|
|
|
|
You can use <B>-Wp,</B><I>option</I> to bypass the compiler driver
|
|
and pass <I>option</I> directly through to the preprocessor. If
|
|
<I>option</I> contains commas, it is split into multiple options at the
|
|
commas. However, many options are modified, translated or interpreted
|
|
by the compiler driver before being passed to the preprocessor, and
|
|
<B>-Wp</B> forcibly bypasses this phase. The preprocessor's direct
|
|
interface is undocumented and subject to change, so whenever possible
|
|
you should avoid using <B>-Wp</B> and let the driver handle the
|
|
options instead.
|
|
<DT id="1373"><B>-Xpreprocessor</B> <I>option</I><DD>
|
|
|
|
|
|
Pass <I>option</I> as an option to the preprocessor. You can use this to
|
|
supply system-specific preprocessor options that <FONT SIZE="-1">GCC</FONT> does not
|
|
recognize.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you want to pass an option that takes an argument, you must use
|
|
<B>-Xpreprocessor</B> twice, once for the option and once for the argument.
|
|
<DT id="1374"><B>-no-integrated-cpp</B><DD>
|
|
|
|
|
|
Perform preprocessing as a separate pass before compilation.
|
|
By default, <FONT SIZE="-1">GCC</FONT> performs preprocessing as an integrated part of
|
|
input tokenization and parsing.
|
|
If this option is provided, the appropriate language front end
|
|
(<B>cc1</B>, <B>cc1plus</B>, or <B>cc1obj</B> for C, C<FONT SIZE="-2">++</FONT>,
|
|
and Objective-C, respectively) is instead invoked twice,
|
|
once for preprocessing only and once for actual compilation
|
|
of the preprocessed input.
|
|
This option may be useful in conjunction with the <B>-B</B> or
|
|
<B>-wrapper</B> options to specify an alternate preprocessor or
|
|
perform additional processing of the program source between
|
|
normal preprocessing and compilation.
|
|
</DL>
|
|
<A NAME="lbAR"> </A>
|
|
<H3>Passing Options to the Assembler</H3>
|
|
|
|
|
|
|
|
You can pass options to the assembler.
|
|
<DL COMPACT>
|
|
<DT id="1375"><B>-Wa,</B><I>option</I><DD>
|
|
|
|
|
|
Pass <I>option</I> as an option to the assembler. If <I>option</I>
|
|
contains commas, it is split into multiple options at the commas.
|
|
<DT id="1376"><B>-Xassembler</B> <I>option</I><DD>
|
|
|
|
|
|
Pass <I>option</I> as an option to the assembler. You can use this to
|
|
supply system-specific assembler options that <FONT SIZE="-1">GCC</FONT> does not
|
|
recognize.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you want to pass an option that takes an argument, you must use
|
|
<B>-Xassembler</B> twice, once for the option and once for the argument.
|
|
</DL>
|
|
<A NAME="lbAS"> </A>
|
|
<H3>Options for Linking</H3>
|
|
|
|
|
|
|
|
These options come into play when the compiler links object files into
|
|
an executable output file. They are meaningless if the compiler is
|
|
not doing a link step.
|
|
<DL COMPACT>
|
|
<DT id="1377"><I>object-file-name</I><DD>
|
|
|
|
|
|
A file name that does not end in a special recognized suffix is
|
|
considered to name an object file or library. (Object files are
|
|
distinguished from libraries by the linker according to the file
|
|
contents.) If linking is done, these object files are used as input
|
|
to the linker.
|
|
<DT id="1378"><B>-c</B><DD>
|
|
|
|
|
|
|
|
<DT id="1379"><B>-S</B><DD>
|
|
|
|
|
|
<DT id="1380"><B>-E</B><DD>
|
|
|
|
|
|
|
|
If any of these options is used, then the linker is not run, and
|
|
object file names should not be used as arguments.
|
|
<DT id="1381"><B>-flinker-output=</B><I>type</I><DD>
|
|
|
|
|
|
This option controls the code generation of the link time optimizer. By
|
|
default the linker output is determined by the linker plugin automatically. For
|
|
debugging the compiler and in the case of incremental linking to non-lto object
|
|
file is desired, it may be useful to control the type manually.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>type</I> is <B>exec</B> the code generation is configured to produce static
|
|
binary. In this case <B>-fpic</B> and <B>-fpie</B> are both disabled.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>type</I> is <B>dyn</B> the code generation is configured to produce shared
|
|
library. In this case <B>-fpic</B> or <B>-fPIC</B> is preserved, but not
|
|
enabled automatically. This makes it possible to build shared libraries without
|
|
position independent code on architectures this is possible, i.e. on x86.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>type</I> is <B>pie</B> the code generation is configured to produce
|
|
<B>-fpie</B> executable. This result in similar optimizations as <B>exec</B>
|
|
except that <B>-fpie</B> is not disabled if specified at compilation time.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>type</I> is <B>rel</B> the compiler assumes that incremental linking is
|
|
done. The sections containing intermediate code for link-time optimization are
|
|
merged, pre-optimized, and output to the resulting object file. In addition, if
|
|
<B>-ffat-lto-objects</B> is specified the binary code is produced for future
|
|
non-lto linking. The object file produced by incremental linking will be smaller
|
|
than a static library produced from the same object files. At link-time the
|
|
result of incremental linking will also load faster to compiler than a static
|
|
library assuming that majority of objects in the library are used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Finally <B>nolto-rel</B> configure compiler to for incremental linking where
|
|
code generation is forced, final binary is produced and the intermediate code
|
|
for later link-time optimization is stripped. When multiple object files are
|
|
linked together the resulting code will be optimized better than with link time
|
|
optimizations disabled (for example, the cross-module inlining will happen),
|
|
most of benefits of whole program optimizations are however lost.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
During the incremental link (by <B>-r</B>) the linker plugin will default to
|
|
<B>rel</B>. With current interfaces to <FONT SIZE="-1">GNU</FONT> Binutils it is however not
|
|
possible to link incrementally <FONT SIZE="-1">LTO</FONT> objects and non-LTO objects into a single
|
|
mixed object file. In the case any of object files in incremental link cannot
|
|
be used for link-time optimization the linker plugin will output warning and
|
|
use <B>nolto-rel</B>. To maintain the whole program optimization it is
|
|
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.
|
|
<DT id="1382"><B>-fuse-ld=bfd</B><DD>
|
|
|
|
|
|
Use the <B>bfd</B> linker instead of the default linker.
|
|
<DT id="1383"><B>-fuse-ld=gold</B><DD>
|
|
|
|
|
|
Use the <B>gold</B> linker instead of the default linker.
|
|
<DT id="1384"><B>-fuse-ld=lld</B><DD>
|
|
|
|
|
|
Use the <FONT SIZE="-1">LLVM</FONT> <B>lld</B> linker instead of the default linker.
|
|
<DT id="1385"><B>-l</B><I>library</I><DD>
|
|
|
|
|
|
|
|
<DT id="1386"><B>-l</B> <I>library</I><DD>
|
|
|
|
|
|
|
|
Search the library named <I>library</I> when linking. (The second
|
|
alternative with the library as a separate argument is only for
|
|
<FONT SIZE="-1">POSIX</FONT> compliance and is not recommended.)
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-l</B> option is passed directly to the linker by <FONT SIZE="-1">GCC.</FONT> Refer
|
|
to your linker documentation for exact details. The general
|
|
description below applies to the <FONT SIZE="-1">GNU</FONT> linker.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The linker searches a standard list of directories for the library.
|
|
The directories searched include several standard system directories
|
|
plus any that you specify with <B>-L</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Static libraries are archives of object files, and have file names
|
|
like <I>liblibrary.a</I>. Some targets also support shared
|
|
libraries, which typically have names like <I>liblibrary.so</I>.
|
|
If both static and shared libraries are found, the linker gives
|
|
preference to linking with the shared library unless the
|
|
<B>-static</B> option is used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It makes a difference where in the command you write this option; the
|
|
linker searches and processes libraries and object files in the order they
|
|
are specified. Thus, <B>foo.o -lz bar.o</B> searches library <B>z</B>
|
|
after file <I>foo.o</I> but before <I>bar.o</I>. If <I>bar.o</I> refers
|
|
to functions in <B>z</B>, those functions may not be loaded.
|
|
<DT id="1387"><B>-lobjc</B><DD>
|
|
|
|
|
|
You need this special case of the <B>-l</B> option in order to
|
|
link an Objective-C or Objective-C<FONT SIZE="-2">++</FONT> program.
|
|
<DT id="1388"><B>-nostartfiles</B><DD>
|
|
|
|
|
|
Do not use the standard system startup files when linking.
|
|
The standard system libraries are used normally, unless <B>-nostdlib</B>,
|
|
<B>-nolibc</B>, or <B>-nodefaultlibs</B> is used.
|
|
<DT id="1389"><B>-nodefaultlibs</B><DD>
|
|
|
|
|
|
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 <B>-static-libgcc</B>
|
|
or <B>-shared-libgcc</B>, are ignored.
|
|
The standard startup files are used normally, unless <B>-nostartfiles</B>
|
|
is used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The compiler may generate calls to <TT>"memcmp"</TT>,
|
|
<TT>"memset"</TT>, <TT>"memcpy"</TT> and <TT>"memmove"</TT>.
|
|
These entries are usually resolved by entries in
|
|
libc. These entry points should be supplied through some other
|
|
mechanism when this option is specified.
|
|
<DT id="1390"><B>-nolibc</B><DD>
|
|
|
|
|
|
Do not use the C library or system libraries tightly coupled with it when
|
|
linking. Still link with the startup files, <I>libgcc</I> or toolchain
|
|
provided language support libraries such as <I>libgnat</I>, <I>libgfortran</I>
|
|
or <I>libstdc++</I> unless options preventing their inclusion are used as
|
|
well. This typically removes <B>-lc</B> from the link command line, as well
|
|
as system libraries that normally go with it and become meaningless when
|
|
absence of a C library is assumed, for example <B>-lpthread</B> or
|
|
<B>-lm</B> in some configurations. This is intended for bare-board
|
|
targets when there is indeed no C library available.
|
|
<DT id="1391"><B>-nostdlib</B><DD>
|
|
|
|
|
|
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
|
|
<B>-static-libgcc</B> or <B>-shared-libgcc</B>, are ignored.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The compiler may generate calls to <TT>"memcmp"</TT>, <TT>"memset"</TT>,
|
|
<TT>"memcpy"</TT> and <TT>"memmove"</TT>.
|
|
These entries are usually resolved by entries in
|
|
libc. These entry points should be supplied through some other
|
|
mechanism when this option is specified.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
One of the standard libraries bypassed by <B>-nostdlib</B> and
|
|
<B>-nodefaultlibs</B> is <I>libgcc.a</I>, a library of internal subroutines
|
|
which <FONT SIZE="-1">GCC</FONT> uses to overcome shortcomings of particular machines, or special
|
|
needs for some languages.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In most cases, you need <I>libgcc.a</I> even when you want to avoid
|
|
other standard libraries. In other words, when you specify <B>-nostdlib</B>
|
|
or <B>-nodefaultlibs</B> you should usually specify <B>-lgcc</B> as well.
|
|
This ensures that you have no unresolved references to internal <FONT SIZE="-1">GCC</FONT>
|
|
library subroutines.
|
|
(An example of such an internal subroutine is <TT>"__main"</TT>, used to ensure C<FONT SIZE="-2">++</FONT>
|
|
constructors are called.)
|
|
<DT id="1392"><B>-e</B> <I>entry</I><DD>
|
|
|
|
|
|
|
|
<DT id="1393"><B>--entry=</B><I>entry</I><DD>
|
|
|
|
|
|
|
|
Specify that the program entry point is <I>entry</I>. The argument is
|
|
interpreted by the linker; the <FONT SIZE="-1">GNU</FONT> linker accepts either a symbol name
|
|
or an address.
|
|
<DT id="1394"><B>-pie</B><DD>
|
|
|
|
|
|
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 (<B>-fpie</B>, <B>-fPIE</B>,
|
|
or model suboptions) when you specify this linker option.
|
|
<DT id="1395"><B>-no-pie</B><DD>
|
|
|
|
|
|
Don't produce a dynamically linked position independent executable.
|
|
<DT id="1396"><B>-static-pie</B><DD>
|
|
|
|
|
|
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.
|
|
For predictable results, you must also specify the same set of options
|
|
used for compilation (<B>-fpie</B>, <B>-fPIE</B>, or model
|
|
suboptions) when you specify this linker option.
|
|
<DT id="1397"><B>-pthread</B><DD>
|
|
|
|
|
|
Link with the <FONT SIZE="-1">POSIX</FONT> 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.
|
|
<DT id="1398"><B>-r</B><DD>
|
|
|
|
|
|
Produce a relocatable object as output. This is also known as partial
|
|
linking.
|
|
<DT id="1399"><B>-rdynamic</B><DD>
|
|
|
|
|
|
Pass the flag <B>-export-dynamic</B> to the <FONT SIZE="-1">ELF</FONT> 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 <TT>"dlopen"</TT> or to allow obtaining backtraces
|
|
from within a program.
|
|
<DT id="1400"><B>-s</B><DD>
|
|
|
|
|
|
Remove all symbol table and relocation information from the executable.
|
|
<DT id="1401"><B>-static</B><DD>
|
|
|
|
|
|
On systems that support dynamic linking, this overrides <B>-pie</B>
|
|
and prevents linking with the shared libraries. On other systems, this
|
|
option has no effect.
|
|
<DT id="1402"><B>-shared</B><DD>
|
|
|
|
|
|
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
|
|
(<B>-fpic</B>, <B>-fPIC</B>, or model suboptions) when
|
|
you specify this linker option.[1]
|
|
<DT id="1403"><B>-shared-libgcc</B><DD>
|
|
|
|
|
|
|
|
<DT id="1404"><B>-static-libgcc</B><DD>
|
|
|
|
|
|
|
|
On systems that provide <I>libgcc</I> as a shared library, these options
|
|
force the use of either the shared or static version, respectively.
|
|
If no shared version of <I>libgcc</I> was built when the compiler was
|
|
configured, these options have no effect.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
There are several situations in which an application should use the
|
|
shared <I>libgcc</I> instead of the static version. The most common
|
|
of these is when the application wishes to throw and catch exceptions
|
|
across different shared libraries. In that case, each of the libraries
|
|
as well as the application itself should use the shared <I>libgcc</I>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Therefore, the G++ driver automatically adds <B>-shared-libgcc</B>
|
|
whenever you build a shared library or a main executable, because C<FONT SIZE="-2">++</FONT>
|
|
programs typically use exceptions, so this is the right thing to do.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If, instead, you use the <FONT SIZE="-1">GCC</FONT> driver to create shared libraries, you may
|
|
find that they are not always linked with the shared <I>libgcc</I>.
|
|
If <FONT SIZE="-1">GCC</FONT> finds, at its configuration time, that you have a non-GNU linker
|
|
or a <FONT SIZE="-1">GNU</FONT> linker that does not support option <B>--eh-frame-hdr</B>,
|
|
it links the shared version of <I>libgcc</I> into shared libraries
|
|
by default. Otherwise, it takes advantage of the linker and optimizes
|
|
away the linking with the shared version of <I>libgcc</I>, linking with
|
|
the static version of libgcc by default. This allows exceptions to
|
|
propagate through such shared libraries, without incurring relocation
|
|
costs at library load time.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
However, if a library or main executable is supposed to throw or catch
|
|
exceptions, you must link it using the G++ driver, or using the option
|
|
<B>-shared-libgcc</B>, such that it is linked with the shared
|
|
<I>libgcc</I>.
|
|
<DT id="1405"><B>-static-libasan</B><DD>
|
|
|
|
|
|
When the <B>-fsanitize=address</B> option is used to link a program,
|
|
the <FONT SIZE="-1">GCC</FONT> driver automatically links against <B>libasan</B>. If
|
|
<I>libasan</I> is available as a shared library, and the <B>-static</B>
|
|
option is not used, then this links against the shared version of
|
|
<I>libasan</I>. The <B>-static-libasan</B> option directs the <FONT SIZE="-1">GCC</FONT>
|
|
driver to link <I>libasan</I> statically, without necessarily linking
|
|
other libraries statically.
|
|
<DT id="1406"><B>-static-libtsan</B><DD>
|
|
|
|
|
|
When the <B>-fsanitize=thread</B> option is used to link a program,
|
|
the <FONT SIZE="-1">GCC</FONT> driver automatically links against <B>libtsan</B>. If
|
|
<I>libtsan</I> is available as a shared library, and the <B>-static</B>
|
|
option is not used, then this links against the shared version of
|
|
<I>libtsan</I>. The <B>-static-libtsan</B> option directs the <FONT SIZE="-1">GCC</FONT>
|
|
driver to link <I>libtsan</I> statically, without necessarily linking
|
|
other libraries statically.
|
|
<DT id="1407"><B>-static-liblsan</B><DD>
|
|
|
|
|
|
When the <B>-fsanitize=leak</B> option is used to link a program,
|
|
the <FONT SIZE="-1">GCC</FONT> driver automatically links against <B>liblsan</B>. If
|
|
<I>liblsan</I> is available as a shared library, and the <B>-static</B>
|
|
option is not used, then this links against the shared version of
|
|
<I>liblsan</I>. The <B>-static-liblsan</B> option directs the <FONT SIZE="-1">GCC</FONT>
|
|
driver to link <I>liblsan</I> statically, without necessarily linking
|
|
other libraries statically.
|
|
<DT id="1408"><B>-static-libubsan</B><DD>
|
|
|
|
|
|
When the <B>-fsanitize=undefined</B> option is used to link a program,
|
|
the <FONT SIZE="-1">GCC</FONT> driver automatically links against <B>libubsan</B>. If
|
|
<I>libubsan</I> is available as a shared library, and the <B>-static</B>
|
|
option is not used, then this links against the shared version of
|
|
<I>libubsan</I>. The <B>-static-libubsan</B> option directs the <FONT SIZE="-1">GCC</FONT>
|
|
driver to link <I>libubsan</I> statically, without necessarily linking
|
|
other libraries statically.
|
|
<DT id="1409"><B>-static-libstdc++</B><DD>
|
|
|
|
|
|
When the <B>g++</B> program is used to link a C<FONT SIZE="-2">++</FONT> program, it
|
|
normally automatically links against <B>libstdc++</B>. If
|
|
<I>libstdc++</I> is available as a shared library, and the
|
|
<B>-static</B> option is not used, then this links against the
|
|
shared version of <I>libstdc++</I>. That is normally fine. However, it
|
|
is sometimes useful to freeze the version of <I>libstdc++</I> used by
|
|
the program without going all the way to a fully static link. The
|
|
<B>-static-libstdc++</B> option directs the <B>g++</B> driver to
|
|
link <I>libstdc++</I> statically, without necessarily linking other
|
|
libraries statically.
|
|
<DT id="1410"><B>-symbolic</B><DD>
|
|
|
|
|
|
Bind references to global symbols when building a shared object. Warn
|
|
about any unresolved references (unless overridden by the link editor
|
|
option <B>-Xlinker -z -Xlinker defs</B>). Only a few systems support
|
|
this option.
|
|
<DT id="1411"><B>-T</B> <I>script</I><DD>
|
|
|
|
|
|
Use <I>script</I> as the linker script. This option is supported by most
|
|
systems using the <FONT SIZE="-1">GNU</FONT> linker. On some targets, such as bare-board
|
|
targets without an operating system, the <B>-T</B> option may be required
|
|
when linking to avoid references to undefined symbols.
|
|
<DT id="1412"><B>-Xlinker</B> <I>option</I><DD>
|
|
|
|
|
|
Pass <I>option</I> as an option to the linker. You can use this to
|
|
supply system-specific linker options that <FONT SIZE="-1">GCC</FONT> does not recognize.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you want to pass an option that takes a separate argument, you must use
|
|
<B>-Xlinker</B> twice, once for the option and once for the argument.
|
|
For example, to pass <B>-assert definitions</B>, you must write
|
|
<B>-Xlinker -assert -Xlinker definitions</B>. It does not work to write
|
|
<B>-Xlinker ``-assert definitions''</B>, because this passes the entire
|
|
string as a single argument, which is not what the linker expects.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When using the <FONT SIZE="-1">GNU</FONT> linker, it is usually more convenient to pass
|
|
arguments to linker options using the <I>option</I><B>=</B><I>value</I>
|
|
syntax than as separate arguments. For example, you can specify
|
|
<B>-Xlinker -Map=output.map</B> rather than
|
|
<B>-Xlinker -Map -Xlinker output.map</B>. Other linkers may not support
|
|
this syntax for command-line options.
|
|
<DT id="1413"><B>-Wl,</B><I>option</I><DD>
|
|
|
|
|
|
Pass <I>option</I> as an option to the linker. If <I>option</I> contains
|
|
commas, it is split into multiple options at the commas. You can use this
|
|
syntax to pass an argument to the option.
|
|
For example, <B>-Wl,-Map,output.map</B> passes <B>-Map output.map</B> to the
|
|
linker. When using the <FONT SIZE="-1">GNU</FONT> linker, you can also get the same effect with
|
|
<B>-Wl,-Map=output.map</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">NOTE:</FONT> In Ubuntu 8.10 and later versions, for <FONT SIZE="-1">LDFLAGS,</FONT> the option
|
|
<B>-Wl,-z,relro</B> is used. To disable, use <B>-Wl,-z,norelro</B>.
|
|
<DT id="1414"><B>-u</B> <I>symbol</I><DD>
|
|
|
|
|
|
Pretend the symbol <I>symbol</I> is undefined, to force linking of
|
|
library modules to define it. You can use <B>-u</B> multiple times with
|
|
different symbols to force loading of additional library modules.
|
|
<DT id="1415"><B>-z</B> <I>keyword</I><DD>
|
|
|
|
|
|
<B>-z</B> is passed directly on to the linker along with the keyword
|
|
<I>keyword</I>. See the section in the documentation of your linker for
|
|
permitted values and their meanings.
|
|
</DL>
|
|
<A NAME="lbAT"> </A>
|
|
<H3>Options for Directory Search</H3>
|
|
|
|
|
|
|
|
These options specify directories to search for header files, for
|
|
libraries and for parts of the compiler:
|
|
<DL COMPACT>
|
|
<DT id="1416"><B>-I</B> <I>dir</I><DD>
|
|
|
|
|
|
|
|
<DT id="1417"><B>-iquote</B> <I>dir</I><DD>
|
|
|
|
|
|
<DT id="1418"><B>-isystem</B> <I>dir</I><DD>
|
|
|
|
|
|
<DT id="1419"><B>-idirafter</B> <I>dir</I><DD>
|
|
|
|
|
|
|
|
Add the directory <I>dir</I> to the list of directories to be searched
|
|
for header files during preprocessing.
|
|
If <I>dir</I> begins with <B>=</B> or <TT>$SYSROOT</TT>, then the <B>=</B>
|
|
or <TT>$SYSROOT</TT> is replaced by the sysroot prefix; see
|
|
<B>--sysroot</B> and <B>-isysroot</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Directories specified with <B>-iquote</B> apply only to the quote
|
|
form of the directive, <TT>"#include "</TT>file<TT>""</TT>.
|
|
Directories specified with <B>-I</B>, <B>-isystem</B>,
|
|
or <B>-idirafter</B> apply to lookup for both the
|
|
<TT>"#include "</TT>file<TT>""</TT> and
|
|
<TT>"#include <</TT>file<TT>>"</TT> directives.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can specify any number or combination of these options on the
|
|
command line to search for header files in several directories.
|
|
The lookup order is as follows:
|
|
<DL COMPACT><DT id="1420"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1421">1.<DD>
|
|
|
|
|
|
For the quote form of the include directive, the directory of the current
|
|
file is searched first.
|
|
<DT id="1422">2.<DD>
|
|
|
|
|
|
For the quote form of the include directive, the directories specified
|
|
by <B>-iquote</B> options are searched in left-to-right order,
|
|
as they appear on the command line.
|
|
<DT id="1423">3.<DD>
|
|
|
|
|
|
Directories specified with <B>-I</B> options are scanned in
|
|
left-to-right order.
|
|
<DT id="1424">4.<DD>
|
|
|
|
|
|
Directories specified with <B>-isystem</B> options are scanned in
|
|
left-to-right order.
|
|
<DT id="1425">5.<DD>
|
|
|
|
|
|
Standard system directories are scanned.
|
|
<DT id="1426">6.<DD>
|
|
|
|
|
|
Directories specified with <B>-idirafter</B> options are scanned in
|
|
left-to-right order.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1427"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can use <B>-I</B> to override a system header
|
|
file, substituting your own version, since these directories are
|
|
searched before the standard system header file directories.
|
|
However, you should
|
|
not use this option to add directories that contain vendor-supplied
|
|
system header files; use <B>-isystem</B> for that.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-isystem</B> and <B>-idirafter</B> options also mark the directory
|
|
as a system directory, so that it gets the same special treatment that
|
|
is applied to the standard system directories.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If a standard system include directory, or a directory specified with
|
|
<B>-isystem</B>, is also specified with <B>-I</B>, the <B>-I</B>
|
|
option is ignored. The directory is still searched but as a
|
|
system directory at its normal position in the system include chain.
|
|
This is to ensure that <FONT SIZE="-1">GCC</FONT>'s procedure to fix buggy system headers and
|
|
the ordering for the <TT>"#include_next"</TT> directive are not inadvertently
|
|
changed.
|
|
If you really need to change the search order for system directories,
|
|
use the <B>-nostdinc</B> and/or <B>-isystem</B> options.
|
|
</DL>
|
|
|
|
<DT id="1428"><B>-I-</B><DD>
|
|
|
|
|
|
Split the include path.
|
|
This option has been deprecated. Please use <B>-iquote</B> instead for
|
|
<B>-I</B> directories before the <B>-I-</B> and remove the <B>-I-</B>
|
|
option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Any directories specified with <B>-I</B>
|
|
options before <B>-I-</B> are searched only for headers requested with
|
|
<TT>"#include "</TT>file<TT>""</TT>; they are not searched for
|
|
<TT>"#include <</TT>file<TT>>"</TT>. If additional directories are
|
|
specified with <B>-I</B> options after the <B>-I-</B>, those
|
|
directories are searched for all <B>#include</B> directives.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In addition, <B>-I-</B> inhibits the use of the directory of the current
|
|
file directory as the first search directory for <TT>"#include "</TT>file<TT>""</TT>. There is no way to override this effect of <B>-I-</B>.
|
|
<DT id="1429"><B>-iprefix</B> <I>prefix</I><DD>
|
|
|
|
|
|
Specify <I>prefix</I> as the prefix for subsequent <B>-iwithprefix</B>
|
|
options. If the prefix represents a directory, you should include the
|
|
final <B>/</B>.
|
|
<DT id="1430"><B>-iwithprefix</B> <I>dir</I><DD>
|
|
|
|
|
|
|
|
<DT id="1431"><B>-iwithprefixbefore</B> <I>dir</I><DD>
|
|
|
|
|
|
|
|
Append <I>dir</I> to the prefix specified previously with
|
|
<B>-iprefix</B>, and add the resulting directory to the include search
|
|
path. <B>-iwithprefixbefore</B> puts it in the same place <B>-I</B>
|
|
would; <B>-iwithprefix</B> puts it where <B>-idirafter</B> would.
|
|
<DT id="1432"><B>-isysroot</B> <I>dir</I><DD>
|
|
|
|
|
|
This option is like the <B>--sysroot</B> option, but applies only to
|
|
header files (except for Darwin targets, where it applies to both header
|
|
files and libraries). See the <B>--sysroot</B> option for more
|
|
information.
|
|
<DT id="1433"><B>-imultilib</B> <I>dir</I><DD>
|
|
|
|
|
|
Use <I>dir</I> as a subdirectory of the directory containing
|
|
target-specific C<FONT SIZE="-2">++</FONT> headers.
|
|
<DT id="1434"><B>-nostdinc</B><DD>
|
|
|
|
|
|
Do not search the standard system directories for header files.
|
|
Only the directories explicitly specified with <B>-I</B>,
|
|
<B>-iquote</B>, <B>-isystem</B>, and/or <B>-idirafter</B>
|
|
options (and the directory of the current file, if appropriate)
|
|
are searched.
|
|
<DT id="1435"><B>-nostdinc++</B><DD>
|
|
|
|
|
|
Do not search for header files in the C<FONT SIZE="-2">++</FONT>-specific standard directories,
|
|
but do still search the other standard directories. (This option is
|
|
used when building the C<FONT SIZE="-2">++</FONT> library.)
|
|
<DT id="1436"><B>-iplugindir=</B><I>dir</I><DD>
|
|
|
|
|
|
Set the directory to search for plugins that are passed
|
|
by <B>-fplugin=</B><I>name</I> instead of
|
|
<B>-fplugin=</B><I>path</I><B>/</B><I>name</I><B>.so</B>. This option is not meant
|
|
to be used by the user, but only passed by the driver.
|
|
<DT id="1437"><B>-L</B><I>dir</I><DD>
|
|
|
|
|
|
Add directory <I>dir</I> to the list of directories to be searched
|
|
for <B>-l</B>.
|
|
<DT id="1438"><B>-B</B><I>prefix</I><DD>
|
|
|
|
|
|
This option specifies where to find the executables, libraries,
|
|
include files, and data files of the compiler itself.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The compiler driver program runs one or more of the subprograms
|
|
<B>cpp</B>, <B>cc1</B>, <B>as</B> and <B>ld</B>. It tries
|
|
<I>prefix</I> as a prefix for each program it tries to run, both with and
|
|
without <I>machine</I><B>/</B><I>version</I><B>/</B> for the corresponding target
|
|
machine and compiler version.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For each subprogram to be run, the compiler driver first tries the
|
|
<B>-B</B> prefix, if any. If that name is not found, or if <B>-B</B>
|
|
is not specified, the driver tries two standard prefixes,
|
|
<I>/usr/lib/gcc/</I> and <I>/usr/local/lib/gcc/</I>. If neither of
|
|
those results in a file name that is found, the unmodified program
|
|
name is searched for using the directories specified in your
|
|
<B></B><FONT SIZE="-1"><B>PATH</B></FONT><B></B> environment variable.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The compiler checks to see if the path provided by <B>-B</B>
|
|
refers to a directory, and if necessary it adds a directory
|
|
separator character at the end of the path.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-B</B> prefixes that effectively specify directory names also apply
|
|
to libraries in the linker, because the compiler translates these
|
|
options into <B>-L</B> options for the linker. They also apply to
|
|
include files in the preprocessor, because the compiler translates these
|
|
options into <B>-isystem</B> options for the preprocessor. In this case,
|
|
the compiler appends <B>include</B> to the prefix.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The runtime support file <I>libgcc.a</I> can also be searched for using
|
|
the <B>-B</B> prefix, if needed. If it is not found there, the two
|
|
standard prefixes above are tried, and that is all. The file is left
|
|
out of the link if it is not found by those means.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Another way to specify a prefix much like the <B>-B</B> prefix is to use
|
|
the environment variable <B></B><FONT SIZE="-1"><B>GCC_EXEC_PREFIX</B></FONT><B></B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
As a special kludge, if the path provided by <B>-B</B> is
|
|
<I>[dir/]stageN/</I>, where <I>N</I> is a number in the range 0 to
|
|
9, then it is replaced by <I>[dir/]include</I>. This is to help
|
|
with boot-strapping the compiler.
|
|
<DT id="1439"><B>-no-canonical-prefixes</B><DD>
|
|
|
|
|
|
Do not expand any symbolic links, resolve references to <B>/../</B>
|
|
or <B>/./</B>, or make the path absolute when generating a relative
|
|
prefix.
|
|
<DT id="1440"><B>--sysroot=</B><I>dir</I><DD>
|
|
|
|
|
|
Use <I>dir</I> as the logical root directory for headers and libraries.
|
|
For example, if the compiler normally searches for headers in
|
|
<I>/usr/include</I> and libraries in <I>/usr/lib</I>, it instead
|
|
searches <I>dir/usr/include</I> and <I>dir/usr/lib</I>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you use both this option and the <B>-isysroot</B> option, then
|
|
the <B>--sysroot</B> option applies to libraries, but the
|
|
<B>-isysroot</B> option applies to header files.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <FONT SIZE="-1">GNU</FONT> linker (beginning with version 2.16) has the necessary support
|
|
for this option. If your linker does not support this option, the
|
|
header file aspect of <B>--sysroot</B> still works, but the
|
|
library aspect does not.
|
|
<DT id="1441"><B>--no-sysroot-suffix</B><DD>
|
|
|
|
|
|
For some targets, a suffix is added to the root directory specified
|
|
with <B>--sysroot</B>, depending on the other options used, so that
|
|
headers may for example be found in
|
|
<I>dir/suffix/usr/include</I> instead of
|
|
<I>dir/usr/include</I>. This option disables the addition of
|
|
such a suffix.
|
|
</DL>
|
|
<A NAME="lbAU"> </A>
|
|
<H3>Options for Code Generation Conventions</H3>
|
|
|
|
|
|
|
|
These machine-independent options control the interface conventions
|
|
used in code generation.
|
|
<P>
|
|
|
|
Most of them have both positive and negative forms; the negative form
|
|
of <B>-ffoo</B> is <B>-fno-foo</B>. In the table below, only
|
|
one of the forms is listed---the one that is not the default. You
|
|
can figure out the other form by either removing <B>no-</B> or adding
|
|
it.
|
|
<DL COMPACT>
|
|
<DT id="1442"><B>-fstack-reuse=</B><I>reuse-level</I><DD>
|
|
|
|
|
|
This option controls stack space reuse for user declared local/auto variables
|
|
and compiler generated temporaries. <I>reuse_level</I> can be <B>all</B>,
|
|
<B>named_vars</B>, or <B>none</B>. <B>all</B> enables stack reuse for all
|
|
local variables and temporaries, <B>named_vars</B> enables the reuse only for
|
|
user defined local variables with names, and <B>none</B> disables stack reuse
|
|
completely. The default value is <B>all</B>. The option is needed when the
|
|
program extends the lifetime of a scoped local variable or a compiler generated
|
|
temporary beyond the end point defined by the language. When a lifetime of
|
|
a variable ends, and if the variable lives in memory, the optimizing compiler
|
|
has the freedom to reuse its stack space with other temporaries or scoped
|
|
local variables whose live range does not overlap with it. Legacy code extending
|
|
local lifetime is likely to break with the stack reuse optimization.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example,
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int *p;
|
|
{
|
|
int local1;
|
|
|
|
p = &local1;
|
|
local1 = 10;
|
|
....
|
|
}
|
|
{
|
|
int local2;
|
|
local2 = 20;
|
|
...
|
|
}
|
|
|
|
if (*p == 10) // out of scope use of local1
|
|
{
|
|
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Another example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct A
|
|
{
|
|
A(int k) : i(k), j(k) { }
|
|
int i;
|
|
int j;
|
|
};
|
|
|
|
A *ap;
|
|
|
|
void foo(const A& ar)
|
|
{
|
|
ap = &ar;
|
|
}
|
|
|
|
void bar()
|
|
{
|
|
foo(A(10)); // temp object's lifetime ends when foo returns
|
|
|
|
{
|
|
A a(20);
|
|
....
|
|
}
|
|
ap->i+= 10; // ap references out of scope temp whose space
|
|
// is reused with a. What is the value of ap->i?
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The lifetime of a compiler generated temporary is well defined by the C<FONT SIZE="-2">++</FONT>
|
|
standard. When a lifetime of a temporary ends, and if the temporary lives
|
|
in memory, the optimizing compiler has the freedom to reuse its stack
|
|
space with other temporaries or scoped local variables whose live range
|
|
does not overlap with it. However some of the legacy code relies on
|
|
the behavior of older compilers in which temporaries' stack space is
|
|
not reused, the aggressive stack reuse can lead to runtime errors. This
|
|
option is used to control the temporary stack reuse optimization.
|
|
<DT id="1443"><B>-ftrapv</B><DD>
|
|
|
|
|
|
This option generates traps for signed overflow on addition, subtraction,
|
|
multiplication operations.
|
|
The options <B>-ftrapv</B> and <B>-fwrapv</B> override each other, so using
|
|
<B>-ftrapv</B> <B>-fwrapv</B> on the command-line results in
|
|
<B>-fwrapv</B> being effective. Note that only active options override, so
|
|
using <B>-ftrapv</B> <B>-fwrapv</B> <B>-fno-wrapv</B> on the command-line
|
|
results in <B>-ftrapv</B> being effective.
|
|
<DT id="1444"><B>-fwrapv</B><DD>
|
|
|
|
|
|
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
|
|
and disables others.
|
|
The options <B>-ftrapv</B> and <B>-fwrapv</B> override each other, so using
|
|
<B>-ftrapv</B> <B>-fwrapv</B> on the command-line results in
|
|
<B>-fwrapv</B> being effective. Note that only active options override, so
|
|
using <B>-ftrapv</B> <B>-fwrapv</B> <B>-fno-wrapv</B> on the command-line
|
|
results in <B>-ftrapv</B> being effective.
|
|
<DT id="1445"><B>-fwrapv-pointer</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="1446"><B>-fstrict-overflow</B><DD>
|
|
|
|
|
|
This option implies <B>-fno-wrapv</B> <B>-fno-wrapv-pointer</B> and when
|
|
negated implies <B>-fwrapv</B> <B>-fwrapv-pointer</B>.
|
|
<DT id="1447"><B>-fexceptions</B><DD>
|
|
|
|
|
|
Enable exception handling. Generates extra code needed to propagate
|
|
exceptions. For some targets, this implies <FONT SIZE="-1">GCC</FONT> generates frame
|
|
unwind information for all functions, which can produce significant data
|
|
size overhead, although it does not affect execution. If you do not
|
|
specify this option, <FONT SIZE="-1">GCC</FONT> enables it by default for languages like
|
|
C<FONT SIZE="-2">++</FONT> that normally require exception handling, and disables it for
|
|
languages like C that do not normally require it. However, you may need
|
|
to enable this option when compiling C code that needs to interoperate
|
|
properly with exception handlers written in C<FONT SIZE="-2">++</FONT>. You may also wish to
|
|
disable this option if you are compiling older C<FONT SIZE="-2">++</FONT> programs that don't
|
|
use exception handling.
|
|
<DT id="1448"><B>-fnon-call-exceptions</B><DD>
|
|
|
|
|
|
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 <I>trapping</I>
|
|
instructions to throw exceptions, i.e. memory references or floating-point
|
|
instructions. It does not allow exceptions to be thrown from
|
|
arbitrary signal handlers such as <TT>"SIGALRM"</TT>.
|
|
<DT id="1449"><B>-fdelete-dead-exceptions</B><DD>
|
|
|
|
|
|
Consider that instructions that may throw exceptions but don't otherwise
|
|
contribute to the execution of the program can be optimized away.
|
|
This option is enabled by default for the Ada front end, as permitted by
|
|
the Ada language specification.
|
|
Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
|
|
<DT id="1450"><B>-funwind-tables</B><DD>
|
|
|
|
|
|
Similar to <B>-fexceptions</B>, 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.
|
|
<DT id="1451"><B>-fasynchronous-unwind-tables</B><DD>
|
|
|
|
|
|
Generate unwind table in <FONT SIZE="-1">DWARF</FONT> 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).
|
|
<DT id="1452"><B>-fno-gnu-unique</B><DD>
|
|
|
|
|
|
On systems with recent <FONT SIZE="-1">GNU</FONT> assembler and C library, the C<FONT SIZE="-2">++</FONT> compiler
|
|
uses the <TT>"STB_GNU_UNIQUE"</TT> binding to make sure that definitions
|
|
of template static data members and static local variables in inline
|
|
functions are unique even in the presence of <TT>"RTLD_LOCAL"</TT>; this
|
|
is necessary to avoid problems with a library used by two different
|
|
<TT>"RTLD_LOCAL"</TT> plugins depending on a definition in one of them and
|
|
therefore disagreeing with the other one about the binding of the
|
|
symbol. But this causes <TT>"dlclose"</TT> to be ignored for affected
|
|
DSOs; if your program relies on reinitialization of a <FONT SIZE="-1">DSO</FONT> via
|
|
<TT>"dlclose"</TT> and <TT>"dlopen"</TT>, you can use
|
|
<B>-fno-gnu-unique</B>.
|
|
<DT id="1453"><B>-fpcc-struct-return</B><DD>
|
|
|
|
|
|
Return ``short'' <TT>"struct"</TT> and <TT>"union"</TT> values in memory like
|
|
longer ones, rather than in registers. This convention is less
|
|
efficient, but it has the advantage of allowing intercallability between
|
|
GCC-compiled files and files compiled with other compilers, particularly
|
|
the Portable C Compiler (pcc).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The precise convention for returning structures in memory depends
|
|
on the target configuration macros.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Short structures and unions are those whose size and alignment match
|
|
that of some integer type.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> code compiled with the <B>-fpcc-struct-return</B>
|
|
switch is not binary compatible with code compiled with the
|
|
<B>-freg-struct-return</B> switch.
|
|
Use it to conform to a non-default application binary interface.
|
|
<DT id="1454"><B>-freg-struct-return</B><DD>
|
|
|
|
|
|
Return <TT>"struct"</TT> and <TT>"union"</TT> values in registers when possible.
|
|
This is more efficient for small structures than
|
|
<B>-fpcc-struct-return</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you specify neither <B>-fpcc-struct-return</B> nor
|
|
<B>-freg-struct-return</B>, <FONT SIZE="-1">GCC</FONT> defaults to whichever convention is
|
|
standard for the target. If there is no standard convention, <FONT SIZE="-1">GCC</FONT>
|
|
defaults to <B>-fpcc-struct-return</B>, except on targets where <FONT SIZE="-1">GCC</FONT> is
|
|
the principal compiler. In those cases, we can choose the standard, and
|
|
we chose the more efficient register return alternative.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> code compiled with the <B>-freg-struct-return</B>
|
|
switch is not binary compatible with code compiled with the
|
|
<B>-fpcc-struct-return</B> switch.
|
|
Use it to conform to a non-default application binary interface.
|
|
<DT id="1455"><B>-fshort-enums</B><DD>
|
|
|
|
|
|
Allocate to an <TT>"enum"</TT> type only as many bytes as it needs for the
|
|
declared range of possible values. Specifically, the <TT>"enum"</TT> type
|
|
is equivalent to the smallest integer type that has enough room.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> the <B>-fshort-enums</B> switch causes <FONT SIZE="-1">GCC</FONT> to generate
|
|
code that is not binary compatible with code generated without that switch.
|
|
Use it to conform to a non-default application binary interface.
|
|
<DT id="1456"><B>-fshort-wchar</B><DD>
|
|
|
|
|
|
Override the underlying type for <TT>"wchar_t"</TT> to be <TT>"short
|
|
unsigned int"</TT> instead of the default for the target. This option is
|
|
useful for building programs to run under <FONT SIZE="-1">WINE.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> the <B>-fshort-wchar</B> switch causes <FONT SIZE="-1">GCC</FONT> to generate
|
|
code that is not binary compatible with code generated without that switch.
|
|
Use it to conform to a non-default application binary interface.
|
|
<DT id="1457"><B>-fno-common</B><DD>
|
|
|
|
|
|
In C code, this option controls the placement of global variables
|
|
defined without an initializer, known as <I>tentative definitions</I>
|
|
in the C standard. Tentative definitions are distinct from declarations
|
|
of a variable with the <TT>"extern"</TT> keyword, which do not allocate storage.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Unix C compilers have traditionally allocated storage for
|
|
uninitialized global variables in a common block. This allows the
|
|
linker to resolve all tentative definitions of the same variable
|
|
in different compilation units to the same object, or to a non-tentative
|
|
definition.
|
|
This is the behavior specified by <B>-fcommon</B>, and is the default for
|
|
<FONT SIZE="-1">GCC</FONT> on most targets.
|
|
On the other hand, this behavior is not required by <FONT SIZE="-1">ISO
|
|
C,</FONT> and on some targets may carry a speed or code size penalty on
|
|
variable references.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-fno-common</B> option specifies that the compiler should instead
|
|
place uninitialized global variables in the <FONT SIZE="-1">BSS</FONT> section of the object file.
|
|
This inhibits the merging of tentative definitions by the linker so
|
|
you get a multiple-definition error if the same
|
|
variable is defined in more than one compilation unit.
|
|
Compiling with <B>-fno-common</B> is useful on targets for which
|
|
it provides better performance, or if you wish to verify that the
|
|
program will work on other systems that always treat uninitialized
|
|
variable definitions this way.
|
|
<DT id="1458"><B>-fno-ident</B><DD>
|
|
|
|
|
|
Ignore the <TT>"#ident"</TT> directive.
|
|
<DT id="1459"><B>-finhibit-size-directive</B><DD>
|
|
|
|
|
|
Don't output a <TT>".size"</TT> 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 <I>crtstuff.c</I>; you should not need to use it
|
|
for anything else.
|
|
<DT id="1460"><B>-fverbose-asm</B><DD>
|
|
|
|
|
|
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
|
|
debugging the compiler itself).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fno-verbose-asm</B>, the default, causes the
|
|
extra information to be omitted and is useful when comparing two assembler
|
|
files.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The added comments include:
|
|
<DL COMPACT><DT id="1461"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1462">*<DD>
|
|
information on the compiler version and command-line options,
|
|
<DT id="1463">*<DD>
|
|
the source code lines associated with the assembly instructions,
|
|
in the form <FONT SIZE="-1">FILENAME:LINENUMBER:CONTENT OF LINE,</FONT>
|
|
<DT id="1464">*<DD>
|
|
hints on which high-level expressions correspond to
|
|
the various assembly instruction operands.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1465"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, given this C source file:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int test (int n)
|
|
{
|
|
int i;
|
|
int total = 0;
|
|
|
|
for (i = 0; i < n; i++)
|
|
total += i * i;
|
|
|
|
return total;
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
compiling to (x86_64) assembly via <B>-S</B> and emitting the result
|
|
direct to stdout via <B>-o</B> <B>-</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -S test.c -fverbose-asm -Os -o -
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
gives output similar to this:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
.file "test.c"
|
|
# GNU C11 (GCC) version 7.0.0 20160809 (experimental) (x86_64-pc-linux-gnu)
|
|
[...snip...]
|
|
# options passed:
|
|
[...snip...]
|
|
|
|
.text
|
|
.globl test
|
|
.type test, @function
|
|
test:
|
|
.LFB0:
|
|
.cfi_startproc
|
|
# test.c:4: int total = 0;
|
|
xorl %eax, %eax # <retval>
|
|
# test.c:6: for (i = 0; i < n; i++)
|
|
xorl %edx, %edx # i
|
|
.L2:
|
|
# test.c:6: for (i = 0; i < n; i++)
|
|
cmpl %edi, %edx # n, i
|
|
jge .L5 #,
|
|
# test.c:7: total += i * i;
|
|
movl %edx, %ecx # i, tmp92
|
|
imull %edx, %ecx # i, tmp92
|
|
# test.c:6: for (i = 0; i < n; i++)
|
|
incl %edx # i
|
|
# test.c:7: total += i * i;
|
|
addl %ecx, %eax # tmp92, <retval>
|
|
jmp .L2 #
|
|
.L5:
|
|
# test.c:10: }
|
|
ret
|
|
.cfi_endproc
|
|
.LFE0:
|
|
.size test, .-test
|
|
.ident "GCC: (GNU) 7.0.0 20160809 (experimental)"
|
|
.section .note.GNU-stack,"",@progbits
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The comments are intended for humans rather than machines and hence the
|
|
precise format of the comments is subject to change.
|
|
</DL>
|
|
|
|
<DT id="1466"><B>-frecord-gcc-switches</B><DD>
|
|
|
|
|
|
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
|
|
of the recording is target and binary file format dependent, but it
|
|
usually takes the form of a section containing <FONT SIZE="-1">ASCII</FONT> text. This
|
|
switch is related to the <B>-fverbose-asm</B> switch, but that
|
|
switch only records information in the assembler output file as
|
|
comments, so it never reaches the object file.
|
|
See also <B>-grecord-gcc-switches</B> for another
|
|
way of storing compiler options into the object file.
|
|
<DT id="1467"><B>-fpic</B><DD>
|
|
|
|
|
|
Generate position-independent code (<FONT SIZE="-1">PIC</FONT>) suitable for use in a shared
|
|
library, if supported for the target machine. Such code accesses all
|
|
constant addresses through a global offset table (<FONT SIZE="-1">GOT</FONT>). The dynamic
|
|
loader resolves the <FONT SIZE="-1">GOT</FONT> entries when the program starts (the dynamic
|
|
loader is not part of <FONT SIZE="-1">GCC</FONT>; it is part of the operating system). If
|
|
the <FONT SIZE="-1">GOT</FONT> size for the linked executable exceeds a machine-specific
|
|
maximum size, you get an error message from the linker indicating that
|
|
<B>-fpic</B> does not work; in that case, recompile with <B>-fPIC</B>
|
|
instead. (These maximums are 8k on the <FONT SIZE="-1">SPARC,</FONT> 28k on AArch64 and 32k
|
|
on the m68k and <FONT SIZE="-1">RS/6000.</FONT> The x86 has no such limit.)
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Position-independent code requires special support, and therefore works
|
|
only on certain machines. For the x86, <FONT SIZE="-1">GCC</FONT> supports <FONT SIZE="-1">PIC</FONT> for System V
|
|
but not for the Sun 386i. Code generated for the <FONT SIZE="-1">IBM RS/6000</FONT> is always
|
|
position-independent.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When this flag is set, the macros <TT>"__pic__"</TT> and <TT>"__PIC__"</TT>
|
|
are defined to 1.
|
|
<DT id="1468"><B>-fPIC</B><DD>
|
|
|
|
|
|
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,
|
|
PowerPC and <FONT SIZE="-1">SPARC.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Position-independent code requires special support, and therefore works
|
|
only on certain machines.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When this flag is set, the macros <TT>"__pic__"</TT> and <TT>"__PIC__"</TT>
|
|
are defined to 2.
|
|
<DT id="1469"><B>-fpie</B><DD>
|
|
|
|
|
|
|
|
<DT id="1470"><B>-fPIE</B><DD>
|
|
|
|
|
|
|
|
These options are similar to <B>-fpic</B> and <B>-fPIC</B>, 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
|
|
the <B>-pie</B> <FONT SIZE="-1">GCC</FONT> option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fpie</B> and <B>-fPIE</B> both define the macros
|
|
<TT>"__pie__"</TT> and <TT>"__PIE__"</TT>. The macros have the value 1
|
|
for <B>-fpie</B> and 2 for <B>-fPIE</B>.
|
|
<DT id="1471"><B>-fno-plt</B><DD>
|
|
|
|
|
|
Do not use the <FONT SIZE="-1">PLT</FONT> for external function calls in position-independent code.
|
|
Instead, load the callee address at call sites from the <FONT SIZE="-1">GOT</FONT> and branch to it.
|
|
This leads to more efficient code by eliminating <FONT SIZE="-1">PLT</FONT> stubs and exposing
|
|
<FONT SIZE="-1">GOT</FONT> loads to optimizations. On architectures such as 32-bit x86 where
|
|
<FONT SIZE="-1">PLT</FONT> stubs expect the <FONT SIZE="-1">GOT</FONT> pointer in a specific register, this gives more
|
|
register allocation freedom to the compiler.
|
|
Lazy binding requires use of the <FONT SIZE="-1">PLT</FONT>;
|
|
with <B>-fno-plt</B> all external symbols are resolved at load time.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Alternatively, the function attribute <TT>"noplt"</TT> can be used to avoid calls
|
|
through the <FONT SIZE="-1">PLT</FONT> for specific external functions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In position-dependent code, a few targets also convert calls to
|
|
functions that are marked to not use the <FONT SIZE="-1">PLT</FONT> to use the <FONT SIZE="-1">GOT</FONT> instead.
|
|
<DT id="1472"><B>-fno-jump-tables</B><DD>
|
|
|
|
|
|
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 <B>-fpic</B> or <B>-fPIC</B> for
|
|
building code that forms part of a dynamic linker and cannot
|
|
reference the address of a jump table. On some targets, jump tables
|
|
do not require a <FONT SIZE="-1">GOT</FONT> and this option is not needed.
|
|
<DT id="1473"><B>-ffixed-</B><I>reg</I><DD>
|
|
|
|
|
|
Treat the register named <I>reg</I> 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).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>reg</I> must be the name of a register. The register names accepted
|
|
are machine-specific and are defined in the <TT>"REGISTER_NAMES"</TT>
|
|
macro in the machine description macro file.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This flag does not have a negative form, because it specifies a
|
|
three-way choice.
|
|
<DT id="1474"><B>-fcall-used-</B><I>reg</I><DD>
|
|
|
|
|
|
Treat the register named <I>reg</I> 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
|
|
do not save and restore the register <I>reg</I>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It is an error to use this flag with the frame pointer or stack pointer.
|
|
Use of this flag for other registers that have fixed pervasive roles in
|
|
the machine's execution model produces disastrous results.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This flag does not have a negative form, because it specifies a
|
|
three-way choice.
|
|
<DT id="1475"><B>-fcall-saved-</B><I>reg</I><DD>
|
|
|
|
|
|
Treat the register named <I>reg</I> 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
|
|
the register <I>reg</I> if they use it.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It is an error to use this flag with the frame pointer or stack pointer.
|
|
Use of this flag for other registers that have fixed pervasive roles in
|
|
the machine's execution model produces disastrous results.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
A different sort of disaster results from the use of this flag for
|
|
a register in which function values may be returned.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This flag does not have a negative form, because it specifies a
|
|
three-way choice.
|
|
<DT id="1476"><B>-fpack-struct[=</B><I>n</I><B>]</B><DD>
|
|
|
|
|
|
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
|
|
alignment (that is, objects with default alignment requirements larger than
|
|
this are output potentially unaligned at the next fitting location.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> the <B>-fpack-struct</B> switch causes <FONT SIZE="-1">GCC</FONT> to generate
|
|
code that is not binary compatible with code generated without that switch.
|
|
Additionally, it makes the code suboptimal.
|
|
Use it to conform to a non-default application binary interface.
|
|
<DT id="1477"><B>-fleading-underscore</B><DD>
|
|
|
|
|
|
This option and its counterpart, <B>-fno-leading-underscore</B>, forcibly
|
|
change the way C symbols are represented in the object file. One use
|
|
is to help link with legacy assembly code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> the <B>-fleading-underscore</B> switch causes <FONT SIZE="-1">GCC</FONT> to
|
|
generate code that is not binary compatible with code generated without that
|
|
switch. Use it to conform to a non-default application binary interface.
|
|
Not all targets provide complete support for this switch.
|
|
<DT id="1478"><B>-ftls-model=</B><I>model</I><DD>
|
|
|
|
|
|
Alter the thread-local storage model to be used.
|
|
The <I>model</I> argument should be one of <B>global-dynamic</B>,
|
|
<B>local-dynamic</B>, <B>initial-exec</B> or <B>local-exec</B>.
|
|
Note that the choice is subject to optimization: the compiler may use
|
|
a more efficient model for symbols not visible outside of the translation
|
|
unit, or if <B>-fpic</B> is not given on the command line.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default without <B>-fpic</B> is <B>initial-exec</B>; with
|
|
<B>-fpic</B> the default is <B>global-dynamic</B>.
|
|
<DT id="1479"><B>-ftrampolines</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">IA-64,</FONT> do nothing.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
A trampoline is a small piece of code that is created at run time on the
|
|
stack when the address of a nested function is taken, and is used to call
|
|
the nested function indirectly. Therefore, it requires the stack to be
|
|
made executable in order for the program to work properly.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fno-trampolines</B> is enabled by default on a language by language
|
|
basis to let the compiler avoid generating them, if it computes that this
|
|
is safe, and replace them with descriptors. Descriptors are made up of data
|
|
only, but the generated code must be prepared to deal with them. As of this
|
|
writing, <B>-fno-trampolines</B> is enabled by default only for Ada.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Moreover, code compiled with <B>-ftrampolines</B> and code compiled with
|
|
<B>-fno-trampolines</B> are not binary compatible if nested functions are
|
|
present. This option must therefore be used on a program-wide basis and be
|
|
manipulated with extreme care.
|
|
<DT id="1480"><B>-fvisibility=</B>[<B>default</B>|<B>internal</B>|<B>hidden</B>|<B>protected</B>]<DD>
|
|
|
|
|
|
Set the default <FONT SIZE="-1">ELF</FONT> 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
|
|
load times of shared object libraries, produce more optimized
|
|
code, provide near-perfect <FONT SIZE="-1">API</FONT> export and prevent symbol clashes.
|
|
It is <B>strongly</B> recommended that you use this in any shared objects
|
|
you distribute.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Despite the nomenclature, <B>default</B> always means public; i.e.,
|
|
available to be linked against from outside the shared object.
|
|
<B>protected</B> and <B>internal</B> are pretty useless in real-world
|
|
usage so the only other commonly used option is <B>hidden</B>.
|
|
The default if <B>-fvisibility</B> isn't specified is
|
|
<B>default</B>, i.e., make every symbol public.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
A good explanation of the benefits offered by ensuring <FONT SIZE="-1">ELF</FONT>
|
|
symbols have the correct visibility is given by ``How To Write
|
|
Shared Libraries'' by Ulrich Drepper (which can be found at
|
|
<<B><A HREF="https://www.akkadia.org/drepper/">https://www.akkadia.org/drepper/</A></B>>)---however a superior
|
|
solution made possible by this option to marking things hidden when
|
|
the default is public is to make the default hidden and mark things
|
|
public. This is the norm with DLLs on Windows and with <B>-fvisibility=hidden</B>
|
|
and <TT>"__attribute__ ((visibility("default")))"</TT> instead of
|
|
<TT>"__declspec(dllexport)"</TT> you get almost identical semantics with
|
|
identical syntax. This is a great boon to those working with
|
|
cross-platform projects.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For those adding visibility support to existing code, you may find
|
|
<TT>"#pragma GCC visibility"</TT> of use. This works by you enclosing
|
|
the declarations you wish to set visibility for with (for example)
|
|
<TT>"#pragma GCC visibility push(hidden)"</TT> and
|
|
<TT>"#pragma GCC visibility pop"</TT>.
|
|
Bear in mind that symbol visibility should be viewed <B>as
|
|
part of the </B><FONT SIZE="-1"><B>API</B></FONT><B> interface contract</B> and thus all new code should
|
|
always specify visibility when it is not the default; i.e., declarations
|
|
only for use within the local <FONT SIZE="-1">DSO</FONT> should <B>always</B> be marked explicitly
|
|
as hidden as so to avoid <FONT SIZE="-1">PLT</FONT> indirection overheads---making this
|
|
abundantly clear also aids readability and self-documentation of the code.
|
|
Note that due to <FONT SIZE="-1">ISO C<FONT SIZE="-2">++</FONT></FONT> specification requirements, <TT>"operator new"</TT> and
|
|
<TT>"operator delete"</TT> must always be of default visibility.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Be aware that headers from outside your project, in particular system
|
|
headers and headers from any other library you use, may not be
|
|
expecting to be compiled with visibility other than the default. You
|
|
may need to explicitly say <TT>"#pragma GCC visibility push(default)"</TT>
|
|
before including any such headers.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<TT>"extern"</TT> declarations are not affected by <B>-fvisibility</B>, so
|
|
a lot of code can be recompiled with <B>-fvisibility=hidden</B> with
|
|
no modifications. However, this means that calls to <TT>"extern"</TT>
|
|
functions with no explicit visibility use the <FONT SIZE="-1">PLT,</FONT> so it is more
|
|
effective to use <TT>"__attribute ((visibility))"</TT> and/or
|
|
<TT>"#pragma GCC visibility"</TT> to tell the compiler which <TT>"extern"</TT>
|
|
declarations should be treated as hidden.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that <B>-fvisibility</B> does affect C<FONT SIZE="-2">++</FONT> vague linkage
|
|
entities. This means that, for instance, an exception class that is
|
|
be thrown between DSOs must be explicitly marked with default
|
|
visibility so that the <B>type_info</B> nodes are unified between
|
|
the DSOs.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
An overview of these techniques, their benefits and how to use them
|
|
is at <<B><A HREF="http://gcc.gnu.org/wiki/Visibility">http://gcc.gnu.org/wiki/Visibility</A></B>>.
|
|
<DT id="1481"><B>-fstrict-volatile-bitfields</B><DD>
|
|
|
|
|
|
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
|
|
field's type, aligned to a natural alignment if possible. For
|
|
example, targets with memory-mapped peripheral registers might require
|
|
all such accesses to be 16 bits wide; with this flag you can
|
|
declare all peripheral bit-fields as <TT>"unsigned short"</TT> (assuming short
|
|
is 16 bits on these targets) to force <FONT SIZE="-1">GCC</FONT> to use 16-bit accesses
|
|
instead of, perhaps, a more efficient 32-bit access.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If this option is disabled, the compiler uses the most efficient
|
|
instruction. In the previous example, that might be a 32-bit load
|
|
instruction, even though that accesses bytes that do not contain
|
|
any portion of the bit-field, or memory-mapped registers unrelated to
|
|
the one being updated.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In some cases, such as when the <TT>"packed"</TT> attribute is applied to a
|
|
structure field, it may not be possible to access the field with a single
|
|
read or write that is correctly aligned for the target machine. In this
|
|
case <FONT SIZE="-1">GCC</FONT> falls back to generating multiple accesses rather than code that
|
|
will fault or truncate the result at run time.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note: Due to restrictions of the C/C<FONT SIZE="-2">++</FONT>11 memory model, write accesses are
|
|
not allowed to touch non bit-field members. It is therefore recommended
|
|
to define all bits of the field's type as bit-field members.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default value of this option is determined by the application binary
|
|
interface for the target processor.
|
|
<DT id="1482"><B>-fsync-libcalls</B><DD>
|
|
|
|
|
|
This option controls whether any out-of-line instance of the <TT>"__sync"</TT>
|
|
family of functions may be used to implement the C<FONT SIZE="-2">++</FONT>11 <TT>"__atomic"</TT>
|
|
family of functions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default value of this option is enabled, thus the only useful form
|
|
of the option is <B>-fno-sync-libcalls</B>. This option is used in
|
|
the implementation of the <I>libatomic</I> runtime library.
|
|
</DL>
|
|
<A NAME="lbAV"> </A>
|
|
<H3><FONT SIZE="-1">GCC</FONT> Developer Options</H3>
|
|
|
|
|
|
|
|
This section describes command-line options that are primarily of
|
|
interest to <FONT SIZE="-1">GCC</FONT> developers, including options to support compiler
|
|
testing and investigation of compiler bugs and compile-time
|
|
performance problems. This includes options that produce debug dumps
|
|
at various points in the compilation; that print statistics such as
|
|
memory use and execution time; and that print information about <FONT SIZE="-1">GCC</FONT>'s
|
|
configuration, such as where it searches for libraries. You should
|
|
rarely need to use any of these options for ordinary compilation and
|
|
linking tasks.
|
|
<P>
|
|
|
|
Many developer options that cause <FONT SIZE="-1">GCC</FONT> to dump output to a file take an
|
|
optional <B>=</B><I>filename</I> suffix. You can specify <B>stdout</B>
|
|
or <B>-</B> to dump to standard output, and <B>stderr</B> for standard
|
|
error.
|
|
<P>
|
|
|
|
If <B>=</B><I>filename</I> is omitted, a default dump file name is
|
|
constructed by concatenating the base dump file name, a pass number,
|
|
phase letter, and pass name. The base dump file name is the name of
|
|
output file produced by the compiler if explicitly specified and not
|
|
an executable; otherwise it is the source file name.
|
|
The pass number is determined by the order passes are registered with
|
|
the compiler's pass manager.
|
|
This is generally the same as the order of execution, but passes
|
|
registered by plugins, target-specific passes, or passes that are
|
|
otherwise registered late are numbered higher than the pass named
|
|
<B>final</B>, even if they are executed earlier. The phase letter is
|
|
one of <B>i</B> (inter-procedural analysis), <B>l</B>
|
|
(language-specific), <B>r</B> (<FONT SIZE="-1">RTL</FONT>), or <B>t</B> (tree).
|
|
The files are created in the directory of the output file.
|
|
<DL COMPACT>
|
|
<DT id="1483"><B>-d</B><I>letters</I><DD>
|
|
|
|
|
|
|
|
<DT id="1484"><B>-fdump-rtl-</B><I>pass</I><DD>
|
|
|
|
|
|
<DT id="1485"><B>-fdump-rtl-</B><I>pass</I><B>=</B><I>filename</I><DD>
|
|
|
|
|
|
|
|
Says to make debugging dumps during compilation at times specified by
|
|
<I>letters</I>. This is used for debugging the RTL-based passes of the
|
|
compiler.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Some <B>-d</B><I>letters</I> switches have different meaning when
|
|
<B>-E</B> is used for preprocessing.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Debug dumps can be enabled with a <B>-fdump-rtl</B> switch or some
|
|
<B>-d</B> option <I>letters</I>. Here are the possible
|
|
letters for use in <I>pass</I> and <I>letters</I>, and their meanings:
|
|
<DL COMPACT><DT id="1486"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1487"><B>-fdump-rtl-alignments</B><DD>
|
|
|
|
|
|
Dump after branch alignments have been computed.
|
|
<DT id="1488"><B>-fdump-rtl-asmcons</B><DD>
|
|
|
|
|
|
Dump after fixing rtl statements that have unsatisfied in/out constraints.
|
|
<DT id="1489"><B>-fdump-rtl-auto_inc_dec</B><DD>
|
|
|
|
|
|
Dump after auto-inc-dec discovery. This pass is only run on
|
|
architectures that have auto inc or auto dec instructions.
|
|
<DT id="1490"><B>-fdump-rtl-barriers</B><DD>
|
|
|
|
|
|
Dump after cleaning up the barrier instructions.
|
|
<DT id="1491"><B>-fdump-rtl-bbpart</B><DD>
|
|
|
|
|
|
Dump after partitioning hot and cold basic blocks.
|
|
<DT id="1492"><B>-fdump-rtl-bbro</B><DD>
|
|
|
|
|
|
Dump after block reordering.
|
|
<DT id="1493"><B>-fdump-rtl-btl1</B><DD>
|
|
|
|
|
|
|
|
<DT id="1494"><B>-fdump-rtl-btl2</B><DD>
|
|
|
|
|
|
|
|
<B>-fdump-rtl-btl1</B> and <B>-fdump-rtl-btl2</B> enable dumping
|
|
after the two branch
|
|
target load optimization passes.
|
|
<DT id="1495"><B>-fdump-rtl-bypass</B><DD>
|
|
|
|
|
|
Dump after jump bypassing and control flow optimizations.
|
|
<DT id="1496"><B>-fdump-rtl-combine</B><DD>
|
|
|
|
|
|
Dump after the <FONT SIZE="-1">RTL</FONT> instruction combination pass.
|
|
<DT id="1497"><B>-fdump-rtl-compgotos</B><DD>
|
|
|
|
|
|
Dump after duplicating the computed gotos.
|
|
<DT id="1498"><B>-fdump-rtl-ce1</B><DD>
|
|
|
|
|
|
|
|
<DT id="1499"><B>-fdump-rtl-ce2</B><DD>
|
|
|
|
|
|
<DT id="1500"><B>-fdump-rtl-ce3</B><DD>
|
|
|
|
|
|
|
|
<B>-fdump-rtl-ce1</B>, <B>-fdump-rtl-ce2</B>, and
|
|
<B>-fdump-rtl-ce3</B> enable dumping after the three
|
|
if conversion passes.
|
|
<DT id="1501"><B>-fdump-rtl-cprop_hardreg</B><DD>
|
|
|
|
|
|
Dump after hard register copy propagation.
|
|
<DT id="1502"><B>-fdump-rtl-csa</B><DD>
|
|
|
|
|
|
Dump after combining stack adjustments.
|
|
<DT id="1503"><B>-fdump-rtl-cse1</B><DD>
|
|
|
|
|
|
|
|
<DT id="1504"><B>-fdump-rtl-cse2</B><DD>
|
|
|
|
|
|
|
|
<B>-fdump-rtl-cse1</B> and <B>-fdump-rtl-cse2</B> enable dumping after
|
|
the two common subexpression elimination passes.
|
|
<DT id="1505"><B>-fdump-rtl-dce</B><DD>
|
|
|
|
|
|
Dump after the standalone dead code elimination passes.
|
|
<DT id="1506"><B>-fdump-rtl-dbr</B><DD>
|
|
|
|
|
|
Dump after delayed branch scheduling.
|
|
<DT id="1507"><B>-fdump-rtl-dce1</B><DD>
|
|
|
|
|
|
|
|
<DT id="1508"><B>-fdump-rtl-dce2</B><DD>
|
|
|
|
|
|
|
|
<B>-fdump-rtl-dce1</B> and <B>-fdump-rtl-dce2</B> enable dumping after
|
|
the two dead store elimination passes.
|
|
<DT id="1509"><B>-fdump-rtl-eh</B><DD>
|
|
|
|
|
|
Dump after finalization of <FONT SIZE="-1">EH</FONT> handling code.
|
|
<DT id="1510"><B>-fdump-rtl-eh_ranges</B><DD>
|
|
|
|
|
|
Dump after conversion of <FONT SIZE="-1">EH</FONT> handling range regions.
|
|
<DT id="1511"><B>-fdump-rtl-expand</B><DD>
|
|
|
|
|
|
Dump after <FONT SIZE="-1">RTL</FONT> generation.
|
|
<DT id="1512"><B>-fdump-rtl-fwprop1</B><DD>
|
|
|
|
|
|
|
|
<DT id="1513"><B>-fdump-rtl-fwprop2</B><DD>
|
|
|
|
|
|
|
|
<B>-fdump-rtl-fwprop1</B> and <B>-fdump-rtl-fwprop2</B> enable
|
|
dumping after the two forward propagation passes.
|
|
<DT id="1514"><B>-fdump-rtl-gcse1</B><DD>
|
|
|
|
|
|
|
|
<DT id="1515"><B>-fdump-rtl-gcse2</B><DD>
|
|
|
|
|
|
|
|
<B>-fdump-rtl-gcse1</B> and <B>-fdump-rtl-gcse2</B> enable dumping
|
|
after global common subexpression elimination.
|
|
<DT id="1516"><B>-fdump-rtl-init-regs</B><DD>
|
|
|
|
|
|
Dump after the initialization of the registers.
|
|
<DT id="1517"><B>-fdump-rtl-initvals</B><DD>
|
|
|
|
|
|
Dump after the computation of the initial value sets.
|
|
<DT id="1518"><B>-fdump-rtl-into_cfglayout</B><DD>
|
|
|
|
|
|
Dump after converting to cfglayout mode.
|
|
<DT id="1519"><B>-fdump-rtl-ira</B><DD>
|
|
|
|
|
|
Dump after iterated register allocation.
|
|
<DT id="1520"><B>-fdump-rtl-jump</B><DD>
|
|
|
|
|
|
Dump after the second jump optimization.
|
|
<DT id="1521"><B>-fdump-rtl-loop2</B><DD>
|
|
|
|
|
|
<B>-fdump-rtl-loop2</B> enables dumping after the rtl
|
|
loop optimization passes.
|
|
<DT id="1522"><B>-fdump-rtl-mach</B><DD>
|
|
|
|
|
|
Dump after performing the machine dependent reorganization pass, if that
|
|
pass exists.
|
|
<DT id="1523"><B>-fdump-rtl-mode_sw</B><DD>
|
|
|
|
|
|
Dump after removing redundant mode switches.
|
|
<DT id="1524"><B>-fdump-rtl-rnreg</B><DD>
|
|
|
|
|
|
Dump after register renumbering.
|
|
<DT id="1525"><B>-fdump-rtl-outof_cfglayout</B><DD>
|
|
|
|
|
|
Dump after converting from cfglayout mode.
|
|
<DT id="1526"><B>-fdump-rtl-peephole2</B><DD>
|
|
|
|
|
|
Dump after the peephole pass.
|
|
<DT id="1527"><B>-fdump-rtl-postreload</B><DD>
|
|
|
|
|
|
Dump after post-reload optimizations.
|
|
<DT id="1528"><B>-fdump-rtl-pro_and_epilogue</B><DD>
|
|
|
|
|
|
Dump after generating the function prologues and epilogues.
|
|
<DT id="1529"><B>-fdump-rtl-sched1</B><DD>
|
|
|
|
|
|
|
|
<DT id="1530"><B>-fdump-rtl-sched2</B><DD>
|
|
|
|
|
|
|
|
<B>-fdump-rtl-sched1</B> and <B>-fdump-rtl-sched2</B> enable dumping
|
|
after the basic block scheduling passes.
|
|
<DT id="1531"><B>-fdump-rtl-ree</B><DD>
|
|
|
|
|
|
Dump after sign/zero extension elimination.
|
|
<DT id="1532"><B>-fdump-rtl-seqabstr</B><DD>
|
|
|
|
|
|
Dump after common sequence discovery.
|
|
<DT id="1533"><B>-fdump-rtl-shorten</B><DD>
|
|
|
|
|
|
Dump after shortening branches.
|
|
<DT id="1534"><B>-fdump-rtl-sibling</B><DD>
|
|
|
|
|
|
Dump after sibling call optimizations.
|
|
<DT id="1535"><B>-fdump-rtl-split1</B><DD>
|
|
|
|
|
|
|
|
<DT id="1536"><B>-fdump-rtl-split2</B><DD>
|
|
|
|
|
|
<DT id="1537"><B>-fdump-rtl-split3</B><DD>
|
|
|
|
|
|
<DT id="1538"><B>-fdump-rtl-split4</B><DD>
|
|
|
|
|
|
<DT id="1539"><B>-fdump-rtl-split5</B><DD>
|
|
|
|
|
|
|
|
These options enable dumping after five rounds of
|
|
instruction splitting.
|
|
<DT id="1540"><B>-fdump-rtl-sms</B><DD>
|
|
|
|
|
|
Dump after modulo scheduling. This pass is only run on some
|
|
architectures.
|
|
<DT id="1541"><B>-fdump-rtl-stack</B><DD>
|
|
|
|
|
|
Dump after conversion from <FONT SIZE="-1">GCC</FONT>'s ``flat register file'' registers to the
|
|
x87's stack-like registers. This pass is only run on x86 variants.
|
|
<DT id="1542"><B>-fdump-rtl-subreg1</B><DD>
|
|
|
|
|
|
|
|
<DT id="1543"><B>-fdump-rtl-subreg2</B><DD>
|
|
|
|
|
|
|
|
<B>-fdump-rtl-subreg1</B> and <B>-fdump-rtl-subreg2</B> enable dumping after
|
|
the two subreg expansion passes.
|
|
<DT id="1544"><B>-fdump-rtl-unshare</B><DD>
|
|
|
|
|
|
Dump after all rtl has been unshared.
|
|
<DT id="1545"><B>-fdump-rtl-vartrack</B><DD>
|
|
|
|
|
|
Dump after variable tracking.
|
|
<DT id="1546"><B>-fdump-rtl-vregs</B><DD>
|
|
|
|
|
|
Dump after converting virtual registers to hard registers.
|
|
<DT id="1547"><B>-fdump-rtl-web</B><DD>
|
|
|
|
|
|
Dump after live range splitting.
|
|
<DT id="1548"><B>-fdump-rtl-regclass</B><DD>
|
|
|
|
|
|
|
|
<DT id="1549"><B>-fdump-rtl-subregs_of_mode_init</B><DD>
|
|
|
|
|
|
<DT id="1550"><B>-fdump-rtl-subregs_of_mode_finish</B><DD>
|
|
|
|
|
|
<DT id="1551"><B>-fdump-rtl-dfinit</B><DD>
|
|
|
|
|
|
<DT id="1552"><B>-fdump-rtl-dfinish</B><DD>
|
|
|
|
|
|
|
|
These dumps are defined but always produce empty files.
|
|
<DT id="1553"><B>-da</B><DD>
|
|
|
|
|
|
|
|
<DT id="1554"><B>-fdump-rtl-all</B><DD>
|
|
|
|
|
|
|
|
Produce all the dumps listed above.
|
|
<DT id="1555"><B>-dA</B><DD>
|
|
|
|
|
|
Annotate the assembler output with miscellaneous debugging information.
|
|
<DT id="1556"><B>-dD</B><DD>
|
|
|
|
|
|
Dump all macro definitions, at the end of preprocessing, in addition to
|
|
normal output.
|
|
<DT id="1557"><B>-dH</B><DD>
|
|
|
|
|
|
Produce a core dump whenever an error occurs.
|
|
<DT id="1558"><B>-dp</B><DD>
|
|
|
|
|
|
Annotate the assembler output with a comment indicating which
|
|
pattern and alternative is used. The length and cost of each instruction are
|
|
also printed.
|
|
<DT id="1559"><B>-dP</B><DD>
|
|
|
|
|
|
Dump the <FONT SIZE="-1">RTL</FONT> in the assembler output as a comment before each instruction.
|
|
Also turns on <B>-dp</B> annotation.
|
|
<DT id="1560"><B>-dx</B><DD>
|
|
|
|
|
|
Just generate <FONT SIZE="-1">RTL</FONT> for a function instead of compiling it. Usually used
|
|
with <B>-fdump-rtl-expand</B>.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1561"><DD>
|
|
</DL>
|
|
|
|
<DT id="1562"><B>-fdump-debug</B><DD>
|
|
|
|
|
|
Dump debugging information generated during the debug
|
|
generation phase.
|
|
<DT id="1563"><B>-fdump-earlydebug</B><DD>
|
|
|
|
|
|
Dump debugging information generated during the early debug
|
|
generation phase.
|
|
<DT id="1564"><B>-fdump-noaddr</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="1565"><B>-freport-bug</B><DD>
|
|
|
|
|
|
Collect and dump debug information into a temporary file if an
|
|
internal compiler error (<FONT SIZE="-1">ICE</FONT>) occurs.
|
|
<DT id="1566"><B>-fdump-unnumbered</B><DD>
|
|
|
|
|
|
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
|
|
<B>-g</B>.
|
|
<DT id="1567"><B>-fdump-unnumbered-links</B><DD>
|
|
|
|
|
|
When doing debugging dumps (see <B>-d</B> option above), suppress
|
|
instruction numbers for the links to the previous and next instructions
|
|
in a sequence.
|
|
<DT id="1568"><B>-fdump-ipa-</B><I>switch</I><DD>
|
|
|
|
|
|
|
|
<DT id="1569"><B>-fdump-ipa-</B><I>switch</I><B>-</B><I>options</I><DD>
|
|
|
|
|
|
|
|
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
|
|
in the same directory as the output file. The following dumps are
|
|
possible:
|
|
<DL COMPACT><DT id="1570"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1571"><B>all</B><DD>
|
|
|
|
|
|
Enables all inter-procedural analysis dumps.
|
|
<DT id="1572"><B>cgraph</B><DD>
|
|
|
|
|
|
Dumps information about call-graph optimization, unused function removal,
|
|
and inlining decisions.
|
|
<DT id="1573"><B>inline</B><DD>
|
|
|
|
|
|
Dump after function inlining.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1574"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Additionally, the options <B>-optimized</B>, <B>-missed</B>,
|
|
<B>-note</B>, and <B>-all</B> can be provided, with the same meaning
|
|
as for <B>-fopt-info</B>, defaulting to <B>-optimized</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, <B>-fdump-ipa-inline-optimized-missed</B> will emit
|
|
information on callsites that were inlined, along with callsites
|
|
that were not inlined.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
By default, the dump will contain messages about successful
|
|
optimizations (equivalent to <B>-optimized</B>) together with
|
|
low-level details about the analysis.
|
|
</DL>
|
|
|
|
<DT id="1575"><B>-fdump-lang-all</B><DD>
|
|
|
|
|
|
|
|
<DT id="1576"><B>-fdump-lang-</B><I>switch</I><DD>
|
|
|
|
|
|
<DT id="1577"><B>-fdump-lang-</B><I>switch</I><B>-</B><I>options</I><DD>
|
|
|
|
|
|
<DT id="1578"><B>-fdump-lang-</B><I>switch</I><B>-</B><I>options</I><B>=</B><I>filename</I><DD>
|
|
|
|
|
|
|
|
Control the dumping of language-specific information. The <I>options</I>
|
|
and <I>filename</I> portions behave as described in the
|
|
<B>-fdump-tree</B> option. The following <I>switch</I> values are
|
|
accepted:
|
|
<DL COMPACT><DT id="1579"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1580"><B>all</B><DD>
|
|
|
|
|
|
Enable all language-specific dumps.
|
|
<DT id="1581"><B>class</B><DD>
|
|
|
|
|
|
Dump class hierarchy information. Virtual table information is emitted
|
|
unless '<B>slim</B>' is specified. This option is applicable to C<FONT SIZE="-2">++</FONT> only.
|
|
<DT id="1582"><B>raw</B><DD>
|
|
|
|
|
|
Dump the raw internal tree data. This option is applicable to C<FONT SIZE="-2">++</FONT> only.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1583"><DD>
|
|
</DL>
|
|
|
|
<DT id="1584"><B>-fdump-passes</B><DD>
|
|
|
|
|
|
Print on <I>stderr</I> the list of optimization passes that are turned
|
|
on and off by the current command-line options.
|
|
<DT id="1585"><B>-fdump-statistics-</B><I>option</I><DD>
|
|
|
|
|
|
Enable and control dumping of pass statistics in a separate file. The
|
|
file name is generated by appending a suffix ending in
|
|
<B>.statistics</B> to the source file name, and the file is created in
|
|
the same directory as the output file. If the <B>-</B><I>option</I>
|
|
form is used, <B>-stats</B> causes counters to be summed over the
|
|
whole compilation unit while <B>-details</B> dumps every event as
|
|
the passes generate them. The default with no option is to sum
|
|
counters for each function compiled.
|
|
<DT id="1586"><B>-fdump-tree-all</B><DD>
|
|
|
|
|
|
|
|
<DT id="1587"><B>-fdump-tree-</B><I>switch</I><DD>
|
|
|
|
|
|
<DT id="1588"><B>-fdump-tree-</B><I>switch</I><B>-</B><I>options</I><DD>
|
|
|
|
|
|
<DT id="1589"><B>-fdump-tree-</B><I>switch</I><B>-</B><I>options</I><B>=</B><I>filename</I><DD>
|
|
|
|
|
|
|
|
Control the dumping at various stages of processing the intermediate
|
|
language tree to a file. If the <B>-</B><I>options</I>
|
|
form is used, <I>options</I> is a list of <B>-</B> separated options
|
|
which control the details of the dump. Not all options are applicable
|
|
to all dumps; those that are not meaningful are ignored. The
|
|
following options are available
|
|
<DL COMPACT><DT id="1590"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1591"><B>address</B><DD>
|
|
|
|
|
|
Print the address of each node. Usually this is not meaningful as it
|
|
changes according to the environment and source file. Its primary use
|
|
is for tying up a dump file with a debug environment.
|
|
<DT id="1592"><B>asmname</B><DD>
|
|
|
|
|
|
If <TT>"DECL_ASSEMBLER_NAME"</TT> has been set for a given decl, use that
|
|
in the dump instead of <TT>"DECL_NAME"</TT>. Its primary use is ease of
|
|
use working backward from mangled names in the assembly file.
|
|
<DT id="1593"><B>slim</B><DD>
|
|
|
|
|
|
When dumping front-end intermediate representations, inhibit dumping
|
|
of members of a scope or body of a function merely because that scope
|
|
has been reached. Only dump such items when they are directly reachable
|
|
by some other path.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When dumping pretty-printed trees, this option inhibits dumping the
|
|
bodies of control structures.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When dumping <FONT SIZE="-1">RTL,</FONT> print the <FONT SIZE="-1">RTL</FONT> in slim (condensed) form instead of
|
|
the default LISP-like representation.
|
|
<DT id="1594"><B>raw</B><DD>
|
|
|
|
|
|
Print a raw representation of the tree. By default, trees are
|
|
pretty-printed into a C-like representation.
|
|
<DT id="1595"><B>details</B><DD>
|
|
|
|
|
|
Enable more detailed dumps (not honored by every dump option). Also
|
|
include information from the optimization passes.
|
|
<DT id="1596"><B>stats</B><DD>
|
|
|
|
|
|
Enable dumping various statistics about the pass (not honored by every dump
|
|
option).
|
|
<DT id="1597"><B>blocks</B><DD>
|
|
|
|
|
|
Enable showing basic block boundaries (disabled in raw dumps).
|
|
<DT id="1598"><B>graph</B><DD>
|
|
|
|
|
|
For each of the other indicated dump files (<B>-fdump-rtl-</B><I>pass</I>),
|
|
dump a representation of the control flow graph suitable for viewing with
|
|
GraphViz to <I>file.passid.pass.dot</I>. Each function in
|
|
the file is pretty-printed as a subgraph, so that GraphViz can render them
|
|
all in a single plot.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option currently only works for <FONT SIZE="-1">RTL</FONT> dumps, and the <FONT SIZE="-1">RTL</FONT> is always
|
|
dumped in slim form.
|
|
<DT id="1599"><B>vops</B><DD>
|
|
|
|
|
|
Enable showing virtual operands for every statement.
|
|
<DT id="1600"><B>lineno</B><DD>
|
|
|
|
|
|
Enable showing line numbers for statements.
|
|
<DT id="1601"><B>uid</B><DD>
|
|
|
|
|
|
Enable showing the unique <FONT SIZE="-1">ID</FONT> (<TT>"DECL_UID"</TT>) for each variable.
|
|
<DT id="1602"><B>verbose</B><DD>
|
|
|
|
|
|
Enable showing the tree dump for each statement.
|
|
<DT id="1603"><B>eh</B><DD>
|
|
|
|
|
|
Enable showing the <FONT SIZE="-1">EH</FONT> region number holding each statement.
|
|
<DT id="1604"><B>scev</B><DD>
|
|
|
|
|
|
Enable showing scalar evolution analysis details.
|
|
<DT id="1605"><B>optimized</B><DD>
|
|
|
|
|
|
Enable showing optimization information (only available in certain
|
|
passes).
|
|
<DT id="1606"><B>missed</B><DD>
|
|
|
|
|
|
Enable showing missed optimization information (only available in certain
|
|
passes).
|
|
<DT id="1607"><B>note</B><DD>
|
|
|
|
|
|
Enable other detailed optimization information (only available in
|
|
certain passes).
|
|
<DT id="1608"><B>all</B><DD>
|
|
|
|
|
|
Turn on all options, except <B>raw</B>, <B>slim</B>, <B>verbose</B>
|
|
and <B>lineno</B>.
|
|
<DT id="1609"><B>optall</B><DD>
|
|
|
|
|
|
Turn on all optimization options, i.e., <B>optimized</B>,
|
|
<B>missed</B>, and <B>note</B>.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1610"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To determine what tree dumps are available or find the dump for a pass
|
|
of interest follow the steps below.
|
|
<DL COMPACT>
|
|
<DT id="1611">1.<DD>
|
|
|
|
|
|
Invoke <FONT SIZE="-1">GCC</FONT> with <B>-fdump-passes</B> and in the <I>stderr</I> output
|
|
look for a code that corresponds to the pass you are interested in.
|
|
For example, the codes <TT>"tree-evrp"</TT>, <TT>"tree-vrp1"</TT>, and
|
|
<TT>"tree-vrp2"</TT> correspond to the three Value Range Propagation passes.
|
|
The number at the end distinguishes distinct invocations of the same pass.
|
|
<DT id="1612">2.<DD>
|
|
|
|
|
|
To enable the creation of the dump file, append the pass code to
|
|
the <B>-fdump-</B> option prefix and invoke <FONT SIZE="-1">GCC</FONT> with it. For example,
|
|
to enable the dump from the Early Value Range Propagation pass, invoke
|
|
<FONT SIZE="-1">GCC</FONT> with the <B>-fdump-tree-evrp</B> option. Optionally, you may
|
|
specify the name of the dump file. If you don't specify one, <FONT SIZE="-1">GCC</FONT>
|
|
creates as described below.
|
|
<DT id="1613">3.<DD>
|
|
|
|
|
|
Find the pass dump in a file whose name is composed of three components
|
|
separated by a period: the name of the source file <FONT SIZE="-1">GCC</FONT> was invoked to
|
|
compile, a numeric suffix indicating the pass number followed by the
|
|
letter <B>t</B> for tree passes (and the letter <B>r</B> for <FONT SIZE="-1">RTL</FONT> passes),
|
|
and finally the pass code. For example, the Early <FONT SIZE="-1">VRP</FONT> pass dump might
|
|
be in a file named <I>myfile.c.038t.evrp</I> in the current working
|
|
directory. Note that the numeric codes are not stable and may change
|
|
from one version of <FONT SIZE="-1">GCC</FONT> to another.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1614"><DD>
|
|
</DL>
|
|
|
|
<DT id="1615"><B>-fopt-info</B><DD>
|
|
|
|
|
|
|
|
<DT id="1616"><B>-fopt-info-</B><I>options</I><DD>
|
|
|
|
|
|
<DT id="1617"><B>-fopt-info-</B><I>options</I><B>=</B><I>filename</I><DD>
|
|
|
|
|
|
|
|
Controls optimization dumps from various optimization passes. If the
|
|
<B>-</B><I>options</I> form is used, <I>options</I> is a list of
|
|
<B>-</B> separated option keywords to select the dump details and
|
|
optimizations.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <I>options</I> can be divided into three groups:
|
|
<DL COMPACT><DT id="1618"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1619">1.<DD>
|
|
|
|
|
|
options describing what kinds of messages should be emitted,
|
|
<DT id="1620">2.<DD>
|
|
|
|
|
|
options describing the verbosity of the dump, and
|
|
<DT id="1621">3.<DD>
|
|
|
|
|
|
options describing which optimizations should be included.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1622"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The options from each group can be freely mixed as they are
|
|
non-overlapping. However, in case of any conflicts,
|
|
the later options override the earlier options on the command
|
|
line.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The following options control which kinds of messages should be emitted:
|
|
<DL COMPACT>
|
|
<DT id="1623"><B>optimized</B><DD>
|
|
|
|
|
|
Print information when an optimization is successfully applied. It is
|
|
up to a pass to decide which information is relevant. For example, the
|
|
vectorizer passes print the source location of loops which are
|
|
successfully vectorized.
|
|
<DT id="1624"><B>missed</B><DD>
|
|
|
|
|
|
Print information about missed optimizations. Individual passes
|
|
control which information to include in the output.
|
|
<DT id="1625"><B>note</B><DD>
|
|
|
|
|
|
Print verbose information about optimizations, such as certain
|
|
transformations, more detailed messages about decisions etc.
|
|
<DT id="1626"><B>all</B><DD>
|
|
|
|
|
|
Print detailed optimization information. This includes
|
|
<B>optimized</B>, <B>missed</B>, and <B>note</B>.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1627"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The following option controls the dump verbosity:
|
|
<DL COMPACT>
|
|
<DT id="1628"><B>internals</B><DD>
|
|
|
|
|
|
By default, only ``high-level'' messages are emitted. This option enables
|
|
additional, more detailed, messages, which are likely to only be of interest
|
|
to <FONT SIZE="-1">GCC</FONT> developers.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1629"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
One or more of the following option keywords can be used to describe a
|
|
group of optimizations:
|
|
<DL COMPACT>
|
|
<DT id="1630"><B>ipa</B><DD>
|
|
|
|
|
|
Enable dumps from all interprocedural optimizations.
|
|
<DT id="1631"><B>loop</B><DD>
|
|
|
|
|
|
Enable dumps from all loop optimizations.
|
|
<DT id="1632"><B>inline</B><DD>
|
|
|
|
|
|
Enable dumps from all inlining optimizations.
|
|
<DT id="1633"><B>omp</B><DD>
|
|
|
|
|
|
Enable dumps from all <FONT SIZE="-1">OMP</FONT> (Offloading and Multi Processing) optimizations.
|
|
<DT id="1634"><B>vec</B><DD>
|
|
|
|
|
|
Enable dumps from all vectorization optimizations.
|
|
<DT id="1635"><B>optall</B><DD>
|
|
|
|
|
|
Enable dumps from all optimizations. This is a superset of
|
|
the optimization groups listed above.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1636"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>options</I> is
|
|
omitted, it defaults to <B>optimized-optall</B>, which means to dump messages
|
|
about successful optimizations from all the passes, omitting messages
|
|
that are treated as ``internals''.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If the <I>filename</I> is provided, then the dumps from all the
|
|
applicable optimizations are concatenated into the <I>filename</I>.
|
|
Otherwise the dump is output onto <I>stderr</I>. Though multiple
|
|
<B>-fopt-info</B> options are accepted, only one of them can include
|
|
a <I>filename</I>. If other filenames are provided then all but the
|
|
first such option are ignored.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that the output <I>filename</I> is overwritten
|
|
in case of multiple translation units. If a combined output from
|
|
multiple translation units is desired, <I>stderr</I> should be used
|
|
instead.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In the following example, the optimization info is output to
|
|
<I>stderr</I>:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -O3 -fopt-info
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -O3 -fopt-info-missed=missed.all
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
outputs missed optimization report from all the passes into
|
|
<I>missed.all</I>, and this one:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -O2 -ftree-vectorize -fopt-info-vec-missed
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
prints information about missed optimization opportunities from
|
|
vectorization passes on <I>stderr</I>.
|
|
Note that <B>-fopt-info-vec-missed</B> is equivalent to
|
|
<B>-fopt-info-missed-vec</B>. The order of the optimization group
|
|
names and message types listed after <B>-fopt-info</B> does not matter.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
As another example,
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
outputs information about missed optimizations as well as
|
|
optimized locations from all the inlining passes into
|
|
<I>inline.txt</I>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Finally, consider:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Here the two output filenames <I>vec.miss</I> and <I>loop.opt</I> are
|
|
in conflict since only one output file is allowed. In this case, only
|
|
the first option takes effect and the subsequent options are
|
|
ignored. Thus only <I>vec.miss</I> is produced which contains
|
|
dumps from the vectorizer about missed opportunities.
|
|
</DL>
|
|
|
|
<DT id="1637"><B>-fsave-optimization-record</B><DD>
|
|
|
|
|
|
Write a <FONT SIZE="-1">SRCFILE</FONT>.opt-record.json.gz file detailing what optimizations
|
|
were performed, for those optimizations that support <B>-fopt-info</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is experimental and the format of the data within the
|
|
compressed <FONT SIZE="-1">JSON</FONT> file is subject to change.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It is roughly equivalent to a machine-readable version of
|
|
<B>-fopt-info-all</B>, as a collection of messages with source file,
|
|
line number and column number, with the following additional data for
|
|
each message:
|
|
<DL COMPACT><DT id="1638"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1639">*<DD>
|
|
the execution count of the code being optimized, along with metadata about
|
|
whether this was from actual profile data, or just an estimate, allowing
|
|
consumers to prioritize messages by code hotness,
|
|
<DT id="1640">*<DD>
|
|
the function name of the code being optimized, where applicable,
|
|
<DT id="1641">*<DD>
|
|
the ``inlining chain'' for the code being optimized, so that when
|
|
a function is inlined into several different places (which might
|
|
themselves be inlined), the reader can distinguish between the copies,
|
|
<DT id="1642">*<DD>
|
|
objects identifying those parts of the message that refer to expressions,
|
|
statements or symbol-table nodes, which of these categories they are, and,
|
|
when available, their source code location,
|
|
<DT id="1643">*<DD>
|
|
the <FONT SIZE="-1">GCC</FONT> pass that emitted the message, and
|
|
<DT id="1644">*<DD>
|
|
the location in <FONT SIZE="-1">GCC</FONT>'s own code from which the message was emitted
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1645"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Additionally, some messages are logically nested within other
|
|
messages, reflecting implementation details of the optimization
|
|
passes.
|
|
</DL>
|
|
|
|
<DT id="1646"><B>-fsched-verbose=</B><I>n</I><DD>
|
|
|
|
|
|
On targets that use instruction scheduling, this option controls the
|
|
amount of debugging output the scheduler prints to the dump files.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For <I>n</I> greater than zero, <B>-fsched-verbose</B> outputs the
|
|
same information as <B>-fdump-rtl-sched1</B> and <B>-fdump-rtl-sched2</B>.
|
|
For <I>n</I> greater than one, it also output basic block probabilities,
|
|
detailed ready list information and unit/insn info. For <I>n</I> greater
|
|
than two, it includes <FONT SIZE="-1">RTL</FONT> at abort point, control-flow and regions info.
|
|
And for <I>n</I> over four, <B>-fsched-verbose</B> also includes
|
|
dependence info.
|
|
<DT id="1647"><B>-fenable-</B><I>kind</I><B>-</B><I>pass</I><DD>
|
|
|
|
|
|
|
|
<DT id="1648"><B>-fdisable-</B><I>kind</I><B>-</B><I>pass</I><B>=</B><I>range-list</I><DD>
|
|
|
|
|
|
|
|
This is a set of options that are used to explicitly disable/enable
|
|
optimization passes. These options are intended for use for debugging <FONT SIZE="-1">GCC.</FONT>
|
|
Compiler users should use regular options for enabling/disabling
|
|
passes instead.
|
|
<DL COMPACT><DT id="1649"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1650"><B>-fdisable-ipa-</B><I>pass</I><DD>
|
|
|
|
|
|
Disable <FONT SIZE="-1">IPA</FONT> pass <I>pass</I>. <I>pass</I> is the pass name. If the same pass is
|
|
statically invoked in the compiler multiple times, the pass name should be
|
|
appended with a sequential number starting from 1.
|
|
<DT id="1651"><B>-fdisable-rtl-</B><I>pass</I><DD>
|
|
|
|
|
|
|
|
<DT id="1652"><B>-fdisable-rtl-</B><I>pass</I><B>=</B><I>range-list</I><DD>
|
|
|
|
|
|
|
|
Disable <FONT SIZE="-1">RTL</FONT> pass <I>pass</I>. <I>pass</I> is the pass name. If the same pass is
|
|
statically invoked in the compiler multiple times, the pass name should be
|
|
appended with a sequential number starting from 1. <I>range-list</I> is a
|
|
comma-separated list of function ranges or assembler names. Each range is a number
|
|
pair separated by a colon. The range is inclusive in both ends. If the range
|
|
is trivial, the number pair can be simplified as a single number. If the
|
|
function's call graph node's <I>uid</I> falls within one of the specified ranges,
|
|
the <I>pass</I> is disabled for that function. The <I>uid</I> is shown in the
|
|
function header of a dump file, and the pass names can be dumped by using
|
|
option <B>-fdump-passes</B>.
|
|
<DT id="1653"><B>-fdisable-tree-</B><I>pass</I><DD>
|
|
|
|
|
|
|
|
<DT id="1654"><B>-fdisable-tree-</B><I>pass</I><B>=</B><I>range-list</I><DD>
|
|
|
|
|
|
|
|
Disable tree pass <I>pass</I>. See <B>-fdisable-rtl</B> for the description of
|
|
option arguments.
|
|
<DT id="1655"><B>-fenable-ipa-</B><I>pass</I><DD>
|
|
|
|
|
|
Enable <FONT SIZE="-1">IPA</FONT> pass <I>pass</I>. <I>pass</I> is the pass name. If the same pass is
|
|
statically invoked in the compiler multiple times, the pass name should be
|
|
appended with a sequential number starting from 1.
|
|
<DT id="1656"><B>-fenable-rtl-</B><I>pass</I><DD>
|
|
|
|
|
|
|
|
<DT id="1657"><B>-fenable-rtl-</B><I>pass</I><B>=</B><I>range-list</I><DD>
|
|
|
|
|
|
|
|
Enable <FONT SIZE="-1">RTL</FONT> pass <I>pass</I>. See <B>-fdisable-rtl</B> for option argument
|
|
description and examples.
|
|
<DT id="1658"><B>-fenable-tree-</B><I>pass</I><DD>
|
|
|
|
|
|
|
|
<DT id="1659"><B>-fenable-tree-</B><I>pass</I><B>=</B><I>range-list</I><DD>
|
|
|
|
|
|
|
|
Enable tree pass <I>pass</I>. See <B>-fdisable-rtl</B> for the description
|
|
of option arguments.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1660"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Here are some examples showing uses of these options.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
# disable ccp1 for all functions
|
|
-fdisable-tree-ccp1
|
|
# disable complete unroll for function whose cgraph node uid is 1
|
|
-fenable-tree-cunroll=1
|
|
# disable gcse2 for functions at the following ranges [1,1],
|
|
# [300,400], and [400,1000]
|
|
# disable gcse2 for functions foo and foo2
|
|
-fdisable-rtl-gcse2=foo,foo2
|
|
# disable early inlining
|
|
-fdisable-tree-einline
|
|
# disable ipa inlining
|
|
-fdisable-ipa-inline
|
|
# enable tree full unroll
|
|
-fenable-tree-unroll
|
|
|
|
</PRE>
|
|
|
|
|
|
</DL>
|
|
|
|
<DT id="1661"><B>-fchecking</B><DD>
|
|
|
|
|
|
|
|
<DT id="1662"><B>-fchecking=</B><I>n</I><DD>
|
|
|
|
|
|
|
|
Enable internal consistency checking. The default depends on
|
|
the compiler configuration. <B>-fchecking=2</B> enables further
|
|
internal consistency checking that might affect code generation.
|
|
<DT id="1663"><B>-frandom-seed=</B><I>string</I><DD>
|
|
|
|
|
|
This option provides a seed that <FONT SIZE="-1">GCC</FONT> 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
|
|
place unique stamps in coverage data files and the object files that
|
|
produce them. You can use the <B>-frandom-seed</B> option to produce
|
|
reproducibly identical object files.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <I>string</I> can either be a number (decimal, octal or hex) or an
|
|
arbitrary string (in which case it's converted to a number by
|
|
computing <FONT SIZE="-1">CRC32</FONT>).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <I>string</I> should be different for every file you compile.
|
|
<DT id="1664"><B>-save-temps</B><DD>
|
|
|
|
|
|
|
|
<DT id="1665"><B>-save-temps=cwd</B><DD>
|
|
|
|
|
|
|
|
Store the usual ``temporary'' intermediate files permanently; place them
|
|
in the current directory and name them based on the source file. Thus,
|
|
compiling <I>foo.c</I> with <B>-c -save-temps</B> produces files
|
|
<I>foo.i</I> and <I>foo.s</I>, as well as <I>foo.o</I>. This creates a
|
|
preprocessed <I>foo.i</I> output file even though the compiler now
|
|
normally uses an integrated preprocessor.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When used in combination with the <B>-x</B> command-line option,
|
|
<B>-save-temps</B> is sensible enough to avoid over writing an
|
|
input source file with the same extension as an intermediate file.
|
|
The corresponding intermediate file may be obtained by renaming the
|
|
source file before using <B>-save-temps</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you invoke <FONT SIZE="-1">GCC</FONT> in parallel, compiling several different source
|
|
files that share a common base name in different subdirectories or the
|
|
same source file compiled for multiple output destinations, it is
|
|
likely that the different parallel compilers will interfere with each
|
|
other, and overwrite the temporary files. For instance:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -save-temps -o outdir1/foo.o indir1/foo.c&
|
|
gcc -save-temps -o outdir2/foo.o indir2/foo.c&
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
may result in <I>foo.i</I> and <I>foo.o</I> being written to
|
|
simultaneously by both compilers.
|
|
<DT id="1666"><B>-save-temps=obj</B><DD>
|
|
|
|
|
|
Store the usual ``temporary'' intermediate files permanently. If the
|
|
<B>-o</B> option is used, the temporary files are based on the
|
|
object file. If the <B>-o</B> option is not used, the
|
|
<B>-save-temps=obj</B> switch behaves like <B>-save-temps</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -save-temps=obj -c foo.c
|
|
gcc -save-temps=obj -c bar.c -o dir/xbar.o
|
|
gcc -save-temps=obj foobar.c -o dir2/yfoobar
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
creates <I>foo.i</I>, <I>foo.s</I>, <I>dir/xbar.i</I>,
|
|
<I>dir/xbar.s</I>, <I>dir2/yfoobar.i</I>, <I>dir2/yfoobar.s</I>, and
|
|
<I>dir2/yfoobar.o</I>.
|
|
<DT id="1667"><B>-time</B>[<B>=</B><I>file</I>]<DD>
|
|
|
|
|
|
Report the <FONT SIZE="-1">CPU</FONT> 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).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Without the specification of an output file, the output looks like this:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
# cc1 0.12 0.01
|
|
# as 0.00 0.01
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The first number on each line is the ``user time'', that is time spent
|
|
executing the program itself. The second number is ``system time'',
|
|
time spent executing operating system routines on behalf of the program.
|
|
Both numbers are in seconds.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With the specification of an output file, the output is appended to the
|
|
named file, and it looks like this:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
0.12 0.01 cc1 <options>
|
|
0.00 0.01 as <options>
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The ``user time'' and the ``system time'' are moved before the program
|
|
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.
|
|
<DT id="1668"><B>-fdump-final-insns</B>[<B>=</B><I>file</I>]<DD>
|
|
|
|
|
|
Dump the final internal representation (<FONT SIZE="-1">RTL</FONT>) to <I>file</I>. If the
|
|
optional argument is omitted (or if <I>file</I> is <TT>"."</TT>), the name
|
|
of the dump file is determined by appending <TT>".gkd"</TT> to the
|
|
compilation output file name.
|
|
<DT id="1669"><B>-fcompare-debug</B>[<B>=</B><I>opts</I>]<DD>
|
|
|
|
|
|
If no error occurs during compilation, run the compiler a second time,
|
|
adding <I>opts</I> and <B>-fcompare-debug-second</B> to the arguments
|
|
passed to the second compilation. Dump the final internal
|
|
representation in both compilations, and print an error if they differ.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If the equal sign is omitted, the default <B>-gtoggle</B> is used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The environment variable <B></B><FONT SIZE="-1"><B>GCC_COMPARE_DEBUG</B></FONT><B></B>, if defined, non-empty
|
|
and nonzero, implicitly enables <B>-fcompare-debug</B>. If
|
|
<B></B><FONT SIZE="-1"><B>GCC_COMPARE_DEBUG</B></FONT><B></B> is defined to a string starting with a dash,
|
|
then it is used for <I>opts</I>, otherwise the default <B>-gtoggle</B>
|
|
is used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-fcompare-debug=</B>, with the equal sign but without <I>opts</I>,
|
|
is equivalent to <B>-fno-compare-debug</B>, which disables the dumping
|
|
of the final representation and the second compilation, preventing even
|
|
<B></B><FONT SIZE="-1"><B>GCC_COMPARE_DEBUG</B></FONT><B></B> from taking effect.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To verify full coverage during <B>-fcompare-debug</B> testing, set
|
|
<B></B><FONT SIZE="-1"><B>GCC_COMPARE_DEBUG</B></FONT><B></B> to say <B>-fcompare-debug-not-overridden</B>,
|
|
which <FONT SIZE="-1">GCC</FONT> rejects as an invalid option in any actual compilation
|
|
(rather than preprocessing, assembly or linking). To get just a
|
|
warning, setting <B></B><FONT SIZE="-1"><B>GCC_COMPARE_DEBUG</B></FONT><B></B> to <B>-w%n-fcompare-debug
|
|
not overridden</B> will do.
|
|
<DT id="1670"><B>-fcompare-debug-second</B><DD>
|
|
|
|
|
|
This option is implicitly passed to the compiler for the second
|
|
compilation requested by <B>-fcompare-debug</B>, along with options to
|
|
silence warnings, and omitting other options that would cause the compiler
|
|
to produce output to files or to standard output as a side effect. Dump
|
|
files and preserved temporary files are renamed so as to contain the
|
|
<TT>".gk"</TT> additional extension during the second compilation, to avoid
|
|
overwriting those generated by the first.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When this option is passed to the compiler driver, it causes the
|
|
<I>first</I> compilation to be skipped, which makes it useful for little
|
|
other than debugging the compiler proper.
|
|
<DT id="1671"><B>-gtoggle</B><DD>
|
|
|
|
|
|
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
|
|
other options are processed, and it does so only once, no matter how
|
|
many times it is given. This is mainly intended to be used with
|
|
<B>-fcompare-debug</B>.
|
|
<DT id="1672"><B>-fvar-tracking-assignments-toggle</B><DD>
|
|
|
|
|
|
Toggle <B>-fvar-tracking-assignments</B>, in the same way that
|
|
<B>-gtoggle</B> toggles <B>-g</B>.
|
|
<DT id="1673"><B>-Q</B><DD>
|
|
|
|
|
|
Makes the compiler print out each function name as it is compiled, and
|
|
print some statistics about each pass when it finishes.
|
|
<DT id="1674"><B>-ftime-report</B><DD>
|
|
|
|
|
|
Makes the compiler print some statistics about the time consumed by each
|
|
pass when it finishes.
|
|
<DT id="1675"><B>-ftime-report-details</B><DD>
|
|
|
|
|
|
Record the time consumed by infrastructure parts separately for each pass.
|
|
<DT id="1676"><B>-fira-verbose=</B><I>n</I><DD>
|
|
|
|
|
|
Control the verbosity of the dump file for the integrated register allocator.
|
|
The default value is 5. If the value <I>n</I> is greater or equal to 10,
|
|
the dump output is sent to stderr using the same format as <I>n</I> minus 10.
|
|
<DT id="1677"><B>-flto-report</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">GCC</FONT> developers when processing object
|
|
files in <FONT SIZE="-1">LTO</FONT> mode (via <B>-flto</B>).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Disabled by default.
|
|
<DT id="1678"><B>-flto-report-wpa</B><DD>
|
|
|
|
|
|
Like <B>-flto-report</B>, but only print for the <FONT SIZE="-1">WPA</FONT> phase of Link
|
|
Time Optimization.
|
|
<DT id="1679"><B>-fmem-report</B><DD>
|
|
|
|
|
|
Makes the compiler print some statistics about permanent memory
|
|
allocation when it finishes.
|
|
<DT id="1680"><B>-fmem-report-wpa</B><DD>
|
|
|
|
|
|
Makes the compiler print some statistics about permanent memory
|
|
allocation for the <FONT SIZE="-1">WPA</FONT> phase only.
|
|
<DT id="1681"><B>-fpre-ipa-mem-report</B><DD>
|
|
|
|
|
|
|
|
<DT id="1682"><B>-fpost-ipa-mem-report</B><DD>
|
|
|
|
|
|
|
|
Makes the compiler print some statistics about permanent memory
|
|
allocation before or after interprocedural optimization.
|
|
<DT id="1683"><B>-fprofile-report</B><DD>
|
|
|
|
|
|
Makes the compiler print some statistics about consistency of the
|
|
(estimated) profile and effect of individual passes.
|
|
<DT id="1684"><B>-fstack-usage</B><DD>
|
|
|
|
|
|
Makes the compiler output stack usage information for the program, on a
|
|
per-function basis. The filename for the dump is made by appending
|
|
<I>.su</I> to the <I>auxname</I>. <I>auxname</I> is generated from the name of
|
|
the output file, if explicitly specified and it is not an executable,
|
|
otherwise it is the basename of the source file. An entry is made up
|
|
of three fields:
|
|
<DL COMPACT><DT id="1685"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1686">*<DD>
|
|
The name of the function.
|
|
<DT id="1687">*<DD>
|
|
A number of bytes.
|
|
<DT id="1688">*<DD>
|
|
One or more qualifiers: <TT>"static"</TT>, <TT>"dynamic"</TT>, <TT>"bounded"</TT>.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1689"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The qualifier <TT>"static"</TT> means that the function manipulates the stack
|
|
statically: a fixed number of bytes are allocated for the frame on function
|
|
entry and released on function exit; no stack adjustments are otherwise made
|
|
in the function. The second field is this fixed number of bytes.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The qualifier <TT>"dynamic"</TT> means that the function manipulates the stack
|
|
dynamically: in addition to the static allocation described above, stack
|
|
adjustments are made in the body of the function, for example to push/pop
|
|
arguments around function calls. If the qualifier <TT>"bounded"</TT> is also
|
|
present, the amount of these adjustments is bounded at compile time and
|
|
the second field is an upper bound of the total amount of stack used by
|
|
the function. If it is not present, the amount of these adjustments is
|
|
not bounded at compile time and the second field only represents the
|
|
bounded part.
|
|
</DL>
|
|
|
|
<DT id="1690"><B>-fstats</B><DD>
|
|
|
|
|
|
Emit statistics about front-end processing at the end of the compilation.
|
|
This option is supported only by the C<FONT SIZE="-2">++</FONT> front end, and
|
|
the information is generally only useful to the G++ development team.
|
|
<DT id="1691"><B>-fdbg-cnt-list</B><DD>
|
|
|
|
|
|
Print the name and the counter upper bound for all debug counters.
|
|
<DT id="1692"><B>-fdbg-cnt=</B><I>counter-value-list</I><DD>
|
|
|
|
|
|
Set the internal debug counter lower and upper bound. <I>counter-value-list</I>
|
|
is a comma-separated list of <I>name</I>:<I>lower_bound</I>:<I>upper_bound</I>
|
|
tuples which sets the lower and the upper bound of each debug
|
|
counter <I>name</I>. The <I>lower_bound</I> is optional and is zero
|
|
initialized if not set.
|
|
All debug counters have the initial upper bound of <TT>"UINT_MAX"</TT>;
|
|
thus <TT>"dbg_cnt"</TT> returns true always unless the upper bound
|
|
is set by this option.
|
|
For example, with <B>-fdbg-cnt=dce:2:4,tail_call:10</B>,
|
|
<TT>"dbg_cnt(dce)"</TT> returns true only for third and fourth invocation.
|
|
For <TT>"dbg_cnt(tail_call)"</TT> true is returned for first 10 invocations.
|
|
<DT id="1693"><B>-print-file-name=</B><I>library</I><DD>
|
|
|
|
|
|
Print the full absolute name of the library file <I>library</I> that
|
|
would be used when linking---and don't do anything else. With this
|
|
option, <FONT SIZE="-1">GCC</FONT> does not compile or link anything; it just prints the
|
|
file name.
|
|
<DT id="1694"><B>-print-multi-directory</B><DD>
|
|
|
|
|
|
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 <B></B><FONT SIZE="-1"><B>GCC_EXEC_PREFIX</B></FONT><B></B>.
|
|
<DT id="1695"><B>-print-multi-lib</B><DD>
|
|
|
|
|
|
Print the mapping from multilib directory names to compiler switches
|
|
that enable them. The directory name is separated from the switches by
|
|
<B>;</B>, and each switch starts with an <B>@</B> instead of the
|
|
<B>-</B>, without spaces between multiple switches. This is supposed to
|
|
ease shell processing.
|
|
<DT id="1696"><B>-print-multi-os-directory</B><DD>
|
|
|
|
|
|
Print the path to <FONT SIZE="-1">OS</FONT> libraries for the selected
|
|
multilib, relative to some <I>lib</I> subdirectory. If <FONT SIZE="-1">OS</FONT> libraries are
|
|
present in the <I>lib</I> subdirectory and no multilibs are used, this is
|
|
usually just <I>.</I>, if <FONT SIZE="-1">OS</FONT> libraries are present in <I>libsuffix</I>
|
|
sibling directories this prints e.g. <I>../lib64</I>, <I>../lib</I> or
|
|
<I>../lib32</I>, or if <FONT SIZE="-1">OS</FONT> libraries are present in <I>lib/subdir</I>
|
|
subdirectories it prints e.g. <I>amd64</I>, <I>sparcv9</I> or <I>ev6</I>.
|
|
<DT id="1697"><B>-print-multiarch</B><DD>
|
|
|
|
|
|
Print the path to <FONT SIZE="-1">OS</FONT> libraries for the selected multiarch,
|
|
relative to some <I>lib</I> subdirectory.
|
|
<DT id="1698"><B>-print-prog-name=</B><I>program</I><DD>
|
|
|
|
|
|
Like <B>-print-file-name</B>, but searches for a program such as <B>cpp</B>.
|
|
<DT id="1699"><B>-print-libgcc-file-name</B><DD>
|
|
|
|
|
|
Same as <B>-print-file-name=libgcc.a</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This is useful when you use <B>-nostdlib</B> or <B>-nodefaultlibs</B>
|
|
but you do want to link with <I>libgcc.a</I>. You can do:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
gcc -nostdlib <files>... `gcc -print-libgcc-file-name`
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="1700"><B>-print-search-dirs</B><DD>
|
|
|
|
|
|
Print the name of the configured installation directory and a list of
|
|
program and library directories <B>gcc</B> searches---and don't do anything else.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This is useful when <B>gcc</B> prints the error message
|
|
<B>installation problem, cannot exec cpp0: No such file or directory</B>.
|
|
To resolve this you either need to put <I>cpp0</I> and the other compiler
|
|
components where <B>gcc</B> expects to find them, or you can set the environment
|
|
variable <B></B><FONT SIZE="-1"><B>GCC_EXEC_PREFIX</B></FONT><B></B> to the directory where you installed them.
|
|
Don't forget the trailing <B>/</B>.
|
|
<DT id="1701"><B>-print-sysroot</B><DD>
|
|
|
|
|
|
Print the target sysroot directory that is used during
|
|
compilation. This is the target sysroot specified either at configure
|
|
time or using the <B>--sysroot</B> option, possibly with an extra
|
|
suffix that depends on compilation options. If no target sysroot is
|
|
specified, the option prints nothing.
|
|
<DT id="1702"><B>-print-sysroot-headers-suffix</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="1703"><B>-dumpmachine</B><DD>
|
|
|
|
|
|
Print the compiler's target machine (for example,
|
|
<B>i686-pc-linux-gnu</B>)---and don't do anything else.
|
|
<DT id="1704"><B>-dumpversion</B><DD>
|
|
|
|
|
|
Print the compiler version (for example, <TT>3.0</TT>, <TT>6.3.0</TT> or <TT>7</TT>)---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
|
|
a single number (major version), two numbers separated by a dot (major and
|
|
minor version) or three numbers separated by dots (major, minor and patchlevel
|
|
version).
|
|
<DT id="1705"><B>-dumpfullversion</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="1706"><B>-dumpspecs</B><DD>
|
|
|
|
|
|
Print the compiler's built-in specs---and don't do anything else. (This
|
|
is used when <FONT SIZE="-1">GCC</FONT> itself is being built.)
|
|
</DL>
|
|
<A NAME="lbAW"> </A>
|
|
<H3>Machine-Dependent Options</H3>
|
|
|
|
|
|
|
|
Each target machine supported by <FONT SIZE="-1">GCC</FONT> can have its own options---for
|
|
example, to allow you to compile for a particular processor variant or
|
|
<FONT SIZE="-1">ABI,</FONT> or to control optimizations specific to that machine. By
|
|
convention, the names of machine-specific options start with
|
|
<B>-m</B>.
|
|
<P>
|
|
|
|
Some configurations of the compiler also support additional target-specific
|
|
options, usually for compatibility with other compilers on the same
|
|
platform.
|
|
<P>
|
|
|
|
<I>AArch64 Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined for AArch64 implementations:
|
|
<DL COMPACT>
|
|
<DT id="1707"><B>-mabi=</B><I>name</I><DD>
|
|
|
|
|
|
Generate code for the specified data model. Permissible values
|
|
are <B>ilp32</B> for SysV-like data model where int, long int and pointers
|
|
are 32 bits, and <B>lp64</B> for SysV-like data model where int is 32 bits,
|
|
but long int and pointers are 64 bits.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default depends on the specific target configuration. Note that
|
|
the <FONT SIZE="-1">LP64</FONT> and <FONT SIZE="-1">ILP32</FONT> ABIs are not link-compatible; you must compile your
|
|
entire program with the same <FONT SIZE="-1">ABI,</FONT> and link with a compatible set of libraries.
|
|
<DT id="1708"><B>-mbig-endian</B><DD>
|
|
|
|
|
|
Generate big-endian code. This is the default when <FONT SIZE="-1">GCC</FONT> is configured for an
|
|
<B>aarch64_be-*-*</B> target.
|
|
<DT id="1709"><B>-mgeneral-regs-only</B><DD>
|
|
|
|
|
|
Generate code which uses only the general-purpose registers. This will prevent
|
|
the compiler from using floating-point and Advanced <FONT SIZE="-1">SIMD</FONT> registers but will not
|
|
impose any restrictions on the assembler.
|
|
<DT id="1710"><B>-mlittle-endian</B><DD>
|
|
|
|
|
|
Generate little-endian code. This is the default when <FONT SIZE="-1">GCC</FONT> is configured for an
|
|
<B>aarch64-*-*</B> but not an <B>aarch64_be-*-*</B> target.
|
|
<DT id="1711"><B>-mcmodel=tiny</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="1712"><B>-mcmodel=small</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="1713"><B>-mcmodel=large</B><DD>
|
|
|
|
|
|
Generate code for the large code model. This makes no assumptions about
|
|
addresses and sizes of sections. Programs can be statically linked only.
|
|
<DT id="1714"><B>-mstrict-align</B><DD>
|
|
|
|
|
|
|
|
<DT id="1715"><B>-mno-strict-align</B><DD>
|
|
|
|
|
|
|
|
Avoid or allow generating memory accesses that may not be aligned on a natural
|
|
object boundary as described in the architecture specification.
|
|
<DT id="1716"><B>-momit-leaf-frame-pointer</B><DD>
|
|
|
|
|
|
|
|
<DT id="1717"><B>-mno-omit-leaf-frame-pointer</B><DD>
|
|
|
|
|
|
|
|
Omit or keep the frame pointer in leaf functions. The former behavior is the
|
|
default.
|
|
<DT id="1718"><B>-mstack-protector-guard=</B><I>guard</I><DD>
|
|
|
|
|
|
|
|
<DT id="1719"><B>-mstack-protector-guard-reg=</B><I>reg</I><DD>
|
|
|
|
|
|
<DT id="1720"><B>-mstack-protector-guard-offset=</B><I>offset</I><DD>
|
|
|
|
|
|
|
|
Generate stack protection code using canary at <I>guard</I>. Supported
|
|
locations are <B>global</B> for a global canary or <B>sysreg</B> for a
|
|
canary in an appropriate system register.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With the latter choice the options
|
|
<B>-mstack-protector-guard-reg=</B><I>reg</I> and
|
|
<B>-mstack-protector-guard-offset=</B><I>offset</I> furthermore specify
|
|
which system register to use as base register for reading the canary,
|
|
and from what offset from that base register. There is no default
|
|
register or offset as this is entirely for use within the Linux
|
|
kernel.
|
|
<DT id="1721"><B>-mstack-protector-guard=</B><I>guard</I><DD>
|
|
|
|
|
|
|
|
<DT id="1722"><B>-mstack-protector-guard-reg=</B><I>reg</I><DD>
|
|
|
|
|
|
<DT id="1723"><B>-mstack-protector-guard-offset=</B><I>offset</I><DD>
|
|
|
|
|
|
|
|
Generate stack protection code using canary at <I>guard</I>. Supported
|
|
locations are <B>global</B> for a global canary or <B>sysreg</B> for a
|
|
canary in an appropriate system register.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With the latter choice the options
|
|
<B>-mstack-protector-guard-reg=</B><I>reg</I> and
|
|
<B>-mstack-protector-guard-offset=</B><I>offset</I> furthermore specify
|
|
which system register to use as base register for reading the canary,
|
|
and from what offset from that base register. There is no default
|
|
register or offset as this is entirely for use within the Linux
|
|
kernel.
|
|
<DT id="1724"><B>-mtls-dialect=desc</B><DD>
|
|
|
|
|
|
Use <FONT SIZE="-1">TLS</FONT> descriptors as the thread-local storage mechanism for dynamic accesses
|
|
of <FONT SIZE="-1">TLS</FONT> variables. This is the default.
|
|
<DT id="1725"><B>-mtls-dialect=traditional</B><DD>
|
|
|
|
|
|
Use traditional <FONT SIZE="-1">TLS</FONT> as the thread-local storage mechanism for dynamic accesses
|
|
of <FONT SIZE="-1">TLS</FONT> variables.
|
|
<DT id="1726"><B>-mtls-size=</B><I>size</I><DD>
|
|
|
|
|
|
Specify bit size of immediate <FONT SIZE="-1">TLS</FONT> offsets. Valid values are 12, 24, 32, 48.
|
|
This option requires binutils 2.26 or newer.
|
|
<DT id="1727"><B>-mfix-cortex-a53-835769</B><DD>
|
|
|
|
|
|
|
|
<DT id="1728"><B>-mno-fix-cortex-a53-835769</B><DD>
|
|
|
|
|
|
|
|
Enable or disable the workaround for the <FONT SIZE="-1">ARM</FONT> Cortex-A53 erratum number 835769.
|
|
This involves inserting a <FONT SIZE="-1">NOP</FONT> instruction between memory instructions and
|
|
64-bit integer multiply-accumulate instructions.
|
|
<DT id="1729"><B>-mfix-cortex-a53-843419</B><DD>
|
|
|
|
|
|
|
|
<DT id="1730"><B>-mno-fix-cortex-a53-843419</B><DD>
|
|
|
|
|
|
|
|
Enable or disable the workaround for the <FONT SIZE="-1">ARM</FONT> Cortex-A53 erratum number 843419.
|
|
This erratum workaround is made at link time and this will only pass the
|
|
corresponding flag to the linker.
|
|
<DT id="1731"><B>-mlow-precision-recip-sqrt</B><DD>
|
|
|
|
|
|
|
|
<DT id="1732"><B>-mno-low-precision-recip-sqrt</B><DD>
|
|
|
|
|
|
|
|
Enable or disable the reciprocal square root approximation.
|
|
This option only has an effect if <B>-ffast-math</B> or
|
|
<B>-funsafe-math-optimizations</B> 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.
|
|
<DT id="1733"><B>-mlow-precision-sqrt</B><DD>
|
|
|
|
|
|
|
|
<DT id="1734"><B>-mno-low-precision-sqrt</B><DD>
|
|
|
|
|
|
|
|
Enable or disable the square root approximation.
|
|
This option only has an effect if <B>-ffast-math</B> or
|
|
<B>-funsafe-math-optimizations</B> is used as well. Enabling this reduces
|
|
precision of square root results to about 16 bits for
|
|
single precision and to 32 bits for double precision.
|
|
If enabled, it implies <B>-mlow-precision-recip-sqrt</B>.
|
|
<DT id="1735"><B>-mlow-precision-div</B><DD>
|
|
|
|
|
|
|
|
<DT id="1736"><B>-mno-low-precision-div</B><DD>
|
|
|
|
|
|
|
|
Enable or disable the division approximation.
|
|
This option only has an effect if <B>-ffast-math</B> or
|
|
<B>-funsafe-math-optimizations</B> is used as well. Enabling this reduces
|
|
precision of division results to about 16 bits for
|
|
single precision and to 32 bits for double precision.
|
|
<DT id="1737"><B>-mtrack-speculation</B><DD>
|
|
|
|
|
|
|
|
<DT id="1738"><B>-mno-track-speculation</B><DD>
|
|
|
|
|
|
|
|
Enable or disable generation of additional code to track speculative
|
|
execution through conditional branches. The tracking state can then
|
|
be used by the compiler when expanding calls to
|
|
<TT>"__builtin_speculation_safe_copy"</TT> to permit a more efficient code
|
|
sequence to be generated.
|
|
<DT id="1739"><B>-moutline-atomics</B><DD>
|
|
|
|
|
|
|
|
<DT id="1740"><B>-mno-outline-atomics</B><DD>
|
|
|
|
|
|
|
|
Enable or disable calls to out-of-line helpers to implement atomic operations.
|
|
These helpers will, at runtime, determine if the <FONT SIZE="-1">LSE</FONT> instructions from
|
|
ARMv8.1-A can be used; if not, they will use the load/store-exclusive
|
|
instructions that are present in the base ARMv8.0 <FONT SIZE="-1">ISA.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is only applicable when compiling for the base ARMv8.0
|
|
instruction set. If using a later revision, e.g. <B>-march=armv8.1-a</B>
|
|
or <B>-march=armv8-a+lse</B>, the ARMv8.1-Atomics instructions will be
|
|
used directly. The same applies when using <B>-mcpu=</B> when the
|
|
selected cpu supports the <B>lse</B> feature.
|
|
<DT id="1741"><B>-march=</B><I>name</I><DD>
|
|
|
|
|
|
Specify the name of the target architecture and, optionally, one or
|
|
more feature modifiers. This option has the form
|
|
<B>-march=</B><I>arch</I>{<B>+</B>[<B>no</B>]<I>feature</I>}*.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The permissible values for <I>arch</I> are <B>armv8-a</B>,
|
|
<B>armv8.1-a</B>, <B>armv8.2-a</B>, <B>armv8.3-a</B>, <B>armv8.4-a</B>,
|
|
<B>armv8.5-a</B> or <I>native</I>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The value <B>armv8.5-a</B> implies <B>armv8.4-a</B> and enables compiler
|
|
support for the ARMv8.5-A architecture extensions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The value <B>armv8.4-a</B> implies <B>armv8.3-a</B> and enables compiler
|
|
support for the ARMv8.4-A architecture extensions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The value <B>armv8.3-a</B> implies <B>armv8.2-a</B> and enables compiler
|
|
support for the ARMv8.3-A architecture extensions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The value <B>armv8.2-a</B> implies <B>armv8.1-a</B> and enables compiler
|
|
support for the ARMv8.2-A architecture extensions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The value <B>armv8.1-a</B> implies <B>armv8-a</B> and enables compiler
|
|
support for the ARMv8.1-A architecture extension. In particular, it
|
|
enables the <B>+crc</B>, <B>+lse</B>, and <B>+rdma</B> features.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The value <B>native</B> is available on native AArch64 GNU/Linux and
|
|
causes the compiler to pick the architecture of the host system. This
|
|
option has no effect if the compiler is unable to recognize the
|
|
architecture of the host system,
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The permissible values for <I>feature</I> are listed in the sub-section
|
|
on <B>aarch64-feature-modifiers,,</B><B>-march</B> <B>and</B> <B>-mcpu</B>
|
|
<B>Feature Modifiers</B>. Where conflicting feature modifiers are
|
|
specified, the right-most feature is used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> uses <I>name</I> to determine what kind of instructions it can emit
|
|
when generating assembly code. If <B>-march</B> is specified
|
|
without either of <B>-mtune</B> or <B>-mcpu</B> also being
|
|
specified, the code is tuned to perform well across a range of target
|
|
processors implementing the target architecture.
|
|
<DT id="1742"><B>-mtune=</B><I>name</I><DD>
|
|
|
|
|
|
Specify the name of the target processor for which <FONT SIZE="-1">GCC</FONT> should tune the
|
|
performance of the code. Permissible values for this option are:
|
|
<B>generic</B>, <B>cortex-a35</B>, <B>cortex-a53</B>, <B>cortex-a55</B>,
|
|
<B>cortex-a57</B>, <B>cortex-a72</B>, <B>cortex-a73</B>, <B>cortex-a75</B>,
|
|
<B>cortex-a76</B>, <B>ares</B>, <B>exynos-m1</B>, <B>emag</B>, <B>falkor</B>,
|
|
<B>neoverse-e1</B>,<B>neoverse-n1</B>,<B>qdf24xx</B>, <B>saphira</B>,
|
|
<B>phecda</B>, <B>xgene1</B>, <B>vulcan</B>, <B>octeontx</B>,
|
|
<B>octeontx81</B>, <B>octeontx83</B>,
|
|
<B>a64fx</B>,
|
|
<B>thunderx</B>, <B>thunderxt88</B>,
|
|
<B>thunderxt88p1</B>, <B>thunderxt81</B>, <B>tsv110</B>,
|
|
<B>thunderxt83</B>, <B>thunderx2t99</B>, <B>zeus</B>,
|
|
<B>cortex-a57.cortex-a53</B>, <B>cortex-a72.cortex-a53</B>,
|
|
<B>cortex-a73.cortex-a35</B>, <B>cortex-a73.cortex-a53</B>,
|
|
<B>cortex-a75.cortex-a55</B>, <B>cortex-a76.cortex-a55</B>
|
|
<B>native</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The values <B>cortex-a57.cortex-a53</B>, <B>cortex-a72.cortex-a53</B>,
|
|
<B>cortex-a73.cortex-a35</B>, <B>cortex-a73.cortex-a53</B>,
|
|
<B>cortex-a75.cortex-a55</B>, <B>cortex-a76.cortex-a55</B> specify that <FONT SIZE="-1">GCC</FONT>
|
|
should tune for a big.LITTLE system.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Additionally on native AArch64 GNU/Linux systems the value
|
|
<B>native</B> tunes performance to the host system. This option has no effect
|
|
if the compiler is unable to recognize the processor of the host system.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Where none of <B>-mtune=</B>, <B>-mcpu=</B> or <B>-march=</B>
|
|
are specified, the code is tuned to perform well across a range
|
|
of target processors.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option cannot be suffixed by feature modifiers.
|
|
<DT id="1743"><B>-mcpu=</B><I>name</I><DD>
|
|
|
|
|
|
Specify the name of the target processor, optionally suffixed by one
|
|
or more feature modifiers. This option has the form
|
|
<B>-mcpu=</B><I>cpu</I>{<B>+</B>[<B>no</B>]<I>feature</I>}*, where
|
|
the permissible values for <I>cpu</I> are the same as those available
|
|
for <B>-mtune</B>. The permissible values for <I>feature</I> are
|
|
documented in the sub-section on
|
|
<B>aarch64-feature-modifiers,,</B><B>-march</B> <B>and</B> <B>-mcpu</B>
|
|
<B>Feature Modifiers</B>. Where conflicting feature modifiers are
|
|
specified, the right-most feature is used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> uses <I>name</I> to determine what kind of instructions it can emit when
|
|
generating assembly code (as if by <B>-march</B>) and to determine
|
|
the target processor for which to tune for performance (as if
|
|
by <B>-mtune</B>). Where this option is used in conjunction
|
|
with <B>-march</B> or <B>-mtune</B>, those options take precedence
|
|
over the appropriate part of this option.
|
|
<DT id="1744"><B>-moverride=</B><I>string</I><DD>
|
|
|
|
|
|
Override tuning decisions made by the back-end in response to a
|
|
<B>-mtune=</B> switch. The syntax, semantics, and accepted values
|
|
for <I>string</I> in this option are not guaranteed to be consistent
|
|
across releases.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is only intended to be useful when developing <FONT SIZE="-1">GCC.</FONT>
|
|
<DT id="1745"><B>-mverbose-cost-dump</B><DD>
|
|
|
|
|
|
Enable verbose cost model dumping in the debug dump files. This option is
|
|
provided for use in debugging the compiler.
|
|
<DT id="1746"><B>-mpc-relative-literal-loads</B><DD>
|
|
|
|
|
|
|
|
<DT id="1747"><B>-mno-pc-relative-literal-loads</B><DD>
|
|
|
|
|
|
|
|
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
|
|
<B>-mcmodel=tiny</B>.
|
|
<DT id="1748"><B>-msign-return-address=</B><I>scope</I><DD>
|
|
|
|
|
|
Select the function scope on which return address signing will be applied.
|
|
Permissible values are <B>none</B>, which disables return address signing,
|
|
<B>non-leaf</B>, which enables pointer signing for functions which are not leaf
|
|
functions, and <B>all</B>, which enables pointer signing for all functions. The
|
|
default value is <B>none</B>. This option has been deprecated by
|
|
-mbranch-protection.
|
|
<DT id="1749"><B>-mbranch-protection=</B><I>none</I><B>|</B><I>standard</I><B>|</B><I>pac-ret</I><B>[+</B><I>leaf</I><B>]|</B><I>bti</I><DD>
|
|
|
|
|
|
Select the branch protection features to use.
|
|
<B>none</B> is the default and turns off all types of branch protection.
|
|
<B>standard</B> turns on all types of branch protection features. If a feature
|
|
has additional tuning options, then <B>standard</B> sets it to its standard
|
|
level.
|
|
<B>pac-ret[+</B><I>leaf</I><B>]</B> turns on return address signing to its standard
|
|
level: signing functions that save the return address to memory (non-leaf
|
|
functions will practically always do this) using the a-key. The optional
|
|
argument <B>leaf</B> can be used to extend the signing to include leaf
|
|
functions.
|
|
<B>bti</B> turns on branch target identification mechanism.
|
|
<DT id="1750"><B>-mharden-sls=</B><I>opts</I><DD>
|
|
|
|
|
|
Enable compiler hardening against straight line speculation (<FONT SIZE="-1">SLS</FONT>).
|
|
<I>opts</I> is a comma-separated list of the following options:
|
|
<DL COMPACT><DT id="1751"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1752"><B>retbr</B><DD>
|
|
|
|
|
|
|
|
<DT id="1753"><B>blr</B><DD>
|
|
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1754"><DD>
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In addition, <B>-mharden-sls=all</B> enables all <FONT SIZE="-1">SLS</FONT> hardening while
|
|
<B>-mharden-sls=none</B> disables all <FONT SIZE="-1">SLS</FONT> hardening.
|
|
</DL>
|
|
|
|
<DT id="1755"><B>-msve-vector-bits=</B><I>bits</I><DD>
|
|
|
|
|
|
Specify the number of bits in an <FONT SIZE="-1">SVE</FONT> vector register. This option only has
|
|
an effect when <FONT SIZE="-1">SVE</FONT> is enabled.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> supports two forms of <FONT SIZE="-1">SVE</FONT> code generation: ``vector-length
|
|
agnostic'' output that works with any size of vector register and
|
|
``vector-length specific'' output that allows <FONT SIZE="-1">GCC</FONT> to make assumptions
|
|
about the vector length when it is useful for optimization reasons.
|
|
The possible values of <B>bits</B> are: <B>scalable</B>, <B>128</B>,
|
|
<B>256</B>, <B>512</B>, <B>1024</B> and <B>2048</B>.
|
|
Specifying <B>scalable</B> selects vector-length agnostic
|
|
output. At present <B>-msve-vector-bits=128</B> also generates vector-length
|
|
agnostic output. All other values generate vector-length specific code.
|
|
The behavior of these values may change in future releases and no value except
|
|
<B>scalable</B> should be relied on for producing code that is portable across
|
|
different hardware <FONT SIZE="-1">SVE</FONT> vector lengths.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-msve-vector-bits=scalable</B>, which produces
|
|
vector-length agnostic code.
|
|
</DL>
|
|
<P>
|
|
|
|
<B>-march</B> and <B>-mcpu</B> Feature Modifiers
|
|
|
|
|
|
<P>
|
|
|
|
Feature modifiers used with <B>-march</B> and <B>-mcpu</B> can be any of
|
|
the following and their inverses <B>no</B><I>feature</I>:
|
|
<DL COMPACT>
|
|
<DT id="1756"><B>crc</B><DD>
|
|
|
|
|
|
Enable <FONT SIZE="-1">CRC</FONT> extension. This is on by default for
|
|
<B>-march=armv8.1-a</B>.
|
|
<DT id="1757"><B>crypto</B><DD>
|
|
|
|
|
|
Enable Crypto extension. This also enables Advanced <FONT SIZE="-1">SIMD</FONT> and floating-point
|
|
instructions.
|
|
<DT id="1758"><B>fp</B><DD>
|
|
|
|
|
|
Enable floating-point instructions. This is on by default for all possible
|
|
values for options <B>-march</B> and <B>-mcpu</B>.
|
|
<DT id="1759"><B>simd</B><DD>
|
|
|
|
|
|
Enable Advanced <FONT SIZE="-1">SIMD</FONT> instructions. This also enables floating-point
|
|
instructions. This is on by default for all possible values for options
|
|
<B>-march</B> and <B>-mcpu</B>.
|
|
<DT id="1760"><B>sve</B><DD>
|
|
|
|
|
|
Enable Scalable Vector Extension instructions. This also enables Advanced
|
|
<FONT SIZE="-1">SIMD</FONT> and floating-point instructions.
|
|
<DT id="1761"><B>lse</B><DD>
|
|
|
|
|
|
Enable Large System Extension instructions. This is on by default for
|
|
<B>-march=armv8.1-a</B>.
|
|
<DT id="1762"><B>rdma</B><DD>
|
|
|
|
|
|
Enable Round Double Multiply Accumulate instructions. This is on by default
|
|
for <B>-march=armv8.1-a</B>.
|
|
<DT id="1763"><B>fp16</B><DD>
|
|
|
|
|
|
Enable <FONT SIZE="-1">FP16</FONT> extension. This also enables floating-point instructions.
|
|
<DT id="1764"><B>fp16fml</B><DD>
|
|
|
|
|
|
Enable <FONT SIZE="-1">FP16</FONT> fmla extension. This also enables <FONT SIZE="-1">FP16</FONT> extensions and
|
|
floating-point instructions. This option is enabled by default for <B>-march=armv8.4-a</B>. Use of this option with architectures prior to Armv8.2-A is not supported.
|
|
<DT id="1765"><B>rcpc</B><DD>
|
|
|
|
|
|
Enable the RcPc extension. This does not change code generation from <FONT SIZE="-1">GCC,</FONT>
|
|
but is passed on to the assembler, enabling inline asm statements to use
|
|
instructions from the RcPc extension.
|
|
<DT id="1766"><B>dotprod</B><DD>
|
|
|
|
|
|
Enable the Dot Product extension. This also enables Advanced <FONT SIZE="-1">SIMD</FONT> instructions.
|
|
<DT id="1767"><B>aes</B><DD>
|
|
|
|
|
|
Enable the Armv8-a aes and pmull crypto extension. This also enables Advanced
|
|
<FONT SIZE="-1">SIMD</FONT> instructions.
|
|
<DT id="1768"><B>sha2</B><DD>
|
|
|
|
|
|
Enable the Armv8-a sha2 crypto extension. This also enables Advanced <FONT SIZE="-1">SIMD</FONT> instructions.
|
|
<DT id="1769"><B>sha3</B><DD>
|
|
|
|
|
|
Enable the sha512 and sha3 crypto extension. This also enables Advanced <FONT SIZE="-1">SIMD</FONT>
|
|
instructions. Use of this option with architectures prior to Armv8.2-A is not supported.
|
|
<DT id="1770"><B>sm4</B><DD>
|
|
|
|
|
|
Enable the sm3 and sm4 crypto extension. This also enables Advanced <FONT SIZE="-1">SIMD</FONT> instructions.
|
|
Use of this option with architectures prior to Armv8.2-A is not supported.
|
|
<DT id="1771"><B>profile</B><DD>
|
|
|
|
|
|
Enable the Statistical Profiling extension. This option is only to enable the
|
|
extension at the assembler level and does not affect code generation.
|
|
<DT id="1772"><B>rng</B><DD>
|
|
|
|
|
|
Enable the Armv8.5-a Random Number instructions. This option is only to
|
|
enable the extension at the assembler level and does not affect code
|
|
generation.
|
|
<DT id="1773"><B>memtag</B><DD>
|
|
|
|
|
|
Enable the Armv8.5-a Memory Tagging Extensions. This option is only to
|
|
enable the extension at the assembler level and does not affect code
|
|
generation.
|
|
<DT id="1774"><B>sb</B><DD>
|
|
|
|
|
|
Enable the Armv8-a Speculation Barrier instruction. This option is only to
|
|
enable the extension at the assembler level and does not affect code
|
|
generation. This option is enabled by default for <B>-march=armv8.5-a</B>.
|
|
<DT id="1775"><B>ssbs</B><DD>
|
|
|
|
|
|
Enable the Armv8-a Speculative Store Bypass Safe instruction. This option
|
|
is only to enable the extension at the assembler level and does not affect code
|
|
generation. This option is enabled by default for <B>-march=armv8.5-a</B>.
|
|
<DT id="1776"><B>predres</B><DD>
|
|
|
|
|
|
Enable the Armv8-a Execution and Data Prediction Restriction instructions.
|
|
This option is only to enable the extension at the assembler level and does
|
|
not affect code generation. This option is enabled by default for
|
|
<B>-march=armv8.5-a</B>.
|
|
</DL>
|
|
<P>
|
|
|
|
Feature <B>crypto</B> implies <B>aes</B>, <B>sha2</B>, and <B>simd</B>,
|
|
which implies <B>fp</B>.
|
|
Conversely, <B>nofp</B> implies <B>nosimd</B>, which implies
|
|
<B>nocrypto</B>, <B>noaes</B> and <B>nosha2</B>.
|
|
<P>
|
|
|
|
<I>Adapteva Epiphany Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for Adapteva Epiphany:
|
|
<DL COMPACT>
|
|
<DT id="1777"><B>-mhalf-reg-file</B><DD>
|
|
|
|
|
|
Don't allocate any register in the range <TT>"r32"</TT>...<TT>"r63"</TT>.
|
|
That allows code to run on hardware variants that lack these registers.
|
|
<DT id="1778"><B>-mprefer-short-insn-regs</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="1779"><B>-mbranch-cost=</B><I>num</I><DD>
|
|
|
|
|
|
Set the cost of branches to roughly <I>num</I> ``simple'' instructions.
|
|
This cost is only a heuristic and is not guaranteed to produce
|
|
consistent results across releases.
|
|
<DT id="1780"><B>-mcmove</B><DD>
|
|
|
|
|
|
Enable the generation of conditional moves.
|
|
<DT id="1781"><B>-mnops=</B><I>num</I><DD>
|
|
|
|
|
|
Emit <I>num</I> NOPs before every other generated instruction.
|
|
<DT id="1782"><B>-mno-soft-cmpsf</B><DD>
|
|
|
|
|
|
For single-precision floating-point comparisons, emit an <TT>"fsub"</TT> 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
|
|
numbers are compared such that their difference is calculated as zero.
|
|
The default is <B>-msoft-cmpsf</B>, which uses slower, but IEEE-compliant,
|
|
software comparisons.
|
|
<DT id="1783"><B>-mstack-offset=</B><I>num</I><DD>
|
|
|
|
|
|
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 <TT>"sp+0...sp+7"</TT>
|
|
can be used by leaf functions without stack allocation.
|
|
Values other than <B>8</B> or <B>16</B> are untested and unlikely to work.
|
|
Note also that this option changes the <FONT SIZE="-1">ABI</FONT>; compiling a program with a
|
|
different stack offset than the libraries have been compiled with
|
|
generally does not work.
|
|
This option can be useful if you want to evaluate if a different stack
|
|
offset would give you better code, but to actually use a different stack
|
|
offset to build working programs, it is recommended to configure the
|
|
toolchain with the appropriate <B>--with-stack-offset=</B><I>num</I> option.
|
|
<DT id="1784"><B>-mno-round-nearest</B><DD>
|
|
|
|
|
|
Make the scheduler assume that the rounding mode has been set to
|
|
truncating. The default is <B>-mround-nearest</B>.
|
|
<DT id="1785"><B>-mlong-calls</B><DD>
|
|
|
|
|
|
If not otherwise specified by an attribute, assume all calls might be beyond
|
|
the offset range of the <TT>"b"</TT> / <TT>"bl"</TT> instructions, and therefore load the
|
|
function address into a register before performing a (otherwise direct) call.
|
|
This is the default.
|
|
<DT id="1786"><B>-mshort-calls</B><DD>
|
|
|
|
|
|
If not otherwise specified by an attribute, assume all direct calls are
|
|
in the range of the <TT>"b"</TT> / <TT>"bl"</TT> instructions, so use these instructions
|
|
for direct calls. The default is <B>-mlong-calls</B>.
|
|
<DT id="1787"><B>-msmall16</B><DD>
|
|
|
|
|
|
Assume addresses can be loaded as 16-bit unsigned values. This does not
|
|
apply to function addresses for which <B>-mlong-calls</B> semantics
|
|
are in effect.
|
|
<DT id="1788"><B>-mfp-mode=</B><I>mode</I><DD>
|
|
|
|
|
|
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
|
|
predominantly need at function start can make your programs smaller and
|
|
faster by avoiding unnecessary mode switches.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>mode</I> can be set to one the following values:
|
|
<DL COMPACT><DT id="1789"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1790"><B>caller</B><DD>
|
|
|
|
|
|
Any mode at function entry is valid, and retained or restored when
|
|
the function returns, and when it calls other functions.
|
|
This mode is useful for compiling libraries or other compilation units
|
|
you might want to incorporate into different programs with different
|
|
prevailing <FONT SIZE="-1">FPU</FONT> modes, and the convenience of being able to use a single
|
|
object file outweighs the size and speed overhead for any extra
|
|
mode switching that might be needed, compared with what would be needed
|
|
with a more specific choice of prevailing <FONT SIZE="-1">FPU</FONT> mode.
|
|
<DT id="1791"><B>truncate</B><DD>
|
|
|
|
|
|
This is the mode used for floating-point calculations with
|
|
truncating (i.e. round towards zero) rounding mode. That includes
|
|
conversion from floating point to integer.
|
|
<DT id="1792"><B>round-nearest</B><DD>
|
|
|
|
|
|
This is the mode used for floating-point calculations with
|
|
round-to-nearest-or-even rounding mode.
|
|
<DT id="1793"><B>int</B><DD>
|
|
|
|
|
|
This is the mode used to perform integer calculations in the <FONT SIZE="-1">FPU,</FONT> e.g.
|
|
integer multiply, or integer multiply-and-accumulate.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1794"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-mfp-mode=caller</B>
|
|
</DL>
|
|
|
|
<DT id="1795"><B>-mno-split-lohi</B><DD>
|
|
|
|
|
|
|
|
<DT id="1796"><B>-mno-postinc</B><DD>
|
|
|
|
|
|
<DT id="1797"><B>-mno-postmodify</B><DD>
|
|
|
|
|
|
|
|
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 <B>msplit-lohi</B>,
|
|
<B>-mpost-inc</B>, and <B>-mpost-modify</B>.
|
|
<DT id="1798"><B>-mnovect-double</B><DD>
|
|
|
|
|
|
Change the preferred <FONT SIZE="-1">SIMD</FONT> mode to SImode. The default is
|
|
<B>-mvect-double</B>, which uses DImode as preferred <FONT SIZE="-1">SIMD</FONT> mode.
|
|
<DT id="1799"><B>-max-vect-align=</B><I>num</I><DD>
|
|
|
|
|
|
The maximum alignment for <FONT SIZE="-1">SIMD</FONT> vector mode types.
|
|
<I>num</I> may be 4 or 8. The default is 8.
|
|
Note that this is an <FONT SIZE="-1">ABI</FONT> change, even though many library function
|
|
interfaces are unaffected if they don't use <FONT SIZE="-1">SIMD</FONT> vector modes
|
|
in places that affect size and/or alignment of relevant types.
|
|
<DT id="1800"><B>-msplit-vecmove-early</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="1801"><B>-m1reg-</B><I>reg</I><DD>
|
|
|
|
|
|
Specify a register to hold the constant -1, which makes loading small negative
|
|
constants and certain bitmasks faster.
|
|
Allowable values for <I>reg</I> are <B>r43</B> and <B>r63</B>,
|
|
which specify use of that register as a fixed register,
|
|
and <B>none</B>, which means that no register is used for this
|
|
purpose. The default is <B>-m1reg-none</B>.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>AMD GCN</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined specifically for the <FONT SIZE="-1">AMD GCN</FONT> port.
|
|
<DL COMPACT>
|
|
<DT id="1802"><B>-march=</B><I>gpu</I><DD>
|
|
|
|
|
|
|
|
<DT id="1803"><B>-mtune=</B><I>gpu</I><DD>
|
|
|
|
|
|
|
|
Set architecture type or tuning for <I>gpu</I>. Supported values for <I>gpu</I>
|
|
are
|
|
<DL COMPACT><DT id="1804"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1805"><B>fiji</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">GCN3</FONT> Fiji devices (gfx803).
|
|
<DT id="1806"><B>gfx900</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">GCN5</FONT> Vega 10 devices (gfx900).
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1807"><DD>
|
|
</DL>
|
|
|
|
<DT id="1808"><B>-mstack-size=</B><I>bytes</I><DD>
|
|
|
|
|
|
Specify how many <I>bytes</I> of stack space will be requested for each <FONT SIZE="-1">GPU</FONT>
|
|
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.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>ARC</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
The following options control the architecture variant for which code
|
|
is being compiled:
|
|
<DL COMPACT>
|
|
<DT id="1809"><B>-mbarrel-shifter</B><DD>
|
|
|
|
|
|
Generate instructions supported by barrel shifter. This is the default
|
|
unless <B>-mcpu=ARC601</B> or <B>-mcpu=ARCEM</B> is in effect.
|
|
<DT id="1810"><B>-mjli-always</B><DD>
|
|
|
|
|
|
Force to call a function using jli_s instruction. This option is
|
|
valid only for ARCv2 architecture.
|
|
<DT id="1811"><B>-mcpu=</B><I>cpu</I><DD>
|
|
|
|
|
|
Set architecture type, register usage, and instruction scheduling
|
|
parameters for <I>cpu</I>. There are also shortcut alias options
|
|
available for backward compatibility and convenience. Supported
|
|
values for <I>cpu</I> are
|
|
<DL COMPACT><DT id="1812"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1813"><B>arc600</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC600.</FONT> Aliases: <B>-mA6</B>, <B>-mARC600</B>.
|
|
<DT id="1814"><B>arc601</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC601.</FONT> Alias: <B>-mARC601</B>.
|
|
<DT id="1815"><B>arc700</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC700.</FONT> Aliases: <B>-mA7</B>, <B>-mARC700</B>.
|
|
This is the default when configured with <B>--with-cpu=arc700</B>.
|
|
<DT id="1816"><B>arcem</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC EM.</FONT>
|
|
<DT id="1817"><B>archs</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC HS.</FONT>
|
|
<DT id="1818"><B>em</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC EM CPU</FONT> with no hardware extensions.
|
|
<DT id="1819"><B>em4</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC EM4 CPU.</FONT>
|
|
<DT id="1820"><B>em4_dmips</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC EM4 DMIPS CPU.</FONT>
|
|
<DT id="1821"><B>em4_fpus</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC EM4 DMIPS CPU</FONT> with the single-precision floating-point
|
|
extension.
|
|
<DT id="1822"><B>em4_fpuda</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC EM4 DMIPS CPU</FONT> with single-precision floating-point and
|
|
double assist instructions.
|
|
<DT id="1823"><B>hs</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC HS CPU</FONT> with no hardware extensions except the atomic
|
|
instructions.
|
|
<DT id="1824"><B>hs34</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC HS34 CPU.</FONT>
|
|
<DT id="1825"><B>hs38</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC HS38 CPU.</FONT>
|
|
<DT id="1826"><B>hs38_linux</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC HS38 CPU</FONT> with all hardware extensions on.
|
|
<DT id="1827"><B>arc600_norm</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC 600 CPU</FONT> with <TT>"norm"</TT> instructions enabled.
|
|
<DT id="1828"><B>arc600_mul32x16</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC 600 CPU</FONT> with <TT>"norm"</TT> and 32x16-bit multiply
|
|
instructions enabled.
|
|
<DT id="1829"><B>arc600_mul64</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC 600 CPU</FONT> with <TT>"norm"</TT> and <TT>"mul64"</TT>-family
|
|
instructions enabled.
|
|
<DT id="1830"><B>arc601_norm</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC 601 CPU</FONT> with <TT>"norm"</TT> instructions enabled.
|
|
<DT id="1831"><B>arc601_mul32x16</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC 601 CPU</FONT> with <TT>"norm"</TT> and 32x16-bit multiply
|
|
instructions enabled.
|
|
<DT id="1832"><B>arc601_mul64</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC 601 CPU</FONT> with <TT>"norm"</TT> and <TT>"mul64"</TT>-family
|
|
instructions enabled.
|
|
<DT id="1833"><B>nps400</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC 700</FONT> on <FONT SIZE="-1">NPS400</FONT> chip.
|
|
<DT id="1834"><B>em_mini</B><DD>
|
|
|
|
|
|
Compile for <FONT SIZE="-1">ARC EM</FONT> minimalist configuration featuring reduced register
|
|
set.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1835"><DD>
|
|
</DL>
|
|
|
|
<DT id="1836"><B>-mdpfp</B><DD>
|
|
|
|
|
|
|
|
<DT id="1837"><B>-mdpfp-compact</B><DD>
|
|
|
|
|
|
|
|
Generate double-precision <FONT SIZE="-1">FPX</FONT> instructions, tuned for the compact
|
|
implementation.
|
|
<DT id="1838"><B>-mdpfp-fast</B><DD>
|
|
|
|
|
|
Generate double-precision <FONT SIZE="-1">FPX</FONT> instructions, tuned for the fast
|
|
implementation.
|
|
<DT id="1839"><B>-mno-dpfp-lrsr</B><DD>
|
|
|
|
|
|
Disable <TT>"lr"</TT> and <TT>"sr"</TT> instructions from using <FONT SIZE="-1">FPX</FONT> extension
|
|
aux registers.
|
|
<DT id="1840"><B>-mea</B><DD>
|
|
|
|
|
|
Generate extended arithmetic instructions. Currently only
|
|
<TT>"divaw"</TT>, <TT>"adds"</TT>, <TT>"subs"</TT>, and <TT>"sat16"</TT> are
|
|
supported. This is always enabled for <B>-mcpu=ARC700</B>.
|
|
<DT id="1841"><B>-mno-mpy</B><DD>
|
|
|
|
|
|
Do not generate <TT>"mpy"</TT>-family instructions for <FONT SIZE="-1">ARC700.</FONT> This option is
|
|
deprecated.
|
|
<DT id="1842"><B>-mmul32x16</B><DD>
|
|
|
|
|
|
Generate 32x16-bit multiply and multiply-accumulate instructions.
|
|
<DT id="1843"><B>-mmul64</B><DD>
|
|
|
|
|
|
Generate <TT>"mul64"</TT> and <TT>"mulu64"</TT> instructions.
|
|
Only valid for <B>-mcpu=ARC600</B>.
|
|
<DT id="1844"><B>-mnorm</B><DD>
|
|
|
|
|
|
Generate <TT>"norm"</TT> instructions. This is the default if <B>-mcpu=ARC700</B>
|
|
is in effect.
|
|
<DT id="1845"><B>-mspfp</B><DD>
|
|
|
|
|
|
|
|
<DT id="1846"><B>-mspfp-compact</B><DD>
|
|
|
|
|
|
|
|
Generate single-precision <FONT SIZE="-1">FPX</FONT> instructions, tuned for the compact
|
|
implementation.
|
|
<DT id="1847"><B>-mspfp-fast</B><DD>
|
|
|
|
|
|
Generate single-precision <FONT SIZE="-1">FPX</FONT> instructions, tuned for the fast
|
|
implementation.
|
|
<DT id="1848"><B>-msimd</B><DD>
|
|
|
|
|
|
Enable generation of <FONT SIZE="-1">ARC SIMD</FONT> instructions via target-specific
|
|
builtins. Only valid for <B>-mcpu=ARC700</B>.
|
|
<DT id="1849"><B>-msoft-float</B><DD>
|
|
|
|
|
|
This option ignored; it is provided for compatibility purposes only.
|
|
Software floating-point code is emitted by default, and this default
|
|
can overridden by <FONT SIZE="-1">FPX</FONT> options; <B>-mspfp</B>, <B>-mspfp-compact</B>, or
|
|
<B>-mspfp-fast</B> for single precision, and <B>-mdpfp</B>,
|
|
<B>-mdpfp-compact</B>, or <B>-mdpfp-fast</B> for double precision.
|
|
<DT id="1850"><B>-mswap</B><DD>
|
|
|
|
|
|
Generate <TT>"swap"</TT> instructions.
|
|
<DT id="1851"><B>-matomic</B><DD>
|
|
|
|
|
|
This enables use of the locked load/store conditional extension to implement
|
|
atomic memory built-in functions. Not available for <FONT SIZE="-1">ARC</FONT> 6xx or <FONT SIZE="-1">ARC
|
|
EM</FONT> cores.
|
|
<DT id="1852"><B>-mdiv-rem</B><DD>
|
|
|
|
|
|
Enable <TT>"div"</TT> and <TT>"rem"</TT> instructions for ARCv2 cores.
|
|
<DT id="1853"><B>-mcode-density</B><DD>
|
|
|
|
|
|
Enable code density instructions for <FONT SIZE="-1">ARC EM.</FONT>
|
|
This option is on by default for <FONT SIZE="-1">ARC HS.</FONT>
|
|
<DT id="1854"><B>-mll64</B><DD>
|
|
|
|
|
|
Enable double load/store operations for <FONT SIZE="-1">ARC HS</FONT> cores.
|
|
<DT id="1855"><B>-mtp-regno=</B><I>regno</I><DD>
|
|
|
|
|
|
Specify thread pointer register number.
|
|
<DT id="1856"><B>-mmpy-option=</B><I>multo</I><DD>
|
|
|
|
|
|
Compile ARCv2 code with a multiplier design option. You can specify
|
|
the option using either a string or numeric value for <I>multo</I>.
|
|
<B>wlh1</B> is the default value. The recognized values are:
|
|
<DL COMPACT><DT id="1857"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1858"><B>0</B><DD>
|
|
|
|
|
|
|
|
<DT id="1859"><B>none</B><DD>
|
|
|
|
|
|
|
|
No multiplier available.
|
|
<DT id="1860"><B>1</B><DD>
|
|
|
|
|
|
|
|
<DT id="1861"><B>w</B><DD>
|
|
|
|
|
|
|
|
16x16 multiplier, fully pipelined.
|
|
The following instructions are enabled: <TT>"mpyw"</TT> and <TT>"mpyuw"</TT>.
|
|
<DT id="1862"><B>2</B><DD>
|
|
|
|
|
|
|
|
<DT id="1863"><B>wlh1</B><DD>
|
|
|
|
|
|
|
|
32x32 multiplier, fully
|
|
pipelined (1 stage). The following instructions are additionally
|
|
enabled: <TT>"mpy"</TT>, <TT>"mpyu"</TT>, <TT>"mpym"</TT>, <TT>"mpymu"</TT>, and <TT>"mpy_s"</TT>.
|
|
<DT id="1864"><B>3</B><DD>
|
|
|
|
|
|
|
|
<DT id="1865"><B>wlh2</B><DD>
|
|
|
|
|
|
|
|
32x32 multiplier, fully pipelined
|
|
(2 stages). The following instructions are additionally enabled: <TT>"mpy"</TT>,
|
|
<TT>"mpyu"</TT>, <TT>"mpym"</TT>, <TT>"mpymu"</TT>, and <TT>"mpy_s"</TT>.
|
|
<DT id="1866"><B>4</B><DD>
|
|
|
|
|
|
|
|
<DT id="1867"><B>wlh3</B><DD>
|
|
|
|
|
|
|
|
Two 16x16 multipliers, blocking,
|
|
sequential. The following instructions are additionally enabled: <TT>"mpy"</TT>,
|
|
<TT>"mpyu"</TT>, <TT>"mpym"</TT>, <TT>"mpymu"</TT>, and <TT>"mpy_s"</TT>.
|
|
<DT id="1868"><B>5</B><DD>
|
|
|
|
|
|
|
|
<DT id="1869"><B>wlh4</B><DD>
|
|
|
|
|
|
|
|
One 16x16 multiplier, blocking,
|
|
sequential. The following instructions are additionally enabled: <TT>"mpy"</TT>,
|
|
<TT>"mpyu"</TT>, <TT>"mpym"</TT>, <TT>"mpymu"</TT>, and <TT>"mpy_s"</TT>.
|
|
<DT id="1870"><B>6</B><DD>
|
|
|
|
|
|
|
|
<DT id="1871"><B>wlh5</B><DD>
|
|
|
|
|
|
|
|
One 32x4 multiplier, blocking,
|
|
sequential. The following instructions are additionally enabled: <TT>"mpy"</TT>,
|
|
<TT>"mpyu"</TT>, <TT>"mpym"</TT>, <TT>"mpymu"</TT>, and <TT>"mpy_s"</TT>.
|
|
<DT id="1872"><B>7</B><DD>
|
|
|
|
|
|
|
|
<DT id="1873"><B>plus_dmpy</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">ARC HS SIMD</FONT> support.
|
|
<DT id="1874"><B>8</B><DD>
|
|
|
|
|
|
|
|
<DT id="1875"><B>plus_macd</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">ARC HS SIMD</FONT> support.
|
|
<DT id="1876"><B>9</B><DD>
|
|
|
|
|
|
|
|
<DT id="1877"><B>plus_qmacw</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">ARC HS SIMD</FONT> support.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1878"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is only available for ARCv2 cores.
|
|
</DL>
|
|
|
|
<DT id="1879"><B>-mfpu=</B><I>fpu</I><DD>
|
|
|
|
|
|
Enables support for specific floating-point hardware extensions for ARCv2
|
|
cores. Supported values for <I>fpu</I> are:
|
|
<DL COMPACT><DT id="1880"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1881"><B>fpus</B><DD>
|
|
|
|
|
|
Enables support for single-precision floating-point hardware
|
|
extensions.
|
|
<DT id="1882"><B>fpud</B><DD>
|
|
|
|
|
|
Enables support for double-precision floating-point hardware
|
|
extensions. The single-precision floating-point extension is also
|
|
enabled. Not available for <FONT SIZE="-1">ARC EM.</FONT>
|
|
<DT id="1883"><B>fpuda</B><DD>
|
|
|
|
|
|
Enables support for double-precision floating-point hardware
|
|
extensions using double-precision assist instructions. The single-precision
|
|
floating-point extension is also enabled. This option is
|
|
only available for <FONT SIZE="-1">ARC EM.</FONT>
|
|
<DT id="1884"><B>fpuda_div</B><DD>
|
|
|
|
|
|
Enables support for double-precision floating-point hardware
|
|
extensions using double-precision assist instructions.
|
|
The single-precision floating-point, square-root, and divide
|
|
extensions are also enabled. This option is
|
|
only available for <FONT SIZE="-1">ARC EM.</FONT>
|
|
<DT id="1885"><B>fpuda_fma</B><DD>
|
|
|
|
|
|
Enables support for double-precision floating-point hardware
|
|
extensions using double-precision assist instructions.
|
|
The single-precision floating-point and fused multiply and add
|
|
hardware extensions are also enabled. This option is
|
|
only available for <FONT SIZE="-1">ARC EM.</FONT>
|
|
<DT id="1886"><B>fpuda_all</B><DD>
|
|
|
|
|
|
Enables support for double-precision floating-point hardware
|
|
extensions using double-precision assist instructions.
|
|
All single-precision floating-point hardware extensions are also
|
|
enabled. This option is only available for <FONT SIZE="-1">ARC EM.</FONT>
|
|
<DT id="1887"><B>fpus_div</B><DD>
|
|
|
|
|
|
Enables support for single-precision floating-point, square-root and divide
|
|
hardware extensions.
|
|
<DT id="1888"><B>fpud_div</B><DD>
|
|
|
|
|
|
Enables support for double-precision floating-point, square-root and divide
|
|
hardware extensions. This option
|
|
includes option <B>fpus_div</B>. Not available for <FONT SIZE="-1">ARC EM.</FONT>
|
|
<DT id="1889"><B>fpus_fma</B><DD>
|
|
|
|
|
|
Enables support for single-precision floating-point and
|
|
fused multiply and add hardware extensions.
|
|
<DT id="1890"><B>fpud_fma</B><DD>
|
|
|
|
|
|
Enables support for double-precision floating-point and
|
|
fused multiply and add hardware extensions. This option
|
|
includes option <B>fpus_fma</B>. Not available for <FONT SIZE="-1">ARC EM.</FONT>
|
|
<DT id="1891"><B>fpus_all</B><DD>
|
|
|
|
|
|
Enables support for all single-precision floating-point hardware
|
|
extensions.
|
|
<DT id="1892"><B>fpud_all</B><DD>
|
|
|
|
|
|
Enables support for all single- and double-precision floating-point
|
|
hardware extensions. Not available for <FONT SIZE="-1">ARC EM.</FONT>
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1893"><DD>
|
|
</DL>
|
|
|
|
<DT id="1894"><B>-mirq-ctrl-saved=</B><I>register-range</I><B>,</B> <I>blink</I><B>,</B> <I>lp_count</I><DD>
|
|
|
|
|
|
Specifies general-purposes registers that the processor automatically
|
|
saves/restores on interrupt entry and exit. <I>register-range</I> is
|
|
specified as two registers separated by a dash. The register range
|
|
always starts with <TT>"r0"</TT>, the upper limit is <TT>"fp"</TT> register.
|
|
<I>blink</I> and <I>lp_count</I> are optional. This option is only
|
|
valid for <FONT SIZE="-1">ARC EM</FONT> and <FONT SIZE="-1">ARC HS</FONT> cores.
|
|
<DT id="1895"><B>-mrgf-banked-regs=</B><I>number</I><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">PC</FONT> and <FONT SIZE="-1">STATUS32</FONT>
|
|
registers to avoid memory transactions during interrupt entry and exit
|
|
sequences. Use this option when you are using fast interrupts in an
|
|
<FONT SIZE="-1">ARC V2</FONT> family processor. Permitted values are 4, 8, 16, and 32.
|
|
<DT id="1896"><B>-mlpc-width=</B><I>width</I><DD>
|
|
|
|
|
|
Specify the width of the <TT>"lp_count"</TT> register. Valid values for
|
|
<I>width</I> 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
|
|
attempt to transform loops in your program to use the zero-delay loop
|
|
mechanism unless it is known that the <TT>"lp_count"</TT> register can
|
|
hold the required loop-counter value. Depending on the width
|
|
specified, the compiler and run-time library might continue to use the
|
|
loop mechanism for various needs. This option defines macro
|
|
<TT>"__ARC_LPC_WIDTH__"</TT> with the value of <I>width</I>.
|
|
<DT id="1897"><B>-mrf16</B><DD>
|
|
|
|
|
|
This option instructs the compiler to generate code for a 16-entry
|
|
register file. This option defines the <TT>"__ARC_RF16__"</TT>
|
|
preprocessor macro.
|
|
<DT id="1898"><B>-mbranch-index</B><DD>
|
|
|
|
|
|
Enable use of <TT>"bi"</TT> or <TT>"bih"</TT> instructions to implement jump
|
|
tables.
|
|
</DL>
|
|
<P>
|
|
|
|
The following options are passed through to the assembler, and also
|
|
define preprocessor macro symbols.
|
|
<DL COMPACT>
|
|
<DT id="1899"><B>-mdsp-packa</B><DD>
|
|
|
|
|
|
Passed down to the assembler to enable the <FONT SIZE="-1">DSP</FONT> Pack A extensions.
|
|
Also sets the preprocessor symbol <TT>"__Xdsp_packa"</TT>. This option is
|
|
deprecated.
|
|
<DT id="1900"><B>-mdvbf</B><DD>
|
|
|
|
|
|
Passed down to the assembler to enable the dual Viterbi butterfly
|
|
extension. Also sets the preprocessor symbol <TT>"__Xdvbf"</TT>. This
|
|
option is deprecated.
|
|
<DT id="1901"><B>-mlock</B><DD>
|
|
|
|
|
|
Passed down to the assembler to enable the locked load/store
|
|
conditional extension. Also sets the preprocessor symbol
|
|
<TT>"__Xlock"</TT>.
|
|
<DT id="1902"><B>-mmac-d16</B><DD>
|
|
|
|
|
|
Passed down to the assembler. Also sets the preprocessor symbol
|
|
<TT>"__Xxmac_d16"</TT>. This option is deprecated.
|
|
<DT id="1903"><B>-mmac-24</B><DD>
|
|
|
|
|
|
Passed down to the assembler. Also sets the preprocessor symbol
|
|
<TT>"__Xxmac_24"</TT>. This option is deprecated.
|
|
<DT id="1904"><B>-mrtsc</B><DD>
|
|
|
|
|
|
Passed down to the assembler to enable the 64-bit time-stamp counter
|
|
extension instruction. Also sets the preprocessor symbol
|
|
<TT>"__Xrtsc"</TT>. This option is deprecated.
|
|
<DT id="1905"><B>-mswape</B><DD>
|
|
|
|
|
|
Passed down to the assembler to enable the swap byte ordering
|
|
extension instruction. Also sets the preprocessor symbol
|
|
<TT>"__Xswape"</TT>.
|
|
<DT id="1906"><B>-mtelephony</B><DD>
|
|
|
|
|
|
Passed down to the assembler to enable dual- and single-operand
|
|
instructions for telephony. Also sets the preprocessor symbol
|
|
<TT>"__Xtelephony"</TT>. This option is deprecated.
|
|
<DT id="1907"><B>-mxy</B><DD>
|
|
|
|
|
|
Passed down to the assembler to enable the <FONT SIZE="-1">XY</FONT> memory extension. Also
|
|
sets the preprocessor symbol <TT>"__Xxy"</TT>.
|
|
</DL>
|
|
<P>
|
|
|
|
The following options control how the assembly code is annotated:
|
|
<DL COMPACT>
|
|
<DT id="1908"><B>-misize</B><DD>
|
|
|
|
|
|
Annotate assembler instructions with estimated addresses.
|
|
<DT id="1909"><B>-mannotate-align</B><DD>
|
|
|
|
|
|
Explain what alignment considerations lead to the decision to make an
|
|
instruction short or long.
|
|
</DL>
|
|
<P>
|
|
|
|
The following options are passed through to the linker:
|
|
<DL COMPACT>
|
|
<DT id="1910"><B>-marclinux</B><DD>
|
|
|
|
|
|
Passed through to the linker, to specify use of the <TT>"arclinux"</TT> emulation.
|
|
This option is enabled by default in tool chains built for
|
|
<TT>"arc-linux-uclibc"</TT> and <TT>"arceb-linux-uclibc"</TT> targets
|
|
when profiling is not requested.
|
|
<DT id="1911"><B>-marclinux_prof</B><DD>
|
|
|
|
|
|
Passed through to the linker, to specify use of the
|
|
<TT>"arclinux_prof"</TT> emulation. This option is enabled by default in
|
|
tool chains built for <TT>"arc-linux-uclibc"</TT> and
|
|
<TT>"arceb-linux-uclibc"</TT> targets when profiling is requested.
|
|
</DL>
|
|
<P>
|
|
|
|
The following options control the semantics of generated code:
|
|
<DL COMPACT>
|
|
<DT id="1912"><B>-mlong-calls</B><DD>
|
|
|
|
|
|
Generate calls as register indirect calls, thus providing access
|
|
to the full 32-bit address range.
|
|
<DT id="1913"><B>-mmedium-calls</B><DD>
|
|
|
|
|
|
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
|
|
allow use of the 25-bit range, rather than the 21-bit range with
|
|
conditional branch-and-link. This is the default for tool chains built
|
|
for <TT>"arc-linux-uclibc"</TT> and <TT>"arceb-linux-uclibc"</TT> targets.
|
|
<DT id="1914"><B>-G</B> <I>num</I><DD>
|
|
|
|
|
|
Put definitions of externally-visible data in a small data section if
|
|
that data is no bigger than <I>num</I> bytes. The default value of
|
|
<I>num</I> is 4 for any <FONT SIZE="-1">ARC</FONT> configuration, or 8 when we have double
|
|
load/store operations.
|
|
<DT id="1915"><B>-mno-sdata</B><DD>
|
|
|
|
|
|
Do not generate sdata references. This is the default for tool chains
|
|
built for <TT>"arc-linux-uclibc"</TT> and <TT>"arceb-linux-uclibc"</TT>
|
|
targets.
|
|
<DT id="1916"><B>-mvolatile-cache</B><DD>
|
|
|
|
|
|
Use ordinarily cached memory accesses for volatile references. This is the
|
|
default.
|
|
<DT id="1917"><B>-mno-volatile-cache</B><DD>
|
|
|
|
|
|
Enable cache bypass for volatile references.
|
|
</DL>
|
|
<P>
|
|
|
|
The following options fine tune code generation:
|
|
<DL COMPACT>
|
|
<DT id="1918"><B>-malign-call</B><DD>
|
|
|
|
|
|
Do alignment optimizations for call instructions.
|
|
<DT id="1919"><B>-mauto-modify-reg</B><DD>
|
|
|
|
|
|
Enable the use of pre/post modify with register displacement.
|
|
<DT id="1920"><B>-mbbit-peephole</B><DD>
|
|
|
|
|
|
Enable bbit peephole2.
|
|
<DT id="1921"><B>-mno-brcc</B><DD>
|
|
|
|
|
|
This option disables a target-specific pass in <I>arc_reorg</I> to
|
|
generate compare-and-branch (<TT>"br</TT>cc<TT>"</TT>) instructions.
|
|
It has no effect on
|
|
generation of these instructions driven by the combiner pass.
|
|
<DT id="1922"><B>-mcase-vector-pcrel</B><DD>
|
|
|
|
|
|
Use PC-relative switch case tables to enable case table shortening.
|
|
This is the default for <B>-Os</B>.
|
|
<DT id="1923"><B>-mcompact-casesi</B><DD>
|
|
|
|
|
|
Enable compact <TT>"casesi"</TT> pattern. This is the default for <B>-Os</B>,
|
|
and only available for ARCv1 cores. This option is deprecated.
|
|
<DT id="1924"><B>-mno-cond-exec</B><DD>
|
|
|
|
|
|
Disable the ARCompact-specific pass to generate conditional
|
|
execution instructions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Due to delay slot scheduling and interactions between operand numbers,
|
|
literal sizes, instruction lengths, and the support for conditional execution,
|
|
the target-independent pass to generate conditional execution is often lacking,
|
|
so the <FONT SIZE="-1">ARC</FONT> port has kept a special pass around that tries to find more
|
|
conditional execution generation opportunities after register allocation,
|
|
branch shortening, and delay slot scheduling have been done. This pass
|
|
generally, but not always, improves performance and code size, at the cost of
|
|
extra compilation time, which is why there is an option to switch it off.
|
|
If you have a problem with call instructions exceeding their allowable
|
|
offset range because they are conditionalized, you should consider using
|
|
<B>-mmedium-calls</B> instead.
|
|
<DT id="1925"><B>-mearly-cbranchsi</B><DD>
|
|
|
|
|
|
Enable pre-reload use of the <TT>"cbranchsi"</TT> pattern.
|
|
<DT id="1926"><B>-mexpand-adddi</B><DD>
|
|
|
|
|
|
Expand <TT>"adddi3"</TT> and <TT>"subdi3"</TT> at <FONT SIZE="-1">RTL</FONT> generation time into
|
|
<TT>"add.f"</TT>, <TT>"adc"</TT> etc. This option is deprecated.
|
|
<DT id="1927"><B>-mindexed-loads</B><DD>
|
|
|
|
|
|
Enable the use of indexed loads. This can be problematic because some
|
|
optimizers then assume that indexed stores exist, which is not
|
|
the case.
|
|
<DT id="1928"><B>-mlra</B><DD>
|
|
|
|
|
|
Enable Local Register Allocation. This is still experimental for <FONT SIZE="-1">ARC,</FONT>
|
|
so by default the compiler uses standard reload
|
|
(i.e. <B>-mno-lra</B>).
|
|
<DT id="1929"><B>-mlra-priority-none</B><DD>
|
|
|
|
|
|
Don't indicate any priority for target registers.
|
|
<DT id="1930"><B>-mlra-priority-compact</B><DD>
|
|
|
|
|
|
Indicate target register priority for r0..r3 / r12..r15.
|
|
<DT id="1931"><B>-mlra-priority-noncompact</B><DD>
|
|
|
|
|
|
Reduce target register priority for r0..r3 / r12..r15.
|
|
<DT id="1932"><B>-mmillicode</B><DD>
|
|
|
|
|
|
When optimizing for size (using <B>-Os</B>), 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
|
|
referred to as a <I>millicode</I> call. As these calls can pose
|
|
performance issues, and/or cause linking issues when linking in a
|
|
nonstandard way, this option is provided to turn on or off millicode
|
|
call generation.
|
|
<DT id="1933"><B>-mcode-density-frame</B><DD>
|
|
|
|
|
|
This option enable the compiler to emit <TT>"enter"</TT> and <TT>"leave"</TT>
|
|
instructions. These instructions are only valid for CPUs with
|
|
code-density feature.
|
|
<DT id="1934"><B>-mmixed-code</B><DD>
|
|
|
|
|
|
Tweak register allocation to help 16-bit instruction generation.
|
|
This generally has the effect of decreasing the average instruction size
|
|
while increasing the instruction count.
|
|
<DT id="1935"><B>-mq-class</B><DD>
|
|
|
|
|
|
Enable <B>q</B> instruction alternatives.
|
|
This is the default for <B>-Os</B>.
|
|
<DT id="1936"><B>-mRcq</B><DD>
|
|
|
|
|
|
Enable <B>Rcq</B> constraint handling.
|
|
Most short code generation depends on this.
|
|
This is the default.
|
|
<DT id="1937"><B>-mRcw</B><DD>
|
|
|
|
|
|
Enable <B>Rcw</B> constraint handling.
|
|
Most ccfsm condexec mostly depends on this.
|
|
This is the default.
|
|
<DT id="1938"><B>-msize-level=</B><I>level</I><DD>
|
|
|
|
|
|
Fine-tune size optimization with regards to instruction lengths and alignment.
|
|
The recognized values for <I>level</I> are:
|
|
<DL COMPACT><DT id="1939"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1940"><B>0</B><DD>
|
|
|
|
|
|
No size optimization. This level is deprecated and treated like <B>1</B>.
|
|
<DT id="1941"><B>1</B><DD>
|
|
|
|
|
|
Short instructions are used opportunistically.
|
|
<DT id="1942"><B>2</B><DD>
|
|
|
|
|
|
In addition, alignment of loops and of code after barriers are dropped.
|
|
<DT id="1943"><B>3</B><DD>
|
|
|
|
|
|
In addition, optional data alignment is dropped, and the option <B>Os</B> is enabled.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1944"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This defaults to <B>3</B> when <B>-Os</B> is in effect. Otherwise,
|
|
the behavior when this is not set is equivalent to level <B>1</B>.
|
|
</DL>
|
|
|
|
<DT id="1945"><B>-mtune=</B><I>cpu</I><DD>
|
|
|
|
|
|
Set instruction scheduling parameters for <I>cpu</I>, overriding any implied
|
|
by <B>-mcpu=</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Supported values for <I>cpu</I> are
|
|
<DL COMPACT><DT id="1946"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1947"><B></B><FONT SIZE="-1"><B>ARC600</B></FONT><B></B><DD>
|
|
|
|
|
|
Tune for <FONT SIZE="-1">ARC600 CPU.</FONT>
|
|
<DT id="1948"><B></B><FONT SIZE="-1"><B>ARC601</B></FONT><B></B><DD>
|
|
|
|
|
|
Tune for <FONT SIZE="-1">ARC601 CPU.</FONT>
|
|
<DT id="1949"><B></B><FONT SIZE="-1"><B>ARC700</B></FONT><B></B><DD>
|
|
|
|
|
|
Tune for <FONT SIZE="-1">ARC700 CPU</FONT> with standard multiplier block.
|
|
<DT id="1950"><B>ARC700-xmac</B><DD>
|
|
|
|
|
|
Tune for <FONT SIZE="-1">ARC700 CPU</FONT> with <FONT SIZE="-1">XMAC</FONT> block.
|
|
<DT id="1951"><B></B><FONT SIZE="-1"><B>ARC725D</B></FONT><B></B><DD>
|
|
|
|
|
|
Tune for <FONT SIZE="-1">ARC725D CPU.</FONT>
|
|
<DT id="1952"><B></B><FONT SIZE="-1"><B>ARC750D</B></FONT><B></B><DD>
|
|
|
|
|
|
Tune for <FONT SIZE="-1">ARC750D CPU.</FONT>
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1953"><DD>
|
|
</DL>
|
|
|
|
<DT id="1954"><B>-mmultcost=</B><I>num</I><DD>
|
|
|
|
|
|
Cost to assume for a multiply instruction, with <B>4</B> being equal to a
|
|
normal instruction.
|
|
<DT id="1955"><B>-munalign-prob-threshold=</B><I>probability</I><DD>
|
|
|
|
|
|
Set probability threshold for unaligning branches.
|
|
When tuning for <B></B><FONT SIZE="-1"><B>ARC700</B></FONT><B></B> and optimizing for speed, branches without
|
|
filled delay slot are preferably emitted unaligned and long, unless
|
|
profiling indicates that the probability for the branch to be taken
|
|
is below <I>probability</I>.
|
|
The default is (<FONT SIZE="-1">REG_BR_PROB_BASE/2</FONT>), i.e. 5000.
|
|
</DL>
|
|
<P>
|
|
|
|
The following options are maintained for backward compatibility, but
|
|
are now deprecated and will be removed in a future release:
|
|
<DL COMPACT>
|
|
<DT id="1956"><B>-margonaut</B><DD>
|
|
|
|
|
|
Obsolete <FONT SIZE="-1">FPX.</FONT>
|
|
<DT id="1957"><B>-mbig-endian</B><DD>
|
|
|
|
|
|
|
|
<DT id="1958"><B>-EB</B><DD>
|
|
|
|
|
|
|
|
Compile code for big-endian targets. Use of these options is now
|
|
deprecated. Big-endian code is supported by configuring <FONT SIZE="-1">GCC</FONT> to build
|
|
<TT>"arceb-elf32"</TT> and <TT>"arceb-linux-uclibc"</TT> targets,
|
|
for which big endian is the default.
|
|
<DT id="1959"><B>-mlittle-endian</B><DD>
|
|
|
|
|
|
|
|
<DT id="1960"><B>-EL</B><DD>
|
|
|
|
|
|
|
|
Compile code for little-endian targets. Use of these options is now
|
|
deprecated. Little-endian code is supported by configuring <FONT SIZE="-1">GCC</FONT> to build
|
|
<TT>"arc-elf32"</TT> and <TT>"arc-linux-uclibc"</TT> targets,
|
|
for which little endian is the default.
|
|
<DT id="1961"><B>-mbarrel_shifter</B><DD>
|
|
|
|
|
|
Replaced by <B>-mbarrel-shifter</B>.
|
|
<DT id="1962"><B>-mdpfp_compact</B><DD>
|
|
|
|
|
|
Replaced by <B>-mdpfp-compact</B>.
|
|
<DT id="1963"><B>-mdpfp_fast</B><DD>
|
|
|
|
|
|
Replaced by <B>-mdpfp-fast</B>.
|
|
<DT id="1964"><B>-mdsp_packa</B><DD>
|
|
|
|
|
|
Replaced by <B>-mdsp-packa</B>.
|
|
<DT id="1965"><B>-mEA</B><DD>
|
|
|
|
|
|
Replaced by <B>-mea</B>.
|
|
<DT id="1966"><B>-mmac_24</B><DD>
|
|
|
|
|
|
Replaced by <B>-mmac-24</B>.
|
|
<DT id="1967"><B>-mmac_d16</B><DD>
|
|
|
|
|
|
Replaced by <B>-mmac-d16</B>.
|
|
<DT id="1968"><B>-mspfp_compact</B><DD>
|
|
|
|
|
|
Replaced by <B>-mspfp-compact</B>.
|
|
<DT id="1969"><B>-mspfp_fast</B><DD>
|
|
|
|
|
|
Replaced by <B>-mspfp-fast</B>.
|
|
<DT id="1970"><B>-mtune=</B><I>cpu</I><DD>
|
|
|
|
|
|
Values <B>arc600</B>, <B>arc601</B>, <B>arc700</B> and
|
|
<B>arc700-xmac</B> for <I>cpu</I> are replaced by <B></B><FONT SIZE="-1"><B>ARC600</B></FONT><B></B>,
|
|
<B></B><FONT SIZE="-1"><B>ARC601</B></FONT><B></B>, <B></B><FONT SIZE="-1"><B>ARC700</B></FONT><B></B> and <B>ARC700-xmac</B> respectively.
|
|
<DT id="1971"><B>-multcost=</B><I>num</I><DD>
|
|
|
|
|
|
Replaced by <B>-mmultcost</B>.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>ARM</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for the <FONT SIZE="-1">ARM</FONT> port:
|
|
<DL COMPACT>
|
|
<DT id="1972"><B>-mabi=</B><I>name</I><DD>
|
|
|
|
|
|
Generate code for the specified <FONT SIZE="-1">ABI.</FONT> Permissible values are: <B>apcs-gnu</B>,
|
|
<B>atpcs</B>, <B>aapcs</B>, <B>aapcs-linux</B> and <B>iwmmxt</B>.
|
|
<DT id="1973"><B>-mapcs-frame</B><DD>
|
|
|
|
|
|
Generate a stack frame that is compliant with the <FONT SIZE="-1">ARM</FONT> Procedure Call
|
|
Standard for all functions, even if this is not strictly necessary for
|
|
correct execution of the code. Specifying <B>-fomit-frame-pointer</B>
|
|
with this option causes the stack frames not to be generated for
|
|
leaf functions. The default is <B>-mno-apcs-frame</B>.
|
|
This option is deprecated.
|
|
<DT id="1974"><B>-mapcs</B><DD>
|
|
|
|
|
|
This is a synonym for <B>-mapcs-frame</B> and is deprecated.
|
|
<DT id="1975"><B>-mthumb-interwork</B><DD>
|
|
|
|
|
|
Generate code that supports calling between the <FONT SIZE="-1">ARM</FONT> and Thumb
|
|
instruction sets. Without this option, on pre-v5 architectures, the
|
|
two instruction sets cannot be reliably used inside one program. The
|
|
default is <B>-mno-thumb-interwork</B>, since slightly larger code
|
|
is generated when <B>-mthumb-interwork</B> is specified. In <FONT SIZE="-1">AAPCS</FONT>
|
|
configurations this option is meaningless.
|
|
<DT id="1976"><B>-mno-sched-prolog</B><DD>
|
|
|
|
|
|
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
|
|
of instructions (or in fact one of a choice from a small set of
|
|
different function prologues), and this information can be used to
|
|
locate the start of functions inside an executable piece of code. The
|
|
default is <B>-msched-prolog</B>.
|
|
<DT id="1977"><B>-mfloat-abi=</B><I>name</I><DD>
|
|
|
|
|
|
Specifies which floating-point <FONT SIZE="-1">ABI</FONT> to use. Permissible values
|
|
are: <B>soft</B>, <B>softfp</B> and <B>hard</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Specifying <B>soft</B> causes <FONT SIZE="-1">GCC</FONT> to generate output containing
|
|
library calls for floating-point operations.
|
|
<B>softfp</B> allows the generation of code using hardware floating-point
|
|
instructions, but still uses the soft-float calling conventions.
|
|
<B>hard</B> allows generation of floating-point instructions
|
|
and uses FPU-specific calling conventions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default depends on the specific target configuration. Note that
|
|
the hard-float and soft-float ABIs are not link-compatible; you must
|
|
compile your entire program with the same <FONT SIZE="-1">ABI,</FONT> and link with a
|
|
compatible set of libraries.
|
|
<DT id="1978"><B>-mgeneral-regs-only</B><DD>
|
|
|
|
|
|
Generate code which uses only the general-purpose registers. This will prevent
|
|
the compiler from using floating-point and Advanced <FONT SIZE="-1">SIMD</FONT> registers but will not
|
|
impose any restrictions on the assembler.
|
|
<DT id="1979"><B>-mlittle-endian</B><DD>
|
|
|
|
|
|
Generate code for a processor running in little-endian mode. This is
|
|
the default for all standard configurations.
|
|
<DT id="1980"><B>-mbig-endian</B><DD>
|
|
|
|
|
|
Generate code for a processor running in big-endian mode; the default is
|
|
to compile code for a little-endian processor.
|
|
<DT id="1981"><B>-mbe8</B><DD>
|
|
|
|
|
|
|
|
<DT id="1982"><B>-mbe32</B><DD>
|
|
|
|
|
|
|
|
When linking a big-endian image select between <FONT SIZE="-1">BE8</FONT> and <FONT SIZE="-1">BE32</FONT> 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 <FONT SIZE="-1">BE8,</FONT> for older architectures
|
|
the default is <FONT SIZE="-1">BE32.</FONT> <FONT SIZE="-1">BE32</FONT> format has been deprecated by <FONT SIZE="-1">ARM.</FONT>
|
|
<DT id="1983"><B>-march=</B><I>name</I>[<B>+extension...</B>]<DD>
|
|
|
|
|
|
This specifies the name of the target <FONT SIZE="-1">ARM</FONT> architecture. <FONT SIZE="-1">GCC</FONT> 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
|
|
of the <B>-mcpu=</B> option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Permissible names are:
|
|
<B>armv4t</B>,
|
|
<B>armv5t</B>, <B>armv5te</B>,
|
|
<B>armv6</B>, <B>armv6j</B>, <B>armv6k</B>, <B>armv6kz</B>, <B>armv6t2</B>,
|
|
<B>armv6z</B>, <B>armv6zk</B>,
|
|
<B>armv7</B>, <B>armv7-a</B>, <B>armv7ve</B>,
|
|
<B>armv8-a</B>, <B>armv8.1-a</B>, <B>armv8.2-a</B>, <B>armv8.3-a</B>,
|
|
<B>armv8.4-a</B>,
|
|
<B>armv8.5-a</B>,
|
|
<B>armv7-r</B>,
|
|
<B>armv8-r</B>,
|
|
<B>armv6-m</B>, <B>armv6s-m</B>,
|
|
<B>armv7-m</B>, <B>armv7e-m</B>,
|
|
<B>armv8-m.base</B>, <B>armv8-m.main</B>,
|
|
<B>iwmmxt</B> and <B>iwmmxt2</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Additionally, the following architectures, which lack support for the
|
|
Thumb execution state, are recognized but support is deprecated: <B>armv4</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Many of the architectures support extensions. These can be added by
|
|
appending <B>+</B><I>extension</I> to the architecture name. Extension
|
|
options are processed in order and capabilities accumulate. An extension
|
|
will also enable any necessary base extensions
|
|
upon which it depends. For example, the <B>+crypto</B> extension
|
|
will always enable the <B>+simd</B> extension. The exception to the
|
|
additive construction is for extensions that are prefixed with
|
|
<B>+no...</B>: these extensions disable the specified option and
|
|
any other extensions that may depend on the presence of that
|
|
extension.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, <B>-march=armv7-a+simd+nofp+vfpv4</B> is equivalent to
|
|
writing <B>-march=armv7-a+vfpv4</B> since the <B>+simd</B> option is
|
|
entirely disabled by the <B>+nofp</B> option that follows it.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Most extension names are generically named, but have an effect that is
|
|
dependent upon the architecture to which it is applied. For example,
|
|
the <B>+simd</B> option can be applied to both <B>armv7-a</B> and
|
|
<B>armv8-a</B> architectures, but will enable the original ARMv7-A
|
|
Advanced <FONT SIZE="-1">SIMD</FONT> (Neon) extensions for <B>armv7-a</B> and the ARMv8-A
|
|
variant for <B>armv8-a</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The table below lists the supported extensions for each architecture.
|
|
Architectures not mentioned do not support any extensions.
|
|
<DL COMPACT><DT id="1984"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1985"><B>armv5te</B><DD>
|
|
|
|
|
|
|
|
<DT id="1986"><B>armv6</B><DD>
|
|
|
|
|
|
<DT id="1987"><B>armv6j</B><DD>
|
|
|
|
|
|
<DT id="1988"><B>armv6k</B><DD>
|
|
|
|
|
|
<DT id="1989"><B>armv6kz</B><DD>
|
|
|
|
|
|
<DT id="1990"><B>armv6t2</B><DD>
|
|
|
|
|
|
<DT id="1991"><B>armv6z</B><DD>
|
|
|
|
|
|
<DT id="1992"><B>armv6zk</B><DD>
|
|
|
|
|
|
<DL COMPACT><DT id="1993"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1994"><B>+fp</B><DD>
|
|
|
|
|
|
|
|
The VFPv2 floating-point instructions. The extension <B>+vfpv2</B> can be
|
|
used as an alias for this extension.
|
|
<DT id="1995"><B>+nofp</B><DD>
|
|
|
|
|
|
Disable the floating-point instructions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="1996"><DD>
|
|
</DL>
|
|
|
|
<DT id="1997"><B>armv7</B><DD>
|
|
|
|
|
|
The common subset of the ARMv7-A, ARMv7-R and ARMv7-M architectures.
|
|
<DL COMPACT><DT id="1998"><DD>
|
|
<DL COMPACT>
|
|
<DT id="1999"><B>+fp</B><DD>
|
|
|
|
|
|
The VFPv3 floating-point instructions, with 16 double-precision
|
|
registers. The extension <B>+vfpv3-d16</B> can be used as an alias
|
|
for this extension. Note that floating-point is not supported by the
|
|
base ARMv7-M architecture, but is compatible with both the ARMv7-A and
|
|
ARMv7-R architectures.
|
|
<DT id="2000"><B>+nofp</B><DD>
|
|
|
|
|
|
Disable the floating-point instructions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2001"><DD>
|
|
</DL>
|
|
|
|
<DT id="2002"><B>armv7-a</B><DD>
|
|
|
|
|
|
<DL COMPACT><DT id="2003"><DD>
|
|
|
|
<DL COMPACT>
|
|
<DT id="2004"><B>+mp</B><DD>
|
|
|
|
|
|
|
|
The multiprocessing extension.
|
|
<DT id="2005"><B>+sec</B><DD>
|
|
|
|
|
|
The security extension.
|
|
<DT id="2006"><B>+fp</B><DD>
|
|
|
|
|
|
The VFPv3 floating-point instructions, with 16 double-precision
|
|
registers. The extension <B>+vfpv3-d16</B> can be used as an alias
|
|
for this extension.
|
|
<DT id="2007"><B>+simd</B><DD>
|
|
|
|
|
|
The Advanced <FONT SIZE="-1">SIMD</FONT> (Neon) v1 and the VFPv3 floating-point instructions.
|
|
The extensions <B>+neon</B> and <B>+neon-vfpv3</B> can be used as aliases
|
|
for this extension.
|
|
<DT id="2008"><B>+vfpv3</B><DD>
|
|
|
|
|
|
The VFPv3 floating-point instructions, with 32 double-precision
|
|
registers.
|
|
<DT id="2009"><B>+vfpv3-d16-fp16</B><DD>
|
|
|
|
|
|
The VFPv3 floating-point instructions, with 16 double-precision
|
|
registers and the half-precision floating-point conversion operations.
|
|
<DT id="2010"><B>+vfpv3-fp16</B><DD>
|
|
|
|
|
|
The VFPv3 floating-point instructions, with 32 double-precision
|
|
registers and the half-precision floating-point conversion operations.
|
|
<DT id="2011"><B>+vfpv4-d16</B><DD>
|
|
|
|
|
|
The VFPv4 floating-point instructions, with 16 double-precision
|
|
registers.
|
|
<DT id="2012"><B>+vfpv4</B><DD>
|
|
|
|
|
|
The VFPv4 floating-point instructions, with 32 double-precision
|
|
registers.
|
|
<DT id="2013"><B>+neon-fp16</B><DD>
|
|
|
|
|
|
The Advanced <FONT SIZE="-1">SIMD</FONT> (Neon) v1 and the VFPv3 floating-point instructions, with
|
|
the half-precision floating-point conversion operations.
|
|
<DT id="2014"><B>+neon-vfpv4</B><DD>
|
|
|
|
|
|
The Advanced <FONT SIZE="-1">SIMD</FONT> (Neon) v2 and the VFPv4 floating-point instructions.
|
|
<DT id="2015"><B>+nosimd</B><DD>
|
|
|
|
|
|
Disable the Advanced <FONT SIZE="-1">SIMD</FONT> instructions (does not disable floating point).
|
|
<DT id="2016"><B>+nofp</B><DD>
|
|
|
|
|
|
Disable the floating-point and Advanced <FONT SIZE="-1">SIMD</FONT> instructions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2017"><DD>
|
|
</DL>
|
|
|
|
<DT id="2018"><B>armv7ve</B><DD>
|
|
|
|
|
|
The extended version of the ARMv7-A architecture with support for
|
|
virtualization.
|
|
<DL COMPACT><DT id="2019"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2020"><B>+fp</B><DD>
|
|
|
|
|
|
The VFPv4 floating-point instructions, with 16 double-precision registers.
|
|
The extension <B>+vfpv4-d16</B> can be used as an alias for this extension.
|
|
<DT id="2021"><B>+simd</B><DD>
|
|
|
|
|
|
The Advanced <FONT SIZE="-1">SIMD</FONT> (Neon) v2 and the VFPv4 floating-point instructions. The
|
|
extension <B>+neon-vfpv4</B> can be used as an alias for this extension.
|
|
<DT id="2022"><B>+vfpv3-d16</B><DD>
|
|
|
|
|
|
The VFPv3 floating-point instructions, with 16 double-precision
|
|
registers.
|
|
<DT id="2023"><B>+vfpv3</B><DD>
|
|
|
|
|
|
The VFPv3 floating-point instructions, with 32 double-precision
|
|
registers.
|
|
<DT id="2024"><B>+vfpv3-d16-fp16</B><DD>
|
|
|
|
|
|
The VFPv3 floating-point instructions, with 16 double-precision
|
|
registers and the half-precision floating-point conversion operations.
|
|
<DT id="2025"><B>+vfpv3-fp16</B><DD>
|
|
|
|
|
|
The VFPv3 floating-point instructions, with 32 double-precision
|
|
registers and the half-precision floating-point conversion operations.
|
|
<DT id="2026"><B>+vfpv4-d16</B><DD>
|
|
|
|
|
|
The VFPv4 floating-point instructions, with 16 double-precision
|
|
registers.
|
|
<DT id="2027"><B>+vfpv4</B><DD>
|
|
|
|
|
|
The VFPv4 floating-point instructions, with 32 double-precision
|
|
registers.
|
|
<DT id="2028"><B>+neon</B><DD>
|
|
|
|
|
|
The Advanced <FONT SIZE="-1">SIMD</FONT> (Neon) v1 and the VFPv3 floating-point instructions.
|
|
The extension <B>+neon-vfpv3</B> can be used as an alias for this extension.
|
|
<DT id="2029"><B>+neon-fp16</B><DD>
|
|
|
|
|
|
The Advanced <FONT SIZE="-1">SIMD</FONT> (Neon) v1 and the VFPv3 floating-point instructions, with
|
|
the half-precision floating-point conversion operations.
|
|
<DT id="2030"><B>+nosimd</B><DD>
|
|
|
|
|
|
Disable the Advanced <FONT SIZE="-1">SIMD</FONT> instructions (does not disable floating point).
|
|
<DT id="2031"><B>+nofp</B><DD>
|
|
|
|
|
|
Disable the floating-point and Advanced <FONT SIZE="-1">SIMD</FONT> instructions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2032"><DD>
|
|
</DL>
|
|
|
|
<DT id="2033"><B>armv8-a</B><DD>
|
|
|
|
|
|
<DL COMPACT><DT id="2034"><DD>
|
|
|
|
<DL COMPACT>
|
|
<DT id="2035"><B>+crc</B><DD>
|
|
|
|
|
|
|
|
The Cyclic Redundancy Check (<FONT SIZE="-1">CRC</FONT>) instructions.
|
|
<DT id="2036"><B>+simd</B><DD>
|
|
|
|
|
|
The ARMv8-A Advanced <FONT SIZE="-1">SIMD</FONT> and floating-point instructions.
|
|
<DT id="2037"><B>+crypto</B><DD>
|
|
|
|
|
|
The cryptographic instructions.
|
|
<DT id="2038"><B>+nocrypto</B><DD>
|
|
|
|
|
|
Disable the cryptographic instructions.
|
|
<DT id="2039"><B>+nofp</B><DD>
|
|
|
|
|
|
Disable the floating-point, Advanced <FONT SIZE="-1">SIMD</FONT> and cryptographic instructions.
|
|
<DT id="2040"><B>+sb</B><DD>
|
|
|
|
|
|
Speculation Barrier Instruction.
|
|
<DT id="2041"><B>+predres</B><DD>
|
|
|
|
|
|
Execution and Data Prediction Restriction Instructions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2042"><DD>
|
|
</DL>
|
|
|
|
<DT id="2043"><B>armv8.1-a</B><DD>
|
|
|
|
|
|
<DL COMPACT><DT id="2044"><DD>
|
|
|
|
<DL COMPACT>
|
|
<DT id="2045"><B>+simd</B><DD>
|
|
|
|
|
|
|
|
The ARMv8.1-A Advanced <FONT SIZE="-1">SIMD</FONT> and floating-point instructions.
|
|
<DT id="2046"><B>+crypto</B><DD>
|
|
|
|
|
|
The cryptographic instructions. This also enables the Advanced <FONT SIZE="-1">SIMD</FONT> and
|
|
floating-point instructions.
|
|
<DT id="2047"><B>+nocrypto</B><DD>
|
|
|
|
|
|
Disable the cryptographic instructions.
|
|
<DT id="2048"><B>+nofp</B><DD>
|
|
|
|
|
|
Disable the floating-point, Advanced <FONT SIZE="-1">SIMD</FONT> and cryptographic instructions.
|
|
<DT id="2049"><B>+sb</B><DD>
|
|
|
|
|
|
Speculation Barrier Instruction.
|
|
<DT id="2050"><B>+predres</B><DD>
|
|
|
|
|
|
Execution and Data Prediction Restriction Instructions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2051"><DD>
|
|
</DL>
|
|
|
|
<DT id="2052"><B>armv8.2-a</B><DD>
|
|
|
|
|
|
|
|
<DT id="2053"><B>armv8.3-a</B><DD>
|
|
|
|
|
|
<DL COMPACT><DT id="2054"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2055"><B>+fp16</B><DD>
|
|
|
|
|
|
|
|
The half-precision floating-point data processing instructions.
|
|
This also enables the Advanced <FONT SIZE="-1">SIMD</FONT> and floating-point instructions.
|
|
<DT id="2056"><B>+fp16fml</B><DD>
|
|
|
|
|
|
The half-precision floating-point fmla extension. This also enables
|
|
the half-precision floating-point extension and Advanced <FONT SIZE="-1">SIMD</FONT> and
|
|
floating-point instructions.
|
|
<DT id="2057"><B>+simd</B><DD>
|
|
|
|
|
|
The ARMv8.1-A Advanced <FONT SIZE="-1">SIMD</FONT> and floating-point instructions.
|
|
<DT id="2058"><B>+crypto</B><DD>
|
|
|
|
|
|
The cryptographic instructions. This also enables the Advanced <FONT SIZE="-1">SIMD</FONT> and
|
|
floating-point instructions.
|
|
<DT id="2059"><B>+dotprod</B><DD>
|
|
|
|
|
|
Enable the Dot Product extension. This also enables Advanced <FONT SIZE="-1">SIMD</FONT> instructions.
|
|
<DT id="2060"><B>+nocrypto</B><DD>
|
|
|
|
|
|
Disable the cryptographic extension.
|
|
<DT id="2061"><B>+nofp</B><DD>
|
|
|
|
|
|
Disable the floating-point, Advanced <FONT SIZE="-1">SIMD</FONT> and cryptographic instructions.
|
|
<DT id="2062"><B>+sb</B><DD>
|
|
|
|
|
|
Speculation Barrier Instruction.
|
|
<DT id="2063"><B>+predres</B><DD>
|
|
|
|
|
|
Execution and Data Prediction Restriction Instructions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2064"><DD>
|
|
</DL>
|
|
|
|
<DT id="2065"><B>armv8.4-a</B><DD>
|
|
|
|
|
|
<DL COMPACT><DT id="2066"><DD>
|
|
|
|
<DL COMPACT>
|
|
<DT id="2067"><B>+fp16</B><DD>
|
|
|
|
|
|
|
|
The half-precision floating-point data processing instructions.
|
|
This also enables the Advanced <FONT SIZE="-1">SIMD</FONT> and floating-point instructions as well
|
|
as the Dot Product extension and the half-precision floating-point fmla
|
|
extension.
|
|
<DT id="2068"><B>+simd</B><DD>
|
|
|
|
|
|
The ARMv8.3-A Advanced <FONT SIZE="-1">SIMD</FONT> and floating-point instructions as well as the
|
|
Dot Product extension.
|
|
<DT id="2069"><B>+crypto</B><DD>
|
|
|
|
|
|
The cryptographic instructions. This also enables the Advanced <FONT SIZE="-1">SIMD</FONT> and
|
|
floating-point instructions as well as the Dot Product extension.
|
|
<DT id="2070"><B>+nocrypto</B><DD>
|
|
|
|
|
|
Disable the cryptographic extension.
|
|
<DT id="2071"><B>+nofp</B><DD>
|
|
|
|
|
|
Disable the floating-point, Advanced <FONT SIZE="-1">SIMD</FONT> and cryptographic instructions.
|
|
<DT id="2072"><B>+sb</B><DD>
|
|
|
|
|
|
Speculation Barrier Instruction.
|
|
<DT id="2073"><B>+predres</B><DD>
|
|
|
|
|
|
Execution and Data Prediction Restriction Instructions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2074"><DD>
|
|
</DL>
|
|
|
|
<DT id="2075"><B>armv8.5-a</B><DD>
|
|
|
|
|
|
<DL COMPACT><DT id="2076"><DD>
|
|
|
|
<DL COMPACT>
|
|
<DT id="2077"><B>+fp16</B><DD>
|
|
|
|
|
|
|
|
The half-precision floating-point data processing instructions.
|
|
This also enables the Advanced <FONT SIZE="-1">SIMD</FONT> and floating-point instructions as well
|
|
as the Dot Product extension and the half-precision floating-point fmla
|
|
extension.
|
|
<DT id="2078"><B>+simd</B><DD>
|
|
|
|
|
|
The ARMv8.3-A Advanced <FONT SIZE="-1">SIMD</FONT> and floating-point instructions as well as the
|
|
Dot Product extension.
|
|
<DT id="2079"><B>+crypto</B><DD>
|
|
|
|
|
|
The cryptographic instructions. This also enables the Advanced <FONT SIZE="-1">SIMD</FONT> and
|
|
floating-point instructions as well as the Dot Product extension.
|
|
<DT id="2080"><B>+nocrypto</B><DD>
|
|
|
|
|
|
Disable the cryptographic extension.
|
|
<DT id="2081"><B>+nofp</B><DD>
|
|
|
|
|
|
Disable the floating-point, Advanced <FONT SIZE="-1">SIMD</FONT> and cryptographic instructions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2082"><DD>
|
|
</DL>
|
|
|
|
<DT id="2083"><B>armv7-r</B><DD>
|
|
|
|
|
|
<DL COMPACT><DT id="2084"><DD>
|
|
|
|
<DL COMPACT>
|
|
<DT id="2085"><B>+fp.sp</B><DD>
|
|
|
|
|
|
|
|
The single-precision VFPv3 floating-point instructions. The extension
|
|
<B>+vfpv3xd</B> can be used as an alias for this extension.
|
|
<DT id="2086"><B>+fp</B><DD>
|
|
|
|
|
|
The VFPv3 floating-point instructions with 16 double-precision registers.
|
|
The extension +vfpv3-d16 can be used as an alias for this extension.
|
|
<DT id="2087"><B>+vfpv3xd-d16-fp16</B><DD>
|
|
|
|
|
|
The single-precision VFPv3 floating-point instructions with 16 double-precision
|
|
registers and the half-precision floating-point conversion operations.
|
|
<DT id="2088"><B>+vfpv3-d16-fp16</B><DD>
|
|
|
|
|
|
The VFPv3 floating-point instructions with 16 double-precision
|
|
registers and the half-precision floating-point conversion operations.
|
|
<DT id="2089"><B>+nofp</B><DD>
|
|
|
|
|
|
Disable the floating-point extension.
|
|
<DT id="2090"><B>+idiv</B><DD>
|
|
|
|
|
|
The ARM-state integer division instructions.
|
|
<DT id="2091"><B>+noidiv</B><DD>
|
|
|
|
|
|
Disable the ARM-state integer division extension.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2092"><DD>
|
|
</DL>
|
|
|
|
<DT id="2093"><B>armv7e-m</B><DD>
|
|
|
|
|
|
<DL COMPACT><DT id="2094"><DD>
|
|
|
|
<DL COMPACT>
|
|
<DT id="2095"><B>+fp</B><DD>
|
|
|
|
|
|
|
|
The single-precision VFPv4 floating-point instructions.
|
|
<DT id="2096"><B>+fpv5</B><DD>
|
|
|
|
|
|
The single-precision FPv5 floating-point instructions.
|
|
<DT id="2097"><B>+fp.dp</B><DD>
|
|
|
|
|
|
The single- and double-precision FPv5 floating-point instructions.
|
|
<DT id="2098"><B>+nofp</B><DD>
|
|
|
|
|
|
Disable the floating-point extensions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2099"><DD>
|
|
</DL>
|
|
|
|
<DT id="2100"><B>armv8-m.main</B><DD>
|
|
|
|
|
|
<DL COMPACT><DT id="2101"><DD>
|
|
|
|
<DL COMPACT>
|
|
<DT id="2102"><B>+dsp</B><DD>
|
|
|
|
|
|
|
|
The <FONT SIZE="-1">DSP</FONT> instructions.
|
|
<DT id="2103"><B>+nodsp</B><DD>
|
|
|
|
|
|
Disable the <FONT SIZE="-1">DSP</FONT> extension.
|
|
<DT id="2104"><B>+fp</B><DD>
|
|
|
|
|
|
The single-precision floating-point instructions.
|
|
<DT id="2105"><B>+fp.dp</B><DD>
|
|
|
|
|
|
The single- and double-precision floating-point instructions.
|
|
<DT id="2106"><B>+nofp</B><DD>
|
|
|
|
|
|
Disable the floating-point extension.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2107"><DD>
|
|
</DL>
|
|
|
|
<DT id="2108"><B>armv8-r</B><DD>
|
|
|
|
|
|
<DL COMPACT><DT id="2109"><DD>
|
|
|
|
<DL COMPACT>
|
|
<DT id="2110"><B>+crc</B><DD>
|
|
|
|
|
|
|
|
The Cyclic Redundancy Check (<FONT SIZE="-1">CRC</FONT>) instructions.
|
|
<DT id="2111"><B>+fp.sp</B><DD>
|
|
|
|
|
|
The single-precision FPv5 floating-point instructions.
|
|
<DT id="2112"><B>+simd</B><DD>
|
|
|
|
|
|
The ARMv8-A Advanced <FONT SIZE="-1">SIMD</FONT> and floating-point instructions.
|
|
<DT id="2113"><B>+crypto</B><DD>
|
|
|
|
|
|
The cryptographic instructions.
|
|
<DT id="2114"><B>+nocrypto</B><DD>
|
|
|
|
|
|
Disable the cryptographic instructions.
|
|
<DT id="2115"><B>+nofp</B><DD>
|
|
|
|
|
|
Disable the floating-point, Advanced <FONT SIZE="-1">SIMD</FONT> and cryptographic instructions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2116"><DD>
|
|
</DL>
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2117"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-march=native</B> causes the compiler to auto-detect the architecture
|
|
of the build computer. At present, this feature is only supported on
|
|
GNU/Linux, and not all architectures are recognized. If the auto-detect
|
|
is unsuccessful the option has no effect.
|
|
</DL>
|
|
|
|
<DT id="2118"><B>-mtune=</B><I>name</I><DD>
|
|
|
|
|
|
This option specifies the name of the target <FONT SIZE="-1">ARM</FONT> processor for
|
|
which <FONT SIZE="-1">GCC</FONT> should tune the performance of the code.
|
|
For some <FONT SIZE="-1">ARM</FONT> implementations better performance can be obtained by using
|
|
this option.
|
|
Permissible names are: <B>arm7tdmi</B>, <B>arm7tdmi-s</B>, <B>arm710t</B>,
|
|
<B>arm720t</B>, <B>arm740t</B>, <B>strongarm</B>, <B>strongarm110</B>,
|
|
<B>strongarm1100</B>, 0<B>strongarm1110</B>, <B>arm8</B>, <B>arm810</B>,
|
|
<B>arm9</B>, <B>arm9e</B>, <B>arm920</B>, <B>arm920t</B>, <B>arm922t</B>,
|
|
<B>arm946e-s</B>, <B>arm966e-s</B>, <B>arm968e-s</B>, <B>arm926ej-s</B>,
|
|
<B>arm940t</B>, <B>arm9tdmi</B>, <B>arm10tdmi</B>, <B>arm1020t</B>,
|
|
<B>arm1026ej-s</B>, <B>arm10e</B>, <B>arm1020e</B>, <B>arm1022e</B>,
|
|
<B>arm1136j-s</B>, <B>arm1136jf-s</B>, <B>mpcore</B>, <B>mpcorenovfp</B>,
|
|
<B>arm1156t2-s</B>, <B>arm1156t2f-s</B>, <B>arm1176jz-s</B>, <B>arm1176jzf-s</B>,
|
|
<B>generic-armv7-a</B>, <B>cortex-a5</B>, <B>cortex-a7</B>, <B>cortex-a8</B>,
|
|
<B>cortex-a9</B>, <B>cortex-a12</B>, <B>cortex-a15</B>, <B>cortex-a17</B>,
|
|
<B>cortex-a32</B>, <B>cortex-a35</B>, <B>cortex-a53</B>, <B>cortex-a55</B>,
|
|
<B>cortex-a57</B>, <B>cortex-a72</B>, <B>cortex-a73</B>, <B>cortex-a75</B>,
|
|
<B>cortex-a76</B>, <B>ares</B>, <B>cortex-r4</B>, <B>cortex-r4f</B>,
|
|
<B>cortex-r5</B>, <B>cortex-r7</B>, <B>cortex-r8</B>, <B>cortex-r52</B>,
|
|
<B>cortex-m0</B>, <B>cortex-m0plus</B>, <B>cortex-m1</B>, <B>cortex-m3</B>,
|
|
<B>cortex-m4</B>, <B>cortex-m7</B>, <B>cortex-m23</B>, <B>cortex-m33</B>,
|
|
<B>cortex-m1.small-multiply</B>, <B>cortex-m0.small-multiply</B>,
|
|
<B>cortex-m0plus.small-multiply</B>, <B>exynos-m1</B>, <B>marvell-pj4</B>,
|
|
<B>neoverse-n1</B>, <B>xscale</B>, <B>iwmmxt</B>, <B>iwmmxt2</B>,
|
|
<B>ep9312</B>, <B>fa526</B>, <B>fa626</B>, <B>fa606te</B>, <B>fa626te</B>,
|
|
<B>fmp626</B>, <B>fa726te</B>, <B>xgene1</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Additionally, this option can specify that <FONT SIZE="-1">GCC</FONT> should tune the performance
|
|
of the code for a big.LITTLE system. Permissible names are:
|
|
<B>cortex-a15.cortex-a7</B>, <B>cortex-a17.cortex-a7</B>,
|
|
<B>cortex-a57.cortex-a53</B>, <B>cortex-a72.cortex-a53</B>,
|
|
<B>cortex-a72.cortex-a35</B>, <B>cortex-a73.cortex-a53</B>,
|
|
<B>cortex-a75.cortex-a55</B>, <B>cortex-a76.cortex-a55</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mtune=generic-</B><I>arch</I> specifies that <FONT SIZE="-1">GCC</FONT> should tune the
|
|
performance for a blend of processors within architecture <I>arch</I>.
|
|
The aim is to generate code that run well on the current most popular
|
|
processors, balancing between optimizations that benefit some CPUs in the
|
|
range, and avoiding performance pitfalls of other CPUs. The effects of
|
|
this option may change in future <FONT SIZE="-1">GCC</FONT> versions as <FONT SIZE="-1">CPU</FONT> models come and go.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mtune</B> permits the same extension options as <B>-mcpu</B>, but
|
|
the extension options do not affect the tuning of the generated code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mtune=native</B> causes the compiler to auto-detect the <FONT SIZE="-1">CPU</FONT>
|
|
of the build computer. At present, this feature is only supported on
|
|
GNU/Linux, and not all architectures are recognized. If the auto-detect is
|
|
unsuccessful the option has no effect.
|
|
<DT id="2119"><B>-mcpu=</B><I>name</I>[<B>+extension...</B>]<DD>
|
|
|
|
|
|
This specifies the name of the target <FONT SIZE="-1">ARM</FONT> processor. <FONT SIZE="-1">GCC</FONT> uses this name
|
|
to derive the name of the target <FONT SIZE="-1">ARM</FONT> architecture (as if specified
|
|
by <B>-march</B>) and the <FONT SIZE="-1">ARM</FONT> processor type for which to tune for
|
|
performance (as if specified by <B>-mtune</B>). Where this option
|
|
is used in conjunction with <B>-march</B> or <B>-mtune</B>,
|
|
those options take precedence over the appropriate part of this option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Many of the supported CPUs implement optional architectural
|
|
extensions. Where this is so the architectural extensions are
|
|
normally enabled by default. If implementations that lack the
|
|
extension exist, then the extension syntax can be used to disable
|
|
those extensions that have been omitted. For floating-point and
|
|
Advanced <FONT SIZE="-1">SIMD</FONT> (Neon) instructions, the settings of the options
|
|
<B>-mfloat-abi</B> and <B>-mfpu</B> must also be considered:
|
|
floating-point and Advanced <FONT SIZE="-1">SIMD</FONT> instructions will only be used if
|
|
<B>-mfloat-abi</B> is not set to <B>soft</B>; and any setting of
|
|
<B>-mfpu</B> other than <B>auto</B> will override the available
|
|
floating-point and <FONT SIZE="-1">SIMD</FONT> extension instructions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, <B>cortex-a9</B> can be found in three major
|
|
configurations: integer only, with just a floating-point unit or with
|
|
floating-point and Advanced <FONT SIZE="-1">SIMD.</FONT> The default is to enable all the
|
|
instructions, but the extensions <B>+nosimd</B> and <B>+nofp</B> can
|
|
be used to disable just the <FONT SIZE="-1">SIMD</FONT> or both the <FONT SIZE="-1">SIMD</FONT> and floating-point
|
|
instructions respectively.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Permissible names for this option are the same as those for
|
|
<B>-mtune</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The following extension options are common to the listed CPUs:
|
|
<DL COMPACT><DT id="2120"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2121"><B>+nodsp</B><DD>
|
|
|
|
|
|
Disable the <FONT SIZE="-1">DSP</FONT> instructions on <B>cortex-m33</B>.
|
|
<DT id="2122"><B>+nofp</B><DD>
|
|
|
|
|
|
Disables the floating-point instructions on <B>arm9e</B>,
|
|
<B>arm946e-s</B>, <B>arm966e-s</B>, <B>arm968e-s</B>, <B>arm10e</B>,
|
|
<B>arm1020e</B>, <B>arm1022e</B>, <B>arm926ej-s</B>,
|
|
<B>arm1026ej-s</B>, <B>cortex-r5</B>, <B>cortex-r7</B>, <B>cortex-r8</B>,
|
|
<B>cortex-m4</B>, <B>cortex-m7</B> and <B>cortex-m33</B>.
|
|
Disables the floating-point and <FONT SIZE="-1">SIMD</FONT> instructions on
|
|
<B>generic-armv7-a</B>, <B>cortex-a5</B>, <B>cortex-a7</B>,
|
|
<B>cortex-a8</B>, <B>cortex-a9</B>, <B>cortex-a12</B>,
|
|
<B>cortex-a15</B>, <B>cortex-a17</B>, <B>cortex-a15.cortex-a7</B>,
|
|
<B>cortex-a17.cortex-a7</B>, <B>cortex-a32</B>, <B>cortex-a35</B>,
|
|
<B>cortex-a53</B> and <B>cortex-a55</B>.
|
|
<DT id="2123"><B>+nofp.dp</B><DD>
|
|
|
|
|
|
Disables the double-precision component of the floating-point instructions
|
|
on <B>cortex-r5</B>, <B>cortex-r7</B>, <B>cortex-r8</B>, <B>cortex-r52</B> and
|
|
<B>cortex-m7</B>.
|
|
<DT id="2124"><B>+nosimd</B><DD>
|
|
|
|
|
|
Disables the <FONT SIZE="-1">SIMD</FONT> (but not floating-point) instructions on
|
|
<B>generic-armv7-a</B>, <B>cortex-a5</B>, <B>cortex-a7</B>
|
|
and <B>cortex-a9</B>.
|
|
<DT id="2125"><B>+crypto</B><DD>
|
|
|
|
|
|
Enables the cryptographic instructions on <B>cortex-a32</B>,
|
|
<B>cortex-a35</B>, <B>cortex-a53</B>, <B>cortex-a55</B>, <B>cortex-a57</B>,
|
|
<B>cortex-a72</B>, <B>cortex-a73</B>, <B>cortex-a75</B>, <B>exynos-m1</B>,
|
|
<B>xgene1</B>, <B>cortex-a57.cortex-a53</B>, <B>cortex-a72.cortex-a53</B>,
|
|
<B>cortex-a73.cortex-a35</B>, <B>cortex-a73.cortex-a53</B> and
|
|
<B>cortex-a75.cortex-a55</B>.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2126"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Additionally the <B>generic-armv7-a</B> pseudo target defaults to
|
|
VFPv3 with 16 double-precision registers. It supports the following
|
|
extension options: <B>mp</B>, <B>sec</B>, <B>vfpv3-d16</B>,
|
|
<B>vfpv3</B>, <B>vfpv3-d16-fp16</B>, <B>vfpv3-fp16</B>,
|
|
<B>vfpv4-d16</B>, <B>vfpv4</B>, <B>neon</B>, <B>neon-vfpv3</B>,
|
|
<B>neon-fp16</B>, <B>neon-vfpv4</B>. The meanings are the same as for
|
|
the extensions to <B>-march=armv7-a</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mcpu=generic-</B><I>arch</I> is also permissible, and is
|
|
equivalent to <B>-march=</B><I>arch</I> <B>-mtune=generic-</B><I>arch</I>.
|
|
See <B>-mtune</B> for more information.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mcpu=native</B> causes the compiler to auto-detect the <FONT SIZE="-1">CPU</FONT>
|
|
of the build computer. At present, this feature is only supported on
|
|
GNU/Linux, and not all architectures are recognized. If the auto-detect
|
|
is unsuccessful the option has no effect.
|
|
</DL>
|
|
|
|
<DT id="2127"><B>-mfpu=</B><I>name</I><DD>
|
|
|
|
|
|
This specifies what floating-point hardware (or hardware emulation) is
|
|
available on the target. Permissible names are: <B>auto</B>, <B>vfpv2</B>,
|
|
<B>vfpv3</B>,
|
|
<B>vfpv3-fp16</B>, <B>vfpv3-d16</B>, <B>vfpv3-d16-fp16</B>, <B>vfpv3xd</B>,
|
|
<B>vfpv3xd-fp16</B>, <B>neon-vfpv3</B>, <B>neon-fp16</B>, <B>vfpv4</B>,
|
|
<B>vfpv4-d16</B>, <B>fpv4-sp-d16</B>, <B>neon-vfpv4</B>,
|
|
<B>fpv5-d16</B>, <B>fpv5-sp-d16</B>,
|
|
<B>fp-armv8</B>, <B>neon-fp-armv8</B> and <B>crypto-neon-fp-armv8</B>.
|
|
Note that <B>neon</B> is an alias for <B>neon-vfpv3</B> and <B>vfp</B>
|
|
is an alias for <B>vfpv2</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The setting <B>auto</B> is the default and is special. It causes the
|
|
compiler to select the floating-point and Advanced <FONT SIZE="-1">SIMD</FONT> instructions
|
|
based on the settings of <B>-mcpu</B> and <B>-march</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If the selected floating-point hardware includes the <FONT SIZE="-1">NEON</FONT> extension
|
|
(e.g. <B>-mfpu=neon</B>), note that floating-point
|
|
operations are not generated by <FONT SIZE="-1">GCC</FONT>'s auto-vectorization pass unless
|
|
<B>-funsafe-math-optimizations</B> is also specified. This is
|
|
because <FONT SIZE="-1">NEON</FONT> hardware does not fully implement the <FONT SIZE="-1">IEEE 754</FONT> standard for
|
|
floating-point arithmetic (in particular denormal values are treated as
|
|
zero), so the use of <FONT SIZE="-1">NEON</FONT> instructions may lead to a loss of precision.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can also set the fpu name at function level by using the <TT>"target("fpu=")"</TT> function attributes or pragmas.
|
|
<DT id="2128"><B>-mfp16-format=</B><I>name</I><DD>
|
|
|
|
|
|
Specify the format of the <TT>"__fp16"</TT> half-precision floating-point type.
|
|
Permissible names are <B>none</B>, <B>ieee</B>, and <B>alternative</B>;
|
|
the default is <B>none</B>, in which case the <TT>"__fp16"</TT> type is not
|
|
defined.
|
|
<DT id="2129"><B>-mstructure-size-boundary=</B><I>n</I><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">COFF</FONT>
|
|
targeted toolchain the default value is 8. A value of 64 is only allowed
|
|
if the underlying <FONT SIZE="-1">ABI</FONT> supports it.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Specifying a larger number can produce faster, more efficient code, but
|
|
can also increase the size of the program. Different values are potentially
|
|
incompatible. Code compiled with one value cannot necessarily expect to
|
|
work with code or libraries compiled with another value, if they exchange
|
|
information using structures or unions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is deprecated.
|
|
<DT id="2130"><B>-mabort-on-noreturn</B><DD>
|
|
|
|
|
|
Generate a call to the function <TT>"abort"</TT> at the end of a
|
|
<TT>"noreturn"</TT> function. It is executed if the function tries to
|
|
return.
|
|
<DT id="2131"><B>-mlong-calls</B><DD>
|
|
|
|
|
|
|
|
<DT id="2132"><B>-mno-long-calls</B><DD>
|
|
|
|
|
|
|
|
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
|
|
lies outside of the 64-megabyte addressing range of the offset-based
|
|
version of subroutine call instruction.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Even if this switch is enabled, not all function calls are turned
|
|
into long calls. The heuristic is that static functions, functions
|
|
that have the <TT>"short_call"</TT> attribute, functions that are inside
|
|
the scope of a <TT>"#pragma no_long_calls"</TT> directive, and functions whose
|
|
definitions have already been compiled within the current compilation
|
|
unit are not turned into long calls. The exceptions to this rule are
|
|
that weak function definitions, functions with the <TT>"long_call"</TT>
|
|
attribute or the <TT>"section"</TT> attribute, and functions that are within
|
|
the scope of a <TT>"#pragma long_calls"</TT> directive are always
|
|
turned into long calls.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This feature is not enabled by default. Specifying
|
|
<B>-mno-long-calls</B> restores the default behavior, as does
|
|
placing the function calls within the scope of a <TT>"#pragma
|
|
long_calls_off"</TT> directive. Note these switches have no effect on how
|
|
the compiler generates code to handle function calls via function
|
|
pointers.
|
|
<DT id="2133"><B>-msingle-pic-base</B><DD>
|
|
|
|
|
|
Treat the register used for <FONT SIZE="-1">PIC</FONT> 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.
|
|
<DT id="2134"><B>-mpic-register=</B><I>reg</I><DD>
|
|
|
|
|
|
Specify the register to be used for <FONT SIZE="-1">PIC</FONT> addressing.
|
|
For standard <FONT SIZE="-1">PIC</FONT> base case, the default is any suitable register
|
|
determined by compiler. For single <FONT SIZE="-1">PIC</FONT> base case, the default is
|
|
<B>R9</B> if target is <FONT SIZE="-1">EABI</FONT> based or stack-checking is enabled,
|
|
otherwise the default is <B>R10</B>.
|
|
<DT id="2135"><B>-mpic-data-is-text-relative</B><DD>
|
|
|
|
|
|
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
|
|
non-VxWorks <FONT SIZE="-1">RTP</FONT> targets, this option is enabled by default. When
|
|
disabled on such targets, it will enable <B>-msingle-pic-base</B> by
|
|
default.
|
|
<DT id="2136"><B>-mpoke-function-name</B><DD>
|
|
|
|
|
|
Write the name of each function into the text section, directly
|
|
preceding the function prologue. The generated code is similar to this:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
t0
|
|
.ascii "arm_poke_function_name", 0
|
|
.align
|
|
t1
|
|
.word 0xff000000 + (t1 - t0)
|
|
arm_poke_function_name
|
|
mov ip, sp
|
|
stmfd sp!, {fp, ip, lr, pc}
|
|
sub fp, ip, #4
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When performing a stack backtrace, code can inspect the value of
|
|
<TT>"pc"</TT> stored at <TT>"fp + 0"</TT>. If the trace function then looks at
|
|
location <TT>"pc - 12"</TT> and the top 8 bits are set, then we know that
|
|
there is a function name embedded immediately preceding this location
|
|
and has length <TT>"((pc[-3]) & 0xff000000)"</TT>.
|
|
<DT id="2137"><B>-mthumb</B><DD>
|
|
|
|
|
|
|
|
<DT id="2138"><B>-marm</B><DD>
|
|
|
|
|
|
|
|
Select between generating code that executes in <FONT SIZE="-1">ARM</FONT> and Thumb
|
|
states. The default for most configurations is to generate code
|
|
that executes in <FONT SIZE="-1">ARM</FONT> state, but the default can be changed by
|
|
configuring <FONT SIZE="-1">GCC</FONT> with the <B>--with-mode=</B><I>state</I>
|
|
configure option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can also override the <FONT SIZE="-1">ARM</FONT> and Thumb mode for each function
|
|
by using the <TT>"target("thumb")"</TT> and <TT>"target("arm")"</TT> function attributes or pragmas.
|
|
<DT id="2139"><B>-mflip-thumb</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2140"><B>-mtpcs-frame</B><DD>
|
|
|
|
|
|
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 <B>-mno-tpcs-frame</B>.
|
|
<DT id="2141"><B>-mtpcs-leaf-frame</B><DD>
|
|
|
|
|
|
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 <B>-mno-apcs-leaf-frame</B>.
|
|
<DT id="2142"><B>-mcallee-super-interworking</B><DD>
|
|
|
|
|
|
Gives all externally visible functions in the file being compiled an <FONT SIZE="-1">ARM</FONT>
|
|
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 <FONT SIZE="-1">AAPCS</FONT> configurations
|
|
because interworking is enabled by default.
|
|
<DT id="2143"><B>-mcaller-super-interworking</B><DD>
|
|
|
|
|
|
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
|
|
of executing a function pointer if this option is enabled. This option
|
|
is not valid in <FONT SIZE="-1">AAPCS</FONT> configurations because interworking is enabled
|
|
by default.
|
|
<DT id="2144"><B>-mtp=</B><I>name</I><DD>
|
|
|
|
|
|
Specify the access model for the thread local storage pointer. The valid
|
|
models are <B>soft</B>, which generates calls to <TT>"__aeabi_read_tp"</TT>,
|
|
<B>cp15</B>, which fetches the thread pointer from <TT>"cp15"</TT> directly
|
|
(supported in the arm6k architecture), and <B>auto</B>, which uses the
|
|
best available method for the selected processor. The default setting is
|
|
<B>auto</B>.
|
|
<DT id="2145"><B>-mtls-dialect=</B><I>dialect</I><DD>
|
|
|
|
|
|
Specify the dialect to use for accessing thread local storage. Two
|
|
<I>dialect</I>s are supported---<B>gnu</B> and <B>gnu2</B>. The
|
|
<B>gnu</B> dialect selects the original <FONT SIZE="-1">GNU</FONT> scheme for supporting
|
|
local and global dynamic <FONT SIZE="-1">TLS</FONT> models. The <B>gnu2</B> dialect
|
|
selects the <FONT SIZE="-1">GNU</FONT> descriptor scheme, which provides better performance
|
|
for shared libraries. The <FONT SIZE="-1">GNU</FONT> descriptor scheme is compatible with
|
|
the original scheme, but does require new assembler, linker and
|
|
library support. Initial and local exec <FONT SIZE="-1">TLS</FONT> models are unaffected by
|
|
this option and always use the original scheme.
|
|
<DT id="2146"><B>-mword-relocations</B><DD>
|
|
|
|
|
|
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 <B>-fpic</B> or <B>-fPIC</B>
|
|
is specified. This option conflicts with <B>-mslow-flash-data</B>.
|
|
<DT id="2147"><B>-mfix-cortex-m3-ldrd</B><DD>
|
|
|
|
|
|
Some Cortex-M3 cores can cause data corruption when <TT>"ldrd"</TT> instructions
|
|
with overlapping destination and base registers are used. This option avoids
|
|
generating these instructions. This option is enabled by default when
|
|
<B>-mcpu=cortex-m3</B> is specified.
|
|
<DT id="2148"><B>-munaligned-access</B><DD>
|
|
|
|
|
|
|
|
<DT id="2149"><B>-mno-unaligned-access</B><DD>
|
|
|
|
|
|
|
|
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
|
|
ARMv8-M Baseline architectures, and enabled for all other
|
|
architectures. If unaligned access is not enabled then words in packed
|
|
data structures are accessed a byte at a time.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <FONT SIZE="-1">ARM</FONT> attribute <TT>"Tag_CPU_unaligned_access"</TT> is set in the
|
|
generated object file to either true or false, depending upon the
|
|
setting of this option. If unaligned access is enabled then the
|
|
preprocessor symbol <TT>"__ARM_FEATURE_UNALIGNED"</TT> is also
|
|
defined.
|
|
<DT id="2150"><B>-mneon-for-64bits</B><DD>
|
|
|
|
|
|
Enables using Neon to handle scalar 64-bits operations. This is
|
|
disabled by default since the cost of moving data from core registers
|
|
to Neon is high.
|
|
<DT id="2151"><B>-mslow-flash-data</B><DD>
|
|
|
|
|
|
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 <B>-mword-relocations</B>.
|
|
<DT id="2152"><B>-masm-syntax-unified</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">GCC.</FONT>
|
|
Divided syntax should be considered deprecated.
|
|
<DT id="2153"><B>-mrestrict-it</B><DD>
|
|
|
|
|
|
Restricts generation of <FONT SIZE="-1">IT</FONT> blocks to conform to the rules of ARMv8-A.
|
|
<FONT SIZE="-1">IT</FONT> 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.
|
|
<DT id="2154"><B>-mprint-tune-info</B><DD>
|
|
|
|
|
|
Print <FONT SIZE="-1">CPU</FONT> 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.
|
|
<DT id="2155"><B>-mverbose-cost-dump</B><DD>
|
|
|
|
|
|
Enable verbose cost model dumping in the debug dump files. This option is
|
|
provided for use in debugging the compiler.
|
|
<DT id="2156"><B>-mpure-code</B><DD>
|
|
|
|
|
|
Do not allow constant data to be placed in code sections.
|
|
Additionally, when compiling for <FONT SIZE="-1">ELF</FONT> object format give all text sections the
|
|
<FONT SIZE="-1">ELF</FONT> processor-specific section attribute <TT>"SHF_ARM_PURECODE"</TT>. This option
|
|
is only available when generating non-pic code for M-profile targets.
|
|
<DT id="2157"><B>-mcmse</B><DD>
|
|
|
|
|
|
Generate secure code as per the ``ARMv8-M Security Extensions: Requirements on
|
|
Development Tools Engineering Specification'', which can be found on
|
|
<<B><A HREF="http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf">http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf</A></B>>.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>AVR</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined for <FONT SIZE="-1">AVR</FONT> implementations:
|
|
<DL COMPACT>
|
|
<DT id="2158"><B>-mmcu=</B><I>mcu</I><DD>
|
|
|
|
|
|
Specify Atmel <FONT SIZE="-1">AVR</FONT> instruction set architectures (<FONT SIZE="-1">ISA</FONT>) or <FONT SIZE="-1">MCU</FONT> type.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default for this option is@tie{}<B>avr2</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> supports the following <FONT SIZE="-1">AVR</FONT> devices and ISAs:
|
|
<DL COMPACT><DT id="2159"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2160">"avr2"<DD>
|
|
|
|
|
|
|
|
|
|
``Classic'' devices with up to 8@tie{}KiB of program memory.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"attiny22"</TT>, <TT>"attiny26"</TT>, <TT>"at90s2313"</TT>, <TT>"at90s2323"</TT>, <TT>"at90s2333"</TT>, <TT>"at90s2343"</TT>, <TT>"at90s4414"</TT>, <TT>"at90s4433"</TT>, <TT>"at90s4434"</TT>, <TT>"at90c8534"</TT>, <TT>"at90s8515"</TT>, <TT>"at90s8535"</TT>.
|
|
<DT id="2161">"avr25"<DD>
|
|
|
|
|
|
|
|
|
|
``Classic'' devices with up to 8@tie{}KiB of program memory and with the <TT>"MOVW"</TT> instruction.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"attiny13"</TT>, <TT>"attiny13a"</TT>, <TT>"attiny24"</TT>, <TT>"attiny24a"</TT>, <TT>"attiny25"</TT>, <TT>"attiny261"</TT>, <TT>"attiny261a"</TT>, <TT>"attiny2313"</TT>, <TT>"attiny2313a"</TT>, <TT>"attiny43u"</TT>, <TT>"attiny44"</TT>, <TT>"attiny44a"</TT>, <TT>"attiny45"</TT>, <TT>"attiny48"</TT>, <TT>"attiny441"</TT>, <TT>"attiny461"</TT>, <TT>"attiny461a"</TT>, <TT>"attiny4313"</TT>, <TT>"attiny84"</TT>, <TT>"attiny84a"</TT>, <TT>"attiny85"</TT>, <TT>"attiny87"</TT>, <TT>"attiny88"</TT>, <TT>"attiny828"</TT>, <TT>"attiny841"</TT>, <TT>"attiny861"</TT>, <TT>"attiny861a"</TT>, <TT>"ata5272"</TT>, <TT>"ata6616c"</TT>, <TT>"at86rf401"</TT>.
|
|
<DT id="2162">"avr3"<DD>
|
|
|
|
|
|
|
|
|
|
``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"at76c711"</TT>, <TT>"at43usb355"</TT>.
|
|
<DT id="2163">"avr31"<DD>
|
|
|
|
|
|
|
|
|
|
``Classic'' devices with 128@tie{}KiB of program memory.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"atmega103"</TT>, <TT>"at43usb320"</TT>.
|
|
<DT id="2164">"avr35"<DD>
|
|
|
|
|
|
|
|
|
|
``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory and with the <TT>"MOVW"</TT> instruction.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"attiny167"</TT>, <TT>"attiny1634"</TT>, <TT>"atmega8u2"</TT>, <TT>"atmega16u2"</TT>, <TT>"atmega32u2"</TT>, <TT>"ata5505"</TT>, <TT>"ata6617c"</TT>, <TT>"ata664251"</TT>, <TT>"at90usb82"</TT>, <TT>"at90usb162"</TT>.
|
|
<DT id="2165">"avr4"<DD>
|
|
|
|
|
|
|
|
|
|
``Enhanced'' devices with up to 8@tie{}KiB of program memory.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"atmega48"</TT>, <TT>"atmega48a"</TT>, <TT>"atmega48p"</TT>, <TT>"atmega48pa"</TT>, <TT>"atmega48pb"</TT>, <TT>"atmega8"</TT>, <TT>"atmega8a"</TT>, <TT>"atmega8hva"</TT>, <TT>"atmega88"</TT>, <TT>"atmega88a"</TT>, <TT>"atmega88p"</TT>, <TT>"atmega88pa"</TT>, <TT>"atmega88pb"</TT>, <TT>"atmega8515"</TT>, <TT>"atmega8535"</TT>, <TT>"ata6285"</TT>, <TT>"ata6286"</TT>, <TT>"ata6289"</TT>, <TT>"ata6612c"</TT>, <TT>"at90pwm1"</TT>, <TT>"at90pwm2"</TT>, <TT>"at90pwm2b"</TT>, <TT>"at90pwm3"</TT>, <TT>"at90pwm3b"</TT>, <TT>"at90pwm81"</TT>.
|
|
<DT id="2166">"avr5"<DD>
|
|
|
|
|
|
|
|
|
|
``Enhanced'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"atmega16"</TT>, <TT>"atmega16a"</TT>, <TT>"atmega16hva"</TT>, <TT>"atmega16hva2"</TT>, <TT>"atmega16hvb"</TT>, <TT>"atmega16hvbrevb"</TT>, <TT>"atmega16m1"</TT>, <TT>"atmega16u4"</TT>, <TT>"atmega161"</TT>, <TT>"atmega162"</TT>, <TT>"atmega163"</TT>, <TT>"atmega164a"</TT>, <TT>"atmega164p"</TT>, <TT>"atmega164pa"</TT>, <TT>"atmega165"</TT>, <TT>"atmega165a"</TT>, <TT>"atmega165p"</TT>, <TT>"atmega165pa"</TT>, <TT>"atmega168"</TT>, <TT>"atmega168a"</TT>, <TT>"atmega168p"</TT>, <TT>"atmega168pa"</TT>, <TT>"atmega168pb"</TT>, <TT>"atmega169"</TT>, <TT>"atmega169a"</TT>, <TT>"atmega169p"</TT>, <TT>"atmega169pa"</TT>, <TT>"atmega32"</TT>, <TT>"atmega32a"</TT>, <TT>"atmega32c1"</TT>, <TT>"atmega32hvb"</TT>, <TT>"atmega32hvbrevb"</TT>, <TT>"atmega32m1"</TT>, <TT>"atmega32u4"</TT>, <TT>"atmega32u6"</TT>, <TT>"atmega323"</TT>, <TT>"atmega324a"</TT>, <TT>"atmega324p"</TT>, <TT>"atmega324pa"</TT>, <TT>"atmega325"</TT>, <TT>"atmega325a"</TT>, <TT>"atmega325p"</TT>, <TT>"atmega325pa"</TT>, <TT>"atmega328"</TT>, <TT>"atmega328p"</TT>, <TT>"atmega328pb"</TT>, <TT>"atmega329"</TT>, <TT>"atmega329a"</TT>, <TT>"atmega329p"</TT>, <TT>"atmega329pa"</TT>, <TT>"atmega3250"</TT>, <TT>"atmega3250a"</TT>, <TT>"atmega3250p"</TT>, <TT>"atmega3250pa"</TT>, <TT>"atmega3290"</TT>, <TT>"atmega3290a"</TT>, <TT>"atmega3290p"</TT>, <TT>"atmega3290pa"</TT>, <TT>"atmega406"</TT>, <TT>"atmega64"</TT>, <TT>"atmega64a"</TT>, <TT>"atmega64c1"</TT>, <TT>"atmega64hve"</TT>, <TT>"atmega64hve2"</TT>, <TT>"atmega64m1"</TT>, <TT>"atmega64rfr2"</TT>, <TT>"atmega640"</TT>, <TT>"atmega644"</TT>, <TT>"atmega644a"</TT>, <TT>"atmega644p"</TT>, <TT>"atmega644pa"</TT>, <TT>"atmega644rfr2"</TT>, <TT>"atmega645"</TT>, <TT>"atmega645a"</TT>, <TT>"atmega645p"</TT>, <TT>"atmega649"</TT>, <TT>"atmega649a"</TT>, <TT>"atmega649p"</TT>, <TT>"atmega6450"</TT>, <TT>"atmega6450a"</TT>, <TT>"atmega6450p"</TT>, <TT>"atmega6490"</TT>, <TT>"atmega6490a"</TT>, <TT>"atmega6490p"</TT>, <TT>"ata5795"</TT>, <TT>"ata5790"</TT>, <TT>"ata5790n"</TT>, <TT>"ata5791"</TT>, <TT>"ata6613c"</TT>, <TT>"ata6614q"</TT>, <TT>"ata5782"</TT>, <TT>"ata5831"</TT>, <TT>"ata8210"</TT>, <TT>"ata8510"</TT>, <TT>"ata5702m322"</TT>, <TT>"at90pwm161"</TT>, <TT>"at90pwm216"</TT>, <TT>"at90pwm316"</TT>, <TT>"at90can32"</TT>, <TT>"at90can64"</TT>, <TT>"at90scr100"</TT>, <TT>"at90usb646"</TT>, <TT>"at90usb647"</TT>, <TT>"at94k"</TT>, <TT>"m3000"</TT>.
|
|
<DT id="2167">"avr51"<DD>
|
|
|
|
|
|
|
|
|
|
``Enhanced'' devices with 128@tie{}KiB of program memory.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"atmega128"</TT>, <TT>"atmega128a"</TT>, <TT>"atmega128rfa1"</TT>, <TT>"atmega128rfr2"</TT>, <TT>"atmega1280"</TT>, <TT>"atmega1281"</TT>, <TT>"atmega1284"</TT>, <TT>"atmega1284p"</TT>, <TT>"atmega1284rfr2"</TT>, <TT>"at90can128"</TT>, <TT>"at90usb1286"</TT>, <TT>"at90usb1287"</TT>.
|
|
<DT id="2168">"avr6"<DD>
|
|
|
|
|
|
|
|
|
|
``Enhanced'' devices with 3-byte <FONT SIZE="-1">PC,</FONT> i.e. with more than 128@tie{}KiB of program memory.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"atmega256rfr2"</TT>, <TT>"atmega2560"</TT>, <TT>"atmega2561"</TT>, <TT>"atmega2564rfr2"</TT>.
|
|
<DT id="2169">"avrxmega2"<DD>
|
|
|
|
|
|
|
|
|
|
``<FONT SIZE="-1">XMEGA''</FONT> devices with more than 8@tie{}KiB and up to 64@tie{}KiB of program memory.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"atxmega8e5"</TT>, <TT>"atxmega16a4"</TT>, <TT>"atxmega16a4u"</TT>, <TT>"atxmega16c4"</TT>, <TT>"atxmega16d4"</TT>, <TT>"atxmega16e5"</TT>, <TT>"atxmega32a4"</TT>, <TT>"atxmega32a4u"</TT>, <TT>"atxmega32c3"</TT>, <TT>"atxmega32c4"</TT>, <TT>"atxmega32d3"</TT>, <TT>"atxmega32d4"</TT>, <TT>"atxmega32e5"</TT>.
|
|
<DT id="2170">"avrxmega3"<DD>
|
|
|
|
|
|
|
|
|
|
``<FONT SIZE="-1">XMEGA''</FONT> devices with up to 64@tie{}KiB of combined program memory and <FONT SIZE="-1">RAM,</FONT> and with program memory visible in the <FONT SIZE="-1">RAM</FONT> address space.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"attiny202"</TT>, <TT>"attiny204"</TT>, <TT>"attiny212"</TT>, <TT>"attiny214"</TT>, <TT>"attiny402"</TT>, <TT>"attiny404"</TT>, <TT>"attiny406"</TT>, <TT>"attiny412"</TT>, <TT>"attiny414"</TT>, <TT>"attiny416"</TT>, <TT>"attiny417"</TT>, <TT>"attiny804"</TT>, <TT>"attiny806"</TT>, <TT>"attiny807"</TT>, <TT>"attiny814"</TT>, <TT>"attiny816"</TT>, <TT>"attiny817"</TT>, <TT>"attiny1604"</TT>, <TT>"attiny1606"</TT>, <TT>"attiny1607"</TT>, <TT>"attiny1614"</TT>, <TT>"attiny1616"</TT>, <TT>"attiny1617"</TT>, <TT>"attiny3214"</TT>, <TT>"attiny3216"</TT>, <TT>"attiny3217"</TT>, <TT>"atmega808"</TT>, <TT>"atmega809"</TT>, <TT>"atmega1608"</TT>, <TT>"atmega1609"</TT>, <TT>"atmega3208"</TT>, <TT>"atmega3209"</TT>, <TT>"atmega4808"</TT>, <TT>"atmega4809"</TT>.
|
|
<DT id="2171">"avrxmega4"<DD>
|
|
|
|
|
|
|
|
|
|
``<FONT SIZE="-1">XMEGA''</FONT> devices with more than 64@tie{}KiB and up to 128@tie{}KiB of program memory.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"atxmega64a3"</TT>, <TT>"atxmega64a3u"</TT>, <TT>"atxmega64a4u"</TT>, <TT>"atxmega64b1"</TT>, <TT>"atxmega64b3"</TT>, <TT>"atxmega64c3"</TT>, <TT>"atxmega64d3"</TT>, <TT>"atxmega64d4"</TT>.
|
|
<DT id="2172">"avrxmega5"<DD>
|
|
|
|
|
|
|
|
|
|
``<FONT SIZE="-1">XMEGA''</FONT> devices with more than 64@tie{}KiB and up to 128@tie{}KiB of program memory and more than 64@tie{}KiB of <FONT SIZE="-1">RAM.</FONT>
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"atxmega64a1"</TT>, <TT>"atxmega64a1u"</TT>.
|
|
<DT id="2173">"avrxmega6"<DD>
|
|
|
|
|
|
|
|
|
|
``<FONT SIZE="-1">XMEGA''</FONT> devices with more than 128@tie{}KiB of program memory.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"atxmega128a3"</TT>, <TT>"atxmega128a3u"</TT>, <TT>"atxmega128b1"</TT>, <TT>"atxmega128b3"</TT>, <TT>"atxmega128c3"</TT>, <TT>"atxmega128d3"</TT>, <TT>"atxmega128d4"</TT>, <TT>"atxmega192a3"</TT>, <TT>"atxmega192a3u"</TT>, <TT>"atxmega192c3"</TT>, <TT>"atxmega192d3"</TT>, <TT>"atxmega256a3"</TT>, <TT>"atxmega256a3b"</TT>, <TT>"atxmega256a3bu"</TT>, <TT>"atxmega256a3u"</TT>, <TT>"atxmega256c3"</TT>, <TT>"atxmega256d3"</TT>, <TT>"atxmega384c3"</TT>, <TT>"atxmega384d3"</TT>.
|
|
<DT id="2174">"avrxmega7"<DD>
|
|
|
|
|
|
|
|
|
|
``<FONT SIZE="-1">XMEGA''</FONT> devices with more than 128@tie{}KiB of program memory and more than 64@tie{}KiB of <FONT SIZE="-1">RAM.</FONT>
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"atxmega128a1"</TT>, <TT>"atxmega128a1u"</TT>, <TT>"atxmega128a4u"</TT>.
|
|
<DT id="2175">"avrtiny"<DD>
|
|
|
|
|
|
|
|
|
|
``<FONT SIZE="-1">TINY''</FONT> Tiny core devices with 512@tie{}B up to 4@tie{}KiB of program memory.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"attiny4"</TT>, <TT>"attiny5"</TT>, <TT>"attiny9"</TT>, <TT>"attiny10"</TT>, <TT>"attiny20"</TT>, <TT>"attiny40"</TT>.
|
|
<DT id="2176">"avr1"<DD>
|
|
|
|
|
|
|
|
|
|
This <FONT SIZE="-1">ISA</FONT> is implemented by the minimal <FONT SIZE="-1">AVR</FONT> core and supported for assembler only.
|
|
<I>mcu</I><TT>@tie</TT>{}= <TT>"attiny11"</TT>, <TT>"attiny12"</TT>, <TT>"attiny15"</TT>, <TT>"attiny28"</TT>, <TT>"at90s1200"</TT>.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2177"><DD>
|
|
</DL>
|
|
|
|
<DT id="2178"><B>-mabsdata</B><DD>
|
|
|
|
|
|
Assume that all data in static storage can be accessed by <FONT SIZE="-1">LDS / STS</FONT>
|
|
instructions. This option has only an effect on reduced Tiny devices like
|
|
ATtiny40. See also the <TT>"absdata"</TT>
|
|
<B></B><FONT SIZE="-1"><B>AVR</B></FONT><B> Variable Attributes,variable attribute</B>.
|
|
<DT id="2179"><B>-maccumulate-args</B><DD>
|
|
|
|
|
|
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
|
|
before calling a function and popped afterwards.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Popping the arguments after the function call can be expensive on
|
|
<FONT SIZE="-1">AVR</FONT> so that accumulating the stack space might lead to smaller
|
|
executables because arguments need not be removed from the
|
|
stack after such a function call.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option can lead to reduced code size for functions that perform
|
|
several calls to functions that get their arguments on the stack like
|
|
calls to printf-like functions.
|
|
<DT id="2180"><B>-mbranch-cost=</B><I>cost</I><DD>
|
|
|
|
|
|
Set the branch costs for conditional branch instructions to
|
|
<I>cost</I>. Reasonable values for <I>cost</I> are small, non-negative
|
|
integers. The default branch cost is 0.
|
|
<DT id="2181"><B>-mcall-prologues</B><DD>
|
|
|
|
|
|
Functions prologues/epilogues are expanded as calls to appropriate
|
|
subroutines. Code size is smaller.
|
|
<DT id="2182"><B>-mgas-isr-prologues</B><DD>
|
|
|
|
|
|
Interrupt service routines (ISRs) may use the <TT>"__gcc_isr"</TT> pseudo
|
|
instruction supported by <FONT SIZE="-1">GNU</FONT> Binutils.
|
|
If this option is on, the feature can still be disabled for individual
|
|
ISRs by means of the <B></B><FONT SIZE="-1"><B>AVR</B></FONT><B> Function Attributes,,</B>"no_gccisr"<B></B>
|
|
function attribute. This feature is activated per default
|
|
if optimization is on (but not with <B>-Og</B>, <TT>@pxref</TT>{Optimize Options}),
|
|
and if <FONT SIZE="-1">GNU</FONT> Binutils support <FONT SIZE="-1">PR21683</FONT> (<TT>"<A HREF="https://sourceware.org/PR21683">https://sourceware.org/PR21683</A>"</TT>).
|
|
<DT id="2183"><B>-mint8</B><DD>
|
|
|
|
|
|
Assume <TT>"int"</TT> to be 8-bit integer. This affects the sizes of all types: a
|
|
<TT>"char"</TT> is 1 byte, an <TT>"int"</TT> is 1 byte, a <TT>"long"</TT> is 2 bytes,
|
|
and <TT>"long long"</TT> is 4 bytes. Please note that this option does not
|
|
conform to the C standards, but it results in smaller code
|
|
size.
|
|
<DT id="2184"><B>-mmain-is-OS_task</B><DD>
|
|
|
|
|
|
Do not save registers in <TT>"main"</TT>. The effect is the same like
|
|
attaching attribute <B></B><FONT SIZE="-1"><B>AVR</B></FONT><B> Function Attributes,,</B>"OS_task"<B></B>
|
|
to <TT>"main"</TT>. It is activated per default if optimization is on.
|
|
<DT id="2185"><B>-mn-flash=</B><I>num</I><DD>
|
|
|
|
|
|
Assume that the flash memory has a size of
|
|
<I>num</I> times 64@tie{}KiB.
|
|
<DT id="2186"><B>-mno-interrupts</B><DD>
|
|
|
|
|
|
Generated code is not compatible with hardware interrupts.
|
|
Code size is smaller.
|
|
<DT id="2187"><B>-mrelax</B><DD>
|
|
|
|
|
|
Try to replace <TT>"CALL"</TT> resp. <TT>"JMP"</TT> instruction by the shorter
|
|
<TT>"RCALL"</TT> resp. <TT>"RJMP"</TT> instruction if applicable.
|
|
Setting <B>-mrelax</B> just adds the <B>--mlink-relax</B> option to
|
|
the assembler's command line and the <B>--relax</B> option to the
|
|
linker's command line.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Jump relaxing is performed by the linker because jump offsets are not
|
|
known before code is located. Therefore, the assembler code generated by the
|
|
compiler is the same, but the instructions in the executable may
|
|
differ from instructions in the assembler code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Relaxing must be turned on if linker stubs are needed, see the
|
|
section on <TT>"EIND"</TT> and linker stubs below.
|
|
<DT id="2188"><B>-mrmw</B><DD>
|
|
|
|
|
|
Assume that the device supports the Read-Modify-Write
|
|
instructions <TT>"XCH"</TT>, <TT>"LAC"</TT>, <TT>"LAS"</TT> and <TT>"LAT"</TT>.
|
|
<DT id="2189"><B>-mshort-calls</B><DD>
|
|
|
|
|
|
Assume that <TT>"RJMP"</TT> and <TT>"RCALL"</TT> can target the whole
|
|
program memory.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is used internally for multilib selection. It is
|
|
not an optimization option, and you don't need to set it by hand.
|
|
<DT id="2190"><B>-msp8</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is used internally by the compiler to select and
|
|
build multilibs for architectures <TT>"avr2"</TT> and <TT>"avr25"</TT>.
|
|
These architectures mix devices with and without <TT>"SPH"</TT>.
|
|
For any setting other than <B>-mmcu=avr2</B> or <B>-mmcu=avr25</B>
|
|
the compiler driver adds or removes this option from the compiler
|
|
proper's command line, because the compiler then knows if the device
|
|
or architecture has an 8-bit stack pointer and thus no <TT>"SPH"</TT>
|
|
register or not.
|
|
<DT id="2191"><B>-mstrict-X</B><DD>
|
|
|
|
|
|
Use address register <TT>"X"</TT> in a way proposed by the hardware. This means
|
|
that <TT>"X"</TT> is only used in indirect, post-increment or
|
|
pre-decrement addressing.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Without this option, the <TT>"X"</TT> register may be used in the same way
|
|
as <TT>"Y"</TT> or <TT>"Z"</TT> which then is emulated by additional
|
|
instructions.
|
|
For example, loading a value with <TT>"X+const"</TT> addressing with a
|
|
small non-negative <TT>"const < 64"</TT> to a register <I>Rn</I> is
|
|
performed as
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
adiw r26, const ; X += const
|
|
ld <Rn>, X ; <Rn> = *X
|
|
sbiw r26, const ; X -= const
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="2192"><B>-mtiny-stack</B><DD>
|
|
|
|
|
|
Only change the lower 8@tie{}bits of the stack pointer.
|
|
<DT id="2193"><B>-mfract-convert-truncate</B><DD>
|
|
|
|
|
|
Allow to use truncation instead of rounding towards zero for fractional fixed-point types.
|
|
<DT id="2194"><B>-nodevicelib</B><DD>
|
|
|
|
|
|
Don't link against AVR-LibC's device specific library <TT>"lib<mcu>.a"</TT>.
|
|
<DT id="2195"><B>-nodevicespecs</B><DD>
|
|
|
|
|
|
Don't add <B>-specs=device-specs/specs-<mcu></B> 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
|
|
options.
|
|
<DT id="2196"><B>-Waddr-space-convert</B><DD>
|
|
|
|
|
|
Warn about conversions between address spaces in the case where the
|
|
resulting address space is not contained in the incoming address space.
|
|
<DT id="2197"><B>-Wmisspelled-isr</B><DD>
|
|
|
|
|
|
Warn if the <FONT SIZE="-1">ISR</FONT> is misspelled, i.e. without __vector prefix.
|
|
Enabled by default.
|
|
</DL>
|
|
<P>
|
|
|
|
<TT>"EIND"</TT> and Devices with More Than 128 Ki Bytes of Flash
|
|
|
|
|
|
<P>
|
|
|
|
Pointers in the implementation are 16@tie{}bits wide.
|
|
The address of a function or label is represented as word address so
|
|
that indirect jumps and calls can target any code address in the
|
|
range of 64@tie{}Ki words.
|
|
<P>
|
|
|
|
In order to facilitate indirect jump on devices with more than 128@tie{}Ki
|
|
bytes of program memory space, there is a special function register called
|
|
<TT>"EIND"</TT> that serves as most significant part of the target address
|
|
when <TT>"EICALL"</TT> or <TT>"EIJMP"</TT> instructions are used.
|
|
<P>
|
|
|
|
Indirect jumps and calls on these devices are handled as follows by
|
|
the compiler and are subject to some limitations:
|
|
<DL COMPACT>
|
|
<DT id="2198">*<DD>
|
|
The compiler never sets <TT>"EIND"</TT>.
|
|
<DT id="2199">*<DD>
|
|
The compiler uses <TT>"EIND"</TT> implicitly in <TT>"EICALL"</TT>/<TT>"EIJMP"</TT>
|
|
instructions or might read <TT>"EIND"</TT> directly in order to emulate an
|
|
indirect call/jump by means of a <TT>"RET"</TT> instruction.
|
|
<DT id="2200">*<DD>
|
|
The compiler assumes that <TT>"EIND"</TT> never changes during the startup
|
|
code or during the application. In particular, <TT>"EIND"</TT> is not
|
|
saved/restored in function or interrupt service routine
|
|
prologue/epilogue.
|
|
<DT id="2201">*<DD>
|
|
For indirect calls to functions and computed goto, the linker
|
|
generates <I>stubs</I>. Stubs are jump pads sometimes also called
|
|
<I>trampolines</I>. Thus, the indirect call/jump jumps to such a stub.
|
|
The stub contains a direct jump to the desired address.
|
|
<DT id="2202">*<DD>
|
|
Linker relaxation must be turned on so that the linker generates
|
|
the stubs correctly in all situations. See the compiler option
|
|
<B>-mrelax</B> and the linker option <B>--relax</B>.
|
|
There are corner cases where the linker is supposed to generate stubs
|
|
but aborts without relaxation and without a helpful error message.
|
|
<DT id="2203">*<DD>
|
|
The default linker script is arranged for code with <TT>"EIND = 0"</TT>.
|
|
If code is supposed to work for a setup with <TT>"EIND != 0"</TT>, a custom
|
|
linker script has to be used in order to place the sections whose
|
|
name start with <TT>".trampolines"</TT> into the segment where <TT>"EIND"</TT>
|
|
points to.
|
|
<DT id="2204">*<DD>
|
|
The startup code from libgcc never sets <TT>"EIND"</TT>.
|
|
Notice that startup code is a blend of code from libgcc and AVR-LibC.
|
|
For the impact of AVR-LibC on <TT>"EIND"</TT>, see the
|
|
AVR-LibC user manual (<TT>"<A HREF="http://nongnu.org/avr-libc/user-manual/">http://nongnu.org/avr-libc/user-manual/</A>"</TT>).
|
|
<DT id="2205">*<DD>
|
|
It is legitimate for user-specific startup code to set up <TT>"EIND"</TT>
|
|
early, for example by means of initialization code located in
|
|
section <TT>".init3"</TT>. Such code runs prior to general startup code
|
|
that initializes <FONT SIZE="-1">RAM</FONT> and calls constructors, but after the bit
|
|
of startup code from AVR-LibC that sets <TT>"EIND"</TT> to the segment
|
|
where the vector table is located.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
#include <<A HREF="file:///usr/include/avr/io.h">avr/io.h</A>>
|
|
|
|
static void
|
|
__attribute__((section(".init3"),naked,used,no_instrument_function))
|
|
init3_set_eind (void)
|
|
{
|
|
__asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
|
|
"out %i0,r24" :: "n" (&EIND) : "r24","memory");
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <TT>"__trampolines_start"</TT> symbol is defined in the linker script.
|
|
<DT id="2206">*<DD>
|
|
Stubs are generated automatically by the linker if
|
|
the following two conditions are met:
|
|
<DL COMPACT><DT id="2207"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2208">-<The address of a label is taken by means of the "gs" modifier><DD>
|
|
|
|
|
|
|
|
|
|
(short for <I>generate stubs</I>) like so:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
LDI r24, lo8(gs(<func>))
|
|
LDI r25, hi8(gs(<func>))
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="2209">-<The final location of that label is in a code segment><DD>
|
|
|
|
|
|
<I>outside</I> the segment where the stubs are located.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2210"><DD>
|
|
</DL>
|
|
|
|
<DT id="2211">*<DD>
|
|
The compiler emits such <TT>"gs"</TT> modifiers for code labels in the
|
|
following situations:
|
|
<DL COMPACT><DT id="2212"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2213">-<Taking address of a function or code label.><DD>
|
|
|
|
|
|
|
|
<DT id="2214">-<Computed goto.><DD>
|
|
|
|
|
|
<DT id="2215">-<If prologue-save function is used, see <B>-mcall-prologues</B>><DD>
|
|
|
|
|
|
|
|
command-line option.
|
|
<DT id="2216">-<Switch/case dispatch tables. If you do not want such dispatch><DD>
|
|
|
|
|
|
tables you can specify the <B>-fno-jump-tables</B> command-line option.
|
|
<DT id="2217">-<C and C<FONT SIZE="-2">++</FONT> constructors/destructors called during startup/shutdown.><DD>
|
|
|
|
|
|
|
|
<DT id="2218">-<If the tools hit a "gs()" modifier explained above.><DD>
|
|
|
|
|
|
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2219"><DD>
|
|
</DL>
|
|
|
|
<DT id="2220">*<DD>
|
|
|
|
Jumping to non-symbolic addresses like so is <I>not</I> supported:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int main (void)
|
|
{
|
|
/* Call function at word address 0x2 */
|
|
return ((int(*)(void)) 0x2)();
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Instead, a stub has to be set up, i.e. the function has to be called
|
|
through a symbol (<TT>"func_4"</TT> in the example):
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
int main (void)
|
|
{
|
|
extern int func_4 (void);
|
|
|
|
/* Call function at byte address 0x4 */
|
|
return func_4();
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
and the application be linked with <B>-Wl,--defsym,func_4=0x4</B>.
|
|
Alternatively, <TT>"func_4"</TT> can be defined in the linker script.
|
|
</DL>
|
|
<P>
|
|
|
|
Handling of the <TT>"RAMPD"</TT>, <TT>"RAMPX"</TT>, <TT>"RAMPY"</TT> and <TT>"RAMPZ"</TT> Special Function Registers
|
|
|
|
|
|
<P>
|
|
|
|
Some <FONT SIZE="-1">AVR</FONT> devices support memories larger than the 64@tie{}KiB range
|
|
that can be accessed with 16-bit pointers. To access memory locations
|
|
outside this 64@tie{}KiB range, the content of a <TT>"RAMP"</TT>
|
|
register is used as high part of the address:
|
|
The <TT>"X"</TT>, <TT>"Y"</TT>, <TT>"Z"</TT> address register is concatenated
|
|
with the <TT>"RAMPX"</TT>, <TT>"RAMPY"</TT>, <TT>"RAMPZ"</TT> special function
|
|
register, respectively, to get a wide address. Similarly,
|
|
<TT>"RAMPD"</TT> is used together with direct addressing.
|
|
<DL COMPACT>
|
|
<DT id="2221">*<DD>
|
|
The startup code initializes the <TT>"RAMP"</TT> special function
|
|
registers with zero.
|
|
<DT id="2222">*<DD>
|
|
If a <B></B><FONT SIZE="-1"><B>AVR</B></FONT><B> Named Address Spaces,named address space</B> other than
|
|
generic or <TT>"__flash"</TT> is used, then <TT>"RAMPZ"</TT> is set
|
|
as needed before the operation.
|
|
<DT id="2223">*<DD>
|
|
If the device supports <FONT SIZE="-1">RAM</FONT> larger than 64@tie{}KiB and the compiler
|
|
needs to change <TT>"RAMPZ"</TT> to accomplish an operation, <TT>"RAMPZ"</TT>
|
|
is reset to zero after the operation.
|
|
<DT id="2224">*<DD>
|
|
If the device comes with a specific <TT>"RAMP"</TT> register, the <FONT SIZE="-1">ISR</FONT>
|
|
prologue/epilogue saves/restores that <FONT SIZE="-1">SFR</FONT> and initializes it with
|
|
zero in case the <FONT SIZE="-1">ISR</FONT> code might (implicitly) use it.
|
|
<DT id="2225">*<DD>
|
|
<FONT SIZE="-1">RAM</FONT> larger than 64@tie{}KiB is not supported by <FONT SIZE="-1">GCC</FONT> for <FONT SIZE="-1">AVR</FONT> targets.
|
|
If you use inline assembler to read from locations outside the
|
|
16-bit address range and change one of the <TT>"RAMP"</TT> registers,
|
|
you must reset it to zero after the access.
|
|
</DL>
|
|
<P>
|
|
|
|
<FONT SIZE="-1">AVR</FONT> Built-in Macros
|
|
|
|
|
|
<P>
|
|
|
|
<FONT SIZE="-1">GCC</FONT> defines several built-in macros so that the user code can test
|
|
for the presence or absence of features. Almost any of the following
|
|
built-in macros are deduced from device capabilities and thus
|
|
triggered by the <B>-mmcu=</B> command-line option.
|
|
<P>
|
|
|
|
For even more AVR-specific built-in macros see
|
|
<B></B><FONT SIZE="-1"><B>AVR</B></FONT><B> Named Address Spaces</B> and <B></B><FONT SIZE="-1"><B>AVR</B></FONT><B> Built-in Functions</B>.
|
|
<DL COMPACT>
|
|
<DT id="2226">"__AVR_ARCH__"<DD>
|
|
|
|
|
|
|
|
|
|
Build-in macro that resolves to a decimal number that identifies the
|
|
architecture and depends on the <B>-mmcu=</B><I>mcu</I> option.
|
|
Possible values are:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<TT>2</TT>, <TT>25</TT>, <TT>3</TT>, <TT>31</TT>, <TT>35</TT>,
|
|
<TT>4</TT>, <TT>5</TT>, <TT>51</TT>, <TT>6</TT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
for <I>mcu</I>=<TT>"avr2"</TT>, <TT>"avr25"</TT>, <TT>"avr3"</TT>, <TT>"avr31"</TT>,
|
|
<TT>"avr35"</TT>, <TT>"avr4"</TT>, <TT>"avr5"</TT>, <TT>"avr51"</TT>, <TT>"avr6"</TT>,
|
|
|
|
|
|
<P>
|
|
|
|
|
|
respectively and
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<TT>100</TT>,
|
|
<TT>102</TT>, <TT>103</TT>, <TT>104</TT>,
|
|
<TT>105</TT>, <TT>106</TT>, <TT>107</TT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
for <I>mcu</I>=<TT>"avrtiny"</TT>,
|
|
<TT>"avrxmega2"</TT>, <TT>"avrxmega3"</TT>, <TT>"avrxmega4"</TT>,
|
|
<TT>"avrxmega5"</TT>, <TT>"avrxmega6"</TT>, <TT>"avrxmega7"</TT>, respectively.
|
|
If <I>mcu</I> specifies a device, this built-in macro is set
|
|
accordingly. For example, with <B>-mmcu=atmega8</B> the macro is
|
|
defined to <TT>4</TT>.
|
|
<DT id="2227">"__AVR_<I>Device</I>__"<DD>
|
|
|
|
|
|
|
|
|
|
Setting <B>-mmcu=</B><I>device</I> defines this built-in macro which reflects
|
|
the device's name. For example, <B>-mmcu=atmega8</B> defines the
|
|
built-in macro <TT>"__AVR_ATmega8__"</TT>, <B>-mmcu=attiny261a</B> defines
|
|
<TT>"__AVR_ATtiny261A__"</TT>, etc.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The built-in macros' names follow
|
|
the scheme <TT>"__AVR_</TT>Device<TT>__"</TT> where <I>Device</I> is
|
|
the device name as from the <FONT SIZE="-1">AVR</FONT> user manual. The difference between
|
|
<I>Device</I> in the built-in macro and <I>device</I> in
|
|
<B>-mmcu=</B><I>device</I> is that the latter is always lowercase.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>device</I> is not a device but only a core architecture like
|
|
<B>avr51</B>, this macro is not defined.
|
|
<DT id="2228">"__AVR_DEVICE_NAME__"<DD>
|
|
|
|
|
|
|
|
|
|
Setting <B>-mmcu=</B><I>device</I> defines this built-in macro to
|
|
the device's name. For example, with <B>-mmcu=atmega8</B> the macro
|
|
is defined to <TT>"atmega8"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <I>device</I> is not a device but only a core architecture like
|
|
<B>avr51</B>, this macro is not defined.
|
|
<DT id="2229">"__AVR_XMEGA__"<DD>
|
|
|
|
|
|
|
|
|
|
The device / architecture belongs to the <FONT SIZE="-1">XMEGA</FONT> family of devices.
|
|
<DT id="2230">"__AVR_HAVE_ELPM__"<DD>
|
|
|
|
|
|
|
|
|
|
The device has the <TT>"ELPM"</TT> instruction.
|
|
<DT id="2231">"__AVR_HAVE_ELPMX__"<DD>
|
|
|
|
|
|
|
|
|
|
The device has the <TT>"ELPM R</TT>n<TT>,Z"</TT> and <TT>"ELPM
|
|
R</TT>n<TT>,Z+"</TT> instructions.
|
|
<DT id="2232">"__AVR_HAVE_MOVW__"<DD>
|
|
|
|
|
|
|
|
|
|
The device has the <TT>"MOVW"</TT> instruction to perform 16-bit
|
|
register-register moves.
|
|
<DT id="2233">"__AVR_HAVE_LPMX__"<DD>
|
|
|
|
|
|
|
|
|
|
The device has the <TT>"LPM R</TT>n<TT>,Z"</TT> and
|
|
<TT>"LPM R</TT>n<TT>,Z+"</TT> instructions.
|
|
<DT id="2234">"__AVR_HAVE_MUL__"<DD>
|
|
|
|
|
|
|
|
|
|
The device has a hardware multiplier.
|
|
<DT id="2235">"__AVR_HAVE_JMP_CALL__"<DD>
|
|
|
|
|
|
|
|
|
|
The device has the <TT>"JMP"</TT> and <TT>"CALL"</TT> instructions.
|
|
This is the case for devices with more than 8@tie{}KiB of program
|
|
memory.
|
|
<DT id="2236">"__AVR_HAVE_EIJMP_EICALL__"<DD>
|
|
|
|
|
|
|
|
|
|
|
|
<DT id="2237">"__AVR_3_BYTE_PC__"<DD>
|
|
|
|
|
|
|
|
|
|
|
|
The device has the <TT>"EIJMP"</TT> and <TT>"EICALL"</TT> instructions.
|
|
This is the case for devices with more than 128@tie{}KiB of program memory.
|
|
This also means that the program counter
|
|
(<FONT SIZE="-1">PC</FONT>) is 3@tie{}bytes wide.
|
|
<DT id="2238">"__AVR_2_BYTE_PC__"<DD>
|
|
|
|
|
|
|
|
|
|
The program counter (<FONT SIZE="-1">PC</FONT>) is 2@tie{}bytes wide. This is the case for devices
|
|
with up to 128@tie{}KiB of program memory.
|
|
<DT id="2239">"__AVR_HAVE_8BIT_SP__"<DD>
|
|
|
|
|
|
|
|
|
|
|
|
<DT id="2240">"__AVR_HAVE_16BIT_SP__"<DD>
|
|
|
|
|
|
|
|
|
|
|
|
The stack pointer (<FONT SIZE="-1">SP</FONT>) register is treated as 8-bit respectively
|
|
16-bit register by the compiler.
|
|
The definition of these macros is affected by <B>-mtiny-stack</B>.
|
|
<DT id="2241">"__AVR_HAVE_SPH__"<DD>
|
|
|
|
|
|
|
|
|
|
|
|
<DT id="2242">"__AVR_SP8__"<DD>
|
|
|
|
|
|
|
|
|
|
|
|
The device has the <FONT SIZE="-1">SPH</FONT> (high part of stack pointer) special function
|
|
register or has an 8-bit stack pointer, respectively.
|
|
The definition of these macros is affected by <B>-mmcu=</B> and
|
|
in the cases of <B>-mmcu=avr2</B> and <B>-mmcu=avr25</B> also
|
|
by <B>-msp8</B>.
|
|
<DT id="2243">"__AVR_HAVE_RAMPD__"<DD>
|
|
|
|
|
|
|
|
|
|
|
|
<DT id="2244">"__AVR_HAVE_RAMPX__"<DD>
|
|
|
|
|
|
|
|
|
|
<DT id="2245">"__AVR_HAVE_RAMPY__"<DD>
|
|
|
|
|
|
|
|
|
|
<DT id="2246">"__AVR_HAVE_RAMPZ__"<DD>
|
|
|
|
|
|
|
|
|
|
|
|
The device has the <TT>"RAMPD"</TT>, <TT>"RAMPX"</TT>, <TT>"RAMPY"</TT>,
|
|
<TT>"RAMPZ"</TT> special function register, respectively.
|
|
<DT id="2247">"__NO_INTERRUPTS__"<DD>
|
|
|
|
|
|
|
|
|
|
This macro reflects the <B>-mno-interrupts</B> command-line option.
|
|
<DT id="2248">"__AVR_ERRATA_SKIP__"<DD>
|
|
|
|
|
|
|
|
|
|
|
|
<DT id="2249">"__AVR_ERRATA_SKIP_JMP_CALL__"<DD>
|
|
|
|
|
|
|
|
|
|
|
|
Some <FONT SIZE="-1">AVR</FONT> devices (<FONT SIZE="-1">AT90S8515,</FONT> ATmega103) must not skip 32-bit
|
|
instructions because of a hardware erratum. Skip instructions are
|
|
<TT>"SBRS"</TT>, <TT>"SBRC"</TT>, <TT>"SBIS"</TT>, <TT>"SBIC"</TT> and <TT>"CPSE"</TT>.
|
|
The second macro is only defined if <TT>"__AVR_HAVE_JMP_CALL__"</TT> is also
|
|
set.
|
|
<DT id="2250">"__AVR_ISA_RMW__"<DD>
|
|
|
|
|
|
|
|
|
|
The device has Read-Modify-Write instructions (<FONT SIZE="-1">XCH, LAC, LAS</FONT> and <FONT SIZE="-1">LAT</FONT>).
|
|
<DT id="2251">"__AVR_SFR_OFFSET__=<I>offset</I>"<DD>
|
|
|
|
|
|
|
|
|
|
Instructions that can address I/O special function registers directly
|
|
like <TT>"IN"</TT>, <TT>"OUT"</TT>, <TT>"SBI"</TT>, etc. may use a different
|
|
address as if addressed by an instruction to access <FONT SIZE="-1">RAM</FONT> like <TT>"LD"</TT>
|
|
or <TT>"STS"</TT>. This offset depends on the device architecture and has
|
|
to be subtracted from the <FONT SIZE="-1">RAM</FONT> address in order to get the
|
|
respective I/O@tie{}address.
|
|
<DT id="2252">"__AVR_SHORT_CALLS__"<DD>
|
|
|
|
|
|
|
|
|
|
The <B>-mshort-calls</B> command line option is set.
|
|
<DT id="2253">"__AVR_PM_BASE_ADDRESS__=<I>addr</I>"<DD>
|
|
|
|
|
|
|
|
|
|
Some devices support reading from flash memory by means of <TT>"LD*"</TT>
|
|
instructions. The flash memory is seen in the data address space
|
|
at an offset of <TT>"__AVR_PM_BASE_ADDRESS__"</TT>. If this macro
|
|
is not defined, this feature is not available. If defined,
|
|
the address space is linear and there is no need to put
|
|
<TT>".rodata"</TT> into <FONT SIZE="-1">RAM.</FONT> This is handled by the default linker
|
|
description file, and is currently available for
|
|
<TT>"avrtiny"</TT> and <TT>"avrxmega3"</TT>. Even more convenient,
|
|
there is no need to use address spaces like <TT>"__flash"</TT> or
|
|
features like attribute <TT>"progmem"</TT> and <TT>"pgm_read_*"</TT>.
|
|
<DT id="2254">"__WITH_AVRLIBC__"<DD>
|
|
|
|
|
|
|
|
|
|
The compiler is configured to be used together with AVR-Libc.
|
|
See the <B>--with-avrlibc</B> configure option.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>Blackfin Options</I>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="2255"><B>-mcpu=</B><I>cpu</I>[<B>-</B><I>sirevision</I>]<DD>
|
|
|
|
|
|
Specifies the name of the target Blackfin processor. Currently, <I>cpu</I>
|
|
can be one of <B>bf512</B>, <B>bf514</B>, <B>bf516</B>, <B>bf518</B>,
|
|
<B>bf522</B>, <B>bf523</B>, <B>bf524</B>, <B>bf525</B>, <B>bf526</B>,
|
|
<B>bf527</B>, <B>bf531</B>, <B>bf532</B>, <B>bf533</B>,
|
|
<B>bf534</B>, <B>bf536</B>, <B>bf537</B>, <B>bf538</B>, <B>bf539</B>,
|
|
<B>bf542</B>, <B>bf544</B>, <B>bf547</B>, <B>bf548</B>, <B>bf549</B>,
|
|
<B>bf542m</B>, <B>bf544m</B>, <B>bf547m</B>, <B>bf548m</B>, <B>bf549m</B>,
|
|
<B>bf561</B>, <B>bf592</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The optional <I>sirevision</I> specifies the silicon revision of the target
|
|
Blackfin processor. Any workarounds available for the targeted silicon revision
|
|
are enabled. If <I>sirevision</I> is <B>none</B>, no workarounds are enabled.
|
|
If <I>sirevision</I> is <B>any</B>, all workarounds for the targeted processor
|
|
are enabled. The <TT>"__SILICON_REVISION__"</TT> macro is defined to two
|
|
hexadecimal digits representing the major and minor numbers in the silicon
|
|
revision. If <I>sirevision</I> is <B>none</B>, the <TT>"__SILICON_REVISION__"</TT>
|
|
is not defined. If <I>sirevision</I> is <B>any</B>, the
|
|
<TT>"__SILICON_REVISION__"</TT> is defined to be <TT>0xffff</TT>.
|
|
If this optional <I>sirevision</I> is not used, <FONT SIZE="-1">GCC</FONT> assumes the latest known
|
|
silicon revision of the targeted Blackfin processor.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> defines a preprocessor macro for the specified <I>cpu</I>.
|
|
For the <B>bfin-elf</B> toolchain, this option causes the hardware <FONT SIZE="-1">BSP</FONT>
|
|
provided by libgloss to be linked in if <B>-msim</B> is not given.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Without this option, <B>bf532</B> is used as the processor by default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that support for <B>bf561</B> is incomplete. For <B>bf561</B>,
|
|
only the preprocessor macro is defined.
|
|
<DT id="2256"><B>-msim</B><DD>
|
|
|
|
|
|
Specifies that the program will be run on the simulator. This causes
|
|
the simulator <FONT SIZE="-1">BSP</FONT> provided by libgloss to be linked in. This option
|
|
has effect only for <B>bfin-elf</B> toolchain.
|
|
Certain other options, such as <B>-mid-shared-library</B> and
|
|
<B>-mfdpic</B>, imply <B>-msim</B>.
|
|
<DT id="2257"><B>-momit-leaf-frame-pointer</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2258"><B>-mspecld-anomaly</B><DD>
|
|
|
|
|
|
When enabled, the compiler ensures that the generated code does not
|
|
contain speculative loads after jump instructions. If this option is used,
|
|
<TT>"__WORKAROUND_SPECULATIVE_LOADS"</TT> is defined.
|
|
<DT id="2259"><B>-mno-specld-anomaly</B><DD>
|
|
|
|
|
|
Don't generate extra code to prevent speculative loads from occurring.
|
|
<DT id="2260"><B>-mcsync-anomaly</B><DD>
|
|
|
|
|
|
When enabled, the compiler ensures that the generated code does not
|
|
contain <FONT SIZE="-1">CSYNC</FONT> or <FONT SIZE="-1">SSYNC</FONT> instructions too soon after conditional branches.
|
|
If this option is used, <TT>"__WORKAROUND_SPECULATIVE_SYNCS"</TT> is defined.
|
|
<DT id="2261"><B>-mno-csync-anomaly</B><DD>
|
|
|
|
|
|
Don't generate extra code to prevent <FONT SIZE="-1">CSYNC</FONT> or <FONT SIZE="-1">SSYNC</FONT> instructions from
|
|
occurring too soon after a conditional branch.
|
|
<DT id="2262"><B>-mlow64k</B><DD>
|
|
|
|
|
|
When enabled, the compiler is free to take advantage of the knowledge that
|
|
the entire program fits into the low 64k of memory.
|
|
<DT id="2263"><B>-mno-low64k</B><DD>
|
|
|
|
|
|
Assume that the program is arbitrarily large. This is the default.
|
|
<DT id="2264"><B>-mstack-check-l1</B><DD>
|
|
|
|
|
|
Do stack checking using information placed into L1 scratchpad memory by the
|
|
uClinux kernel.
|
|
<DT id="2265"><B>-mid-shared-library</B><DD>
|
|
|
|
|
|
Generate code that supports shared libraries via the library <FONT SIZE="-1">ID</FONT> method.
|
|
This allows for execute in place and shared libraries in an environment
|
|
without virtual memory management. This option implies <B>-fPIC</B>.
|
|
With a <B>bfin-elf</B> target, this option implies <B>-msim</B>.
|
|
<DT id="2266"><B>-mno-id-shared-library</B><DD>
|
|
|
|
|
|
Generate code that doesn't assume ID-based shared libraries are being used.
|
|
This is the default.
|
|
<DT id="2267"><B>-mleaf-id-shared-library</B><DD>
|
|
|
|
|
|
Generate code that supports shared libraries via the library <FONT SIZE="-1">ID</FONT> method,
|
|
but assumes that this library or executable won't link against any other
|
|
<FONT SIZE="-1">ID</FONT> shared libraries. That allows the compiler to use faster code for jumps
|
|
and calls.
|
|
<DT id="2268"><B>-mno-leaf-id-shared-library</B><DD>
|
|
|
|
|
|
Do not assume that the code being compiled won't link against any <FONT SIZE="-1">ID</FONT> shared
|
|
libraries. Slower code is generated for jump and call insns.
|
|
<DT id="2269"><B>-mshared-library-id=n</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2270"><B>-msep-data</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2271"><B>-mno-sep-data</B><DD>
|
|
|
|
|
|
Generate code that assumes that the data segment follows the text segment.
|
|
This is the default.
|
|
<DT id="2272"><B>-mlong-calls</B><DD>
|
|
|
|
|
|
|
|
<DT id="2273"><B>-mno-long-calls</B><DD>
|
|
|
|
|
|
|
|
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
|
|
lies outside of the 24-bit addressing range of the offset-based
|
|
version of subroutine call instruction.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This feature is not enabled by default. Specifying
|
|
<B>-mno-long-calls</B> restores the default behavior. Note these
|
|
switches have no effect on how the compiler generates code to handle
|
|
function calls via function pointers.
|
|
<DT id="2274"><B>-mfast-fp</B><DD>
|
|
|
|
|
|
Link with the fast floating-point library. This library relaxes some of
|
|
the <FONT SIZE="-1">IEEE</FONT> floating-point standard's rules for checking inputs against
|
|
Not-a-Number (<FONT SIZE="-1">NAN</FONT>), in the interest of performance.
|
|
<DT id="2275"><B>-minline-plt</B><DD>
|
|
|
|
|
|
Enable inlining of <FONT SIZE="-1">PLT</FONT> entries in function calls to functions that are
|
|
not known to bind locally. It has no effect without <B>-mfdpic</B>.
|
|
<DT id="2276"><B>-mmulticore</B><DD>
|
|
|
|
|
|
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 <TT>"__BFIN_MULTICORE"</TT>.
|
|
It can only be used with <B>-mcpu=bf561</B>[<B>-</B><I>sirevision</I>].
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option can be used with <B>-mcorea</B> or <B>-mcoreb</B>, which
|
|
selects the one-application-per-core programming model. Without
|
|
<B>-mcorea</B> or <B>-mcoreb</B>, the single-application/dual-core
|
|
programming model is used. In this model, the main function of Core B
|
|
should be named as <TT>"coreb_main"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If this option is not used, the single-core application programming
|
|
model is used.
|
|
<DT id="2277"><B>-mcorea</B><DD>
|
|
|
|
|
|
Build a standalone application for Core A of <FONT SIZE="-1">BF561</FONT> when using
|
|
the one-application-per-core programming model. Proper start files
|
|
and link scripts are used to support Core A, and the macro
|
|
<TT>"__BFIN_COREA"</TT> is defined.
|
|
This option can only be used in conjunction with <B>-mmulticore</B>.
|
|
<DT id="2278"><B>-mcoreb</B><DD>
|
|
|
|
|
|
Build a standalone application for Core B of <FONT SIZE="-1">BF561</FONT> when using
|
|
the one-application-per-core programming model. Proper start files
|
|
and link scripts are used to support Core B, and the macro
|
|
<TT>"__BFIN_COREB"</TT> is defined. When this option is used, <TT>"coreb_main"</TT>
|
|
should be used instead of <TT>"main"</TT>.
|
|
This option can only be used in conjunction with <B>-mmulticore</B>.
|
|
<DT id="2279"><B>-msdram</B><DD>
|
|
|
|
|
|
Build a standalone application for <FONT SIZE="-1">SDRAM.</FONT> Proper start files and
|
|
link scripts are used to put the application into <FONT SIZE="-1">SDRAM,</FONT> and the macro
|
|
<TT>"__BFIN_SDRAM"</TT> is defined.
|
|
The loader should initialize <FONT SIZE="-1">SDRAM</FONT> before loading the application.
|
|
<DT id="2280"><B>-micplb</B><DD>
|
|
|
|
|
|
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.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>C6X Options</I>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="2281"><B>-march=</B><I>name</I><DD>
|
|
|
|
|
|
This specifies the name of the target architecture. <FONT SIZE="-1">GCC</FONT> uses this
|
|
name to determine what kind of instructions it can emit when generating
|
|
assembly code. Permissible names are: <B>c62x</B>,
|
|
<B>c64x</B>, <B>c64x+</B>, <B>c67x</B>, <B>c67x+</B>, <B>c674x</B>.
|
|
<DT id="2282"><B>-mbig-endian</B><DD>
|
|
|
|
|
|
Generate code for a big-endian target.
|
|
<DT id="2283"><B>-mlittle-endian</B><DD>
|
|
|
|
|
|
Generate code for a little-endian target. This is the default.
|
|
<DT id="2284"><B>-msim</B><DD>
|
|
|
|
|
|
Choose startup files and linker script suitable for the simulator.
|
|
<DT id="2285"><B>-msdata=default</B><DD>
|
|
|
|
|
|
Put small global and static data in the <TT>".neardata"</TT> section,
|
|
which is pointed to by register <TT>"B14"</TT>. Put small uninitialized
|
|
global and static data in the <TT>".bss"</TT> section, which is adjacent
|
|
to the <TT>".neardata"</TT> section. Put small read-only data into the
|
|
<TT>".rodata"</TT> section. The corresponding sections used for large
|
|
pieces of data are <TT>".fardata"</TT>, <TT>".far"</TT> and <TT>".const"</TT>.
|
|
<DT id="2286"><B>-msdata=all</B><DD>
|
|
|
|
|
|
Put all data, not just small objects, into the sections reserved for
|
|
small data, and use addressing relative to the <TT>"B14"</TT> register to
|
|
access them.
|
|
<DT id="2287"><B>-msdata=none</B><DD>
|
|
|
|
|
|
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 <TT>".fardata"</TT> section, and all uninitialized data in the
|
|
<TT>".far"</TT> section. Put all constant data into the <TT>".const"</TT>
|
|
section.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>CRIS</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined specifically for the <FONT SIZE="-1">CRIS</FONT> ports.
|
|
<DL COMPACT>
|
|
<DT id="2288"><B>-march=</B><I>architecture-type</I><DD>
|
|
|
|
|
|
|
|
<DT id="2289"><B>-mcpu=</B><I>architecture-type</I><DD>
|
|
|
|
|
|
|
|
Generate code for the specified architecture. The choices for
|
|
<I>architecture-type</I> are <B>v3</B>, <B>v8</B> and <B>v10</B> for
|
|
respectively <FONT SIZE="-1">ETRAX</FONT> 4, <FONT SIZE="-1">ETRAX</FONT> 100, and <FONT SIZE="-1">ETRAX</FONT> 100 <FONT SIZE="-1">LX.</FONT>
|
|
Default is <B>v0</B> except for cris-axis-linux-gnu, where the default is
|
|
<B>v10</B>.
|
|
<DT id="2290"><B>-mtune=</B><I>architecture-type</I><DD>
|
|
|
|
|
|
Tune to <I>architecture-type</I> everything applicable about the generated
|
|
code, except for the <FONT SIZE="-1">ABI</FONT> and the set of available instructions. The
|
|
choices for <I>architecture-type</I> are the same as for
|
|
<B>-march=</B><I>architecture-type</I>.
|
|
<DT id="2291"><B>-mmax-stack-frame=</B><I>n</I><DD>
|
|
|
|
|
|
Warn when the stack frame of a function exceeds <I>n</I> bytes.
|
|
<DT id="2292"><B>-metrax4</B><DD>
|
|
|
|
|
|
|
|
<DT id="2293"><B>-metrax100</B><DD>
|
|
|
|
|
|
|
|
The options <B>-metrax4</B> and <B>-metrax100</B> are synonyms for
|
|
<B>-march=v3</B> and <B>-march=v8</B> respectively.
|
|
<DT id="2294"><B>-mmul-bug-workaround</B><DD>
|
|
|
|
|
|
|
|
<DT id="2295"><B>-mno-mul-bug-workaround</B><DD>
|
|
|
|
|
|
|
|
Work around a bug in the <TT>"muls"</TT> and <TT>"mulu"</TT> instructions for <FONT SIZE="-1">CPU</FONT>
|
|
models where it applies. This option is active by default.
|
|
<DT id="2296"><B>-mpdebug</B><DD>
|
|
|
|
|
|
Enable CRIS-specific verbose debug-related information in the assembly
|
|
code. This option also has the effect of turning off the <B>#NO_APP</B>
|
|
formatted-code indicator to the assembler at the beginning of the
|
|
assembly file.
|
|
<DT id="2297"><B>-mcc-init</B><DD>
|
|
|
|
|
|
Do not use condition-code results from previous instruction; always emit
|
|
compare and test instructions before use of condition codes.
|
|
<DT id="2298"><B>-mno-side-effects</B><DD>
|
|
|
|
|
|
Do not emit instructions with side effects in addressing modes other than
|
|
post-increment.
|
|
<DT id="2299"><B>-mstack-align</B><DD>
|
|
|
|
|
|
|
|
<DT id="2300"><B>-mno-stack-align</B><DD>
|
|
|
|
|
|
<DT id="2301"><B>-mdata-align</B><DD>
|
|
|
|
|
|
<DT id="2302"><B>-mno-data-align</B><DD>
|
|
|
|
|
|
<DT id="2303"><B>-mconst-align</B><DD>
|
|
|
|
|
|
<DT id="2304"><B>-mno-const-align</B><DD>
|
|
|
|
|
|
|
|
These options (<B>no-</B> 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 <FONT SIZE="-1">CPU</FONT> model. The default is to
|
|
arrange for 32-bit alignment. <FONT SIZE="-1">ABI</FONT> details such as structure layout are
|
|
not affected by these options.
|
|
<DT id="2305"><B>-m32-bit</B><DD>
|
|
|
|
|
|
|
|
<DT id="2306"><B>-m16-bit</B><DD>
|
|
|
|
|
|
<DT id="2307"><B>-m8-bit</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="2308"><B>-mno-prologue-epilogue</B><DD>
|
|
|
|
|
|
|
|
<DT id="2309"><B>-mprologue-epilogue</B><DD>
|
|
|
|
|
|
|
|
With <B>-mno-prologue-epilogue</B>, 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
|
|
option only together with visual inspection of the compiled code: no
|
|
warnings or errors are generated when call-saved registers must be saved,
|
|
or storage for local variables needs to be allocated.
|
|
<DT id="2310"><B>-mno-gotplt</B><DD>
|
|
|
|
|
|
|
|
<DT id="2311"><B>-mgotplt</B><DD>
|
|
|
|
|
|
|
|
With <B>-fpic</B> and <B>-fPIC</B>, don't generate (do generate)
|
|
instruction sequences that load addresses for functions from the <FONT SIZE="-1">PLT</FONT> part
|
|
of the <FONT SIZE="-1">GOT</FONT> rather than (traditional on other architectures) calls to the
|
|
<FONT SIZE="-1">PLT.</FONT> The default is <B>-mgotplt</B>.
|
|
<DT id="2312"><B>-melf</B><DD>
|
|
|
|
|
|
Legacy no-op option only recognized with the cris-axis-elf and
|
|
cris-axis-linux-gnu targets.
|
|
<DT id="2313"><B>-mlinux</B><DD>
|
|
|
|
|
|
Legacy no-op option only recognized with the cris-axis-linux-gnu target.
|
|
<DT id="2314"><B>-sim</B><DD>
|
|
|
|
|
|
This option, recognized for the cris-axis-elf, arranges
|
|
to link with input-output functions from a simulator library. Code,
|
|
initialized data and zero-initialized data are allocated consecutively.
|
|
<DT id="2315"><B>-sim2</B><DD>
|
|
|
|
|
|
Like <B>-sim</B>, but pass linker options to locate initialized data at
|
|
0x40000000 and zero-initialized data at 0x80000000.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>CR16</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined specifically for the <FONT SIZE="-1">CR16</FONT> ports.
|
|
<DL COMPACT>
|
|
<DT id="2316"><B>-mmac</B><DD>
|
|
|
|
|
|
Enable the use of multiply-accumulate instructions. Disabled by default.
|
|
<DT id="2317"><B>-mcr16cplus</B><DD>
|
|
|
|
|
|
|
|
<DT id="2318"><B>-mcr16c</B><DD>
|
|
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">CR16C</FONT> or <FONT SIZE="-1">CR16C+</FONT> architecture. <FONT SIZE="-1">CR16C+</FONT> architecture
|
|
is default.
|
|
<DT id="2319"><B>-msim</B><DD>
|
|
|
|
|
|
Links the library libsim.a which is in compatible with simulator. Applicable
|
|
to <FONT SIZE="-1">ELF</FONT> compiler only.
|
|
<DT id="2320"><B>-mint32</B><DD>
|
|
|
|
|
|
Choose integer type as 32-bit wide.
|
|
<DT id="2321"><B>-mbit-ops</B><DD>
|
|
|
|
|
|
Generates <TT>"sbit"</TT>/<TT>"cbit"</TT> instructions for bit manipulations.
|
|
<DT id="2322"><B>-mdata-model=</B><I>model</I><DD>
|
|
|
|
|
|
Choose a data model. The choices for <I>model</I> are <B>near</B>,
|
|
<B>far</B> or <B>medium</B>. <B>medium</B> is default.
|
|
However, <B>far</B> is not valid with <B>-mcr16c</B>, as the
|
|
<FONT SIZE="-1">CR16C</FONT> architecture does not support the far data model.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>C-SKY Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
<FONT SIZE="-1">GCC</FONT> supports these options when compiling for C-SKY V2 processors.
|
|
<DL COMPACT>
|
|
<DT id="2323"><B>-march=</B><I>arch</I><DD>
|
|
|
|
|
|
Specify the C-SKY target architecture. Valid values for <I>arch</I> are:
|
|
<B>ck801</B>, <B>ck802</B>, <B>ck803</B>, <B>ck807</B>, and <B>ck810</B>.
|
|
The default is <B>ck810</B>.
|
|
<DT id="2324"><B>-mcpu=</B><I>cpu</I><DD>
|
|
|
|
|
|
Specify the C-SKY target processor. Valid values for <I>cpu</I> are:
|
|
<B>ck801</B>, <B>ck801t</B>,
|
|
<B>ck802</B>, <B>ck802t</B>, <B>ck802j</B>,
|
|
<B>ck803</B>, <B>ck803h</B>, <B>ck803t</B>, <B>ck803ht</B>,
|
|
<B>ck803f</B>, <B>ck803fh</B>, <B>ck803e</B>, <B>ck803eh</B>,
|
|
<B>ck803et</B>, <B>ck803eht</B>, <B>ck803ef</B>, <B>ck803efh</B>,
|
|
<B>ck803ft</B>, <B>ck803eft</B>, <B>ck803efht</B>, <B>ck803r1</B>,
|
|
<B>ck803hr1</B>, <B>ck803tr1</B>, <B>ck803htr1</B>, <B>ck803fr1</B>,
|
|
<B>ck803fhr1</B>, <B>ck803er1</B>, <B>ck803ehr1</B>, <B>ck803etr1</B>,
|
|
<B>ck803ehtr1</B>, <B>ck803efr1</B>, <B>ck803efhr1</B>, <B>ck803ftr1</B>,
|
|
<B>ck803eftr1</B>, <B>ck803efhtr1</B>,
|
|
<B>ck803s</B>, <B>ck803st</B>, <B>ck803se</B>, <B>ck803sf</B>,
|
|
<B>ck803sef</B>, <B>ck803seft</B>,
|
|
<B>ck807e</B>, <B>ck807ef</B>, <B>ck807</B>, <B>ck807f</B>,
|
|
<B>ck810e</B>, <B>ck810et</B>, <B>ck810ef</B>, <B>ck810eft</B>,
|
|
<B>ck810</B>, <B>ck810v</B>, <B>ck810f</B>, <B>ck810t</B>, <B>ck810fv</B>,
|
|
<B>ck810tv</B>, <B>ck810ft</B>, and <B>ck810ftv</B>.
|
|
<DT id="2325"><B>-mbig-endian</B><DD>
|
|
|
|
|
|
|
|
<DT id="2326"><B>-EB</B><DD>
|
|
|
|
|
|
<DT id="2327"><B>-mlittle-endian</B><DD>
|
|
|
|
|
|
<DT id="2328"><B>-EL</B><DD>
|
|
|
|
|
|
|
|
Select big- or little-endian code. The default is little-endian.
|
|
<DT id="2329"><B>-mhard-float</B><DD>
|
|
|
|
|
|
|
|
<DT id="2330"><B>-msoft-float</B><DD>
|
|
|
|
|
|
|
|
Select hardware or software floating-point implementations.
|
|
The default is soft float.
|
|
<DT id="2331"><B>-mdouble-float</B><DD>
|
|
|
|
|
|
|
|
<DT id="2332"><B>-mno-double-float</B><DD>
|
|
|
|
|
|
|
|
When <B>-mhard-float</B> is in effect, enable generation of
|
|
double-precision float instructions. This is the default except
|
|
when compiling for <FONT SIZE="-1">CK803.</FONT>
|
|
<DT id="2333"><B>-mfdivdu</B><DD>
|
|
|
|
|
|
|
|
<DT id="2334"><B>-mno-fdivdu</B><DD>
|
|
|
|
|
|
|
|
When <B>-mhard-float</B> is in effect, enable generation of
|
|
<TT>"frecipd"</TT>, <TT>"fsqrtd"</TT>, and <TT>"fdivd"</TT> instructions.
|
|
This is the default except when compiling for <FONT SIZE="-1">CK803.</FONT>
|
|
<DT id="2335"><B>-mfpu=</B><I>fpu</I><DD>
|
|
|
|
|
|
Select the floating-point processor. This option can only be used with
|
|
<B>-mhard-float</B>.
|
|
Values for <I>fpu</I> are
|
|
<B>fpv2_sf</B> (equivalent to <B>-mno-double-float -mno-fdivdu</B>),
|
|
<B>fpv2</B> (<B>-mdouble-float -mno-divdu</B>), and
|
|
<B>fpv2_divd</B> (<B>-mdouble-float -mdivdu</B>).
|
|
<DT id="2336"><B>-melrw</B><DD>
|
|
|
|
|
|
|
|
<DT id="2337"><B>-mno-elrw</B><DD>
|
|
|
|
|
|
|
|
Enable the extended <TT>"lrw"</TT> instruction. This option defaults to on
|
|
for <FONT SIZE="-1">CK801</FONT> and off otherwise.
|
|
<DT id="2338"><B>-mistack</B><DD>
|
|
|
|
|
|
|
|
<DT id="2339"><B>-mno-istack</B><DD>
|
|
|
|
|
|
|
|
Enable interrupt stack instructions; the default is off.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-mistack</B> option is required to handle the
|
|
<TT>"interrupt"</TT> and <TT>"isr"</TT> function attributes.
|
|
<DT id="2340"><B>-mmp</B><DD>
|
|
|
|
|
|
Enable multiprocessor instructions; the default is off.
|
|
<DT id="2341"><B>-mcp</B><DD>
|
|
|
|
|
|
Enable coprocessor instructions; the default is off.
|
|
<DT id="2342"><B>-mcache</B><DD>
|
|
|
|
|
|
Enable coprocessor instructions; the default is off.
|
|
<DT id="2343"><B>-msecurity</B><DD>
|
|
|
|
|
|
Enable C-SKY security instructions; the default is off.
|
|
<DT id="2344"><B>-mtrust</B><DD>
|
|
|
|
|
|
Enable C-SKY trust instructions; the default is off.
|
|
<DT id="2345"><B>-mdsp</B><DD>
|
|
|
|
|
|
|
|
<DT id="2346"><B>-medsp</B><DD>
|
|
|
|
|
|
<DT id="2347"><B>-mvdsp</B><DD>
|
|
|
|
|
|
|
|
Enable C-SKY <FONT SIZE="-1">DSP,</FONT> Enhanced <FONT SIZE="-1">DSP,</FONT> or Vector <FONT SIZE="-1">DSP</FONT> instructions, respectively.
|
|
All of these options default to off.
|
|
<DT id="2348"><B>-mdiv</B><DD>
|
|
|
|
|
|
|
|
<DT id="2349"><B>-mno-div</B><DD>
|
|
|
|
|
|
|
|
Generate divide instructions. Default is off.
|
|
<DT id="2350"><B>-msmart</B><DD>
|
|
|
|
|
|
|
|
<DT id="2351"><B>-mno-smart</B><DD>
|
|
|
|
|
|
|
|
Generate code for Smart Mode, using only registers numbered 0-7 to allow
|
|
use of 16-bit instructions. This option is ignored for <FONT SIZE="-1">CK801</FONT> where this
|
|
is the required behavior, and it defaults to on for <FONT SIZE="-1">CK802.</FONT>
|
|
For other targets, the default is off.
|
|
<DT id="2352"><B>-mhigh-registers</B><DD>
|
|
|
|
|
|
|
|
<DT id="2353"><B>-mno-high-registers</B><DD>
|
|
|
|
|
|
|
|
Generate code using the high registers numbered 16-31. This option
|
|
is not supported on <FONT SIZE="-1">CK801, CK802,</FONT> or <FONT SIZE="-1">CK803,</FONT> and is enabled by default
|
|
for other processors.
|
|
<DT id="2354"><B>-manchor</B><DD>
|
|
|
|
|
|
|
|
<DT id="2355"><B>-mno-anchor</B><DD>
|
|
|
|
|
|
|
|
Generate code using global anchor symbol addresses.
|
|
<DT id="2356"><B>-mpushpop</B><DD>
|
|
|
|
|
|
|
|
<DT id="2357"><B>-mno-pushpop</B><DD>
|
|
|
|
|
|
|
|
Generate code using <TT>"push"</TT> and <TT>"pop"</TT> instructions. This option
|
|
defaults to on.
|
|
<DT id="2358"><B>-mmultiple-stld</B><DD>
|
|
|
|
|
|
|
|
<DT id="2359"><B>-mstm</B><DD>
|
|
|
|
|
|
<DT id="2360"><B>-mno-multiple-stld</B><DD>
|
|
|
|
|
|
<DT id="2361"><B>-mno-stm</B><DD>
|
|
|
|
|
|
|
|
Generate code using <TT>"stm"</TT> and <TT>"ldm"</TT> instructions. This option
|
|
isn't supported on <FONT SIZE="-1">CK801</FONT> but is enabled by default on other processors.
|
|
<DT id="2362"><B>-mconstpool</B><DD>
|
|
|
|
|
|
|
|
<DT id="2363"><B>-mno-constpool</B><DD>
|
|
|
|
|
|
|
|
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 <FONT SIZE="-1">CK801</FONT> and <FONT SIZE="-1">CK802,</FONT> and is optional on other processors.
|
|
<DT id="2364"><B>-mstack-size</B><DD>
|
|
|
|
|
|
|
|
<DT id="2365"><B>-mno-stack-size</B><DD>
|
|
|
|
|
|
|
|
Emit <TT>".stack_size"</TT> directives for each function in the assembly
|
|
output. This option defaults to off.
|
|
<DT id="2366"><B>-mccrt</B><DD>
|
|
|
|
|
|
|
|
<DT id="2367"><B>-mno-ccrt</B><DD>
|
|
|
|
|
|
|
|
Generate code for the C-SKY compiler runtime instead of libgcc. This
|
|
option defaults to off.
|
|
<DT id="2368"><B>-mbranch-cost=</B><I>n</I><DD>
|
|
|
|
|
|
Set the branch costs to roughly <TT>"n"</TT> instructions. The default is 1.
|
|
<DT id="2369"><B>-msched-prolog</B><DD>
|
|
|
|
|
|
|
|
<DT id="2370"><B>-mno-sched-prolog</B><DD>
|
|
|
|
|
|
|
|
Permit scheduling of function prologue and epilogue sequences. Using
|
|
this option can result in code that is not compliant with the C-SKY V2 <FONT SIZE="-1">ABI</FONT>
|
|
prologue requirements and that cannot be debugged or backtraced.
|
|
It is disabled by default.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>Darwin Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined for all architectures running the Darwin operating
|
|
system.
|
|
<P>
|
|
|
|
<FONT SIZE="-1">FSF GCC</FONT> on Darwin does not create ``fat'' object files; it creates
|
|
an object file for the single architecture that <FONT SIZE="-1">GCC</FONT> was built to
|
|
target. Apple's <FONT SIZE="-1">GCC</FONT> on Darwin does create ``fat'' files if multiple
|
|
<B>-arch</B> options are used; it does so by running the compiler or
|
|
linker multiple times and joining the results together with
|
|
<I>lipo</I>.
|
|
<P>
|
|
|
|
The subtype of the file created (like <B>ppc7400</B> or <B>ppc970</B> or
|
|
<B>i686</B>) is determined by the flags that specify the <FONT SIZE="-1">ISA</FONT>
|
|
that <FONT SIZE="-1">GCC</FONT> is targeting, like <B>-mcpu</B> or <B>-march</B>. The
|
|
<B>-force_cpusubtype_ALL</B> option can be used to override this.
|
|
<P>
|
|
|
|
The Darwin tools vary in their behavior when presented with an <FONT SIZE="-1">ISA</FONT>
|
|
mismatch. The assembler, <I>as</I>, only permits instructions to
|
|
be used that are valid for the subtype of the file it is generating,
|
|
so you cannot put 64-bit instructions in a <B>ppc750</B> object file.
|
|
The linker for shared libraries, <I>/usr/bin/libtool</I>, fails
|
|
and prints an error if asked to create a shared library with a less
|
|
restrictive subtype than its input files (for instance, trying to put
|
|
a <B>ppc970</B> object file in a <B>ppc7400</B> library). The linker
|
|
for executables, <B>ld</B>, quietly gives the executable the most
|
|
restrictive subtype of any of its input files.
|
|
<DL COMPACT>
|
|
<DT id="2371"><B>-F</B><I>dir</I><DD>
|
|
|
|
|
|
Add the framework directory <I>dir</I> to the head of the list of
|
|
directories to be searched for header files. These directories are
|
|
interleaved with those specified by <B>-I</B> options and are
|
|
scanned in a left-to-right order.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
A framework directory is a directory with frameworks in it. A
|
|
framework is a directory with a <I>Headers</I> and/or
|
|
<I>PrivateHeaders</I> directory contained directly in it that ends
|
|
in <I>.framework</I>. The name of a framework is the name of this
|
|
directory excluding the <I>.framework</I>. Headers associated with
|
|
the framework are found in one of those two directories, with
|
|
<I>Headers</I> being searched first. A subframework is a framework
|
|
directory that is in a framework's <I>Frameworks</I> directory.
|
|
Includes of subframework headers can only appear in a header of a
|
|
framework that contains the subframework, or in a sibling subframework
|
|
header. Two subframeworks are siblings if they occur in the same
|
|
framework. A subframework should not have the same name as a
|
|
framework; a warning is issued if this is violated. Currently a
|
|
subframework cannot have subframeworks; in the future, the mechanism
|
|
may be extended to support this. The standard frameworks can be found
|
|
in <I>/System/Library/Frameworks</I> and
|
|
<I>/Library/Frameworks</I>. An example include looks like
|
|
<TT>"#include <<A HREF="file:///usr/include/Framework/header.h">Framework/header.h</A>>"</TT>, where <I>Framework</I> denotes
|
|
the name of the framework and <I>header.h</I> is found in the
|
|
<I>PrivateHeaders</I> or <I>Headers</I> directory.
|
|
<DT id="2372"><B>-iframework</B><I>dir</I><DD>
|
|
|
|
|
|
Like <B>-F</B> except the directory is a treated as a system
|
|
directory. The main difference between this <B>-iframework</B> and
|
|
<B>-F</B> is that with <B>-iframework</B> the compiler does not
|
|
warn about constructs contained within header files found via
|
|
<I>dir</I>. This option is valid only for the C family of languages.
|
|
<DT id="2373"><B>-gused</B><DD>
|
|
|
|
|
|
Emit debugging information for symbols that are used. For stabs
|
|
debugging format, this enables <B>-feliminate-unused-debug-symbols</B>.
|
|
This is by default <FONT SIZE="-1">ON.</FONT>
|
|
<DT id="2374"><B>-gfull</B><DD>
|
|
|
|
|
|
Emit debugging information for all symbols and types.
|
|
<DT id="2375"><B>-mmacosx-version-min=</B><I>version</I><DD>
|
|
|
|
|
|
The earliest version of MacOS X that this executable will run on
|
|
is <I>version</I>. Typical values of <I>version</I> include <TT>10.1</TT>,
|
|
<TT>10.2</TT>, and <TT>10.3.9</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If the compiler was built to use the system's headers by default,
|
|
then the default for this option is the system version on which the
|
|
compiler is running, otherwise the default is to make choices that
|
|
are compatible with as many systems and code bases as possible.
|
|
<DT id="2376"><B>-mkernel</B><DD>
|
|
|
|
|
|
Enable kernel development mode. The <B>-mkernel</B> option sets
|
|
<B>-static</B>, <B>-fno-common</B>, <B>-fno-use-cxa-atexit</B>,
|
|
<B>-fno-exceptions</B>, <B>-fno-non-call-exceptions</B>,
|
|
<B>-fapple-kext</B>, <B>-fno-weak</B> and <B>-fno-rtti</B> where
|
|
applicable. This mode also sets <B>-mno-altivec</B>,
|
|
<B>-msoft-float</B>, <B>-fno-builtin</B> and
|
|
<B>-mlong-branch</B> for PowerPC targets.
|
|
<DT id="2377"><B>-mone-byte-bool</B><DD>
|
|
|
|
|
|
Override the defaults for <TT>"bool"</TT> so that <TT>"sizeof(bool)==1"</TT>.
|
|
By default <TT>"sizeof(bool)"</TT> is <TT>4</TT> when compiling for
|
|
Darwin/PowerPC and <TT>1</TT> when compiling for Darwin/x86, so this
|
|
option has no effect on x86.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> The <B>-mone-byte-bool</B> switch causes <FONT SIZE="-1">GCC</FONT>
|
|
to generate code that is not binary compatible with code generated
|
|
without that switch. Using this switch may require recompiling all
|
|
other modules in a program, including system libraries. Use this
|
|
switch to conform to a non-default data model.
|
|
<DT id="2378"><B>-mfix-and-continue</B><DD>
|
|
|
|
|
|
|
|
<DT id="2379"><B>-ffix-and-continue</B><DD>
|
|
|
|
|
|
<DT id="2380"><B>-findirect-data</B><DD>
|
|
|
|
|
|
|
|
Generate code suitable for fast turnaround development, such as to
|
|
allow <FONT SIZE="-1">GDB</FONT> to dynamically load <I>.o</I> files into already-running
|
|
programs. <B>-findirect-data</B> and <B>-ffix-and-continue</B>
|
|
are provided for backwards compatibility.
|
|
<DT id="2381"><B>-all_load</B><DD>
|
|
|
|
|
|
Loads all members of static archive libraries.
|
|
See man <B><A HREF="/cgi-bin/man/man2html?1+ld">ld</A></B>(1) for more information.
|
|
<DT id="2382"><B>-arch_errors_fatal</B><DD>
|
|
|
|
|
|
Cause the errors having to do with files that have the wrong architecture
|
|
to be fatal.
|
|
<DT id="2383"><B>-bind_at_load</B><DD>
|
|
|
|
|
|
Causes the output file to be marked such that the dynamic linker will
|
|
bind all undefined references when the file is loaded or launched.
|
|
<DT id="2384"><B>-bundle</B><DD>
|
|
|
|
|
|
Produce a Mach-o bundle format file.
|
|
See man <B><A HREF="/cgi-bin/man/man2html?1+ld">ld</A></B>(1) for more information.
|
|
<DT id="2385"><B>-bundle_loader</B> <I>executable</I><DD>
|
|
|
|
|
|
This option specifies the <I>executable</I> that will load the build
|
|
output file being linked. See man <B><A HREF="/cgi-bin/man/man2html?1+ld">ld</A></B>(1) for more information.
|
|
<DT id="2386"><B>-dynamiclib</B><DD>
|
|
|
|
|
|
When passed this option, <FONT SIZE="-1">GCC</FONT> produces a dynamic library instead of
|
|
an executable when linking, using the Darwin <I>libtool</I> command.
|
|
<DT id="2387"><B>-force_cpusubtype_ALL</B><DD>
|
|
|
|
|
|
This causes <FONT SIZE="-1">GCC</FONT>'s output file to have the <B></B><FONT SIZE="-1"><B>ALL</B></FONT><B></B> subtype, instead of
|
|
one controlled by the <B>-mcpu</B> or <B>-march</B> option.
|
|
<DT id="2388"><B>-allowable_client</B> <I>client_name</I><DD>
|
|
|
|
|
|
|
|
<DT id="2389"><B>-client_name</B><DD>
|
|
|
|
|
|
<DT id="2390"><B>-compatibility_version</B><DD>
|
|
|
|
|
|
<DT id="2391"><B>-current_version</B><DD>
|
|
|
|
|
|
<DT id="2392"><B>-dead_strip</B><DD>
|
|
|
|
|
|
<DT id="2393"><B>-dependency-file</B><DD>
|
|
|
|
|
|
<DT id="2394"><B>-dylib_file</B><DD>
|
|
|
|
|
|
<DT id="2395"><B>-dylinker_install_name</B><DD>
|
|
|
|
|
|
<DT id="2396"><B>-dynamic</B><DD>
|
|
|
|
|
|
<DT id="2397"><B>-exported_symbols_list</B><DD>
|
|
|
|
|
|
<DT id="2398"><B>-filelist</B><DD>
|
|
|
|
|
|
<DT id="2399"><B>-flat_namespace</B><DD>
|
|
|
|
|
|
<DT id="2400"><B>-force_flat_namespace</B><DD>
|
|
|
|
|
|
<DT id="2401"><B>-headerpad_max_install_names</B><DD>
|
|
|
|
|
|
<DT id="2402"><B>-image_base</B><DD>
|
|
|
|
|
|
<DT id="2403"><B>-init</B><DD>
|
|
|
|
|
|
<DT id="2404"><B>-install_name</B><DD>
|
|
|
|
|
|
<DT id="2405"><B>-keep_private_externs</B><DD>
|
|
|
|
|
|
<DT id="2406"><B>-multi_module</B><DD>
|
|
|
|
|
|
<DT id="2407"><B>-multiply_defined</B><DD>
|
|
|
|
|
|
<DT id="2408"><B>-multiply_defined_unused</B><DD>
|
|
|
|
|
|
<DT id="2409"><B>-noall_load</B><DD>
|
|
|
|
|
|
<DT id="2410"><B>-no_dead_strip_inits_and_terms</B><DD>
|
|
|
|
|
|
<DT id="2411"><B>-nofixprebinding</B><DD>
|
|
|
|
|
|
<DT id="2412"><B>-nomultidefs</B><DD>
|
|
|
|
|
|
<DT id="2413"><B>-noprebind</B><DD>
|
|
|
|
|
|
<DT id="2414"><B>-noseglinkedit</B><DD>
|
|
|
|
|
|
<DT id="2415"><B>-pagezero_size</B><DD>
|
|
|
|
|
|
<DT id="2416"><B>-prebind</B><DD>
|
|
|
|
|
|
<DT id="2417"><B>-prebind_all_twolevel_modules</B><DD>
|
|
|
|
|
|
<DT id="2418"><B>-private_bundle</B><DD>
|
|
|
|
|
|
<DT id="2419"><B>-read_only_relocs</B><DD>
|
|
|
|
|
|
<DT id="2420"><B>-sectalign</B><DD>
|
|
|
|
|
|
<DT id="2421"><B>-sectobjectsymbols</B><DD>
|
|
|
|
|
|
<DT id="2422"><B>-whyload</B><DD>
|
|
|
|
|
|
<DT id="2423"><B>-seg1addr</B><DD>
|
|
|
|
|
|
<DT id="2424"><B>-sectcreate</B><DD>
|
|
|
|
|
|
<DT id="2425"><B>-sectobjectsymbols</B><DD>
|
|
|
|
|
|
<DT id="2426"><B>-sectorder</B><DD>
|
|
|
|
|
|
<DT id="2427"><B>-segaddr</B><DD>
|
|
|
|
|
|
<DT id="2428"><B>-segs_read_only_addr</B><DD>
|
|
|
|
|
|
<DT id="2429"><B>-segs_read_write_addr</B><DD>
|
|
|
|
|
|
<DT id="2430"><B>-seg_addr_table</B><DD>
|
|
|
|
|
|
<DT id="2431"><B>-seg_addr_table_filename</B><DD>
|
|
|
|
|
|
<DT id="2432"><B>-seglinkedit</B><DD>
|
|
|
|
|
|
<DT id="2433"><B>-segprot</B><DD>
|
|
|
|
|
|
<DT id="2434"><B>-segs_read_only_addr</B><DD>
|
|
|
|
|
|
<DT id="2435"><B>-segs_read_write_addr</B><DD>
|
|
|
|
|
|
<DT id="2436"><B>-single_module</B><DD>
|
|
|
|
|
|
<DT id="2437"><B>-static</B><DD>
|
|
|
|
|
|
<DT id="2438"><B>-sub_library</B><DD>
|
|
|
|
|
|
<DT id="2439"><B>-sub_umbrella</B><DD>
|
|
|
|
|
|
<DT id="2440"><B>-twolevel_namespace</B><DD>
|
|
|
|
|
|
<DT id="2441"><B>-umbrella</B><DD>
|
|
|
|
|
|
<DT id="2442"><B>-undefined</B><DD>
|
|
|
|
|
|
<DT id="2443"><B>-unexported_symbols_list</B><DD>
|
|
|
|
|
|
<DT id="2444"><B>-weak_reference_mismatches</B><DD>
|
|
|
|
|
|
<DT id="2445"><B>-whatsloaded</B><DD>
|
|
|
|
|
|
|
|
These options are passed to the Darwin linker. The Darwin linker man page
|
|
describes them in detail.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>DEC</I></FONT><I> Alpha Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for the <FONT SIZE="-1">DEC</FONT> Alpha implementations:
|
|
<DL COMPACT>
|
|
<DT id="2446"><B>-mno-soft-float</B><DD>
|
|
|
|
|
|
|
|
<DT id="2447"><B>-msoft-float</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the hardware floating-point instructions for
|
|
floating-point operations. When <B>-msoft-float</B> is specified,
|
|
functions in <I>libgcc.a</I> are used to perform floating-point
|
|
operations. Unless they are replaced by routines that emulate the
|
|
floating-point operations, or compiled in such a way as to call such
|
|
emulations routines, these routines issue floating-point
|
|
operations. If you are compiling for an Alpha without floating-point
|
|
operations, you must ensure that the library is built so as not to call
|
|
them.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that Alpha implementations without floating-point operations are
|
|
required to have floating-point registers.
|
|
<DT id="2448"><B>-mfp-reg</B><DD>
|
|
|
|
|
|
|
|
<DT id="2449"><B>-mno-fp-regs</B><DD>
|
|
|
|
|
|
|
|
Generate code that uses (does not use) the floating-point register set.
|
|
<B>-mno-fp-regs</B> implies <B>-msoft-float</B>. If the floating-point
|
|
register set is not used, floating-point operands are passed in integer
|
|
registers as if they were integers and floating-point results are passed
|
|
in <TT>$0</TT> instead of <TT>$f0</TT>. This is a non-standard calling sequence,
|
|
so any function with a floating-point argument or return value called by code
|
|
compiled with <B>-mno-fp-regs</B> must also be compiled with that
|
|
option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
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.
|
|
<DT id="2450"><B>-mieee</B><DD>
|
|
|
|
|
|
The Alpha architecture implements floating-point hardware optimized for
|
|
maximum performance. It is mostly compliant with the <FONT SIZE="-1">IEEE</FONT> floating-point
|
|
standard. However, for full compliance, software assistance is
|
|
required. This option generates code fully IEEE-compliant code
|
|
<I>except</I> that the <I>inexact-flag</I> is not maintained (see below).
|
|
If this option is turned on, the preprocessor macro <TT>"_IEEE_FP"</TT> is
|
|
defined during compilation. The resulting code is less efficient but is
|
|
able to correctly support denormalized numbers and exceptional <FONT SIZE="-1">IEEE</FONT>
|
|
values such as not-a-number and plus/minus infinity. Other Alpha
|
|
compilers call this option <B>-ieee_with_no_inexact</B>.
|
|
<DT id="2451"><B>-mieee-with-inexact</B><DD>
|
|
|
|
|
|
This is like <B>-mieee</B> except the generated code also maintains
|
|
the <FONT SIZE="-1">IEEE</FONT> <I>inexact-flag</I>. Turning on this option causes the
|
|
generated code to implement fully-compliant <FONT SIZE="-1">IEEE</FONT> math. In addition to
|
|
<TT>"_IEEE_FP"</TT>, <TT>"_IEEE_FP_EXACT"</TT> is defined as a preprocessor
|
|
macro. On some Alpha implementations the resulting code may execute
|
|
significantly slower than the code generated by default. Since there is
|
|
very little code that depends on the <I>inexact-flag</I>, you should
|
|
normally not specify this option. Other Alpha compilers call this
|
|
option <B>-ieee_with_inexact</B>.
|
|
<DT id="2452"><B>-mfp-trap-mode=</B><I>trap-mode</I><DD>
|
|
|
|
|
|
This option controls what floating-point related traps are enabled.
|
|
Other Alpha compilers call this option <B>-fptm</B> <I>trap-mode</I>.
|
|
The trap mode can be set to one of four values:
|
|
<DL COMPACT><DT id="2453"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2454"><B>n</B><DD>
|
|
|
|
|
|
This is the default (normal) setting. The only traps that are enabled
|
|
are the ones that cannot be disabled in software (e.g., division by zero
|
|
trap).
|
|
<DT id="2455"><B>u</B><DD>
|
|
|
|
|
|
In addition to the traps enabled by <B>n</B>, underflow traps are enabled
|
|
as well.
|
|
<DT id="2456"><B>su</B><DD>
|
|
|
|
|
|
Like <B>u</B>, but the instructions are marked to be safe for software
|
|
completion (see Alpha architecture manual for details).
|
|
<DT id="2457"><B>sui</B><DD>
|
|
|
|
|
|
Like <B>su</B>, but inexact traps are enabled as well.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2458"><DD>
|
|
</DL>
|
|
|
|
<DT id="2459"><B>-mfp-rounding-mode=</B><I>rounding-mode</I><DD>
|
|
|
|
|
|
Selects the <FONT SIZE="-1">IEEE</FONT> rounding mode. Other Alpha compilers call this option
|
|
<B>-fprm</B> <I>rounding-mode</I>. The <I>rounding-mode</I> can be one
|
|
of:
|
|
<DL COMPACT><DT id="2460"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2461"><B>n</B><DD>
|
|
|
|
|
|
Normal <FONT SIZE="-1">IEEE</FONT> rounding mode. Floating-point numbers are rounded towards
|
|
the nearest machine number or towards the even machine number in case
|
|
of a tie.
|
|
<DT id="2462"><B>m</B><DD>
|
|
|
|
|
|
Round towards minus infinity.
|
|
<DT id="2463"><B>c</B><DD>
|
|
|
|
|
|
Chopped rounding mode. Floating-point numbers are rounded towards zero.
|
|
<DT id="2464"><B>d</B><DD>
|
|
|
|
|
|
Dynamic rounding mode. A field in the floating-point control register
|
|
(<I>fpcr</I>, see Alpha architecture reference manual) controls the
|
|
rounding mode in effect. The C library initializes this register for
|
|
rounding towards plus infinity. Thus, unless your program modifies the
|
|
<I>fpcr</I>, <B>d</B> corresponds to round towards plus infinity.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2465"><DD>
|
|
</DL>
|
|
|
|
<DT id="2466"><B>-mtrap-precision=</B><I>trap-precision</I><DD>
|
|
|
|
|
|
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.
|
|
<FONT SIZE="-1">GCC</FONT> can generate code that can assist operating system trap handlers
|
|
in determining the exact location that caused a floating-point trap.
|
|
Depending on the requirements of an application, different levels of
|
|
precisions can be selected:
|
|
<DL COMPACT><DT id="2467"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2468"><B>p</B><DD>
|
|
|
|
|
|
Program precision. This option is the default and means a trap handler
|
|
can only identify which program caused a floating-point exception.
|
|
<DT id="2469"><B>f</B><DD>
|
|
|
|
|
|
Function precision. The trap handler can determine the function that
|
|
caused a floating-point exception.
|
|
<DT id="2470"><B>i</B><DD>
|
|
|
|
|
|
Instruction precision. The trap handler can determine the exact
|
|
instruction that caused a floating-point exception.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2471"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Other Alpha compilers provide the equivalent options called
|
|
<B>-scope_safe</B> and <B>-resumption_safe</B>.
|
|
</DL>
|
|
|
|
<DT id="2472"><B>-mieee-conformant</B><DD>
|
|
|
|
|
|
This option marks the generated code as <FONT SIZE="-1">IEEE</FONT> conformant. You must not
|
|
use this option unless you also specify <B>-mtrap-precision=i</B> and either
|
|
<B>-mfp-trap-mode=su</B> or <B>-mfp-trap-mode=sui</B>. Its only effect
|
|
is to emit the line <B>.eflag 48</B> in the function prologue of the
|
|
generated assembly file.
|
|
<DT id="2473"><B>-mbuild-constants</B><DD>
|
|
|
|
|
|
Normally <FONT SIZE="-1">GCC</FONT> 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
|
|
generates code to load it from the data segment at run time.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Use this option to require <FONT SIZE="-1">GCC</FONT> to construct <I>all</I> integer constants
|
|
using code, even if it takes more instructions (the maximum is six).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You typically use this option to build a shared library dynamic
|
|
loader. Itself a shared library, it must relocate itself in memory
|
|
before it can find the variables and constants in its own data segment.
|
|
<DT id="2474"><B>-mbwx</B><DD>
|
|
|
|
|
|
|
|
<DT id="2475"><B>-mno-bwx</B><DD>
|
|
|
|
|
|
<DT id="2476"><B>-mcix</B><DD>
|
|
|
|
|
|
<DT id="2477"><B>-mno-cix</B><DD>
|
|
|
|
|
|
<DT id="2478"><B>-mfix</B><DD>
|
|
|
|
|
|
<DT id="2479"><B>-mno-fix</B><DD>
|
|
|
|
|
|
<DT id="2480"><B>-mmax</B><DD>
|
|
|
|
|
|
<DT id="2481"><B>-mno-max</B><DD>
|
|
|
|
|
|
|
|
Indicate whether <FONT SIZE="-1">GCC</FONT> should generate code to use the optional <FONT SIZE="-1">BWX,
|
|
CIX, FIX</FONT> and <FONT SIZE="-1">MAX</FONT> instruction sets. The default is to use the instruction
|
|
sets supported by the <FONT SIZE="-1">CPU</FONT> type specified via <B>-mcpu=</B> option or that
|
|
of the <FONT SIZE="-1">CPU</FONT> on which <FONT SIZE="-1">GCC</FONT> was built if none is specified.
|
|
<DT id="2482"><B>-mfloat-vax</B><DD>
|
|
|
|
|
|
|
|
<DT id="2483"><B>-mfloat-ieee</B><DD>
|
|
|
|
|
|
|
|
Generate code that uses (does not use) <FONT SIZE="-1">VAX F</FONT> and G floating-point
|
|
arithmetic instead of <FONT SIZE="-1">IEEE</FONT> single and double precision.
|
|
<DT id="2484"><B>-mexplicit-relocs</B><DD>
|
|
|
|
|
|
|
|
<DT id="2485"><B>-mno-explicit-relocs</B><DD>
|
|
|
|
|
|
|
|
Older Alpha assemblers provided no way to generate symbol relocations
|
|
except via assembler macros. Use of these macros does not allow
|
|
optimal instruction scheduling. <FONT SIZE="-1">GNU</FONT> binutils as of version 2.12
|
|
supports a new syntax that allows the compiler to explicitly mark
|
|
which relocations should apply to which instructions. This option
|
|
is mostly useful for debugging, as <FONT SIZE="-1">GCC</FONT> detects the capabilities of
|
|
the assembler when it is built and sets the default accordingly.
|
|
<DT id="2486"><B>-msmall-data</B><DD>
|
|
|
|
|
|
|
|
<DT id="2487"><B>-mlarge-data</B><DD>
|
|
|
|
|
|
|
|
When <B>-mexplicit-relocs</B> is in effect, static data is
|
|
accessed via <I>gp-relative</I> relocations. When <B>-msmall-data</B>
|
|
is used, objects 8 bytes long or smaller are placed in a <I>small data area</I>
|
|
(the <TT>".sdata"</TT> and <TT>".sbss"</TT> sections) and are accessed via
|
|
16-bit relocations off of the <TT>$gp</TT> register. This limits the
|
|
size of the small data area to 64KB, but allows the variables to be
|
|
directly accessed via a single instruction.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-mlarge-data</B>. With this option the data area
|
|
is limited to just below 2GB. Programs that require more than 2GB of
|
|
data must use <TT>"malloc"</TT> or <TT>"mmap"</TT> to allocate the data in the
|
|
heap instead of in the program's data segment.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When generating code for shared libraries, <B>-fpic</B> implies
|
|
<B>-msmall-data</B> and <B>-fPIC</B> implies <B>-mlarge-data</B>.
|
|
<DT id="2488"><B>-msmall-text</B><DD>
|
|
|
|
|
|
|
|
<DT id="2489"><B>-mlarge-text</B><DD>
|
|
|
|
|
|
|
|
When <B>-msmall-text</B> 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 <B>-msmall-data</B>
|
|
is used, the compiler can assume that all local symbols share the
|
|
same <TT>$gp</TT> value, and thus reduce the number of instructions
|
|
required for a function call from 4 to 1.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-mlarge-text</B>.
|
|
<DT id="2490"><B>-mcpu=</B><I>cpu_type</I><DD>
|
|
|
|
|
|
Set the instruction set and instruction scheduling parameters for
|
|
machine type <I>cpu_type</I>. You can specify either the <B></B><FONT SIZE="-1"><B>EV</B></FONT><B></B>
|
|
style name or the corresponding chip number. <FONT SIZE="-1">GCC</FONT> supports scheduling
|
|
parameters for the <FONT SIZE="-1">EV4, EV5</FONT> and <FONT SIZE="-1">EV6</FONT> family of processors and
|
|
chooses the default values for the instruction set from the processor
|
|
you specify. If you do not specify a processor type, <FONT SIZE="-1">GCC</FONT> defaults
|
|
to the processor on which the compiler was built.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Supported values for <I>cpu_type</I> are
|
|
<DL COMPACT><DT id="2491"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2492"><B>ev4</B><DD>
|
|
|
|
|
|
|
|
<DT id="2493"><B>ev45</B><DD>
|
|
|
|
|
|
<DT id="2494"><B>21064</B><DD>
|
|
|
|
|
|
|
|
Schedules as an <FONT SIZE="-1">EV4</FONT> and has no instruction set extensions.
|
|
<DT id="2495"><B>ev5</B><DD>
|
|
|
|
|
|
|
|
<DT id="2496"><B>21164</B><DD>
|
|
|
|
|
|
|
|
Schedules as an <FONT SIZE="-1">EV5</FONT> and has no instruction set extensions.
|
|
<DT id="2497"><B>ev56</B><DD>
|
|
|
|
|
|
|
|
<DT id="2498"><B>21164a</B><DD>
|
|
|
|
|
|
|
|
Schedules as an <FONT SIZE="-1">EV5</FONT> and supports the <FONT SIZE="-1">BWX</FONT> extension.
|
|
<DT id="2499"><B>pca56</B><DD>
|
|
|
|
|
|
|
|
<DT id="2500"><B>21164pc</B><DD>
|
|
|
|
|
|
<DT id="2501"><B>21164PC</B><DD>
|
|
|
|
|
|
|
|
Schedules as an <FONT SIZE="-1">EV5</FONT> and supports the <FONT SIZE="-1">BWX</FONT> and <FONT SIZE="-1">MAX</FONT> extensions.
|
|
<DT id="2502"><B>ev6</B><DD>
|
|
|
|
|
|
|
|
<DT id="2503"><B>21264</B><DD>
|
|
|
|
|
|
|
|
Schedules as an <FONT SIZE="-1">EV6</FONT> and supports the <FONT SIZE="-1">BWX, FIX,</FONT> and <FONT SIZE="-1">MAX</FONT> extensions.
|
|
<DT id="2504"><B>ev67</B><DD>
|
|
|
|
|
|
|
|
<DT id="2505"><B>21264a</B><DD>
|
|
|
|
|
|
|
|
Schedules as an <FONT SIZE="-1">EV6</FONT> and supports the <FONT SIZE="-1">BWX, CIX, FIX,</FONT> and <FONT SIZE="-1">MAX</FONT> extensions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2506"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Native toolchains also support the value <B>native</B>,
|
|
which selects the best architecture option for the host processor.
|
|
<B>-mcpu=native</B> has no effect if <FONT SIZE="-1">GCC</FONT> does not recognize
|
|
the processor.
|
|
</DL>
|
|
|
|
<DT id="2507"><B>-mtune=</B><I>cpu_type</I><DD>
|
|
|
|
|
|
Set only the instruction scheduling parameters for machine type
|
|
<I>cpu_type</I>. The instruction set is not changed.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Native toolchains also support the value <B>native</B>,
|
|
which selects the best architecture option for the host processor.
|
|
<B>-mtune=native</B> has no effect if <FONT SIZE="-1">GCC</FONT> does not recognize
|
|
the processor.
|
|
<DT id="2508"><B>-mmemory-latency=</B><I>time</I><DD>
|
|
|
|
|
|
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
|
|
and the size of the external cache on the machine.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Valid options for <I>time</I> are
|
|
<DL COMPACT><DT id="2509"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2510"><I>number</I><DD>
|
|
|
|
|
|
A decimal number representing clock cycles.
|
|
<DT id="2511"><B>L1</B><DD>
|
|
|
|
|
|
|
|
<DT id="2512"><B>L2</B><DD>
|
|
|
|
|
|
<DT id="2513"><B>L3</B><DD>
|
|
|
|
|
|
<DT id="2514"><B>main</B><DD>
|
|
|
|
|
|
|
|
The compiler contains estimates of the number of clock cycles for
|
|
``typical'' <FONT SIZE="-1">EV4 & EV5</FONT> hardware for the Level 1, 2 & 3 caches
|
|
(also called Dcache, Scache, and Bcache), as well as to main memory.
|
|
Note that L3 is only valid for <FONT SIZE="-1">EV5.</FONT>
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2515"><DD>
|
|
</DL>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>FR30</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined specifically for the <FONT SIZE="-1">FR30</FONT> port.
|
|
<DL COMPACT>
|
|
<DT id="2516"><B>-msmall-model</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2517"><B>-mno-lsim</B><DD>
|
|
|
|
|
|
Assume that runtime support has been provided and so there is no need
|
|
to include the simulator library (<I>libsim.a</I>) on the linker
|
|
command line.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>FT32</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined specifically for the <FONT SIZE="-1">FT32</FONT> port.
|
|
<DL COMPACT>
|
|
<DT id="2518"><B>-msim</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2519"><B>-mlra</B><DD>
|
|
|
|
|
|
Enable Local Register Allocation. This is still experimental for <FONT SIZE="-1">FT32,</FONT>
|
|
so by default the compiler uses standard reload.
|
|
<DT id="2520"><B>-mnodiv</B><DD>
|
|
|
|
|
|
Do not use div and mod instructions.
|
|
<DT id="2521"><B>-mft32b</B><DD>
|
|
|
|
|
|
Enable use of the extended instructions of the <FONT SIZE="-1">FT32B</FONT> processor.
|
|
<DT id="2522"><B>-mcompress</B><DD>
|
|
|
|
|
|
Compress all code using the Ft32B code compression scheme.
|
|
<DT id="2523"><B>-mnopm</B><DD>
|
|
|
|
|
|
Do not generate code that reads program memory.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>FRV</I></FONT><I> Options</I>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="2524"><B>-mgpr-32</B><DD>
|
|
|
|
|
|
Only use the first 32 general-purpose registers.
|
|
<DT id="2525"><B>-mgpr-64</B><DD>
|
|
|
|
|
|
Use all 64 general-purpose registers.
|
|
<DT id="2526"><B>-mfpr-32</B><DD>
|
|
|
|
|
|
Use only the first 32 floating-point registers.
|
|
<DT id="2527"><B>-mfpr-64</B><DD>
|
|
|
|
|
|
Use all 64 floating-point registers.
|
|
<DT id="2528"><B>-mhard-float</B><DD>
|
|
|
|
|
|
Use hardware instructions for floating-point operations.
|
|
<DT id="2529"><B>-msoft-float</B><DD>
|
|
|
|
|
|
Use library routines for floating-point operations.
|
|
<DT id="2530"><B>-malloc-cc</B><DD>
|
|
|
|
|
|
Dynamically allocate condition code registers.
|
|
<DT id="2531"><B>-mfixed-cc</B><DD>
|
|
|
|
|
|
Do not try to dynamically allocate condition code registers, only
|
|
use <TT>"icc0"</TT> and <TT>"fcc0"</TT>.
|
|
<DT id="2532"><B>-mdword</B><DD>
|
|
|
|
|
|
Change <FONT SIZE="-1">ABI</FONT> to use double word insns.
|
|
<DT id="2533"><B>-mno-dword</B><DD>
|
|
|
|
|
|
Do not use double word instructions.
|
|
<DT id="2534"><B>-mdouble</B><DD>
|
|
|
|
|
|
Use floating-point double instructions.
|
|
<DT id="2535"><B>-mno-double</B><DD>
|
|
|
|
|
|
Do not use floating-point double instructions.
|
|
<DT id="2536"><B>-mmedia</B><DD>
|
|
|
|
|
|
Use media instructions.
|
|
<DT id="2537"><B>-mno-media</B><DD>
|
|
|
|
|
|
Do not use media instructions.
|
|
<DT id="2538"><B>-mmuladd</B><DD>
|
|
|
|
|
|
Use multiply and add/subtract instructions.
|
|
<DT id="2539"><B>-mno-muladd</B><DD>
|
|
|
|
|
|
Do not use multiply and add/subtract instructions.
|
|
<DT id="2540"><B>-mfdpic</B><DD>
|
|
|
|
|
|
Select the <FONT SIZE="-1">FDPIC ABI,</FONT> which uses function descriptors to represent
|
|
pointers to functions. Without any PIC/PIE-related options, it
|
|
implies <B>-fPIE</B>. With <B>-fpic</B> or <B>-fpie</B>, it
|
|
assumes <FONT SIZE="-1">GOT</FONT> entries and small data are within a 12-bit range from the
|
|
<FONT SIZE="-1">GOT</FONT> base address; with <B>-fPIC</B> or <B>-fPIE</B>, <FONT SIZE="-1">GOT</FONT> offsets
|
|
are computed with 32 bits.
|
|
With a <B>bfin-elf</B> target, this option implies <B>-msim</B>.
|
|
<DT id="2541"><B>-minline-plt</B><DD>
|
|
|
|
|
|
Enable inlining of <FONT SIZE="-1">PLT</FONT> entries in function calls to functions that are
|
|
not known to bind locally. It has no effect without <B>-mfdpic</B>.
|
|
It's enabled by default if optimizing for speed and compiling for
|
|
shared libraries (i.e., <B>-fPIC</B> or <B>-fpic</B>), or when an
|
|
optimization option such as <B>-O3</B> or above is present in the
|
|
command line.
|
|
<DT id="2542"><B>-mTLS</B><DD>
|
|
|
|
|
|
Assume a large <FONT SIZE="-1">TLS</FONT> segment when generating thread-local code.
|
|
<DT id="2543"><B>-mtls</B><DD>
|
|
|
|
|
|
Do not assume a large <FONT SIZE="-1">TLS</FONT> segment when generating thread-local code.
|
|
<DT id="2544"><B>-mgprel-ro</B><DD>
|
|
|
|
|
|
Enable the use of <TT>"GPREL"</TT> relocations in the <FONT SIZE="-1">FDPIC ABI</FONT> for data
|
|
that is known to be in read-only sections. It's enabled by default,
|
|
except for <B>-fpic</B> or <B>-fpie</B>: even though it may help
|
|
make the global offset table smaller, it trades 1 instruction for 4.
|
|
With <B>-fPIC</B> or <B>-fPIE</B>, it trades 3 instructions for 4,
|
|
one of which may be shared by multiple symbols, and it avoids the need
|
|
for a <FONT SIZE="-1">GOT</FONT> entry for the referenced symbol, so it's more likely to be a
|
|
win. If it is not, <B>-mno-gprel-ro</B> can be used to disable it.
|
|
<DT id="2545"><B>-multilib-library-pic</B><DD>
|
|
|
|
|
|
Link with the (library, not <FONT SIZE="-1">FD</FONT>) pic libraries. It's implied by
|
|
<B>-mlibrary-pic</B>, as well as by <B>-fPIC</B> and
|
|
<B>-fpic</B> without <B>-mfdpic</B>. You should never have to use
|
|
it explicitly.
|
|
<DT id="2546"><B>-mlinked-fp</B><DD>
|
|
|
|
|
|
Follow the <FONT SIZE="-1">EABI</FONT> requirement of always creating a frame pointer whenever
|
|
a stack frame is allocated. This option is enabled by default and can
|
|
be disabled with <B>-mno-linked-fp</B>.
|
|
<DT id="2547"><B>-mlong-calls</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2548"><B>-malign-labels</B><DD>
|
|
|
|
|
|
Try to align labels to an 8-byte boundary by inserting NOPs into the
|
|
previous packet. This option only has an effect when <FONT SIZE="-1">VLIW</FONT> packing
|
|
is enabled. It doesn't create new packets; it merely adds NOPs to
|
|
existing ones.
|
|
<DT id="2549"><B>-mlibrary-pic</B><DD>
|
|
|
|
|
|
Generate position-independent <FONT SIZE="-1">EABI</FONT> code.
|
|
<DT id="2550"><B>-macc-4</B><DD>
|
|
|
|
|
|
Use only the first four media accumulator registers.
|
|
<DT id="2551"><B>-macc-8</B><DD>
|
|
|
|
|
|
Use all eight media accumulator registers.
|
|
<DT id="2552"><B>-mpack</B><DD>
|
|
|
|
|
|
Pack <FONT SIZE="-1">VLIW</FONT> instructions.
|
|
<DT id="2553"><B>-mno-pack</B><DD>
|
|
|
|
|
|
Do not pack <FONT SIZE="-1">VLIW</FONT> instructions.
|
|
<DT id="2554"><B>-mno-eflags</B><DD>
|
|
|
|
|
|
Do not mark <FONT SIZE="-1">ABI</FONT> switches in e_flags.
|
|
<DT id="2555"><B>-mcond-move</B><DD>
|
|
|
|
|
|
Enable the use of conditional-move instructions (default).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This switch is mainly for debugging the compiler and will likely be removed
|
|
in a future version.
|
|
<DT id="2556"><B>-mno-cond-move</B><DD>
|
|
|
|
|
|
Disable the use of conditional-move instructions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This switch is mainly for debugging the compiler and will likely be removed
|
|
in a future version.
|
|
<DT id="2557"><B>-mscc</B><DD>
|
|
|
|
|
|
Enable the use of conditional set instructions (default).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This switch is mainly for debugging the compiler and will likely be removed
|
|
in a future version.
|
|
<DT id="2558"><B>-mno-scc</B><DD>
|
|
|
|
|
|
Disable the use of conditional set instructions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This switch is mainly for debugging the compiler and will likely be removed
|
|
in a future version.
|
|
<DT id="2559"><B>-mcond-exec</B><DD>
|
|
|
|
|
|
Enable the use of conditional execution (default).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This switch is mainly for debugging the compiler and will likely be removed
|
|
in a future version.
|
|
<DT id="2560"><B>-mno-cond-exec</B><DD>
|
|
|
|
|
|
Disable the use of conditional execution.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This switch is mainly for debugging the compiler and will likely be removed
|
|
in a future version.
|
|
<DT id="2561"><B>-mvliw-branch</B><DD>
|
|
|
|
|
|
Run a pass to pack branches into <FONT SIZE="-1">VLIW</FONT> instructions (default).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This switch is mainly for debugging the compiler and will likely be removed
|
|
in a future version.
|
|
<DT id="2562"><B>-mno-vliw-branch</B><DD>
|
|
|
|
|
|
Do not run a pass to pack branches into <FONT SIZE="-1">VLIW</FONT> instructions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This switch is mainly for debugging the compiler and will likely be removed
|
|
in a future version.
|
|
<DT id="2563"><B>-mmulti-cond-exec</B><DD>
|
|
|
|
|
|
Enable optimization of <TT>"&&"</TT> and <TT>"||"</TT> in conditional execution
|
|
(default).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This switch is mainly for debugging the compiler and will likely be removed
|
|
in a future version.
|
|
<DT id="2564"><B>-mno-multi-cond-exec</B><DD>
|
|
|
|
|
|
Disable optimization of <TT>"&&"</TT> and <TT>"||"</TT> in conditional execution.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This switch is mainly for debugging the compiler and will likely be removed
|
|
in a future version.
|
|
<DT id="2565"><B>-mnested-cond-exec</B><DD>
|
|
|
|
|
|
Enable nested conditional execution optimizations (default).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This switch is mainly for debugging the compiler and will likely be removed
|
|
in a future version.
|
|
<DT id="2566"><B>-mno-nested-cond-exec</B><DD>
|
|
|
|
|
|
Disable nested conditional execution optimizations.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This switch is mainly for debugging the compiler and will likely be removed
|
|
in a future version.
|
|
<DT id="2567"><B>-moptimize-membar</B><DD>
|
|
|
|
|
|
This switch removes redundant <TT>"membar"</TT> instructions from the
|
|
compiler-generated code. It is enabled by default.
|
|
<DT id="2568"><B>-mno-optimize-membar</B><DD>
|
|
|
|
|
|
This switch disables the automatic removal of redundant <TT>"membar"</TT>
|
|
instructions from the generated code.
|
|
<DT id="2569"><B>-mtomcat-stats</B><DD>
|
|
|
|
|
|
Cause gas to print out tomcat statistics.
|
|
<DT id="2570"><B>-mcpu=</B><I>cpu</I><DD>
|
|
|
|
|
|
Select the processor type for which to generate code. Possible values are
|
|
<B>frv</B>, <B>fr550</B>, <B>tomcat</B>, <B>fr500</B>, <B>fr450</B>,
|
|
<B>fr405</B>, <B>fr400</B>, <B>fr300</B> and <B>simple</B>.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>GNU/Linux Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for GNU/Linux targets:
|
|
<DL COMPACT>
|
|
<DT id="2571"><B>-mglibc</B><DD>
|
|
|
|
|
|
Use the <FONT SIZE="-1">GNU C</FONT> library. This is the default except
|
|
on <B>*-*-linux-*uclibc*</B>, <B>*-*-linux-*musl*</B> and
|
|
<B>*-*-linux-*android*</B> targets.
|
|
<DT id="2572"><B>-muclibc</B><DD>
|
|
|
|
|
|
Use uClibc C library. This is the default on
|
|
<B>*-*-linux-*uclibc*</B> targets.
|
|
<DT id="2573"><B>-mmusl</B><DD>
|
|
|
|
|
|
Use the musl C library. This is the default on
|
|
<B>*-*-linux-*musl*</B> targets.
|
|
<DT id="2574"><B>-mbionic</B><DD>
|
|
|
|
|
|
Use Bionic C library. This is the default on
|
|
<B>*-*-linux-*android*</B> targets.
|
|
<DT id="2575"><B>-mandroid</B><DD>
|
|
|
|
|
|
Compile code compatible with Android platform. This is the default on
|
|
<B>*-*-linux-*android*</B> targets.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When compiling, this option enables <B>-mbionic</B>, <B>-fPIC</B>,
|
|
<B>-fno-exceptions</B> and <B>-fno-rtti</B> by default. When linking,
|
|
this option makes the <FONT SIZE="-1">GCC</FONT> driver pass Android-specific options to the linker.
|
|
Finally, this option causes the preprocessor macro <TT>"__ANDROID__"</TT>
|
|
to be defined.
|
|
<DT id="2576"><B>-tno-android-cc</B><DD>
|
|
|
|
|
|
Disable compilation effects of <B>-mandroid</B>, i.e., do not enable
|
|
<B>-mbionic</B>, <B>-fPIC</B>, <B>-fno-exceptions</B> and
|
|
<B>-fno-rtti</B> by default.
|
|
<DT id="2577"><B>-tno-android-ld</B><DD>
|
|
|
|
|
|
Disable linking effects of <B>-mandroid</B>, i.e., pass standard Linux
|
|
linking options to the linker.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>H8/300 Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for the H8/300 implementations:
|
|
<DL COMPACT>
|
|
<DT id="2578"><B>-mrelax</B><DD>
|
|
|
|
|
|
Shorten some address references at link time, when possible; uses the
|
|
linker option <B>-relax</B>.
|
|
<DT id="2579"><B>-mh</B><DD>
|
|
|
|
|
|
Generate code for the H8/300H.
|
|
<DT id="2580"><B>-ms</B><DD>
|
|
|
|
|
|
Generate code for the H8S.
|
|
<DT id="2581"><B>-mn</B><DD>
|
|
|
|
|
|
Generate code for the H8S and H8/300H in the normal mode. This switch
|
|
must be used either with <B>-mh</B> or <B>-ms</B>.
|
|
<DT id="2582"><B>-ms2600</B><DD>
|
|
|
|
|
|
Generate code for the H8S/2600. This switch must be used with <B>-ms</B>.
|
|
<DT id="2583"><B>-mexr</B><DD>
|
|
|
|
|
|
Extended registers are stored on stack before execution of function
|
|
with monitor attribute. Default option is <B>-mexr</B>.
|
|
This option is valid only for H8S targets.
|
|
<DT id="2584"><B>-mno-exr</B><DD>
|
|
|
|
|
|
Extended registers are not stored on stack before execution of function
|
|
with monitor attribute. Default option is <B>-mno-exr</B>.
|
|
This option is valid only for H8S targets.
|
|
<DT id="2585"><B>-mint32</B><DD>
|
|
|
|
|
|
Make <TT>"int"</TT> data 32 bits by default.
|
|
<DT id="2586"><B>-malign-300</B><DD>
|
|
|
|
|
|
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.
|
|
<B>-malign-300</B> causes them to be aligned on 2-byte boundaries.
|
|
This option has no effect on the H8/300.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>HPPA</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for the <FONT SIZE="-1">HPPA</FONT> family of computers:
|
|
<DL COMPACT>
|
|
<DT id="2587"><B>-march=</B><I>architecture-type</I><DD>
|
|
|
|
|
|
Generate code for the specified architecture. The choices for
|
|
<I>architecture-type</I> are <B>1.0</B> for <FONT SIZE="-1">PA 1.0,</FONT> <B>1.1</B> for <FONT SIZE="-1">PA
|
|
1.1,</FONT> and <B>2.0</B> for <FONT SIZE="-1">PA 2.0</FONT> processors. Refer to
|
|
<I>/usr/lib/sched.models</I> on an HP-UX system to determine the proper
|
|
architecture option for your machine. Code compiled for lower numbered
|
|
architectures runs on higher numbered architectures, but not the
|
|
other way around.
|
|
<DT id="2588"><B>-mpa-risc-1-0</B><DD>
|
|
|
|
|
|
|
|
<DT id="2589"><B>-mpa-risc-1-1</B><DD>
|
|
|
|
|
|
<DT id="2590"><B>-mpa-risc-2-0</B><DD>
|
|
|
|
|
|
|
|
Synonyms for <B>-march=1.0</B>, <B>-march=1.1</B>, and <B>-march=2.0</B> respectively.
|
|
<DT id="2591"><B>-mcaller-copies</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2592"><B>-mjump-in-delay</B><DD>
|
|
|
|
|
|
This option is ignored and provided for compatibility purposes only.
|
|
<DT id="2593"><B>-mdisable-fpregs</B><DD>
|
|
|
|
|
|
Prevent floating-point registers from being used in any manner. This is
|
|
necessary for compiling kernels that perform lazy context switching of
|
|
floating-point registers. If you use this option and attempt to perform
|
|
floating-point operations, the compiler aborts.
|
|
<DT id="2594"><B>-mdisable-indexing</B><DD>
|
|
|
|
|
|
Prevent the compiler from using indexing address modes. This avoids some
|
|
rather obscure problems when compiling <FONT SIZE="-1">MIG</FONT> generated code under <FONT SIZE="-1">MACH.</FONT>
|
|
<DT id="2595"><B>-mno-space-regs</B><DD>
|
|
|
|
|
|
Generate code that assumes the target has no space registers. This allows
|
|
<FONT SIZE="-1">GCC</FONT> to generate faster indirect calls and use unscaled index address modes.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Such code is suitable for level 0 <FONT SIZE="-1">PA</FONT> systems and kernels.
|
|
<DT id="2596"><B>-mfast-indirect-calls</B><DD>
|
|
|
|
|
|
Generate code that assumes calls never cross space boundaries. This
|
|
allows <FONT SIZE="-1">GCC</FONT> to emit code that performs faster indirect calls.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option does not work in the presence of shared libraries or nested
|
|
functions.
|
|
<DT id="2597"><B>-mfixed-range=</B><I>register-range</I><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2598"><B>-mlong-load-store</B><DD>
|
|
|
|
|
|
Generate 3-instruction load and store sequences as sometimes required by
|
|
the HP-UX 10 linker. This is equivalent to the <B>+k</B> option to
|
|
the <FONT SIZE="-1">HP</FONT> compilers.
|
|
<DT id="2599"><B>-mportable-runtime</B><DD>
|
|
|
|
|
|
Use the portable calling conventions proposed by <FONT SIZE="-1">HP</FONT> for <FONT SIZE="-1">ELF</FONT> systems.
|
|
<DT id="2600"><B>-mgas</B><DD>
|
|
|
|
|
|
Enable the use of assembler directives only <FONT SIZE="-1">GAS</FONT> understands.
|
|
<DT id="2601"><B>-mschedule=</B><I>cpu-type</I><DD>
|
|
|
|
|
|
Schedule code according to the constraints for the machine type
|
|
<I>cpu-type</I>. The choices for <I>cpu-type</I> are <B>700</B>
|
|
<B>7100</B>, <B>7100LC</B>, <B>7200</B>, <B>7300</B> and <B>8000</B>. Refer
|
|
to <I>/usr/lib/sched.models</I> on an HP-UX system to determine the
|
|
proper scheduling option for your machine. The default scheduling is
|
|
<B>8000</B>.
|
|
<DT id="2602"><B>-mlinker-opt</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2603"><B>-msoft-float</B><DD>
|
|
|
|
|
|
Generate output containing library calls for floating point.
|
|
<B>Warning:</B> the requisite libraries are not available for all <FONT SIZE="-1">HPPA</FONT>
|
|
targets. Normally the facilities of the machine's usual C compiler are
|
|
used, but this cannot be done directly in cross-compilation. You must make
|
|
your own arrangements to provide suitable library functions for
|
|
cross-compilation.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-msoft-float</B> changes the calling convention in the output file;
|
|
therefore, it is only useful if you compile <I>all</I> of a program with
|
|
this option. In particular, you need to compile <I>libgcc.a</I>, the
|
|
library that comes with <FONT SIZE="-1">GCC,</FONT> with <B>-msoft-float</B> in order for
|
|
this to work.
|
|
<DT id="2604"><B>-msio</B><DD>
|
|
|
|
|
|
Generate the predefine, <TT>"_SIO"</TT>, for server <FONT SIZE="-1">IO.</FONT> The default is
|
|
<B>-mwsio</B>. This generates the predefines, <TT>"__hp9000s700"</TT>,
|
|
<TT>"__hp9000s700__"</TT> and <TT>"_WSIO"</TT>, for workstation <FONT SIZE="-1">IO.</FONT> These
|
|
options are available under HP-UX and HI-UX.
|
|
<DT id="2605"><B>-mgnu-ld</B><DD>
|
|
|
|
|
|
Use options specific to <FONT SIZE="-1">GNU</FONT> <B>ld</B>.
|
|
This passes <B>-shared</B> to <B>ld</B> when
|
|
building a shared library. It is the default when <FONT SIZE="-1">GCC</FONT> is configured,
|
|
explicitly or implicitly, with the <FONT SIZE="-1">GNU</FONT> linker. This option does not
|
|
affect which <B>ld</B> is called; it only changes what parameters
|
|
are passed to that <B>ld</B>.
|
|
The <B>ld</B> that is called is determined by the
|
|
<B>--with-ld</B> configure option, <FONT SIZE="-1">GCC</FONT>'s program search path, and
|
|
finally by the user's <B></B><FONT SIZE="-1"><B>PATH</B></FONT><B></B>. The linker used by <FONT SIZE="-1">GCC</FONT> can be printed
|
|
using <B>which `gcc -print-prog-name=ld`</B>. This option is only available
|
|
on the 64-bit HP-UX <FONT SIZE="-1">GCC,</FONT> i.e. configured with <B>hppa*64*-*-hpux*</B>.
|
|
<DT id="2606"><B>-mhp-ld</B><DD>
|
|
|
|
|
|
Use options specific to <FONT SIZE="-1">HP</FONT> <B>ld</B>.
|
|
This passes <B>-b</B> to <B>ld</B> when building
|
|
a shared library and passes <B>+Accept TypeMismatch</B> to <B>ld</B> on all
|
|
links. It is the default when <FONT SIZE="-1">GCC</FONT> is configured, explicitly or
|
|
implicitly, with the <FONT SIZE="-1">HP</FONT> linker. This option does not affect
|
|
which <B>ld</B> is called; it only changes what parameters are passed to that
|
|
<B>ld</B>.
|
|
The <B>ld</B> that is called is determined by the <B>--with-ld</B>
|
|
configure option, <FONT SIZE="-1">GCC</FONT>'s program search path, and finally by the user's
|
|
<B></B><FONT SIZE="-1"><B>PATH</B></FONT><B></B>. The linker used by <FONT SIZE="-1">GCC</FONT> can be printed using <B>which
|
|
`gcc -print-prog-name=ld`</B>. This option is only available on the 64-bit
|
|
HP-UX <FONT SIZE="-1">GCC,</FONT> i.e. configured with <B>hppa*64*-*-hpux*</B>.
|
|
<DT id="2607"><B>-mlong-calls</B><DD>
|
|
|
|
|
|
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
|
|
of the function or translation unit, as the case may be, exceeds a
|
|
predefined limit set by the branch type being used. The limits for
|
|
normal calls are 7,600,000 and 240,000 bytes, respectively for the
|
|
<FONT SIZE="-1">PA 2.0</FONT> and <FONT SIZE="-1">PA 1.X</FONT> architectures. Sibcalls are always limited at
|
|
240,000 bytes.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Distances are measured from the beginning of functions when using the
|
|
<B>-ffunction-sections</B> option, or when using the <B>-mgas</B>
|
|
and <B>-mno-portable-runtime</B> options together under HP-UX with
|
|
the <FONT SIZE="-1">SOM</FONT> linker.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It is normally not desirable to use this option as it degrades
|
|
performance. However, it may be useful in large applications,
|
|
particularly when partial linking is used to build the application.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The types of long calls used depends on the capabilities of the
|
|
assembler and linker, and the type of code being generated. The
|
|
impact on systems that support long absolute calls, and long pic
|
|
symbol-difference or pc-relative calls should be relatively small.
|
|
However, an indirect call is used on 32-bit <FONT SIZE="-1">ELF</FONT> systems in pic code
|
|
and it is quite long.
|
|
<DT id="2608"><B>-munix=</B><I>unix-std</I><DD>
|
|
|
|
|
|
Generate compiler predefines and select a startfile for the specified
|
|
<FONT SIZE="-1">UNIX</FONT> standard. The choices for <I>unix-std</I> are <B>93</B>, <B>95</B>
|
|
and <B>98</B>. <B>93</B> is supported on all HP-UX versions. <B>95</B>
|
|
is available on HP-UX 10.10 and later. <B>98</B> is available on HP-UX
|
|
11.11 and later. The default values are <B>93</B> for HP-UX 10.00,
|
|
<B>95</B> for HP-UX 10.10 though to 11.00, and <B>98</B> for HP-UX 11.11
|
|
and later.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-munix=93</B> provides the same predefines as <FONT SIZE="-1">GCC 3.3</FONT> and 3.4.
|
|
<B>-munix=95</B> provides additional predefines for <TT>"XOPEN_UNIX"</TT>
|
|
and <TT>"_XOPEN_SOURCE_EXTENDED"</TT>, and the startfile <I>unix95.o</I>.
|
|
<B>-munix=98</B> provides additional predefines for <TT>"_XOPEN_UNIX"</TT>,
|
|
<TT>"_XOPEN_SOURCE_EXTENDED"</TT>, <TT>"_INCLUDE__STDC_A1_SOURCE"</TT> and
|
|
<TT>"_INCLUDE_XOPEN_SOURCE_500"</TT>, and the startfile <I>unix98.o</I>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It is <I>important</I> to note that this option changes the interfaces
|
|
for various library routines. It also affects the operational behavior
|
|
of the C library. Thus, <I>extreme</I> care is needed in using this
|
|
option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Library code that is intended to operate with more than one <FONT SIZE="-1">UNIX</FONT>
|
|
standard must test, set and restore the variable <TT>"__xpg4_extended_mask"</TT>
|
|
as appropriate. Most <FONT SIZE="-1">GNU</FONT> software doesn't provide this capability.
|
|
<DT id="2609"><B>-nolibdld</B><DD>
|
|
|
|
|
|
Suppress the generation of link options to search libdld.sl when the
|
|
<B>-static</B> option is specified on HP-UX 10 and later.
|
|
<DT id="2610"><B>-static</B><DD>
|
|
|
|
|
|
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 <B>-static</B> option is specified, special link options
|
|
are needed to resolve this dependency.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On HP-UX 10 and later, the <FONT SIZE="-1">GCC</FONT> driver adds the necessary options to
|
|
link with libdld.sl when the <B>-static</B> option is specified.
|
|
This causes the resulting binary to be dynamic. On the 64-bit port,
|
|
the linkers generate dynamic binaries by default in any case. The
|
|
<B>-nolibdld</B> option can be used to prevent the <FONT SIZE="-1">GCC</FONT> driver from
|
|
adding these link options.
|
|
<DT id="2611"><B>-threads</B><DD>
|
|
|
|
|
|
Add support for multithreading with the <I>dce thread</I> library
|
|
under HP-UX. This option sets flags for both the preprocessor and
|
|
linker.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>IA-64</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These are the <B>-m</B> options defined for the Intel <FONT SIZE="-1">IA-64</FONT> architecture.
|
|
<DL COMPACT>
|
|
<DT id="2612"><B>-mbig-endian</B><DD>
|
|
|
|
|
|
Generate code for a big-endian target. This is the default for HP-UX.
|
|
<DT id="2613"><B>-mlittle-endian</B><DD>
|
|
|
|
|
|
Generate code for a little-endian target. This is the default for <FONT SIZE="-1">AIX5</FONT>
|
|
and GNU/Linux.
|
|
<DT id="2614"><B>-mgnu-as</B><DD>
|
|
|
|
|
|
|
|
<DT id="2615"><B>-mno-gnu-as</B><DD>
|
|
|
|
|
|
|
|
Generate (or don't) code for the <FONT SIZE="-1">GNU</FONT> assembler. This is the default.
|
|
<DT id="2616"><B>-mgnu-ld</B><DD>
|
|
|
|
|
|
|
|
<DT id="2617"><B>-mno-gnu-ld</B><DD>
|
|
|
|
|
|
|
|
Generate (or don't) code for the <FONT SIZE="-1">GNU</FONT> linker. This is the default.
|
|
<DT id="2618"><B>-mno-pic</B><DD>
|
|
|
|
|
|
Generate code that does not use a global pointer register. The result
|
|
is not position independent code, and violates the <FONT SIZE="-1">IA-64 ABI.</FONT>
|
|
<DT id="2619"><B>-mvolatile-asm-stop</B><DD>
|
|
|
|
|
|
|
|
<DT id="2620"><B>-mno-volatile-asm-stop</B><DD>
|
|
|
|
|
|
|
|
Generate (or don't) a stop bit immediately before and after volatile asm
|
|
statements.
|
|
<DT id="2621"><B>-mregister-names</B><DD>
|
|
|
|
|
|
|
|
<DT id="2622"><B>-mno-register-names</B><DD>
|
|
|
|
|
|
|
|
Generate (or don't) <B>in</B>, <B>loc</B>, and <B>out</B> register names for
|
|
the stacked registers. This may make assembler output more readable.
|
|
<DT id="2623"><B>-mno-sdata</B><DD>
|
|
|
|
|
|
|
|
<DT id="2624"><B>-msdata</B><DD>
|
|
|
|
|
|
|
|
Disable (or enable) optimizations that use the small data section. This may
|
|
be useful for working around optimizer bugs.
|
|
<DT id="2625"><B>-mconstant-gp</B><DD>
|
|
|
|
|
|
Generate code that uses a single constant global pointer value. This is
|
|
useful when compiling kernel code.
|
|
<DT id="2626"><B>-mauto-pic</B><DD>
|
|
|
|
|
|
Generate code that is self-relocatable. This implies <B>-mconstant-gp</B>.
|
|
This is useful when compiling firmware code.
|
|
<DT id="2627"><B>-minline-float-divide-min-latency</B><DD>
|
|
|
|
|
|
Generate code for inline divides of floating-point values
|
|
using the minimum latency algorithm.
|
|
<DT id="2628"><B>-minline-float-divide-max-throughput</B><DD>
|
|
|
|
|
|
Generate code for inline divides of floating-point values
|
|
using the maximum throughput algorithm.
|
|
<DT id="2629"><B>-mno-inline-float-divide</B><DD>
|
|
|
|
|
|
Do not generate inline code for divides of floating-point values.
|
|
<DT id="2630"><B>-minline-int-divide-min-latency</B><DD>
|
|
|
|
|
|
Generate code for inline divides of integer values
|
|
using the minimum latency algorithm.
|
|
<DT id="2631"><B>-minline-int-divide-max-throughput</B><DD>
|
|
|
|
|
|
Generate code for inline divides of integer values
|
|
using the maximum throughput algorithm.
|
|
<DT id="2632"><B>-mno-inline-int-divide</B><DD>
|
|
|
|
|
|
Do not generate inline code for divides of integer values.
|
|
<DT id="2633"><B>-minline-sqrt-min-latency</B><DD>
|
|
|
|
|
|
Generate code for inline square roots
|
|
using the minimum latency algorithm.
|
|
<DT id="2634"><B>-minline-sqrt-max-throughput</B><DD>
|
|
|
|
|
|
Generate code for inline square roots
|
|
using the maximum throughput algorithm.
|
|
<DT id="2635"><B>-mno-inline-sqrt</B><DD>
|
|
|
|
|
|
Do not generate inline code for <TT>"sqrt"</TT>.
|
|
<DT id="2636"><B>-mfused-madd</B><DD>
|
|
|
|
|
|
|
|
<DT id="2637"><B>-mno-fused-madd</B><DD>
|
|
|
|
|
|
|
|
Do (don't) generate code that uses the fused multiply/add or multiply/subtract
|
|
instructions. The default is to use these instructions.
|
|
<DT id="2638"><B>-mno-dwarf2-asm</B><DD>
|
|
|
|
|
|
|
|
<DT id="2639"><B>-mdwarf2-asm</B><DD>
|
|
|
|
|
|
|
|
Don't (or do) generate assembler code for the <FONT SIZE="-1">DWARF</FONT> line number debugging
|
|
info. This may be useful when not using the <FONT SIZE="-1">GNU</FONT> assembler.
|
|
<DT id="2640"><B>-mearly-stop-bits</B><DD>
|
|
|
|
|
|
|
|
<DT id="2641"><B>-mno-early-stop-bits</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="2642"><B>-mfixed-range=</B><I>register-range</I><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2643"><B>-mtls-size=</B><I>tls-size</I><DD>
|
|
|
|
|
|
Specify bit size of immediate <FONT SIZE="-1">TLS</FONT> offsets. Valid values are 14, 22, and
|
|
64.
|
|
<DT id="2644"><B>-mtune=</B><I>cpu-type</I><DD>
|
|
|
|
|
|
Tune the instruction scheduling for a particular <FONT SIZE="-1">CPU,</FONT> Valid values are
|
|
<B>itanium</B>, <B>itanium1</B>, <B>merced</B>, <B>itanium2</B>,
|
|
and <B>mckinley</B>.
|
|
<DT id="2645"><B>-milp32</B><DD>
|
|
|
|
|
|
|
|
<DT id="2646"><B>-mlp64</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="2647"><B>-mno-sched-br-data-spec</B><DD>
|
|
|
|
|
|
|
|
<DT id="2648"><B>-msched-br-data-spec</B><DD>
|
|
|
|
|
|
|
|
(Dis/En)able data speculative scheduling before reload.
|
|
This results in generation of <TT>"ld.a"</TT> instructions and
|
|
the corresponding check instructions (<TT>"ld.c"</TT> / <TT>"chk.a"</TT>).
|
|
The default setting is disabled.
|
|
<DT id="2649"><B>-msched-ar-data-spec</B><DD>
|
|
|
|
|
|
|
|
<DT id="2650"><B>-mno-sched-ar-data-spec</B><DD>
|
|
|
|
|
|
|
|
(En/Dis)able data speculative scheduling after reload.
|
|
This results in generation of <TT>"ld.a"</TT> instructions and
|
|
the corresponding check instructions (<TT>"ld.c"</TT> / <TT>"chk.a"</TT>).
|
|
The default setting is enabled.
|
|
<DT id="2651"><B>-mno-sched-control-spec</B><DD>
|
|
|
|
|
|
|
|
<DT id="2652"><B>-msched-control-spec</B><DD>
|
|
|
|
|
|
|
|
(Dis/En)able control speculative scheduling. This feature is
|
|
available only during region scheduling (i.e. before reload).
|
|
This results in generation of the <TT>"ld.s"</TT> instructions and
|
|
the corresponding check instructions <TT>"chk.s"</TT>.
|
|
The default setting is disabled.
|
|
<DT id="2653"><B>-msched-br-in-data-spec</B><DD>
|
|
|
|
|
|
|
|
<DT id="2654"><B>-mno-sched-br-in-data-spec</B><DD>
|
|
|
|
|
|
|
|
(En/Dis)able speculative scheduling of the instructions that
|
|
are dependent on the data speculative loads before reload.
|
|
This is effective only with <B>-msched-br-data-spec</B> enabled.
|
|
The default setting is enabled.
|
|
<DT id="2655"><B>-msched-ar-in-data-spec</B><DD>
|
|
|
|
|
|
|
|
<DT id="2656"><B>-mno-sched-ar-in-data-spec</B><DD>
|
|
|
|
|
|
|
|
(En/Dis)able speculative scheduling of the instructions that
|
|
are dependent on the data speculative loads after reload.
|
|
This is effective only with <B>-msched-ar-data-spec</B> enabled.
|
|
The default setting is enabled.
|
|
<DT id="2657"><B>-msched-in-control-spec</B><DD>
|
|
|
|
|
|
|
|
<DT id="2658"><B>-mno-sched-in-control-spec</B><DD>
|
|
|
|
|
|
|
|
(En/Dis)able speculative scheduling of the instructions that
|
|
are dependent on the control speculative loads.
|
|
This is effective only with <B>-msched-control-spec</B> enabled.
|
|
The default setting is enabled.
|
|
<DT id="2659"><B>-mno-sched-prefer-non-data-spec-insns</B><DD>
|
|
|
|
|
|
|
|
<DT id="2660"><B>-msched-prefer-non-data-spec-insns</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="2661"><B>-mno-sched-prefer-non-control-spec-insns</B><DD>
|
|
|
|
|
|
|
|
<DT id="2662"><B>-msched-prefer-non-control-spec-insns</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="2663"><B>-mno-sched-count-spec-in-critical-path</B><DD>
|
|
|
|
|
|
|
|
<DT id="2664"><B>-msched-count-spec-in-critical-path</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="2665"><B>-msched-spec-ldc</B><DD>
|
|
|
|
|
|
Use a simple data speculation check. This option is on by default.
|
|
<DT id="2666"><B>-msched-control-spec-ldc</B><DD>
|
|
|
|
|
|
Use a simple check for control speculation. This option is on by default.
|
|
<DT id="2667"><B>-msched-stop-bits-after-every-cycle</B><DD>
|
|
|
|
|
|
Place a stop bit after every cycle when scheduling. This option is on
|
|
by default.
|
|
<DT id="2668"><B>-msched-fp-mem-deps-zero-cost</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2669"><B>-msel-sched-dont-check-control-spec</B><DD>
|
|
|
|
|
|
Generate checks for control speculation in selective scheduling.
|
|
This flag is disabled by default.
|
|
<DT id="2670"><B>-msched-max-memory-insns=</B><I>max-insns</I><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2671"><B>-msched-max-memory-insns-hard-limit</B><DD>
|
|
|
|
|
|
Makes the limit specified by <B>msched-max-memory-insns</B> a hard limit,
|
|
disallowing more than that number in an instruction group.
|
|
Otherwise, the limit is ``soft'', meaning that non-memory operations
|
|
are preferred when the limit is reached, but memory operations may still
|
|
be scheduled.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>LM32</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for the LatticeMico32 architecture:
|
|
<DL COMPACT>
|
|
<DT id="2672"><B>-mbarrel-shift-enabled</B><DD>
|
|
|
|
|
|
Enable barrel-shift instructions.
|
|
<DT id="2673"><B>-mdivide-enabled</B><DD>
|
|
|
|
|
|
Enable divide and modulus instructions.
|
|
<DT id="2674"><B>-mmultiply-enabled</B><DD>
|
|
|
|
|
|
Enable multiply instructions.
|
|
<DT id="2675"><B>-msign-extend-enabled</B><DD>
|
|
|
|
|
|
Enable sign extend instructions.
|
|
<DT id="2676"><B>-muser-enabled</B><DD>
|
|
|
|
|
|
Enable user-defined instructions.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>M32C Options</I>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="2677"><B>-mcpu=</B><I>name</I><DD>
|
|
|
|
|
|
Select the <FONT SIZE="-1">CPU</FONT> for which code is generated. <I>name</I> may be one of
|
|
<B>r8c</B> for the R8C/Tiny series, <B>m16c</B> for the M16C (up to
|
|
/60) series, <B>m32cm</B> for the M16C/80 series, or <B>m32c</B> for
|
|
the M32C/80 series.
|
|
<DT id="2678"><B>-msim</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2679"><B>-memregs=</B><I>number</I><DD>
|
|
|
|
|
|
Specifies the number of memory-based pseudo-registers <FONT SIZE="-1">GCC</FONT> uses
|
|
during code generation. These pseudo-registers are used like real
|
|
registers, so there is a tradeoff between <FONT SIZE="-1">GCC</FONT>'s ability to fit the
|
|
code into available registers, and the performance penalty of using
|
|
memory instead of registers. Note that all modules in a program must
|
|
be compiled with the same value for this option. Because of that, you
|
|
must not use this option with <FONT SIZE="-1">GCC</FONT>'s default runtime libraries.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>M32R/D Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for Renesas M32R/D architectures:
|
|
<DL COMPACT>
|
|
<DT id="2680"><B>-m32r2</B><DD>
|
|
|
|
|
|
Generate code for the M32R/2.
|
|
<DT id="2681"><B>-m32rx</B><DD>
|
|
|
|
|
|
Generate code for the M32R/X.
|
|
<DT id="2682"><B>-m32r</B><DD>
|
|
|
|
|
|
Generate code for the M32R. This is the default.
|
|
<DT id="2683"><B>-mmodel=small</B><DD>
|
|
|
|
|
|
Assume all objects live in the lower 16MB of memory (so that their addresses
|
|
can be loaded with the <TT>"ld24"</TT> instruction), and assume all subroutines
|
|
are reachable with the <TT>"bl"</TT> instruction.
|
|
This is the default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The addressability of a particular object can be set with the
|
|
<TT>"model"</TT> attribute.
|
|
<DT id="2684"><B>-mmodel=medium</B><DD>
|
|
|
|
|
|
Assume objects may be anywhere in the 32-bit address space (the compiler
|
|
generates <TT>"seth/add3"</TT> instructions to load their addresses), and
|
|
assume all subroutines are reachable with the <TT>"bl"</TT> instruction.
|
|
<DT id="2685"><B>-mmodel=large</B><DD>
|
|
|
|
|
|
Assume objects may be anywhere in the 32-bit address space (the compiler
|
|
generates <TT>"seth/add3"</TT> instructions to load their addresses), and
|
|
assume subroutines may not be reachable with the <TT>"bl"</TT> instruction
|
|
(the compiler generates the much slower <TT>"seth/add3/jl"</TT>
|
|
instruction sequence).
|
|
<DT id="2686"><B>-msdata=none</B><DD>
|
|
|
|
|
|
Disable use of the small data area. Variables are put into
|
|
one of <TT>".data"</TT>, <TT>".bss"</TT>, or <TT>".rodata"</TT> (unless the
|
|
<TT>"section"</TT> attribute has been specified).
|
|
This is the default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The small data area consists of sections <TT>".sdata"</TT> and <TT>".sbss"</TT>.
|
|
Objects may be explicitly put in the small data area with the
|
|
<TT>"section"</TT> attribute using one of these sections.
|
|
<DT id="2687"><B>-msdata=sdata</B><DD>
|
|
|
|
|
|
Put small global and static data in the small data area, but do not
|
|
generate special code to reference them.
|
|
<DT id="2688"><B>-msdata=use</B><DD>
|
|
|
|
|
|
Put small global and static data in the small data area, and generate
|
|
special instructions to reference them.
|
|
<DT id="2689"><B>-G</B> <I>num</I><DD>
|
|
|
|
|
|
Put global and static objects less than or equal to <I>num</I> bytes
|
|
into the small data or <FONT SIZE="-1">BSS</FONT> sections instead of the normal data or <FONT SIZE="-1">BSS</FONT>
|
|
sections. The default value of <I>num</I> is 8.
|
|
The <B>-msdata</B> option must be set to one of <B>sdata</B> or <B>use</B>
|
|
for this option to have any effect.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
All modules should be compiled with the same <B>-G</B> <I>num</I> value.
|
|
Compiling with different values of <I>num</I> may or may not work; if it
|
|
doesn't the linker gives an error message---incorrect code is not
|
|
generated.
|
|
<DT id="2690"><B>-mdebug</B><DD>
|
|
|
|
|
|
Makes the M32R-specific code in the compiler display some statistics
|
|
that might help in debugging programs.
|
|
<DT id="2691"><B>-malign-loops</B><DD>
|
|
|
|
|
|
Align all loops to a 32-byte boundary.
|
|
<DT id="2692"><B>-mno-align-loops</B><DD>
|
|
|
|
|
|
Do not enforce a 32-byte alignment for loops. This is the default.
|
|
<DT id="2693"><B>-missue-rate=</B><I>number</I><DD>
|
|
|
|
|
|
Issue <I>number</I> instructions per cycle. <I>number</I> can only be 1
|
|
or 2.
|
|
<DT id="2694"><B>-mbranch-cost=</B><I>number</I><DD>
|
|
|
|
|
|
<I>number</I> 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.
|
|
<DT id="2695"><B>-mflush-trap=</B><I>number</I><DD>
|
|
|
|
|
|
Specifies the trap number to use to flush the cache. The default is
|
|
12. Valid numbers are between 0 and 15 inclusive.
|
|
<DT id="2696"><B>-mno-flush-trap</B><DD>
|
|
|
|
|
|
Specifies that the cache cannot be flushed by using a trap.
|
|
<DT id="2697"><B>-mflush-func=</B><I>name</I><DD>
|
|
|
|
|
|
Specifies the name of the operating system function to call to flush
|
|
the cache. The default is <B>_flush_cache</B>, but a function call
|
|
is only used if a trap is not available.
|
|
<DT id="2698"><B>-mno-flush-func</B><DD>
|
|
|
|
|
|
Indicates that there is no <FONT SIZE="-1">OS</FONT> function for flushing the cache.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>M680x0 Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These are the <B>-m</B> options defined for M680x0 and ColdFire processors.
|
|
The default settings depend on which architecture was selected when
|
|
the compiler was configured; the defaults for the most common choices
|
|
are given below.
|
|
<DL COMPACT>
|
|
<DT id="2699"><B>-march=</B><I>arch</I><DD>
|
|
|
|
|
|
Generate code for a specific M680x0 or ColdFire instruction set
|
|
architecture. Permissible values of <I>arch</I> for M680x0
|
|
architectures are: <B>68000</B>, <B>68010</B>, <B>68020</B>,
|
|
<B>68030</B>, <B>68040</B>, <B>68060</B> and <B>cpu32</B>. ColdFire
|
|
architectures are selected according to Freescale's <FONT SIZE="-1">ISA</FONT> classification
|
|
and the permissible values are: <B>isaa</B>, <B>isaaplus</B>,
|
|
<B>isab</B> and <B>isac</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> defines a macro <TT>"__mcf</TT>arch<TT>__"</TT> whenever it is generating
|
|
code for a ColdFire target. The <I>arch</I> in this macro is one of the
|
|
<B>-march</B> arguments given above.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When used together, <B>-march</B> and <B>-mtune</B> select code
|
|
that runs on a family of similar processors but that is optimized
|
|
for a particular microarchitecture.
|
|
<DT id="2700"><B>-mcpu=</B><I>cpu</I><DD>
|
|
|
|
|
|
Generate code for a specific M680x0 or ColdFire processor.
|
|
The M680x0 <I>cpu</I>s are: <B>68000</B>, <B>68010</B>, <B>68020</B>,
|
|
<B>68030</B>, <B>68040</B>, <B>68060</B>, <B>68302</B>, <B>68332</B>
|
|
and <B>cpu32</B>. The ColdFire <I>cpu</I>s are given by the table
|
|
below, which also classifies the CPUs into families:
|
|
<DL COMPACT><DT id="2701"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2702">Family : <B>-mcpu</B> arguments<DD>
|
|
|
|
|
|
|
|
<DT id="2703"><B>51</B> : <B>51</B> <B>51ac</B> <B>51ag</B> <B>51cn</B> <B>51em</B> <B>51je</B> <B>51jf</B> <B>51jg</B> <B>51jm</B> <B>51mm</B> <B>51qe</B> <B>51qm</B><DD>
|
|
|
|
|
|
<DT id="2704"><B>5206</B> : <B>5202</B> <B>5204</B> <B>5206</B><DD>
|
|
|
|
|
|
<DT id="2705"><B>5206e</B> : <B>5206e</B><DD>
|
|
|
|
|
|
<DT id="2706"><B>5208</B> : <B>5207</B> <B>5208</B><DD>
|
|
|
|
|
|
<DT id="2707"><B>5211a</B> : <B>5210a</B> <B>5211a</B><DD>
|
|
|
|
|
|
<DT id="2708"><B>5213</B> : <B>5211</B> <B>5212</B> <B>5213</B><DD>
|
|
|
|
|
|
<DT id="2709"><B>5216</B> : <B>5214</B> <B>5216</B><DD>
|
|
|
|
|
|
<DT id="2710"><B>52235</B> : <B>52230</B> <B>52231</B> <B>52232</B> <B>52233</B> <B>52234</B> <B>52235</B><DD>
|
|
|
|
|
|
<DT id="2711"><B>5225</B> : <B>5224</B> <B>5225</B><DD>
|
|
|
|
|
|
<DT id="2712"><B>52259</B> : <B>52252</B> <B>52254</B> <B>52255</B> <B>52256</B> <B>52258</B> <B>52259</B><DD>
|
|
|
|
|
|
<DT id="2713"><B>5235</B> : <B>5232</B> <B>5233</B> <B>5234</B> <B>5235</B> <B>523x</B><DD>
|
|
|
|
|
|
<DT id="2714"><B>5249</B> : <B>5249</B><DD>
|
|
|
|
|
|
<DT id="2715"><B>5250</B> : <B>5250</B><DD>
|
|
|
|
|
|
<DT id="2716"><B>5271</B> : <B>5270</B> <B>5271</B><DD>
|
|
|
|
|
|
<DT id="2717"><B>5272</B> : <B>5272</B><DD>
|
|
|
|
|
|
<DT id="2718"><B>5275</B> : <B>5274</B> <B>5275</B><DD>
|
|
|
|
|
|
<DT id="2719"><B>5282</B> : <B>5280</B> <B>5281</B> <B>5282</B> <B>528x</B><DD>
|
|
|
|
|
|
<DT id="2720"><B>53017</B> : <B>53011</B> <B>53012</B> <B>53013</B> <B>53014</B> <B>53015</B> <B>53016</B> <B>53017</B><DD>
|
|
|
|
|
|
<DT id="2721"><B>5307</B> : <B>5307</B><DD>
|
|
|
|
|
|
<DT id="2722"><B>5329</B> : <B>5327</B> <B>5328</B> <B>5329</B> <B>532x</B><DD>
|
|
|
|
|
|
<DT id="2723"><B>5373</B> : <B>5372</B> <B>5373</B> <B>537x</B><DD>
|
|
|
|
|
|
<DT id="2724"><B>5407</B> : <B>5407</B><DD>
|
|
|
|
|
|
<DT id="2725"><B>5475</B> : <B>5470</B> <B>5471</B> <B>5472</B> <B>5473</B> <B>5474</B> <B>5475</B> <B>547x</B> <B>5480</B> <B>5481</B> <B>5482</B> <B>5483</B> <B>5484</B> <B>5485</B><DD>
|
|
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2726"><DD>
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mcpu=</B><I>cpu</I> overrides <B>-march=</B><I>arch</I> if
|
|
<I>arch</I> is compatible with <I>cpu</I>. Other combinations of
|
|
<B>-mcpu</B> and <B>-march</B> are rejected.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> defines the macro <TT>"__mcf_cpu_</TT>cpu<TT>"</TT> when ColdFire target
|
|
<I>cpu</I> is selected. It also defines <TT>"__mcf_family_</TT>family<TT>"</TT>,
|
|
where the value of <I>family</I> is given by the table above.
|
|
</DL>
|
|
|
|
<DT id="2727"><B>-mtune=</B><I>tune</I><DD>
|
|
|
|
|
|
Tune the code for a particular microarchitecture within the
|
|
constraints set by <B>-march</B> and <B>-mcpu</B>.
|
|
The M680x0 microarchitectures are: <B>68000</B>, <B>68010</B>,
|
|
<B>68020</B>, <B>68030</B>, <B>68040</B>, <B>68060</B>
|
|
and <B>cpu32</B>. The ColdFire microarchitectures
|
|
are: <B>cfv1</B>, <B>cfv2</B>, <B>cfv3</B>, <B>cfv4</B> and <B>cfv4e</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can also use <B>-mtune=68020-40</B> for code that needs
|
|
to run relatively well on 68020, 68030 and 68040 targets.
|
|
<B>-mtune=68020-60</B> is similar but includes 68060 targets
|
|
as well. These two options select the same tuning decisions as
|
|
<B>-m68020-40</B> and <B>-m68020-60</B> respectively.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> defines the macros <TT>"__mc</TT>arch<TT>"</TT> and <TT>"__mc</TT>arch<TT>__"</TT>
|
|
when tuning for 680x0 architecture <I>arch</I>. It also defines
|
|
<TT>"mc</TT>arch<TT>"</TT> unless either <B>-ansi</B> or a non-GNU <B>-std</B>
|
|
option is used. If <FONT SIZE="-1">GCC</FONT> is tuning for a range of architectures,
|
|
as selected by <B>-mtune=68020-40</B> or <B>-mtune=68020-60</B>,
|
|
it defines the macros for every architecture in the range.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> also defines the macro <TT>"__m</TT>uarch<TT>__"</TT> when tuning for
|
|
ColdFire microarchitecture <I>uarch</I>, where <I>uarch</I> is one
|
|
of the arguments given above.
|
|
<DT id="2728"><B>-m68000</B><DD>
|
|
|
|
|
|
|
|
<DT id="2729"><B>-mc68000</B><DD>
|
|
|
|
|
|
|
|
Generate output for a 68000. This is the default
|
|
when the compiler is configured for 68000-based systems.
|
|
It is equivalent to <B>-march=68000</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Use this option for microcontrollers with a 68000 or <FONT SIZE="-1">EC000</FONT> core,
|
|
including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
|
|
<DT id="2730"><B>-m68010</B><DD>
|
|
|
|
|
|
Generate output for a 68010. This is the default
|
|
when the compiler is configured for 68010-based systems.
|
|
It is equivalent to <B>-march=68010</B>.
|
|
<DT id="2731"><B>-m68020</B><DD>
|
|
|
|
|
|
|
|
<DT id="2732"><B>-mc68020</B><DD>
|
|
|
|
|
|
|
|
Generate output for a 68020. This is the default
|
|
when the compiler is configured for 68020-based systems.
|
|
It is equivalent to <B>-march=68020</B>.
|
|
<DT id="2733"><B>-m68030</B><DD>
|
|
|
|
|
|
Generate output for a 68030. This is the default when the compiler is
|
|
configured for 68030-based systems. It is equivalent to
|
|
<B>-march=68030</B>.
|
|
<DT id="2734"><B>-m68040</B><DD>
|
|
|
|
|
|
Generate output for a 68040. This is the default when the compiler is
|
|
configured for 68040-based systems. It is equivalent to
|
|
<B>-march=68040</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option inhibits the use of 68881/68882 instructions that have to be
|
|
emulated by software on the 68040. Use this option if your 68040 does not
|
|
have code to emulate those instructions.
|
|
<DT id="2735"><B>-m68060</B><DD>
|
|
|
|
|
|
Generate output for a 68060. This is the default when the compiler is
|
|
configured for 68060-based systems. It is equivalent to
|
|
<B>-march=68060</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option inhibits the use of 68020 and 68881/68882 instructions that
|
|
have to be emulated by software on the 68060. Use this option if your 68060
|
|
does not have code to emulate those instructions.
|
|
<DT id="2736"><B>-mcpu32</B><DD>
|
|
|
|
|
|
Generate output for a <FONT SIZE="-1">CPU32.</FONT> This is the default
|
|
when the compiler is configured for CPU32-based systems.
|
|
It is equivalent to <B>-march=cpu32</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Use this option for microcontrollers with a
|
|
<FONT SIZE="-1">CPU32</FONT> or <FONT SIZE="-1">CPU32+</FONT> core, including the 68330, 68331, 68332, 68333, 68334,
|
|
68336, 68340, 68341, 68349 and 68360.
|
|
<DT id="2737"><B>-m5200</B><DD>
|
|
|
|
|
|
Generate output for a 520X ColdFire <FONT SIZE="-1">CPU.</FONT> This is the default
|
|
when the compiler is configured for 520X-based systems.
|
|
It is equivalent to <B>-mcpu=5206</B>, and is now deprecated
|
|
in favor of that option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Use this option for microcontroller with a 5200 core, including
|
|
the <FONT SIZE="-1">MCF5202, MCF5203, MCF5204</FONT> and <FONT SIZE="-1">MCF5206.</FONT>
|
|
<DT id="2738"><B>-m5206e</B><DD>
|
|
|
|
|
|
Generate output for a 5206e ColdFire <FONT SIZE="-1">CPU.</FONT> The option is now
|
|
deprecated in favor of the equivalent <B>-mcpu=5206e</B>.
|
|
<DT id="2739"><B>-m528x</B><DD>
|
|
|
|
|
|
Generate output for a member of the ColdFire 528X family.
|
|
The option is now deprecated in favor of the equivalent
|
|
<B>-mcpu=528x</B>.
|
|
<DT id="2740"><B>-m5307</B><DD>
|
|
|
|
|
|
Generate output for a ColdFire 5307 <FONT SIZE="-1">CPU.</FONT> The option is now deprecated
|
|
in favor of the equivalent <B>-mcpu=5307</B>.
|
|
<DT id="2741"><B>-m5407</B><DD>
|
|
|
|
|
|
Generate output for a ColdFire 5407 <FONT SIZE="-1">CPU.</FONT> The option is now deprecated
|
|
in favor of the equivalent <B>-mcpu=5407</B>.
|
|
<DT id="2742"><B>-mcfv4e</B><DD>
|
|
|
|
|
|
Generate output for a ColdFire V4e family <FONT SIZE="-1">CPU</FONT> (e.g. 547x/548x).
|
|
This includes use of hardware floating-point instructions.
|
|
The option is equivalent to <B>-mcpu=547x</B>, and is now
|
|
deprecated in favor of that option.
|
|
<DT id="2743"><B>-m68020-40</B><DD>
|
|
|
|
|
|
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
|
|
68881 instructions that are emulated on the 68040.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The option is equivalent to <B>-march=68020</B> <B>-mtune=68020-40</B>.
|
|
<DT id="2744"><B>-m68020-60</B><DD>
|
|
|
|
|
|
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
|
|
68881 instructions that are emulated on the 68060.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The option is equivalent to <B>-march=68020</B> <B>-mtune=68020-60</B>.
|
|
<DT id="2745"><B>-mhard-float</B><DD>
|
|
|
|
|
|
|
|
<DT id="2746"><B>-m68881</B><DD>
|
|
|
|
|
|
|
|
Generate floating-point instructions. This is the default for 68020
|
|
and above, and for ColdFire devices that have an <FONT SIZE="-1">FPU.</FONT> It defines the
|
|
macro <TT>"__HAVE_68881__"</TT> on M680x0 targets and <TT>"__mcffpu__"</TT>
|
|
on ColdFire targets.
|
|
<DT id="2747"><B>-msoft-float</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">FPU.</FONT>
|
|
<DT id="2748"><B>-mdiv</B><DD>
|
|
|
|
|
|
|
|
<DT id="2749"><B>-mno-div</B><DD>
|
|
|
|
|
|
|
|
Generate (do not generate) ColdFire hardware divide and remainder
|
|
instructions. If <B>-march</B> is used without <B>-mcpu</B>,
|
|
the default is ``on'' for ColdFire architectures and ``off'' for M680x0
|
|
architectures. Otherwise, the default is taken from the target <FONT SIZE="-1">CPU</FONT>
|
|
(either the default <FONT SIZE="-1">CPU,</FONT> or the one specified by <B>-mcpu</B>). For
|
|
example, the default is ``off'' for <B>-mcpu=5206</B> and ``on'' for
|
|
<B>-mcpu=5206e</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> defines the macro <TT>"__mcfhwdiv__"</TT> when this option is enabled.
|
|
<DT id="2750"><B>-mshort</B><DD>
|
|
|
|
|
|
Consider type <TT>"int"</TT> to be 16 bits wide, like <TT>"short int"</TT>.
|
|
Additionally, parameters passed on the stack are also aligned to a
|
|
16-bit boundary even on targets whose <FONT SIZE="-1">API</FONT> mandates promotion to 32-bit.
|
|
<DT id="2751"><B>-mno-short</B><DD>
|
|
|
|
|
|
Do not consider type <TT>"int"</TT> to be 16 bits wide. This is the default.
|
|
<DT id="2752"><B>-mnobitfield</B><DD>
|
|
|
|
|
|
|
|
<DT id="2753"><B>-mno-bitfield</B><DD>
|
|
|
|
|
|
|
|
Do not use the bit-field instructions. The <B>-m68000</B>, <B>-mcpu32</B>
|
|
and <B>-m5200</B> options imply <B>-mnobitfield</B>.
|
|
<DT id="2754"><B>-mbitfield</B><DD>
|
|
|
|
|
|
Do use the bit-field instructions. The <B>-m68020</B> option implies
|
|
<B>-mbitfield</B>. This is the default if you use a configuration
|
|
designed for a 68020.
|
|
<DT id="2755"><B>-mrtd</B><DD>
|
|
|
|
|
|
Use a different function-calling convention, in which functions
|
|
that take a fixed number of arguments return with the <TT>"rtd"</TT>
|
|
instruction, which pops their arguments while returning. This
|
|
saves one instruction in the caller since there is no need to pop
|
|
the arguments there.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This calling convention is incompatible with the one normally
|
|
used on Unix, so you cannot use it if you need to call libraries
|
|
compiled with the Unix compiler.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Also, you must provide function prototypes for all functions that
|
|
take variable numbers of arguments (including <TT>"printf"</TT>);
|
|
otherwise incorrect code is generated for calls to those
|
|
functions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In addition, seriously incorrect code results if you call a
|
|
function with too many arguments. (Normally, extra arguments are
|
|
harmlessly ignored.)
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <TT>"rtd"</TT> instruction is supported by the 68010, 68020, 68030,
|
|
68040, 68060 and <FONT SIZE="-1">CPU32</FONT> processors, but not by the 68000 or 5200.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-mno-rtd</B>.
|
|
<DT id="2756"><B>-malign-int</B><DD>
|
|
|
|
|
|
|
|
<DT id="2757"><B>-mno-align-int</B><DD>
|
|
|
|
|
|
|
|
Control whether <FONT SIZE="-1">GCC</FONT> aligns <TT>"int"</TT>, <TT>"long"</TT>, <TT>"long long"</TT>,
|
|
<TT>"float"</TT>, <TT>"double"</TT>, and <TT>"long double"</TT> variables on a 32-bit
|
|
boundary (<B>-malign-int</B>) or a 16-bit boundary (<B>-mno-align-int</B>).
|
|
Aligning variables on 32-bit boundaries produces code that runs somewhat
|
|
faster on processors with 32-bit busses at the expense of more memory.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> if you use the <B>-malign-int</B> switch, <FONT SIZE="-1">GCC</FONT>
|
|
aligns structures containing the above types differently than
|
|
most published application binary interface specifications for the m68k.
|
|
<DT id="2758"><B>-mpcrel</B><DD>
|
|
|
|
|
|
Use the pc-relative addressing mode of the 68000 directly, instead of
|
|
using a global offset table. At present, this option implies <B>-fpic</B>,
|
|
allowing at most a 16-bit offset for pc-relative addressing. <B>-fPIC</B> is
|
|
not presently supported with <B>-mpcrel</B>, though this could be supported for
|
|
68020 and higher processors.
|
|
<DT id="2759"><B>-mno-strict-align</B><DD>
|
|
|
|
|
|
|
|
<DT id="2760"><B>-mstrict-align</B><DD>
|
|
|
|
|
|
|
|
Do not (do) assume that unaligned memory references are handled by
|
|
the system.
|
|
<DT id="2761"><B>-msep-data</B><DD>
|
|
|
|
|
|
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. This option implies
|
|
<B>-fPIC</B>.
|
|
<DT id="2762"><B>-mno-sep-data</B><DD>
|
|
|
|
|
|
Generate code that assumes that the data segment follows the text segment.
|
|
This is the default.
|
|
<DT id="2763"><B>-mid-shared-library</B><DD>
|
|
|
|
|
|
Generate code that supports shared libraries via the library <FONT SIZE="-1">ID</FONT> method.
|
|
This allows for execute-in-place and shared libraries in an environment
|
|
without virtual memory management. This option implies <B>-fPIC</B>.
|
|
<DT id="2764"><B>-mno-id-shared-library</B><DD>
|
|
|
|
|
|
Generate code that doesn't assume ID-based shared libraries are being used.
|
|
This is the default.
|
|
<DT id="2765"><B>-mshared-library-id=n</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="2766"><B>-mxgot</B><DD>
|
|
|
|
|
|
|
|
<DT id="2767"><B>-mno-xgot</B><DD>
|
|
|
|
|
|
|
|
When generating position-independent code for ColdFire, generate code
|
|
that works if the <FONT SIZE="-1">GOT</FONT> has more than 8192 entries. This code is
|
|
larger and slower than code generated without this option. On M680x0
|
|
processors, this option is not needed; <B>-fPIC</B> suffices.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> normally uses a single instruction to load values from the <FONT SIZE="-1">GOT.</FONT>
|
|
While this is relatively efficient, it only works if the <FONT SIZE="-1">GOT</FONT>
|
|
is smaller than about 64k. Anything larger causes the linker
|
|
to report an error such as:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
relocation truncated to fit: R_68K_GOT16O foobar
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If this happens, you should recompile your code with <B>-mxgot</B>.
|
|
It should then work with very large GOTs. However, code generated with
|
|
<B>-mxgot</B> is less efficient, since it takes 4 instructions to fetch
|
|
the value of a global symbol.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that some linkers, including newer versions of the <FONT SIZE="-1">GNU</FONT> linker,
|
|
can create multiple GOTs and sort <FONT SIZE="-1">GOT</FONT> entries. If you have such a linker,
|
|
you should only need to use <B>-mxgot</B> when compiling a single
|
|
object file that accesses more than 8192 <FONT SIZE="-1">GOT</FONT> entries. Very few do.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
These options have no effect unless <FONT SIZE="-1">GCC</FONT> is generating
|
|
position-independent code.
|
|
<DT id="2768"><B>-mlong-jump-table-offsets</B><DD>
|
|
|
|
|
|
Use 32-bit offsets in <TT>"switch"</TT> tables. The default is to use
|
|
16-bit offsets.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>MCore Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These are the <B>-m</B> options defined for the Motorola M*Core
|
|
processors.
|
|
<DL COMPACT>
|
|
<DT id="2769"><B>-mhardlit</B><DD>
|
|
|
|
|
|
|
|
<DT id="2770"><B>-mno-hardlit</B><DD>
|
|
|
|
|
|
|
|
Inline constants into the code stream if it can be done in two
|
|
instructions or less.
|
|
<DT id="2771"><B>-mdiv</B><DD>
|
|
|
|
|
|
|
|
<DT id="2772"><B>-mno-div</B><DD>
|
|
|
|
|
|
|
|
Use the divide instruction. (Enabled by default).
|
|
<DT id="2773"><B>-mrelax-immediate</B><DD>
|
|
|
|
|
|
|
|
<DT id="2774"><B>-mno-relax-immediate</B><DD>
|
|
|
|
|
|
|
|
Allow arbitrary-sized immediates in bit operations.
|
|
<DT id="2775"><B>-mwide-bitfields</B><DD>
|
|
|
|
|
|
|
|
<DT id="2776"><B>-mno-wide-bitfields</B><DD>
|
|
|
|
|
|
|
|
Always treat bit-fields as <TT>"int"</TT>-sized.
|
|
<DT id="2777"><B>-m4byte-functions</B><DD>
|
|
|
|
|
|
|
|
<DT id="2778"><B>-mno-4byte-functions</B><DD>
|
|
|
|
|
|
|
|
Force all functions to be aligned to a 4-byte boundary.
|
|
<DT id="2779"><B>-mcallgraph-data</B><DD>
|
|
|
|
|
|
|
|
<DT id="2780"><B>-mno-callgraph-data</B><DD>
|
|
|
|
|
|
|
|
Emit callgraph information.
|
|
<DT id="2781"><B>-mslow-bytes</B><DD>
|
|
|
|
|
|
|
|
<DT id="2782"><B>-mno-slow-bytes</B><DD>
|
|
|
|
|
|
|
|
Prefer word access when reading byte quantities.
|
|
<DT id="2783"><B>-mlittle-endian</B><DD>
|
|
|
|
|
|
|
|
<DT id="2784"><B>-mbig-endian</B><DD>
|
|
|
|
|
|
|
|
Generate code for a little-endian target.
|
|
<DT id="2785"><B>-m210</B><DD>
|
|
|
|
|
|
|
|
<DT id="2786"><B>-m340</B><DD>
|
|
|
|
|
|
|
|
Generate code for the 210 processor.
|
|
<DT id="2787"><B>-mno-lsim</B><DD>
|
|
|
|
|
|
Assume that runtime support has been provided and so omit the
|
|
simulator library (<I>libsim.a)</I> from the linker command line.
|
|
<DT id="2788"><B>-mstack-increment=</B><I>size</I><DD>
|
|
|
|
|
|
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
|
|
segmentation fault if the stack is extended too much. The default
|
|
value is 0x1000.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>MeP Options</I>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="2789"><B>-mabsdiff</B><DD>
|
|
|
|
|
|
Enables the <TT>"abs"</TT> instruction, which is the absolute difference
|
|
between two registers.
|
|
<DT id="2790"><B>-mall-opts</B><DD>
|
|
|
|
|
|
Enables all the optional instructions---average, multiply, divide, bit
|
|
operations, leading zero, absolute difference, min/max, clip, and
|
|
saturation.
|
|
<DT id="2791"><B>-maverage</B><DD>
|
|
|
|
|
|
Enables the <TT>"ave"</TT> instruction, which computes the average of two
|
|
registers.
|
|
<DT id="2792"><B>-mbased=</B><I>n</I><DD>
|
|
|
|
|
|
Variables of size <I>n</I> bytes or smaller are placed in the
|
|
<TT>".based"</TT> section by default. Based variables use the <TT>$tp</TT>
|
|
register as a base register, and there is a 128-byte limit to the
|
|
<TT>".based"</TT> section.
|
|
<DT id="2793"><B>-mbitops</B><DD>
|
|
|
|
|
|
Enables the bit operation instructions---bit test (<TT>"btstm"</TT>), set
|
|
(<TT>"bsetm"</TT>), clear (<TT>"bclrm"</TT>), invert (<TT>"bnotm"</TT>), and
|
|
test-and-set (<TT>"tas"</TT>).
|
|
<DT id="2794"><B>-mc=</B><I>name</I><DD>
|
|
|
|
|
|
Selects which section constant data is placed in. <I>name</I> may
|
|
be <B>tiny</B>, <B>near</B>, or <B>far</B>.
|
|
<DT id="2795"><B>-mclip</B><DD>
|
|
|
|
|
|
Enables the <TT>"clip"</TT> instruction. Note that <B>-mclip</B> is not
|
|
useful unless you also provide <B>-mminmax</B>.
|
|
<DT id="2796"><B>-mconfig=</B><I>name</I><DD>
|
|
|
|
|
|
Selects one of the built-in core configurations. Each MeP chip has
|
|
one or more modules in it; each module has a core <FONT SIZE="-1">CPU</FONT> and a variety of
|
|
coprocessors, optional instructions, and peripherals. The
|
|
<TT>"MeP-Integrator"</TT> tool, not part of <FONT SIZE="-1">GCC,</FONT> provides these
|
|
configurations through this option; using this option is the same as
|
|
using all the corresponding command-line options. The default
|
|
configuration is <B>default</B>.
|
|
<DT id="2797"><B>-mcop</B><DD>
|
|
|
|
|
|
Enables the coprocessor instructions. By default, this is a 32-bit
|
|
coprocessor. Note that the coprocessor is normally enabled via the
|
|
<B>-mconfig=</B> option.
|
|
<DT id="2798"><B>-mcop32</B><DD>
|
|
|
|
|
|
Enables the 32-bit coprocessor's instructions.
|
|
<DT id="2799"><B>-mcop64</B><DD>
|
|
|
|
|
|
Enables the 64-bit coprocessor's instructions.
|
|
<DT id="2800"><B>-mivc2</B><DD>
|
|
|
|
|
|
Enables <FONT SIZE="-1">IVC2</FONT> scheduling. <FONT SIZE="-1">IVC2</FONT> is a 64-bit <FONT SIZE="-1">VLIW</FONT> coprocessor.
|
|
<DT id="2801"><B>-mdc</B><DD>
|
|
|
|
|
|
Causes constant variables to be placed in the <TT>".near"</TT> section.
|
|
<DT id="2802"><B>-mdiv</B><DD>
|
|
|
|
|
|
Enables the <TT>"div"</TT> and <TT>"divu"</TT> instructions.
|
|
<DT id="2803"><B>-meb</B><DD>
|
|
|
|
|
|
Generate big-endian code.
|
|
<DT id="2804"><B>-mel</B><DD>
|
|
|
|
|
|
Generate little-endian code.
|
|
<DT id="2805"><B>-mio-volatile</B><DD>
|
|
|
|
|
|
Tells the compiler that any variable marked with the <TT>"io"</TT>
|
|
attribute is to be considered volatile.
|
|
<DT id="2806"><B>-ml</B><DD>
|
|
|
|
|
|
Causes variables to be assigned to the <TT>".far"</TT> section by default.
|
|
<DT id="2807"><B>-mleadz</B><DD>
|
|
|
|
|
|
Enables the <TT>"leadz"</TT> (leading zero) instruction.
|
|
<DT id="2808"><B>-mm</B><DD>
|
|
|
|
|
|
Causes variables to be assigned to the <TT>".near"</TT> section by default.
|
|
<DT id="2809"><B>-mminmax</B><DD>
|
|
|
|
|
|
Enables the <TT>"min"</TT> and <TT>"max"</TT> instructions.
|
|
<DT id="2810"><B>-mmult</B><DD>
|
|
|
|
|
|
Enables the multiplication and multiply-accumulate instructions.
|
|
<DT id="2811"><B>-mno-opts</B><DD>
|
|
|
|
|
|
Disables all the optional instructions enabled by <B>-mall-opts</B>.
|
|
<DT id="2812"><B>-mrepeat</B><DD>
|
|
|
|
|
|
Enables the <TT>"repeat"</TT> and <TT>"erepeat"</TT> instructions, used for
|
|
low-overhead looping.
|
|
<DT id="2813"><B>-ms</B><DD>
|
|
|
|
|
|
Causes all variables to default to the <TT>".tiny"</TT> section. Note
|
|
that there is a 65536-byte limit to this section. Accesses to these
|
|
variables use the <TT>%gp</TT> base register.
|
|
<DT id="2814"><B>-msatur</B><DD>
|
|
|
|
|
|
Enables the saturation instructions. Note that the compiler does not
|
|
currently generate these itself, but this option is included for
|
|
compatibility with other tools, like <TT>"as"</TT>.
|
|
<DT id="2815"><B>-msdram</B><DD>
|
|
|
|
|
|
Link the SDRAM-based runtime instead of the default ROM-based runtime.
|
|
<DT id="2816"><B>-msim</B><DD>
|
|
|
|
|
|
Link the simulator run-time libraries.
|
|
<DT id="2817"><B>-msimnovec</B><DD>
|
|
|
|
|
|
Link the simulator runtime libraries, excluding built-in support
|
|
for reset and exception vectors and tables.
|
|
<DT id="2818"><B>-mtf</B><DD>
|
|
|
|
|
|
Causes all functions to default to the <TT>".far"</TT> section. Without
|
|
this option, functions default to the <TT>".near"</TT> section.
|
|
<DT id="2819"><B>-mtiny=</B><I>n</I><DD>
|
|
|
|
|
|
Variables that are <I>n</I> bytes or smaller are allocated to the
|
|
<TT>".tiny"</TT> section. These variables use the <TT>$gp</TT> base
|
|
register. The default for this option is 4, but note that there's a
|
|
65536-byte limit to the <TT>".tiny"</TT> section.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>MicroBlaze Options</I>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="2820"><B>-msoft-float</B><DD>
|
|
|
|
|
|
Use software emulation for floating point (default).
|
|
<DT id="2821"><B>-mhard-float</B><DD>
|
|
|
|
|
|
Use hardware floating-point instructions.
|
|
<DT id="2822"><B>-mmemcpy</B><DD>
|
|
|
|
|
|
Do not optimize block moves, use <TT>"memcpy"</TT>.
|
|
<DT id="2823"><B>-mno-clearbss</B><DD>
|
|
|
|
|
|
This option is deprecated. Use <B>-fno-zero-initialized-in-bss</B> instead.
|
|
<DT id="2824"><B>-mcpu=</B><I>cpu-type</I><DD>
|
|
|
|
|
|
Use features of, and schedule code for, the given <FONT SIZE="-1">CPU.</FONT>
|
|
Supported values are in the format <B>v</B><I>X</I><B>.</B><I></I><FONT SIZE="-1"><I>YY</I></FONT><I></I><B>.</B><I>Z</I>,
|
|
where <I>X</I> is a major version, <I></I><FONT SIZE="-1"><I>YY</I></FONT><I></I> is the minor version, and
|
|
<I>Z</I> is compatibility code. Example values are <B>v3.00.a</B>,
|
|
<B>v4.00.b</B>, <B>v5.00.a</B>, <B>v5.00.b</B>, <B>v6.00.a</B>.
|
|
<DT id="2825"><B>-mxl-soft-mul</B><DD>
|
|
|
|
|
|
Use software multiply emulation (default).
|
|
<DT id="2826"><B>-mxl-soft-div</B><DD>
|
|
|
|
|
|
Use software emulation for divides (default).
|
|
<DT id="2827"><B>-mxl-barrel-shift</B><DD>
|
|
|
|
|
|
Use the hardware barrel shifter.
|
|
<DT id="2828"><B>-mxl-pattern-compare</B><DD>
|
|
|
|
|
|
Use pattern compare instructions.
|
|
<DT id="2829"><B>-msmall-divides</B><DD>
|
|
|
|
|
|
Use table lookup optimization for small signed integer divisions.
|
|
<DT id="2830"><B>-mxl-stack-check</B><DD>
|
|
|
|
|
|
This option is deprecated. Use <B>-fstack-check</B> instead.
|
|
<DT id="2831"><B>-mxl-gp-opt</B><DD>
|
|
|
|
|
|
Use GP-relative <TT>".sdata"</TT>/<TT>".sbss"</TT> sections.
|
|
<DT id="2832"><B>-mxl-multiply-high</B><DD>
|
|
|
|
|
|
Use multiply high instructions for high part of 32x32 multiply.
|
|
<DT id="2833"><B>-mxl-float-convert</B><DD>
|
|
|
|
|
|
Use hardware floating-point conversion instructions.
|
|
<DT id="2834"><B>-mxl-float-sqrt</B><DD>
|
|
|
|
|
|
Use hardware floating-point square root instruction.
|
|
<DT id="2835"><B>-mbig-endian</B><DD>
|
|
|
|
|
|
Generate code for a big-endian target.
|
|
<DT id="2836"><B>-mlittle-endian</B><DD>
|
|
|
|
|
|
Generate code for a little-endian target.
|
|
<DT id="2837"><B>-mxl-reorder</B><DD>
|
|
|
|
|
|
Use reorder instructions (swap and byte reversed load/store).
|
|
<DT id="2838"><B>-mxl-mode-</B><I>app-model</I><DD>
|
|
|
|
|
|
Select application model <I>app-model</I>. Valid models are
|
|
<DL COMPACT><DT id="2839"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2840"><B>executable</B><DD>
|
|
|
|
|
|
normal executable (default), uses startup code <I>crt0.o</I>.
|
|
<DT id="2841"><B>-mpic-data-is-text-relative</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">GOT</FONT> since PC-relative addressing is not supported.
|
|
<DT id="2842"><B>xmdstub</B><DD>
|
|
|
|
|
|
for use with Xilinx Microprocessor Debugger (<FONT SIZE="-1">XMD</FONT>) based
|
|
software intrusive debug agent called xmdstub. This uses startup file
|
|
<I>crt1.o</I> and sets the start address of the program to 0x800.
|
|
<DT id="2843"><B>bootstrap</B><DD>
|
|
|
|
|
|
for applications that are loaded using a bootloader.
|
|
This model uses startup file <I>crt2.o</I> which does not contain a processor
|
|
reset vector handler. This is suitable for transferring control on a
|
|
processor reset to the bootloader rather than the application.
|
|
<DT id="2844"><B>novectors</B><DD>
|
|
|
|
|
|
for applications that do not require any of the
|
|
MicroBlaze vectors. This option may be useful for applications running
|
|
within a monitoring application. This model uses <I>crt3.o</I> as a startup file.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2845"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Option <B>-xl-mode-</B><I>app-model</I> is a deprecated alias for
|
|
<B>-mxl-mode-</B><I>app-model</I>.
|
|
</DL>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>MIPS</I></FONT><I> Options</I>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="2846"><B>-EB</B><DD>
|
|
|
|
|
|
Generate big-endian code.
|
|
<DT id="2847"><B>-EL</B><DD>
|
|
|
|
|
|
Generate little-endian code. This is the default for <B>mips*el-*-*</B>
|
|
configurations.
|
|
<DT id="2848"><B>-march=</B><I>arch</I><DD>
|
|
|
|
|
|
Generate code that runs on <I>arch</I>, which can be the name of a
|
|
generic <FONT SIZE="-1">MIPS ISA,</FONT> or the name of a particular processor.
|
|
The <FONT SIZE="-1">ISA</FONT> names are:
|
|
<B>mips1</B>, <B>mips2</B>, <B>mips3</B>, <B>mips4</B>,
|
|
<B>mips32</B>, <B>mips32r2</B>, <B>mips32r3</B>, <B>mips32r5</B>,
|
|
<B>mips32r6</B>, <B>mips64</B>, <B>mips64r2</B>, <B>mips64r3</B>,
|
|
<B>mips64r5</B> and <B>mips64r6</B>.
|
|
The processor names are:
|
|
<B>4kc</B>, <B>4km</B>, <B>4kp</B>, <B>4ksc</B>,
|
|
<B>4kec</B>, <B>4kem</B>, <B>4kep</B>, <B>4ksd</B>,
|
|
<B>5kc</B>, <B>5kf</B>,
|
|
<B>20kc</B>,
|
|
<B>24kc</B>, <B>24kf2_1</B>, <B>24kf1_1</B>,
|
|
<B>24kec</B>, <B>24kef2_1</B>, <B>24kef1_1</B>,
|
|
<B>34kc</B>, <B>34kf2_1</B>, <B>34kf1_1</B>, <B>34kn</B>,
|
|
<B>74kc</B>, <B>74kf2_1</B>, <B>74kf1_1</B>, <B>74kf3_2</B>,
|
|
<B>1004kc</B>, <B>1004kf2_1</B>, <B>1004kf1_1</B>,
|
|
<B>i6400</B>, <B>i6500</B>,
|
|
<B>interaptiv</B>,
|
|
<B>loongson2e</B>, <B>loongson2f</B>, <B>loongson3a</B>, <B>gs464</B>,
|
|
<B>gs464e</B>, <B>gs264e</B>,
|
|
<B>m4k</B>,
|
|
<B>m14k</B>, <B>m14kc</B>, <B>m14ke</B>, <B>m14kec</B>,
|
|
<B>m5100</B>, <B>m5101</B>,
|
|
<B>octeon</B>, <B>octeon+</B>, <B>octeon2</B>, <B>octeon3</B>,
|
|
<B>orion</B>,
|
|
<B>p5600</B>, <B>p6600</B>,
|
|
<B>r2000</B>, <B>r3000</B>, <B>r3900</B>, <B>r4000</B>, <B>r4400</B>,
|
|
<B>r4600</B>, <B>r4650</B>, <B>r4700</B>, <B>r5900</B>,
|
|
<B>r6000</B>, <B>r8000</B>,
|
|
<B>rm7000</B>, <B>rm9000</B>,
|
|
<B>r10000</B>, <B>r12000</B>, <B>r14000</B>, <B>r16000</B>,
|
|
<B>sb1</B>,
|
|
<B>sr71000</B>,
|
|
<B>vr4100</B>, <B>vr4111</B>, <B>vr4120</B>, <B>vr4130</B>, <B>vr4300</B>,
|
|
<B>vr5000</B>, <B>vr5400</B>, <B>vr5500</B>,
|
|
<B>xlr</B> and <B>xlp</B>.
|
|
The special value <B>from-abi</B> selects the
|
|
most compatible architecture for the selected <FONT SIZE="-1">ABI</FONT> (that is,
|
|
<B>mips1</B> for 32-bit ABIs and <B>mips3</B> for 64-bit ABIs).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The native Linux/GNU toolchain also supports the value <B>native</B>,
|
|
which selects the best architecture option for the host processor.
|
|
<B>-march=native</B> has no effect if <FONT SIZE="-1">GCC</FONT> does not recognize
|
|
the processor.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In processor names, a final <B>000</B> can be abbreviated as <B>k</B>
|
|
(for example, <B>-march=r2k</B>). Prefixes are optional, and
|
|
<B>vr</B> may be written <B>r</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Names of the form <I>n</I><B>f2_1</B> refer to processors with
|
|
FPUs clocked at half the rate of the core, names of the form
|
|
<I>n</I><B>f1_1</B> refer to processors with FPUs clocked at the same
|
|
rate as the core, and names of the form <I>n</I><B>f3_2</B> refer to
|
|
processors with FPUs clocked a ratio of 3:2 with respect to the core.
|
|
For compatibility reasons, <I>n</I><B>f</B> is accepted as a synonym
|
|
for <I>n</I><B>f2_1</B> while <I>n</I><B>x</B> and <I>b</I><B>fx</B> are
|
|
accepted as synonyms for <I>n</I><B>f1_1</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> defines two macros based on the value of this option. The first
|
|
is <TT>"_MIPS_ARCH"</TT>, which gives the name of target architecture, as
|
|
a string. The second has the form <TT>"_MIPS_ARCH_</TT>foo<TT>"</TT>,
|
|
where <I>foo</I> is the capitalized value of <TT>"_MIPS_ARCH"</TT>.
|
|
For example, <B>-march=r2000</B> sets <TT>"_MIPS_ARCH"</TT>
|
|
to <TT>"r2000"</TT> and defines the macro <TT>"_MIPS_ARCH_R2000"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that the <TT>"_MIPS_ARCH"</TT> macro uses the processor names given
|
|
above. In other words, it has the full prefix and does not
|
|
abbreviate <B>000</B> as <B>k</B>. In the case of <B>from-abi</B>,
|
|
the macro names the resolved architecture (either <TT>"mips1"</TT> or
|
|
<TT>"mips3"</TT>). It names the default architecture when no
|
|
<B>-march</B> option is given.
|
|
<DT id="2849"><B>-mtune=</B><I>arch</I><DD>
|
|
|
|
|
|
Optimize for <I>arch</I>. Among other things, this option controls
|
|
the way instructions are scheduled, and the perceived cost of arithmetic
|
|
operations. The list of <I>arch</I> values is the same as for
|
|
<B>-march</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When this option is not used, <FONT SIZE="-1">GCC</FONT> optimizes for the processor
|
|
specified by <B>-march</B>. By using <B>-march</B> and
|
|
<B>-mtune</B> together, it is possible to generate code that
|
|
runs on a family of processors, but optimize the code for one
|
|
particular member of that family.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mtune</B> defines the macros <TT>"_MIPS_TUNE"</TT> and
|
|
<TT>"_MIPS_TUNE_</TT>foo<TT>"</TT>, which work in the same way as the
|
|
<B>-march</B> ones described above.
|
|
<DT id="2850"><B>-mips1</B><DD>
|
|
|
|
|
|
Equivalent to <B>-march=mips1</B>.
|
|
<DT id="2851"><B>-mips2</B><DD>
|
|
|
|
|
|
Equivalent to <B>-march=mips2</B>.
|
|
<DT id="2852"><B>-mips3</B><DD>
|
|
|
|
|
|
Equivalent to <B>-march=mips3</B>.
|
|
<DT id="2853"><B>-mips4</B><DD>
|
|
|
|
|
|
Equivalent to <B>-march=mips4</B>.
|
|
<DT id="2854"><B>-mips32</B><DD>
|
|
|
|
|
|
Equivalent to <B>-march=mips32</B>.
|
|
<DT id="2855"><B>-mips32r3</B><DD>
|
|
|
|
|
|
Equivalent to <B>-march=mips32r3</B>.
|
|
<DT id="2856"><B>-mips32r5</B><DD>
|
|
|
|
|
|
Equivalent to <B>-march=mips32r5</B>.
|
|
<DT id="2857"><B>-mips32r6</B><DD>
|
|
|
|
|
|
Equivalent to <B>-march=mips32r6</B>.
|
|
<DT id="2858"><B>-mips64</B><DD>
|
|
|
|
|
|
Equivalent to <B>-march=mips64</B>.
|
|
<DT id="2859"><B>-mips64r2</B><DD>
|
|
|
|
|
|
Equivalent to <B>-march=mips64r2</B>.
|
|
<DT id="2860"><B>-mips64r3</B><DD>
|
|
|
|
|
|
Equivalent to <B>-march=mips64r3</B>.
|
|
<DT id="2861"><B>-mips64r5</B><DD>
|
|
|
|
|
|
Equivalent to <B>-march=mips64r5</B>.
|
|
<DT id="2862"><B>-mips64r6</B><DD>
|
|
|
|
|
|
Equivalent to <B>-march=mips64r6</B>.
|
|
<DT id="2863"><B>-mips16</B><DD>
|
|
|
|
|
|
|
|
<DT id="2864"><B>-mno-mips16</B><DD>
|
|
|
|
|
|
|
|
Generate (do not generate) <FONT SIZE="-1">MIPS16</FONT> code. If <FONT SIZE="-1">GCC</FONT> is targeting a
|
|
<FONT SIZE="-1">MIPS32</FONT> or <FONT SIZE="-1">MIPS64</FONT> architecture, it makes use of the MIPS16e <FONT SIZE="-1">ASE.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">MIPS16</FONT> code generation can also be controlled on a per-function basis
|
|
by means of <TT>"mips16"</TT> and <TT>"nomips16"</TT> attributes.
|
|
<DT id="2865"><B>-mflip-mips16</B><DD>
|
|
|
|
|
|
Generate <FONT SIZE="-1">MIPS16</FONT> 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.
|
|
<DT id="2866"><B>-minterlink-compressed</B><DD>
|
|
|
|
|
|
|
|
<DT id="2867"><B>-mno-interlink-compressed</B><DD>
|
|
|
|
|
|
|
|
Require (do not require) that code using the standard (uncompressed) <FONT SIZE="-1">MIPS ISA</FONT>
|
|
be link-compatible with <FONT SIZE="-1">MIPS16</FONT> and microMIPS code, and vice versa.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, code using the standard <FONT SIZE="-1">ISA</FONT> encoding cannot jump directly
|
|
to <FONT SIZE="-1">MIPS16</FONT> or microMIPS code; it must either use a call or an indirect jump.
|
|
<B>-minterlink-compressed</B> therefore disables direct jumps unless <FONT SIZE="-1">GCC</FONT>
|
|
knows that the target of the jump is not compressed.
|
|
<DT id="2868"><B>-minterlink-mips16</B><DD>
|
|
|
|
|
|
|
|
<DT id="2869"><B>-mno-interlink-mips16</B><DD>
|
|
|
|
|
|
|
|
Aliases of <B>-minterlink-compressed</B> and
|
|
<B>-mno-interlink-compressed</B>. These options predate the microMIPS <FONT SIZE="-1">ASE</FONT>
|
|
and are retained for backwards compatibility.
|
|
<DT id="2870"><B>-mabi=32</B><DD>
|
|
|
|
|
|
|
|
<DT id="2871"><B>-mabi=o64</B><DD>
|
|
|
|
|
|
<DT id="2872"><B>-mabi=n32</B><DD>
|
|
|
|
|
|
<DT id="2873"><B>-mabi=64</B><DD>
|
|
|
|
|
|
<DT id="2874"><B>-mabi=eabi</B><DD>
|
|
|
|
|
|
|
|
Generate code for the given <FONT SIZE="-1">ABI.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that the <FONT SIZE="-1">EABI</FONT> has a 32-bit and a 64-bit variant. <FONT SIZE="-1">GCC</FONT> normally
|
|
generates 64-bit code when you select a 64-bit architecture, but you
|
|
can use <B>-mgp32</B> to get 32-bit code instead.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For information about the O64 <FONT SIZE="-1">ABI,</FONT> see
|
|
<<B><A HREF="http://gcc.gnu.org/projects/mipso64-abi.html">http://gcc.gnu.org/projects/mipso64-abi.html</A></B>>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> supports a variant of the o32 <FONT SIZE="-1">ABI</FONT> in which floating-point registers
|
|
are 64 rather than 32 bits wide. You can select this combination with
|
|
<B>-mabi=32</B> <B>-mfp64</B>. This <FONT SIZE="-1">ABI</FONT> relies on the <TT>"mthc1"</TT>
|
|
and <TT>"mfhc1"</TT> instructions and is therefore only supported for
|
|
<FONT SIZE="-1">MIPS32R2, MIPS32R3</FONT> and <FONT SIZE="-1">MIPS32R5</FONT> processors.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The register assignments for arguments and return values remain the
|
|
same, but each scalar value is passed in a single 64-bit register
|
|
rather than a pair of 32-bit registers. For example, scalar
|
|
floating-point values are returned in <B></B>$f0<B></B> only, not a
|
|
<B></B>$f0<B></B>/<B></B>$f1<B></B> pair. The set of call-saved registers also
|
|
remains the same in that the even-numbered double-precision registers
|
|
are saved.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Two additional variants of the o32 <FONT SIZE="-1">ABI</FONT> are supported to enable
|
|
a transition from 32-bit to 64-bit registers. These are <FONT SIZE="-1">FPXX</FONT>
|
|
(<B>-mfpxx</B>) and <FONT SIZE="-1">FP64A</FONT> (<B>-mfp64</B> <B>-mno-odd-spreg</B>).
|
|
The <FONT SIZE="-1">FPXX</FONT> extension mandates that all code must execute correctly
|
|
when run using 32-bit or 64-bit registers. The code can be interlinked
|
|
with either <FONT SIZE="-1">FP32</FONT> or <FONT SIZE="-1">FP64,</FONT> but not both.
|
|
The <FONT SIZE="-1">FP64A</FONT> extension is similar to the <FONT SIZE="-1">FP64</FONT> extension but forbids the
|
|
use of odd-numbered single-precision registers. This can be used
|
|
in conjunction with the <TT>"FRE"</TT> mode of FPUs in <FONT SIZE="-1">MIPS32R5</FONT>
|
|
processors and allows both <FONT SIZE="-1">FP32</FONT> and <FONT SIZE="-1">FP64A</FONT> code to interlink and
|
|
run in the same process without changing <FONT SIZE="-1">FPU</FONT> modes.
|
|
<DT id="2875"><B>-mabicalls</B><DD>
|
|
|
|
|
|
|
|
<DT id="2876"><B>-mno-abicalls</B><DD>
|
|
|
|
|
|
|
|
Generate (do not generate) code that is suitable for SVR4-style
|
|
dynamic objects. <B>-mabicalls</B> is the default for SVR4-based
|
|
systems.
|
|
<DT id="2877"><B>-mshared</B><DD>
|
|
|
|
|
|
|
|
<DT id="2878"><B>-mno-shared</B><DD>
|
|
|
|
|
|
|
|
Generate (do not generate) code that is fully position-independent,
|
|
and that can therefore be linked into shared libraries. This option
|
|
only affects <B>-mabicalls</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
All <B>-mabicalls</B> code has traditionally been position-independent,
|
|
regardless of options like <B>-fPIC</B> and <B>-fpic</B>. However,
|
|
as an extension, the <FONT SIZE="-1">GNU</FONT> toolchain allows executables to use absolute
|
|
accesses for locally-binding symbols. It can also use shorter <FONT SIZE="-1">GP</FONT>
|
|
initialization sequences and generate direct calls to locally-defined
|
|
functions. This mode is selected by <B>-mno-shared</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mno-shared</B> depends on binutils 2.16 or higher and generates
|
|
objects that can only be linked by the <FONT SIZE="-1">GNU</FONT> linker. However, the option
|
|
does not affect the <FONT SIZE="-1">ABI</FONT> of the final executable; it only affects the <FONT SIZE="-1">ABI</FONT>
|
|
of relocatable objects. Using <B>-mno-shared</B> generally makes
|
|
executables both smaller and quicker.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mshared</B> is the default.
|
|
<DT id="2879"><B>-mplt</B><DD>
|
|
|
|
|
|
|
|
<DT id="2880"><B>-mno-plt</B><DD>
|
|
|
|
|
|
|
|
Assume (do not assume) that the static and dynamic linkers
|
|
support PLTs and copy relocations. This option only affects
|
|
<B>-mno-shared -mabicalls</B>. For the n64 <FONT SIZE="-1">ABI,</FONT> this option
|
|
has no effect without <B>-msym32</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can make <B>-mplt</B> the default by configuring
|
|
<FONT SIZE="-1">GCC</FONT> with <B>--with-mips-plt</B>. The default is
|
|
<B>-mno-plt</B> otherwise.
|
|
<DT id="2881"><B>-mxgot</B><DD>
|
|
|
|
|
|
|
|
<DT id="2882"><B>-mno-xgot</B><DD>
|
|
|
|
|
|
|
|
Lift (do not lift) the usual restrictions on the size of the global
|
|
offset table.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> normally uses a single instruction to load values from the <FONT SIZE="-1">GOT.</FONT>
|
|
While this is relatively efficient, it only works if the <FONT SIZE="-1">GOT</FONT>
|
|
is smaller than about 64k. Anything larger causes the linker
|
|
to report an error such as:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
relocation truncated to fit: R_MIPS_GOT16 foobar
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If this happens, you should recompile your code with <B>-mxgot</B>.
|
|
This works with very large GOTs, although the code is also
|
|
less efficient, since it takes three instructions to fetch the
|
|
value of a global symbol.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that some linkers can create multiple GOTs. If you have such a
|
|
linker, you should only need to use <B>-mxgot</B> when a single object
|
|
file accesses more than 64k's worth of <FONT SIZE="-1">GOT</FONT> entries. Very few do.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
These options have no effect unless <FONT SIZE="-1">GCC</FONT> is generating position
|
|
independent code.
|
|
<DT id="2883"><B>-mgp32</B><DD>
|
|
|
|
|
|
Assume that general-purpose registers are 32 bits wide.
|
|
<DT id="2884"><B>-mgp64</B><DD>
|
|
|
|
|
|
Assume that general-purpose registers are 64 bits wide.
|
|
<DT id="2885"><B>-mfp32</B><DD>
|
|
|
|
|
|
Assume that floating-point registers are 32 bits wide.
|
|
<DT id="2886"><B>-mfp64</B><DD>
|
|
|
|
|
|
Assume that floating-point registers are 64 bits wide.
|
|
<DT id="2887"><B>-mfpxx</B><DD>
|
|
|
|
|
|
Do not assume the width of floating-point registers.
|
|
<DT id="2888"><B>-mhard-float</B><DD>
|
|
|
|
|
|
Use floating-point coprocessor instructions.
|
|
<DT id="2889"><B>-msoft-float</B><DD>
|
|
|
|
|
|
Do not use floating-point coprocessor instructions. Implement
|
|
floating-point calculations using library calls instead.
|
|
<DT id="2890"><B>-mno-float</B><DD>
|
|
|
|
|
|
Equivalent to <B>-msoft-float</B>, 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 <FONT SIZE="-1">MIPS</FONT>
|
|
configurations, where it may select a special set of libraries
|
|
that lack all floating-point support (including, for example, the
|
|
floating-point <TT>"printf"</TT> formats).
|
|
If code compiled with <B>-mno-float</B> accidentally contains
|
|
floating-point operations, it is likely to suffer a link-time
|
|
or run-time failure.
|
|
<DT id="2891"><B>-msingle-float</B><DD>
|
|
|
|
|
|
Assume that the floating-point coprocessor only supports single-precision
|
|
operations.
|
|
<DT id="2892"><B>-mdouble-float</B><DD>
|
|
|
|
|
|
Assume that the floating-point coprocessor supports double-precision
|
|
operations. This is the default.
|
|
<DT id="2893"><B>-modd-spreg</B><DD>
|
|
|
|
|
|
|
|
<DT id="2894"><B>-mno-odd-spreg</B><DD>
|
|
|
|
|
|
|
|
Enable the use of odd-numbered single-precision floating-point registers
|
|
for the o32 <FONT SIZE="-1">ABI.</FONT> This is the default for processors that are known to
|
|
support these registers. When using the o32 <FONT SIZE="-1">FPXX ABI,</FONT> <B>-mno-odd-spreg</B>
|
|
is set by default.
|
|
<DT id="2895"><B>-mabs=2008</B><DD>
|
|
|
|
|
|
|
|
<DT id="2896"><B>-mabs=legacy</B><DD>
|
|
|
|
|
|
|
|
These options control the treatment of the special not-a-number (NaN)
|
|
<FONT SIZE="-1">IEEE 754</FONT> floating-point data with the <TT>"abs.</TT>fmt<TT>"</TT> and
|
|
<TT>"neg.</TT>fmt<TT>"</TT> machine instructions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
By default or when <B>-mabs=legacy</B> is used the legacy
|
|
treatment is selected. In this case these instructions are considered
|
|
arithmetic and avoided where correct operation is required and the
|
|
input operand might be a NaN. A longer sequence of instructions that
|
|
manipulate the sign bit of floating-point datum manually is used
|
|
instead unless the <B>-ffinite-math-only</B> option has also been
|
|
specified.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-mabs=2008</B> option selects the <FONT SIZE="-1">IEEE 754-2008</FONT> treatment. In
|
|
this case these instructions are considered non-arithmetic and therefore
|
|
operating correctly in all cases, including in particular where the
|
|
input operand is a NaN. These instructions are therefore always used
|
|
for the respective operations.
|
|
<DT id="2897"><B>-mnan=2008</B><DD>
|
|
|
|
|
|
|
|
<DT id="2898"><B>-mnan=legacy</B><DD>
|
|
|
|
|
|
|
|
These options control the encoding of the special not-a-number (NaN)
|
|
<FONT SIZE="-1">IEEE 754</FONT> floating-point data.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-mnan=legacy</B> option selects the legacy encoding. In this
|
|
case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
|
|
significand field being 0, whereas signaling NaNs (sNaNs) are denoted
|
|
by the first bit of their trailing significand field being 1.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-mnan=2008</B> option selects the <FONT SIZE="-1">IEEE 754-2008</FONT> encoding. In
|
|
this case qNaNs are denoted by the first bit of their trailing
|
|
significand field being 1, whereas sNaNs are denoted by the first bit of
|
|
their trailing significand field being 0.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-mnan=legacy</B> unless <FONT SIZE="-1">GCC</FONT> has been configured with
|
|
<B>--with-nan=2008</B>.
|
|
<DT id="2899"><B>-mllsc</B><DD>
|
|
|
|
|
|
|
|
<DT id="2900"><B>-mno-llsc</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) <B>ll</B>, <B>sc</B>, and <B>sync</B> instructions to
|
|
implement atomic memory built-in functions. When neither option is
|
|
specified, <FONT SIZE="-1">GCC</FONT> uses the instructions if the target architecture
|
|
supports them.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mllsc</B> is useful if the runtime environment can emulate the
|
|
instructions and <B>-mno-llsc</B> can be useful when compiling for
|
|
nonstandard ISAs. You can make either option the default by
|
|
configuring <FONT SIZE="-1">GCC</FONT> with <B>--with-llsc</B> and <B>--without-llsc</B>
|
|
respectively. <B>--with-llsc</B> is the default for some
|
|
configurations; see the installation documentation for details.
|
|
<DT id="2901"><B>-mdsp</B><DD>
|
|
|
|
|
|
|
|
<DT id="2902"><B>-mno-dsp</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) revision 1 of the <FONT SIZE="-1">MIPS DSP ASE.</FONT>
|
|
<BR> This option defines the
|
|
preprocessor macro <TT>"__mips_dsp"</TT>. It also defines
|
|
<TT>"__mips_dsp_rev"</TT> to 1.
|
|
<DT id="2903"><B>-mdspr2</B><DD>
|
|
|
|
|
|
|
|
<DT id="2904"><B>-mno-dspr2</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) revision 2 of the <FONT SIZE="-1">MIPS DSP ASE.</FONT>
|
|
<BR> This option defines the
|
|
preprocessor macros <TT>"__mips_dsp"</TT> and <TT>"__mips_dspr2"</TT>.
|
|
It also defines <TT>"__mips_dsp_rev"</TT> to 2.
|
|
<DT id="2905"><B>-msmartmips</B><DD>
|
|
|
|
|
|
|
|
<DT id="2906"><B>-mno-smartmips</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the <FONT SIZE="-1">MIPS</FONT> SmartMIPS <FONT SIZE="-1">ASE.</FONT>
|
|
<DT id="2907"><B>-mpaired-single</B><DD>
|
|
|
|
|
|
|
|
<DT id="2908"><B>-mno-paired-single</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) paired-single floating-point instructions.
|
|
<BR> This option requires
|
|
hardware floating-point support to be enabled.
|
|
<DT id="2909"><B>-mdmx</B><DD>
|
|
|
|
|
|
|
|
<DT id="2910"><B>-mno-mdmx</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) <FONT SIZE="-1">MIPS</FONT> Digital Media Extension instructions.
|
|
This option can only be used when generating 64-bit code and requires
|
|
hardware floating-point support to be enabled.
|
|
<DT id="2911"><B>-mips3d</B><DD>
|
|
|
|
|
|
|
|
<DT id="2912"><B>-mno-mips3d</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the <FONT SIZE="-1">MIPS-3D ASE.</FONT>
|
|
The option <B>-mips3d</B> implies <B>-mpaired-single</B>.
|
|
<DT id="2913"><B>-mmicromips</B><DD>
|
|
|
|
|
|
|
|
<DT id="2914"><B>-mno-micromips</B><DD>
|
|
|
|
|
|
|
|
Generate (do not generate) microMIPS code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
MicroMIPS code generation can also be controlled on a per-function basis
|
|
by means of <TT>"micromips"</TT> and <TT>"nomicromips"</TT> attributes.
|
|
<DT id="2915"><B>-mmt</B><DD>
|
|
|
|
|
|
|
|
<DT id="2916"><B>-mno-mt</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) <FONT SIZE="-1">MT</FONT> Multithreading instructions.
|
|
<DT id="2917"><B>-mmcu</B><DD>
|
|
|
|
|
|
|
|
<DT id="2918"><B>-mno-mcu</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the <FONT SIZE="-1">MIPS MCU ASE</FONT> instructions.
|
|
<DT id="2919"><B>-meva</B><DD>
|
|
|
|
|
|
|
|
<DT id="2920"><B>-mno-eva</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the <FONT SIZE="-1">MIPS</FONT> Enhanced Virtual Addressing instructions.
|
|
<DT id="2921"><B>-mvirt</B><DD>
|
|
|
|
|
|
|
|
<DT id="2922"><B>-mno-virt</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the <FONT SIZE="-1">MIPS</FONT> Virtualization (<FONT SIZE="-1">VZ</FONT>) instructions.
|
|
<DT id="2923"><B>-mxpa</B><DD>
|
|
|
|
|
|
|
|
<DT id="2924"><B>-mno-xpa</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the <FONT SIZE="-1">MIPS</FONT> eXtended Physical Address (<FONT SIZE="-1">XPA</FONT>) instructions.
|
|
<DT id="2925"><B>-mcrc</B><DD>
|
|
|
|
|
|
|
|
<DT id="2926"><B>-mno-crc</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the <FONT SIZE="-1">MIPS</FONT> Cyclic Redundancy Check (<FONT SIZE="-1">CRC</FONT>) instructions.
|
|
<DT id="2927"><B>-mginv</B><DD>
|
|
|
|
|
|
|
|
<DT id="2928"><B>-mno-ginv</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the <FONT SIZE="-1">MIPS</FONT> Global INValidate (<FONT SIZE="-1">GINV</FONT>) instructions.
|
|
<DT id="2929"><B>-mloongson-mmi</B><DD>
|
|
|
|
|
|
|
|
<DT id="2930"><B>-mno-loongson-mmi</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the <FONT SIZE="-1">MIPS</FONT> Loongson MultiMedia extensions Instructions (<FONT SIZE="-1">MMI</FONT>).
|
|
<DT id="2931"><B>-mloongson-ext</B><DD>
|
|
|
|
|
|
|
|
<DT id="2932"><B>-mno-loongson-ext</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the <FONT SIZE="-1">MIPS</FONT> Loongson EXTensions (<FONT SIZE="-1">EXT</FONT>) instructions.
|
|
<DT id="2933"><B>-mloongson-ext2</B><DD>
|
|
|
|
|
|
|
|
<DT id="2934"><B>-mno-loongson-ext2</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the <FONT SIZE="-1">MIPS</FONT> Loongson EXTensions r2 (<FONT SIZE="-1">EXT2</FONT>) instructions.
|
|
<DT id="2935"><B>-mlong64</B><DD>
|
|
|
|
|
|
Force <TT>"long"</TT> types to be 64 bits wide. See <B>-mlong32</B> for
|
|
an explanation of the default and the way that the pointer size is
|
|
determined.
|
|
<DT id="2936"><B>-mlong32</B><DD>
|
|
|
|
|
|
Force <TT>"long"</TT>, <TT>"int"</TT>, and pointer types to be 32 bits wide.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default size of <TT>"int"</TT>s, <TT>"long"</TT>s and pointers depends on
|
|
the <FONT SIZE="-1">ABI.</FONT> All the supported ABIs use 32-bit <TT>"int"</TT>s. The n64 <FONT SIZE="-1">ABI</FONT>
|
|
uses 64-bit <TT>"long"</TT>s, as does the 64-bit <FONT SIZE="-1">EABI</FONT>; the others use
|
|
32-bit <TT>"long"</TT>s. Pointers are the same size as <TT>"long"</TT>s,
|
|
or the same size as integer registers, whichever is smaller.
|
|
<DT id="2937"><B>-msym32</B><DD>
|
|
|
|
|
|
|
|
<DT id="2938"><B>-mno-sym32</B><DD>
|
|
|
|
|
|
|
|
Assume (do not assume) that all symbols have 32-bit values, regardless
|
|
of the selected <FONT SIZE="-1">ABI.</FONT> This option is useful in combination with
|
|
<B>-mabi=64</B> and <B>-mno-abicalls</B> because it allows <FONT SIZE="-1">GCC</FONT>
|
|
to generate shorter and faster references to symbolic addresses.
|
|
<DT id="2939"><B>-G</B> <I>num</I><DD>
|
|
|
|
|
|
Put definitions of externally-visible data in a small data section
|
|
if that data is no bigger than <I>num</I> bytes. <FONT SIZE="-1">GCC</FONT> can then generate
|
|
more efficient accesses to the data; see <B>-mgpopt</B> for details.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default <B>-G</B> option depends on the configuration.
|
|
<DT id="2940"><B>-mlocal-sdata</B><DD>
|
|
|
|
|
|
|
|
<DT id="2941"><B>-mno-local-sdata</B><DD>
|
|
|
|
|
|
|
|
Extend (do not extend) the <B>-G</B> behavior to local data too,
|
|
such as to static variables in C. <B>-mlocal-sdata</B> is the
|
|
default for all configurations.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If the linker complains that an application is using too much small data,
|
|
you might want to try rebuilding the less performance-critical parts with
|
|
<B>-mno-local-sdata</B>. You might also want to build large
|
|
libraries with <B>-mno-local-sdata</B>, so that the libraries leave
|
|
more room for the main program.
|
|
<DT id="2942"><B>-mextern-sdata</B><DD>
|
|
|
|
|
|
|
|
<DT id="2943"><B>-mno-extern-sdata</B><DD>
|
|
|
|
|
|
|
|
Assume (do not assume) that externally-defined data is in
|
|
a small data section if the size of that data is within the <B>-G</B> limit.
|
|
<B>-mextern-sdata</B> is the default for all configurations.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you compile a module <I>Mod</I> with <B>-mextern-sdata</B> <B>-G</B>
|
|
<I>num</I> <B>-mgpopt</B>, and <I>Mod</I> references a variable <I>Var</I>
|
|
that is no bigger than <I>num</I> bytes, you must make sure that <I>Var</I>
|
|
is placed in a small data section. If <I>Var</I> is defined by another
|
|
module, you must either compile that module with a high-enough
|
|
<B>-G</B> setting or attach a <TT>"section"</TT> attribute to <I>Var</I>'s
|
|
definition. If <I>Var</I> is common, you must link the application
|
|
with a high-enough <B>-G</B> setting.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The easiest way of satisfying these restrictions is to compile
|
|
and link every module with the same <B>-G</B> option. However,
|
|
you may wish to build a library that supports several different
|
|
small data limits. You can do this by compiling the library with
|
|
the highest supported <B>-G</B> setting and additionally using
|
|
<B>-mno-extern-sdata</B> to stop the library from making assumptions
|
|
about externally-defined data.
|
|
<DT id="2944"><B>-mgpopt</B><DD>
|
|
|
|
|
|
|
|
<DT id="2945"><B>-mno-gpopt</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) GP-relative accesses for symbols that are known to be
|
|
in a small data section; see <B>-G</B>, <B>-mlocal-sdata</B> and
|
|
<B>-mextern-sdata</B>. <B>-mgpopt</B> is the default for all
|
|
configurations.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mno-gpopt</B> is useful for cases where the <TT>$gp</TT> register
|
|
might not hold the value of <TT>"_gp"</TT>. For example, if the code is
|
|
part of a library that might be used in a boot monitor, programs that
|
|
call boot monitor routines pass an unknown value in <TT>$gp</TT>.
|
|
(In such situations, the boot monitor itself is usually compiled
|
|
with <B>-G0</B>.)
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mno-gpopt</B> implies <B>-mno-local-sdata</B> and
|
|
<B>-mno-extern-sdata</B>.
|
|
<DT id="2946"><B>-membedded-data</B><DD>
|
|
|
|
|
|
|
|
<DT id="2947"><B>-mno-embedded-data</B><DD>
|
|
|
|
|
|
|
|
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 <FONT SIZE="-1">RAM</FONT> required
|
|
when executing, and thus may be preferred for some embedded systems.
|
|
<DT id="2948"><B>-muninit-const-in-rodata</B><DD>
|
|
|
|
|
|
|
|
<DT id="2949"><B>-mno-uninit-const-in-rodata</B><DD>
|
|
|
|
|
|
|
|
Put uninitialized <TT>"const"</TT> variables in the read-only data section.
|
|
This option is only meaningful in conjunction with <B>-membedded-data</B>.
|
|
<DT id="2950"><B>-mcode-readable=</B><I>setting</I><DD>
|
|
|
|
|
|
Specify whether <FONT SIZE="-1">GCC</FONT> may generate code that reads from executable sections.
|
|
There are three possible settings:
|
|
<DL COMPACT><DT id="2951"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2952"><B>-mcode-readable=yes</B><DD>
|
|
|
|
|
|
Instructions may freely access executable sections. This is the
|
|
default setting.
|
|
<DT id="2953"><B>-mcode-readable=pcrel</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">MIPS16</FONT> PC-relative load instructions can access executable sections,
|
|
but other instructions must not do so. This option is useful on 4KSc
|
|
and 4KSd processors when the code TLBs have the Read Inhibit bit set.
|
|
It is also useful on processors that can be configured to have a dual
|
|
instruction/data <FONT SIZE="-1">SRAM</FONT> interface and that, like the M4K, automatically
|
|
redirect PC-relative loads to the instruction <FONT SIZE="-1">RAM.</FONT>
|
|
<DT id="2954"><B>-mcode-readable=no</B><DD>
|
|
|
|
|
|
Instructions must not access executable sections. This option can be
|
|
useful on targets that are configured to have a dual instruction/data
|
|
<FONT SIZE="-1">SRAM</FONT> interface but that (unlike the M4K) do not automatically redirect
|
|
PC-relative loads to the instruction <FONT SIZE="-1">RAM.</FONT>
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2955"><DD>
|
|
</DL>
|
|
|
|
<DT id="2956"><B>-msplit-addresses</B><DD>
|
|
|
|
|
|
|
|
<DT id="2957"><B>-mno-split-addresses</B><DD>
|
|
|
|
|
|
|
|
Enable (disable) use of the <TT>"%hi()"</TT> and <TT>"%lo()"</TT> assembler
|
|
relocation operators. This option has been superseded by
|
|
<B>-mexplicit-relocs</B> but is retained for backwards compatibility.
|
|
<DT id="2958"><B>-mexplicit-relocs</B><DD>
|
|
|
|
|
|
|
|
<DT id="2959"><B>-mno-explicit-relocs</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) assembler relocation operators when dealing with symbolic
|
|
addresses. The alternative, selected by <B>-mno-explicit-relocs</B>,
|
|
is to use assembler macros instead.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mexplicit-relocs</B> is the default if <FONT SIZE="-1">GCC</FONT> was configured
|
|
to use an assembler that supports relocation operators.
|
|
<DT id="2960"><B>-mcheck-zero-division</B><DD>
|
|
|
|
|
|
|
|
<DT id="2961"><B>-mno-check-zero-division</B><DD>
|
|
|
|
|
|
|
|
Trap (do not trap) on integer division by zero.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-mcheck-zero-division</B>.
|
|
<DT id="2962"><B>-mdivide-traps</B><DD>
|
|
|
|
|
|
|
|
<DT id="2963"><B>-mdivide-breaks</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">MIPS</FONT> 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 <FONT SIZE="-1">MIPS II</FONT> and later. Also, some
|
|
versions of the Linux kernel have a bug that prevents trap from
|
|
generating the proper signal (<TT>"SIGFPE"</TT>). Use <B>-mdivide-traps</B> to
|
|
allow conditional traps on architectures that support them and
|
|
<B>-mdivide-breaks</B> to force the use of breaks.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is usually <B>-mdivide-traps</B>, but this can be
|
|
overridden at configure time using <B>--with-divide=breaks</B>.
|
|
Divide-by-zero checks can be completely disabled using
|
|
<B>-mno-check-zero-division</B>.
|
|
<DT id="2964"><B>-mload-store-pairs</B><DD>
|
|
|
|
|
|
|
|
<DT id="2965"><B>-mno-load-store-pairs</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="2966"><B>-mmemcpy</B><DD>
|
|
|
|
|
|
|
|
<DT id="2967"><B>-mno-memcpy</B><DD>
|
|
|
|
|
|
|
|
Force (do not force) the use of <TT>"memcpy"</TT> for non-trivial block
|
|
moves. The default is <B>-mno-memcpy</B>, which allows <FONT SIZE="-1">GCC</FONT> to inline
|
|
most constant-sized copies.
|
|
<DT id="2968"><B>-mlong-calls</B><DD>
|
|
|
|
|
|
|
|
<DT id="2969"><B>-mno-long-calls</B><DD>
|
|
|
|
|
|
|
|
Disable (do not disable) use of the <TT>"jal"</TT> instruction. Calling
|
|
functions using <TT>"jal"</TT> is more efficient but requires the caller
|
|
and callee to be in the same 256 megabyte segment.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option has no effect on abicalls code. The default is
|
|
<B>-mno-long-calls</B>.
|
|
<DT id="2970"><B>-mmad</B><DD>
|
|
|
|
|
|
|
|
<DT id="2971"><B>-mno-mad</B><DD>
|
|
|
|
|
|
|
|
Enable (disable) use of the <TT>"mad"</TT>, <TT>"madu"</TT> and <TT>"mul"</TT>
|
|
instructions, as provided by the R4650 <FONT SIZE="-1">ISA.</FONT>
|
|
<DT id="2972"><B>-mimadd</B><DD>
|
|
|
|
|
|
|
|
<DT id="2973"><B>-mno-imadd</B><DD>
|
|
|
|
|
|
|
|
Enable (disable) use of the <TT>"madd"</TT> and <TT>"msub"</TT> integer
|
|
instructions. The default is <B>-mimadd</B> on architectures
|
|
that support <TT>"madd"</TT> and <TT>"msub"</TT> except for the 74k
|
|
architecture where it was found to generate slower code.
|
|
<DT id="2974"><B>-mfused-madd</B><DD>
|
|
|
|
|
|
|
|
<DT id="2975"><B>-mno-fused-madd</B><DD>
|
|
|
|
|
|
|
|
Enable (disable) use of the floating-point multiply-accumulate
|
|
instructions, when they are available. The default is
|
|
<B>-mfused-madd</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On the R8000 <FONT SIZE="-1">CPU</FONT> when multiply-accumulate instructions are used,
|
|
the intermediate product is calculated to infinite precision
|
|
and is not subject to the <FONT SIZE="-1">FCSR</FONT> Flush to Zero bit. This may be
|
|
undesirable in some circumstances. On other processors the result
|
|
is numerically identical to the equivalent computation using
|
|
separate multiply, add, subtract and negate instructions.
|
|
<DT id="2976"><B>-nocpp</B><DD>
|
|
|
|
|
|
Tell the <FONT SIZE="-1">MIPS</FONT> assembler to not run its preprocessor over user
|
|
assembler files (with a <B>.s</B> suffix) when assembling them.
|
|
<DT id="2977"><B>-mfix-24k</B><DD>
|
|
|
|
|
|
|
|
<DT id="2978"><B>-mno-fix-24k</B><DD>
|
|
|
|
|
|
|
|
Work around the 24K E48 (lost data on stores during refill) errata.
|
|
The workarounds are implemented by the assembler rather than by <FONT SIZE="-1">GCC.</FONT>
|
|
<DT id="2979"><B>-mfix-r4000</B><DD>
|
|
|
|
|
|
|
|
<DT id="2980"><B>-mno-fix-r4000</B><DD>
|
|
|
|
|
|
|
|
Work around certain R4000 <FONT SIZE="-1">CPU</FONT> errata:
|
|
<DL COMPACT><DT id="2981"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2982">-<DD>
|
|
A double-word or a variable shift may give an incorrect result if executed
|
|
immediately after starting an integer division.
|
|
<DT id="2983">-<DD>
|
|
A double-word or a variable shift may give an incorrect result if executed
|
|
while an integer multiplication is in progress.
|
|
<DT id="2984">-<DD>
|
|
An integer division may give an incorrect result if started in a delay slot
|
|
of a taken branch or a jump.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2985"><DD>
|
|
</DL>
|
|
|
|
<DT id="2986"><B>-mfix-r4400</B><DD>
|
|
|
|
|
|
|
|
<DT id="2987"><B>-mno-fix-r4400</B><DD>
|
|
|
|
|
|
|
|
Work around certain R4400 <FONT SIZE="-1">CPU</FONT> errata:
|
|
<DL COMPACT><DT id="2988"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2989">-<DD>
|
|
A double-word or a variable shift may give an incorrect result if executed
|
|
immediately after starting an integer division.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2990"><DD>
|
|
</DL>
|
|
|
|
<DT id="2991"><B>-mfix-r10000</B><DD>
|
|
|
|
|
|
|
|
<DT id="2992"><B>-mno-fix-r10000</B><DD>
|
|
|
|
|
|
|
|
Work around certain R10000 errata:
|
|
<DL COMPACT><DT id="2993"><DD>
|
|
<DL COMPACT>
|
|
<DT id="2994">-<DD>
|
|
<TT>"ll"</TT>/<TT>"sc"</TT> sequences may not behave atomically on revisions
|
|
prior to 3.0. They may deadlock on revisions 2.6 and earlier.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="2995"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option can only be used if the target architecture supports
|
|
branch-likely instructions. <B>-mfix-r10000</B> is the default when
|
|
<B>-march=r10000</B> is used; <B>-mno-fix-r10000</B> is the default
|
|
otherwise.
|
|
</DL>
|
|
|
|
<DT id="2996"><B>-mfix-r5900</B><DD>
|
|
|
|
|
|
|
|
<DT id="2997"><B>-mno-fix-r5900</B><DD>
|
|
|
|
|
|
|
|
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 <TT>"nop"</TT> instruction there
|
|
instead. The short loop bug under certain conditions causes loops to
|
|
execute only once or twice, due to a hardware bug in the R5900 chip. The
|
|
workaround is implemented by the assembler rather than by <FONT SIZE="-1">GCC.</FONT>
|
|
<DT id="2998"><B>-mfix-rm7000</B><DD>
|
|
|
|
|
|
|
|
<DT id="2999"><B>-mno-fix-rm7000</B><DD>
|
|
|
|
|
|
|
|
Work around the <FONT SIZE="-1">RM7000</FONT> <TT>"dmult"</TT>/<TT>"dmultu"</TT> errata. The
|
|
workarounds are implemented by the assembler rather than by <FONT SIZE="-1">GCC.</FONT>
|
|
<DT id="3000"><B>-mfix-vr4120</B><DD>
|
|
|
|
|
|
|
|
<DT id="3001"><B>-mno-fix-vr4120</B><DD>
|
|
|
|
|
|
|
|
Work around certain <FONT SIZE="-1">VR4120</FONT> errata:
|
|
<DL COMPACT><DT id="3002"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3003">-<DD>
|
|
<TT>"dmultu"</TT> does not always produce the correct result.
|
|
<DT id="3004">-<DD>
|
|
<TT>"div"</TT> and <TT>"ddiv"</TT> do not always produce the correct result if one
|
|
of the operands is negative.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3005"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The workarounds for the division errata rely on special functions in
|
|
<I>libgcc.a</I>. At present, these functions are only provided by
|
|
the <TT>"mips64vr*-elf"</TT> configurations.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Other <FONT SIZE="-1">VR4120</FONT> errata require a <FONT SIZE="-1">NOP</FONT> to be inserted between certain pairs of
|
|
instructions. These errata are handled by the assembler, not by <FONT SIZE="-1">GCC</FONT> itself.
|
|
</DL>
|
|
|
|
<DT id="3006"><B>-mfix-vr4130</B><DD>
|
|
|
|
|
|
Work around the <FONT SIZE="-1">VR4130</FONT> <TT>"mflo"</TT>/<TT>"mfhi"</TT> errata. The
|
|
workarounds are implemented by the assembler rather than by <FONT SIZE="-1">GCC,</FONT>
|
|
although <FONT SIZE="-1">GCC</FONT> avoids using <TT>"mflo"</TT> and <TT>"mfhi"</TT> if the
|
|
<FONT SIZE="-1">VR4130</FONT> <TT>"macc"</TT>, <TT>"macchi"</TT>, <TT>"dmacc"</TT> and <TT>"dmacchi"</TT>
|
|
instructions are available instead.
|
|
<DT id="3007"><B>-mfix-sb1</B><DD>
|
|
|
|
|
|
|
|
<DT id="3008"><B>-mno-fix-sb1</B><DD>
|
|
|
|
|
|
|
|
Work around certain <FONT SIZE="-1">SB-1 CPU</FONT> core errata.
|
|
(This flag currently works around the <FONT SIZE="-1">SB-1</FONT> revision 2
|
|
``F1'' and ``F2'' floating-point errata.)
|
|
<DT id="3009"><B>-mr10k-cache-barrier=</B><I>setting</I><DD>
|
|
|
|
|
|
Specify whether <FONT SIZE="-1">GCC</FONT> should insert cache barriers to avoid the
|
|
side effects of speculation on R10K processors.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In common with many processors, the R10K tries to predict the outcome
|
|
of a conditional branch and speculatively executes instructions from
|
|
the ``taken'' branch. It later aborts these instructions if the
|
|
predicted outcome is wrong. However, on the R10K, even aborted
|
|
instructions can have side effects.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This problem only affects kernel stores and, depending on the system,
|
|
kernel loads. As an example, a speculatively-executed store may load
|
|
the target memory into cache and mark the cache line as dirty, even if
|
|
the store itself is later aborted. If a <FONT SIZE="-1">DMA</FONT> operation writes to the
|
|
same area of memory before the ``dirty'' line is flushed, the cached
|
|
data overwrites the DMA-ed data. See the R10K processor manual
|
|
for a full description, including other potential problems.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
One workaround is to insert cache barrier instructions before every memory
|
|
access that might be speculatively executed and that might have side
|
|
effects even if aborted. <B>-mr10k-cache-barrier=</B><I>setting</I>
|
|
controls <FONT SIZE="-1">GCC</FONT>'s implementation of this workaround. It assumes that
|
|
aborted accesses to any byte in the following regions does not have
|
|
side effects:
|
|
<DL COMPACT><DT id="3010"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3011">1.<DD>
|
|
|
|
|
|
the memory occupied by the current function's stack frame;
|
|
<DT id="3012">2.<DD>
|
|
|
|
|
|
the memory occupied by an incoming stack argument;
|
|
<DT id="3013">3.<DD>
|
|
|
|
|
|
the memory occupied by an object with a link-time-constant address.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3014"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It is the kernel's responsibility to ensure that speculative
|
|
accesses to these regions are indeed safe.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If the input program contains a function declaration such as:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
void foo (void);
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
then the implementation of <TT>"foo"</TT> must allow <TT>"j foo"</TT> and
|
|
<TT>"jal foo"</TT> to be executed speculatively. <FONT SIZE="-1">GCC</FONT> honors this
|
|
restriction for functions it compiles itself. It expects non-GCC
|
|
functions (such as hand-written assembly code) to do the same.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The option has three forms:
|
|
<DL COMPACT>
|
|
<DT id="3015"><B>-mr10k-cache-barrier=load-store</B><DD>
|
|
|
|
|
|
Insert a cache barrier before a load or store that might be
|
|
speculatively executed and that might have side effects even
|
|
if aborted.
|
|
<DT id="3016"><B>-mr10k-cache-barrier=store</B><DD>
|
|
|
|
|
|
Insert a cache barrier before a store that might be speculatively
|
|
executed and that might have side effects even if aborted.
|
|
<DT id="3017"><B>-mr10k-cache-barrier=none</B><DD>
|
|
|
|
|
|
Disable the insertion of cache barriers. This is the default setting.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3018"><DD>
|
|
</DL>
|
|
|
|
<DT id="3019"><B>-mflush-func=</B><I>func</I><DD>
|
|
|
|
|
|
|
|
<DT id="3020"><B>-mno-flush-func</B><DD>
|
|
|
|
|
|
|
|
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 <TT>"_flush_func"</TT>, that is, the address of the
|
|
memory range for which the cache is being flushed, the size of the
|
|
memory range, and the number 3 (to flush both caches). The default
|
|
depends on the target <FONT SIZE="-1">GCC</FONT> was configured for, but commonly is either
|
|
<TT>"_flush_func"</TT> or <TT>"__cpu_flush"</TT>.
|
|
<DT id="3021"><B>mbranch-cost=</B><I>num</I><DD>
|
|
|
|
|
|
Set the cost of branches to roughly <I>num</I> ``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 <B>-mtune</B> setting.
|
|
<DT id="3022"><B>-mbranch-likely</B><DD>
|
|
|
|
|
|
|
|
<DT id="3023"><B>-mno-branch-likely</B><DD>
|
|
|
|
|
|
|
|
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
|
|
architecture. An exception is for the <FONT SIZE="-1">MIPS32</FONT> and <FONT SIZE="-1">MIPS64</FONT> architectures
|
|
and processors that implement those architectures; for those, Branch
|
|
Likely instructions are not be generated by default because the <FONT SIZE="-1">MIPS32</FONT>
|
|
and <FONT SIZE="-1">MIPS64</FONT> architectures specifically deprecate their use.
|
|
<DT id="3024"><B>-mcompact-branches=never</B><DD>
|
|
|
|
|
|
|
|
<DT id="3025"><B>-mcompact-branches=optimal</B><DD>
|
|
|
|
|
|
<DT id="3026"><B>-mcompact-branches=always</B><DD>
|
|
|
|
|
|
|
|
These options control which form of branches will be generated. The
|
|
default is <B>-mcompact-branches=optimal</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-mcompact-branches=never</B> option ensures that compact branch
|
|
instructions will never be generated.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-mcompact-branches=always</B> option ensures that a compact
|
|
branch instruction will be generated if available. If a compact branch
|
|
instruction is not available, a delay slot form of the branch will be
|
|
used instead.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is supported from <FONT SIZE="-1">MIPS</FONT> Release 6 onwards.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-mcompact-branches=optimal</B> option will cause a delay slot
|
|
branch to be used if one is available in the current <FONT SIZE="-1">ISA</FONT> and the delay
|
|
slot is successfully filled. If the delay slot is not filled, a compact
|
|
branch will be chosen if one is available.
|
|
<DT id="3027"><B>-mfp-exceptions</B><DD>
|
|
|
|
|
|
|
|
<DT id="3028"><B>-mno-fp-exceptions</B><DD>
|
|
|
|
|
|
|
|
Specifies whether <FONT SIZE="-1">FP</FONT> exceptions are enabled. This affects how
|
|
<FONT SIZE="-1">FP</FONT> instructions are scheduled for some processors.
|
|
The default is that <FONT SIZE="-1">FP</FONT> exceptions are
|
|
enabled.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For instance, on the <FONT SIZE="-1">SB-1,</FONT> if <FONT SIZE="-1">FP</FONT> exceptions are disabled, and we are emitting
|
|
64-bit code, then we can use both <FONT SIZE="-1">FP</FONT> pipes. Otherwise, we can only use one
|
|
<FONT SIZE="-1">FP</FONT> pipe.
|
|
<DT id="3029"><B>-mvr4130-align</B><DD>
|
|
|
|
|
|
|
|
<DT id="3030"><B>-mno-vr4130-align</B><DD>
|
|
|
|
|
|
|
|
The <FONT SIZE="-1">VR4130</FONT> 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, <FONT SIZE="-1">GCC</FONT> aligns pairs of instructions that it
|
|
thinks should execute in parallel.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option only has an effect when optimizing for the <FONT SIZE="-1">VR4130.</FONT>
|
|
It normally makes code faster, but at the expense of making it bigger.
|
|
It is enabled by default at optimization level <B>-O3</B>.
|
|
<DT id="3031"><B>-msynci</B><DD>
|
|
|
|
|
|
|
|
<DT id="3032"><B>-mno-synci</B><DD>
|
|
|
|
|
|
|
|
Enable (disable) generation of <TT>"synci"</TT> instructions on
|
|
architectures that support it. The <TT>"synci"</TT> instructions (if
|
|
enabled) are generated when <TT>"__builtin___clear_cache"</TT> is
|
|
compiled.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option defaults to <B>-mno-synci</B>, but the default can be
|
|
overridden by configuring <FONT SIZE="-1">GCC</FONT> with <B>--with-synci</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When compiling code for single processor systems, it is generally safe
|
|
to use <TT>"synci"</TT>. However, on many multi-core (<FONT SIZE="-1">SMP</FONT>) systems, it
|
|
does not invalidate the instruction caches on all cores and may lead
|
|
to undefined behavior.
|
|
<DT id="3033"><B>-mrelax-pic-calls</B><DD>
|
|
|
|
|
|
|
|
<DT id="3034"><B>-mno-relax-pic-calls</B><DD>
|
|
|
|
|
|
|
|
Try to turn <FONT SIZE="-1">PIC</FONT> calls that are normally dispatched via register
|
|
<TT>$25</TT> into direct calls. This is only possible if the linker can
|
|
resolve the destination at link time and if the destination is within
|
|
range for a direct call.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mrelax-pic-calls</B> is the default if <FONT SIZE="-1">GCC</FONT> was configured to use
|
|
an assembler and a linker that support the <TT>".reloc"</TT> assembly
|
|
directive and <B>-mexplicit-relocs</B> is in effect. With
|
|
<B>-mno-explicit-relocs</B>, this optimization can be performed by the
|
|
assembler and the linker alone without help from the compiler.
|
|
<DT id="3035"><B>-mmcount-ra-address</B><DD>
|
|
|
|
|
|
|
|
<DT id="3036"><B>-mno-mcount-ra-address</B><DD>
|
|
|
|
|
|
|
|
Emit (do not emit) code that allows <TT>"_mcount"</TT> to modify the
|
|
calling function's return address. When enabled, this option extends
|
|
the usual <TT>"_mcount"</TT> interface with a new <I>ra-address</I>
|
|
parameter, which has type <TT>"intptr_t *"</TT> and is passed in register
|
|
<TT>$12</TT>. <TT>"_mcount"</TT> can then modify the return address by
|
|
doing both of the following:
|
|
<DL COMPACT><DT id="3037"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3038">*<DD>
|
|
Returning the new address in register <TT>$31</TT>.
|
|
<DT id="3039">*<DD>
|
|
Storing the new address in <TT>"*</TT>ra-address<TT>"</TT>,
|
|
if <I>ra-address</I> is nonnull.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3040"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-mno-mcount-ra-address</B>.
|
|
</DL>
|
|
|
|
<DT id="3041"><B>-mframe-header-opt</B><DD>
|
|
|
|
|
|
|
|
<DT id="3042"><B>-mno-frame-header-opt</B><DD>
|
|
|
|
|
|
|
|
Enable (disable) frame header optimization in the o32 <FONT SIZE="-1">ABI.</FONT> When using the
|
|
o32 <FONT SIZE="-1">ABI,</FONT> calling functions will allocate 16 bytes on the stack for the called
|
|
function to write out register arguments. When enabled, this optimization
|
|
will suppress the allocation of the frame header if it can be determined that
|
|
it is unused.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This optimization is off by default at all optimization levels.
|
|
<DT id="3043"><B>-mlxc1-sxc1</B><DD>
|
|
|
|
|
|
|
|
<DT id="3044"><B>-mno-lxc1-sxc1</B><DD>
|
|
|
|
|
|
|
|
When applicable, enable (disable) the generation of <TT>"lwxc1"</TT>,
|
|
<TT>"swxc1"</TT>, <TT>"ldxc1"</TT>, <TT>"sdxc1"</TT> instructions. Enabled by default.
|
|
<DT id="3045"><B>-mmadd4</B><DD>
|
|
|
|
|
|
|
|
<DT id="3046"><B>-mno-madd4</B><DD>
|
|
|
|
|
|
|
|
When applicable, enable (disable) the generation of 4-operand <TT>"madd.s"</TT>,
|
|
<TT>"madd.d"</TT> and related instructions. Enabled by default.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>MMIX</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined for the <FONT SIZE="-1">MMIX:</FONT>
|
|
<DL COMPACT>
|
|
<DT id="3047"><B>-mlibfuncs</B><DD>
|
|
|
|
|
|
|
|
<DT id="3048"><B>-mno-libfuncs</B><DD>
|
|
|
|
|
|
|
|
Specify that intrinsic library functions are being compiled, passing all
|
|
values in registers, no matter the size.
|
|
<DT id="3049"><B>-mepsilon</B><DD>
|
|
|
|
|
|
|
|
<DT id="3050"><B>-mno-epsilon</B><DD>
|
|
|
|
|
|
|
|
Generate floating-point comparison instructions that compare with respect
|
|
to the <TT>"rE"</TT> epsilon register.
|
|
<DT id="3051"><B>-mabi=mmixware</B><DD>
|
|
|
|
|
|
|
|
<DT id="3052"><B>-mabi=gnu</B><DD>
|
|
|
|
|
|
|
|
Generate code that passes function parameters and return values that (in
|
|
the called function) are seen as registers <TT>$0</TT> and up, as opposed to
|
|
the <FONT SIZE="-1">GNU ABI</FONT> which uses global registers <TT>$231</TT> and up.
|
|
<DT id="3053"><B>-mzero-extend</B><DD>
|
|
|
|
|
|
|
|
<DT id="3054"><B>-mno-zero-extend</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3055"><B>-mknuthdiv</B><DD>
|
|
|
|
|
|
|
|
<DT id="3056"><B>-mno-knuthdiv</B><DD>
|
|
|
|
|
|
|
|
Make the result of a division yielding a remainder have the same sign as
|
|
the divisor. With the default, <B>-mno-knuthdiv</B>, the sign of the
|
|
remainder follows the sign of the dividend. Both methods are
|
|
arithmetically valid, the latter being almost exclusively used.
|
|
<DT id="3057"><B>-mtoplevel-symbols</B><DD>
|
|
|
|
|
|
|
|
<DT id="3058"><B>-mno-toplevel-symbols</B><DD>
|
|
|
|
|
|
|
|
Prepend (do not prepend) a <B>:</B> to all global symbols, so the assembly
|
|
code can be used with the <TT>"PREFIX"</TT> assembly directive.
|
|
<DT id="3059"><B>-melf</B><DD>
|
|
|
|
|
|
Generate an executable in the <FONT SIZE="-1">ELF</FONT> format, rather than the default
|
|
<B>mmo</B> format used by the <B>mmix</B> simulator.
|
|
<DT id="3060"><B>-mbranch-predict</B><DD>
|
|
|
|
|
|
|
|
<DT id="3061"><B>-mno-branch-predict</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the probable-branch instructions, when static branch
|
|
prediction indicates a probable branch.
|
|
<DT id="3062"><B>-mbase-addresses</B><DD>
|
|
|
|
|
|
|
|
<DT id="3063"><B>-mno-base-addresses</B><DD>
|
|
|
|
|
|
|
|
Generate (do not generate) code that uses <I>base addresses</I>. 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
|
|
register is used for one or more base address requests within the range 0
|
|
to 255 from the value held in the register. The generally leads to short
|
|
and fast code, but the number of different data items that can be
|
|
addressed is limited. This means that a program that uses lots of static
|
|
data may require <B>-mno-base-addresses</B>.
|
|
<DT id="3064"><B>-msingle-exit</B><DD>
|
|
|
|
|
|
|
|
<DT id="3065"><B>-mno-single-exit</B><DD>
|
|
|
|
|
|
|
|
Force (do not force) generated code to have a single exit point in each
|
|
function.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>MN10300</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for Matsushita <FONT SIZE="-1">MN10300</FONT> architectures:
|
|
<DL COMPACT>
|
|
<DT id="3066"><B>-mmult-bug</B><DD>
|
|
|
|
|
|
Generate code to avoid bugs in the multiply instructions for the <FONT SIZE="-1">MN10300</FONT>
|
|
processors. This is the default.
|
|
<DT id="3067"><B>-mno-mult-bug</B><DD>
|
|
|
|
|
|
Do not generate code to avoid bugs in the multiply instructions for the
|
|
<FONT SIZE="-1">MN10300</FONT> processors.
|
|
<DT id="3068"><B>-mam33</B><DD>
|
|
|
|
|
|
Generate code using features specific to the <FONT SIZE="-1">AM33</FONT> processor.
|
|
<DT id="3069"><B>-mno-am33</B><DD>
|
|
|
|
|
|
Do not generate code using features specific to the <FONT SIZE="-1">AM33</FONT> processor. This
|
|
is the default.
|
|
<DT id="3070"><B>-mam33-2</B><DD>
|
|
|
|
|
|
Generate code using features specific to the <FONT SIZE="-1">AM33/2.0</FONT> processor.
|
|
<DT id="3071"><B>-mam34</B><DD>
|
|
|
|
|
|
Generate code using features specific to the <FONT SIZE="-1">AM34</FONT> processor.
|
|
<DT id="3072"><B>-mtune=</B><I>cpu-type</I><DD>
|
|
|
|
|
|
Use the timing characteristics of the indicated <FONT SIZE="-1">CPU</FONT> type when
|
|
scheduling instructions. This does not change the targeted processor
|
|
type. The <FONT SIZE="-1">CPU</FONT> type must be one of <B>mn10300</B>, <B>am33</B>,
|
|
<B>am33-2</B> or <B>am34</B>.
|
|
<DT id="3073"><B>-mreturn-pointer-on-d0</B><DD>
|
|
|
|
|
|
When generating a function that returns a pointer, return the pointer
|
|
in both <TT>"a0"</TT> and <TT>"d0"</TT>. Otherwise, the pointer is returned
|
|
only in <TT>"a0"</TT>, and attempts to call such functions without a prototype
|
|
result in errors. Note that this option is on by default; use
|
|
<B>-mno-return-pointer-on-d0</B> to disable it.
|
|
<DT id="3074"><B>-mno-crt0</B><DD>
|
|
|
|
|
|
Do not link in the C run-time initialization object file.
|
|
<DT id="3075"><B>-mrelax</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option makes symbolic debugging impossible.
|
|
<DT id="3076"><B>-mliw</B><DD>
|
|
|
|
|
|
Allow the compiler to generate <I>Long Instruction Word</I>
|
|
instructions if the target is the <B></B><FONT SIZE="-1"><B>AM33</B></FONT><B></B> or later. This is the
|
|
default. This option defines the preprocessor macro <TT>"__LIW__"</TT>.
|
|
<DT id="3077"><B>-mno-liw</B><DD>
|
|
|
|
|
|
Do not allow the compiler to generate <I>Long Instruction Word</I>
|
|
instructions. This option defines the preprocessor macro
|
|
<TT>"__NO_LIW__"</TT>.
|
|
<DT id="3078"><B>-msetlb</B><DD>
|
|
|
|
|
|
Allow the compiler to generate the <I></I><FONT SIZE="-1"><I>SETLB</I></FONT><I></I> and <I>Lcc</I>
|
|
instructions if the target is the <B></B><FONT SIZE="-1"><B>AM33</B></FONT><B></B> or later. This is the
|
|
default. This option defines the preprocessor macro <TT>"__SETLB__"</TT>.
|
|
<DT id="3079"><B>-mno-setlb</B><DD>
|
|
|
|
|
|
Do not allow the compiler to generate <I></I><FONT SIZE="-1"><I>SETLB</I></FONT><I></I> or <I>Lcc</I>
|
|
instructions. This option defines the preprocessor macro
|
|
<TT>"__NO_SETLB__"</TT>.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>Moxie Options</I>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="3080"><B>-meb</B><DD>
|
|
|
|
|
|
Generate big-endian code. This is the default for <B>moxie-*-*</B>
|
|
configurations.
|
|
<DT id="3081"><B>-mel</B><DD>
|
|
|
|
|
|
Generate little-endian code.
|
|
<DT id="3082"><B>-mmul.x</B><DD>
|
|
|
|
|
|
Generate mul.x and umul.x instructions. This is the default for
|
|
<B>moxiebox-*-*</B> configurations.
|
|
<DT id="3083"><B>-mno-crt0</B><DD>
|
|
|
|
|
|
Do not link in the C run-time initialization object file.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>MSP430</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined for the <FONT SIZE="-1">MSP430:</FONT>
|
|
<DL COMPACT>
|
|
<DT id="3084"><B>-masm-hex</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="3085"><B>-mmcu=</B><DD>
|
|
|
|
|
|
Select the <FONT SIZE="-1">MCU</FONT> to target. This is used to create a C preprocessor
|
|
symbol based upon the <FONT SIZE="-1">MCU</FONT> name, converted to upper case and pre- and
|
|
post-fixed with <B>__</B>. This in turn is used by the
|
|
<I>msp430.h</I> header file to select an MCU-specific supplementary
|
|
header file.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The option also sets the <FONT SIZE="-1">ISA</FONT> to use. If the <FONT SIZE="-1">MCU</FONT> name is one that is
|
|
known to only support the 430 <FONT SIZE="-1">ISA</FONT> then that is selected, otherwise the
|
|
430X <FONT SIZE="-1">ISA</FONT> is selected. A generic <FONT SIZE="-1">MCU</FONT> name of <B>msp430</B> can also be
|
|
used to select the 430 <FONT SIZE="-1">ISA.</FONT> Similarly the generic <B>msp430x</B> <FONT SIZE="-1">MCU</FONT>
|
|
name selects the 430X <FONT SIZE="-1">ISA.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In addition an MCU-specific linker script is added to the linker
|
|
command line. The script's name is the name of the <FONT SIZE="-1">MCU</FONT> with
|
|
<I>.ld</I> appended. Thus specifying <B>-mmcu=xxx</B> on the <B>gcc</B>
|
|
command line defines the C preprocessor symbol <TT>"__XXX__"</TT> and
|
|
cause the linker to search for a script called <I>xxx.ld</I>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is also passed on to the assembler.
|
|
<DT id="3086"><B>-mwarn-mcu</B><DD>
|
|
|
|
|
|
|
|
<DT id="3087"><B>-mno-warn-mcu</B><DD>
|
|
|
|
|
|
|
|
This option enables or disables warnings about conflicts between the
|
|
<FONT SIZE="-1">MCU</FONT> name specified by the <B>-mmcu</B> option and the <FONT SIZE="-1">ISA</FONT> set by the
|
|
<B>-mcpu</B> option and/or the hardware multiply support set by the
|
|
<B>-mhwmult</B> option. It also toggles warnings about unrecognized
|
|
<FONT SIZE="-1">MCU</FONT> names. This option is on by default.
|
|
<DT id="3088"><B>-mcpu=</B><DD>
|
|
|
|
|
|
Specifies the <FONT SIZE="-1">ISA</FONT> to use. Accepted values are <B>msp430</B>,
|
|
<B>msp430x</B> and <B>msp430xv2</B>. This option is deprecated. The
|
|
<B>-mmcu=</B> option should be used to select the <FONT SIZE="-1">ISA.</FONT>
|
|
<DT id="3089"><B>-msim</B><DD>
|
|
|
|
|
|
Link to the simulator runtime libraries and linker script. Overrides
|
|
any scripts that would be selected by the <B>-mmcu=</B> option.
|
|
<DT id="3090"><B>-mlarge</B><DD>
|
|
|
|
|
|
Use large-model addressing (20-bit pointers, 32-bit <TT>"size_t"</TT>).
|
|
<DT id="3091"><B>-msmall</B><DD>
|
|
|
|
|
|
Use small-model addressing (16-bit pointers, 16-bit <TT>"size_t"</TT>).
|
|
<DT id="3092"><B>-mrelax</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="3093"><B>mhwmult=</B><DD>
|
|
|
|
|
|
Describes the type of hardware multiply supported by the target.
|
|
Accepted values are <B>none</B> for no hardware multiply, <B>16bit</B>
|
|
for the original 16-bit-only multiply supported by early MCUs.
|
|
<B>32bit</B> for the 16/32-bit multiply supported by later MCUs and
|
|
<B>f5series</B> for the 16/32-bit multiply supported by F5-series MCUs.
|
|
A value of <B>auto</B> can also be given. This tells <FONT SIZE="-1">GCC</FONT> to deduce
|
|
the hardware multiply support based upon the <FONT SIZE="-1">MCU</FONT> name provided by the
|
|
<B>-mmcu</B> option. If no <B>-mmcu</B> option is specified or if
|
|
the <FONT SIZE="-1">MCU</FONT> name is not recognized then no hardware multiply support is
|
|
assumed. <TT>"auto"</TT> is the default setting.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Hardware multiplies are normally performed by calling a library
|
|
routine. This saves space in the generated code. When compiling at
|
|
<B>-O3</B> or higher however the hardware multiplier is invoked
|
|
inline. This makes for bigger, but faster code.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The hardware multiply routines disable interrupts whilst running and
|
|
restore the previous interrupt state when they finish. This makes
|
|
them safe to use inside interrupt handlers as well as in normal code.
|
|
<DT id="3094"><B>-minrt</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="3095"><B>-mcode-region=</B><DD>
|
|
|
|
|
|
|
|
<DT id="3096"><B>-mdata-region=</B><DD>
|
|
|
|
|
|
|
|
These options tell the compiler where to place functions and data that
|
|
do not have one of the <TT>"lower"</TT>, <TT>"upper"</TT>, <TT>"either"</TT> or
|
|
<TT>"section"</TT> attributes. Possible values are <TT>"lower"</TT>,
|
|
<TT>"upper"</TT>, <TT>"either"</TT> or <TT>"any"</TT>. The first three behave
|
|
like the corresponding attribute. The fourth possible value -
|
|
<TT>"any"</TT> - is the default. It leaves placement entirely up to the
|
|
linker script and how it assigns the standard sections
|
|
(<TT>".text"</TT>, <TT>".data"</TT>, etc) to the memory regions.
|
|
<DT id="3097"><B>-msilicon-errata=</B><DD>
|
|
|
|
|
|
This option passes on a request to assembler to enable the fixes for
|
|
the named silicon errata.
|
|
<DT id="3098"><B>-msilicon-errata-warn=</B><DD>
|
|
|
|
|
|
This option passes on a request to the assembler to enable warning
|
|
messages when a silicon errata might need to be applied.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>NDS32</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined for <FONT SIZE="-1">NDS32</FONT> implementations:
|
|
<DL COMPACT>
|
|
<DT id="3099"><B>-mbig-endian</B><DD>
|
|
|
|
|
|
Generate code in big-endian mode.
|
|
<DT id="3100"><B>-mlittle-endian</B><DD>
|
|
|
|
|
|
Generate code in little-endian mode.
|
|
<DT id="3101"><B>-mreduced-regs</B><DD>
|
|
|
|
|
|
Use reduced-set registers for register allocation.
|
|
<DT id="3102"><B>-mfull-regs</B><DD>
|
|
|
|
|
|
Use full-set registers for register allocation.
|
|
<DT id="3103"><B>-mcmov</B><DD>
|
|
|
|
|
|
Generate conditional move instructions.
|
|
<DT id="3104"><B>-mno-cmov</B><DD>
|
|
|
|
|
|
Do not generate conditional move instructions.
|
|
<DT id="3105"><B>-mext-perf</B><DD>
|
|
|
|
|
|
Generate performance extension instructions.
|
|
<DT id="3106"><B>-mno-ext-perf</B><DD>
|
|
|
|
|
|
Do not generate performance extension instructions.
|
|
<DT id="3107"><B>-mext-perf2</B><DD>
|
|
|
|
|
|
Generate performance extension 2 instructions.
|
|
<DT id="3108"><B>-mno-ext-perf2</B><DD>
|
|
|
|
|
|
Do not generate performance extension 2 instructions.
|
|
<DT id="3109"><B>-mext-string</B><DD>
|
|
|
|
|
|
Generate string extension instructions.
|
|
<DT id="3110"><B>-mno-ext-string</B><DD>
|
|
|
|
|
|
Do not generate string extension instructions.
|
|
<DT id="3111"><B>-mv3push</B><DD>
|
|
|
|
|
|
Generate v3 push25/pop25 instructions.
|
|
<DT id="3112"><B>-mno-v3push</B><DD>
|
|
|
|
|
|
Do not generate v3 push25/pop25 instructions.
|
|
<DT id="3113"><B>-m16-bit</B><DD>
|
|
|
|
|
|
Generate 16-bit instructions.
|
|
<DT id="3114"><B>-mno-16-bit</B><DD>
|
|
|
|
|
|
Do not generate 16-bit instructions.
|
|
<DT id="3115"><B>-misr-vector-size=</B><I>num</I><DD>
|
|
|
|
|
|
Specify the size of each interrupt vector, which must be 4 or 16.
|
|
<DT id="3116"><B>-mcache-block-size=</B><I>num</I><DD>
|
|
|
|
|
|
Specify the size of each cache block,
|
|
which must be a power of 2 between 4 and 512.
|
|
<DT id="3117"><B>-march=</B><I>arch</I><DD>
|
|
|
|
|
|
Specify the name of the target architecture.
|
|
<DT id="3118"><B>-mcmodel=</B><I>code-model</I><DD>
|
|
|
|
|
|
Set the code model to one of
|
|
<DL COMPACT><DT id="3119"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3120"><B>small</B><DD>
|
|
|
|
|
|
All the data and read-only data segments must be within 512KB addressing space.
|
|
The text segment must be within 16MB addressing space.
|
|
<DT id="3121"><B>medium</B><DD>
|
|
|
|
|
|
The data segment must be within 512KB while the read-only data segment can be
|
|
within 4GB addressing space. The text segment should be still within 16MB
|
|
addressing space.
|
|
<DT id="3122"><B>large</B><DD>
|
|
|
|
|
|
All the text and data segments can be within 4GB addressing space.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3123"><DD>
|
|
</DL>
|
|
|
|
<DT id="3124"><B>-mctor-dtor</B><DD>
|
|
|
|
|
|
Enable constructor/destructor feature.
|
|
<DT id="3125"><B>-mrelax</B><DD>
|
|
|
|
|
|
Guide linker to relax instructions.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>Nios </I><FONT SIZE="-1"><I>II</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These are the options defined for the Altera Nios <FONT SIZE="-1">II</FONT> processor.
|
|
<DL COMPACT>
|
|
<DT id="3126"><B>-G</B> <I>num</I><DD>
|
|
|
|
|
|
Put global and static objects less than or equal to <I>num</I> bytes
|
|
into the small data or <FONT SIZE="-1">BSS</FONT> sections instead of the normal data or <FONT SIZE="-1">BSS</FONT>
|
|
sections. The default value of <I>num</I> is 8.
|
|
<DT id="3127"><B>-mgpopt=</B><I>option</I><DD>
|
|
|
|
|
|
|
|
<DT id="3128"><B>-mgpopt</B><DD>
|
|
|
|
|
|
<DT id="3129"><B>-mno-gpopt</B><DD>
|
|
|
|
|
|
|
|
Generate (do not generate) GP-relative accesses. The following
|
|
<I>option</I> names are recognized:
|
|
<DL COMPACT><DT id="3130"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3131"><B>none</B><DD>
|
|
|
|
|
|
Do not generate GP-relative accesses.
|
|
<DT id="3132"><B>local</B><DD>
|
|
|
|
|
|
Generate GP-relative accesses for small data objects that are not
|
|
external, weak, or uninitialized common symbols.
|
|
Also use GP-relative addressing for objects that
|
|
have been explicitly placed in a small data section via a <TT>"section"</TT>
|
|
attribute.
|
|
<DT id="3133"><B>global</B><DD>
|
|
|
|
|
|
As for <B>local</B>, but also generate GP-relative accesses for
|
|
small data objects that are external, weak, or common. If you use this option,
|
|
you must ensure that all parts of your program (including libraries) are
|
|
compiled with the same <B>-G</B> setting.
|
|
<DT id="3134"><B>data</B><DD>
|
|
|
|
|
|
Generate GP-relative accesses for all data objects in the program. If you
|
|
use this option, the entire data and <FONT SIZE="-1">BSS</FONT> segments
|
|
of your program must fit in 64K of memory and you must use an appropriate
|
|
linker script to allocate them within the addressable range of the
|
|
global pointer.
|
|
<DT id="3135"><B>all</B><DD>
|
|
|
|
|
|
Generate GP-relative addresses for function pointers as well as data
|
|
pointers. If you use this option, the entire text, data, and <FONT SIZE="-1">BSS</FONT> segments
|
|
of your program must fit in 64K of memory and you must use an appropriate
|
|
linker script to allocate them within the addressable range of the
|
|
global pointer.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3136"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mgpopt</B> is equivalent to <B>-mgpopt=local</B>, and
|
|
<B>-mno-gpopt</B> is equivalent to <B>-mgpopt=none</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-mgpopt</B> except when <B>-fpic</B> or
|
|
<B>-fPIC</B> is specified to generate position-independent code.
|
|
Note that the Nios <FONT SIZE="-1">II ABI</FONT> does not permit GP-relative accesses from
|
|
shared libraries.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You may need to specify <B>-mno-gpopt</B> explicitly when building
|
|
programs that include large amounts of small data, including large
|
|
<FONT SIZE="-1">GOT</FONT> data sections. In this case, the 16-bit offset for GP-relative
|
|
addressing may not be large enough to allow access to the entire
|
|
small data section.
|
|
</DL>
|
|
|
|
<DT id="3137"><B>-mgprel-sec=</B><I>regexp</I><DD>
|
|
|
|
|
|
This option specifies additional section names that can be accessed via
|
|
GP-relative addressing. It is most useful in conjunction with
|
|
<TT>"section"</TT> attributes on variable declarations and a custom linker script.
|
|
The <I>regexp</I> is a <FONT SIZE="-1">POSIX</FONT> Extended Regular Expression.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option does not affect the behavior of the <B>-G</B> option, and
|
|
the specified sections are in addition to the standard <TT>".sdata"</TT>
|
|
and <TT>".sbss"</TT> small-data sections that are recognized by <B>-mgpopt</B>.
|
|
<DT id="3138"><B>-mr0rel-sec=</B><I>regexp</I><DD>
|
|
|
|
|
|
This option specifies names of sections that can be accessed via a
|
|
16-bit offset from <TT>"r0"</TT>; that is, in the low 32K or high 32K
|
|
of the 32-bit address space. It is most useful in conjunction with
|
|
<TT>"section"</TT> attributes on variable declarations and a custom linker script.
|
|
The <I>regexp</I> is a <FONT SIZE="-1">POSIX</FONT> Extended Regular Expression.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In contrast to the use of GP-relative addressing for small data,
|
|
zero-based addressing is never generated by default and there are no
|
|
conventional section names used in standard linker scripts for sections
|
|
in the low or high areas of memory.
|
|
<DT id="3139"><B>-mel</B><DD>
|
|
|
|
|
|
|
|
<DT id="3140"><B>-meb</B><DD>
|
|
|
|
|
|
|
|
Generate little-endian (default) or big-endian (experimental) code,
|
|
respectively.
|
|
<DT id="3141"><B>-march=</B><I>arch</I><DD>
|
|
|
|
|
|
This specifies the name of the target Nios <FONT SIZE="-1">II</FONT> architecture. <FONT SIZE="-1">GCC</FONT> uses this
|
|
name to determine what kind of instructions it can emit when generating
|
|
assembly code. Permissible names are: <B>r1</B>, <B>r2</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The preprocessor macro <TT>"__nios2_arch__"</TT> is available to programs,
|
|
with value 1 or 2, indicating the targeted <FONT SIZE="-1">ISA</FONT> level.
|
|
<DT id="3142"><B>-mbypass-cache</B><DD>
|
|
|
|
|
|
|
|
<DT id="3143"><B>-mno-bypass-cache</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3144"><B>-mno-cache-volatile</B><DD>
|
|
|
|
|
|
|
|
<DT id="3145"><B>-mcache-volatile</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3146"><B>-mno-fast-sw-div</B><DD>
|
|
|
|
|
|
|
|
<DT id="3147"><B>-mfast-sw-div</B><DD>
|
|
|
|
|
|
|
|
Do not use table-based fast divide for small numbers. The default
|
|
is to use the fast divide at <B>-O3</B> and above.
|
|
<DT id="3148"><B>-mno-hw-mul</B><DD>
|
|
|
|
|
|
|
|
<DT id="3149"><B>-mhw-mul</B><DD>
|
|
|
|
|
|
<DT id="3150"><B>-mno-hw-mulx</B><DD>
|
|
|
|
|
|
<DT id="3151"><B>-mhw-mulx</B><DD>
|
|
|
|
|
|
<DT id="3152"><B>-mno-hw-div</B><DD>
|
|
|
|
|
|
<DT id="3153"><B>-mhw-div</B><DD>
|
|
|
|
|
|
|
|
Enable or disable emitting <TT>"mul"</TT>, <TT>"mulx"</TT> and <TT>"div"</TT> family of
|
|
instructions by the compiler. The default is to emit <TT>"mul"</TT>
|
|
and not emit <TT>"div"</TT> and <TT>"mulx"</TT>.
|
|
<DT id="3154"><B>-mbmx</B><DD>
|
|
|
|
|
|
|
|
<DT id="3155"><B>-mno-bmx</B><DD>
|
|
|
|
|
|
<DT id="3156"><B>-mcdx</B><DD>
|
|
|
|
|
|
<DT id="3157"><B>-mno-cdx</B><DD>
|
|
|
|
|
|
|
|
Enable or disable generation of Nios <FONT SIZE="-1">II R2 BMX</FONT> (bit manipulation) and
|
|
<FONT SIZE="-1">CDX</FONT> (code density) instructions. Enabling these instructions also
|
|
requires <B>-march=r2</B>. Since these instructions are optional
|
|
extensions to the R2 architecture, the default is not to emit them.
|
|
<DT id="3158"><B>-mcustom-</B><I>insn</I><B>=</B><I>N</I><DD>
|
|
|
|
|
|
|
|
<DT id="3159"><B>-mno-custom-</B><I>insn</I><DD>
|
|
|
|
|
|
|
|
Each <B>-mcustom-</B><I>insn</I><B>=</B><I>N</I> option enables use of a
|
|
custom instruction with encoding <I>N</I> when generating code that uses
|
|
<I>insn</I>. For example, <B>-mcustom-fadds=253</B> generates custom
|
|
instruction 253 for single-precision floating-point add operations instead
|
|
of the default behavior of using a library call.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The following values of <I>insn</I> are supported. Except as otherwise
|
|
noted, floating-point operations are expected to be implemented with
|
|
normal <FONT SIZE="-1">IEEE 754</FONT> semantics and correspond directly to the C operators or the
|
|
equivalent <FONT SIZE="-1">GCC</FONT> built-in functions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Single-precision floating point:
|
|
<DL COMPACT><DT id="3160"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3161"><B>fadds</B>, <B>fsubs</B>, <B>fdivs</B>, <B>fmuls</B><DD>
|
|
|
|
|
|
Binary arithmetic operations.
|
|
<DT id="3162"><B>fnegs</B><DD>
|
|
|
|
|
|
Unary negation.
|
|
<DT id="3163"><B>fabss</B><DD>
|
|
|
|
|
|
Unary absolute value.
|
|
<DT id="3164"><B>fcmpeqs</B>, <B>fcmpges</B>, <B>fcmpgts</B>, <B>fcmples</B>, <B>fcmplts</B>, <B>fcmpnes</B><DD>
|
|
|
|
|
|
Comparison operations.
|
|
<DT id="3165"><B>fmins</B>, <B>fmaxs</B><DD>
|
|
|
|
|
|
Floating-point minimum and maximum. These instructions are only
|
|
generated if <B>-ffinite-math-only</B> is specified.
|
|
<DT id="3166"><B>fsqrts</B><DD>
|
|
|
|
|
|
Unary square root operation.
|
|
<DT id="3167"><B>fcoss</B>, <B>fsins</B>, <B>ftans</B>, <B>fatans</B>, <B>fexps</B>, <B>flogs</B><DD>
|
|
|
|
|
|
Floating-point trigonometric and exponential functions. These instructions
|
|
are only generated if <B>-funsafe-math-optimizations</B> is also specified.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3168"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Double-precision floating point:
|
|
<DL COMPACT>
|
|
<DT id="3169"><B>faddd</B>, <B>fsubd</B>, <B>fdivd</B>, <B>fmuld</B><DD>
|
|
|
|
|
|
Binary arithmetic operations.
|
|
<DT id="3170"><B>fnegd</B><DD>
|
|
|
|
|
|
Unary negation.
|
|
<DT id="3171"><B>fabsd</B><DD>
|
|
|
|
|
|
Unary absolute value.
|
|
<DT id="3172"><B>fcmpeqd</B>, <B>fcmpged</B>, <B>fcmpgtd</B>, <B>fcmpled</B>, <B>fcmpltd</B>, <B>fcmpned</B><DD>
|
|
|
|
|
|
Comparison operations.
|
|
<DT id="3173"><B>fmind</B>, <B>fmaxd</B><DD>
|
|
|
|
|
|
Double-precision minimum and maximum. These instructions are only
|
|
generated if <B>-ffinite-math-only</B> is specified.
|
|
<DT id="3174"><B>fsqrtd</B><DD>
|
|
|
|
|
|
Unary square root operation.
|
|
<DT id="3175"><B>fcosd</B>, <B>fsind</B>, <B>ftand</B>, <B>fatand</B>, <B>fexpd</B>, <B>flogd</B><DD>
|
|
|
|
|
|
Double-precision trigonometric and exponential functions. These instructions
|
|
are only generated if <B>-funsafe-math-optimizations</B> is also specified.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3176"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Conversions:
|
|
<DL COMPACT>
|
|
<DT id="3177"><B>fextsd</B><DD>
|
|
|
|
|
|
Conversion from single precision to double precision.
|
|
<DT id="3178"><B>ftruncds</B><DD>
|
|
|
|
|
|
Conversion from double precision to single precision.
|
|
<DT id="3179"><B>fixsi</B>, <B>fixsu</B>, <B>fixdi</B>, <B>fixdu</B><DD>
|
|
|
|
|
|
Conversion from floating point to signed or unsigned integer types, with
|
|
truncation towards zero.
|
|
<DT id="3180"><B>round</B><DD>
|
|
|
|
|
|
Conversion from single-precision floating point to signed integer,
|
|
rounding to the nearest integer and ties away from zero.
|
|
This corresponds to the <TT>"__builtin_lroundf"</TT> function when
|
|
<B>-fno-math-errno</B> is used.
|
|
<DT id="3181"><B>floatis</B>, <B>floatus</B>, <B>floatid</B>, <B>floatud</B><DD>
|
|
|
|
|
|
Conversion from signed or unsigned integer types to floating-point types.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3182"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In addition, all of the following transfer instructions for internal
|
|
registers X and Y must be provided to use any of the double-precision
|
|
floating-point instructions. Custom instructions taking two
|
|
double-precision source operands expect the first operand in the
|
|
64-bit register X. The other operand (or only operand of a unary
|
|
operation) is given to the custom arithmetic instruction with the
|
|
least significant half in source register <I>src1</I> and the most
|
|
significant half in <I>src2</I>. A custom instruction that returns a
|
|
double-precision result returns the most significant 32 bits in the
|
|
destination register and the other half in 32-bit register Y.
|
|
<FONT SIZE="-1">GCC</FONT> automatically generates the necessary code sequences to write
|
|
register X and/or read register Y when double-precision floating-point
|
|
instructions are used.
|
|
<DL COMPACT>
|
|
<DT id="3183"><B>fwrx</B><DD>
|
|
|
|
|
|
Write <I>src1</I> into the least significant half of X and <I>src2</I> into
|
|
the most significant half of X.
|
|
<DT id="3184"><B>fwry</B><DD>
|
|
|
|
|
|
Write <I>src1</I> into Y.
|
|
<DT id="3185"><B>frdxhi</B>, <B>frdxlo</B><DD>
|
|
|
|
|
|
Read the most or least (respectively) significant half of X and store it in
|
|
<I>dest</I>.
|
|
<DT id="3186"><B>frdy</B><DD>
|
|
|
|
|
|
Read the value of Y and store it into <I>dest</I>.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3187"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that you can gain more local control over generation of Nios <FONT SIZE="-1">II</FONT> custom
|
|
instructions by using the <TT>"target("custom-</TT>insn<TT>=</TT>N<TT>")"</TT>
|
|
and <TT>"target("no-custom-</TT>insn<TT>")"</TT> function attributes
|
|
or pragmas.
|
|
</DL>
|
|
|
|
<DT id="3188"><B>-mcustom-fpu-cfg=</B><I>name</I><DD>
|
|
|
|
|
|
This option enables a predefined, named set of custom instruction encodings
|
|
(see <B>-mcustom-</B><I>insn</I> above).
|
|
Currently, the following sets are defined:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mcustom-fpu-cfg=60-1</B> is equivalent to:
|
|
<B>-mcustom-fmuls=252
|
|
-mcustom-fadds=253
|
|
-mcustom-fsubs=254
|
|
-fsingle-precision-constant</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mcustom-fpu-cfg=60-2</B> is equivalent to:
|
|
<B>-mcustom-fmuls=252
|
|
-mcustom-fadds=253
|
|
-mcustom-fsubs=254
|
|
-mcustom-fdivs=255
|
|
-fsingle-precision-constant</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mcustom-fpu-cfg=72-3</B> is equivalent to:
|
|
<B>-mcustom-floatus=243
|
|
-mcustom-fixsi=244
|
|
-mcustom-floatis=245
|
|
-mcustom-fcmpgts=246
|
|
-mcustom-fcmples=249
|
|
-mcustom-fcmpeqs=250
|
|
-mcustom-fcmpnes=251
|
|
-mcustom-fmuls=252
|
|
-mcustom-fadds=253
|
|
-mcustom-fsubs=254
|
|
-mcustom-fdivs=255
|
|
-fsingle-precision-constant</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Custom instruction assignments given by individual
|
|
<B>-mcustom-</B><I>insn</I><B>=</B> options override those given by
|
|
<B>-mcustom-fpu-cfg=</B>, regardless of the
|
|
order of the options on the command line.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that you can gain more local control over selection of a <FONT SIZE="-1">FPU</FONT>
|
|
configuration by using the <TT>"target("custom-fpu-cfg=</TT>name<TT>")"</TT>
|
|
function attribute
|
|
or pragma.
|
|
</DL>
|
|
<P>
|
|
|
|
These additional <B>-m</B> options are available for the Altera Nios <FONT SIZE="-1">II
|
|
ELF</FONT> (bare-metal) target:
|
|
<DL COMPACT>
|
|
<DT id="3189"><B>-mhal</B><DD>
|
|
|
|
|
|
Link with <FONT SIZE="-1">HAL BSP.</FONT> This suppresses linking with the GCC-provided C runtime
|
|
startup and termination code, and is typically used in conjunction with
|
|
<B>-msys-crt0=</B> to specify the location of the alternate startup code
|
|
provided by the <FONT SIZE="-1">HAL BSP.</FONT>
|
|
<DT id="3190"><B>-msmallc</B><DD>
|
|
|
|
|
|
Link with a limited version of the C library, <B>-lsmallc</B>, rather than
|
|
Newlib.
|
|
<DT id="3191"><B>-msys-crt0=</B><I>startfile</I><DD>
|
|
|
|
|
|
<I>startfile</I> is the file name of the startfile (crt0) to use
|
|
when linking. This option is only useful in conjunction with <B>-mhal</B>.
|
|
<DT id="3192"><B>-msys-lib=</B><I>systemlib</I><DD>
|
|
|
|
|
|
<I>systemlib</I> is the library name of the library that provides
|
|
low-level system calls required by the C library,
|
|
e.g. <TT>"read"</TT> and <TT>"write"</TT>.
|
|
This option is typically used to link with a library provided by a <FONT SIZE="-1">HAL BSP.</FONT>
|
|
</DL>
|
|
<P>
|
|
|
|
<I>Nvidia </I><FONT SIZE="-1"><I>PTX</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined for Nvidia <FONT SIZE="-1">PTX:</FONT>
|
|
<DL COMPACT>
|
|
<DT id="3193"><B>-m32</B><DD>
|
|
|
|
|
|
|
|
<DT id="3194"><B>-m64</B><DD>
|
|
|
|
|
|
|
|
Generate code for 32-bit or 64-bit <FONT SIZE="-1">ABI.</FONT>
|
|
<DT id="3195"><B>-misa=</B><I>ISA-string</I><DD>
|
|
|
|
|
|
Generate code for given the specified <FONT SIZE="-1">PTX ISA</FONT> (e.g. <B>sm_35</B>). <FONT SIZE="-1">ISA</FONT>
|
|
strings must be lower-case. Valid <FONT SIZE="-1">ISA</FONT> strings include <B>sm_30</B> and
|
|
<B>sm_35</B>. The default <FONT SIZE="-1">ISA</FONT> is sm_30.
|
|
<DT id="3196"><B>-mmainkernel</B><DD>
|
|
|
|
|
|
Link in code for a __main kernel. This is for stand-alone instead of
|
|
offloading execution.
|
|
<DT id="3197"><B>-moptimize</B><DD>
|
|
|
|
|
|
Apply partitioned execution optimizations. This is the default when any
|
|
level of optimization is selected.
|
|
<DT id="3198"><B>-msoft-stack</B><DD>
|
|
|
|
|
|
Generate code that does not use <TT>".local"</TT> memory
|
|
directly for stack storage. Instead, a per-warp stack pointer is
|
|
maintained explicitly. This enables variable-length stack allocation (with
|
|
variable-length arrays or <TT>"alloca"</TT>), and when global memory is used for
|
|
underlying storage, makes it possible to access automatic variables from other
|
|
threads, or with atomic instructions. This code generation variant is used
|
|
for OpenMP offloading, but the option is exposed on its own for the purpose
|
|
of testing the compiler; to generate code suitable for linking into programs
|
|
using OpenMP offloading, use option <B>-mgomp</B>.
|
|
<DT id="3199"><B>-muniform-simt</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">SIMD</FONT> regions. All atomic operations
|
|
and calls to runtime (malloc, free, vprintf) are conditionally executed (iff
|
|
current lane index equals the master lane index), and the register being
|
|
assigned is copied via a shuffle instruction from the master lane. Outside of
|
|
<FONT SIZE="-1">SIMD</FONT> regions lane 0 is the master; inside, each thread sees itself as the
|
|
master. Shared memory array <TT>"int __nvptx_uni[]"</TT> stores all-zeros or
|
|
all-ones bitmasks for each warp, indicating current mode (0 outside of <FONT SIZE="-1">SIMD</FONT>
|
|
regions). Each thread can bitwise-and the bitmask at position <TT>"tid.y"</TT>
|
|
with current lane index to compute the master lane index.
|
|
<DT id="3200"><B>-mgomp</B><DD>
|
|
|
|
|
|
Generate code for use in OpenMP offloading: enables <B>-msoft-stack</B> and
|
|
<B>-muniform-simt</B> options, and selects corresponding multilib variant.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>OpenRISC Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined for OpenRISC:
|
|
<DL COMPACT>
|
|
<DT id="3201"><B>-mboard=</B><I>name</I><DD>
|
|
|
|
|
|
Configure a board specific runtime. This will be passed to the linker for
|
|
newlib board library linking. The default is <TT>"or1ksim"</TT>.
|
|
<DT id="3202"><B>-mnewlib</B><DD>
|
|
|
|
|
|
For compatibility, it's always newlib for elf now.
|
|
<DT id="3203"><B>-mhard-div</B><DD>
|
|
|
|
|
|
Generate code for hardware which supports divide instructions. This is the
|
|
default.
|
|
<DT id="3204"><B>-mhard-mul</B><DD>
|
|
|
|
|
|
Generate code for hardware which supports multiply instructions. This is the
|
|
default.
|
|
<DT id="3205"><B>-mcmov</B><DD>
|
|
|
|
|
|
Generate code for hardware which supports the conditional move (<TT>"l.cmov"</TT>)
|
|
instruction.
|
|
<DT id="3206"><B>-mror</B><DD>
|
|
|
|
|
|
Generate code for hardware which supports rotate right instructions.
|
|
<DT id="3207"><B>-msext</B><DD>
|
|
|
|
|
|
Generate code for hardware which supports sign-extension instructions.
|
|
<DT id="3208"><B>-msfimm</B><DD>
|
|
|
|
|
|
Generate code for hardware which supports set flag immediate (<TT>"l.sf*i"</TT>)
|
|
instructions.
|
|
<DT id="3209"><B>-mshftimm</B><DD>
|
|
|
|
|
|
Generate code for hardware which supports shift immediate related instructions
|
|
(i.e. <TT>"l.srai"</TT>, <TT>"l.srli"</TT>, <TT>"l.slli"</TT>, <TT>"1.rori"</TT>). Note, to
|
|
enable generation of the <TT>"l.rori"</TT> instruction the <B>-mror</B> flag must
|
|
also be specified.
|
|
<DT id="3210"><B>-msoft-div</B><DD>
|
|
|
|
|
|
Generate code for hardware which requires divide instruction emulation.
|
|
<DT id="3211"><B>-msoft-mul</B><DD>
|
|
|
|
|
|
Generate code for hardware which requires multiply instruction emulation.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>PDP-11</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined for the <FONT SIZE="-1">PDP-11:</FONT>
|
|
<DL COMPACT>
|
|
<DT id="3212"><B>-mfpu</B><DD>
|
|
|
|
|
|
Use hardware <FONT SIZE="-1">FPP</FONT> floating point. This is the default. (<FONT SIZE="-1">FIS</FONT> floating
|
|
point on the <FONT SIZE="-1">PDP-11/40</FONT> is not supported.) Implies -m45.
|
|
<DT id="3213"><B>-msoft-float</B><DD>
|
|
|
|
|
|
Do not use hardware floating point.
|
|
<DT id="3214"><B>-mac0</B><DD>
|
|
|
|
|
|
Return floating-point results in ac0 (fr0 in Unix assembler syntax).
|
|
<DT id="3215"><B>-mno-ac0</B><DD>
|
|
|
|
|
|
Return floating-point results in memory. This is the default.
|
|
<DT id="3216"><B>-m40</B><DD>
|
|
|
|
|
|
Generate code for a <FONT SIZE="-1">PDP-11/40.</FONT> Implies -msoft-float -mno-split.
|
|
<DT id="3217"><B>-m45</B><DD>
|
|
|
|
|
|
Generate code for a <FONT SIZE="-1">PDP-11/45.</FONT> This is the default.
|
|
<DT id="3218"><B>-m10</B><DD>
|
|
|
|
|
|
Generate code for a <FONT SIZE="-1">PDP-11/10.</FONT> Implies -msoft-float -mno-split.
|
|
<DT id="3219"><B>-mint16</B><DD>
|
|
|
|
|
|
|
|
<DT id="3220"><B>-mno-int32</B><DD>
|
|
|
|
|
|
|
|
Use 16-bit <TT>"int"</TT>. This is the default.
|
|
<DT id="3221"><B>-mint32</B><DD>
|
|
|
|
|
|
|
|
<DT id="3222"><B>-mno-int16</B><DD>
|
|
|
|
|
|
|
|
Use 32-bit <TT>"int"</TT>.
|
|
<DT id="3223"><B>-msplit</B><DD>
|
|
|
|
|
|
Target has split instruction and data space. Implies -m45.
|
|
<DT id="3224"><B>-munix-asm</B><DD>
|
|
|
|
|
|
Use Unix assembler syntax.
|
|
<DT id="3225"><B>-mdec-asm</B><DD>
|
|
|
|
|
|
Use <FONT SIZE="-1">DEC</FONT> assembler syntax.
|
|
<DT id="3226"><B>-mgnu-asm</B><DD>
|
|
|
|
|
|
Use <FONT SIZE="-1">GNU</FONT> assembler syntax. This is the default.
|
|
<DT id="3227"><B>-mlra</B><DD>
|
|
|
|
|
|
Use the new <FONT SIZE="-1">LRA</FONT> register allocator. By default, the old ``reload''
|
|
allocator is used.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>picoChip Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for picoChip implementations:
|
|
<DL COMPACT>
|
|
<DT id="3228"><B>-mae=</B><I>ae_type</I><DD>
|
|
|
|
|
|
Set the instruction set, register set, and instruction scheduling
|
|
parameters for array element type <I>ae_type</I>. Supported values
|
|
for <I>ae_type</I> are <B></B><FONT SIZE="-1"><B>ANY</B></FONT><B></B>, <B></B><FONT SIZE="-1"><B>MUL</B></FONT><B></B>, and <B></B><FONT SIZE="-1"><B>MAC</B></FONT><B></B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mae=ANY</B> selects a completely generic <FONT SIZE="-1">AE</FONT> type. Code
|
|
generated with this option runs on any of the other <FONT SIZE="-1">AE</FONT> types. The
|
|
code is not as efficient as it would be if compiled for a specific
|
|
<FONT SIZE="-1">AE</FONT> type, and some types of operation (e.g., multiplication) do not
|
|
work properly on all types of <FONT SIZE="-1">AE.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mae=MUL</B> selects a <FONT SIZE="-1">MUL AE</FONT> type. This is the most useful <FONT SIZE="-1">AE</FONT> type
|
|
for compiled code, and is the default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mae=MAC</B> selects a DSP-style <FONT SIZE="-1">MAC AE.</FONT> Code compiled with this
|
|
option may suffer from poor performance of byte (char) manipulation,
|
|
since the <FONT SIZE="-1">DSP AE</FONT> does not provide hardware support for byte load/stores.
|
|
<DT id="3229"><B>-msymbol-as-address</B><DD>
|
|
|
|
|
|
Enable the compiler to directly use a symbol name as an address in a
|
|
load/store instruction, without first loading it into a
|
|
register. Typically, the use of this option generates larger
|
|
programs, which run faster than when the option isn't used. However, the
|
|
results vary from program to program, so it is left as a user option,
|
|
rather than being permanently enabled.
|
|
<DT id="3230"><B>-mno-inefficient-warnings</B><DD>
|
|
|
|
|
|
Disables warnings about the generation of inefficient code. These
|
|
warnings can be generated, for example, when compiling code that
|
|
performs byte-level memory operations on the <FONT SIZE="-1">MAC AE</FONT> type. The <FONT SIZE="-1">MAC AE</FONT> has
|
|
no hardware support for byte-level memory operations, so all byte
|
|
load/stores must be synthesized from word load/store operations. This is
|
|
inefficient and a warning is generated to indicate
|
|
that you should rewrite the code to avoid byte operations, or to target
|
|
an <FONT SIZE="-1">AE</FONT> type that has the necessary hardware support. This option disables
|
|
these warnings.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>PowerPC Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These are listed under
|
|
<P>
|
|
|
|
<I>RISC-V Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These command-line options are defined for RISC-V targets:
|
|
<DL COMPACT>
|
|
<DT id="3231"><B>-mbranch-cost=</B><I>n</I><DD>
|
|
|
|
|
|
Set the cost of branches to roughly <I>n</I> instructions.
|
|
<DT id="3232"><B>-mplt</B><DD>
|
|
|
|
|
|
|
|
<DT id="3233"><B>-mno-plt</B><DD>
|
|
|
|
|
|
|
|
When generating <FONT SIZE="-1">PIC</FONT> code, do or don't allow the use of PLTs. Ignored for
|
|
non-PIC. The default is <B>-mplt</B>.
|
|
<DT id="3234"><B>-mabi=</B><I>ABI-string</I><DD>
|
|
|
|
|
|
Specify integer and floating-point calling convention. <I>ABI-string</I>
|
|
contains two parts: the size of integer types and the registers used for
|
|
floating-point types. For example <B>-march=rv64ifd -mabi=lp64d</B> means that
|
|
<B>long</B> and pointers are 64-bit (implicitly defining <B>int</B> to be
|
|
32-bit), and that floating-point values up to 64 bits wide are passed in F
|
|
registers. Contrast this with <B>-march=rv64ifd -mabi=lp64f</B>, which still
|
|
allows the compiler to generate code that uses the F and D extensions but only
|
|
allows floating-point values up to 32 bits long to be passed in registers; or
|
|
<B>-march=rv64ifd -mabi=lp64</B>, in which no floating-point arguments will be
|
|
passed in registers.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default for this argument is system dependent, users who want a specific
|
|
calling convention should specify one explicitly. The valid calling
|
|
conventions are: <B>ilp32</B>, <B>ilp32f</B>, <B>ilp32d</B>, <B>lp64</B>,
|
|
<B>lp64f</B>, and <B>lp64d</B>. Some calling conventions are impossible to
|
|
implement on some ISAs: for example, <B>-march=rv32if -mabi=ilp32d</B> is
|
|
invalid because the <FONT SIZE="-1">ABI</FONT> requires 64-bit values be passed in F registers, but F
|
|
registers are only 32 bits wide. There is also the <B>ilp32e</B> <FONT SIZE="-1">ABI</FONT> that can
|
|
only be used with the <B>rv32e</B> architecture. This <FONT SIZE="-1">ABI</FONT> is not well
|
|
specified at present, and is subject to change.
|
|
<DT id="3235"><B>-mfdiv</B><DD>
|
|
|
|
|
|
|
|
<DT id="3236"><B>-mno-fdiv</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3237"><B>-mdiv</B><DD>
|
|
|
|
|
|
|
|
<DT id="3238"><B>-mno-div</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3239"><B>-march=</B><I>ISA-string</I><DD>
|
|
|
|
|
|
Generate code for given RISC-V <FONT SIZE="-1">ISA</FONT> (e.g. <B>rv64im</B>). <FONT SIZE="-1">ISA</FONT> strings must be
|
|
lower-case. Examples include <B>rv64i</B>, <B>rv32g</B>, <B>rv32e</B>, and
|
|
<B>rv32imaf</B>.
|
|
<DT id="3240"><B>-mtune=</B><I>processor-string</I><DD>
|
|
|
|
|
|
Optimize the output for the given processor, specified by microarchitecture
|
|
name. Permissible values for this option are: <B>rocket</B>,
|
|
<B>sifive-3-series</B>, <B>sifive-5-series</B>, <B>sifive-7-series</B>,
|
|
and <B>size</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When <B>-mtune=</B> is not specified, the default is <B>rocket</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>size</B> choice is not intended for use by end-users. This is used
|
|
when <B>-Os</B> is specified. It overrides the instruction cost info
|
|
provided by <B>-mtune=</B>, but does not override the pipeline info. This
|
|
helps reduce code size while still giving good performance.
|
|
<DT id="3241"><B>-mpreferred-stack-boundary=</B><I>num</I><DD>
|
|
|
|
|
|
Attempt to keep the stack boundary aligned to a 2 raised to <I>num</I>
|
|
byte boundary. If <B>-mpreferred-stack-boundary</B> is not specified,
|
|
the default is 4 (16 bytes or 128-bits).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> If you use this switch, then you must build all modules with
|
|
the same value, including any libraries. This includes the system libraries
|
|
and startup modules.
|
|
<DT id="3242"><B>-msmall-data-limit=</B><I>n</I><DD>
|
|
|
|
|
|
Put global and static data smaller than <I>n</I> bytes into a special section
|
|
(on some targets).
|
|
<DT id="3243"><B>-msave-restore</B><DD>
|
|
|
|
|
|
|
|
<DT id="3244"><B>-mno-save-restore</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3245"><B>-mstrict-align</B><DD>
|
|
|
|
|
|
|
|
<DT id="3246"><B>-mno-strict-align</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3247"><B>-mcmodel=medlow</B><DD>
|
|
|
|
|
|
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 -2 GiB and +2 GiB. Programs can be
|
|
statically or dynamically linked. This is the default code model.
|
|
<DT id="3248"><B>-mcmodel=medany</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="3249"><B>-mexplicit-relocs</B><DD>
|
|
|
|
|
|
|
|
<DT id="3250"><B>-mno-exlicit-relocs</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3251"><B>-mrelax</B><DD>
|
|
|
|
|
|
|
|
<DT id="3252"><B>-mno-relax</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3253"><B>-memit-attribute</B><DD>
|
|
|
|
|
|
|
|
<DT id="3254"><B>-mno-emit-attribute</B><DD>
|
|
|
|
|
|
|
|
Emit (do not emit) RISC-V attribute to record extra information into <FONT SIZE="-1">ELF</FONT>
|
|
objects. This feature requires at least binutils 2.32.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>RL78</I></FONT><I> Options</I>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="3255"><B>-msim</B><DD>
|
|
|
|
|
|
Links in additional target libraries to support operation within a
|
|
simulator.
|
|
<DT id="3256"><B>-mmul=none</B><DD>
|
|
|
|
|
|
|
|
<DT id="3257"><B>-mmul=g10</B><DD>
|
|
|
|
|
|
<DT id="3258"><B>-mmul=g13</B><DD>
|
|
|
|
|
|
<DT id="3259"><B>-mmul=g14</B><DD>
|
|
|
|
|
|
<DT id="3260"><B>-mmul=rl78</B><DD>
|
|
|
|
|
|
|
|
Specifies the type of hardware multiplication and division support to
|
|
be used. The simplest is <TT>"none"</TT>, which uses software for both
|
|
multiplication and division. This is the default. The <TT>"g13"</TT>
|
|
value is for the hardware multiply/divide peripheral found on the
|
|
<FONT SIZE="-1">RL78/G13</FONT> (S2 core) targets. The <TT>"g14"</TT> value selects the use of
|
|
the multiplication and division instructions supported by the <FONT SIZE="-1">RL78/G14</FONT>
|
|
(S3 core) parts. The value <TT>"rl78"</TT> is an alias for <TT>"g14"</TT> and
|
|
the value <TT>"mg10"</TT> is an alias for <TT>"none"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In addition a C preprocessor macro is defined, based upon the setting
|
|
of this option. Possible values are: <TT>"__RL78_MUL_NONE__"</TT>,
|
|
<TT>"__RL78_MUL_G13__"</TT> or <TT>"__RL78_MUL_G14__"</TT>.
|
|
<DT id="3261"><B>-mcpu=g10</B><DD>
|
|
|
|
|
|
|
|
<DT id="3262"><B>-mcpu=g13</B><DD>
|
|
|
|
|
|
<DT id="3263"><B>-mcpu=g14</B><DD>
|
|
|
|
|
|
<DT id="3264"><B>-mcpu=rl78</B><DD>
|
|
|
|
|
|
|
|
Specifies the <FONT SIZE="-1">RL78</FONT> core to target. The default is the G14 core, also
|
|
known as an S3 core or just <FONT SIZE="-1">RL78.</FONT> The G13 or S2 core does not have
|
|
multiply or divide instructions, instead it uses a hardware peripheral
|
|
for these operations. The G10 or S1 core does not have register
|
|
banks, so it uses a different calling convention.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If this option is set it also selects the type of hardware multiply
|
|
support to use, unless this is overridden by an explicit
|
|
<B>-mmul=none</B> option on the command line. Thus specifying
|
|
<B>-mcpu=g13</B> enables the use of the G13 hardware multiply
|
|
peripheral and specifying <B>-mcpu=g10</B> disables the use of
|
|
hardware multiplications altogether.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note, although the <FONT SIZE="-1">RL78/G14</FONT> core is the default target, specifying
|
|
<B>-mcpu=g14</B> or <B>-mcpu=rl78</B> on the command line does
|
|
change the behavior of the toolchain since it also enables G14
|
|
hardware multiply support. If these options are not specified on the
|
|
command line then software multiplication routines will be used even
|
|
though the code targets the <FONT SIZE="-1">RL78</FONT> core. This is for backwards
|
|
compatibility with older toolchains which did not have hardware
|
|
multiply and divide support.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In addition a C preprocessor macro is defined, based upon the setting
|
|
of this option. Possible values are: <TT>"__RL78_G10__"</TT>,
|
|
<TT>"__RL78_G13__"</TT> or <TT>"__RL78_G14__"</TT>.
|
|
<DT id="3265"><B>-mg10</B><DD>
|
|
|
|
|
|
|
|
<DT id="3266"><B>-mg13</B><DD>
|
|
|
|
|
|
<DT id="3267"><B>-mg14</B><DD>
|
|
|
|
|
|
<DT id="3268"><B>-mrl78</B><DD>
|
|
|
|
|
|
|
|
These are aliases for the corresponding <B>-mcpu=</B> option. They
|
|
are provided for backwards compatibility.
|
|
<DT id="3269"><B>-mallregs</B><DD>
|
|
|
|
|
|
Allow the compiler to use all of the available registers. By default
|
|
registers <TT>"r24..r31"</TT> are reserved for use in interrupt handlers.
|
|
With this option enabled these registers can be used in ordinary
|
|
functions as well.
|
|
<DT id="3270"><B>-m64bit-doubles</B><DD>
|
|
|
|
|
|
|
|
<DT id="3271"><B>-m32bit-doubles</B><DD>
|
|
|
|
|
|
|
|
Make the <TT>"double"</TT> data type be 64 bits (<B>-m64bit-doubles</B>)
|
|
or 32 bits (<B>-m32bit-doubles</B>) in size. The default is
|
|
<B>-m32bit-doubles</B>.
|
|
<DT id="3272"><B>-msave-mduc-in-interrupts</B><DD>
|
|
|
|
|
|
|
|
<DT id="3273"><B>-mno-save-mduc-in-interrupts</B><DD>
|
|
|
|
|
|
|
|
Specifies that interrupt handler functions should preserve the
|
|
<FONT SIZE="-1">MDUC</FONT> registers. This is only necessary if normal code might use
|
|
the <FONT SIZE="-1">MDUC</FONT> registers, for example because it performs multiplication
|
|
and division operations. The default is to ignore the <FONT SIZE="-1">MDUC</FONT> registers
|
|
as this makes the interrupt handlers faster. The target option -mg13
|
|
needs to be passed for this to work as this feature is only available
|
|
on the G13 target (S2 core). The <FONT SIZE="-1">MDUC</FONT> registers will only be saved
|
|
if the interrupt handler performs a multiplication or division
|
|
operation or it calls another function.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>IBM RS/6000</I></FONT><I> and PowerPC Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for the <FONT SIZE="-1">IBM RS/6000</FONT> and PowerPC:
|
|
<DL COMPACT>
|
|
<DT id="3274"><B>-mpowerpc-gpopt</B><DD>
|
|
|
|
|
|
|
|
<DT id="3275"><B>-mno-powerpc-gpopt</B><DD>
|
|
|
|
|
|
<DT id="3276"><B>-mpowerpc-gfxopt</B><DD>
|
|
|
|
|
|
<DT id="3277"><B>-mno-powerpc-gfxopt</B><DD>
|
|
|
|
|
|
<DT id="3278"><B>-mpowerpc64</B><DD>
|
|
|
|
|
|
<DT id="3279"><B>-mno-powerpc64</B><DD>
|
|
|
|
|
|
<DT id="3280"><B>-mmfcrf</B><DD>
|
|
|
|
|
|
<DT id="3281"><B>-mno-mfcrf</B><DD>
|
|
|
|
|
|
<DT id="3282"><B>-mpopcntb</B><DD>
|
|
|
|
|
|
<DT id="3283"><B>-mno-popcntb</B><DD>
|
|
|
|
|
|
<DT id="3284"><B>-mpopcntd</B><DD>
|
|
|
|
|
|
<DT id="3285"><B>-mno-popcntd</B><DD>
|
|
|
|
|
|
<DT id="3286"><B>-mfprnd</B><DD>
|
|
|
|
|
|
<DT id="3287"><B>-mno-fprnd</B><DD>
|
|
|
|
|
|
<DT id="3288"><B>-mcmpb</B><DD>
|
|
|
|
|
|
<DT id="3289"><B>-mno-cmpb</B><DD>
|
|
|
|
|
|
<DT id="3290"><B>-mmfpgpr</B><DD>
|
|
|
|
|
|
<DT id="3291"><B>-mno-mfpgpr</B><DD>
|
|
|
|
|
|
<DT id="3292"><B>-mhard-dfp</B><DD>
|
|
|
|
|
|
<DT id="3293"><B>-mno-hard-dfp</B><DD>
|
|
|
|
|
|
|
|
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 <FONT SIZE="-1">GCC.</FONT> Specifying the
|
|
<B>-mcpu=</B><I>cpu_type</I> overrides the specification of these
|
|
options. We recommend you use the <B>-mcpu=</B><I>cpu_type</I> option
|
|
rather than the options listed above.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Specifying <B>-mpowerpc-gpopt</B> allows
|
|
<FONT SIZE="-1">GCC</FONT> to use the optional PowerPC architecture instructions in the
|
|
General Purpose group, including floating-point square root. Specifying
|
|
<B>-mpowerpc-gfxopt</B> allows <FONT SIZE="-1">GCC</FONT> to
|
|
use the optional PowerPC architecture instructions in the Graphics
|
|
group, including floating-point select.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-mmfcrf</B> option allows <FONT SIZE="-1">GCC</FONT> to generate the move from
|
|
condition register field instruction implemented on the <FONT SIZE="-1">POWER4</FONT>
|
|
processor and other processors that support the PowerPC V2.01
|
|
architecture.
|
|
The <B>-mpopcntb</B> option allows <FONT SIZE="-1">GCC</FONT> to generate the popcount and
|
|
double-precision <FONT SIZE="-1">FP</FONT> reciprocal estimate instruction implemented on the
|
|
<FONT SIZE="-1">POWER5</FONT> processor and other processors that support the PowerPC V2.02
|
|
architecture.
|
|
The <B>-mpopcntd</B> option allows <FONT SIZE="-1">GCC</FONT> to generate the popcount
|
|
instruction implemented on the <FONT SIZE="-1">POWER7</FONT> processor and other processors
|
|
that support the PowerPC V2.06 architecture.
|
|
The <B>-mfprnd</B> option allows <FONT SIZE="-1">GCC</FONT> to generate the <FONT SIZE="-1">FP</FONT> round to
|
|
integer instructions implemented on the <FONT SIZE="-1">POWER5+</FONT> processor and other
|
|
processors that support the PowerPC V2.03 architecture.
|
|
The <B>-mcmpb</B> option allows <FONT SIZE="-1">GCC</FONT> to generate the compare bytes
|
|
instruction implemented on the <FONT SIZE="-1">POWER6</FONT> processor and other processors
|
|
that support the PowerPC V2.05 architecture.
|
|
The <B>-mmfpgpr</B> option allows <FONT SIZE="-1">GCC</FONT> to generate the <FONT SIZE="-1">FP</FONT> move to/from
|
|
general-purpose register instructions implemented on the <FONT SIZE="-1">POWER6X</FONT>
|
|
processor and other processors that support the extended PowerPC V2.05
|
|
architecture.
|
|
The <B>-mhard-dfp</B> option allows <FONT SIZE="-1">GCC</FONT> to generate the decimal
|
|
floating-point instructions implemented on some <FONT SIZE="-1">POWER</FONT> processors.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-mpowerpc64</B> option allows <FONT SIZE="-1">GCC</FONT> to generate the additional
|
|
64-bit instructions that are found in the full PowerPC64 architecture
|
|
and to treat GPRs as 64-bit, doubleword quantities. <FONT SIZE="-1">GCC</FONT> defaults to
|
|
<B>-mno-powerpc64</B>.
|
|
<DT id="3294"><B>-mcpu=</B><I>cpu_type</I><DD>
|
|
|
|
|
|
Set architecture type, register usage, and
|
|
instruction scheduling parameters for machine type <I>cpu_type</I>.
|
|
Supported values for <I>cpu_type</I> are <B>401</B>, <B>403</B>,
|
|
<B>405</B>, <B>405fp</B>, <B>440</B>, <B>440fp</B>, <B>464</B>, <B>464fp</B>,
|
|
<B>476</B>, <B>476fp</B>, <B>505</B>, <B>601</B>, <B>602</B>, <B>603</B>,
|
|
<B>603e</B>, <B>604</B>, <B>604e</B>, <B>620</B>, <B>630</B>, <B>740</B>,
|
|
<B>7400</B>, <B>7450</B>, <B>750</B>, <B>801</B>, <B>821</B>, <B>823</B>,
|
|
<B>860</B>, <B>970</B>, <B>8540</B>, <B>a2</B>, <B>e300c2</B>,
|
|
<B>e300c3</B>, <B>e500mc</B>, <B>e500mc64</B>, <B>e5500</B>,
|
|
<B>e6500</B>, <B>ec603e</B>, <B>G3</B>, <B>G4</B>, <B>G5</B>,
|
|
<B>titan</B>, <B>power3</B>, <B>power4</B>, <B>power5</B>, <B>power5+</B>,
|
|
<B>power6</B>, <B>power6x</B>, <B>power7</B>, <B>power8</B>,
|
|
<B>power9</B>, <B>powerpc</B>, <B>powerpc64</B>, <B>powerpc64le</B>,
|
|
<B>rs64</B>, and <B>native</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mcpu=powerpc</B>, <B>-mcpu=powerpc64</B>, and
|
|
<B>-mcpu=powerpc64le</B> specify pure 32-bit PowerPC (either
|
|
endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
|
|
architecture machine types, with an appropriate, generic processor
|
|
model assumed for scheduling purposes.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Specifying <B>native</B> as cpu type detects and selects the
|
|
architecture option that corresponds to the host processor of the
|
|
system performing the compilation.
|
|
<B>-mcpu=native</B> has no effect if <FONT SIZE="-1">GCC</FONT> does not recognize the
|
|
processor.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The other options specify a specific processor. Code generated under
|
|
those options runs best on that processor, and may not run at all on
|
|
others.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-mcpu</B> options automatically enable or disable the
|
|
following options:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-maltivec -mfprnd -mhard-float -mmfcrf -mmultiple
|
|
-mpopcntb -mpopcntd -mpowerpc64
|
|
-mpowerpc-gpopt -mpowerpc-gfxopt
|
|
-mmulhw -mdlmzb -mmfpgpr -mvsx
|
|
-mcrypto -mhtm -mpower8-fusion -mpower8-vector
|
|
-mquad-memory -mquad-memory-atomic -mfloat128 -mfloat128-hardware</B>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The particular options set for any particular <FONT SIZE="-1">CPU</FONT> varies between
|
|
compiler versions, depending on what setting seems to produce optimal
|
|
code for that <FONT SIZE="-1">CPU</FONT>; it doesn't necessarily reflect the actual hardware's
|
|
capabilities. If you wish to set an individual option to a particular
|
|
value, you may specify it after the <B>-mcpu</B> option, like
|
|
<B>-mcpu=970 -mno-altivec</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On <FONT SIZE="-1">AIX,</FONT> the <B>-maltivec</B> and <B>-mpowerpc64</B> options are
|
|
not enabled or disabled by the <B>-mcpu</B> option at present because
|
|
<FONT SIZE="-1">AIX</FONT> does not have full support for these options. You may still
|
|
enable or disable them individually if you're sure it'll work in your
|
|
environment.
|
|
<DT id="3295"><B>-mtune=</B><I>cpu_type</I><DD>
|
|
|
|
|
|
Set the instruction scheduling parameters for machine type
|
|
<I>cpu_type</I>, but do not set the architecture type or register usage,
|
|
as <B>-mcpu=</B><I>cpu_type</I> does. The same
|
|
values for <I>cpu_type</I> are used for <B>-mtune</B> as for
|
|
<B>-mcpu</B>. If both are specified, the code generated uses the
|
|
architecture and registers set by <B>-mcpu</B>, but the
|
|
scheduling parameters set by <B>-mtune</B>.
|
|
<DT id="3296"><B>-mcmodel=small</B><DD>
|
|
|
|
|
|
Generate PowerPC64 code for the small model: The <FONT SIZE="-1">TOC</FONT> is limited to
|
|
64k.
|
|
<DT id="3297"><B>-mcmodel=medium</B><DD>
|
|
|
|
|
|
Generate PowerPC64 code for the medium model: The <FONT SIZE="-1">TOC</FONT> and other static
|
|
data may be up to a total of 4G in size. This is the default for 64-bit
|
|
Linux.
|
|
<DT id="3298"><B>-mcmodel=large</B><DD>
|
|
|
|
|
|
Generate PowerPC64 code for the large model: The <FONT SIZE="-1">TOC</FONT> may be up to 4G
|
|
in size. Other data and code is only limited by the 64-bit address
|
|
space.
|
|
<DT id="3299"><B>-maltivec</B><DD>
|
|
|
|
|
|
|
|
<DT id="3300"><B>-mno-altivec</B><DD>
|
|
|
|
|
|
|
|
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
|
|
<B>-mabi=altivec</B> to adjust the current <FONT SIZE="-1">ABI</FONT> with AltiVec <FONT SIZE="-1">ABI</FONT>
|
|
enhancements.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When <B>-maltivec</B> is used, the element order for AltiVec intrinsics
|
|
such as <TT>"vec_splat"</TT>, <TT>"vec_extract"</TT>, and <TT>"vec_insert"</TT>
|
|
match array element order corresponding to the endianness of the
|
|
target. That is, element zero identifies the leftmost element in a
|
|
vector register when targeting a big-endian platform, and identifies
|
|
the rightmost element in a vector register when targeting a
|
|
little-endian platform.
|
|
<DT id="3301"><B>-mvrsave</B><DD>
|
|
|
|
|
|
|
|
<DT id="3302"><B>-mno-vrsave</B><DD>
|
|
|
|
|
|
|
|
Generate <FONT SIZE="-1">VRSAVE</FONT> instructions when generating AltiVec code.
|
|
<DT id="3303"><B>-msecure-plt</B><DD>
|
|
|
|
|
|
Generate code that allows <B>ld</B> and <B>ld.so</B>
|
|
to build executables and shared
|
|
libraries with non-executable <TT>".plt"</TT> and <TT>".got"</TT> sections.
|
|
This is a PowerPC
|
|
32-bit <FONT SIZE="-1">SYSV ABI</FONT> option.
|
|
<DT id="3304"><B>-mbss-plt</B><DD>
|
|
|
|
|
|
Generate code that uses a <FONT SIZE="-1">BSS</FONT> <TT>".plt"</TT> section that <B>ld.so</B>
|
|
fills in, and
|
|
requires <TT>".plt"</TT> and <TT>".got"</TT>
|
|
sections that are both writable and executable.
|
|
This is a PowerPC 32-bit <FONT SIZE="-1">SYSV ABI</FONT> option.
|
|
<DT id="3305"><B>-misel</B><DD>
|
|
|
|
|
|
|
|
<DT id="3306"><B>-mno-isel</B><DD>
|
|
|
|
|
|
|
|
This switch enables or disables the generation of <FONT SIZE="-1">ISEL</FONT> instructions.
|
|
<DT id="3307"><B>-mvsx</B><DD>
|
|
|
|
|
|
|
|
<DT id="3308"><B>-mno-vsx</B><DD>
|
|
|
|
|
|
|
|
Generate code that uses (does not use) vector/scalar (<FONT SIZE="-1">VSX</FONT>)
|
|
instructions, and also enable the use of built-in functions that allow
|
|
more direct access to the <FONT SIZE="-1">VSX</FONT> instruction set.
|
|
<DT id="3309"><B>-mcrypto</B><DD>
|
|
|
|
|
|
|
|
<DT id="3310"><B>-mno-crypto</B><DD>
|
|
|
|
|
|
|
|
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 <FONT SIZE="-1">ISA.</FONT>
|
|
<DT id="3311"><B>-mhtm</B><DD>
|
|
|
|
|
|
|
|
<DT id="3312"><B>-mno-htm</B><DD>
|
|
|
|
|
|
|
|
Enable (disable) the use of the built-in functions that allow direct
|
|
access to the Hardware Transactional Memory (<FONT SIZE="-1">HTM</FONT>) instructions that
|
|
were added in version 2.07 of the PowerPC <FONT SIZE="-1">ISA.</FONT>
|
|
<DT id="3313"><B>-mpower8-fusion</B><DD>
|
|
|
|
|
|
|
|
<DT id="3314"><B>-mno-power8-fusion</B><DD>
|
|
|
|
|
|
|
|
Generate code that keeps (does not keeps) some integer operations
|
|
adjacent so that the instructions can be fused together on power8 and
|
|
later processors.
|
|
<DT id="3315"><B>-mpower8-vector</B><DD>
|
|
|
|
|
|
|
|
<DT id="3316"><B>-mno-power8-vector</B><DD>
|
|
|
|
|
|
|
|
Generate code that uses (does not use) the vector and scalar
|
|
instructions that were added in version 2.07 of the PowerPC <FONT SIZE="-1">ISA.</FONT> Also
|
|
enable the use of built-in functions that allow more direct access to
|
|
the vector instructions.
|
|
<DT id="3317"><B>-mquad-memory</B><DD>
|
|
|
|
|
|
|
|
<DT id="3318"><B>-mno-quad-memory</B><DD>
|
|
|
|
|
|
|
|
Generate code that uses (does not use) the non-atomic quad word memory
|
|
instructions. The <B>-mquad-memory</B> option requires use of
|
|
64-bit mode.
|
|
<DT id="3319"><B>-mquad-memory-atomic</B><DD>
|
|
|
|
|
|
|
|
<DT id="3320"><B>-mno-quad-memory-atomic</B><DD>
|
|
|
|
|
|
|
|
Generate code that uses (does not use) the atomic quad word memory
|
|
instructions. The <B>-mquad-memory-atomic</B> option requires use of
|
|
64-bit mode.
|
|
<DT id="3321"><B>-mfloat128</B><DD>
|
|
|
|
|
|
|
|
<DT id="3322"><B>-mno-float128</B><DD>
|
|
|
|
|
|
|
|
Enable/disable the <I>__float128</I> keyword for <FONT SIZE="-1">IEEE</FONT> 128-bit floating point
|
|
and use either software emulation for <FONT SIZE="-1">IEEE</FONT> 128-bit floating point or
|
|
hardware instructions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <FONT SIZE="-1">VSX</FONT> instruction set (<B>-mvsx</B>, <B>-mcpu=power7</B>,
|
|
<B>-mcpu=power8</B>), or <B>-mcpu=power9</B> must be enabled to
|
|
use the <FONT SIZE="-1">IEEE</FONT> 128-bit floating point support. The <FONT SIZE="-1">IEEE</FONT> 128-bit
|
|
floating point support only works on PowerPC Linux systems.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default for <B>-mfloat128</B> is enabled on PowerPC Linux
|
|
systems using the <FONT SIZE="-1">VSX</FONT> instruction set, and disabled on other systems.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you use the <FONT SIZE="-1">ISA 3.0</FONT> instruction set (<B>-mpower9-vector</B> or
|
|
<B>-mcpu=power9</B>) on a 64-bit system, the <FONT SIZE="-1">IEEE</FONT> 128-bit floating
|
|
point support will also enable the generation of <FONT SIZE="-1">ISA 3.0 IEEE</FONT> 128-bit
|
|
floating point instructions. Otherwise, if you do not specify to
|
|
generate <FONT SIZE="-1">ISA 3.0</FONT> instructions or you are targeting a 32-bit big endian
|
|
system, <FONT SIZE="-1">IEEE</FONT> 128-bit floating point will be done with software
|
|
emulation.
|
|
<DT id="3323"><B>-mfloat128-hardware</B><DD>
|
|
|
|
|
|
|
|
<DT id="3324"><B>-mno-float128-hardware</B><DD>
|
|
|
|
|
|
|
|
Enable/disable using <FONT SIZE="-1">ISA 3.0</FONT> hardware instructions to support the
|
|
<I>__float128</I> data type.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default for <B>-mfloat128-hardware</B> is enabled on PowerPC
|
|
Linux systems using the <FONT SIZE="-1">ISA 3.0</FONT> instruction set, and disabled on other
|
|
systems.
|
|
<DT id="3325"><B>-m32</B><DD>
|
|
|
|
|
|
|
|
<DT id="3326"><B>-m64</B><DD>
|
|
|
|
|
|
|
|
Generate code for 32-bit or 64-bit environments of Darwin and <FONT SIZE="-1">SVR4</FONT>
|
|
targets (including GNU/Linux). The 32-bit environment sets int, long
|
|
and pointer to 32 bits and generates code that runs on any PowerPC
|
|
variant. The 64-bit environment sets int to 32 bits and long and
|
|
pointer to 64 bits, and generates code for PowerPC64, as for
|
|
<B>-mpowerpc64</B>.
|
|
<DT id="3327"><B>-mfull-toc</B><DD>
|
|
|
|
|
|
|
|
<DT id="3328"><B>-mno-fp-in-toc</B><DD>
|
|
|
|
|
|
<DT id="3329"><B>-mno-sum-in-toc</B><DD>
|
|
|
|
|
|
<DT id="3330"><B>-mminimal-toc</B><DD>
|
|
|
|
|
|
|
|
Modify generation of the <FONT SIZE="-1">TOC</FONT> (Table Of Contents), which is created for
|
|
every executable file. The <B>-mfull-toc</B> option is selected by
|
|
default. In that case, <FONT SIZE="-1">GCC</FONT> allocates at least one <FONT SIZE="-1">TOC</FONT> entry for
|
|
each unique non-automatic variable reference in your program. <FONT SIZE="-1">GCC</FONT>
|
|
also places floating-point constants in the <FONT SIZE="-1">TOC.</FONT> However, only
|
|
16,384 entries are available in the <FONT SIZE="-1">TOC.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you receive a linker error message that saying you have overflowed
|
|
the available <FONT SIZE="-1">TOC</FONT> space, you can reduce the amount of <FONT SIZE="-1">TOC</FONT> space used
|
|
with the <B>-mno-fp-in-toc</B> and <B>-mno-sum-in-toc</B> options.
|
|
<B>-mno-fp-in-toc</B> prevents <FONT SIZE="-1">GCC</FONT> from putting floating-point
|
|
constants in the <FONT SIZE="-1">TOC</FONT> and <B>-mno-sum-in-toc</B> forces <FONT SIZE="-1">GCC</FONT> to
|
|
generate code to calculate the sum of an address and a constant at
|
|
run time instead of putting that sum into the <FONT SIZE="-1">TOC.</FONT> You may specify one
|
|
or both of these options. Each causes <FONT SIZE="-1">GCC</FONT> to produce very slightly
|
|
slower and larger code at the expense of conserving <FONT SIZE="-1">TOC</FONT> space.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you still run out of space in the <FONT SIZE="-1">TOC</FONT> even when you specify both of
|
|
these options, specify <B>-mminimal-toc</B> instead. This option causes
|
|
<FONT SIZE="-1">GCC</FONT> to make only one <FONT SIZE="-1">TOC</FONT> entry for every file. When you specify this
|
|
option, <FONT SIZE="-1">GCC</FONT> produces code that is slower and larger but which
|
|
uses extremely little <FONT SIZE="-1">TOC</FONT> space. You may wish to use this option
|
|
only on files that contain less frequently-executed code.
|
|
<DT id="3331"><B>-maix64</B><DD>
|
|
|
|
|
|
|
|
<DT id="3332"><B>-maix32</B><DD>
|
|
|
|
|
|
|
|
Enable 64-bit <FONT SIZE="-1">AIX ABI</FONT> and calling convention: 64-bit pointers, 64-bit
|
|
<TT>"long"</TT> type, and the infrastructure needed to support them.
|
|
Specifying <B>-maix64</B> implies <B>-mpowerpc64</B>,
|
|
while <B>-maix32</B> disables the 64-bit <FONT SIZE="-1">ABI</FONT> and
|
|
implies <B>-mno-powerpc64</B>. <FONT SIZE="-1">GCC</FONT> defaults to <B>-maix32</B>.
|
|
<DT id="3333"><B>-mxl-compat</B><DD>
|
|
|
|
|
|
|
|
<DT id="3334"><B>-mno-xl-compat</B><DD>
|
|
|
|
|
|
|
|
Produce code that conforms more closely to <FONT SIZE="-1">IBM XL</FONT> compiler semantics
|
|
when using AIX-compatible <FONT SIZE="-1">ABI.</FONT> Pass floating-point arguments to
|
|
prototyped functions beyond the register save area (<FONT SIZE="-1">RSA</FONT>) on the stack
|
|
in addition to argument FPRs. Do not assume that most significant
|
|
double in 128-bit long double value is properly rounded when comparing
|
|
values and converting to double. Use <FONT SIZE="-1">XL</FONT> symbol names for long double
|
|
support routines.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <FONT SIZE="-1">AIX</FONT> calling convention was extended but not initially documented to
|
|
handle an obscure K&R C case of calling a function that takes the
|
|
address of its arguments with fewer arguments than declared. <FONT SIZE="-1">IBM XL</FONT>
|
|
compilers access floating-point arguments that do not fit in the
|
|
<FONT SIZE="-1">RSA</FONT> from the stack when a subroutine is compiled without
|
|
optimization. Because always storing floating-point arguments on the
|
|
stack is inefficient and rarely needed, this option is not enabled by
|
|
default and only is necessary when calling subroutines compiled by <FONT SIZE="-1">IBM
|
|
XL</FONT> compilers without optimization.
|
|
<DT id="3335"><B>-mpe</B><DD>
|
|
|
|
|
|
Support <I></I><FONT SIZE="-1"><I>IBM RS/6000 SP</I></FONT><I></I> <I>Parallel Environment</I> (<FONT SIZE="-1">PE</FONT>). Link an
|
|
application written to use message passing with special startup code to
|
|
enable the application to run. The system must have <FONT SIZE="-1">PE</FONT> installed in the
|
|
standard location (<I>/usr/lpp/ppe.poe/</I>), or the <I>specs</I> file
|
|
must be overridden with the <B>-specs=</B> option to specify the
|
|
appropriate directory location. The Parallel Environment does not
|
|
support threads, so the <B>-mpe</B> option and the <B>-pthread</B>
|
|
option are incompatible.
|
|
<DT id="3336"><B>-malign-natural</B><DD>
|
|
|
|
|
|
|
|
<DT id="3337"><B>-malign-power</B><DD>
|
|
|
|
|
|
|
|
On <FONT SIZE="-1">AIX,</FONT> 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
|
|
<B>-malign-natural</B> overrides the ABI-defined alignment of larger
|
|
types, such as floating-point doubles, on their natural size-based boundary.
|
|
The option <B>-malign-power</B> instructs <FONT SIZE="-1">GCC</FONT> to follow the ABI-specified
|
|
alignment rules. <FONT SIZE="-1">GCC</FONT> defaults to the standard alignment defined in the <FONT SIZE="-1">ABI.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On 64-bit Darwin, natural alignment is the default, and <B>-malign-power</B>
|
|
is not supported.
|
|
<DT id="3338"><B>-msoft-float</B><DD>
|
|
|
|
|
|
|
|
<DT id="3339"><B>-mhard-float</B><DD>
|
|
|
|
|
|
|
|
Generate code that does not use (uses) the floating-point register set.
|
|
Software floating-point emulation is provided if you use the
|
|
<B>-msoft-float</B> option, and pass the option to <FONT SIZE="-1">GCC</FONT> when linking.
|
|
<DT id="3340"><B>-mmultiple</B><DD>
|
|
|
|
|
|
|
|
<DT id="3341"><B>-mno-multiple</B><DD>
|
|
|
|
|
|
|
|
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 <FONT SIZE="-1">POWER</FONT> systems, and not
|
|
generated on PowerPC systems. Do not use <B>-mmultiple</B> on little-endian
|
|
PowerPC systems, since those instructions do not work when the
|
|
processor is in little-endian mode. The exceptions are <FONT SIZE="-1">PPC740</FONT> and
|
|
<FONT SIZE="-1">PPC750</FONT> which permit these instructions in little-endian mode.
|
|
<DT id="3342"><B>-mupdate</B><DD>
|
|
|
|
|
|
|
|
<DT id="3343"><B>-mno-update</B><DD>
|
|
|
|
|
|
|
|
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
|
|
<B>-mno-update</B>, there is a small window between the time that the
|
|
stack pointer is updated and the address of the previous frame is
|
|
stored, which means code that walks the stack frame across interrupts or
|
|
signals may get corrupted data.
|
|
<DT id="3344"><B>-mavoid-indexed-addresses</B><DD>
|
|
|
|
|
|
|
|
<DT id="3345"><B>-mno-avoid-indexed-addresses</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3346"><B>-mfused-madd</B><DD>
|
|
|
|
|
|
|
|
<DT id="3347"><B>-mno-fused-madd</B><DD>
|
|
|
|
|
|
|
|
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
|
|
<B>-mfused-madd</B> option is now mapped to the machine-independent
|
|
<B>-ffp-contract=fast</B> option, and <B>-mno-fused-madd</B> is
|
|
mapped to <B>-ffp-contract=off</B>.
|
|
<DT id="3348"><B>-mmulhw</B><DD>
|
|
|
|
|
|
|
|
<DT id="3349"><B>-mno-mulhw</B><DD>
|
|
|
|
|
|
|
|
Generate code that uses (does not use) the half-word multiply and
|
|
multiply-accumulate instructions on the <FONT SIZE="-1">IBM 405, 440, 464</FONT> and 476 processors.
|
|
These instructions are generated by default when targeting those
|
|
processors.
|
|
<DT id="3350"><B>-mdlmzb</B><DD>
|
|
|
|
|
|
|
|
<DT id="3351"><B>-mno-dlmzb</B><DD>
|
|
|
|
|
|
|
|
Generate code that uses (does not use) the string-search <B>dlmzb</B>
|
|
instruction on the <FONT SIZE="-1">IBM 405, 440, 464</FONT> and 476 processors. This instruction is
|
|
generated by default when targeting those processors.
|
|
<DT id="3352"><B>-mno-bit-align</B><DD>
|
|
|
|
|
|
|
|
<DT id="3353"><B>-mbit-align</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example, by default a structure containing nothing but 8
|
|
<TT>"unsigned"</TT> bit-fields of length 1 is aligned to a 4-byte
|
|
boundary and has a size of 4 bytes. By using <B>-mno-bit-align</B>,
|
|
the structure is aligned to a 1-byte boundary and is 1 byte in
|
|
size.
|
|
<DT id="3354"><B>-mno-strict-align</B><DD>
|
|
|
|
|
|
|
|
<DT id="3355"><B>-mstrict-align</B><DD>
|
|
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems do not (do) assume that
|
|
unaligned memory references are handled by the system.
|
|
<DT id="3356"><B>-mrelocatable</B><DD>
|
|
|
|
|
|
|
|
<DT id="3357"><B>-mno-relocatable</B><DD>
|
|
|
|
|
|
|
|
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
|
|
<TT>".got2"</TT> and 4-byte locations listed in the <TT>".fixup"</TT> section,
|
|
a table of 32-bit addresses generated by this option. For this to
|
|
work, all objects linked together must be compiled with
|
|
<B>-mrelocatable</B> or <B>-mrelocatable-lib</B>.
|
|
<B>-mrelocatable</B> code aligns the stack to an 8-byte boundary.
|
|
<DT id="3358"><B>-mrelocatable-lib</B><DD>
|
|
|
|
|
|
|
|
<DT id="3359"><B>-mno-relocatable-lib</B><DD>
|
|
|
|
|
|
|
|
Like <B>-mrelocatable</B>, <B>-mrelocatable-lib</B> generates a
|
|
<TT>".fixup"</TT> section to allow static executables to be relocated at
|
|
run time, but <B>-mrelocatable-lib</B> does not use the smaller stack
|
|
alignment of <B>-mrelocatable</B>. Objects compiled with
|
|
<B>-mrelocatable-lib</B> may be linked with objects compiled with
|
|
any combination of the <B>-mrelocatable</B> options.
|
|
<DT id="3360"><B>-mno-toc</B><DD>
|
|
|
|
|
|
|
|
<DT id="3361"><B>-mtoc</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3362"><B>-mlittle</B><DD>
|
|
|
|
|
|
|
|
<DT id="3363"><B>-mlittle-endian</B><DD>
|
|
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems compile code for the
|
|
processor in little-endian mode. The <B>-mlittle-endian</B> option is
|
|
the same as <B>-mlittle</B>.
|
|
<DT id="3364"><B>-mbig</B><DD>
|
|
|
|
|
|
|
|
<DT id="3365"><B>-mbig-endian</B><DD>
|
|
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems compile code for the
|
|
processor in big-endian mode. The <B>-mbig-endian</B> option is
|
|
the same as <B>-mbig</B>.
|
|
<DT id="3366"><B>-mdynamic-no-pic</B><DD>
|
|
|
|
|
|
On Darwin and Mac <FONT SIZE="-1">OS X</FONT> 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.
|
|
<DT id="3367"><B>-msingle-pic-base</B><DD>
|
|
|
|
|
|
Treat the register used for <FONT SIZE="-1">PIC</FONT> 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.
|
|
<DT id="3368"><B>-mprioritize-restricted-insns=</B><I>priority</I><DD>
|
|
|
|
|
|
This option controls the priority that is assigned to
|
|
dispatch-slot restricted instructions during the second scheduling
|
|
pass. The argument <I>priority</I> takes the value <B>0</B>, <B>1</B>,
|
|
or <B>2</B> to assign no, highest, or second-highest (respectively)
|
|
priority to dispatch-slot restricted
|
|
instructions.
|
|
<DT id="3369"><B>-msched-costly-dep=</B><I>dependence_type</I><DD>
|
|
|
|
|
|
This option controls which dependences are considered costly
|
|
by the target during instruction scheduling. The argument
|
|
<I>dependence_type</I> takes one of the following values:
|
|
<DL COMPACT><DT id="3370"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3371"><B>no</B><DD>
|
|
|
|
|
|
No dependence is costly.
|
|
<DT id="3372"><B>all</B><DD>
|
|
|
|
|
|
All dependences are costly.
|
|
<DT id="3373"><B>true_store_to_load</B><DD>
|
|
|
|
|
|
A true dependence from store to load is costly.
|
|
<DT id="3374"><B>store_to_load</B><DD>
|
|
|
|
|
|
Any dependence from store to load is costly.
|
|
<DT id="3375"><I>number</I><DD>
|
|
|
|
|
|
Any dependence for which the latency is greater than or equal to
|
|
<I>number</I> is costly.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3376"><DD>
|
|
</DL>
|
|
|
|
<DT id="3377"><B>-minsert-sched-nops=</B><I>scheme</I><DD>
|
|
|
|
|
|
This option controls which <FONT SIZE="-1">NOP</FONT> insertion scheme is used during
|
|
the second scheduling pass. The argument <I>scheme</I> takes one of the
|
|
following values:
|
|
<DL COMPACT><DT id="3378"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3379"><B>no</B><DD>
|
|
|
|
|
|
Don't insert NOPs.
|
|
<DT id="3380"><B>pad</B><DD>
|
|
|
|
|
|
Pad with NOPs any dispatch group that has vacant issue slots,
|
|
according to the scheduler's grouping.
|
|
<DT id="3381"><B>regroup_exact</B><DD>
|
|
|
|
|
|
Insert NOPs to force costly dependent insns into
|
|
separate groups. Insert exactly as many NOPs as needed to force an insn
|
|
to a new group, according to the estimated processor grouping.
|
|
<DT id="3382"><I>number</I><DD>
|
|
|
|
|
|
Insert NOPs to force costly dependent insns into
|
|
separate groups. Insert <I>number</I> NOPs to force an insn to a new group.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3383"><DD>
|
|
</DL>
|
|
|
|
<DT id="3384"><B>-mcall-sysv</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">GCC</FONT> using <B>powerpc-*-eabiaix</B>.
|
|
<DT id="3385"><B>-mcall-sysv-eabi</B><DD>
|
|
|
|
|
|
|
|
<DT id="3386"><B>-mcall-eabi</B><DD>
|
|
|
|
|
|
|
|
Specify both <B>-mcall-sysv</B> and <B>-meabi</B> options.
|
|
<DT id="3387"><B>-mcall-sysv-noeabi</B><DD>
|
|
|
|
|
|
Specify both <B>-mcall-sysv</B> and <B>-mno-eabi</B> options.
|
|
<DT id="3388"><B>-mcall-aixdesc</B><DD>
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems compile code for the <FONT SIZE="-1">AIX</FONT>
|
|
operating system.
|
|
<DT id="3389"><B>-mcall-linux</B><DD>
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems compile code for the
|
|
Linux-based <FONT SIZE="-1">GNU</FONT> system.
|
|
<DT id="3390"><B>-mcall-freebsd</B><DD>
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems compile code for the
|
|
FreeBSD operating system.
|
|
<DT id="3391"><B>-mcall-netbsd</B><DD>
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems compile code for the
|
|
NetBSD operating system.
|
|
<DT id="3392"><B>-mcall-openbsd</B><DD>
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems compile code for the
|
|
OpenBSD operating system.
|
|
<DT id="3393"><B>-mtraceback=</B><I>traceback_type</I><DD>
|
|
|
|
|
|
Select the type of traceback table. Valid values for <I>traceback_type</I>
|
|
are <B>full</B>, <B>part</B>, and <B>no</B>.
|
|
<DT id="3394"><B>-maix-struct-return</B><DD>
|
|
|
|
|
|
Return all structures in memory (as specified by the <FONT SIZE="-1">AIX ABI</FONT>).
|
|
<DT id="3395"><B>-msvr4-struct-return</B><DD>
|
|
|
|
|
|
Return structures smaller than 8 bytes in registers (as specified by the
|
|
<FONT SIZE="-1">SVR4 ABI</FONT>).
|
|
<DT id="3396"><B>-mabi=</B><I>abi-type</I><DD>
|
|
|
|
|
|
Extend the current <FONT SIZE="-1">ABI</FONT> with a particular extension, or remove such extension.
|
|
Valid values are <B>altivec</B>, <B>no-altivec</B>,
|
|
<B>ibmlongdouble</B>, <B>ieeelongdouble</B>,
|
|
<B>elfv1</B>, <B>elfv2</B>.
|
|
<DT id="3397"><B>-mabi=ibmlongdouble</B><DD>
|
|
|
|
|
|
Change the current <FONT SIZE="-1">ABI</FONT> to use <FONT SIZE="-1">IBM</FONT> extended-precision long double.
|
|
This is not likely to work if your system defaults to using <FONT SIZE="-1">IEEE</FONT>
|
|
extended-precision long double. If you change the long double type
|
|
from <FONT SIZE="-1">IEEE</FONT> extended-precision, the compiler will issue a warning unless
|
|
you use the <B>-Wno-psabi</B> option. Requires <B>-mlong-double-128</B>
|
|
to be enabled.
|
|
<DT id="3398"><B>-mabi=ieeelongdouble</B><DD>
|
|
|
|
|
|
Change the current <FONT SIZE="-1">ABI</FONT> to use <FONT SIZE="-1">IEEE</FONT> extended-precision long double.
|
|
This is not likely to work if your system defaults to using <FONT SIZE="-1">IBM</FONT>
|
|
extended-precision long double. If you change the long double type
|
|
from <FONT SIZE="-1">IBM</FONT> extended-precision, the compiler will issue a warning unless
|
|
you use the <B>-Wno-psabi</B> option. Requires <B>-mlong-double-128</B>
|
|
to be enabled.
|
|
<DT id="3399"><B>-mabi=elfv1</B><DD>
|
|
|
|
|
|
Change the current <FONT SIZE="-1">ABI</FONT> to use the ELFv1 <FONT SIZE="-1">ABI.</FONT>
|
|
This is the default <FONT SIZE="-1">ABI</FONT> for big-endian PowerPC 64-bit Linux.
|
|
Overriding the default <FONT SIZE="-1">ABI</FONT> requires special system support and is
|
|
likely to fail in spectacular ways.
|
|
<DT id="3400"><B>-mabi=elfv2</B><DD>
|
|
|
|
|
|
Change the current <FONT SIZE="-1">ABI</FONT> to use the ELFv2 <FONT SIZE="-1">ABI.</FONT>
|
|
This is the default <FONT SIZE="-1">ABI</FONT> for little-endian PowerPC 64-bit Linux.
|
|
Overriding the default <FONT SIZE="-1">ABI</FONT> requires special system support and is
|
|
likely to fail in spectacular ways.
|
|
<DT id="3401"><B>-mgnu-attribute</B><DD>
|
|
|
|
|
|
|
|
<DT id="3402"><B>-mno-gnu-attribute</B><DD>
|
|
|
|
|
|
|
|
Emit .gnu_attribute assembly directives to set tag/value pairs in a
|
|
.gnu.attributes section that specify <FONT SIZE="-1">ABI</FONT> variations in function
|
|
parameters or return values.
|
|
<DT id="3403"><B>-mprototype</B><DD>
|
|
|
|
|
|
|
|
<DT id="3404"><B>-mno-prototype</B><DD>
|
|
|
|
|
|
|
|
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
|
|
set or clear bit 6 of the condition code register (<TT>"CR"</TT>) to
|
|
indicate whether floating-point values are passed in the floating-point
|
|
registers in case the function takes variable arguments. With
|
|
<B>-mprototype</B>, only calls to prototyped variable argument functions
|
|
set or clear the bit.
|
|
<DT id="3405"><B>-msim</B><DD>
|
|
|
|
|
|
On embedded PowerPC systems, assume that the startup module is called
|
|
<I>sim-crt0.o</I> and that the standard C libraries are <I>libsim.a</I> and
|
|
<I>libc.a</I>. This is the default for <B>powerpc-*-eabisim</B>
|
|
configurations.
|
|
<DT id="3406"><B>-mmvme</B><DD>
|
|
|
|
|
|
On embedded PowerPC systems, assume that the startup module is called
|
|
<I>crt0.o</I> and the standard C libraries are <I>libmvme.a</I> and
|
|
<I>libc.a</I>.
|
|
<DT id="3407"><B>-mads</B><DD>
|
|
|
|
|
|
On embedded PowerPC systems, assume that the startup module is called
|
|
<I>crt0.o</I> and the standard C libraries are <I>libads.a</I> and
|
|
<I>libc.a</I>.
|
|
<DT id="3408"><B>-myellowknife</B><DD>
|
|
|
|
|
|
On embedded PowerPC systems, assume that the startup module is called
|
|
<I>crt0.o</I> and the standard C libraries are <I>libyk.a</I> and
|
|
<I>libc.a</I>.
|
|
<DT id="3409"><B>-mvxworks</B><DD>
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems, specify that you are
|
|
compiling for a VxWorks system.
|
|
<DT id="3410"><B>-memb</B><DD>
|
|
|
|
|
|
On embedded PowerPC systems, set the <TT>"PPC_EMB"</TT> bit in the <FONT SIZE="-1">ELF</FONT> flags
|
|
header to indicate that <B>eabi</B> extended relocations are used.
|
|
<DT id="3411"><B>-meabi</B><DD>
|
|
|
|
|
|
|
|
<DT id="3412"><B>-mno-eabi</B><DD>
|
|
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems do (do not) adhere to the
|
|
Embedded Applications Binary Interface (<FONT SIZE="-1">EABI</FONT>), which is a set of
|
|
modifications to the System V.4 specifications. Selecting <B>-meabi</B>
|
|
means that the stack is aligned to an 8-byte boundary, a function
|
|
<TT>"__eabi"</TT> is called from <TT>"main"</TT> to set up the <FONT SIZE="-1">EABI</FONT>
|
|
environment, and the <B>-msdata</B> option can use both <TT>"r2"</TT> and
|
|
<TT>"r13"</TT> to point to two separate small data areas. Selecting
|
|
<B>-mno-eabi</B> means that the stack is aligned to a 16-byte boundary,
|
|
no <FONT SIZE="-1">EABI</FONT> initialization function is called from <TT>"main"</TT>, and the
|
|
<B>-msdata</B> option only uses <TT>"r13"</TT> to point to a single
|
|
small data area. The <B>-meabi</B> option is on by default if you
|
|
configured <FONT SIZE="-1">GCC</FONT> using one of the <B>powerpc*-*-eabi*</B> options.
|
|
<DT id="3413"><B>-msdata=eabi</B><DD>
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems, put small initialized
|
|
<TT>"const"</TT> global and static data in the <TT>".sdata2"</TT> section, which
|
|
is pointed to by register <TT>"r2"</TT>. Put small initialized
|
|
non-<TT>"const"</TT> global and static data in the <TT>".sdata"</TT> section,
|
|
which is pointed to by register <TT>"r13"</TT>. Put small uninitialized
|
|
global and static data in the <TT>".sbss"</TT> section, which is adjacent to
|
|
the <TT>".sdata"</TT> section. The <B>-msdata=eabi</B> option is
|
|
incompatible with the <B>-mrelocatable</B> option. The
|
|
<B>-msdata=eabi</B> option also sets the <B>-memb</B> option.
|
|
<DT id="3414"><B>-msdata=sysv</B><DD>
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems, put small global and static
|
|
data in the <TT>".sdata"</TT> section, which is pointed to by register
|
|
<TT>"r13"</TT>. Put small uninitialized global and static data in the
|
|
<TT>".sbss"</TT> section, which is adjacent to the <TT>".sdata"</TT> section.
|
|
The <B>-msdata=sysv</B> option is incompatible with the
|
|
<B>-mrelocatable</B> option.
|
|
<DT id="3415"><B>-msdata=default</B><DD>
|
|
|
|
|
|
|
|
<DT id="3416"><B>-msdata</B><DD>
|
|
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems, if <B>-meabi</B> is used,
|
|
compile code the same as <B>-msdata=eabi</B>, otherwise compile code the
|
|
same as <B>-msdata=sysv</B>.
|
|
<DT id="3417"><B>-msdata=data</B><DD>
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems, put small global
|
|
data in the <TT>".sdata"</TT> section. Put small uninitialized global
|
|
data in the <TT>".sbss"</TT> section. Do not use register <TT>"r13"</TT>
|
|
to address small data however. This is the default behavior unless
|
|
other <B>-msdata</B> options are used.
|
|
<DT id="3418"><B>-msdata=none</B><DD>
|
|
|
|
|
|
|
|
<DT id="3419"><B>-mno-sdata</B><DD>
|
|
|
|
|
|
|
|
On embedded PowerPC systems, put all initialized global and static data
|
|
in the <TT>".data"</TT> section, and all uninitialized data in the
|
|
<TT>".bss"</TT> section.
|
|
<DT id="3420"><B>-mreadonly-in-sdata</B><DD>
|
|
|
|
|
|
Put read-only objects in the <TT>".sdata"</TT> section as well. This is the
|
|
default.
|
|
<DT id="3421"><B>-mblock-move-inline-limit=</B><I>num</I><DD>
|
|
|
|
|
|
Inline all block moves (such as calls to <TT>"memcpy"</TT> or structure
|
|
copies) less than or equal to <I>num</I> bytes. The minimum value for
|
|
<I>num</I> is 32 bytes on 32-bit targets and 64 bytes on 64-bit
|
|
targets. The default value is target-specific.
|
|
<DT id="3422"><B>-mblock-compare-inline-limit=</B><I>num</I><DD>
|
|
|
|
|
|
Generate non-looping inline code for all block compares (such as calls
|
|
to <TT>"memcmp"</TT> or structure compares) less than or equal to <I>num</I>
|
|
bytes. If <I>num</I> is 0, all inline expansion (non-loop and loop) of
|
|
block compare is disabled. The default value is target-specific.
|
|
<DT id="3423"><B>-mblock-compare-inline-loop-limit=</B><I>num</I><DD>
|
|
|
|
|
|
Generate an inline expansion using loop code for all block compares that
|
|
are less than or equal to <I>num</I> bytes, but greater than the limit
|
|
for non-loop inline block compare expansion. If the block length is not
|
|
constant, at most <I>num</I> bytes will be compared before <TT>"memcmp"</TT>
|
|
is called to compare the remainder of the block. The default value is
|
|
target-specific.
|
|
<DT id="3424"><B>-mstring-compare-inline-limit=</B><I>num</I><DD>
|
|
|
|
|
|
Compare at most <I>num</I> 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 <TT>"strcmp"</TT> or <TT>"strncmp"</TT> will
|
|
take care of the rest of the comparison. The default is 64 bytes.
|
|
<DT id="3425"><B>-G</B> <I>num</I><DD>
|
|
|
|
|
|
On embedded PowerPC systems, put global and static items less than or
|
|
equal to <I>num</I> bytes into the small data or <FONT SIZE="-1">BSS</FONT> sections instead of
|
|
the normal data or <FONT SIZE="-1">BSS</FONT> section. By default, <I>num</I> is 8. The
|
|
<B>-G</B> <I>num</I> switch is also passed to the linker.
|
|
All modules should be compiled with the same <B>-G</B> <I>num</I> value.
|
|
<DT id="3426"><B>-mregnames</B><DD>
|
|
|
|
|
|
|
|
<DT id="3427"><B>-mno-regnames</B><DD>
|
|
|
|
|
|
|
|
On System V.4 and embedded PowerPC systems do (do not) emit register
|
|
names in the assembly language output using symbolic forms.
|
|
<DT id="3428"><B>-mlongcall</B><DD>
|
|
|
|
|
|
|
|
<DT id="3429"><B>-mno-longcall</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
A short call is generated if the compiler knows
|
|
the call cannot be that far away. This setting can be overridden by
|
|
the <TT>"shortcall"</TT> function attribute, or by <TT>"#pragma
|
|
longcall(0)"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Some linkers are capable of detecting out-of-range calls and generating
|
|
glue code on the fly. On these systems, long calls are unnecessary and
|
|
generate slower code. As of this writing, the <FONT SIZE="-1">AIX</FONT> linker can do this,
|
|
as can the <FONT SIZE="-1">GNU</FONT> linker for PowerPC/64. It is planned to add this feature
|
|
to the <FONT SIZE="-1">GNU</FONT> linker for 32-bit PowerPC systems as well.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On PowerPC64 ELFv2 and 32-bit PowerPC systems with newer <FONT SIZE="-1">GNU</FONT> linkers,
|
|
<FONT SIZE="-1">GCC</FONT> can generate long calls using an inline <FONT SIZE="-1">PLT</FONT> call sequence (see
|
|
<B>-mpltseq</B>). PowerPC with <B>-mbss-plt</B> and PowerPC64
|
|
ELFv1 (big-endian) do not support inline <FONT SIZE="-1">PLT</FONT> calls.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On Darwin/PPC systems, <TT>"#pragma longcall"</TT> generates <TT>"jbsr
|
|
callee, L42"</TT>, plus a <I>branch island</I> (glue code). The two target
|
|
addresses represent the callee and the branch island. The
|
|
Darwin/PPC linker prefers the first address and generates a <TT>"bl
|
|
callee"</TT> if the <FONT SIZE="-1">PPC</FONT> <TT>"bl"</TT> instruction reaches the callee directly;
|
|
otherwise, the linker generates <TT>"bl L42"</TT> to call the branch
|
|
island. The branch island is appended to the body of the
|
|
calling function; it computes the full 32-bit address of the callee
|
|
and jumps to it.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On Mach-O (Darwin) systems, this option directs the compiler emit to
|
|
the glue for every direct call, and the Darwin linker decides whether
|
|
to use or discard it.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In the future, <FONT SIZE="-1">GCC</FONT> may ignore all longcall specifications
|
|
when the linker is known to generate glue.
|
|
<DT id="3430"><B>-mpltseq</B><DD>
|
|
|
|
|
|
|
|
<DT id="3431"><B>-mno-pltseq</B><DD>
|
|
|
|
|
|
|
|
Implement (do not implement) -fno-plt and long calls using an inline
|
|
<FONT SIZE="-1">PLT</FONT> call sequence that supports lazy linking and long calls to
|
|
functions in dlopen'd shared libraries. Inline <FONT SIZE="-1">PLT</FONT> calls are only
|
|
supported on PowerPC64 ELFv2 and 32-bit PowerPC systems with newer <FONT SIZE="-1">GNU</FONT>
|
|
linkers, and are enabled by default if the support is detected when
|
|
configuring <FONT SIZE="-1">GCC,</FONT> and, in the case of 32-bit PowerPC, if <FONT SIZE="-1">GCC</FONT> is
|
|
configured with <B>--enable-secureplt</B>. <B>-mpltseq</B> code
|
|
and <B>-mbss-plt</B> 32-bit PowerPC relocatable objects may not be
|
|
linked together.
|
|
<DT id="3432"><B>-mtls-markers</B><DD>
|
|
|
|
|
|
|
|
<DT id="3433"><B>-mno-tls-markers</B><DD>
|
|
|
|
|
|
|
|
Mark (do not mark) calls to <TT>"__tls_get_addr"</TT> with a relocation
|
|
specifying the function argument. The relocation allows the linker to
|
|
reliably associate function call with argument setup instructions for
|
|
<FONT SIZE="-1">TLS</FONT> optimization, which in turn allows <FONT SIZE="-1">GCC</FONT> to better schedule the
|
|
sequence.
|
|
<DT id="3434"><B>-mrecip</B><DD>
|
|
|
|
|
|
|
|
<DT id="3435"><B>-mno-recip</B><DD>
|
|
|
|
|
|
|
|
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
|
|
square root and divide for floating-point arguments. You should use
|
|
the <B>-ffast-math</B> option when using <B>-mrecip</B> (or at
|
|
least <B>-funsafe-math-optimizations</B>,
|
|
<B>-ffinite-math-only</B>, <B>-freciprocal-math</B> and
|
|
<B>-fno-trapping-math</B>). Note that while the throughput of the
|
|
sequence is generally higher than the throughput of the non-reciprocal
|
|
instruction, the precision of the sequence can be decreased by up to 2
|
|
ulp (i.e. the inverse of 1.0 equals 0.99999994) for reciprocal square
|
|
roots.
|
|
<DT id="3436"><B>-mrecip=</B><I>opt</I><DD>
|
|
|
|
|
|
This option controls which reciprocal estimate instructions
|
|
may be used. <I>opt</I> is a comma-separated list of options, which may
|
|
be preceded by a <TT>"!"</TT> to invert the option:
|
|
<DL COMPACT><DT id="3437"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3438"><B>all</B><DD>
|
|
|
|
|
|
Enable all estimate instructions.
|
|
<DT id="3439"><B>default</B><DD>
|
|
|
|
|
|
Enable the default instructions, equivalent to <B>-mrecip</B>.
|
|
<DT id="3440"><B>none</B><DD>
|
|
|
|
|
|
Disable all estimate instructions, equivalent to <B>-mno-recip</B>.
|
|
<DT id="3441"><B>div</B><DD>
|
|
|
|
|
|
Enable the reciprocal approximation instructions for both
|
|
single and double precision.
|
|
<DT id="3442"><B>divf</B><DD>
|
|
|
|
|
|
Enable the single-precision reciprocal approximation instructions.
|
|
<DT id="3443"><B>divd</B><DD>
|
|
|
|
|
|
Enable the double-precision reciprocal approximation instructions.
|
|
<DT id="3444"><B>rsqrt</B><DD>
|
|
|
|
|
|
Enable the reciprocal square root approximation instructions for both
|
|
single and double precision.
|
|
<DT id="3445"><B>rsqrtf</B><DD>
|
|
|
|
|
|
Enable the single-precision reciprocal square root approximation instructions.
|
|
<DT id="3446"><B>rsqrtd</B><DD>
|
|
|
|
|
|
Enable the double-precision reciprocal square root approximation instructions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3447"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
So, for example, <B>-mrecip=all,!rsqrtd</B> enables
|
|
all of the reciprocal estimate instructions, except for the
|
|
<TT>"FRSQRTE"</TT>, <TT>"XSRSQRTEDP"</TT>, and <TT>"XVRSQRTEDP"</TT> instructions
|
|
which handle the double-precision reciprocal square root calculations.
|
|
</DL>
|
|
|
|
<DT id="3448"><B>-mrecip-precision</B><DD>
|
|
|
|
|
|
|
|
<DT id="3449"><B>-mno-recip-precision</B><DD>
|
|
|
|
|
|
|
|
Assume (do not assume) that the reciprocal estimate instructions
|
|
provide higher-precision estimates than is mandated by the PowerPC
|
|
<FONT SIZE="-1">ABI.</FONT> Selecting <B>-mcpu=power6</B>, <B>-mcpu=power7</B> or
|
|
<B>-mcpu=power8</B> automatically selects <B>-mrecip-precision</B>.
|
|
The double-precision square root estimate instructions are not generated by
|
|
default on low-precision machines, since they do not provide an
|
|
estimate that converges after three steps.
|
|
<DT id="3450"><B>-mveclibabi=</B><I>type</I><DD>
|
|
|
|
|
|
Specifies the <FONT SIZE="-1">ABI</FONT> type to use for vectorizing intrinsics using an
|
|
external library. The only type supported at present is <B>mass</B>,
|
|
which specifies to use <FONT SIZE="-1">IBM</FONT>'s Mathematical Acceleration Subsystem
|
|
(<FONT SIZE="-1">MASS</FONT>) libraries for vectorizing intrinsics using external libraries.
|
|
<FONT SIZE="-1">GCC</FONT> currently emits calls to <TT>"acosd2"</TT>, <TT>"acosf4"</TT>,
|
|
<TT>"acoshd2"</TT>, <TT>"acoshf4"</TT>, <TT>"asind2"</TT>, <TT>"asinf4"</TT>,
|
|
<TT>"asinhd2"</TT>, <TT>"asinhf4"</TT>, <TT>"atan2d2"</TT>, <TT>"atan2f4"</TT>,
|
|
<TT>"atand2"</TT>, <TT>"atanf4"</TT>, <TT>"atanhd2"</TT>, <TT>"atanhf4"</TT>,
|
|
<TT>"cbrtd2"</TT>, <TT>"cbrtf4"</TT>, <TT>"cosd2"</TT>, <TT>"cosf4"</TT>,
|
|
<TT>"coshd2"</TT>, <TT>"coshf4"</TT>, <TT>"erfcd2"</TT>, <TT>"erfcf4"</TT>,
|
|
<TT>"erfd2"</TT>, <TT>"erff4"</TT>, <TT>"exp2d2"</TT>, <TT>"exp2f4"</TT>,
|
|
<TT>"expd2"</TT>, <TT>"expf4"</TT>, <TT>"expm1d2"</TT>, <TT>"expm1f4"</TT>,
|
|
<TT>"hypotd2"</TT>, <TT>"hypotf4"</TT>, <TT>"lgammad2"</TT>, <TT>"lgammaf4"</TT>,
|
|
<TT>"log10d2"</TT>, <TT>"log10f4"</TT>, <TT>"log1pd2"</TT>, <TT>"log1pf4"</TT>,
|
|
<TT>"log2d2"</TT>, <TT>"log2f4"</TT>, <TT>"logd2"</TT>, <TT>"logf4"</TT>,
|
|
<TT>"powd2"</TT>, <TT>"powf4"</TT>, <TT>"sind2"</TT>, <TT>"sinf4"</TT>, <TT>"sinhd2"</TT>,
|
|
<TT>"sinhf4"</TT>, <TT>"sqrtd2"</TT>, <TT>"sqrtf4"</TT>, <TT>"tand2"</TT>,
|
|
<TT>"tanf4"</TT>, <TT>"tanhd2"</TT>, and <TT>"tanhf4"</TT> when generating code
|
|
for power7. Both <B>-ftree-vectorize</B> and
|
|
<B>-funsafe-math-optimizations</B> must also be enabled. The <FONT SIZE="-1">MASS</FONT>
|
|
libraries must be specified at link time.
|
|
<DT id="3451"><B>-mfriz</B><DD>
|
|
|
|
|
|
|
|
<DT id="3452"><B>-mno-friz</B><DD>
|
|
|
|
|
|
|
|
Generate (do not generate) the <TT>"friz"</TT> instruction when the
|
|
<B>-funsafe-math-optimizations</B> option is used to optimize
|
|
rounding of floating-point values to 64-bit integer and back to floating
|
|
point. The <TT>"friz"</TT> instruction does not return the same value if
|
|
the floating-point number is too large to fit in an integer.
|
|
<DT id="3453"><B>-mpointers-to-nested-functions</B><DD>
|
|
|
|
|
|
|
|
<DT id="3454"><B>-mno-pointers-to-nested-functions</B><DD>
|
|
|
|
|
|
|
|
Generate (do not generate) code to load up the static chain register
|
|
(<TT>"r11"</TT>) when calling through a pointer on <FONT SIZE="-1">AIX</FONT> and 64-bit Linux
|
|
systems where a function pointer points to a 3-word descriptor giving
|
|
the function address, <FONT SIZE="-1">TOC</FONT> value to be loaded in register <TT>"r2"</TT>, and
|
|
static chain value to be loaded in register <TT>"r11"</TT>. The
|
|
<B>-mpointers-to-nested-functions</B> is on by default. You cannot
|
|
call through pointers to nested functions or pointers
|
|
to functions compiled in other languages that use the static chain if
|
|
you use <B>-mno-pointers-to-nested-functions</B>.
|
|
<DT id="3455"><B>-msave-toc-indirect</B><DD>
|
|
|
|
|
|
|
|
<DT id="3456"><B>-mno-save-toc-indirect</B><DD>
|
|
|
|
|
|
|
|
Generate (do not generate) code to save the <FONT SIZE="-1">TOC</FONT> value in the reserved
|
|
stack location in the function prologue if the function calls through
|
|
a pointer on <FONT SIZE="-1">AIX</FONT> and 64-bit Linux systems. If the <FONT SIZE="-1">TOC</FONT> value is not
|
|
saved in the prologue, it is saved just before the call through the
|
|
pointer. The <B>-mno-save-toc-indirect</B> option is the default.
|
|
<DT id="3457"><B>-mcompat-align-parm</B><DD>
|
|
|
|
|
|
|
|
<DT id="3458"><B>-mno-compat-align-parm</B><DD>
|
|
|
|
|
|
|
|
Generate (do not generate) code to pass structure parameters with a
|
|
maximum alignment of 64 bits, for compatibility with older versions
|
|
of <FONT SIZE="-1">GCC.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Older versions of <FONT SIZE="-1">GCC</FONT> (prior to 4.9.0) incorrectly did not align a
|
|
structure parameter on a 128-bit boundary when that structure contained
|
|
a member requiring 128-bit alignment. This is corrected in more
|
|
recent versions of <FONT SIZE="-1">GCC.</FONT> This option may be used to generate code
|
|
that is compatible with functions compiled with older versions of
|
|
<FONT SIZE="-1">GCC.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-mno-compat-align-parm</B> option is the default.
|
|
<DT id="3459"><B>-mstack-protector-guard=</B><I>guard</I><DD>
|
|
|
|
|
|
|
|
<DT id="3460"><B>-mstack-protector-guard-reg=</B><I>reg</I><DD>
|
|
|
|
|
|
<DT id="3461"><B>-mstack-protector-guard-offset=</B><I>offset</I><DD>
|
|
|
|
|
|
<DT id="3462"><B>-mstack-protector-guard-symbol=</B><I>symbol</I><DD>
|
|
|
|
|
|
|
|
Generate stack protection code using canary at <I>guard</I>. Supported
|
|
locations are <B>global</B> for global canary or <B>tls</B> for per-thread
|
|
canary in the <FONT SIZE="-1">TLS</FONT> block (the default with <FONT SIZE="-1">GNU</FONT> libc version 2.4 or later).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With the latter choice the options
|
|
<B>-mstack-protector-guard-reg=</B><I>reg</I> and
|
|
<B>-mstack-protector-guard-offset=</B><I>offset</I> furthermore specify
|
|
which register to use as base register for reading the canary, and from what
|
|
offset from that base register. The default for those is as specified in the
|
|
relevant <FONT SIZE="-1">ABI.</FONT> <B>-mstack-protector-guard-symbol=</B><I>symbol</I> overrides
|
|
the offset with a symbol reference to a canary in the <FONT SIZE="-1">TLS</FONT> block.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>RX</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These command-line options are defined for <FONT SIZE="-1">RX</FONT> targets:
|
|
<DL COMPACT>
|
|
<DT id="3463"><B>-m64bit-doubles</B><DD>
|
|
|
|
|
|
|
|
<DT id="3464"><B>-m32bit-doubles</B><DD>
|
|
|
|
|
|
|
|
Make the <TT>"double"</TT> data type be 64 bits (<B>-m64bit-doubles</B>)
|
|
or 32 bits (<B>-m32bit-doubles</B>) in size. The default is
|
|
<B>-m32bit-doubles</B>. <I>Note</I> <FONT SIZE="-1">RX</FONT> floating-point hardware only
|
|
works on 32-bit values, which is why the default is
|
|
<B>-m32bit-doubles</B>.
|
|
<DT id="3465"><B>-fpu</B><DD>
|
|
|
|
|
|
|
|
<DT id="3466"><B>-nofpu</B><DD>
|
|
|
|
|
|
|
|
Enables (<B>-fpu</B>) or disables (<B>-nofpu</B>) the use of <FONT SIZE="-1">RX</FONT>
|
|
floating-point hardware. The default is enabled for the <FONT SIZE="-1">RX600</FONT>
|
|
series and disabled for the <FONT SIZE="-1">RX200</FONT> series.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Floating-point instructions are only generated for 32-bit floating-point
|
|
values, however, so the <FONT SIZE="-1">FPU</FONT> hardware is not used for doubles if the
|
|
<B>-m64bit-doubles</B> option is used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<I>Note</I> If the <B>-fpu</B> option is enabled then
|
|
<B>-funsafe-math-optimizations</B> is also enabled automatically.
|
|
This is because the <FONT SIZE="-1">RX FPU</FONT> instructions are themselves unsafe.
|
|
<DT id="3467"><B>-mcpu=</B><I>name</I><DD>
|
|
|
|
|
|
Selects the type of <FONT SIZE="-1">RX CPU</FONT> to be targeted. Currently three types are
|
|
supported, the generic <B></B><FONT SIZE="-1"><B>RX600</B></FONT><B></B> and <B></B><FONT SIZE="-1"><B>RX200</B></FONT><B></B> series hardware and
|
|
the specific <B></B><FONT SIZE="-1"><B>RX610</B></FONT><B></B> <FONT SIZE="-1">CPU.</FONT> The default is <B></B><FONT SIZE="-1"><B>RX600</B></FONT><B></B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The only difference between <B></B><FONT SIZE="-1"><B>RX600</B></FONT><B></B> and <B></B><FONT SIZE="-1"><B>RX610</B></FONT><B></B> is that the
|
|
<B></B><FONT SIZE="-1"><B>RX610</B></FONT><B></B> does not support the <TT>"MVTIPL"</TT> instruction.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B></B><FONT SIZE="-1"><B>RX200</B></FONT><B></B> series does not have a hardware floating-point unit
|
|
and so <B>-nofpu</B> is enabled by default when this type is
|
|
selected.
|
|
<DT id="3468"><B>-mbig-endian-data</B><DD>
|
|
|
|
|
|
|
|
<DT id="3469"><B>-mlittle-endian-data</B><DD>
|
|
|
|
|
|
|
|
Store data (but not code) in the big-endian format. The default is
|
|
<B>-mlittle-endian-data</B>, i.e. to store data in the little-endian
|
|
format.
|
|
<DT id="3470"><B>-msmall-data-limit=</B><I>N</I><DD>
|
|
|
|
|
|
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
|
|
limited and it is up to the programmer to ensure that the area does
|
|
not overflow. Also when the small data area is used one of the <FONT SIZE="-1">RX</FONT>'s
|
|
registers (usually <TT>"r13"</TT>) is reserved for use pointing to this
|
|
area, so it is no longer available for use by the compiler. This
|
|
could result in slower and/or larger code if variables are pushed onto
|
|
the stack instead of being held in this register.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note, common variables (variables that have not been initialized) and
|
|
constants are not placed into the small data area as they are assigned
|
|
to other sections in the output executable.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default value is zero, which disables this feature. Note, this
|
|
feature is not enabled by default with higher optimization levels
|
|
(<B>-O2</B> etc) because of the potentially detrimental effects of
|
|
reserving a register. It is up to the programmer to experiment and
|
|
discover whether this feature is of benefit to their program. See the
|
|
description of the <B>-mpid</B> option for a description of how the
|
|
actual register to hold the small data area pointer is chosen.
|
|
<DT id="3471"><B>-msim</B><DD>
|
|
|
|
|
|
|
|
<DT id="3472"><B>-mno-sim</B><DD>
|
|
|
|
|
|
|
|
Use the simulator runtime. The default is to use the libgloss
|
|
board-specific runtime.
|
|
<DT id="3473"><B>-mas100-syntax</B><DD>
|
|
|
|
|
|
|
|
<DT id="3474"><B>-mno-as100-syntax</B><DD>
|
|
|
|
|
|
|
|
When generating assembler output use a syntax that is compatible with
|
|
Renesas's <FONT SIZE="-1">AS100</FONT> assembler. This syntax can also be handled by the <FONT SIZE="-1">GAS</FONT>
|
|
assembler, but it has some restrictions so it is not generated by default.
|
|
<DT id="3475"><B>-mmax-constant-size=</B><I>N</I><DD>
|
|
|
|
|
|
Specifies the maximum size, in bytes, of a constant that can be used as
|
|
an operand in a <FONT SIZE="-1">RX</FONT> instruction. Although the <FONT SIZE="-1">RX</FONT> instruction set does
|
|
allow constants of up to 4 bytes in length to be used in instructions,
|
|
a longer value equates to a longer instruction. Thus in some
|
|
circumstances it can be beneficial to restrict the size of constants
|
|
that are used in instructions. Constants that are too big are instead
|
|
placed into a constant pool and referenced via register indirection.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The value <I>N</I> can be between 0 and 4. A value of 0 (the default)
|
|
or 4 means that constants of any size are allowed.
|
|
<DT id="3476"><B>-mrelax</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="3477"><B>-mint-register=</B><I>N</I><DD>
|
|
|
|
|
|
Specify the number of registers to reserve for fast interrupt handler
|
|
functions. The value <I>N</I> can be between 0 and 4. A value of 1
|
|
means that register <TT>"r13"</TT> is reserved for the exclusive use
|
|
of fast interrupt handlers. A value of 2 reserves <TT>"r13"</TT> and
|
|
<TT>"r12"</TT>. A value of 3 reserves <TT>"r13"</TT>, <TT>"r12"</TT> and
|
|
<TT>"r11"</TT>, and a value of 4 reserves <TT>"r13"</TT> through <TT>"r10"</TT>.
|
|
A value of 0, the default, does not reserve any registers.
|
|
<DT id="3478"><B>-msave-acc-in-interrupts</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="3479"><B>-mpid</B><DD>
|
|
|
|
|
|
|
|
<DT id="3480"><B>-mno-pid</B><DD>
|
|
|
|
|
|
|
|
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
|
|
determined at run time without requiring the executable to be
|
|
relocated, which is a benefit to embedded applications with tight
|
|
memory constraints. Data that can be modified is not affected by this
|
|
option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note, using this feature reserves a register, usually <TT>"r13"</TT>, for
|
|
the constant data base address. This can result in slower and/or
|
|
larger code, especially in complicated functions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The actual register chosen to hold the constant data base address
|
|
depends upon whether the <B>-msmall-data-limit</B> and/or the
|
|
<B>-mint-register</B> command-line options are enabled. Starting
|
|
with register <TT>"r13"</TT> and proceeding downwards, registers are
|
|
allocated first to satisfy the requirements of <B>-mint-register</B>,
|
|
then <B>-mpid</B> and finally <B>-msmall-data-limit</B>. Thus it
|
|
is possible for the small data area register to be <TT>"r8"</TT> if both
|
|
<B>-mint-register=4</B> and <B>-mpid</B> are specified on the
|
|
command line.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
By default this feature is not enabled. The default can be restored
|
|
via the <B>-mno-pid</B> command-line option.
|
|
<DT id="3481"><B>-mno-warn-multiple-fast-interrupts</B><DD>
|
|
|
|
|
|
|
|
<DT id="3482"><B>-mwarn-multiple-fast-interrupts</B><DD>
|
|
|
|
|
|
|
|
Prevents <FONT SIZE="-1">GCC</FONT> 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 <FONT SIZE="-1">RX</FONT>
|
|
only supports one such interrupt.
|
|
<DT id="3483"><B>-mallow-string-insns</B><DD>
|
|
|
|
|
|
|
|
<DT id="3484"><B>-mno-allow-string-insns</B><DD>
|
|
|
|
|
|
|
|
Enables or disables the use of the string manipulation instructions
|
|
<TT>"SMOVF"</TT>, <TT>"SCMPU"</TT>, <TT>"SMOVB"</TT>, <TT>"SMOVU"</TT>, <TT>"SUNTIL"</TT>
|
|
<TT>"SWHILE"</TT> and also the <TT>"RMPA"</TT> instruction. These
|
|
instructions may prefetch data, which is not safe to do if accessing
|
|
an I/O register. (See section 12.2.7 of the <FONT SIZE="-1">RX62N</FONT> Group User's Manual
|
|
for more information).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is to allow these instructions, but it is not possible for
|
|
<FONT SIZE="-1">GCC</FONT> to reliably detect all circumstances where a string instruction
|
|
might be used to access an I/O register, so their use cannot be
|
|
disabled automatically. Instead it is reliant upon the programmer to
|
|
use the <B>-mno-allow-string-insns</B> option if their program
|
|
accesses I/O space.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When the instructions are enabled <FONT SIZE="-1">GCC</FONT> defines the C preprocessor
|
|
symbol <TT>"__RX_ALLOW_STRING_INSNS__"</TT>, otherwise it defines the
|
|
symbol <TT>"__RX_DISALLOW_STRING_INSNS__"</TT>.
|
|
<DT id="3485"><B>-mjsr</B><DD>
|
|
|
|
|
|
|
|
<DT id="3486"><B>-mno-jsr</B><DD>
|
|
|
|
|
|
|
|
Use only (or not only) <TT>"JSR"</TT> instructions to access functions.
|
|
This option can be used when code size exceeds the range of <TT>"BSR"</TT>
|
|
instructions. Note that <B>-mno-jsr</B> does not mean to not use
|
|
<TT>"JSR"</TT> but instead means that any type of branch may be used.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>Note:</I> The generic <FONT SIZE="-1">GCC</FONT> command-line option <B>-ffixed-</B><I>reg</I>
|
|
has special significance to the <FONT SIZE="-1">RX</FONT> port when used with the
|
|
<TT>"interrupt"</TT> function attribute. This attribute indicates a
|
|
function intended to process fast interrupts. <FONT SIZE="-1">GCC</FONT> ensures
|
|
that it only uses the registers <TT>"r10"</TT>, <TT>"r11"</TT>, <TT>"r12"</TT>
|
|
and/or <TT>"r13"</TT> and only provided that the normal use of the
|
|
corresponding registers have been restricted via the
|
|
<B>-ffixed-</B><I>reg</I> or <B>-mint-register</B> command-line
|
|
options.
|
|
<P>
|
|
|
|
<I>S/390 and zSeries Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These are the <B>-m</B> options defined for the S/390 and zSeries architecture.
|
|
<DL COMPACT>
|
|
<DT id="3487"><B>-mhard-float</B><DD>
|
|
|
|
|
|
|
|
<DT id="3488"><B>-msoft-float</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the hardware floating-point instructions and registers
|
|
for floating-point operations. When <B>-msoft-float</B> is specified,
|
|
functions in <I>libgcc.a</I> are used to perform floating-point
|
|
operations. When <B>-mhard-float</B> is specified, the compiler
|
|
generates <FONT SIZE="-1">IEEE</FONT> floating-point instructions. This is the default.
|
|
<DT id="3489"><B>-mhard-dfp</B><DD>
|
|
|
|
|
|
|
|
<DT id="3490"><B>-mno-hard-dfp</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the hardware decimal-floating-point instructions for
|
|
decimal-floating-point operations. When <B>-mno-hard-dfp</B> is
|
|
specified, functions in <I>libgcc.a</I> are used to perform
|
|
decimal-floating-point operations. When <B>-mhard-dfp</B> is
|
|
specified, the compiler generates decimal-floating-point hardware
|
|
instructions. This is the default for <B>-march=z9-ec</B> or higher.
|
|
<DT id="3491"><B>-mlong-double-64</B><DD>
|
|
|
|
|
|
|
|
<DT id="3492"><B>-mlong-double-128</B><DD>
|
|
|
|
|
|
|
|
These switches control the size of <TT>"long double"</TT> type. A size
|
|
of 64 bits makes the <TT>"long double"</TT> type equivalent to the <TT>"double"</TT>
|
|
type. This is the default.
|
|
<DT id="3493"><B>-mbackchain</B><DD>
|
|
|
|
|
|
|
|
<DT id="3494"><B>-mno-backchain</B><DD>
|
|
|
|
|
|
|
|
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
|
|
<FONT SIZE="-1">DWARF</FONT> call frame information.
|
|
When <B>-mno-packed-stack</B> is in effect, the backchain pointer is stored
|
|
at the bottom of the stack frame; when <B>-mpacked-stack</B> is in effect,
|
|
the backchain is placed into the topmost word of the 96/160 byte register
|
|
save area.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In general, code compiled with <B>-mbackchain</B> is call-compatible with
|
|
code compiled with <B>-mmo-backchain</B>; however, use of the backchain
|
|
for debugging purposes usually requires that the whole binary is built with
|
|
<B>-mbackchain</B>. Note that the combination of <B>-mbackchain</B>,
|
|
<B>-mpacked-stack</B> and <B>-mhard-float</B> is not supported. In order
|
|
to build a linux kernel use <B>-msoft-float</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is to not maintain the backchain.
|
|
<DT id="3495"><B>-mpacked-stack</B><DD>
|
|
|
|
|
|
|
|
<DT id="3496"><B>-mno-packed-stack</B><DD>
|
|
|
|
|
|
|
|
Use (do not use) the packed stack layout. When <B>-mno-packed-stack</B> 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.
|
|
When <B>-mpacked-stack</B> is specified, register save slots are densely
|
|
packed at the top of the register save area; unused space is reused for other
|
|
purposes, allowing for more efficient use of the available stack space.
|
|
However, when <B>-mbackchain</B> is also in effect, the topmost word of
|
|
the save area is always used to store the backchain, and the return address
|
|
register is always saved two words below the backchain.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
As long as the stack frame backchain is not used, code generated with
|
|
<B>-mpacked-stack</B> is call-compatible with code generated with
|
|
<B>-mno-packed-stack</B>. Note that some non-FSF releases of <FONT SIZE="-1">GCC 2.95</FONT> for
|
|
S/390 or zSeries generated code that uses the stack frame backchain at run
|
|
time, not just for debugging purposes. Such code is not call-compatible
|
|
with code compiled with <B>-mpacked-stack</B>. Also, note that the
|
|
combination of <B>-mbackchain</B>,
|
|
<B>-mpacked-stack</B> and <B>-mhard-float</B> is not supported. In order
|
|
to build a linux kernel use <B>-msoft-float</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is to not use the packed stack layout.
|
|
<DT id="3497"><B>-msmall-exec</B><DD>
|
|
|
|
|
|
|
|
<DT id="3498"><B>-mno-small-exec</B><DD>
|
|
|
|
|
|
|
|
Generate (or do not generate) code using the <TT>"bras"</TT> instruction
|
|
to do subroutine calls.
|
|
This only works reliably if the total executable size does not
|
|
exceed 64k. The default is to use the <TT>"basr"</TT> instruction instead,
|
|
which does not have this limitation.
|
|
<DT id="3499"><B>-m64</B><DD>
|
|
|
|
|
|
|
|
<DT id="3500"><B>-m31</B><DD>
|
|
|
|
|
|
|
|
When <B>-m31</B> is specified, generate code compliant to the
|
|
GNU/Linux for S/390 <FONT SIZE="-1">ABI.</FONT> When <B>-m64</B> is specified, generate
|
|
code compliant to the GNU/Linux for zSeries <FONT SIZE="-1">ABI.</FONT> This allows <FONT SIZE="-1">GCC</FONT> in
|
|
particular to generate 64-bit instructions. For the <B>s390</B>
|
|
targets, the default is <B>-m31</B>, while the <B>s390x</B>
|
|
targets default to <B>-m64</B>.
|
|
<DT id="3501"><B>-mzarch</B><DD>
|
|
|
|
|
|
|
|
<DT id="3502"><B>-mesa</B><DD>
|
|
|
|
|
|
|
|
When <B>-mzarch</B> is specified, generate code using the
|
|
instructions available on z/Architecture.
|
|
When <B>-mesa</B> is specified, generate code using the
|
|
instructions available on <FONT SIZE="-1">ESA/390.</FONT> Note that <B>-mesa</B> is
|
|
not possible with <B>-m64</B>.
|
|
When generating code compliant to the GNU/Linux for S/390 <FONT SIZE="-1">ABI,</FONT>
|
|
the default is <B>-mesa</B>. When generating code compliant
|
|
to the GNU/Linux for zSeries <FONT SIZE="-1">ABI,</FONT> the default is <B>-mzarch</B>.
|
|
<DT id="3503"><B>-mhtm</B><DD>
|
|
|
|
|
|
|
|
<DT id="3504"><B>-mno-htm</B><DD>
|
|
|
|
|
|
|
|
The <B>-mhtm</B> option enables a set of builtins making use of
|
|
instructions available with the transactional execution facility
|
|
introduced with the <FONT SIZE="-1">IBM</FONT> zEnterprise <FONT SIZE="-1">EC12</FONT> machine generation
|
|
<B>S/390 System z Built-in Functions</B>.
|
|
<B>-mhtm</B> is enabled by default when using <B>-march=zEC12</B>.
|
|
<DT id="3505"><B>-mvx</B><DD>
|
|
|
|
|
|
|
|
<DT id="3506"><B>-mno-vx</B><DD>
|
|
|
|
|
|
|
|
When <B>-mvx</B> is specified, generate code using the instructions
|
|
available with the vector extension facility introduced with the <FONT SIZE="-1">IBM</FONT>
|
|
z13 machine generation.
|
|
This option changes the <FONT SIZE="-1">ABI</FONT> for some vector type values with regard to
|
|
alignment and calling conventions. In case vector type values are
|
|
being used in an ABI-relevant context a <FONT SIZE="-1">GAS</FONT> <B>.gnu_attribute</B>
|
|
command will be added to mark the resulting binary with the <FONT SIZE="-1">ABI</FONT> used.
|
|
<B>-mvx</B> is enabled by default when using <B>-march=z13</B>.
|
|
<DT id="3507"><B>-mzvector</B><DD>
|
|
|
|
|
|
|
|
<DT id="3508"><B>-mno-zvector</B><DD>
|
|
|
|
|
|
|
|
The <B>-mzvector</B> option enables vector language extensions and
|
|
builtins using instructions available with the vector extension
|
|
facility introduced with the <FONT SIZE="-1">IBM</FONT> z13 machine generation.
|
|
This option adds support for <B>vector</B> to be used as a keyword to
|
|
define vector type variables and arguments. <B>vector</B> is only
|
|
available when <FONT SIZE="-1">GNU</FONT> extensions are enabled. It will not be expanded
|
|
when requesting strict standard compliance e.g. with <B>-std=c99</B>.
|
|
In addition to the <FONT SIZE="-1">GCC</FONT> low-level builtins <B>-mzvector</B> enables
|
|
a set of builtins added for compatibility with AltiVec-style
|
|
implementations like Power and Cell. In order to make use of these
|
|
builtins the header file <I>vecintrin.h</I> needs to be included.
|
|
<B>-mzvector</B> is disabled by default.
|
|
<DT id="3509"><B>-mmvcle</B><DD>
|
|
|
|
|
|
|
|
<DT id="3510"><B>-mno-mvcle</B><DD>
|
|
|
|
|
|
|
|
Generate (or do not generate) code using the <TT>"mvcle"</TT> instruction
|
|
to perform block moves. When <B>-mno-mvcle</B> is specified,
|
|
use a <TT>"mvc"</TT> loop instead. This is the default unless optimizing for
|
|
size.
|
|
<DT id="3511"><B>-mdebug</B><DD>
|
|
|
|
|
|
|
|
<DT id="3512"><B>-mno-debug</B><DD>
|
|
|
|
|
|
|
|
Print (or do not print) additional debug information when compiling.
|
|
The default is to not print debug information.
|
|
<DT id="3513"><B>-march=</B><I>cpu-type</I><DD>
|
|
|
|
|
|
Generate code that runs on <I>cpu-type</I>, which is the name of a
|
|
system representing a certain processor type. Possible values for
|
|
<I>cpu-type</I> are <B>z900</B>/<B>arch5</B>, <B>z990</B>/<B>arch6</B>,
|
|
<B>z9-109</B>, <B>z9-ec</B>/<B>arch7</B>, <B>z10</B>/<B>arch8</B>,
|
|
<B>z196</B>/<B>arch9</B>, <B>zEC12</B>, <B>z13</B>/<B>arch11</B>,
|
|
<B>z14</B>/<B>arch12</B>, and <B>native</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-march=z900</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Specifying <B>native</B> as cpu type can be used to select the best
|
|
architecture option for the host processor.
|
|
<B>-march=native</B> has no effect if <FONT SIZE="-1">GCC</FONT> does not recognize the
|
|
processor.
|
|
<DT id="3514"><B>-mtune=</B><I>cpu-type</I><DD>
|
|
|
|
|
|
Tune to <I>cpu-type</I> everything applicable about the generated code,
|
|
except for the <FONT SIZE="-1">ABI</FONT> and the set of available instructions.
|
|
The list of <I>cpu-type</I> values is the same as for <B>-march</B>.
|
|
The default is the value used for <B>-march</B>.
|
|
<DT id="3515"><B>-mtpf-trace</B><DD>
|
|
|
|
|
|
|
|
<DT id="3516"><B>-mno-tpf-trace</B><DD>
|
|
|
|
|
|
|
|
Generate code that adds (does not add) in <FONT SIZE="-1">TPF OS</FONT> specific branches to trace
|
|
routines in the operating system. This option is off by default, even
|
|
when compiling for the <FONT SIZE="-1">TPF OS.</FONT>
|
|
<DT id="3517"><B>-mfused-madd</B><DD>
|
|
|
|
|
|
|
|
<DT id="3518"><B>-mno-fused-madd</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3519"><B>-mwarn-framesize=</B><I>framesize</I><DD>
|
|
|
|
|
|
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.
|
|
<DT id="3520"><B>-mwarn-dynamicstack</B><DD>
|
|
|
|
|
|
Emit a warning if the function calls <TT>"alloca"</TT> or uses dynamically-sized
|
|
arrays. This is generally a bad idea with a limited stack size.
|
|
<DT id="3521"><B>-mstack-guard=</B><I>stack-guard</I><DD>
|
|
|
|
|
|
|
|
<DT id="3522"><B>-mstack-size=</B><I>stack-size</I><DD>
|
|
|
|
|
|
|
|
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 <I>stack-guard</I>
|
|
bytes above the <I>stack-size</I> (remember that the stack on S/390 grows downward).
|
|
If the <I>stack-guard</I> option is omitted the smallest power of 2 larger than
|
|
the frame size of the compiled function is chosen.
|
|
These options are intended to be used to help debugging stack overflow problems.
|
|
The additionally emitted code causes only little overhead and hence can also be
|
|
used in production-like systems without greater performance degradation. The given
|
|
values have to be exact powers of 2 and <I>stack-size</I> has to be greater than
|
|
<I>stack-guard</I> without exceeding 64k.
|
|
In order to be efficient the extra code makes the assumption that the stack starts
|
|
at an address aligned to the value given by <I>stack-size</I>.
|
|
The <I>stack-guard</I> option can only be used in conjunction with <I>stack-size</I>.
|
|
<DT id="3523"><B>-mhotpatch=</B><I>pre-halfwords</I><B>,</B><I>post-halfwords</I><DD>
|
|
|
|
|
|
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
|
|
<FONT SIZE="-1">NOP</FONT> instructions (<I>pre-halfwords</I>, maximum 1000000). After
|
|
the label, 2 * <I>post-halfwords</I> bytes are appended, using the
|
|
largest <FONT SIZE="-1">NOP</FONT> like instructions the architecture allows (maximum
|
|
1000000).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If both arguments are zero, hotpatching is disabled.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option can be overridden for individual functions with the
|
|
<TT>"hotpatch"</TT> attribute.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>Score Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined for Score implementations:
|
|
<DL COMPACT>
|
|
<DT id="3524"><B>-meb</B><DD>
|
|
|
|
|
|
Compile code for big-endian mode. This is the default.
|
|
<DT id="3525"><B>-mel</B><DD>
|
|
|
|
|
|
Compile code for little-endian mode.
|
|
<DT id="3526"><B>-mnhwloop</B><DD>
|
|
|
|
|
|
Disable generation of <TT>"bcnz"</TT> instructions.
|
|
<DT id="3527"><B>-muls</B><DD>
|
|
|
|
|
|
Enable generation of unaligned load and store instructions.
|
|
<DT id="3528"><B>-mmac</B><DD>
|
|
|
|
|
|
Enable the use of multiply-accumulate instructions. Disabled by default.
|
|
<DT id="3529"><B>-mscore5</B><DD>
|
|
|
|
|
|
Specify the <FONT SIZE="-1">SCORE5</FONT> as the target architecture.
|
|
<DT id="3530"><B>-mscore5u</B><DD>
|
|
|
|
|
|
Specify the <FONT SIZE="-1">SCORE5U</FONT> of the target architecture.
|
|
<DT id="3531"><B>-mscore7</B><DD>
|
|
|
|
|
|
Specify the <FONT SIZE="-1">SCORE7</FONT> as the target architecture. This is the default.
|
|
<DT id="3532"><B>-mscore7d</B><DD>
|
|
|
|
|
|
Specify the <FONT SIZE="-1">SCORE7D</FONT> as the target architecture.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>SH</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for the <FONT SIZE="-1">SH</FONT> implementations:
|
|
<DL COMPACT>
|
|
<DT id="3533"><B>-m1</B><DD>
|
|
|
|
|
|
Generate code for the <FONT SIZE="-1">SH1.</FONT>
|
|
<DT id="3534"><B>-m2</B><DD>
|
|
|
|
|
|
Generate code for the <FONT SIZE="-1">SH2.</FONT>
|
|
<DT id="3535"><B>-m2e</B><DD>
|
|
|
|
|
|
Generate code for the SH2e.
|
|
<DT id="3536"><B>-m2a-nofpu</B><DD>
|
|
|
|
|
|
Generate code for the SH2a without <FONT SIZE="-1">FPU,</FONT> or for a SH2a-FPU in such a way
|
|
that the floating-point unit is not used.
|
|
<DT id="3537"><B>-m2a-single-only</B><DD>
|
|
|
|
|
|
Generate code for the SH2a-FPU, in such a way that no double-precision
|
|
floating-point operations are used.
|
|
<DT id="3538"><B>-m2a-single</B><DD>
|
|
|
|
|
|
Generate code for the SH2a-FPU assuming the floating-point unit is in
|
|
single-precision mode by default.
|
|
<DT id="3539"><B>-m2a</B><DD>
|
|
|
|
|
|
Generate code for the SH2a-FPU assuming the floating-point unit is in
|
|
double-precision mode by default.
|
|
<DT id="3540"><B>-m3</B><DD>
|
|
|
|
|
|
Generate code for the <FONT SIZE="-1">SH3.</FONT>
|
|
<DT id="3541"><B>-m3e</B><DD>
|
|
|
|
|
|
Generate code for the SH3e.
|
|
<DT id="3542"><B>-m4-nofpu</B><DD>
|
|
|
|
|
|
Generate code for the <FONT SIZE="-1">SH4</FONT> without a floating-point unit.
|
|
<DT id="3543"><B>-m4-single-only</B><DD>
|
|
|
|
|
|
Generate code for the <FONT SIZE="-1">SH4</FONT> with a floating-point unit that only
|
|
supports single-precision arithmetic.
|
|
<DT id="3544"><B>-m4-single</B><DD>
|
|
|
|
|
|
Generate code for the <FONT SIZE="-1">SH4</FONT> assuming the floating-point unit is in
|
|
single-precision mode by default.
|
|
<DT id="3545"><B>-m4</B><DD>
|
|
|
|
|
|
Generate code for the <FONT SIZE="-1">SH4.</FONT>
|
|
<DT id="3546"><B>-m4-100</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-100.</FONT>
|
|
<DT id="3547"><B>-m4-100-nofpu</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-100</FONT> in such a way that the
|
|
floating-point unit is not used.
|
|
<DT id="3548"><B>-m4-100-single</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-100</FONT> assuming the floating-point unit is in
|
|
single-precision mode by default.
|
|
<DT id="3549"><B>-m4-100-single-only</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-100</FONT> in such a way that no double-precision
|
|
floating-point operations are used.
|
|
<DT id="3550"><B>-m4-200</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-200.</FONT>
|
|
<DT id="3551"><B>-m4-200-nofpu</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-200</FONT> without in such a way that the
|
|
floating-point unit is not used.
|
|
<DT id="3552"><B>-m4-200-single</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-200</FONT> assuming the floating-point unit is in
|
|
single-precision mode by default.
|
|
<DT id="3553"><B>-m4-200-single-only</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-200</FONT> in such a way that no double-precision
|
|
floating-point operations are used.
|
|
<DT id="3554"><B>-m4-300</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-300.</FONT>
|
|
<DT id="3555"><B>-m4-300-nofpu</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-300</FONT> without in such a way that the
|
|
floating-point unit is not used.
|
|
<DT id="3556"><B>-m4-300-single</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-300</FONT> in such a way that no double-precision
|
|
floating-point operations are used.
|
|
<DT id="3557"><B>-m4-300-single-only</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-300</FONT> in such a way that no double-precision
|
|
floating-point operations are used.
|
|
<DT id="3558"><B>-m4-340</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-340</FONT> (no <FONT SIZE="-1">MMU,</FONT> no <FONT SIZE="-1">FPU</FONT>).
|
|
<DT id="3559"><B>-m4-500</B><DD>
|
|
|
|
|
|
Generate code for <FONT SIZE="-1">SH4-500</FONT> (no <FONT SIZE="-1">FPU</FONT>). Passes <B>-isa=sh4-nofpu</B> to the
|
|
assembler.
|
|
<DT id="3560"><B>-m4a-nofpu</B><DD>
|
|
|
|
|
|
Generate code for the SH4al-dsp, or for a SH4a in such a way that the
|
|
floating-point unit is not used.
|
|
<DT id="3561"><B>-m4a-single-only</B><DD>
|
|
|
|
|
|
Generate code for the SH4a, in such a way that no double-precision
|
|
floating-point operations are used.
|
|
<DT id="3562"><B>-m4a-single</B><DD>
|
|
|
|
|
|
Generate code for the SH4a assuming the floating-point unit is in
|
|
single-precision mode by default.
|
|
<DT id="3563"><B>-m4a</B><DD>
|
|
|
|
|
|
Generate code for the SH4a.
|
|
<DT id="3564"><B>-m4al</B><DD>
|
|
|
|
|
|
Same as <B>-m4a-nofpu</B>, except that it implicitly passes
|
|
<B>-dsp</B> to the assembler. <FONT SIZE="-1">GCC</FONT> doesn't generate any <FONT SIZE="-1">DSP</FONT>
|
|
instructions at the moment.
|
|
<DT id="3565"><B>-mb</B><DD>
|
|
|
|
|
|
Compile code for the processor in big-endian mode.
|
|
<DT id="3566"><B>-ml</B><DD>
|
|
|
|
|
|
Compile code for the processor in little-endian mode.
|
|
<DT id="3567"><B>-mdalign</B><DD>
|
|
|
|
|
|
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 <B>-mdalign</B>.
|
|
<DT id="3568"><B>-mrelax</B><DD>
|
|
|
|
|
|
Shorten some address references at link time, when possible; uses the
|
|
linker option <B>-relax</B>.
|
|
<DT id="3569"><B>-mbigtable</B><DD>
|
|
|
|
|
|
Use 32-bit offsets in <TT>"switch"</TT> tables. The default is to use
|
|
16-bit offsets.
|
|
<DT id="3570"><B>-mbitops</B><DD>
|
|
|
|
|
|
Enable the use of bit manipulation instructions on <FONT SIZE="-1">SH2A.</FONT>
|
|
<DT id="3571"><B>-mfmovd</B><DD>
|
|
|
|
|
|
Enable the use of the instruction <TT>"fmovd"</TT>. Check <B>-mdalign</B> for
|
|
alignment constraints.
|
|
<DT id="3572"><B>-mrenesas</B><DD>
|
|
|
|
|
|
Comply with the calling conventions defined by Renesas.
|
|
<DT id="3573"><B>-mno-renesas</B><DD>
|
|
|
|
|
|
Comply with the calling conventions defined for <FONT SIZE="-1">GCC</FONT> before the Renesas
|
|
conventions were available. This option is the default for all
|
|
targets of the <FONT SIZE="-1">SH</FONT> toolchain.
|
|
<DT id="3574"><B>-mnomacsave</B><DD>
|
|
|
|
|
|
Mark the <TT>"MAC"</TT> register as call-clobbered, even if
|
|
<B>-mrenesas</B> is given.
|
|
<DT id="3575"><B>-mieee</B><DD>
|
|
|
|
|
|
|
|
<DT id="3576"><B>-mno-ieee</B><DD>
|
|
|
|
|
|
|
|
Control the <FONT SIZE="-1">IEEE</FONT> compliance of floating-point comparisons, which affects the
|
|
handling of cases where the result of a comparison is unordered. By default
|
|
<B>-mieee</B> is implicitly enabled. If <B>-ffinite-math-only</B> is
|
|
enabled <B>-mno-ieee</B> is implicitly set, which results in faster
|
|
floating-point greater-equal and less-equal comparisons. The implicit settings
|
|
can be overridden by specifying either <B>-mieee</B> or <B>-mno-ieee</B>.
|
|
<DT id="3577"><B>-minline-ic_invalidate</B><DD>
|
|
|
|
|
|
Inline code to invalidate instruction cache entries after setting up
|
|
nested function trampolines.
|
|
This option has no effect if <B>-musermode</B> is in effect and the selected
|
|
code generation option (e.g. <B>-m4</B>) does not allow the use of the <TT>"icbi"</TT>
|
|
instruction.
|
|
If the selected code generation option does not allow the use of the <TT>"icbi"</TT>
|
|
instruction, and <B>-musermode</B> is not in effect, the inlined code
|
|
manipulates the instruction cache address array directly with an associative
|
|
write. This not only requires privileged mode at run time, but it also
|
|
fails if the cache line had been mapped via the <FONT SIZE="-1">TLB</FONT> and has become unmapped.
|
|
<DT id="3578"><B>-misize</B><DD>
|
|
|
|
|
|
Dump instruction size and location in the assembly code.
|
|
<DT id="3579"><B>-mpadstruct</B><DD>
|
|
|
|
|
|
This option is deprecated. It pads structures to multiple of 4 bytes,
|
|
which is incompatible with the <FONT SIZE="-1">SH ABI.</FONT>
|
|
<DT id="3580"><B>-matomic-model=</B><I>model</I><DD>
|
|
|
|
|
|
Sets the model of atomic operations and additional parameters as a comma
|
|
separated list. For details on the atomic built-in functions see
|
|
<B>__atomic Builtins</B>. The following models and parameters are supported:
|
|
<DL COMPACT><DT id="3581"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3582"><B>none</B><DD>
|
|
|
|
|
|
Disable compiler generated atomic sequences and emit library calls for atomic
|
|
operations. This is the default if the target is not <TT>"sh*-*-linux*"</TT>.
|
|
<DT id="3583"><B>soft-gusa</B><DD>
|
|
|
|
|
|
Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
|
|
built-in functions. The generated atomic sequences require additional support
|
|
from the interrupt/exception handling code of the system and are only suitable
|
|
for SH3* and SH4* single-core systems. This option is enabled by default when
|
|
the target is <TT>"sh*-*-linux*"</TT> and SH3* or SH4*. When the target is <FONT SIZE="-1">SH4A,</FONT>
|
|
this option also partially utilizes the hardware atomic instructions
|
|
<TT>"movli.l"</TT> and <TT>"movco.l"</TT> to create more efficient code, unless
|
|
<B>strict</B> is specified.
|
|
<DT id="3584"><B>soft-tcb</B><DD>
|
|
|
|
|
|
Generate software atomic sequences that use a variable in the thread control
|
|
block. This is a variation of the gUSA sequences which can also be used on
|
|
SH1* and SH2* targets. The generated atomic sequences require additional
|
|
support from the interrupt/exception handling code of the system and are only
|
|
suitable for single-core systems. When using this model, the <B>gbr-offset=</B>
|
|
parameter has to be specified as well.
|
|
<DT id="3585"><B>soft-imask</B><DD>
|
|
|
|
|
|
Generate software atomic sequences that temporarily disable interrupts by
|
|
setting <TT>"SR.IMASK = 1111"</TT>. This model works only when the program runs
|
|
in privileged mode and is only suitable for single-core systems. Additional
|
|
support from the interrupt/exception handling code of the system is not
|
|
required. This model is enabled by default when the target is
|
|
<TT>"sh*-*-linux*"</TT> and SH1* or SH2*.
|
|
<DT id="3586"><B>hard-llcs</B><DD>
|
|
|
|
|
|
Generate hardware atomic sequences using the <TT>"movli.l"</TT> and <TT>"movco.l"</TT>
|
|
instructions only. This is only available on <FONT SIZE="-1">SH4A</FONT> and is suitable for
|
|
multi-core systems. Since the hardware instructions support only 32 bit atomic
|
|
variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
|
|
Code compiled with this option is also compatible with other software
|
|
atomic model interrupt/exception handling systems if executed on an <FONT SIZE="-1">SH4A</FONT>
|
|
system. Additional support from the interrupt/exception handling code of the
|
|
system is not required for this model.
|
|
<DT id="3587"><B>gbr-offset=</B><DD>
|
|
|
|
|
|
This parameter specifies the offset in bytes of the variable in the thread
|
|
control block structure that should be used by the generated atomic sequences
|
|
when the <B>soft-tcb</B> model has been selected. For other models this
|
|
parameter is ignored. The specified value must be an integer multiple of four
|
|
and in the range 0-1020.
|
|
<DT id="3588"><B>strict</B><DD>
|
|
|
|
|
|
This parameter prevents mixed usage of multiple atomic models, even if they
|
|
are compatible, and makes the compiler generate atomic sequences of the
|
|
specified model only.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3589"><DD>
|
|
</DL>
|
|
|
|
<DT id="3590"><B>-mtas</B><DD>
|
|
|
|
|
|
Generate the <TT>"tas.b"</TT> opcode for <TT>"__atomic_test_and_set"</TT>.
|
|
Notice that depending on the particular hardware and software configuration
|
|
this can degrade overall performance due to the operand cache line flushes
|
|
that are implied by the <TT>"tas.b"</TT> instruction. On multi-core <FONT SIZE="-1">SH4A</FONT>
|
|
processors the <TT>"tas.b"</TT> instruction must be used with caution since it
|
|
can result in data corruption for certain cache configurations.
|
|
<DT id="3591"><B>-mprefergot</B><DD>
|
|
|
|
|
|
When generating position-independent code, emit function calls using
|
|
the Global Offset Table instead of the Procedure Linkage Table.
|
|
<DT id="3592"><B>-musermode</B><DD>
|
|
|
|
|
|
|
|
<DT id="3593"><B>-mno-usermode</B><DD>
|
|
|
|
|
|
|
|
Don't allow (allow) the compiler generating privileged mode code. Specifying
|
|
<B>-musermode</B> also implies <B>-mno-inline-ic_invalidate</B> if the
|
|
inlined code would not work in user mode. <B>-musermode</B> is the default
|
|
when the target is <TT>"sh*-*-linux*"</TT>. If the target is SH1* or SH2*
|
|
<B>-musermode</B> has no effect, since there is no user mode.
|
|
<DT id="3594"><B>-multcost=</B><I>number</I><DD>
|
|
|
|
|
|
Set the cost to assume for a multiply insn.
|
|
<DT id="3595"><B>-mdiv=</B><I>strategy</I><DD>
|
|
|
|
|
|
Set the division strategy to be used for integer division operations.
|
|
<I>strategy</I> can be one of:
|
|
<DL COMPACT><DT id="3596"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3597"><B>call-div1</B><DD>
|
|
|
|
|
|
Calls a library function that uses the single-step division instruction
|
|
<TT>"div1"</TT> to perform the operation. Division by zero calculates an
|
|
unspecified result and does not trap. This is the default except for <FONT SIZE="-1">SH4,
|
|
SH2A</FONT> and SHcompact.
|
|
<DT id="3598"><B>call-fp</B><DD>
|
|
|
|
|
|
Calls a library function that performs the operation in double precision
|
|
floating point. Division by zero causes a floating-point exception. This is
|
|
the default for SHcompact with <FONT SIZE="-1">FPU.</FONT> Specifying this for targets that do not
|
|
have a double precision <FONT SIZE="-1">FPU</FONT> defaults to <TT>"call-div1"</TT>.
|
|
<DT id="3599"><B>call-table</B><DD>
|
|
|
|
|
|
Calls a library function that uses a lookup table for small divisors and
|
|
the <TT>"div1"</TT> instruction with case distinction for larger divisors. Division
|
|
by zero calculates an unspecified result and does not trap. This is the default
|
|
for <FONT SIZE="-1">SH4.</FONT> Specifying this for targets that do not have dynamic shift
|
|
instructions defaults to <TT>"call-div1"</TT>.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3600"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When a division strategy has not been specified the default strategy is
|
|
selected based on the current target. For <FONT SIZE="-1">SH2A</FONT> the default strategy is to
|
|
use the <TT>"divs"</TT> and <TT>"divu"</TT> instructions instead of library function
|
|
calls.
|
|
</DL>
|
|
|
|
<DT id="3601"><B>-maccumulate-outgoing-args</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="3602"><B>-mdivsi3_libfunc=</B><I>name</I><DD>
|
|
|
|
|
|
Set the name of the library function used for 32-bit signed division to
|
|
<I>name</I>.
|
|
This only affects the name used in the <B>call</B> division strategies, and
|
|
the compiler still expects the same sets of input/output/clobbered registers as
|
|
if this option were not present.
|
|
<DT id="3603"><B>-mfixed-range=</B><I>register-range</I><DD>
|
|
|
|
|
|
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.
|
|
<DT id="3604"><B>-mbranch-cost=</B><I>num</I><DD>
|
|
|
|
|
|
Assume <I>num</I> 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.
|
|
<DT id="3605"><B>-mzdcbranch</B><DD>
|
|
|
|
|
|
|
|
<DT id="3606"><B>-mno-zdcbranch</B><DD>
|
|
|
|
|
|
|
|
Assume (do not assume) that zero displacement conditional branch instructions
|
|
<TT>"bt"</TT> and <TT>"bf"</TT> are fast. If <B>-mzdcbranch</B> is specified, the
|
|
compiler prefers zero displacement branch code sequences. This is
|
|
enabled by default when generating code for <FONT SIZE="-1">SH4</FONT> and <FONT SIZE="-1">SH4A.</FONT> It can be explicitly
|
|
disabled by specifying <B>-mno-zdcbranch</B>.
|
|
<DT id="3607"><B>-mcbranch-force-delay-slot</B><DD>
|
|
|
|
|
|
Force the usage of delay slots for conditional branches, which stuffs the delay
|
|
slot with a <TT>"nop"</TT> 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 <FONT SIZE="-1">SH7055.</FONT>
|
|
<DT id="3608"><B>-mfused-madd</B><DD>
|
|
|
|
|
|
|
|
<DT id="3609"><B>-mno-fused-madd</B><DD>
|
|
|
|
|
|
|
|
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
|
|
<B>-mfused-madd</B> option is now mapped to the machine-independent
|
|
<B>-ffp-contract=fast</B> option, and <B>-mno-fused-madd</B> is
|
|
mapped to <B>-ffp-contract=off</B>.
|
|
<DT id="3610"><B>-mfsca</B><DD>
|
|
|
|
|
|
|
|
<DT id="3611"><B>-mno-fsca</B><DD>
|
|
|
|
|
|
|
|
Allow or disallow the compiler to emit the <TT>"fsca"</TT> instruction for sine
|
|
and cosine approximations. The option <B>-mfsca</B> must be used in
|
|
combination with <B>-funsafe-math-optimizations</B>. It is enabled by default
|
|
when generating code for <FONT SIZE="-1">SH4A.</FONT> Using <B>-mno-fsca</B> disables sine and cosine
|
|
approximations even if <B>-funsafe-math-optimizations</B> is in effect.
|
|
<DT id="3612"><B>-mfsrra</B><DD>
|
|
|
|
|
|
|
|
<DT id="3613"><B>-mno-fsrra</B><DD>
|
|
|
|
|
|
|
|
Allow or disallow the compiler to emit the <TT>"fsrra"</TT> instruction for
|
|
reciprocal square root approximations. The option <B>-mfsrra</B> must be used
|
|
in combination with <B>-funsafe-math-optimizations</B> and
|
|
<B>-ffinite-math-only</B>. It is enabled by default when generating code for
|
|
<FONT SIZE="-1">SH4A.</FONT> Using <B>-mno-fsrra</B> disables reciprocal square root approximations
|
|
even if <B>-funsafe-math-optimizations</B> and <B>-ffinite-math-only</B> are
|
|
in effect.
|
|
<DT id="3614"><B>-mpretend-cmove</B><DD>
|
|
|
|
|
|
Prefer zero-displacement conditional branches for conditional move instruction
|
|
patterns. This can result in faster code on the <FONT SIZE="-1">SH4</FONT> processor.
|
|
<DT id="3615"><B>-mfdpic</B><DD>
|
|
|
|
|
|
Generate code using the <FONT SIZE="-1">FDPIC ABI.</FONT>
|
|
</DL>
|
|
<P>
|
|
|
|
<I>Solaris 2 Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are supported on Solaris 2:
|
|
<DL COMPACT>
|
|
<DT id="3616"><B>-mclear-hwcap</B><DD>
|
|
|
|
|
|
<B>-mclear-hwcap</B> tells the compiler to remove the hardware
|
|
capabilities generated by the Solaris assembler. This is only necessary
|
|
when object files use <FONT SIZE="-1">ISA</FONT> extensions not supported by the current
|
|
machine, but check at runtime whether or not to use them.
|
|
<DT id="3617"><B>-mimpure-text</B><DD>
|
|
|
|
|
|
<B>-mimpure-text</B>, used in addition to <B>-shared</B>, tells
|
|
the compiler to not pass <B>-z text</B> to the linker when linking a
|
|
shared object. Using this option, you can link position-dependent
|
|
code into a shared object.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-mimpure-text</B> suppresses the ``relocations remain against
|
|
allocatable but non-writable sections'' linker error message.
|
|
However, the necessary relocations trigger copy-on-write, and the
|
|
shared object is not actually shared across processes. Instead of
|
|
using <B>-mimpure-text</B>, you should compile all source code with
|
|
<B>-fpic</B> or <B>-fPIC</B>.
|
|
</DL>
|
|
<P>
|
|
|
|
These switches are supported in addition to the above on Solaris 2:
|
|
<DL COMPACT>
|
|
<DT id="3618"><B>-pthreads</B><DD>
|
|
|
|
|
|
This is a synonym for <B>-pthread</B>.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>SPARC</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are supported on the <FONT SIZE="-1">SPARC:</FONT>
|
|
<DL COMPACT>
|
|
<DT id="3619"><B>-mno-app-regs</B><DD>
|
|
|
|
|
|
|
|
<DT id="3620"><B>-mapp-regs</B><DD>
|
|
|
|
|
|
|
|
Specify <B>-mapp-regs</B> to generate output using the global registers
|
|
2 through 4, which the <FONT SIZE="-1">SPARC SVR4 ABI</FONT> reserves for applications. Like the
|
|
global register 1, each global register 2 through 4 is then treated as an
|
|
allocable register that is clobbered by function calls. This is the default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To be fully <FONT SIZE="-1">SVR4</FONT> ABI-compliant at the cost of some performance loss,
|
|
specify <B>-mno-app-regs</B>. You should compile libraries and system
|
|
software with this option.
|
|
<DT id="3621"><B>-mflat</B><DD>
|
|
|
|
|
|
|
|
<DT id="3622"><B>-mno-flat</B><DD>
|
|
|
|
|
|
|
|
With <B>-mflat</B>, 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
|
|
registers (0--5) are still treated as ``call-saved'' registers and are
|
|
saved on the stack as needed.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-mno-flat</B> (the default), the compiler generates save/restore
|
|
instructions (except for leaf functions). This is the normal operating mode.
|
|
<DT id="3623"><B>-mfpu</B><DD>
|
|
|
|
|
|
|
|
<DT id="3624"><B>-mhard-float</B><DD>
|
|
|
|
|
|
|
|
Generate output containing floating-point instructions. This is the
|
|
default.
|
|
<DT id="3625"><B>-mno-fpu</B><DD>
|
|
|
|
|
|
|
|
<DT id="3626"><B>-msoft-float</B><DD>
|
|
|
|
|
|
|
|
Generate output containing library calls for floating point.
|
|
<B>Warning:</B> the requisite libraries are not available for all <FONT SIZE="-1">SPARC</FONT>
|
|
targets. Normally the facilities of the machine's usual C compiler are
|
|
used, but this cannot be done directly in cross-compilation. You must make
|
|
your own arrangements to provide suitable library functions for
|
|
cross-compilation. The embedded targets <B>sparc-*-aout</B> and
|
|
<B>sparclite-*-*</B> do provide software floating-point support.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-msoft-float</B> changes the calling convention in the output file;
|
|
therefore, it is only useful if you compile <I>all</I> of a program with
|
|
this option. In particular, you need to compile <I>libgcc.a</I>, the
|
|
library that comes with <FONT SIZE="-1">GCC,</FONT> with <B>-msoft-float</B> in order for
|
|
this to work.
|
|
<DT id="3627"><B>-mhard-quad-float</B><DD>
|
|
|
|
|
|
Generate output containing quad-word (long double) floating-point
|
|
instructions.
|
|
<DT id="3628"><B>-msoft-quad-float</B><DD>
|
|
|
|
|
|
Generate output containing library calls for quad-word (long double)
|
|
floating-point instructions. The functions called are those specified
|
|
in the <FONT SIZE="-1">SPARC ABI.</FONT> This is the default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
As of this writing, there are no <FONT SIZE="-1">SPARC</FONT> implementations that have hardware
|
|
support for the quad-word floating-point instructions. They all invoke
|
|
a trap handler for one of these instructions, and then the trap handler
|
|
emulates the effect of the instruction. Because of the trap handler overhead,
|
|
this is much slower than calling the <FONT SIZE="-1">ABI</FONT> library routines. Thus the
|
|
<B>-msoft-quad-float</B> option is the default.
|
|
<DT id="3629"><B>-mno-unaligned-doubles</B><DD>
|
|
|
|
|
|
|
|
<DT id="3630"><B>-munaligned-doubles</B><DD>
|
|
|
|
|
|
|
|
Assume that doubles have 8-byte alignment. This is the default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-munaligned-doubles</B>, <FONT SIZE="-1">GCC</FONT> assumes that doubles have 8-byte
|
|
alignment only if they are contained in another type, or if they have an
|
|
absolute address. Otherwise, it assumes they have 4-byte alignment.
|
|
Specifying this option avoids some rare compatibility problems with code
|
|
generated by other compilers. It is not the default because it results
|
|
in a performance loss, especially for floating-point code.
|
|
<DT id="3631"><B>-muser-mode</B><DD>
|
|
|
|
|
|
|
|
<DT id="3632"><B>-mno-user-mode</B><DD>
|
|
|
|
|
|
|
|
Do not generate code that can only run in supervisor mode. This is relevant
|
|
only for the <TT>"casa"</TT> instruction emitted for the <FONT SIZE="-1">LEON3</FONT> processor. This
|
|
is the default.
|
|
<DT id="3633"><B>-mfaster-structs</B><DD>
|
|
|
|
|
|
|
|
<DT id="3634"><B>-mno-faster-structs</B><DD>
|
|
|
|
|
|
|
|
With <B>-mfaster-structs</B>, the compiler assumes that structures
|
|
should have 8-byte alignment. This enables the use of pairs of
|
|
<TT>"ldd"</TT> and <TT>"std"</TT> instructions for copies in structure
|
|
assignment, in place of twice as many <TT>"ld"</TT> and <TT>"st"</TT> pairs.
|
|
However, the use of this changed alignment directly violates the <FONT SIZE="-1">SPARC
|
|
ABI.</FONT> Thus, it's intended only for use on targets where the developer
|
|
acknowledges that their resulting code is not directly in line with
|
|
the rules of the <FONT SIZE="-1">ABI.</FONT>
|
|
<DT id="3635"><B>-mstd-struct-return</B><DD>
|
|
|
|
|
|
|
|
<DT id="3636"><B>-mno-std-struct-return</B><DD>
|
|
|
|
|
|
|
|
With <B>-mstd-struct-return</B>, 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 <FONT SIZE="-1">ABI.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default is <B>-mno-std-struct-return</B>. This option has no effect
|
|
in 64-bit mode.
|
|
<DT id="3637"><B>-mlra</B><DD>
|
|
|
|
|
|
|
|
<DT id="3638"><B>-mno-lra</B><DD>
|
|
|
|
|
|
|
|
Enable Local Register Allocation. This is the default for <FONT SIZE="-1">SPARC</FONT> since <FONT SIZE="-1">GCC 7</FONT>
|
|
so <B>-mno-lra</B> needs to be passed to get old Reload.
|
|
<DT id="3639"><B>-mcpu=</B><I>cpu_type</I><DD>
|
|
|
|
|
|
Set the instruction set, register set, and instruction scheduling parameters
|
|
for machine type <I>cpu_type</I>. Supported values for <I>cpu_type</I> are
|
|
<B>v7</B>, <B>cypress</B>, <B>v8</B>, <B>supersparc</B>, <B>hypersparc</B>,
|
|
<B>leon</B>, <B>leon3</B>, <B>leon3v7</B>, <B>sparclite</B>, <B>f930</B>,
|
|
<B>f934</B>, <B>sparclite86x</B>, <B>sparclet</B>, <B>tsc701</B>, <B>v9</B>,
|
|
<B>ultrasparc</B>, <B>ultrasparc3</B>, <B>niagara</B>, <B>niagara2</B>,
|
|
<B>niagara3</B>, <B>niagara4</B>, <B>niagara7</B> and <B>m8</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Native Solaris and GNU/Linux toolchains also support the value <B>native</B>,
|
|
which selects the best architecture option for the host processor.
|
|
<B>-mcpu=native</B> has no effect if <FONT SIZE="-1">GCC</FONT> does not recognize
|
|
the processor.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Default instruction scheduling parameters are used for values that select
|
|
an architecture and not an implementation. These are <B>v7</B>, <B>v8</B>,
|
|
<B>sparclite</B>, <B>sparclet</B>, <B>v9</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Here is a list of each supported architecture and their supported
|
|
implementations.
|
|
<DL COMPACT><DT id="3640"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3641">v7<DD>
|
|
|
|
|
|
cypress, leon3v7
|
|
<DT id="3642">v8<DD>
|
|
|
|
|
|
supersparc, hypersparc, leon, leon3
|
|
<DT id="3643">sparclite<DD>
|
|
|
|
|
|
f930, f934, sparclite86x
|
|
<DT id="3644">sparclet<DD>
|
|
|
|
|
|
tsc701
|
|
<DT id="3645">v9<DD>
|
|
|
|
|
|
ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4,
|
|
niagara7, m8
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3646"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
By default (unless configured otherwise), <FONT SIZE="-1">GCC</FONT> generates code for the V7
|
|
variant of the <FONT SIZE="-1">SPARC</FONT> architecture. With <B>-mcpu=cypress</B>, the compiler
|
|
additionally optimizes it for the Cypress <FONT SIZE="-1">CY7C602</FONT> chip, as used in the
|
|
SPARCStation/SPARCServer 3xx series. This is also appropriate for the older
|
|
SPARCStation 1, 2, <FONT SIZE="-1">IPX</FONT> etc.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-mcpu=v8</B>, <FONT SIZE="-1">GCC</FONT> generates code for the V8 variant of the <FONT SIZE="-1">SPARC</FONT>
|
|
architecture. The only difference from V7 code is that the compiler emits
|
|
the integer multiply and integer divide instructions which exist in <FONT SIZE="-1">SPARC-V8</FONT>
|
|
but not in <FONT SIZE="-1">SPARC-V7.</FONT> With <B>-mcpu=supersparc</B>, the compiler additionally
|
|
optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
|
|
2000 series.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-mcpu=sparclite</B>, <FONT SIZE="-1">GCC</FONT> generates code for the SPARClite variant of
|
|
the <FONT SIZE="-1">SPARC</FONT> architecture. This adds the integer multiply, integer divide step
|
|
and scan (<TT>"ffs"</TT>) instructions which exist in SPARClite but not in <FONT SIZE="-1">SPARC-V7.</FONT>
|
|
With <B>-mcpu=f930</B>, the compiler additionally optimizes it for the
|
|
Fujitsu <FONT SIZE="-1">MB86930</FONT> chip, which is the original SPARClite, with no <FONT SIZE="-1">FPU.</FONT> With
|
|
<B>-mcpu=f934</B>, the compiler additionally optimizes it for the Fujitsu
|
|
<FONT SIZE="-1">MB86934</FONT> chip, which is the more recent SPARClite with <FONT SIZE="-1">FPU.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-mcpu=sparclet</B>, <FONT SIZE="-1">GCC</FONT> generates code for the SPARClet variant of
|
|
the <FONT SIZE="-1">SPARC</FONT> architecture. This adds the integer multiply, multiply/accumulate,
|
|
integer divide step and scan (<TT>"ffs"</TT>) instructions which exist in SPARClet
|
|
but not in <FONT SIZE="-1">SPARC-V7.</FONT> With <B>-mcpu=tsc701</B>, the compiler additionally
|
|
optimizes it for the <FONT SIZE="-1">TEMIC</FONT> SPARClet chip.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-mcpu=v9</B>, <FONT SIZE="-1">GCC</FONT> generates code for the V9 variant of the <FONT SIZE="-1">SPARC</FONT>
|
|
architecture. This adds 64-bit integer and floating-point move instructions,
|
|
3 additional floating-point condition code registers and conditional move
|
|
instructions. With <B>-mcpu=ultrasparc</B>, the compiler additionally
|
|
optimizes it for the Sun UltraSPARC I/II/IIi chips. With
|
|
<B>-mcpu=ultrasparc3</B>, the compiler additionally optimizes it for the
|
|
Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips. With
|
|
<B>-mcpu=niagara</B>, the compiler additionally optimizes it for
|
|
Sun UltraSPARC T1 chips. With <B>-mcpu=niagara2</B>, the compiler
|
|
additionally optimizes it for Sun UltraSPARC T2 chips. With
|
|
<B>-mcpu=niagara3</B>, the compiler additionally optimizes it for Sun
|
|
UltraSPARC T3 chips. With <B>-mcpu=niagara4</B>, the compiler
|
|
additionally optimizes it for Sun UltraSPARC T4 chips. With
|
|
<B>-mcpu=niagara7</B>, the compiler additionally optimizes it for
|
|
Oracle <FONT SIZE="-1">SPARC M7</FONT> chips. With <B>-mcpu=m8</B>, the compiler
|
|
additionally optimizes it for Oracle M8 chips.
|
|
</DL>
|
|
|
|
<DT id="3647"><B>-mtune=</B><I>cpu_type</I><DD>
|
|
|
|
|
|
Set the instruction scheduling parameters for machine type
|
|
<I>cpu_type</I>, but do not set the instruction set or register set that the
|
|
option <B>-mcpu=</B><I>cpu_type</I> does.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The same values for <B>-mcpu=</B><I>cpu_type</I> can be used for
|
|
<B>-mtune=</B><I>cpu_type</I>, but the only useful values are those
|
|
that select a particular <FONT SIZE="-1">CPU</FONT> implementation. Those are
|
|
<B>cypress</B>, <B>supersparc</B>, <B>hypersparc</B>, <B>leon</B>,
|
|
<B>leon3</B>, <B>leon3v7</B>, <B>f930</B>, <B>f934</B>,
|
|
<B>sparclite86x</B>, <B>tsc701</B>, <B>ultrasparc</B>,
|
|
<B>ultrasparc3</B>, <B>niagara</B>, <B>niagara2</B>, <B>niagara3</B>,
|
|
<B>niagara4</B>, <B>niagara7</B> and <B>m8</B>. With native Solaris
|
|
and GNU/Linux toolchains, <B>native</B> can also be used.
|
|
<DT id="3648"><B>-mv8plus</B><DD>
|
|
|
|
|
|
|
|
<DT id="3649"><B>-mno-v8plus</B><DD>
|
|
|
|
|
|
|
|
With <B>-mv8plus</B>, <FONT SIZE="-1">GCC</FONT> generates code for the <FONT SIZE="-1">SPARC-V8+ ABI.</FONT> The
|
|
difference from the V8 <FONT SIZE="-1">ABI</FONT> 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 <FONT SIZE="-1">SPARC-V9</FONT> processors.
|
|
<DT id="3650"><B>-mvis</B><DD>
|
|
|
|
|
|
|
|
<DT id="3651"><B>-mno-vis</B><DD>
|
|
|
|
|
|
|
|
With <B>-mvis</B>, <FONT SIZE="-1">GCC</FONT> generates code that takes advantage of the UltraSPARC
|
|
Visual Instruction Set extensions. The default is <B>-mno-vis</B>.
|
|
<DT id="3652"><B>-mvis2</B><DD>
|
|
|
|
|
|
|
|
<DT id="3653"><B>-mno-vis2</B><DD>
|
|
|
|
|
|
|
|
With <B>-mvis2</B>, <FONT SIZE="-1">GCC</FONT> generates code that takes advantage of
|
|
version 2.0 of the UltraSPARC Visual Instruction Set extensions. The
|
|
default is <B>-mvis2</B> when targeting a cpu that supports such
|
|
instructions, such as UltraSPARC-III and later. Setting <B>-mvis2</B>
|
|
also sets <B>-mvis</B>.
|
|
<DT id="3654"><B>-mvis3</B><DD>
|
|
|
|
|
|
|
|
<DT id="3655"><B>-mno-vis3</B><DD>
|
|
|
|
|
|
|
|
With <B>-mvis3</B>, <FONT SIZE="-1">GCC</FONT> generates code that takes advantage of
|
|
version 3.0 of the UltraSPARC Visual Instruction Set extensions. The
|
|
default is <B>-mvis3</B> when targeting a cpu that supports such
|
|
instructions, such as niagara-3 and later. Setting <B>-mvis3</B>
|
|
also sets <B>-mvis2</B> and <B>-mvis</B>.
|
|
<DT id="3656"><B>-mvis4</B><DD>
|
|
|
|
|
|
|
|
<DT id="3657"><B>-mno-vis4</B><DD>
|
|
|
|
|
|
|
|
With <B>-mvis4</B>, <FONT SIZE="-1">GCC</FONT> generates code that takes advantage of
|
|
version 4.0 of the UltraSPARC Visual Instruction Set extensions. The
|
|
default is <B>-mvis4</B> when targeting a cpu that supports such
|
|
instructions, such as niagara-7 and later. Setting <B>-mvis4</B>
|
|
also sets <B>-mvis3</B>, <B>-mvis2</B> and <B>-mvis</B>.
|
|
<DT id="3658"><B>-mvis4b</B><DD>
|
|
|
|
|
|
|
|
<DT id="3659"><B>-mno-vis4b</B><DD>
|
|
|
|
|
|
|
|
With <B>-mvis4b</B>, <FONT SIZE="-1">GCC</FONT> generates code that takes advantage of
|
|
version 4.0 of the UltraSPARC Visual Instruction Set extensions, plus
|
|
the additional <FONT SIZE="-1">VIS</FONT> instructions introduced in the Oracle <FONT SIZE="-1">SPARC</FONT>
|
|
Architecture 2017. The default is <B>-mvis4b</B> when targeting a
|
|
cpu that supports such instructions, such as m8 and later. Setting
|
|
<B>-mvis4b</B> also sets <B>-mvis4</B>, <B>-mvis3</B>,
|
|
<B>-mvis2</B> and <B>-mvis</B>.
|
|
<DT id="3660"><B>-mcbcond</B><DD>
|
|
|
|
|
|
|
|
<DT id="3661"><B>-mno-cbcond</B><DD>
|
|
|
|
|
|
|
|
With <B>-mcbcond</B>, <FONT SIZE="-1">GCC</FONT> generates code that takes advantage of the UltraSPARC
|
|
Compare-and-Branch-on-Condition instructions. The default is <B>-mcbcond</B>
|
|
when targeting a <FONT SIZE="-1">CPU</FONT> that supports such instructions, such as Niagara-4 and
|
|
later.
|
|
<DT id="3662"><B>-mfmaf</B><DD>
|
|
|
|
|
|
|
|
<DT id="3663"><B>-mno-fmaf</B><DD>
|
|
|
|
|
|
|
|
With <B>-mfmaf</B>, <FONT SIZE="-1">GCC</FONT> generates code that takes advantage of the UltraSPARC
|
|
Fused Multiply-Add Floating-point instructions. The default is <B>-mfmaf</B>
|
|
when targeting a <FONT SIZE="-1">CPU</FONT> that supports such instructions, such as Niagara-3 and
|
|
later.
|
|
<DT id="3664"><B>-mfsmuld</B><DD>
|
|
|
|
|
|
|
|
<DT id="3665"><B>-mno-fsmuld</B><DD>
|
|
|
|
|
|
|
|
With <B>-mfsmuld</B>, <FONT SIZE="-1">GCC</FONT> generates code that takes advantage of the
|
|
Floating-point Multiply Single to Double (FsMULd) instruction. The default is
|
|
<B>-mfsmuld</B> when targeting a <FONT SIZE="-1">CPU</FONT> supporting the architecture versions V8
|
|
or V9 with <FONT SIZE="-1">FPU</FONT> except <B>-mcpu=leon</B>.
|
|
<DT id="3666"><B>-mpopc</B><DD>
|
|
|
|
|
|
|
|
<DT id="3667"><B>-mno-popc</B><DD>
|
|
|
|
|
|
|
|
With <B>-mpopc</B>, <FONT SIZE="-1">GCC</FONT> generates code that takes advantage of the UltraSPARC
|
|
Population Count instruction. The default is <B>-mpopc</B>
|
|
when targeting a <FONT SIZE="-1">CPU</FONT> that supports such an instruction, such as Niagara-2 and
|
|
later.
|
|
<DT id="3668"><B>-msubxc</B><DD>
|
|
|
|
|
|
|
|
<DT id="3669"><B>-mno-subxc</B><DD>
|
|
|
|
|
|
|
|
With <B>-msubxc</B>, <FONT SIZE="-1">GCC</FONT> generates code that takes advantage of the UltraSPARC
|
|
Subtract-Extended-with-Carry instruction. The default is <B>-msubxc</B>
|
|
when targeting a <FONT SIZE="-1">CPU</FONT> that supports such an instruction, such as Niagara-7 and
|
|
later.
|
|
<DT id="3670"><B>-mfix-at697f</B><DD>
|
|
|
|
|
|
Enable the documented workaround for the single erratum of the Atmel <FONT SIZE="-1">AT697F</FONT>
|
|
processor (which corresponds to erratum #13 of the <FONT SIZE="-1">AT697E</FONT> processor).
|
|
<DT id="3671"><B>-mfix-ut699</B><DD>
|
|
|
|
|
|
Enable the documented workarounds for the floating-point errata and the data
|
|
cache nullify errata of the <FONT SIZE="-1">UT699</FONT> processor.
|
|
<DT id="3672"><B>-mfix-ut700</B><DD>
|
|
|
|
|
|
Enable the documented workaround for the back-to-back store errata of
|
|
the <FONT SIZE="-1">UT699E/UT700</FONT> processor.
|
|
<DT id="3673"><B>-mfix-gr712rc</B><DD>
|
|
|
|
|
|
Enable the documented workaround for the back-to-back store errata of
|
|
the <FONT SIZE="-1">GR712RC</FONT> processor.
|
|
</DL>
|
|
<P>
|
|
|
|
These <B>-m</B> options are supported in addition to the above
|
|
on <FONT SIZE="-1">SPARC-V9</FONT> processors in 64-bit environments:
|
|
<DL COMPACT>
|
|
<DT id="3674"><B>-m32</B><DD>
|
|
|
|
|
|
|
|
<DT id="3675"><B>-m64</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3676"><B>-mcmodel=</B><I>which</I><DD>
|
|
|
|
|
|
Set the code model to one of
|
|
<DL COMPACT><DT id="3677"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3678"><B>medlow</B><DD>
|
|
|
|
|
|
The Medium/Low code model: 64-bit addresses, programs
|
|
must be linked in the low 32 bits of memory. Programs can be statically
|
|
or dynamically linked.
|
|
<DT id="3679"><B>medmid</B><DD>
|
|
|
|
|
|
The Medium/Middle code model: 64-bit addresses, programs
|
|
must be linked in the low 44 bits of memory, the text and data segments must
|
|
be less than 2GB in size and the data segment must be located within 2GB of
|
|
the text segment.
|
|
<DT id="3680"><B>medany</B><DD>
|
|
|
|
|
|
The Medium/Anywhere code model: 64-bit addresses, programs
|
|
may be linked anywhere in memory, the text and data segments must be less
|
|
than 2GB in size and the data segment must be located within 2GB of the
|
|
text segment.
|
|
<DT id="3681"><B>embmedany</B><DD>
|
|
|
|
|
|
The Medium/Anywhere code model for embedded systems:
|
|
64-bit addresses, the text and data segments must be less than 2GB in
|
|
size, both starting anywhere in memory (determined at link time). The
|
|
global register <TT>%g4</TT> points to the base of the data segment. Programs
|
|
are statically linked and <FONT SIZE="-1">PIC</FONT> is not supported.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3682"><DD>
|
|
</DL>
|
|
|
|
<DT id="3683"><B>-mmemory-model=</B><I>mem-model</I><DD>
|
|
|
|
|
|
Set the memory model in force on the processor to one of
|
|
<DL COMPACT><DT id="3684"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3685"><B>default</B><DD>
|
|
|
|
|
|
The default memory model for the processor and operating system.
|
|
<DT id="3686"><B>rmo</B><DD>
|
|
|
|
|
|
Relaxed Memory Order
|
|
<DT id="3687"><B>pso</B><DD>
|
|
|
|
|
|
Partial Store Order
|
|
<DT id="3688"><B>tso</B><DD>
|
|
|
|
|
|
Total Store Order
|
|
<DT id="3689"><B>sc</B><DD>
|
|
|
|
|
|
Sequential Consistency
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3690"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
These memory models are formally defined in Appendix D of the <FONT SIZE="-1">SPARC-V9</FONT>
|
|
architecture manual, as set in the processor's <TT>"PSTATE.MM"</TT> field.
|
|
</DL>
|
|
|
|
<DT id="3691"><B>-mstack-bias</B><DD>
|
|
|
|
|
|
|
|
<DT id="3692"><B>-mno-stack-bias</B><DD>
|
|
|
|
|
|
|
|
With <B>-mstack-bias</B>, <FONT SIZE="-1">GCC</FONT> assumes that the stack pointer, and
|
|
frame pointer if present, are offset by -2047 which must be added back
|
|
when making stack frame references. This is the default in 64-bit mode.
|
|
Otherwise, assume no such offset is present.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>SPU</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are supported on the <FONT SIZE="-1">SPU:</FONT>
|
|
<DL COMPACT>
|
|
<DT id="3693"><B>-mwarn-reloc</B><DD>
|
|
|
|
|
|
|
|
<DT id="3694"><B>-merror-reloc</B><DD>
|
|
|
|
|
|
|
|
The loader for <FONT SIZE="-1">SPU</FONT> does not handle dynamic relocations. By default, <FONT SIZE="-1">GCC</FONT>
|
|
gives an error when it generates code that requires a dynamic
|
|
relocation. <B>-mno-error-reloc</B> disables the error,
|
|
<B>-mwarn-reloc</B> generates a warning instead.
|
|
<DT id="3695"><B>-msafe-dma</B><DD>
|
|
|
|
|
|
|
|
<DT id="3696"><B>-munsafe-dma</B><DD>
|
|
|
|
|
|
|
|
Instructions that initiate or test completion of <FONT SIZE="-1">DMA</FONT> must not be
|
|
reordered with respect to loads and stores of the memory that is being
|
|
accessed.
|
|
With <B>-munsafe-dma</B> you must use the <TT>"volatile"</TT> keyword to protect
|
|
memory accesses, but that can lead to inefficient code in places where the
|
|
memory is known to not change. Rather than mark the memory as volatile,
|
|
you can use <B>-msafe-dma</B> to tell the compiler to treat
|
|
the <FONT SIZE="-1">DMA</FONT> instructions as potentially affecting all memory.
|
|
<DT id="3697"><B>-mbranch-hints</B><DD>
|
|
|
|
|
|
By default, <FONT SIZE="-1">GCC</FONT> generates a branch hint instruction to avoid
|
|
pipeline stalls for always-taken or probably-taken branches. A hint
|
|
is not generated closer than 8 instructions away from its branch.
|
|
There is little reason to disable them, except for debugging purposes,
|
|
or to make an object a little bit smaller.
|
|
<DT id="3698"><B>-msmall-mem</B><DD>
|
|
|
|
|
|
|
|
<DT id="3699"><B>-mlarge-mem</B><DD>
|
|
|
|
|
|
|
|
By default, <FONT SIZE="-1">GCC</FONT> generates code assuming that addresses are never larger
|
|
than 18 bits. With <B>-mlarge-mem</B> code is generated that assumes
|
|
a full 32-bit address.
|
|
<DT id="3700"><B>-mstdmain</B><DD>
|
|
|
|
|
|
By default, <FONT SIZE="-1">GCC</FONT> links against startup code that assumes the SPU-style
|
|
main function interface (which has an unconventional parameter list).
|
|
With <B>-mstdmain</B>, <FONT SIZE="-1">GCC</FONT> links your program against startup
|
|
code that assumes a C99-style interface to <TT>"main"</TT>, including a
|
|
local copy of <TT>"argv"</TT> strings.
|
|
<DT id="3701"><B>-mfixed-range=</B><I>register-range</I><DD>
|
|
|
|
|
|
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.
|
|
<DT id="3702"><B>-mea32</B><DD>
|
|
|
|
|
|
|
|
<DT id="3703"><B>-mea64</B><DD>
|
|
|
|
|
|
|
|
Compile code assuming that pointers to the <FONT SIZE="-1">PPU</FONT> address space accessed
|
|
via the <TT>"__ea"</TT> named address space qualifier are either 32 or 64
|
|
bits wide. The default is 32 bits. As this is an ABI-changing option,
|
|
all object code in an executable must be compiled with the same setting.
|
|
<DT id="3704"><B>-maddress-space-conversion</B><DD>
|
|
|
|
|
|
|
|
<DT id="3705"><B>-mno-address-space-conversion</B><DD>
|
|
|
|
|
|
|
|
Allow/disallow treating the <TT>"__ea"</TT> address space as superset
|
|
of the generic address space. This enables explicit type casts
|
|
between <TT>"__ea"</TT> and generic pointer as well as implicit
|
|
conversions of generic pointers to <TT>"__ea"</TT> pointers. The
|
|
default is to allow address space pointer conversions.
|
|
<DT id="3706"><B>-mcache-size=</B><I>cache-size</I><DD>
|
|
|
|
|
|
This option controls the version of libgcc that the compiler links to an
|
|
executable and selects a software-managed cache for accessing variables
|
|
in the <TT>"__ea"</TT> address space with a particular cache size. Possible
|
|
options for <I>cache-size</I> are <B>8</B>, <B>16</B>, <B>32</B>, <B>64</B>
|
|
and <B>128</B>. The default cache size is 64KB.
|
|
<DT id="3707"><B>-matomic-updates</B><DD>
|
|
|
|
|
|
|
|
<DT id="3708"><B>-mno-atomic-updates</B><DD>
|
|
|
|
|
|
|
|
This option controls the version of libgcc that the compiler links to an
|
|
executable and selects whether atomic updates to the software-managed
|
|
cache of PPU-side variables are used. If you use atomic updates, changes
|
|
to a <FONT SIZE="-1">PPU</FONT> variable from <FONT SIZE="-1">SPU</FONT> code using the <TT>"__ea"</TT> named address space
|
|
qualifier do not interfere with changes to other <FONT SIZE="-1">PPU</FONT> variables residing
|
|
in the same cache line from <FONT SIZE="-1">PPU</FONT> code. If you do not use atomic updates,
|
|
such interference may occur; however, writing back cache lines is
|
|
more efficient. The default behavior is to use atomic updates.
|
|
<DT id="3709"><B>-mdual-nops</B><DD>
|
|
|
|
|
|
|
|
<DT id="3710"><B>-mdual-nops=</B><I>n</I><DD>
|
|
|
|
|
|
|
|
By default, <FONT SIZE="-1">GCC</FONT> inserts NOPs to increase dual issue when it expects
|
|
it to increase performance. <I>n</I> can be a value from 0 to 10. A
|
|
smaller <I>n</I> inserts fewer NOPs. 10 is the default, 0 is the
|
|
same as <B>-mno-dual-nops</B>. Disabled with <B>-Os</B>.
|
|
<DT id="3711"><B>-mhint-max-nops=</B><I>n</I><DD>
|
|
|
|
|
|
Maximum number of NOPs to insert for a branch hint. A branch hint must
|
|
be at least 8 instructions away from the branch it is affecting. <FONT SIZE="-1">GCC</FONT>
|
|
inserts up to <I>n</I> NOPs to enforce this, otherwise it does not
|
|
generate the branch hint.
|
|
<DT id="3712"><B>-mhint-max-distance=</B><I>n</I><DD>
|
|
|
|
|
|
The encoding of the branch hint instruction limits the hint to be within
|
|
256 instructions of the branch it is affecting. By default, <FONT SIZE="-1">GCC</FONT> makes
|
|
sure it is within 125.
|
|
<DT id="3713"><B>-msafe-hints</B><DD>
|
|
|
|
|
|
Work around a hardware bug that causes the <FONT SIZE="-1">SPU</FONT> to stall indefinitely.
|
|
By default, <FONT SIZE="-1">GCC</FONT> inserts the <TT>"hbrp"</TT> instruction to make sure
|
|
this stall won't happen.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>Options for System V</I>
|
|
|
|
|
|
<P>
|
|
|
|
These additional options are available on System V Release 4 for
|
|
compatibility with other compilers on those systems:
|
|
<DL COMPACT>
|
|
<DT id="3714"><B>-G</B><DD>
|
|
|
|
|
|
Create a shared object.
|
|
It is recommended that <B>-symbolic</B> or <B>-shared</B> be used instead.
|
|
<DT id="3715"><B>-Qy</B><DD>
|
|
|
|
|
|
Identify the versions of each tool used by the compiler, in a
|
|
<TT>".ident"</TT> assembler directive in the output.
|
|
<DT id="3716"><B>-Qn</B><DD>
|
|
|
|
|
|
Refrain from adding <TT>".ident"</TT> directives to the output file (this is
|
|
the default).
|
|
<DT id="3717"><B>-YP,</B><I>dirs</I><DD>
|
|
|
|
|
|
Search the directories <I>dirs</I>, and no others, for libraries
|
|
specified with <B>-l</B>.
|
|
<DT id="3718"><B>-Ym,</B><I>dir</I><DD>
|
|
|
|
|
|
Look in the directory <I>dir</I> to find the M4 preprocessor.
|
|
The assembler uses this option.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>TILE-Gx Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are supported on the TILE-Gx:
|
|
<DL COMPACT>
|
|
<DT id="3719"><B>-mcmodel=small</B><DD>
|
|
|
|
|
|
Generate code for the small model. The distance for direct calls is
|
|
limited to 500M in either direction. PC-relative addresses are 32
|
|
bits. Absolute addresses support the full address range.
|
|
<DT id="3720"><B>-mcmodel=large</B><DD>
|
|
|
|
|
|
Generate code for the large model. There is no limitation on call
|
|
distance, pc-relative addresses, or absolute addresses.
|
|
<DT id="3721"><B>-mcpu=</B><I>name</I><DD>
|
|
|
|
|
|
Selects the type of <FONT SIZE="-1">CPU</FONT> to be targeted. Currently the only supported
|
|
type is <B>tilegx</B>.
|
|
<DT id="3722"><B>-m32</B><DD>
|
|
|
|
|
|
|
|
<DT id="3723"><B>-m64</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3724"><B>-mbig-endian</B><DD>
|
|
|
|
|
|
|
|
<DT id="3725"><B>-mlittle-endian</B><DD>
|
|
|
|
|
|
|
|
Generate code in big/little endian mode, respectively.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>TILEPro Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are supported on the TILEPro:
|
|
<DL COMPACT>
|
|
<DT id="3726"><B>-mcpu=</B><I>name</I><DD>
|
|
|
|
|
|
Selects the type of <FONT SIZE="-1">CPU</FONT> to be targeted. Currently the only supported
|
|
type is <B>tilepro</B>.
|
|
<DT id="3727"><B>-m32</B><DD>
|
|
|
|
|
|
Generate code for a 32-bit environment, which sets int, long, and
|
|
pointer to 32 bits. This is the only supported behavior so the flag
|
|
is essentially ignored.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>V850 Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for V850 implementations:
|
|
<DL COMPACT>
|
|
<DT id="3728"><B>-mlong-calls</B><DD>
|
|
|
|
|
|
|
|
<DT id="3729"><B>-mno-long-calls</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="3730"><B>-mno-ep</B><DD>
|
|
|
|
|
|
|
|
<DT id="3731"><B>-mep</B><DD>
|
|
|
|
|
|
|
|
Do not optimize (do optimize) basic blocks that use the same index
|
|
pointer 4 or more times to copy pointer into the <TT>"ep"</TT> register, and
|
|
use the shorter <TT>"sld"</TT> and <TT>"sst"</TT> instructions. The <B>-mep</B>
|
|
option is on by default if you optimize.
|
|
<DT id="3732"><B>-mno-prolog-function</B><DD>
|
|
|
|
|
|
|
|
<DT id="3733"><B>-mprolog-function</B><DD>
|
|
|
|
|
|
|
|
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 <B>-mprolog-function</B> option
|
|
is on by default if you optimize.
|
|
<DT id="3734"><B>-mspace</B><DD>
|
|
|
|
|
|
Try to make the code as small as possible. At present, this just turns
|
|
on the <B>-mep</B> and <B>-mprolog-function</B> options.
|
|
<DT id="3735"><B>-mtda=</B><I>n</I><DD>
|
|
|
|
|
|
Put static or global variables whose size is <I>n</I> bytes or less into
|
|
the tiny data area that register <TT>"ep"</TT> points to. The tiny data
|
|
area can hold up to 256 bytes in total (128 bytes for byte references).
|
|
<DT id="3736"><B>-msda=</B><I>n</I><DD>
|
|
|
|
|
|
Put static or global variables whose size is <I>n</I> bytes or less into
|
|
the small data area that register <TT>"gp"</TT> points to. The small data
|
|
area can hold up to 64 kilobytes.
|
|
<DT id="3737"><B>-mzda=</B><I>n</I><DD>
|
|
|
|
|
|
Put static or global variables whose size is <I>n</I> bytes or less into
|
|
the first 32 kilobytes of memory.
|
|
<DT id="3738"><B>-mv850</B><DD>
|
|
|
|
|
|
Specify that the target processor is the V850.
|
|
<DT id="3739"><B>-mv850e3v5</B><DD>
|
|
|
|
|
|
Specify that the target processor is the V850E3V5. The preprocessor
|
|
constant <TT>"__v850e3v5__"</TT> is defined if this option is used.
|
|
<DT id="3740"><B>-mv850e2v4</B><DD>
|
|
|
|
|
|
Specify that the target processor is the V850E3V5. This is an alias for
|
|
the <B>-mv850e3v5</B> option.
|
|
<DT id="3741"><B>-mv850e2v3</B><DD>
|
|
|
|
|
|
Specify that the target processor is the V850E2V3. The preprocessor
|
|
constant <TT>"__v850e2v3__"</TT> is defined if this option is used.
|
|
<DT id="3742"><B>-mv850e2</B><DD>
|
|
|
|
|
|
Specify that the target processor is the V850E2. The preprocessor
|
|
constant <TT>"__v850e2__"</TT> is defined if this option is used.
|
|
<DT id="3743"><B>-mv850e1</B><DD>
|
|
|
|
|
|
Specify that the target processor is the V850E1. The preprocessor
|
|
constants <TT>"__v850e1__"</TT> and <TT>"__v850e__"</TT> are defined if
|
|
this option is used.
|
|
<DT id="3744"><B>-mv850es</B><DD>
|
|
|
|
|
|
Specify that the target processor is the V850ES. This is an alias for
|
|
the <B>-mv850e1</B> option.
|
|
<DT id="3745"><B>-mv850e</B><DD>
|
|
|
|
|
|
Specify that the target processor is the V850E. The preprocessor
|
|
constant <TT>"__v850e__"</TT> is defined if this option is used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If neither <B>-mv850</B> nor <B>-mv850e</B> nor <B>-mv850e1</B>
|
|
nor <B>-mv850e2</B> nor <B>-mv850e2v3</B> nor <B>-mv850e3v5</B>
|
|
are defined then a default target processor is chosen and the
|
|
relevant <B>__v850*__</B> preprocessor constant is defined.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The preprocessor constants <TT>"__v850"</TT> and <TT>"__v851__"</TT> are always
|
|
defined, regardless of which processor variant is the target.
|
|
<DT id="3746"><B>-mdisable-callt</B><DD>
|
|
|
|
|
|
|
|
<DT id="3747"><B>-mno-disable-callt</B><DD>
|
|
|
|
|
|
|
|
This option suppresses generation of the <TT>"CALLT"</TT> instruction for the
|
|
v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
|
|
architecture.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is enabled by default when the <FONT SIZE="-1">RH850 ABI</FONT> is
|
|
in use (see <B>-mrh850-abi</B>), and disabled by default when the
|
|
<FONT SIZE="-1">GCC ABI</FONT> is in use. If <TT>"CALLT"</TT> instructions are being generated
|
|
then the C preprocessor symbol <TT>"__V850_CALLT__"</TT> is defined.
|
|
<DT id="3748"><B>-mrelax</B><DD>
|
|
|
|
|
|
|
|
<DT id="3749"><B>-mno-relax</B><DD>
|
|
|
|
|
|
|
|
Pass on (or do not pass on) the <B>-mrelax</B> command-line option
|
|
to the assembler.
|
|
<DT id="3750"><B>-mlong-jumps</B><DD>
|
|
|
|
|
|
|
|
<DT id="3751"><B>-mno-long-jumps</B><DD>
|
|
|
|
|
|
|
|
Disable (or re-enable) the generation of PC-relative jump instructions.
|
|
<DT id="3752"><B>-msoft-float</B><DD>
|
|
|
|
|
|
|
|
<DT id="3753"><B>-mhard-float</B><DD>
|
|
|
|
|
|
|
|
Disable (or re-enable) the generation of hardware floating point
|
|
instructions. This option is only significant when the target
|
|
architecture is <B>V850E2V3</B> or higher. If hardware floating point
|
|
instructions are being generated then the C preprocessor symbol
|
|
<TT>"__FPU_OK__"</TT> is defined, otherwise the symbol
|
|
<TT>"__NO_FPU__"</TT> is defined.
|
|
<DT id="3754"><B>-mloop</B><DD>
|
|
|
|
|
|
Enables the use of the e3v5 <FONT SIZE="-1">LOOP</FONT> instruction. The use of this
|
|
instruction is not enabled by default when the e3v5 architecture is
|
|
selected because its use is still experimental.
|
|
<DT id="3755"><B>-mrh850-abi</B><DD>
|
|
|
|
|
|
|
|
<DT id="3756"><B>-mghs</B><DD>
|
|
|
|
|
|
|
|
Enables support for the <FONT SIZE="-1">RH850</FONT> version of the V850 <FONT SIZE="-1">ABI.</FONT> This is the
|
|
default. With this version of the <FONT SIZE="-1">ABI</FONT> the following rules apply:
|
|
<DL COMPACT><DT id="3757"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3758">*<DD>
|
|
Integer sized structures and unions are returned via a memory pointer
|
|
rather than a register.
|
|
<DT id="3759">*<DD>
|
|
Large structures and unions (more than 8 bytes in size) are passed by
|
|
value.
|
|
<DT id="3760">*<DD>
|
|
Functions are aligned to 16-bit boundaries.
|
|
<DT id="3761">*<DD>
|
|
The <B>-m8byte-align</B> command-line option is supported.
|
|
<DT id="3762">*<DD>
|
|
The <B>-mdisable-callt</B> command-line option is enabled by
|
|
default. The <B>-mno-disable-callt</B> command-line option is not
|
|
supported.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3763"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When this version of the <FONT SIZE="-1">ABI</FONT> is enabled the C preprocessor symbol
|
|
<TT>"__V850_RH850_ABI__"</TT> is defined.
|
|
</DL>
|
|
|
|
<DT id="3764"><B>-mgcc-abi</B><DD>
|
|
|
|
|
|
Enables support for the old <FONT SIZE="-1">GCC</FONT> version of the V850 <FONT SIZE="-1">ABI.</FONT> With this
|
|
version of the <FONT SIZE="-1">ABI</FONT> the following rules apply:
|
|
<DL COMPACT><DT id="3765"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3766">*<DD>
|
|
Integer sized structures and unions are returned in register <TT>"r10"</TT>.
|
|
<DT id="3767">*<DD>
|
|
Large structures and unions (more than 8 bytes in size) are passed by
|
|
reference.
|
|
<DT id="3768">*<DD>
|
|
Functions are aligned to 32-bit boundaries, unless optimizing for
|
|
size.
|
|
<DT id="3769">*<DD>
|
|
The <B>-m8byte-align</B> command-line option is not supported.
|
|
<DT id="3770">*<DD>
|
|
The <B>-mdisable-callt</B> command-line option is supported but not
|
|
enabled by default.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3771"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When this version of the <FONT SIZE="-1">ABI</FONT> is enabled the C preprocessor symbol
|
|
<TT>"__V850_GCC_ABI__"</TT> is defined.
|
|
</DL>
|
|
|
|
<DT id="3772"><B>-m8byte-align</B><DD>
|
|
|
|
|
|
|
|
<DT id="3773"><B>-mno-8byte-align</B><DD>
|
|
|
|
|
|
|
|
Enables support for <TT>"double"</TT> and <TT>"long long"</TT> types to be
|
|
aligned on 8-byte boundaries. The default is to restrict the
|
|
alignment of all objects to at most 4-bytes. When
|
|
<B>-m8byte-align</B> is in effect the C preprocessor symbol
|
|
<TT>"__V850_8BYTE_ALIGN__"</TT> is defined.
|
|
<DT id="3774"><B>-mbig-switch</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="3775"><B>-mapp-regs</B><DD>
|
|
|
|
|
|
This option causes r2 and r5 to be used in the code generated by
|
|
the compiler. This setting is the default.
|
|
<DT id="3776"><B>-mno-app-regs</B><DD>
|
|
|
|
|
|
This option causes r2 and r5 to be treated as fixed registers.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>VAX</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for the <FONT SIZE="-1">VAX:</FONT>
|
|
<DL COMPACT>
|
|
<DT id="3777"><B>-munix</B><DD>
|
|
|
|
|
|
Do not output certain jump instructions (<TT>"aobleq"</TT> and so on)
|
|
that the Unix assembler for the <FONT SIZE="-1">VAX</FONT> cannot handle across long
|
|
ranges.
|
|
<DT id="3778"><B>-mgnu</B><DD>
|
|
|
|
|
|
Do output those jump instructions, on the assumption that the
|
|
<FONT SIZE="-1">GNU</FONT> assembler is being used.
|
|
<DT id="3779"><B>-mg</B><DD>
|
|
|
|
|
|
Output code for G-format floating-point numbers instead of D-format.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>Visium Options</I>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="3780"><B>-mdebug</B><DD>
|
|
|
|
|
|
A program which performs file I/O and is destined to run on an <FONT SIZE="-1">MCM</FONT> 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 <FONT SIZE="-1">GDB</FONT> remote debugging stub.
|
|
<DT id="3781"><B>-msim</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="3782"><B>-mfpu</B><DD>
|
|
|
|
|
|
|
|
<DT id="3783"><B>-mhard-float</B><DD>
|
|
|
|
|
|
|
|
Generate code containing floating-point instructions. This is the
|
|
default.
|
|
<DT id="3784"><B>-mno-fpu</B><DD>
|
|
|
|
|
|
|
|
<DT id="3785"><B>-msoft-float</B><DD>
|
|
|
|
|
|
|
|
Generate code containing library calls for floating-point.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>-msoft-float</B> changes the calling convention in the output file;
|
|
therefore, it is only useful if you compile <I>all</I> of a program with
|
|
this option. In particular, you need to compile <I>libgcc.a</I>, the
|
|
library that comes with <FONT SIZE="-1">GCC,</FONT> with <B>-msoft-float</B> in order for
|
|
this to work.
|
|
<DT id="3786"><B>-mcpu=</B><I>cpu_type</I><DD>
|
|
|
|
|
|
Set the instruction set, register set, and instruction scheduling parameters
|
|
for machine type <I>cpu_type</I>. Supported values for <I>cpu_type</I> are
|
|
<B>mcm</B>, <B>gr5</B> and <B>gr6</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>mcm</B> is a synonym of <B>gr5</B> present for backward compatibility.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
By default (unless configured otherwise), <FONT SIZE="-1">GCC</FONT> generates code for the <FONT SIZE="-1">GR5</FONT>
|
|
variant of the Visium architecture.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With <B>-mcpu=gr6</B>, <FONT SIZE="-1">GCC</FONT> generates code for the <FONT SIZE="-1">GR6</FONT> variant of the Visium
|
|
architecture. The only difference from <FONT SIZE="-1">GR5</FONT> code is that the compiler will
|
|
generate block move instructions.
|
|
<DT id="3787"><B>-mtune=</B><I>cpu_type</I><DD>
|
|
|
|
|
|
Set the instruction scheduling parameters for machine type <I>cpu_type</I>,
|
|
but do not set the instruction set or register set that the option
|
|
<B>-mcpu=</B><I>cpu_type</I> would.
|
|
<DT id="3788"><B>-msv-mode</B><DD>
|
|
|
|
|
|
Generate code for the supervisor mode, where there are no restrictions on
|
|
the access to general registers. This is the default.
|
|
<DT id="3789"><B>-muser-mode</B><DD>
|
|
|
|
|
|
Generate code for the user mode, where the access to some general registers
|
|
is forbidden: on the <FONT SIZE="-1">GR5,</FONT> registers r24 to r31 cannot be accessed in this
|
|
mode; on the <FONT SIZE="-1">GR6,</FONT> only registers r29 to r31 are affected.
|
|
</DL>
|
|
<P>
|
|
|
|
<I></I><FONT SIZE="-1"><I>VMS</I></FONT><I> Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for the <FONT SIZE="-1">VMS</FONT> implementations:
|
|
<DL COMPACT>
|
|
<DT id="3790"><B>-mvms-return-codes</B><DD>
|
|
|
|
|
|
Return <FONT SIZE="-1">VMS</FONT> condition codes from <TT>"main"</TT>. The default is to return POSIX-style
|
|
condition (e.g. error) codes.
|
|
<DT id="3791"><B>-mdebug-main=</B><I>prefix</I><DD>
|
|
|
|
|
|
Flag the first routine whose name starts with <I>prefix</I> as the main
|
|
routine for the debugger.
|
|
<DT id="3792"><B>-mmalloc64</B><DD>
|
|
|
|
|
|
Default to 64-bit memory allocation routines.
|
|
<DT id="3793"><B>-mpointer-size=</B><I>size</I><DD>
|
|
|
|
|
|
Set the default size of pointers. Possible options for <I>size</I> are
|
|
<B>32</B> or <B>short</B> for 32 bit pointers, <B>64</B> or <B>long</B>
|
|
for 64 bit pointers, and <B>no</B> for supporting only 32 bit pointers.
|
|
The later option disables <TT>"pragma pointer_size"</TT>.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>VxWorks Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
The options in this section are defined for all VxWorks targets.
|
|
Options specific to the target hardware are listed with the other
|
|
options for that target.
|
|
<DL COMPACT>
|
|
<DT id="3794"><B>-mrtp</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> 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 <TT>"__RTP__"</TT>.
|
|
<DT id="3795"><B>-non-static</B><DD>
|
|
|
|
|
|
Link an <FONT SIZE="-1">RTP</FONT> executable against shared libraries rather than static
|
|
libraries. The options <B>-static</B> and <B>-shared</B> can
|
|
also be used for RTPs; <B>-static</B>
|
|
is the default.
|
|
<DT id="3796"><B>-Bstatic</B><DD>
|
|
|
|
|
|
|
|
<DT id="3797"><B>-Bdynamic</B><DD>
|
|
|
|
|
|
|
|
These options are passed down to the linker. They are defined for
|
|
compatibility with Diab.
|
|
<DT id="3798"><B>-Xbind-lazy</B><DD>
|
|
|
|
|
|
Enable lazy binding of function calls. This option is equivalent to
|
|
<B>-Wl,-z,now</B> and is defined for compatibility with Diab.
|
|
<DT id="3799"><B>-Xbind-now</B><DD>
|
|
|
|
|
|
Disable lazy binding of function calls. This option is the default and
|
|
is defined for compatibility with Diab.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>x86 Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These <B>-m</B> options are defined for the x86 family of computers.
|
|
<DL COMPACT>
|
|
<DT id="3800"><B>-march=</B><I>cpu-type</I><DD>
|
|
|
|
|
|
Generate instructions for the machine type <I>cpu-type</I>. In contrast to
|
|
<B>-mtune=</B><I>cpu-type</I>, which merely tunes the generated code
|
|
for the specified <I>cpu-type</I>, <B>-march=</B><I>cpu-type</I> allows <FONT SIZE="-1">GCC</FONT>
|
|
to generate code that may not run at all on processors other than the one
|
|
indicated. Specifying <B>-march=</B><I>cpu-type</I> implies
|
|
<B>-mtune=</B><I>cpu-type</I>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The choices for <I>cpu-type</I> are:
|
|
<DL COMPACT><DT id="3801"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3802"><B>native</B><DD>
|
|
|
|
|
|
This selects the <FONT SIZE="-1">CPU</FONT> to generate code for at compilation time by determining
|
|
the processor type of the compiling machine. Using <B>-march=native</B>
|
|
enables all instruction subsets supported by the local machine (hence
|
|
the result might not run on different machines). Using <B>-mtune=native</B>
|
|
produces code optimized for the local machine under the constraints
|
|
of the selected instruction set.
|
|
<DT id="3803"><B>x86-64</B><DD>
|
|
|
|
|
|
A generic <FONT SIZE="-1">CPU</FONT> with 64-bit extensions.
|
|
<DT id="3804"><B>i386</B><DD>
|
|
|
|
|
|
Original Intel i386 <FONT SIZE="-1">CPU.</FONT>
|
|
<DT id="3805"><B>i486</B><DD>
|
|
|
|
|
|
Intel i486 <FONT SIZE="-1">CPU.</FONT> (No scheduling is implemented for this chip.)
|
|
<DT id="3806"><B>i586</B><DD>
|
|
|
|
|
|
|
|
<DT id="3807"><B>pentium</B><DD>
|
|
|
|
|
|
|
|
Intel Pentium <FONT SIZE="-1">CPU</FONT> with no <FONT SIZE="-1">MMX</FONT> support.
|
|
<DT id="3808"><B>lakemont</B><DD>
|
|
|
|
|
|
Intel Lakemont <FONT SIZE="-1">MCU,</FONT> based on Intel Pentium <FONT SIZE="-1">CPU.</FONT>
|
|
<DT id="3809"><B>pentium-mmx</B><DD>
|
|
|
|
|
|
Intel Pentium <FONT SIZE="-1">MMX CPU,</FONT> based on Pentium core with <FONT SIZE="-1">MMX</FONT> instruction set support.
|
|
<DT id="3810"><B>pentiumpro</B><DD>
|
|
|
|
|
|
Intel Pentium Pro <FONT SIZE="-1">CPU.</FONT>
|
|
<DT id="3811"><B>i686</B><DD>
|
|
|
|
|
|
When used with <B>-march</B>, the Pentium Pro
|
|
instruction set is used, so the code runs on all i686 family chips.
|
|
When used with <B>-mtune</B>, it has the same meaning as <B>generic</B>.
|
|
<DT id="3812"><B>pentium2</B><DD>
|
|
|
|
|
|
Intel Pentium <FONT SIZE="-1">II CPU,</FONT> based on Pentium Pro core with <FONT SIZE="-1">MMX</FONT> instruction set
|
|
support.
|
|
<DT id="3813"><B>pentium3</B><DD>
|
|
|
|
|
|
|
|
<DT id="3814"><B>pentium3m</B><DD>
|
|
|
|
|
|
|
|
Intel Pentium <FONT SIZE="-1">III CPU,</FONT> based on Pentium Pro core with <FONT SIZE="-1">MMX</FONT> and <FONT SIZE="-1">SSE</FONT> instruction
|
|
set support.
|
|
<DT id="3815"><B>pentium-m</B><DD>
|
|
|
|
|
|
Intel Pentium M; low-power version of Intel Pentium <FONT SIZE="-1">III CPU</FONT>
|
|
with <FONT SIZE="-1">MMX, SSE</FONT> and <FONT SIZE="-1">SSE2</FONT> instruction set support. Used by Centrino notebooks.
|
|
<DT id="3816"><B>pentium4</B><DD>
|
|
|
|
|
|
|
|
<DT id="3817"><B>pentium4m</B><DD>
|
|
|
|
|
|
|
|
Intel Pentium 4 <FONT SIZE="-1">CPU</FONT> with <FONT SIZE="-1">MMX, SSE</FONT> and <FONT SIZE="-1">SSE2</FONT> instruction set support.
|
|
<DT id="3818"><B>prescott</B><DD>
|
|
|
|
|
|
Improved version of Intel Pentium 4 <FONT SIZE="-1">CPU</FONT> with <FONT SIZE="-1">MMX, SSE, SSE2</FONT> and <FONT SIZE="-1">SSE3</FONT> instruction
|
|
set support.
|
|
<DT id="3819"><B>nocona</B><DD>
|
|
|
|
|
|
Improved version of Intel Pentium 4 <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MMX, SSE,
|
|
SSE2</FONT> and <FONT SIZE="-1">SSE3</FONT> instruction set support.
|
|
<DT id="3820"><B>core2</B><DD>
|
|
|
|
|
|
Intel Core 2 <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MMX, SSE, SSE2, SSE3</FONT> and <FONT SIZE="-1">SSSE3</FONT>
|
|
instruction set support.
|
|
<DT id="3821"><B>nehalem</B><DD>
|
|
|
|
|
|
Intel Nehalem <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MMX, SSE, SSE2, SSE3, SSSE3,
|
|
SSE4.1, SSE4.2</FONT> and <FONT SIZE="-1">POPCNT</FONT> instruction set support.
|
|
<DT id="3822"><B>westmere</B><DD>
|
|
|
|
|
|
Intel Westmere <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MMX, SSE, SSE2, SSE3, SSSE3,
|
|
SSE4.1, SSE4.2, POPCNT, AES</FONT> and <FONT SIZE="-1">PCLMUL</FONT> instruction set support.
|
|
<DT id="3823"><B>sandybridge</B><DD>
|
|
|
|
|
|
Intel Sandy Bridge <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MMX, SSE, SSE2, SSE3, SSSE3,
|
|
SSE4.1, SSE4.2, POPCNT, AVX, AES</FONT> and <FONT SIZE="-1">PCLMUL</FONT> instruction set support.
|
|
<DT id="3824"><B>ivybridge</B><DD>
|
|
|
|
|
|
Intel Ivy Bridge <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MMX, SSE, SSE2, SSE3, SSSE3,
|
|
SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND</FONT> and F16C
|
|
instruction set support.
|
|
<DT id="3825"><B>haswell</B><DD>
|
|
|
|
|
|
Intel Haswell <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
|
|
SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
|
|
BMI, BMI2</FONT> and F16C instruction set support.
|
|
<DT id="3826"><B>broadwell</B><DD>
|
|
|
|
|
|
Intel Broadwell <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
|
|
SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
|
|
BMI, BMI2, F16C, RDSEED, ADCX</FONT> and <FONT SIZE="-1">PREFETCHW</FONT> instruction set support.
|
|
<DT id="3827"><B>skylake</B><DD>
|
|
|
|
|
|
Intel Skylake <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
|
|
SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
|
|
BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC</FONT> and
|
|
<FONT SIZE="-1">XSAVES</FONT> instruction set support.
|
|
<DT id="3828"><B>bonnell</B><DD>
|
|
|
|
|
|
Intel Bonnell <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2, SSE3</FONT> and <FONT SIZE="-1">SSSE3</FONT>
|
|
instruction set support.
|
|
<DT id="3829"><B>silvermont</B><DD>
|
|
|
|
|
|
Intel Silvermont <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
|
|
SSE4.1, SSE4.2, POPCNT, AES, PCLMUL</FONT> and <FONT SIZE="-1">RDRND</FONT> instruction set support.
|
|
<DT id="3830"><B>goldmont</B><DD>
|
|
|
|
|
|
Intel Goldmont <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
|
|
SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT</FONT> and <FONT SIZE="-1">FSGSBASE</FONT>
|
|
instruction set support.
|
|
<DT id="3831"><B>goldmont-plus</B><DD>
|
|
|
|
|
|
Intel Goldmont Plus <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2, SSE3,
|
|
SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT, FSGSBASE,
|
|
PTWRITE, RDPID, SGX</FONT> and <FONT SIZE="-1">UMIP</FONT> instruction set support.
|
|
<DT id="3832"><B>tremont</B><DD>
|
|
|
|
|
|
Intel Tremont <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
|
|
SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT, FSGSBASE, PTWRITE,
|
|
RDPID, SGX, UMIP,</FONT> GFNI-SSE, <FONT SIZE="-1">CLWB</FONT> and <FONT SIZE="-1">ENCLV</FONT> instruction set support.
|
|
<DT id="3833"><B>knl</B><DD>
|
|
|
|
|
|
Intel Knight's Landing <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2, SSE3,
|
|
SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
|
|
BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER</FONT> and
|
|
<FONT SIZE="-1">AVX512CD</FONT> instruction set support.
|
|
<DT id="3834"><B>knm</B><DD>
|
|
|
|
|
|
Intel Knights Mill <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2, SSE3,
|
|
SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
|
|
BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER, AVX512CD,
|
|
AVX5124VNNIW, AVX5124FMAPS</FONT> and <FONT SIZE="-1">AVX512VPOPCNTDQ</FONT> instruction set support.
|
|
<DT id="3835"><B>skylake-avx512</B><DD>
|
|
|
|
|
|
Intel Skylake Server <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2, SSE3,
|
|
SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
|
|
BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
|
|
CLWB, AVX512VL, AVX512BW, AVX512DQ</FONT> and <FONT SIZE="-1">AVX512CD</FONT> instruction set support.
|
|
<DT id="3836"><B>cannonlake</B><DD>
|
|
|
|
|
|
Intel Cannonlake Server <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2,
|
|
SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
|
|
RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
|
|
XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
|
|
AVX512IFMA, SHA</FONT> and <FONT SIZE="-1">UMIP</FONT> instruction set support.
|
|
<DT id="3837"><B>icelake-client</B><DD>
|
|
|
|
|
|
Intel Icelake Client <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2,
|
|
SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
|
|
RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
|
|
XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
|
|
AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
|
|
AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES</FONT> instruction set support.
|
|
<DT id="3838"><B>icelake-server</B><DD>
|
|
|
|
|
|
Intel Icelake Server <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2,
|
|
SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE,
|
|
RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC,
|
|
XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI,
|
|
AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
|
|
AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES, PCONFIG</FONT> and <FONT SIZE="-1">WBNOINVD</FONT> instruction
|
|
set support.
|
|
<DT id="3839"><B>cascadelake</B><DD>
|
|
|
|
|
|
Intel Cascadelake <FONT SIZE="-1">CPU</FONT> with 64-bit extensions, <FONT SIZE="-1">MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
|
|
SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI,
|
|
BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, CLWB,
|
|
AVX512VL, AVX512BW, AVX512DQ, AVX512CD</FONT> and <FONT SIZE="-1">AVX512VNNI</FONT> instruction set support.
|
|
<DT id="3840"><B>k6</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">AMD K6 CPU</FONT> with <FONT SIZE="-1">MMX</FONT> instruction set support.
|
|
<DT id="3841"><B>k6-2</B><DD>
|
|
|
|
|
|
|
|
<DT id="3842"><B>k6-3</B><DD>
|
|
|
|
|
|
|
|
Improved versions of <FONT SIZE="-1">AMD K6 CPU</FONT> with <FONT SIZE="-1">MMX</FONT> and 3DNow! instruction set support.
|
|
<DT id="3843"><B>athlon</B><DD>
|
|
|
|
|
|
|
|
<DT id="3844"><B>athlon-tbird</B><DD>
|
|
|
|
|
|
|
|
<FONT SIZE="-1">AMD</FONT> Athlon <FONT SIZE="-1">CPU</FONT> with <FONT SIZE="-1">MMX,</FONT> 3dNOW!, enhanced 3DNow! and <FONT SIZE="-1">SSE</FONT> prefetch instructions
|
|
support.
|
|
<DT id="3845"><B>athlon-4</B><DD>
|
|
|
|
|
|
|
|
<DT id="3846"><B>athlon-xp</B><DD>
|
|
|
|
|
|
<DT id="3847"><B>athlon-mp</B><DD>
|
|
|
|
|
|
|
|
Improved <FONT SIZE="-1">AMD</FONT> Athlon <FONT SIZE="-1">CPU</FONT> with <FONT SIZE="-1">MMX,</FONT> 3DNow!, enhanced 3DNow! and full <FONT SIZE="-1">SSE</FONT>
|
|
instruction set support.
|
|
<DT id="3848"><B>k8</B><DD>
|
|
|
|
|
|
|
|
<DT id="3849"><B>opteron</B><DD>
|
|
|
|
|
|
<DT id="3850"><B>athlon64</B><DD>
|
|
|
|
|
|
<DT id="3851"><B>athlon-fx</B><DD>
|
|
|
|
|
|
|
|
Processors based on the <FONT SIZE="-1">AMD K8</FONT> core with x86-64 instruction set support,
|
|
including the <FONT SIZE="-1">AMD</FONT> Opteron, Athlon 64, and Athlon 64 <FONT SIZE="-1">FX</FONT> processors.
|
|
(This supersets <FONT SIZE="-1">MMX, SSE, SSE2,</FONT> 3DNow!, enhanced 3DNow! and 64-bit
|
|
instruction set extensions.)
|
|
<DT id="3852"><B>k8-sse3</B><DD>
|
|
|
|
|
|
|
|
<DT id="3853"><B>opteron-sse3</B><DD>
|
|
|
|
|
|
<DT id="3854"><B>athlon64-sse3</B><DD>
|
|
|
|
|
|
|
|
Improved versions of <FONT SIZE="-1">AMD K8</FONT> cores with <FONT SIZE="-1">SSE3</FONT> instruction set support.
|
|
<DT id="3855"><B>amdfam10</B><DD>
|
|
|
|
|
|
|
|
<DT id="3856"><B>barcelona</B><DD>
|
|
|
|
|
|
|
|
CPUs based on <FONT SIZE="-1">AMD</FONT> Family 10h cores with x86-64 instruction set support. (This
|
|
supersets <FONT SIZE="-1">MMX, SSE, SSE2, SSE3, SSE4A,</FONT> 3DNow!, enhanced 3DNow!, <FONT SIZE="-1">ABM</FONT> and 64-bit
|
|
instruction set extensions.)
|
|
<DT id="3857"><B>bdver1</B><DD>
|
|
|
|
|
|
CPUs based on <FONT SIZE="-1">AMD</FONT> Family 15h cores with x86-64 instruction set support. (This
|
|
supersets <FONT SIZE="-1">FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
|
|
SSSE3, SSE4.1, SSE4.2, ABM</FONT> and 64-bit instruction set extensions.)
|
|
<DT id="3858"><B>bdver2</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">AMD</FONT> Family 15h core based CPUs with x86-64 instruction set support. (This
|
|
supersets <FONT SIZE="-1">BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
|
|
SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM</FONT> and 64-bit instruction set
|
|
extensions.)
|
|
<DT id="3859"><B>bdver3</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">AMD</FONT> Family 15h core based CPUs with x86-64 instruction set support. (This
|
|
supersets <FONT SIZE="-1">BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES,</FONT>
|
|
<FONT SIZE="-1">PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM</FONT> and
|
|
64-bit instruction set extensions.
|
|
<DT id="3860"><B>bdver4</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">AMD</FONT> Family 15h core based CPUs with x86-64 instruction set support. (This
|
|
supersets <FONT SIZE="-1">BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP,</FONT>
|
|
<FONT SIZE="-1">AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1,</FONT>
|
|
<FONT SIZE="-1">SSE4.2, ABM</FONT> and 64-bit instruction set extensions.
|
|
<DT id="3861"><B>znver1</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">AMD</FONT> Family 17h core based CPUs with x86-64 instruction set support. (This
|
|
supersets <FONT SIZE="-1">BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
|
|
SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
|
|
SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT,</FONT> and 64-bit
|
|
instruction set extensions.
|
|
<DT id="3862"><B>znver2</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">AMD</FONT> Family 17h core based CPUs with x86-64 instruction set support. (This
|
|
supersets <FONT SIZE="-1">BMI, BMI2, ,CLWB, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED,
|
|
MWAITX, SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A,
|
|
SSSE3, SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT,</FONT> and 64-bit
|
|
instruction set extensions.)
|
|
<DT id="3863"><B>btver1</B><DD>
|
|
|
|
|
|
CPUs based on <FONT SIZE="-1">AMD</FONT> Family 14h cores with x86-64 instruction set support. (This
|
|
supersets <FONT SIZE="-1">MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM</FONT> and 64-bit
|
|
instruction set extensions.)
|
|
<DT id="3864"><B>btver2</B><DD>
|
|
|
|
|
|
CPUs based on <FONT SIZE="-1">AMD</FONT> Family 16h cores with x86-64 instruction set support. This
|
|
includes <FONT SIZE="-1">MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
|
|
SSE4A, SSSE3, SSE3, SSE2, SSE, MMX</FONT> and 64-bit instruction set extensions.
|
|
<DT id="3865"><B>winchip-c6</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">IDT</FONT> WinChip C6 <FONT SIZE="-1">CPU,</FONT> dealt in same way as i486 with additional <FONT SIZE="-1">MMX</FONT> instruction
|
|
set support.
|
|
<DT id="3866"><B>winchip2</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">IDT</FONT> WinChip 2 <FONT SIZE="-1">CPU,</FONT> dealt in same way as i486 with additional <FONT SIZE="-1">MMX</FONT> and 3DNow!
|
|
instruction set support.
|
|
<DT id="3867"><B>c3</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">VIA C3 CPU</FONT> with <FONT SIZE="-1">MMX</FONT> and 3DNow! instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3868"><B>c3-2</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">VIA C3-2</FONT> (Nehemiah/C5XL) <FONT SIZE="-1">CPU</FONT> with <FONT SIZE="-1">MMX</FONT> and <FONT SIZE="-1">SSE</FONT> instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3869"><B>c7</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">VIA C7</FONT> (Esther) <FONT SIZE="-1">CPU</FONT> with <FONT SIZE="-1">MMX, SSE, SSE2</FONT> and <FONT SIZE="-1">SSE3</FONT> instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3870"><B>samuel-2</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">VIA</FONT> Eden Samuel 2 <FONT SIZE="-1">CPU</FONT> with <FONT SIZE="-1">MMX</FONT> and 3DNow! instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3871"><B>nehemiah</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">VIA</FONT> Eden Nehemiah <FONT SIZE="-1">CPU</FONT> with <FONT SIZE="-1">MMX</FONT> and <FONT SIZE="-1">SSE</FONT> instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3872"><B>esther</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">VIA</FONT> Eden Esther <FONT SIZE="-1">CPU</FONT> with <FONT SIZE="-1">MMX, SSE, SSE2</FONT> and <FONT SIZE="-1">SSE3</FONT> instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3873"><B>eden-x2</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">VIA</FONT> Eden X2 <FONT SIZE="-1">CPU</FONT> with x86-64, <FONT SIZE="-1">MMX, SSE, SSE2</FONT> and <FONT SIZE="-1">SSE3</FONT> instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3874"><B>eden-x4</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">VIA</FONT> Eden X4 <FONT SIZE="-1">CPU</FONT> with x86-64, <FONT SIZE="-1">MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2,
|
|
AVX</FONT> and <FONT SIZE="-1">AVX2</FONT> instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3875"><B>nano</B><DD>
|
|
|
|
|
|
Generic <FONT SIZE="-1">VIA</FONT> Nano <FONT SIZE="-1">CPU</FONT> with x86-64, <FONT SIZE="-1">MMX, SSE, SSE2, SSE3</FONT> and <FONT SIZE="-1">SSSE3</FONT>
|
|
instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3876"><B>nano-1000</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">VIA</FONT> Nano 1xxx <FONT SIZE="-1">CPU</FONT> with x86-64, <FONT SIZE="-1">MMX, SSE, SSE2, SSE3</FONT> and <FONT SIZE="-1">SSSE3</FONT>
|
|
instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3877"><B>nano-2000</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">VIA</FONT> Nano 2xxx <FONT SIZE="-1">CPU</FONT> with x86-64, <FONT SIZE="-1">MMX, SSE, SSE2, SSE3</FONT> and <FONT SIZE="-1">SSSE3</FONT>
|
|
instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3878"><B>nano-3000</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">VIA</FONT> Nano 3xxx <FONT SIZE="-1">CPU</FONT> with x86-64, <FONT SIZE="-1">MMX, SSE, SSE2, SSE3, SSSE3</FONT> and <FONT SIZE="-1">SSE4.1</FONT>
|
|
instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3879"><B>nano-x2</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">VIA</FONT> Nano Dual Core <FONT SIZE="-1">CPU</FONT> with x86-64, <FONT SIZE="-1">MMX, SSE, SSE2, SSE3, SSSE3</FONT> and <FONT SIZE="-1">SSE4.1</FONT>
|
|
instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3880"><B>nano-x4</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">VIA</FONT> Nano Quad Core <FONT SIZE="-1">CPU</FONT> with x86-64, <FONT SIZE="-1">MMX, SSE, SSE2, SSE3, SSSE3</FONT> and <FONT SIZE="-1">SSE4.1</FONT>
|
|
instruction set support.
|
|
(No scheduling is implemented for this chip.)
|
|
<DT id="3881"><B>geode</B><DD>
|
|
|
|
|
|
<FONT SIZE="-1">AMD</FONT> Geode embedded processor with <FONT SIZE="-1">MMX</FONT> and 3DNow! instruction set support.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3882"><DD>
|
|
</DL>
|
|
|
|
<DT id="3883"><B>-mtune=</B><I>cpu-type</I><DD>
|
|
|
|
|
|
Tune to <I>cpu-type</I> everything applicable about the generated code, except
|
|
for the <FONT SIZE="-1">ABI</FONT> and the set of available instructions.
|
|
While picking a specific <I>cpu-type</I> schedules things appropriately
|
|
for that particular chip, the compiler does not generate any code that
|
|
cannot run on the default machine type unless you use a
|
|
<B>-march=</B><I>cpu-type</I> option.
|
|
For example, if <FONT SIZE="-1">GCC</FONT> is configured for i686-pc-linux-gnu
|
|
then <B>-mtune=pentium4</B> generates code that is tuned for Pentium 4
|
|
but still runs on i686 machines.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The choices for <I>cpu-type</I> are the same as for <B>-march</B>.
|
|
In addition, <B>-mtune</B> supports 2 extra choices for <I>cpu-type</I>:
|
|
<DL COMPACT><DT id="3884"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3885"><B>generic</B><DD>
|
|
|
|
|
|
Produce code optimized for the most common <FONT SIZE="-1">IA32/AMD64/EM64T</FONT> processors.
|
|
If you know the <FONT SIZE="-1">CPU</FONT> on which your code will run, then you should use
|
|
the corresponding <B>-mtune</B> or <B>-march</B> option instead of
|
|
<B>-mtune=generic</B>. But, if you do not know exactly what <FONT SIZE="-1">CPU</FONT> users
|
|
of your application will have, then you should use this option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
As new processors are deployed in the marketplace, the behavior of this
|
|
option will change. Therefore, if you upgrade to a newer version of
|
|
<FONT SIZE="-1">GCC,</FONT> code generation controlled by this option will change to reflect
|
|
the processors
|
|
that are most common at the time that version of <FONT SIZE="-1">GCC</FONT> is released.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
There is no <B>-march=generic</B> option because <B>-march</B>
|
|
indicates the instruction set the compiler can use, and there is no
|
|
generic instruction set applicable to all processors. In contrast,
|
|
<B>-mtune</B> indicates the processor (or, in this case, collection of
|
|
processors) for which the code is optimized.
|
|
<DT id="3886"><B>intel</B><DD>
|
|
|
|
|
|
Produce code optimized for the most current Intel processors, which are
|
|
Haswell and Silvermont for this version of <FONT SIZE="-1">GCC.</FONT> If you know the <FONT SIZE="-1">CPU</FONT>
|
|
on which your code will run, then you should use the corresponding
|
|
<B>-mtune</B> or <B>-march</B> option instead of <B>-mtune=intel</B>.
|
|
But, if you want your application performs better on both Haswell and
|
|
Silvermont, then you should use this option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
As new Intel processors are deployed in the marketplace, the behavior of
|
|
this option will change. Therefore, if you upgrade to a newer version of
|
|
<FONT SIZE="-1">GCC,</FONT> code generation controlled by this option will change to reflect
|
|
the most current Intel processors at the time that version of <FONT SIZE="-1">GCC</FONT> is
|
|
released.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
There is no <B>-march=intel</B> option because <B>-march</B> indicates
|
|
the instruction set the compiler can use, and there is no common
|
|
instruction set applicable to all processors. In contrast,
|
|
<B>-mtune</B> indicates the processor (or, in this case, collection of
|
|
processors) for which the code is optimized.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3887"><DD>
|
|
</DL>
|
|
|
|
<DT id="3888"><B>-mcpu=</B><I>cpu-type</I><DD>
|
|
|
|
|
|
A deprecated synonym for <B>-mtune</B>.
|
|
<DT id="3889"><B>-mfpmath=</B><I>unit</I><DD>
|
|
|
|
|
|
Generate floating-point arithmetic for selected unit <I>unit</I>. The choices
|
|
for <I>unit</I> are:
|
|
<DL COMPACT><DT id="3890"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3891"><B>387</B><DD>
|
|
|
|
|
|
Use the standard 387 floating-point coprocessor present on the majority of chips and
|
|
emulated otherwise. Code compiled with this option runs almost everywhere.
|
|
The temporary results are computed in 80-bit precision instead of the precision
|
|
specified by the type, resulting in slightly different results compared to most
|
|
of other chips. See <B>-ffloat-store</B> for more detailed description.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This is the default choice for non-Darwin x86-32 targets.
|
|
<DT id="3892"><B>sse</B><DD>
|
|
|
|
|
|
Use scalar floating-point instructions present in the <FONT SIZE="-1">SSE</FONT> instruction set.
|
|
This instruction set is supported by Pentium <FONT SIZE="-1">III</FONT> and newer chips,
|
|
and in the <FONT SIZE="-1">AMD</FONT> line
|
|
by Athlon-4, Athlon <FONT SIZE="-1">XP</FONT> and Athlon <FONT SIZE="-1">MP</FONT> chips. The earlier version of the <FONT SIZE="-1">SSE</FONT>
|
|
instruction set supports only single-precision arithmetic, thus the double and
|
|
extended-precision arithmetic are still done using 387. A later version, present
|
|
only in Pentium 4 and <FONT SIZE="-1">AMD</FONT> x86-64 chips, supports double-precision
|
|
arithmetic too.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For the x86-32 compiler, you must use <B>-march=</B><I>cpu-type</I>, <B>-msse</B>
|
|
or <B>-msse2</B> switches to enable <FONT SIZE="-1">SSE</FONT> extensions and make this option
|
|
effective. For the x86-64 compiler, these extensions are enabled by default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The resulting code should be considerably faster in the majority of cases and avoid
|
|
the numerical instability problems of 387 code, but may break some existing
|
|
code that expects temporaries to be 80 bits.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This is the default choice for the x86-64 compiler, Darwin x86-32 targets,
|
|
and the default choice for x86-32 targets with the <FONT SIZE="-1">SSE2</FONT> instruction set
|
|
when <B>-ffast-math</B> is enabled.
|
|
<DT id="3893"><B>sse,387</B><DD>
|
|
|
|
|
|
|
|
<DT id="3894"><B>sse+387</B><DD>
|
|
|
|
|
|
<DT id="3895"><B>both</B><DD>
|
|
|
|
|
|
|
|
Attempt to utilize both instruction sets at once. This effectively doubles the
|
|
amount of available registers, and on chips with separate execution units for
|
|
387 and <FONT SIZE="-1">SSE</FONT> the execution resources too. Use this option with care, as it is
|
|
still experimental, because the <FONT SIZE="-1">GCC</FONT> register allocator does not model separate
|
|
functional units well, resulting in unstable performance.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="3896"><DD>
|
|
</DL>
|
|
|
|
<DT id="3897"><B>-masm=</B><I>dialect</I><DD>
|
|
|
|
|
|
Output assembly instructions using selected <I>dialect</I>. Also affects
|
|
which dialect is used for basic <TT>"asm"</TT> and
|
|
extended <TT>"asm"</TT>. Supported choices (in dialect
|
|
order) are <B>att</B> or <B>intel</B>. The default is <B>att</B>. Darwin does
|
|
not support <B>intel</B>.
|
|
<DT id="3898"><B>-mieee-fp</B><DD>
|
|
|
|
|
|
|
|
<DT id="3899"><B>-mno-ieee-fp</B><DD>
|
|
|
|
|
|
|
|
Control whether or not the compiler uses <FONT SIZE="-1">IEEE</FONT> floating-point
|
|
comparisons. These correctly handle the case where the result of a
|
|
comparison is unordered.
|
|
<DT id="3900"><B>-m80387</B><DD>
|
|
|
|
|
|
|
|
<DT id="3901"><B>-mhard-float</B><DD>
|
|
|
|
|
|
|
|
Generate output containing 80387 instructions for floating point.
|
|
<DT id="3902"><B>-mno-80387</B><DD>
|
|
|
|
|
|
|
|
<DT id="3903"><B>-msoft-float</B><DD>
|
|
|
|
|
|
|
|
Generate output containing library calls for floating point.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> the requisite libraries are not part of <FONT SIZE="-1">GCC.</FONT>
|
|
Normally the facilities of the machine's usual C compiler are used, but
|
|
this cannot be done directly in cross-compilation. You must make your
|
|
own arrangements to provide suitable library functions for
|
|
cross-compilation.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On machines where a function returns floating-point results in the 80387
|
|
register stack, some floating-point opcodes may be emitted even if
|
|
<B>-msoft-float</B> is used.
|
|
<DT id="3904"><B>-mno-fp-ret-in-387</B><DD>
|
|
|
|
|
|
Do not use the <FONT SIZE="-1">FPU</FONT> registers for return values of functions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The usual calling convention has functions return values of types
|
|
<TT>"float"</TT> and <TT>"double"</TT> in an <FONT SIZE="-1">FPU</FONT> register, even if there
|
|
is no <FONT SIZE="-1">FPU.</FONT> The idea is that the operating system should emulate
|
|
an <FONT SIZE="-1">FPU.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The option <B>-mno-fp-ret-in-387</B> causes such values to be returned
|
|
in ordinary <FONT SIZE="-1">CPU</FONT> registers instead.
|
|
<DT id="3905"><B>-mno-fancy-math-387</B><DD>
|
|
|
|
|
|
Some 387 emulators do not support the <TT>"sin"</TT>, <TT>"cos"</TT> and
|
|
<TT>"sqrt"</TT> instructions for the 387. Specify this option to avoid
|
|
generating those instructions.
|
|
This option is overridden when <B>-march</B>
|
|
indicates that the target <FONT SIZE="-1">CPU</FONT> always has an <FONT SIZE="-1">FPU</FONT> and so the
|
|
instruction does not need emulation. These
|
|
instructions are not generated unless you also use the
|
|
<B>-funsafe-math-optimizations</B> switch.
|
|
<DT id="3906"><B>-malign-double</B><DD>
|
|
|
|
|
|
|
|
<DT id="3907"><B>-mno-align-double</B><DD>
|
|
|
|
|
|
|
|
Control whether <FONT SIZE="-1">GCC</FONT> aligns <TT>"double"</TT>, <TT>"long double"</TT>, and
|
|
<TT>"long long"</TT> variables on a two-word boundary or a one-word
|
|
boundary. Aligning <TT>"double"</TT> variables on a two-word boundary
|
|
produces code that runs somewhat faster on a Pentium at the
|
|
expense of more memory.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On x86-64, <B>-malign-double</B> is enabled by default.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> if you use the <B>-malign-double</B> switch,
|
|
structures containing the above types are aligned differently than
|
|
the published application binary interface specifications for the x86-32
|
|
and are not binary compatible with structures in code compiled
|
|
without that switch.
|
|
<DT id="3908"><B>-m96bit-long-double</B><DD>
|
|
|
|
|
|
|
|
<DT id="3909"><B>-m128bit-long-double</B><DD>
|
|
|
|
|
|
|
|
These switches control the size of <TT>"long double"</TT> type. The x86-32
|
|
application binary interface specifies the size to be 96 bits,
|
|
so <B>-m96bit-long-double</B> is the default in 32-bit mode.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Modern architectures (Pentium and newer) prefer <TT>"long double"</TT>
|
|
to be aligned to an 8- or 16-byte boundary. In arrays or structures
|
|
conforming to the <FONT SIZE="-1">ABI,</FONT> this is not possible. So specifying
|
|
<B>-m128bit-long-double</B> aligns <TT>"long double"</TT>
|
|
to a 16-byte boundary by padding the <TT>"long double"</TT> with an additional
|
|
32-bit zero.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In the x86-64 compiler, <B>-m128bit-long-double</B> is the default choice as
|
|
its <FONT SIZE="-1">ABI</FONT> specifies that <TT>"long double"</TT> is aligned on 16-byte boundary.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Notice that neither of these options enable any extra precision over the x87
|
|
standard of 80 bits for a <TT>"long double"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> if you override the default value for your target <FONT SIZE="-1">ABI,</FONT> this
|
|
changes the size of
|
|
structures and arrays containing <TT>"long double"</TT> variables,
|
|
as well as modifying the function calling convention for functions taking
|
|
<TT>"long double"</TT>. Hence they are not binary-compatible
|
|
with code compiled without that switch.
|
|
<DT id="3910"><B>-mlong-double-64</B><DD>
|
|
|
|
|
|
|
|
<DT id="3911"><B>-mlong-double-80</B><DD>
|
|
|
|
|
|
<DT id="3912"><B>-mlong-double-128</B><DD>
|
|
|
|
|
|
|
|
These switches control the size of <TT>"long double"</TT> type. A size
|
|
of 64 bits makes the <TT>"long double"</TT> type equivalent to the <TT>"double"</TT>
|
|
type. This is the default for 32-bit Bionic C library. A size
|
|
of 128 bits makes the <TT>"long double"</TT> type equivalent to the
|
|
<TT>"__float128"</TT> type. This is the default for 64-bit Bionic C library.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> if you override the default value for your target <FONT SIZE="-1">ABI,</FONT> this
|
|
changes the size of
|
|
structures and arrays containing <TT>"long double"</TT> variables,
|
|
as well as modifying the function calling convention for functions taking
|
|
<TT>"long double"</TT>. Hence they are not binary-compatible
|
|
with code compiled without that switch.
|
|
<DT id="3913"><B>-malign-data=</B><I>type</I><DD>
|
|
|
|
|
|
Control how <FONT SIZE="-1">GCC</FONT> aligns variables. Supported values for <I>type</I> are
|
|
<B>compat</B> uses increased alignment value compatible uses <FONT SIZE="-1">GCC 4.8</FONT>
|
|
and earlier, <B>abi</B> uses alignment value as specified by the
|
|
psABI, and <B>cacheline</B> uses increased alignment value to match
|
|
the cache line size. <B>compat</B> is the default.
|
|
<DT id="3914"><B>-mlarge-data-threshold=</B><I>threshold</I><DD>
|
|
|
|
|
|
When <B>-mcmodel=medium</B> is specified, data objects larger than
|
|
<I>threshold</I> are placed in the large data section. This value must be the
|
|
same across all objects linked into the binary, and defaults to 65535.
|
|
<DT id="3915"><B>-mrtd</B><DD>
|
|
|
|
|
|
Use a different function-calling convention, in which functions that
|
|
take a fixed number of arguments return with the <TT>"ret </TT>num<TT>"</TT>
|
|
instruction, which pops their arguments while returning. This saves one
|
|
instruction in the caller since there is no need to pop the arguments
|
|
there.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
You can specify that an individual function is called with this calling
|
|
sequence with the function attribute <TT>"stdcall"</TT>. You can also
|
|
override the <B>-mrtd</B> option by using the function attribute
|
|
<TT>"cdecl"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> this calling convention is incompatible with the one
|
|
normally used on Unix, so you cannot use it if you need to call
|
|
libraries compiled with the Unix compiler.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Also, you must provide function prototypes for all functions that
|
|
take variable numbers of arguments (including <TT>"printf"</TT>);
|
|
otherwise incorrect code is generated for calls to those
|
|
functions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In addition, seriously incorrect code results if you call a
|
|
function with too many arguments. (Normally, extra arguments are
|
|
harmlessly ignored.)
|
|
<DT id="3916"><B>-mregparm=</B><I>num</I><DD>
|
|
|
|
|
|
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
|
|
function by using the function attribute <TT>"regparm"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> if you use this switch, and
|
|
<I>num</I> is nonzero, then you must build all modules with the same
|
|
value, including any libraries. This includes the system libraries and
|
|
startup modules.
|
|
<DT id="3917"><B>-msseregparm</B><DD>
|
|
|
|
|
|
Use <FONT SIZE="-1">SSE</FONT> 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 <TT>"sseregparm"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> if you use this switch then you must build all
|
|
modules with the same value, including any libraries. This includes
|
|
the system libraries and startup modules.
|
|
<DT id="3918"><B>-mvect8-ret-in-mem</B><DD>
|
|
|
|
|
|
Return 8-byte vectors in memory instead of <FONT SIZE="-1">MMX</FONT> registers. This is the
|
|
default on Solaris@tie{}8 and 9 and VxWorks to match the <FONT SIZE="-1">ABI</FONT> of the Sun
|
|
Studio compilers until version 12. Later compiler versions (starting
|
|
with Studio 12 Update@tie{}1) follow the <FONT SIZE="-1">ABI</FONT> used by other x86 targets, which
|
|
is the default on Solaris@tie{}10 and later. <I>Only</I> use this option if
|
|
you need to remain compatible with existing code produced by those
|
|
previous compiler versions or older versions of <FONT SIZE="-1">GCC.</FONT>
|
|
<DT id="3919"><B>-mpc32</B><DD>
|
|
|
|
|
|
|
|
<DT id="3920"><B>-mpc64</B><DD>
|
|
|
|
|
|
<DT id="3921"><B>-mpc80</B><DD>
|
|
|
|
|
|
|
|
Set 80387 floating-point precision to 32, 64 or 80 bits. When <B>-mpc32</B>
|
|
is specified, the significands of results of floating-point operations are
|
|
rounded to 24 bits (single precision); <B>-mpc64</B> rounds the
|
|
significands of results of floating-point operations to 53 bits (double
|
|
precision) and <B>-mpc80</B> rounds the significands of results of
|
|
floating-point operations to 64 bits (extended double precision), which is
|
|
the default. When this option is used, floating-point operations in higher
|
|
precisions are not available to the programmer without setting the <FONT SIZE="-1">FPU</FONT>
|
|
control word explicitly.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Setting the rounding of floating-point operations to less than the default
|
|
80 bits can speed some programs by 2% or more. Note that some mathematical
|
|
libraries assume that extended-precision (80-bit) floating-point operations
|
|
are enabled by default; routines in such libraries could suffer significant
|
|
loss of accuracy, typically through so-called ``catastrophic cancellation'',
|
|
when this option is used to set the precision to less than extended precision.
|
|
<DT id="3922"><B>-mstackrealign</B><DD>
|
|
|
|
|
|
Realign the stack at entry. On the x86, the <B>-mstackrealign</B>
|
|
option generates an alternate prologue and epilogue that realigns the
|
|
run-time stack if necessary. This supports mixing legacy codes that keep
|
|
4-byte stack alignment with modern codes that keep 16-byte stack alignment for
|
|
<FONT SIZE="-1">SSE</FONT> compatibility. See also the attribute <TT>"force_align_arg_pointer"</TT>,
|
|
applicable to individual functions.
|
|
<DT id="3923"><B>-mpreferred-stack-boundary=</B><I>num</I><DD>
|
|
|
|
|
|
Attempt to keep the stack boundary aligned to a 2 raised to <I>num</I>
|
|
byte boundary. If <B>-mpreferred-stack-boundary</B> is not specified,
|
|
the default is 4 (16 bytes or 128 bits).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> When generating code for the x86-64 architecture with
|
|
<FONT SIZE="-1">SSE</FONT> extensions disabled, <B>-mpreferred-stack-boundary=3</B> can be
|
|
used to keep the stack boundary aligned to 8 byte boundary. Since
|
|
x86-64 <FONT SIZE="-1">ABI</FONT> require 16 byte stack alignment, this is <FONT SIZE="-1">ABI</FONT> incompatible and
|
|
intended to be used in controlled environment where stack space is
|
|
important limitation. This option leads to wrong code when functions
|
|
compiled with 16 byte stack alignment (such as functions from a standard
|
|
library) are called with misaligned stack. In this case, <FONT SIZE="-1">SSE</FONT>
|
|
instructions may lead to misaligned memory access traps. In addition,
|
|
variable arguments are handled incorrectly for 16 byte aligned
|
|
objects (including x87 long double and __int128), leading to wrong
|
|
results. You must build all modules with
|
|
<B>-mpreferred-stack-boundary=3</B>, including any libraries. This
|
|
includes the system libraries and startup modules.
|
|
<DT id="3924"><B>-mincoming-stack-boundary=</B><I>num</I><DD>
|
|
|
|
|
|
Assume the incoming stack is aligned to a 2 raised to <I>num</I> byte
|
|
boundary. If <B>-mincoming-stack-boundary</B> is not specified,
|
|
the one specified by <B>-mpreferred-stack-boundary</B> is used.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
On Pentium and Pentium Pro, <TT>"double"</TT> and <TT>"long double"</TT> values
|
|
should be aligned to an 8-byte boundary (see <B>-malign-double</B>) or
|
|
suffer significant run time performance penalties. On Pentium <FONT SIZE="-1">III,</FONT> the
|
|
Streaming <FONT SIZE="-1">SIMD</FONT> Extension (<FONT SIZE="-1">SSE</FONT>) data type <TT>"__m128"</TT> may not work
|
|
properly if it is not 16-byte aligned.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To ensure proper alignment of this values on the stack, the stack boundary
|
|
must be as aligned as that required by any value stored on the stack.
|
|
Further, every function must be generated such that it keeps the stack
|
|
aligned. Thus calling a function compiled with a higher preferred
|
|
stack boundary from a function compiled with a lower preferred stack
|
|
boundary most likely misaligns the stack. It is recommended that
|
|
libraries that use callbacks always use the default setting.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This extra alignment does consume extra stack space, and generally
|
|
increases code size. Code that is sensitive to stack space usage, such
|
|
as embedded systems and operating system kernels, may want to reduce the
|
|
preferred alignment to <B>-mpreferred-stack-boundary=2</B>.
|
|
<DT id="3925"><B>-mmmx</B><DD>
|
|
|
|
|
|
|
|
<DT id="3926"><B>-msse</B><DD>
|
|
|
|
|
|
<DT id="3927"><B>-msse2</B><DD>
|
|
|
|
|
|
<DT id="3928"><B>-msse3</B><DD>
|
|
|
|
|
|
<DT id="3929"><B>-mssse3</B><DD>
|
|
|
|
|
|
<DT id="3930"><B>-msse4</B><DD>
|
|
|
|
|
|
<DT id="3931"><B>-msse4a</B><DD>
|
|
|
|
|
|
<DT id="3932"><B>-msse4.1</B><DD>
|
|
|
|
|
|
<DT id="3933"><B>-msse4.2</B><DD>
|
|
|
|
|
|
<DT id="3934"><B>-mavx</B><DD>
|
|
|
|
|
|
<DT id="3935"><B>-mavx2</B><DD>
|
|
|
|
|
|
<DT id="3936"><B>-mavx512f</B><DD>
|
|
|
|
|
|
<DT id="3937"><B>-mavx512pf</B><DD>
|
|
|
|
|
|
<DT id="3938"><B>-mavx512er</B><DD>
|
|
|
|
|
|
<DT id="3939"><B>-mavx512cd</B><DD>
|
|
|
|
|
|
<DT id="3940"><B>-mavx512vl</B><DD>
|
|
|
|
|
|
<DT id="3941"><B>-mavx512bw</B><DD>
|
|
|
|
|
|
<DT id="3942"><B>-mavx512dq</B><DD>
|
|
|
|
|
|
<DT id="3943"><B>-mavx512ifma</B><DD>
|
|
|
|
|
|
<DT id="3944"><B>-mavx512vbmi</B><DD>
|
|
|
|
|
|
<DT id="3945"><B>-msha</B><DD>
|
|
|
|
|
|
<DT id="3946"><B>-maes</B><DD>
|
|
|
|
|
|
<DT id="3947"><B>-mpclmul</B><DD>
|
|
|
|
|
|
<DT id="3948"><B>-mclflushopt</B><DD>
|
|
|
|
|
|
<DT id="3949"><B>-mclwb</B><DD>
|
|
|
|
|
|
<DT id="3950"><B>-mfsgsbase</B><DD>
|
|
|
|
|
|
<DT id="3951"><B>-mptwrite</B><DD>
|
|
|
|
|
|
<DT id="3952"><B>-mrdrnd</B><DD>
|
|
|
|
|
|
<DT id="3953"><B>-mf16c</B><DD>
|
|
|
|
|
|
<DT id="3954"><B>-mfma</B><DD>
|
|
|
|
|
|
<DT id="3955"><B>-mpconfig</B><DD>
|
|
|
|
|
|
<DT id="3956"><B>-mwbnoinvd</B><DD>
|
|
|
|
|
|
<DT id="3957"><B>-mfma4</B><DD>
|
|
|
|
|
|
<DT id="3958"><B>-mprfchw</B><DD>
|
|
|
|
|
|
<DT id="3959"><B>-mrdpid</B><DD>
|
|
|
|
|
|
<DT id="3960"><B>-mprefetchwt1</B><DD>
|
|
|
|
|
|
<DT id="3961"><B>-mrdseed</B><DD>
|
|
|
|
|
|
<DT id="3962"><B>-msgx</B><DD>
|
|
|
|
|
|
<DT id="3963"><B>-mxop</B><DD>
|
|
|
|
|
|
<DT id="3964"><B>-mlwp</B><DD>
|
|
|
|
|
|
<DT id="3965"><B>-m3dnow</B><DD>
|
|
|
|
|
|
<DT id="3966"><B>-m3dnowa</B><DD>
|
|
|
|
|
|
<DT id="3967"><B>-mpopcnt</B><DD>
|
|
|
|
|
|
<DT id="3968"><B>-mabm</B><DD>
|
|
|
|
|
|
<DT id="3969"><B>-madx</B><DD>
|
|
|
|
|
|
<DT id="3970"><B>-mbmi</B><DD>
|
|
|
|
|
|
<DT id="3971"><B>-mbmi2</B><DD>
|
|
|
|
|
|
<DT id="3972"><B>-mlzcnt</B><DD>
|
|
|
|
|
|
<DT id="3973"><B>-mfxsr</B><DD>
|
|
|
|
|
|
<DT id="3974"><B>-mxsave</B><DD>
|
|
|
|
|
|
<DT id="3975"><B>-mxsaveopt</B><DD>
|
|
|
|
|
|
<DT id="3976"><B>-mxsavec</B><DD>
|
|
|
|
|
|
<DT id="3977"><B>-mxsaves</B><DD>
|
|
|
|
|
|
<DT id="3978"><B>-mrtm</B><DD>
|
|
|
|
|
|
<DT id="3979"><B>-mhle</B><DD>
|
|
|
|
|
|
<DT id="3980"><B>-mtbm</B><DD>
|
|
|
|
|
|
<DT id="3981"><B>-mmwaitx</B><DD>
|
|
|
|
|
|
<DT id="3982"><B>-mclzero</B><DD>
|
|
|
|
|
|
<DT id="3983"><B>-mpku</B><DD>
|
|
|
|
|
|
<DT id="3984"><B>-mavx512vbmi2</B><DD>
|
|
|
|
|
|
<DT id="3985"><B>-mgfni</B><DD>
|
|
|
|
|
|
<DT id="3986"><B>-mvaes</B><DD>
|
|
|
|
|
|
<DT id="3987"><B>-mwaitpkg</B><DD>
|
|
|
|
|
|
<DT id="3988"><B>-mvpclmulqdq</B><DD>
|
|
|
|
|
|
<DT id="3989"><B>-mavx512bitalg</B><DD>
|
|
|
|
|
|
<DT id="3990"><B>-mmovdiri</B><DD>
|
|
|
|
|
|
<DT id="3991"><B>-mmovdir64b</B><DD>
|
|
|
|
|
|
<DT id="3992"><B>-mavx512vpopcntdq</B><DD>
|
|
|
|
|
|
<DT id="3993"><B>-mavx5124fmaps</B><DD>
|
|
|
|
|
|
<DT id="3994"><B>-mavx512vnni</B><DD>
|
|
|
|
|
|
<DT id="3995"><B>-mavx5124vnniw</B><DD>
|
|
|
|
|
|
<DT id="3996"><B>-mcldemote</B><DD>
|
|
|
|
|
|
|
|
These switches enable the use of instructions in the <FONT SIZE="-1">MMX, SSE,
|
|
SSE2, SSE3, SSSE3, SSE4, SSE4A, SSE4.1, SSE4.2, AVX, AVX2, AVX512F, AVX512PF,
|
|
AVX512ER, AVX512CD, AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA, AVX512VBMI, SHA,
|
|
AES, PCLMUL, CLFLUSHOPT, CLWB, FSGSBASE, PTWRITE, RDRND, F16C, FMA, PCONFIG,
|
|
WBNOINVD, FMA4, PREFETCHW, RDPID, PREFETCHWT1, RDSEED, SGX, XOP, LWP,</FONT>
|
|
3DNow!, enhanced 3DNow!, <FONT SIZE="-1">POPCNT, ABM, ADX, BMI, BMI2, LZCNT, FXSR, XSAVE,
|
|
XSAVEOPT, XSAVEC, XSAVES, RTM, HLE, TBM, MWAITX, CLZERO, PKU, AVX512VBMI2,
|
|
GFNI, VAES, WAITPKG, VPCLMULQDQ, AVX512BITALG, MOVDIRI, MOVDIR64B,
|
|
AVX512VPOPCNTDQ, AVX5124FMAPS, AVX512VNNI, AVX5124VNNIW,</FONT> or <FONT SIZE="-1">CLDEMOTE</FONT>
|
|
extended instruction sets. Each has a corresponding <B>-mno-</B> option to
|
|
disable use of these instructions.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
These extensions are also available as built-in functions: see
|
|
<B>x86 Built-in Functions</B>, for details of the functions enabled and
|
|
disabled by these switches.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
To generate <FONT SIZE="-1">SSE/SSE2</FONT> instructions automatically from floating-point
|
|
code (as opposed to 387 instructions), see <B>-mfpmath=sse</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> depresses SSEx instructions when <B>-mavx</B> is used. Instead, it
|
|
generates new <FONT SIZE="-1">AVX</FONT> instructions or <FONT SIZE="-1">AVX</FONT> equivalence for all SSEx instructions
|
|
when needed.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
These options enable <FONT SIZE="-1">GCC</FONT> to use these extended instructions in
|
|
generated code, even without <B>-mfpmath=sse</B>. Applications that
|
|
perform run-time <FONT SIZE="-1">CPU</FONT> detection must compile separate files for each
|
|
supported architecture, using the appropriate flags. In particular,
|
|
the file containing the <FONT SIZE="-1">CPU</FONT> detection code should be compiled without
|
|
these options.
|
|
<DT id="3997"><B>-mdump-tune-features</B><DD>
|
|
|
|
|
|
This option instructs <FONT SIZE="-1">GCC</FONT> to dump the names of the x86 performance
|
|
tuning features and default settings. The names can be used in
|
|
<B>-mtune-ctrl=</B><I>feature-list</I>.
|
|
<DT id="3998"><B>-mtune-ctrl=</B><I>feature-list</I><DD>
|
|
|
|
|
|
This option is used to do fine grain control of x86 code generation features.
|
|
<I>feature-list</I> is a comma separated list of <I>feature</I> names. See also
|
|
<B>-mdump-tune-features</B>. When specified, the <I>feature</I> is turned
|
|
on if it is not preceded with <B>^</B>, otherwise, it is turned off.
|
|
<B>-mtune-ctrl=</B><I>feature-list</I> is intended to be used by <FONT SIZE="-1">GCC</FONT>
|
|
developers. Using it may lead to code paths not covered by testing and can
|
|
potentially result in compiler ICEs or runtime errors.
|
|
<DT id="3999"><B>-mno-default</B><DD>
|
|
|
|
|
|
This option instructs <FONT SIZE="-1">GCC</FONT> to turn off all tunable features. See also
|
|
<B>-mtune-ctrl=</B><I>feature-list</I> and <B>-mdump-tune-features</B>.
|
|
<DT id="4000"><B>-mcld</B><DD>
|
|
|
|
|
|
This option instructs <FONT SIZE="-1">GCC</FONT> to emit a <TT>"cld"</TT> instruction in the prologue
|
|
of functions that use string instructions. String instructions depend on
|
|
the <FONT SIZE="-1">DF</FONT> flag to select between autoincrement or autodecrement mode. While the
|
|
<FONT SIZE="-1">ABI</FONT> specifies the <FONT SIZE="-1">DF</FONT> flag to be cleared on function entry, some operating
|
|
systems violate this specification by not clearing the <FONT SIZE="-1">DF</FONT> flag in their
|
|
exception dispatchers. The exception handler can be invoked with the <FONT SIZE="-1">DF</FONT> flag
|
|
set, which leads to wrong direction mode when string instructions are used.
|
|
This option can be enabled by default on 32-bit x86 targets by configuring
|
|
<FONT SIZE="-1">GCC</FONT> with the <B>--enable-cld</B> configure option. Generation of <TT>"cld"</TT>
|
|
instructions can be suppressed with the <B>-mno-cld</B> compiler option
|
|
in this case.
|
|
<DT id="4001"><B>-mvzeroupper</B><DD>
|
|
|
|
|
|
This option instructs <FONT SIZE="-1">GCC</FONT> to emit a <TT>"vzeroupper"</TT> instruction
|
|
before a transfer of control flow out of the function to minimize
|
|
the <FONT SIZE="-1">AVX</FONT> to <FONT SIZE="-1">SSE</FONT> transition penalty as well as remove unnecessary <TT>"zeroupper"</TT>
|
|
intrinsics.
|
|
<DT id="4002"><B>-mprefer-avx128</B><DD>
|
|
|
|
|
|
This option instructs <FONT SIZE="-1">GCC</FONT> to use 128-bit <FONT SIZE="-1">AVX</FONT> instructions instead of
|
|
256-bit <FONT SIZE="-1">AVX</FONT> instructions in the auto-vectorizer.
|
|
<DT id="4003"><B>-mprefer-vector-width=</B><I>opt</I><DD>
|
|
|
|
|
|
This option instructs <FONT SIZE="-1">GCC</FONT> to use <I>opt</I>-bit vector width in instructions
|
|
instead of default on the selected platform.
|
|
<DL COMPACT><DT id="4004"><DD>
|
|
<DL COMPACT>
|
|
<DT id="4005"><B>none</B><DD>
|
|
|
|
|
|
No extra limitations applied to <FONT SIZE="-1">GCC</FONT> other than defined by the selected platform.
|
|
<DT id="4006"><B>128</B><DD>
|
|
|
|
|
|
Prefer 128-bit vector width for instructions.
|
|
<DT id="4007"><B>256</B><DD>
|
|
|
|
|
|
Prefer 256-bit vector width for instructions.
|
|
<DT id="4008"><B>512</B><DD>
|
|
|
|
|
|
Prefer 512-bit vector width for instructions.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="4009"><DD>
|
|
</DL>
|
|
|
|
<DT id="4010"><B>-mcx16</B><DD>
|
|
|
|
|
|
This option enables <FONT SIZE="-1">GCC</FONT> to generate <TT>"CMPXCHG16B"</TT> 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
|
|
machine word in size. The compiler uses this instruction to implement
|
|
<B>__sync Builtins</B>. However, for <B>__atomic Builtins</B> operating on
|
|
128-bit integers, a library call is always used.
|
|
<DT id="4011"><B>-msahf</B><DD>
|
|
|
|
|
|
This option enables generation of <TT>"SAHF"</TT> 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,
|
|
lacked the <TT>"LAHF"</TT> and <TT>"SAHF"</TT> instructions
|
|
which are supported by <FONT SIZE="-1">AMD64.</FONT>
|
|
These are load and store instructions, respectively, for certain status flags.
|
|
In 64-bit mode, the <TT>"SAHF"</TT> instruction is used to optimize <TT>"fmod"</TT>,
|
|
<TT>"drem"</TT>, and <TT>"remainder"</TT> built-in functions;
|
|
see <B>Other Builtins</B> for details.
|
|
<DT id="4012"><B>-mmovbe</B><DD>
|
|
|
|
|
|
This option enables use of the <TT>"movbe"</TT> instruction to implement
|
|
<TT>"__builtin_bswap32"</TT> and <TT>"__builtin_bswap64"</TT>.
|
|
<DT id="4013"><B>-mshstk</B><DD>
|
|
|
|
|
|
The <B>-mshstk</B> option enables shadow stack built-in functions
|
|
from x86 Control-flow Enforcement Technology (<FONT SIZE="-1">CET</FONT>).
|
|
<DT id="4014"><B>-mcrc32</B><DD>
|
|
|
|
|
|
This option enables built-in functions <TT>"__builtin_ia32_crc32qi"</TT>,
|
|
<TT>"__builtin_ia32_crc32hi"</TT>, <TT>"__builtin_ia32_crc32si"</TT> and
|
|
<TT>"__builtin_ia32_crc32di"</TT> to generate the <TT>"crc32"</TT> machine instruction.
|
|
<DT id="4015"><B>-mrecip</B><DD>
|
|
|
|
|
|
This option enables use of <TT>"RCPSS"</TT> and <TT>"RSQRTSS"</TT> instructions
|
|
(and their vectorized variants <TT>"RCPPS"</TT> and <TT>"RSQRTPS"</TT>)
|
|
with an additional Newton-Raphson step
|
|
to increase precision instead of <TT>"DIVSS"</TT> and <TT>"SQRTSS"</TT>
|
|
(and their vectorized
|
|
variants) for single-precision floating-point arguments. These instructions
|
|
are generated only when <B>-funsafe-math-optimizations</B> is enabled
|
|
together with <B>-ffinite-math-only</B> and <B>-fno-trapping-math</B>.
|
|
Note that while the throughput of the sequence is higher than the throughput
|
|
of the non-reciprocal instruction, the precision of the sequence can be
|
|
decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that <FONT SIZE="-1">GCC</FONT> implements <TT>"1.0f/sqrtf(</TT>x<TT>)"</TT> in terms of <TT>"RSQRTSS"</TT>
|
|
(or <TT>"RSQRTPS"</TT>) already with <B>-ffast-math</B> (or the above option
|
|
combination), and doesn't need <B>-mrecip</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Also note that <FONT SIZE="-1">GCC</FONT> emits the above sequence with additional Newton-Raphson step
|
|
for vectorized single-float division and vectorized <TT>"sqrtf(</TT>x<TT>)"</TT>
|
|
already with <B>-ffast-math</B> (or the above option combination), and
|
|
doesn't need <B>-mrecip</B>.
|
|
<DT id="4016"><B>-mrecip=</B><I>opt</I><DD>
|
|
|
|
|
|
This option controls which reciprocal estimate instructions
|
|
may be used. <I>opt</I> is a comma-separated list of options, which may
|
|
be preceded by a <B>!</B> to invert the option:
|
|
<DL COMPACT><DT id="4017"><DD>
|
|
<DL COMPACT>
|
|
<DT id="4018"><B>all</B><DD>
|
|
|
|
|
|
Enable all estimate instructions.
|
|
<DT id="4019"><B>default</B><DD>
|
|
|
|
|
|
Enable the default instructions, equivalent to <B>-mrecip</B>.
|
|
<DT id="4020"><B>none</B><DD>
|
|
|
|
|
|
Disable all estimate instructions, equivalent to <B>-mno-recip</B>.
|
|
<DT id="4021"><B>div</B><DD>
|
|
|
|
|
|
Enable the approximation for scalar division.
|
|
<DT id="4022"><B>vec-div</B><DD>
|
|
|
|
|
|
Enable the approximation for vectorized division.
|
|
<DT id="4023"><B>sqrt</B><DD>
|
|
|
|
|
|
Enable the approximation for scalar square root.
|
|
<DT id="4024"><B>vec-sqrt</B><DD>
|
|
|
|
|
|
Enable the approximation for vectorized square root.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="4025"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
So, for example, <B>-mrecip=all,!sqrt</B> enables
|
|
all of the reciprocal approximations, except for square root.
|
|
</DL>
|
|
|
|
<DT id="4026"><B>-mveclibabi=</B><I>type</I><DD>
|
|
|
|
|
|
Specifies the <FONT SIZE="-1">ABI</FONT> type to use for vectorizing intrinsics using an
|
|
external library. Supported values for <I>type</I> are <B>svml</B>
|
|
for the Intel short
|
|
vector math library and <B>acml</B> for the <FONT SIZE="-1">AMD</FONT> math core library.
|
|
To use this option, both <B>-ftree-vectorize</B> and
|
|
<B>-funsafe-math-optimizations</B> have to be enabled, and an <FONT SIZE="-1">SVML</FONT> or <FONT SIZE="-1">ACML</FONT>
|
|
ABI-compatible library must be specified at link time.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">GCC</FONT> currently emits calls to <TT>"vmldExp2"</TT>,
|
|
<TT>"vmldLn2"</TT>, <TT>"vmldLog102"</TT>, <TT>"vmldPow2"</TT>,
|
|
<TT>"vmldTanh2"</TT>, <TT>"vmldTan2"</TT>, <TT>"vmldAtan2"</TT>, <TT>"vmldAtanh2"</TT>,
|
|
<TT>"vmldCbrt2"</TT>, <TT>"vmldSinh2"</TT>, <TT>"vmldSin2"</TT>, <TT>"vmldAsinh2"</TT>,
|
|
<TT>"vmldAsin2"</TT>, <TT>"vmldCosh2"</TT>, <TT>"vmldCos2"</TT>, <TT>"vmldAcosh2"</TT>,
|
|
<TT>"vmldAcos2"</TT>, <TT>"vmlsExp4"</TT>, <TT>"vmlsLn4"</TT>,
|
|
<TT>"vmlsLog104"</TT>, <TT>"vmlsPow4"</TT>, <TT>"vmlsTanh4"</TT>, <TT>"vmlsTan4"</TT>,
|
|
<TT>"vmlsAtan4"</TT>, <TT>"vmlsAtanh4"</TT>, <TT>"vmlsCbrt4"</TT>, <TT>"vmlsSinh4"</TT>,
|
|
<TT>"vmlsSin4"</TT>, <TT>"vmlsAsinh4"</TT>, <TT>"vmlsAsin4"</TT>, <TT>"vmlsCosh4"</TT>,
|
|
<TT>"vmlsCos4"</TT>, <TT>"vmlsAcosh4"</TT> and <TT>"vmlsAcos4"</TT> for corresponding
|
|
function type when <B>-mveclibabi=svml</B> is used, and <TT>"__vrd2_sin"</TT>,
|
|
<TT>"__vrd2_cos"</TT>, <TT>"__vrd2_exp"</TT>, <TT>"__vrd2_log"</TT>, <TT>"__vrd2_log2"</TT>,
|
|
<TT>"__vrd2_log10"</TT>, <TT>"__vrs4_sinf"</TT>, <TT>"__vrs4_cosf"</TT>,
|
|
<TT>"__vrs4_expf"</TT>, <TT>"__vrs4_logf"</TT>, <TT>"__vrs4_log2f"</TT>,
|
|
<TT>"__vrs4_log10f"</TT> and <TT>"__vrs4_powf"</TT> for the corresponding function type
|
|
when <B>-mveclibabi=acml</B> is used.
|
|
<DT id="4027"><B>-mabi=</B><I>name</I><DD>
|
|
|
|
|
|
Generate code for the specified calling convention. Permissible values
|
|
are <B>sysv</B> for the <FONT SIZE="-1">ABI</FONT> used on GNU/Linux and other systems, and
|
|
<B>ms</B> for the Microsoft <FONT SIZE="-1">ABI.</FONT> The default is to use the Microsoft
|
|
<FONT SIZE="-1">ABI</FONT> when targeting Microsoft Windows and the SysV <FONT SIZE="-1">ABI</FONT> on all other systems.
|
|
You can control this behavior for specific functions by
|
|
using the function attributes <TT>"ms_abi"</TT> and <TT>"sysv_abi"</TT>.
|
|
<DT id="4028"><B>-mforce-indirect-call</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="4029"><B>-mmanual-endbr</B><DD>
|
|
|
|
|
|
Insert <FONT SIZE="-1">ENDBR</FONT> instruction at function entry only via the <TT>"cf_check"</TT>
|
|
function attribute. This is useful when used with the option
|
|
<B>-fcf-protection=branch</B> to control <FONT SIZE="-1">ENDBR</FONT> insertion at the
|
|
function entry.
|
|
<DT id="4030"><B>-mcall-ms2sysv-xlogues</B><DD>
|
|
|
|
|
|
Due to differences in 64-bit ABIs, any Microsoft <FONT SIZE="-1">ABI</FONT> function that calls a
|
|
System V <FONT SIZE="-1">ABI</FONT> function must consider <FONT SIZE="-1">RSI, RDI</FONT> and <FONT SIZE="-1">XMM6-15</FONT> as clobbered. By
|
|
default, the code for saving and restoring these registers is emitted inline,
|
|
resulting in fairly lengthy prologues and epilogues. Using
|
|
<B>-mcall-ms2sysv-xlogues</B> emits prologues and epilogues that
|
|
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.
|
|
<DT id="4031"><B>-mtls-dialect=</B><I>type</I><DD>
|
|
|
|
|
|
Generate code to access thread-local storage using the <B>gnu</B> or
|
|
<B>gnu2</B> conventions. <B>gnu</B> is the conservative default;
|
|
<B>gnu2</B> is more efficient, but it may add compile- and run-time
|
|
requirements that cannot be satisfied on all systems.
|
|
<DT id="4032"><B>-mpush-args</B><DD>
|
|
|
|
|
|
|
|
<DT id="4033"><B>-mno-push-args</B><DD>
|
|
|
|
|
|
|
|
Use <FONT SIZE="-1">PUSH</FONT> operations to store outgoing parameters. This method is shorter
|
|
and usually equally fast as method using <FONT SIZE="-1">SUB/MOV</FONT> operations and is enabled
|
|
by default. In some cases disabling it may improve performance because of
|
|
improved scheduling and reduced dependencies.
|
|
<DT id="4034"><B>-maccumulate-outgoing-args</B><DD>
|
|
|
|
|
|
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 <B>-mno-push-args</B>.
|
|
<DT id="4035"><B>-mthreads</B><DD>
|
|
|
|
|
|
Support thread-safe exception handling on MinGW. Programs that rely
|
|
on thread-safe exception handling must compile and link all code with the
|
|
<B>-mthreads</B> option. When compiling, <B>-mthreads</B> defines
|
|
<B>-D_MT</B>; when linking, it links in a special thread helper library
|
|
<B>-lmingwthrd</B> which cleans up per-thread exception-handling data.
|
|
<DT id="4036"><B>-mms-bitfields</B><DD>
|
|
|
|
|
|
|
|
<DT id="4037"><B>-mno-ms-bitfields</B><DD>
|
|
|
|
|
|
|
|
Enable/disable bit-field layout compatible with the native Microsoft
|
|
Windows compiler.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <TT>"packed"</TT> is used on a structure, or if bit-fields are used,
|
|
it may be that the Microsoft <FONT SIZE="-1">ABI</FONT> lays out the structure differently
|
|
than the way <FONT SIZE="-1">GCC</FONT> normally does. Particularly when moving packed
|
|
data between functions compiled with <FONT SIZE="-1">GCC</FONT> and the native Microsoft compiler
|
|
(either via function call or as data in a file), it may be necessary to access
|
|
either format.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is enabled by default for Microsoft Windows
|
|
targets. This behavior can also be controlled locally by use of variable
|
|
or type attributes. For more information, see <B>x86 Variable Attributes</B>
|
|
and <B>x86 Type Attributes</B>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The Microsoft structure layout algorithm is fairly simple with the exception
|
|
of the bit-field packing.
|
|
The padding and alignment of members of structures and whether a bit-field
|
|
can straddle a storage-unit boundary are determine by these rules:
|
|
<DL COMPACT><DT id="4038"><DD>
|
|
<DL COMPACT>
|
|
<DT id="4039">1. Structure members are stored sequentially in the order in which they are<DD>
|
|
|
|
|
|
declared: the first member has the lowest memory address and the last member
|
|
the highest.
|
|
<DT id="4040">2. Every data object has an alignment requirement. The alignment requirement<DD>
|
|
|
|
|
|
for all data except structures, unions, and arrays is either the size of the
|
|
object or the current packing size (specified with either the
|
|
<TT>"aligned"</TT> attribute or the <TT>"pack"</TT> pragma),
|
|
whichever is less. For structures, unions, and arrays,
|
|
the alignment requirement is the largest alignment requirement of its members.
|
|
Every object is allocated an offset so that:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
offset % alignment_requirement == 0
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="4041">3. Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation<DD>
|
|
|
|
|
|
unit if the integral types are the same size and if the next bit-field fits
|
|
into the current allocation unit without crossing the boundary imposed by the
|
|
common alignment requirements of the bit-fields.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="4042"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<FONT SIZE="-1">MSVC</FONT> interprets zero-length bit-fields in the following ways:
|
|
<DL COMPACT>
|
|
<DT id="4043">1. If a zero-length bit-field is inserted between two bit-fields that<DD>
|
|
|
|
|
|
are normally coalesced, the bit-fields are not coalesced.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct
|
|
{
|
|
unsigned long bf_1 : 12;
|
|
unsigned long : 0;
|
|
unsigned long bf_2 : 12;
|
|
} t1;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The size of <TT>"t1"</TT> is 8 bytes with the zero-length bit-field. If the
|
|
zero-length bit-field were removed, <TT>"t1"</TT>'s size would be 4 bytes.
|
|
<DT id="4044">2. If a zero-length bit-field is inserted after a bit-field, "foo", and the<DD>
|
|
|
|
|
|
|
|
|
|
alignment of the zero-length bit-field is greater than the member that follows it,
|
|
<TT>"bar"</TT>, <TT>"bar"</TT> is aligned as the type of the zero-length bit-field.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For example:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct
|
|
{
|
|
char foo : 4;
|
|
short : 0;
|
|
char bar;
|
|
} t2;
|
|
|
|
struct
|
|
{
|
|
char foo : 4;
|
|
short : 0;
|
|
double bar;
|
|
} t3;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For <TT>"t2"</TT>, <TT>"bar"</TT> is placed at offset 2, rather than offset 1.
|
|
Accordingly, the size of <TT>"t2"</TT> is 4. For <TT>"t3"</TT>, the zero-length
|
|
bit-field does not affect the alignment of <TT>"bar"</TT> or, as a result, the size
|
|
of the structure.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Taking this into account, it is important to note the following:
|
|
<DL COMPACT><DT id="4045"><DD>
|
|
<DL COMPACT>
|
|
<DT id="4046">1. If a zero-length bit-field follows a normal bit-field, the type of the<DD>
|
|
|
|
|
|
zero-length bit-field may affect the alignment of the structure as whole. For
|
|
example, <TT>"t2"</TT> has a size of 4 bytes, since the zero-length bit-field follows a
|
|
normal bit-field, and is of type short.
|
|
<DT id="4047">2. Even if a zero-length bit-field is not followed by a normal bit-field, it may<DD>
|
|
|
|
|
|
still affect the alignment of the structure:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct
|
|
{
|
|
char foo : 6;
|
|
long : 0;
|
|
} t4;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Here, <TT>"t4"</TT> takes up 4 bytes.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="4048"><DD>
|
|
</DL>
|
|
|
|
<DT id="4049">3. Zero-length bit-fields following non-bit-field members are ignored:<DD>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
struct
|
|
{
|
|
char foo;
|
|
long : 0;
|
|
char bar;
|
|
} t5;
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Here, <TT>"t5"</TT> takes up 2 bytes.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="4050"><DD>
|
|
</DL>
|
|
|
|
<DT id="4051"><B>-mno-align-stringops</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">GCC</FONT> doesn't know about it.
|
|
<DT id="4052"><B>-minline-all-stringops</B><DD>
|
|
|
|
|
|
By default <FONT SIZE="-1">GCC</FONT> 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
|
|
size, but may improve performance of code that depends on fast
|
|
<TT>"memcpy"</TT>, <TT>"strlen"</TT>,
|
|
and <TT>"memset"</TT> for short lengths.
|
|
<DT id="4053"><B>-minline-stringops-dynamically</B><DD>
|
|
|
|
|
|
For string operations of unknown size, use run-time checks with
|
|
inline code for small blocks and a library call for large blocks.
|
|
<DT id="4054"><B>-mstringop-strategy=</B><I>alg</I><DD>
|
|
|
|
|
|
Override the internal decision heuristic for the particular algorithm to use
|
|
for inlining string operations. The allowed values for <I>alg</I> are:
|
|
<DL COMPACT><DT id="4055"><DD>
|
|
<DL COMPACT>
|
|
<DT id="4056"><B>rep_byte</B><DD>
|
|
|
|
|
|
|
|
<DT id="4057"><B>rep_4byte</B><DD>
|
|
|
|
|
|
<DT id="4058"><B>rep_8byte</B><DD>
|
|
|
|
|
|
|
|
Expand using i386 <TT>"rep"</TT> prefix of the specified size.
|
|
<DT id="4059"><B>byte_loop</B><DD>
|
|
|
|
|
|
|
|
<DT id="4060"><B>loop</B><DD>
|
|
|
|
|
|
<DT id="4061"><B>unrolled_loop</B><DD>
|
|
|
|
|
|
|
|
Expand into an inline loop.
|
|
<DT id="4062"><B>libcall</B><DD>
|
|
|
|
|
|
Always use a library call.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="4063"><DD>
|
|
</DL>
|
|
|
|
<DT id="4064"><B>-mmemcpy-strategy=</B><I>strategy</I><DD>
|
|
|
|
|
|
Override the internal decision heuristic to decide if <TT>"__builtin_memcpy"</TT>
|
|
should be inlined and what inline algorithm to use when the expected size
|
|
of the copy operation is known. <I>strategy</I>
|
|
is a comma-separated list of <I>alg</I>:<I>max_size</I>:<I>dest_align</I> triplets.
|
|
<I>alg</I> is specified in <B>-mstringop-strategy</B>, <I>max_size</I> specifies
|
|
the max byte size with which inline algorithm <I>alg</I> is allowed. For the last
|
|
triplet, the <I>max_size</I> must be <TT>"-1"</TT>. The <I>max_size</I> of the triplets
|
|
in the list must be specified in increasing order. The minimal byte size for
|
|
<I>alg</I> is <TT>0</TT> for the first triplet and <TT>"</TT>max_size<TT> + 1"</TT> of the
|
|
preceding range.
|
|
<DT id="4065"><B>-mmemset-strategy=</B><I>strategy</I><DD>
|
|
|
|
|
|
The option is similar to <B>-mmemcpy-strategy=</B> except that it is to control
|
|
<TT>"__builtin_memset"</TT> expansion.
|
|
<DT id="4066"><B>-momit-leaf-frame-pointer</B><DD>
|
|
|
|
|
|
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
|
|
<B>-fomit-leaf-frame-pointer</B> removes the frame pointer for leaf functions,
|
|
which might make debugging harder.
|
|
<DT id="4067"><B>-mtls-direct-seg-refs</B><DD>
|
|
|
|
|
|
|
|
<DT id="4068"><B>-mno-tls-direct-seg-refs</B><DD>
|
|
|
|
|
|
|
|
Controls whether <FONT SIZE="-1">TLS</FONT> variables may be accessed with offsets from the
|
|
<FONT SIZE="-1">TLS</FONT> segment register (<TT>%gs</TT> for 32-bit, <TT>%fs</TT> for 64-bit),
|
|
or whether the thread base pointer must be added. Whether or not this
|
|
is valid depends on the operating system, and whether it maps the
|
|
segment to cover the entire <FONT SIZE="-1">TLS</FONT> area.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
For systems that use the <FONT SIZE="-1">GNU C</FONT> Library, the default is on.
|
|
<DT id="4069"><B>-msse2avx</B><DD>
|
|
|
|
|
|
|
|
<DT id="4070"><B>-mno-sse2avx</B><DD>
|
|
|
|
|
|
|
|
Specify that the assembler should encode <FONT SIZE="-1">SSE</FONT> instructions with <FONT SIZE="-1">VEX</FONT>
|
|
prefix. The option <B>-mavx</B> turns this on by default.
|
|
<DT id="4071"><B>-mfentry</B><DD>
|
|
|
|
|
|
|
|
<DT id="4072"><B>-mno-fentry</B><DD>
|
|
|
|
|
|
|
|
If profiling is active (<B>-pg</B>), put the profiling
|
|
counter call before the prologue.
|
|
Note: On x86 architectures the attribute <TT>"ms_hook_prologue"</TT>
|
|
isn't possible at the moment for <B>-mfentry</B> and <B>-pg</B>.
|
|
<DT id="4073"><B>-mrecord-mcount</B><DD>
|
|
|
|
|
|
|
|
<DT id="4074"><B>-mno-record-mcount</B><DD>
|
|
|
|
|
|
|
|
If profiling is active (<B>-pg</B>), generate a __mcount_loc section
|
|
that contains pointers to each profiling call. This is useful for
|
|
automatically patching and out calls.
|
|
<DT id="4075"><B>-mnop-mcount</B><DD>
|
|
|
|
|
|
|
|
<DT id="4076"><B>-mno-nop-mcount</B><DD>
|
|
|
|
|
|
|
|
If profiling is active (<B>-pg</B>), 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 <B>-mrecord-mcount</B>.
|
|
<DT id="4077"><B>-minstrument-return=</B><I>type</I><DD>
|
|
|
|
|
|
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 <I>none</I> to not instrument, <I>call</I> to generate a call to __return__,
|
|
or <I>nop5</I> to generate a 5 byte nop.
|
|
<DT id="4078"><B>-mrecord-return</B><DD>
|
|
|
|
|
|
|
|
<DT id="4079"><B>-mno-record-return</B><DD>
|
|
|
|
|
|
|
|
Generate a __return_loc section pointing to all return instrumentation code.
|
|
<DT id="4080"><B>-mfentry-name=</B><I>name</I><DD>
|
|
|
|
|
|
Set name of __fentry__ symbol called at function entry for -pg -mfentry functions.
|
|
<DT id="4081"><B>-mfentry-section=</B><I>name</I><DD>
|
|
|
|
|
|
Set name of section to record -mrecord-mcount calls (default __mcount_loc).
|
|
<DT id="4082"><B>-mskip-rax-setup</B><DD>
|
|
|
|
|
|
|
|
<DT id="4083"><B>-mno-skip-rax-setup</B><DD>
|
|
|
|
|
|
|
|
When generating code for the x86-64 architecture with <FONT SIZE="-1">SSE</FONT> extensions
|
|
disabled, <B>-mskip-rax-setup</B> can be used to skip setting up <FONT SIZE="-1">RAX</FONT>
|
|
register when there are no variable arguments passed in vector registers.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B>Warning:</B> Since <FONT SIZE="-1">RAX</FONT> register is used to avoid unnecessarily
|
|
saving vector registers on stack when passing variable arguments, the
|
|
impacts of this option are callees may waste some stack space,
|
|
misbehave or jump to a random location. <FONT SIZE="-1">GCC 4.4</FONT> or newer don't have
|
|
those issues, regardless the <FONT SIZE="-1">RAX</FONT> register value.
|
|
<DT id="4084"><B>-m8bit-idiv</B><DD>
|
|
|
|
|
|
|
|
<DT id="4085"><B>-mno-8bit-idiv</B><DD>
|
|
|
|
|
|
|
|
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.
|
|
<DT id="4086"><B>-mavx256-split-unaligned-load</B><DD>
|
|
|
|
|
|
|
|
<DT id="4087"><B>-mavx256-split-unaligned-store</B><DD>
|
|
|
|
|
|
|
|
Split 32-byte <FONT SIZE="-1">AVX</FONT> unaligned load and store.
|
|
<DT id="4088"><B>-mstack-protector-guard=</B><I>guard</I><DD>
|
|
|
|
|
|
|
|
<DT id="4089"><B>-mstack-protector-guard-reg=</B><I>reg</I><DD>
|
|
|
|
|
|
<DT id="4090"><B>-mstack-protector-guard-offset=</B><I>offset</I><DD>
|
|
|
|
|
|
|
|
Generate stack protection code using canary at <I>guard</I>. Supported
|
|
locations are <B>global</B> for global canary or <B>tls</B> for per-thread
|
|
canary in the <FONT SIZE="-1">TLS</FONT> block (the default). This option has effect only when
|
|
<B>-fstack-protector</B> or <B>-fstack-protector-all</B> is specified.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
With the latter choice the options
|
|
<B>-mstack-protector-guard-reg=</B><I>reg</I> and
|
|
<B>-mstack-protector-guard-offset=</B><I>offset</I> furthermore specify
|
|
which segment register (<TT>%fs</TT> or <TT>%gs</TT>) to use as base register
|
|
for reading the canary, and from what offset from that base register.
|
|
The default for those is as specified in the relevant <FONT SIZE="-1">ABI.</FONT>
|
|
<DT id="4091"><B>-mgeneral-regs-only</B><DD>
|
|
|
|
|
|
Generate code that uses only the general-purpose registers. This
|
|
prevents the compiler from using floating-point, vector, mask and bound
|
|
registers.
|
|
<DT id="4092"><B>-mindirect-branch=</B><I>choice</I><DD>
|
|
|
|
|
|
Convert indirect call and jump with <I>choice</I>. The default is
|
|
<B>keep</B>, which keeps indirect call and jump unmodified.
|
|
<B>thunk</B> converts indirect call and jump to call and return thunk.
|
|
<B>thunk-inline</B> converts indirect call and jump to inlined call
|
|
and return thunk. <B>thunk-extern</B> converts indirect call and jump
|
|
to external call and return thunk provided in a separate object file.
|
|
You can control this behavior for a specific function by using the
|
|
function attribute <TT>"indirect_branch"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that <B>-mcmodel=large</B> is incompatible with
|
|
<B>-mindirect-branch=thunk</B> and
|
|
<B>-mindirect-branch=thunk-extern</B> since the thunk function may
|
|
not be reachable in the large code model.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that <B>-mindirect-branch=thunk-extern</B> is compatible with
|
|
<B>-fcf-protection=branch</B> since the external thunk can be made
|
|
to enable control-flow check.
|
|
<DT id="4093"><B>-mfunction-return=</B><I>choice</I><DD>
|
|
|
|
|
|
Convert function return with <I>choice</I>. The default is <B>keep</B>,
|
|
which keeps function return unmodified. <B>thunk</B> converts function
|
|
return to call and return thunk. <B>thunk-inline</B> converts function
|
|
return to inlined call and return thunk. <B>thunk-extern</B> converts
|
|
function return to external call and return thunk provided in a separate
|
|
object file. You can control this behavior for a specific function by
|
|
using the function attribute <TT>"function_return"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that <B>-mindirect-return=thunk-extern</B> is compatible with
|
|
<B>-fcf-protection=branch</B> since the external thunk can be made
|
|
to enable control-flow check.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that <B>-mcmodel=large</B> is incompatible with
|
|
<B>-mfunction-return=thunk</B> and
|
|
<B>-mfunction-return=thunk-extern</B> since the thunk function may
|
|
not be reachable in the large code model.
|
|
<DT id="4094"><B>-mindirect-branch-register</B><DD>
|
|
|
|
|
|
Force indirect call and jump via register.
|
|
</DL>
|
|
<P>
|
|
|
|
These <B>-m</B> switches are supported in addition to the above
|
|
on x86-64 processors in 64-bit environments.
|
|
<DL COMPACT>
|
|
<DT id="4095"><B>-m32</B><DD>
|
|
|
|
|
|
|
|
<DT id="4096"><B>-m64</B><DD>
|
|
|
|
|
|
<DT id="4097"><B>-mx32</B><DD>
|
|
|
|
|
|
<DT id="4098"><B>-m16</B><DD>
|
|
|
|
|
|
<DT id="4099"><B>-miamcu</B><DD>
|
|
|
|
|
|
|
|
Generate code for a 16-bit, 32-bit or 64-bit environment.
|
|
The <B>-m32</B> option sets <TT>"int"</TT>, <TT>"long"</TT>, and pointer types
|
|
to 32 bits, and
|
|
generates code that runs on any i386 system.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-m64</B> option sets <TT>"int"</TT> to 32 bits and <TT>"long"</TT> and pointer
|
|
types to 64 bits, and generates code for the x86-64 architecture.
|
|
For Darwin only the <B>-m64</B> option also turns off the <B>-fno-pic</B>
|
|
and <B>-mdynamic-no-pic</B> options.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-mx32</B> option sets <TT>"int"</TT>, <TT>"long"</TT>, and pointer types
|
|
to 32 bits, and
|
|
generates code for the x86-64 architecture.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-m16</B> option is the same as <B>-m32</B>, except for that
|
|
it outputs the <TT>".code16gcc"</TT> assembly directive at the beginning of
|
|
the assembly output so that the binary can run in 16-bit mode.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-miamcu</B> option generates code which conforms to Intel <FONT SIZE="-1">MCU</FONT>
|
|
psABI. It requires the <B>-m32</B> option to be turned on.
|
|
<DT id="4100"><B>-mno-red-zone</B><DD>
|
|
|
|
|
|
Do not use a so-called ``red zone'' for x86-64 code. The red zone is mandated
|
|
by the x86-64 <FONT SIZE="-1">ABI</FONT>; 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 <B>-mno-red-zone</B> disables this red zone.
|
|
<DT id="4101"><B>-mcmodel=small</B><DD>
|
|
|
|
|
|
Generate code for the small code model: the program and its symbols must
|
|
be linked in the lower 2 <FONT SIZE="-1">GB</FONT> of the address space. Pointers are 64 bits.
|
|
Programs can be statically or dynamically linked. This is the default
|
|
code model.
|
|
<DT id="4102"><B>-mcmodel=kernel</B><DD>
|
|
|
|
|
|
Generate code for the kernel code model. The kernel runs in the
|
|
negative 2 <FONT SIZE="-1">GB</FONT> of the address space.
|
|
This model has to be used for Linux kernel code.
|
|
<DT id="4103"><B>-mcmodel=medium</B><DD>
|
|
|
|
|
|
Generate code for the medium model: the program is linked in the lower 2
|
|
<FONT SIZE="-1">GB</FONT> of the address space. Small symbols are also placed there. Symbols
|
|
with sizes larger than <B>-mlarge-data-threshold</B> are put into
|
|
large data or <FONT SIZE="-1">BSS</FONT> sections and can be located above 2GB. Programs can
|
|
be statically or dynamically linked.
|
|
<DT id="4104"><B>-mcmodel=large</B><DD>
|
|
|
|
|
|
Generate code for the large model. This model makes no assumptions
|
|
about addresses and sizes of sections.
|
|
<DT id="4105"><B>-maddress-mode=long</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="4106"><B>-maddress-mode=short</B><DD>
|
|
|
|
|
|
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.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>x86 Windows Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These additional options are available for Microsoft Windows targets:
|
|
<DL COMPACT>
|
|
<DT id="4107"><B>-mconsole</B><DD>
|
|
|
|
|
|
This option
|
|
specifies that a console application is to be generated, by
|
|
instructing the linker to set the <FONT SIZE="-1">PE</FONT> header subsystem type
|
|
required for console applications.
|
|
This option is available for Cygwin and MinGW targets and is
|
|
enabled by default on those targets.
|
|
<DT id="4108"><B>-mdll</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="4109"><B>-mnop-fun-dllimport</B><DD>
|
|
|
|
|
|
This option is available for Cygwin and MinGW targets. It
|
|
specifies that the <TT>"dllimport"</TT> attribute should be ignored.
|
|
<DT id="4110"><B>-mthread</B><DD>
|
|
|
|
|
|
This option is available for MinGW targets. It specifies
|
|
that MinGW-specific thread support is to be used.
|
|
<DT id="4111"><B>-municode</B><DD>
|
|
|
|
|
|
This option is available for MinGW-w64 targets. It causes
|
|
the <TT>"UNICODE"</TT> preprocessor macro to be predefined, and
|
|
chooses Unicode-capable runtime startup code.
|
|
<DT id="4112"><B>-mwin32</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="4113"><B>-mwindows</B><DD>
|
|
|
|
|
|
This option is available for Cygwin and MinGW targets. It
|
|
specifies that a <FONT SIZE="-1">GUI</FONT> application is to be generated by
|
|
instructing the linker to set the <FONT SIZE="-1">PE</FONT> header subsystem type
|
|
appropriately.
|
|
<DT id="4114"><B>-fno-set-stack-executable</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">API,</FONT> which is used to set executable
|
|
privileges, isn't available.
|
|
<DT id="4115"><B>-fwritable-relocated-rdata</B><DD>
|
|
|
|
|
|
This option is available for MinGW and Cygwin targets. It specifies
|
|
that relocated-data in read-only section is put into the <TT>".data"</TT>
|
|
section. This is a necessary for older runtimes not supporting
|
|
modification of <TT>".rdata"</TT> sections for pseudo-relocation.
|
|
<DT id="4116"><B>-mpe-aligned-commons</B><DD>
|
|
|
|
|
|
This option is available for Cygwin and MinGW targets. It
|
|
specifies that the <FONT SIZE="-1">GNU</FONT> extension to the <FONT SIZE="-1">PE</FONT> file format that
|
|
permits the correct alignment of <FONT SIZE="-1">COMMON</FONT> variables should be
|
|
used when generating code. It is enabled by default if
|
|
<FONT SIZE="-1">GCC</FONT> detects that the target assembler found during configuration
|
|
supports the feature.
|
|
</DL>
|
|
<P>
|
|
|
|
See also under <B>x86 Options</B> for standard options.
|
|
<P>
|
|
|
|
<I>Xstormy16 Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are defined for Xstormy16:
|
|
<DL COMPACT>
|
|
<DT id="4117"><B>-msim</B><DD>
|
|
|
|
|
|
Choose startup files and linker script suitable for the simulator.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>Xtensa Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These options are supported for Xtensa targets:
|
|
<DL COMPACT>
|
|
<DT id="4118"><B>-mconst16</B><DD>
|
|
|
|
|
|
|
|
<DT id="4119"><B>-mno-const16</B><DD>
|
|
|
|
|
|
|
|
Enable or disable use of <TT>"CONST16"</TT> instructions for loading
|
|
constant values. The <TT>"CONST16"</TT> instruction is currently not a
|
|
standard option from Tensilica. When enabled, <TT>"CONST16"</TT>
|
|
instructions are always used in place of the standard <TT>"L32R"</TT>
|
|
instructions. The use of <TT>"CONST16"</TT> is enabled by default only if
|
|
the <TT>"L32R"</TT> instruction is not available.
|
|
<DT id="4120"><B>-mfused-madd</B><DD>
|
|
|
|
|
|
|
|
<DT id="4121"><B>-mno-fused-madd</B><DD>
|
|
|
|
|
|
|
|
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
|
|
and multiply/subtract instructions forces the compiler to use separate
|
|
instructions for the multiply and add/subtract operations. This may be
|
|
desirable in some cases where strict <FONT SIZE="-1">IEEE</FONT> 754-compliant results are
|
|
required: the fused multiply add/subtract instructions do not round the
|
|
intermediate result, thereby producing results with <I>more</I> bits of
|
|
precision than specified by the <FONT SIZE="-1">IEEE</FONT> standard. Disabling fused multiply
|
|
add/subtract instructions also ensures that the program output is not
|
|
sensitive to the compiler's ability to combine multiply and add/subtract
|
|
operations.
|
|
<DT id="4122"><B>-mserialize-volatile</B><DD>
|
|
|
|
|
|
|
|
<DT id="4123"><B>-mno-serialize-volatile</B><DD>
|
|
|
|
|
|
|
|
When this option is enabled, <FONT SIZE="-1">GCC</FONT> inserts <TT>"MEMW"</TT> instructions before
|
|
<TT>"volatile"</TT> memory references to guarantee sequential consistency.
|
|
The default is <B>-mserialize-volatile</B>. Use
|
|
<B>-mno-serialize-volatile</B> to omit the <TT>"MEMW"</TT> instructions.
|
|
<DT id="4124"><B>-mforce-no-pic</B><DD>
|
|
|
|
|
|
For targets, like GNU/Linux, where all user-mode Xtensa code must be
|
|
position-independent code (<FONT SIZE="-1">PIC</FONT>), this option disables <FONT SIZE="-1">PIC</FONT> for compiling
|
|
kernel code.
|
|
<DT id="4125"><B>-mtext-section-literals</B><DD>
|
|
|
|
|
|
|
|
<DT id="4126"><B>-mno-text-section-literals</B><DD>
|
|
|
|
|
|
|
|
These options control the treatment of literal pools. The default is
|
|
<B>-mno-text-section-literals</B>, which places literals in a separate
|
|
section in the output file. This allows the literal pool to be placed
|
|
in a data <FONT SIZE="-1">RAM/ROM,</FONT> and it also allows the linker to combine literal
|
|
pools from separate object files to remove redundant literals and
|
|
improve code size. With <B>-mtext-section-literals</B>, the literals
|
|
are interspersed in the text section in order to keep them as close as
|
|
possible to their references. This may be necessary for large assembly
|
|
files. Literals for each function are placed right before that function.
|
|
<DT id="4127"><B>-mauto-litpools</B><DD>
|
|
|
|
|
|
|
|
<DT id="4128"><B>-mno-auto-litpools</B><DD>
|
|
|
|
|
|
|
|
These options control the treatment of literal pools. The default is
|
|
<B>-mno-auto-litpools</B>, which places literals in a separate
|
|
section in the output file unless <B>-mtext-section-literals</B> is
|
|
used. With <B>-mauto-litpools</B> the literals are interspersed in
|
|
the text section by the assembler. Compiler does not produce explicit
|
|
<TT>".literal"</TT> directives and loads literals into registers with
|
|
<TT>"MOVI"</TT> instructions instead of <TT>"L32R"</TT> to let the assembler
|
|
do relaxation and place literals as necessary. This option allows
|
|
assembler to create several literal pools per function and assemble
|
|
very big functions, which may not be possible with
|
|
<B>-mtext-section-literals</B>.
|
|
<DT id="4129"><B>-mtarget-align</B><DD>
|
|
|
|
|
|
|
|
<DT id="4130"><B>-mno-target-align</B><DD>
|
|
|
|
|
|
|
|
When this option is enabled, <FONT SIZE="-1">GCC</FONT> instructs the assembler to
|
|
automatically align instructions to reduce branch penalties at the
|
|
expense of some code density. The assembler attempts to widen density
|
|
instructions to align branch targets and the instructions following call
|
|
instructions. If there are not enough preceding safe density
|
|
instructions to align a target, no widening is performed. The
|
|
default is <B>-mtarget-align</B>. These options do not affect the
|
|
treatment of auto-aligned instructions like <TT>"LOOP"</TT>, which the
|
|
assembler always aligns, either by widening density instructions or
|
|
by inserting <FONT SIZE="-1">NOP</FONT> instructions.
|
|
<DT id="4131"><B>-mlongcalls</B><DD>
|
|
|
|
|
|
|
|
<DT id="4132"><B>-mno-longcalls</B><DD>
|
|
|
|
|
|
|
|
When this option is enabled, <FONT SIZE="-1">GCC</FONT> 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
|
|
translation typically occurs for calls to functions in other source
|
|
files. Specifically, the assembler translates a direct <TT>"CALL"</TT>
|
|
instruction into an <TT>"L32R"</TT> followed by a <TT>"CALLX"</TT> instruction.
|
|
The default is <B>-mno-longcalls</B>. This option should be used in
|
|
programs where the call target can potentially be out of range. This
|
|
option is implemented in the assembler, not the compiler, so the
|
|
assembly code generated by <FONT SIZE="-1">GCC</FONT> still shows direct call
|
|
instructions---look at the disassembled object code to see the actual
|
|
instructions. Note that the assembler uses an indirect call for
|
|
every cross-file call, not just those that really are out of range.
|
|
</DL>
|
|
<P>
|
|
|
|
<I>zSeries Options</I>
|
|
|
|
|
|
<P>
|
|
|
|
These are listed under
|
|
<A NAME="lbAX"> </A>
|
|
<H2>ENVIRONMENT</H2>
|
|
|
|
|
|
|
|
This section describes several environment variables that affect how <FONT SIZE="-1">GCC</FONT>
|
|
operates. Some of them work by specifying directories or prefixes to use
|
|
when searching for various kinds of files. Some are used to specify other
|
|
aspects of the compilation environment.
|
|
<P>
|
|
|
|
Note that you can also specify places to search using options such as
|
|
<B>-B</B>, <B>-I</B> and <B>-L</B>. These
|
|
take precedence over places specified using environment variables, which
|
|
in turn take precedence over those specified by the configuration of <FONT SIZE="-1">GCC.</FONT>
|
|
<DL COMPACT>
|
|
<DT id="4133"><B></B><FONT SIZE="-1"><B>LANG</B></FONT><B></B><DD>
|
|
|
|
|
|
|
|
<DT id="4134"><B></B><FONT SIZE="-1"><B>LC_CTYPE</B></FONT><B></B><DD>
|
|
|
|
|
|
<DT id="4135"><B></B><FONT SIZE="-1"><B>LC_MESSAGES</B></FONT><B></B><DD>
|
|
|
|
|
|
<DT id="4136"><B></B><FONT SIZE="-1"><B>LC_ALL</B></FONT><B></B><DD>
|
|
|
|
|
|
|
|
These environment variables control the way that <FONT SIZE="-1">GCC</FONT> uses
|
|
localization information which allows <FONT SIZE="-1">GCC</FONT> to work with different
|
|
national conventions. <FONT SIZE="-1">GCC</FONT> inspects the locale categories
|
|
<B></B><FONT SIZE="-1"><B>LC_CTYPE</B></FONT><B></B> and <B></B><FONT SIZE="-1"><B>LC_MESSAGES</B></FONT><B></B> if it has been configured to do
|
|
so. These locale categories can be set to any value supported by your
|
|
installation. A typical value is <B>en_GB.UTF-8</B> for English in the United
|
|
Kingdom encoded in <FONT SIZE="-1">UTF-8.</FONT>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B></B><FONT SIZE="-1"><B>LC_CTYPE</B></FONT><B></B> environment variable specifies character
|
|
classification. <FONT SIZE="-1">GCC</FONT> uses it to determine the character boundaries in
|
|
a string; this is needed for some multibyte encodings that contain quote
|
|
and escape characters that are otherwise interpreted as a string
|
|
end or escape.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B></B><FONT SIZE="-1"><B>LC_MESSAGES</B></FONT><B></B> environment variable specifies the language to
|
|
use in diagnostic messages.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If the <B></B><FONT SIZE="-1"><B>LC_ALL</B></FONT><B></B> environment variable is set, it overrides the value
|
|
of <B></B><FONT SIZE="-1"><B>LC_CTYPE</B></FONT><B></B> and <B></B><FONT SIZE="-1"><B>LC_MESSAGES</B></FONT><B></B>; otherwise, <B></B><FONT SIZE="-1"><B>LC_CTYPE</B></FONT><B></B>
|
|
and <B></B><FONT SIZE="-1"><B>LC_MESSAGES</B></FONT><B></B> default to the value of the <B></B><FONT SIZE="-1"><B>LANG</B></FONT><B></B>
|
|
environment variable. If none of these variables are set, <FONT SIZE="-1">GCC</FONT>
|
|
defaults to traditional C English behavior.
|
|
<DT id="4137"><B></B><FONT SIZE="-1"><B>TMPDIR</B></FONT><B></B><DD>
|
|
|
|
|
|
If <B></B><FONT SIZE="-1"><B>TMPDIR</B></FONT><B></B> is set, it specifies the directory to use for temporary
|
|
files. <FONT SIZE="-1">GCC</FONT> uses temporary files to hold the output of one stage of
|
|
compilation which is to be used as input to the next stage: for example,
|
|
the output of the preprocessor, which is the input to the compiler
|
|
proper.
|
|
<DT id="4138"><B></B><FONT SIZE="-1"><B>GCC_COMPARE_DEBUG</B></FONT><B></B><DD>
|
|
|
|
|
|
Setting <B></B><FONT SIZE="-1"><B>GCC_COMPARE_DEBUG</B></FONT><B></B> is nearly equivalent to passing
|
|
<B>-fcompare-debug</B> to the compiler driver. See the documentation
|
|
of this option for more details.
|
|
<DT id="4139"><B></B><FONT SIZE="-1"><B>GCC_EXEC_PREFIX</B></FONT><B></B><DD>
|
|
|
|
|
|
If <B></B><FONT SIZE="-1"><B>GCC_EXEC_PREFIX</B></FONT><B></B> is set, it specifies a prefix to use in the
|
|
names of the subprograms executed by the compiler. No slash is added
|
|
when this prefix is combined with the name of a subprogram, but you can
|
|
specify a prefix that ends with a slash if you wish.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <B></B><FONT SIZE="-1"><B>GCC_EXEC_PREFIX</B></FONT><B></B> is not set, <FONT SIZE="-1">GCC</FONT> attempts to figure out
|
|
an appropriate prefix to use based on the pathname it is invoked with.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <FONT SIZE="-1">GCC</FONT> cannot find the subprogram using the specified prefix, it
|
|
tries looking in the usual places for the subprogram.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The default value of <B></B><FONT SIZE="-1"><B>GCC_EXEC_PREFIX</B></FONT><B></B> is
|
|
<I>prefix/lib/gcc/</I> where <I>prefix</I> is the prefix to
|
|
the installed compiler. In many cases <I>prefix</I> is the value
|
|
of <TT>"prefix"</TT> when you ran the <I>configure</I> script.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Other prefixes specified with <B>-B</B> take precedence over this prefix.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This prefix is also used for finding files such as <I>crt0.o</I> that are
|
|
used for linking.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In addition, the prefix is used in an unusual way in finding the
|
|
directories to search for header files. For each of the standard
|
|
directories whose name normally begins with <B>/usr/local/lib/gcc</B>
|
|
(more precisely, with the value of <B></B><FONT SIZE="-1"><B>GCC_INCLUDE_DIR</B></FONT><B></B>), <FONT SIZE="-1">GCC</FONT> tries
|
|
replacing that beginning with the specified prefix to produce an
|
|
alternate directory name. Thus, with <B>-Bfoo/</B>, <FONT SIZE="-1">GCC</FONT> searches
|
|
<I>foo/bar</I> just before it searches the standard directory
|
|
<I>/usr/local/lib/bar</I>.
|
|
If a standard directory begins with the configured
|
|
<I>prefix</I> then the value of <I>prefix</I> is replaced by
|
|
<B></B><FONT SIZE="-1"><B>GCC_EXEC_PREFIX</B></FONT><B></B> when looking for header files.
|
|
<DT id="4140"><B></B><FONT SIZE="-1"><B>COMPILER_PATH</B></FONT><B></B><DD>
|
|
|
|
|
|
The value of <B></B><FONT SIZE="-1"><B>COMPILER_PATH</B></FONT><B></B> is a colon-separated list of
|
|
directories, much like <B></B><FONT SIZE="-1"><B>PATH</B></FONT><B></B>. <FONT SIZE="-1">GCC</FONT> tries the directories thus
|
|
specified when searching for subprograms, if it cannot find the
|
|
subprograms using <B></B><FONT SIZE="-1"><B>GCC_EXEC_PREFIX</B></FONT><B></B>.
|
|
<DT id="4141"><B></B><FONT SIZE="-1"><B>LIBRARY_PATH</B></FONT><B></B><DD>
|
|
|
|
|
|
The value of <B></B><FONT SIZE="-1"><B>LIBRARY_PATH</B></FONT><B></B> is a colon-separated list of
|
|
directories, much like <B></B><FONT SIZE="-1"><B>PATH</B></FONT><B></B>. When configured as a native compiler,
|
|
<FONT SIZE="-1">GCC</FONT> tries the directories thus specified when searching for special
|
|
linker files, if it cannot find them using <B></B><FONT SIZE="-1"><B>GCC_EXEC_PREFIX</B></FONT><B></B>. Linking
|
|
using <FONT SIZE="-1">GCC</FONT> also uses these directories when searching for ordinary
|
|
libraries for the <B>-l</B> option (but directories specified with
|
|
<B>-L</B> come first).
|
|
<DT id="4142"><B></B><FONT SIZE="-1"><B>LANG</B></FONT><B></B><DD>
|
|
|
|
|
|
This variable is used to pass locale information to the compiler. One way in
|
|
which this information is used is to determine the character set to be used
|
|
when character literals, string literals and comments are parsed in C and C<FONT SIZE="-2">++</FONT>.
|
|
When the compiler is configured to allow multibyte characters,
|
|
the following values for <B></B><FONT SIZE="-1"><B>LANG</B></FONT><B></B> are recognized:
|
|
<DL COMPACT><DT id="4143"><DD>
|
|
<DL COMPACT>
|
|
<DT id="4144"><B>C-JIS</B><DD>
|
|
|
|
|
|
Recognize <FONT SIZE="-1">JIS</FONT> characters.
|
|
<DT id="4145"><B>C-SJIS</B><DD>
|
|
|
|
|
|
Recognize <FONT SIZE="-1">SJIS</FONT> characters.
|
|
<DT id="4146"><B>C-EUCJP</B><DD>
|
|
|
|
|
|
Recognize <FONT SIZE="-1">EUCJP</FONT> characters.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="4147"><DD>
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <B></B><FONT SIZE="-1"><B>LANG</B></FONT><B></B> is not defined, or if it has some other value, then the
|
|
compiler uses <TT>"mblen"</TT> and <TT>"mbtowc"</TT> as defined by the default locale to
|
|
recognize and translate multibyte characters.
|
|
</DL>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
Some additional environment variables affect the behavior of the
|
|
preprocessor.
|
|
<DL COMPACT>
|
|
<DT id="4148"><B></B><FONT SIZE="-1"><B>CPATH</B></FONT><B></B><DD>
|
|
|
|
|
|
|
|
<DT id="4149"><B>C_INCLUDE_PATH</B><DD>
|
|
|
|
|
|
<DT id="4150"><B></B><FONT SIZE="-1"><B>CPLUS_INCLUDE_PATH</B></FONT><B></B><DD>
|
|
|
|
|
|
<DT id="4151"><B></B><FONT SIZE="-1"><B>OBJC_INCLUDE_PATH</B></FONT><B></B><DD>
|
|
|
|
|
|
|
|
Each variable's value is a list of directories separated by a special
|
|
character, much like <B></B><FONT SIZE="-1"><B>PATH</B></FONT><B></B>, in which to look for header files.
|
|
The special character, <TT>"PATH_SEPARATOR"</TT>, is target-dependent and
|
|
determined at <FONT SIZE="-1">GCC</FONT> build time. For Microsoft Windows-based targets it is a
|
|
semicolon, and for almost all other targets it is a colon.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
<B></B><FONT SIZE="-1"><B>CPATH</B></FONT><B></B> specifies a list of directories to be searched as if
|
|
specified with <B>-I</B>, but after any paths given with <B>-I</B>
|
|
options on the command line. This environment variable is used
|
|
regardless of which language is being preprocessed.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The remaining environment variables apply only when preprocessing the
|
|
particular language indicated. Each specifies a list of directories
|
|
to be searched as if specified with <B>-isystem</B>, but after any
|
|
paths given with <B>-isystem</B> options on the command line.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In all these variables, an empty element instructs the compiler to
|
|
search its current working directory. Empty elements can appear at the
|
|
beginning or end of a path. For instance, if the value of
|
|
<B></B><FONT SIZE="-1"><B>CPATH</B></FONT><B></B> is <TT>":/special/include"</TT>, that has the same
|
|
effect as <B>-I. -I/special/include</B>.
|
|
<DT id="4152"><B></B><FONT SIZE="-1"><B>DEPENDENCIES_OUTPUT</B></FONT><B></B><DD>
|
|
|
|
|
|
If this variable is set, its value specifies how to output
|
|
dependencies for Make based on the non-system header files processed
|
|
by the compiler. System header files are ignored in the dependency
|
|
output.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The value of <B></B><FONT SIZE="-1"><B>DEPENDENCIES_OUTPUT</B></FONT><B></B> can be just a file name, in
|
|
which case the Make rules are written to that file, guessing the target
|
|
name from the source file name. Or the value can have the form
|
|
<I>file</I><B> </B><I>target</I>, in which case the rules are written to
|
|
file <I>file</I> using <I>target</I> as the target name.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
In other words, this environment variable is equivalent to combining
|
|
the options <B>-MM</B> and <B>-MF</B>,
|
|
with an optional <B>-MT</B> switch too.
|
|
<DT id="4153"><B></B><FONT SIZE="-1"><B>SUNPRO_DEPENDENCIES</B></FONT><B></B><DD>
|
|
|
|
|
|
This variable is the same as <B></B><FONT SIZE="-1"><B>DEPENDENCIES_OUTPUT</B></FONT><B></B> (see above),
|
|
except that system header files are not ignored, so it implies
|
|
<B>-M</B> rather than <B>-MM</B>. However, the dependence on the
|
|
main input file is omitted.
|
|
<DT id="4154"><B></B><FONT SIZE="-1"><B>SOURCE_DATE_EPOCH</B></FONT><B></B><DD>
|
|
|
|
|
|
If this variable is set, its value specifies a <FONT SIZE="-1">UNIX</FONT> timestamp to be
|
|
used in replacement of the current date and time in the <TT>"__DATE__"</TT>
|
|
and <TT>"__TIME__"</TT> macros, so that the embedded timestamps become
|
|
reproducible.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The value of <B></B><FONT SIZE="-1"><B>SOURCE_DATE_EPOCH</B></FONT><B></B> must be a <FONT SIZE="-1">UNIX</FONT> timestamp,
|
|
defined as the number of seconds (excluding leap seconds) since
|
|
01 Jan 1970 00:00:00 represented in <FONT SIZE="-1">ASCII</FONT>; identical to the output of
|
|
<B></B>@command<B>{date +%s</B>} on GNU/Linux and other systems that support the
|
|
<TT>%s</TT> extension in the <TT>"date"</TT> command.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The value should be a known timestamp such as the last modification
|
|
time of the source or package and it should be set by the build
|
|
process.
|
|
</DL>
|
|
<A NAME="lbAY"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
|
|
|
|
For instructions on reporting bugs, see
|
|
<<B><A HREF="file:///usr/share/doc/gcc-9/README.Bugs">file:///usr/share/doc/gcc-9/README.Bugs</A></B>>.
|
|
<A NAME="lbAZ"> </A>
|
|
<H2>FOOTNOTES</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="4155">1.<DD>
|
|
On some systems, <B>gcc -shared</B>
|
|
needs to build supplementary stub code for constructors to work. On
|
|
multi-libbed systems, <B>gcc -shared</B> must select the correct support
|
|
libraries to link against. Failing to supply the correct flags may lead
|
|
to subtle defects. Supplying them in cases where they are not necessary
|
|
is innocuous.
|
|
</DL>
|
|
<A NAME="lbBA"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+gpl">gpl</A></B>(7), <B><A HREF="/cgi-bin/man/man2html?7+gfdl">gfdl</A></B>(7), <B><A HREF="/cgi-bin/man/man2html?7+fsf-funding">fsf-funding</A></B>(7),
|
|
<B><A HREF="/cgi-bin/man/man2html?1+cpp">cpp</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+gcov">gcov</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+as">as</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+ld">ld</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+gdb">gdb</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+dbx">dbx</A></B>(1)
|
|
and the Info entries for <I>gcc</I>, <I>cpp</I>, <I>as</I>,
|
|
<I>ld</I>, <I>binutils</I> and <I>gdb</I>.
|
|
<A NAME="lbBB"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
|
|
|
|
See the Info entry for <B>gcc</B>, or
|
|
<<B><A HREF="http://gcc.gnu.org/onlinedocs/gcc/Contributors.html">http://gcc.gnu.org/onlinedocs/gcc/Contributors.html</A></B>>,
|
|
for contributors to <FONT SIZE="-1">GCC.</FONT>
|
|
<A NAME="lbBC"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright (c) 1988-2019 Free Software Foundation, Inc.
|
|
<P>
|
|
|
|
Permission is granted to copy, distribute and/or modify this document
|
|
under the terms of the <FONT SIZE="-1">GNU</FONT> Free Documentation License, Version 1.3 or
|
|
any later version published by the Free Software Foundation; with the
|
|
Invariant Sections being ``<FONT SIZE="-1">GNU</FONT> General Public License'' and ``Funding
|
|
Free Software'', the Front-Cover texts being (a) (see below), and with
|
|
the Back-Cover Texts being (b) (see below). A copy of the license is
|
|
included in the <B><A HREF="/cgi-bin/man/man2html?7+gfdl">gfdl</A></B>(7) man page.
|
|
<P>
|
|
|
|
(a) The <FONT SIZE="-1">FSF</FONT>'s Front-Cover Text is:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
A GNU Manual
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
(b) The <FONT SIZE="-1">FSF</FONT>'s Back-Cover Text is:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
You have freedom to copy and modify this GNU Manual, like GNU
|
|
software. Copies published by the Free Software Foundation raise
|
|
funds for GNU development.
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="4156"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="4157"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="4158"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="4159"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DL>
|
|
<DT id="4160"><A HREF="#lbAF">Option Summary</A><DD>
|
|
<DT id="4161"><A HREF="#lbAG">Options Controlling the Kind of Output</A><DD>
|
|
<DT id="4162"><A HREF="#lbAH">Compiling C<FONT SIZE="-2">++</FONT> Programs</A><DD>
|
|
<DT id="4163"><A HREF="#lbAI">Options Controlling C Dialect</A><DD>
|
|
<DT id="4164"><A HREF="#lbAJ">Options Controlling C<FONT SIZE="-2">++</FONT> Dialect</A><DD>
|
|
<DT id="4165"><A HREF="#lbAK">Options Controlling Objective-C and Objective-C<FONT SIZE="-2">++</FONT> Dialects</A><DD>
|
|
<DT id="4166"><A HREF="#lbAL">Options to Control Diagnostic Messages Formatting</A><DD>
|
|
<DT id="4167"><A HREF="#lbAM">Options to Request or Suppress Warnings</A><DD>
|
|
<DT id="4168"><A HREF="#lbAN">Options for Debugging Your Program</A><DD>
|
|
<DT id="4169"><A HREF="#lbAO">Options That Control Optimization</A><DD>
|
|
<DT id="4170"><A HREF="#lbAP">Program Instrumentation Options</A><DD>
|
|
<DT id="4171"><A HREF="#lbAQ">Options Controlling the Preprocessor</A><DD>
|
|
<DT id="4172"><A HREF="#lbAR">Passing Options to the Assembler</A><DD>
|
|
<DT id="4173"><A HREF="#lbAS">Options for Linking</A><DD>
|
|
<DT id="4174"><A HREF="#lbAT">Options for Directory Search</A><DD>
|
|
<DT id="4175"><A HREF="#lbAU">Options for Code Generation Conventions</A><DD>
|
|
<DT id="4176"><A HREF="#lbAV"><FONT SIZE="-1">GCC</FONT> Developer Options</A><DD>
|
|
<DT id="4177"><A HREF="#lbAW">Machine-Dependent Options</A><DD>
|
|
</DL>
|
|
<DT id="4178"><A HREF="#lbAX">ENVIRONMENT</A><DD>
|
|
<DT id="4179"><A HREF="#lbAY">BUGS</A><DD>
|
|
<DT id="4180"><A HREF="#lbAZ">FOOTNOTES</A><DD>
|
|
<DT id="4181"><A HREF="#lbBA">SEE ALSO</A><DD>
|
|
<DT id="4182"><A HREF="#lbBB">AUTHOR</A><DD>
|
|
<DT id="4183"><A HREF="#lbBC">COPYRIGHT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:29 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|