1GCC(1) GNU GCC(1)
2
3
4
6 gcc - GNU project C and C++ compiler
7
9 gcc [-c|-S|-E] [-std=standard]
10 [-g] [-pg] [-Olevel]
11 [-Wwarn...] [-Wpedantic]
12 [-Idir...] [-Ldir...]
13 [-Dmacro[=defn]...] [-Umacro]
14 [-foption...] [-mmachine-option...]
15 [-o outfile] [@file] infile...
16
17 Only the most useful options are listed here; see below for the
18 remainder. g++ accepts mostly the same options as gcc.
19
21 When you invoke GCC, it normally does preprocessing, compilation,
22 assembly and linking. The "overall options" allow you to stop this
23 process at an intermediate stage. For example, the -c option says not
24 to run the linker. Then the output consists of object files output by
25 the assembler.
26
27 Other options are passed on to one or more stages of processing. Some
28 options control the preprocessor and others the compiler itself. Yet
29 other options control the assembler and linker; most of these are not
30 documented here, since you rarely need to use any of them.
31
32 Most of the command-line options that you can use with GCC are useful
33 for C programs; when an option is only useful with another language
34 (usually C++), the explanation says so explicitly. If the description
35 for a particular option does not mention a source language, you can use
36 that option with all supported languages.
37
38 The usual way to run GCC is to run the executable called gcc, or
39 machine-gcc when cross-compiling, or machine-gcc-version to run a
40 specific version of GCC. When you compile C++ programs, you should
41 invoke GCC as g++ instead.
42
43 The gcc program accepts options and file names as operands. Many
44 options have multi-letter names; therefore multiple single-letter
45 options may not be grouped: -dv is very different from -d -v.
46
47 You can mix options and other arguments. For the most part, the order
48 you use doesn't matter. Order does matter when you use several options
49 of the same kind; for example, if you specify -L more than once, the
50 directories are searched in the order specified. Also, the placement
51 of the -l option is significant.
52
53 Many options have long names starting with -f or with -W---for example,
54 -fmove-loop-invariants, -Wformat and so on. Most of these have both
55 positive and negative forms; the negative form of -ffoo is -fno-foo.
56 This manual documents only one of these two forms, whichever one is not
57 the default.
58
60 Option Summary
61 Here is a summary of all the options, grouped by type. Explanations
62 are in the following sections.
63
64 Overall Options
65 -c -S -E -o file -x language -v -### --help[=class[,...]]
66 --target-help --version -pass-exit-codes -pipe -specs=file
67 -wrapper @file -ffile-prefix-map=old=new -fplugin=file
68 -fplugin-arg-name=arg -fdump-ada-spec[-slim]
69 -fada-spec-parent=unit -fdump-go-spec=file
70
71 C Language Options
72 -ansi -std=standard -fgnu89-inline
73 -fpermitted-flt-eval-methods=standard -aux-info filename
74 -fallow-parameterless-variadic-functions -fno-asm -fno-builtin
75 -fno-builtin-function -fgimple -fhosted -ffreestanding -fopenacc
76 -fopenmp -fopenmp-simd -fms-extensions -fplan9-extensions
77 -fsso-struct=endianness -fallow-single-precision -fcond-mismatch
78 -flax-vector-conversions -fsigned-bitfields -fsigned-char
79 -funsigned-bitfields -funsigned-char
80
81 C++ Language Options
82 -fabi-version=n -fno-access-control -faligned-new=n
83 -fargs-in-order=n -fcheck-new -fconstexpr-depth=n
84 -fconstexpr-loop-limit=n -ffriend-injection -fno-elide-constructors
85 -fno-enforce-eh-specs -ffor-scope -fno-for-scope
86 -fno-gnu-keywords -fno-implicit-templates
87 -fno-implicit-inline-templates -fno-implement-inlines
88 -fms-extensions -fnew-inheriting-ctors -fnew-ttp-matching
89 -fno-nonansi-builtins -fnothrow-opt -fno-operator-names
90 -fno-optional-diags -fpermissive -fno-pretty-templates -frepo
91 -fno-rtti -fsized-deallocation -ftemplate-backtrace-limit=n
92 -ftemplate-depth=n -fno-threadsafe-statics -fuse-cxa-atexit
93 -fno-weak -nostdinc++ -fvisibility-inlines-hidden
94 -fvisibility-ms-compat -fext-numeric-literals -Wabi=n -Wabi-tag
95 -Wconversion-null -Wctor-dtor-privacy -Wdelete-non-virtual-dtor
96 -Wliteral-suffix -Wmultiple-inheritance -Wnamespaces -Wnarrowing
97 -Wnoexcept -Wnoexcept-type -Wclass-memaccess -Wnon-virtual-dtor
98 -Wreorder -Wregister -Weffc++ -Wstrict-null-sentinel -Wtemplates
99 -Wno-non-template-friend -Wold-style-cast -Woverloaded-virtual
100 -Wno-pmf-conversions -Wsign-promo -Wvirtual-inheritance
101
102 Objective-C and Objective-C++ Language Options
103 -fconstant-string-class=class-name -fgnu-runtime -fnext-runtime
104 -fno-nil-receivers -fobjc-abi-version=n -fobjc-call-cxx-cdtors
105 -fobjc-direct-dispatch -fobjc-exceptions -fobjc-gc -fobjc-nilcheck
106 -fobjc-std=objc1 -fno-local-ivars
107 -fivar-visibility=[public|protected|private|package]
108 -freplace-objc-classes -fzero-link -gen-decls -Wassign-intercept
109 -Wno-protocol -Wselector -Wstrict-selector-match
110 -Wundeclared-selector
111
112 Diagnostic Message Formatting Options
113 -fmessage-length=n -fdiagnostics-show-location=[once|every-line]
114 -fdiagnostics-color=[auto|never|always]
115 -fno-diagnostics-show-option -fno-diagnostics-show-caret
116 -fdiagnostics-parseable-fixits -fdiagnostics-generate-patch
117 -fdiagnostics-show-template-tree -fno-elide-type -fno-show-column
118
119 Warning Options
120 -fsyntax-only -fmax-errors=n -Wpedantic -pedantic-errors -w
121 -Wextra -Wall -Waddress -Waggregate-return -Walloc-zero
122 -Walloc-size-larger-than=n -Walloca -Walloca-larger-than=n
123 -Wno-aggressive-loop-optimizations -Warray-bounds
124 -Warray-bounds=n -Wno-attributes -Wbool-compare -Wbool-operation
125 -Wno-builtin-declaration-mismatch -Wno-builtin-macro-redefined
126 -Wc90-c99-compat -Wc99-c11-compat -Wc++-compat -Wc++11-compat
127 -Wc++14-compat -Wcast-align -Wcast-align=strict
128 -Wcast-function-type -Wcast-qual -Wchar-subscripts -Wchkp
129 -Wcatch-value -Wcatch-value=n -Wclobbered -Wcomment
130 -Wconditionally-supported -Wconversion -Wcoverage-mismatch
131 -Wno-cpp -Wdangling-else -Wdate-time -Wdelete-incomplete
132 -Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init
133 -Wdisabled-optimization -Wno-discarded-qualifiers
134 -Wno-discarded-array-qualifiers -Wno-div-by-zero
135 -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond
136 -Wempty-body -Wenum-compare -Wno-endif-labels
137 -Wexpansion-to-defined -Werror -Werror=* -Wextra-semi
138 -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2
139 -Wno-format-contains-nul -Wno-format-extra-args
140 -Wformat-nonliteral -Wformat-overflow=n -Wformat-security
141 -Wformat-signedness -Wformat-truncation=n -Wformat-y2k
142 -Wframe-address -Wframe-larger-than=len -Wno-free-nonheap-object
143 -Wjump-misses-init -Wif-not-aligned -Wignored-qualifiers
144 -Wignored-attributes -Wincompatible-pointer-types -Wimplicit
145 -Wimplicit-fallthrough -Wimplicit-fallthrough=n
146 -Wimplicit-function-declaration -Wimplicit-int -Winit-self
147 -Winline -Wno-int-conversion -Wint-in-bool-context
148 -Wno-int-to-pointer-cast -Winvalid-memory-model
149 -Wno-invalid-offsetof -Winvalid-pch -Wlarger-than=len -Wlogical-op
150 -Wlogical-not-parentheses -Wlong-long -Wmain
151 -Wmaybe-uninitialized -Wmemset-elt-size -Wmemset-transposed-args
152 -Wmisleading-indentation -Wmissing-attributes -Wmissing-braces
153 -Wmissing-field-initializers -Wmissing-include-dirs -Wno-multichar
154 -Wmultistatement-macros -Wnonnull -Wnonnull-compare
155 -Wnormalized=[none|id|nfc|nfkc] -Wnull-dereference -Wodr
156 -Wno-overflow -Wopenmp-simd -Woverride-init-side-effects
157 -Woverlength-strings -Wpacked -Wpacked-bitfield-compat
158 -Wpacked-not-aligned -Wpadded -Wparentheses
159 -Wno-pedantic-ms-format -Wplacement-new -Wplacement-new=n
160 -Wpointer-arith -Wpointer-compare -Wno-pointer-to-int-cast
161 -Wno-pragmas -Wredundant-decls -Wrestrict -Wno-return-local-addr
162 -Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar
163 -Wshadow=global, -Wshadow=local, -Wshadow=compatible-local
164 -Wshift-overflow -Wshift-overflow=n -Wshift-count-negative
165 -Wshift-count-overflow -Wshift-negative-value -Wsign-compare
166 -Wsign-conversion -Wfloat-conversion -Wno-scalar-storage-order
167 -Wsizeof-pointer-div -Wsizeof-pointer-memaccess
168 -Wsizeof-array-argument -Wstack-protector -Wstack-usage=len
169 -Wstrict-aliasing -Wstrict-aliasing=n -Wstrict-overflow
170 -Wstrict-overflow=n -Wstringop-overflow=n -Wstringop-truncation
171 -Wsuggest-attribute=[pure|const|noreturn|format|malloc]
172 -Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override
173 -Wmissing-format-attribute -Wsubobject-linkage -Wswitch
174 -Wswitch-bool -Wswitch-default -Wswitch-enum -Wswitch-unreachable
175 -Wsync-nand -Wsystem-headers -Wtautological-compare -Wtrampolines
176 -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized
177 -Wunknown-pragmas -Wunsuffixed-float-constants -Wunused
178 -Wunused-function -Wunused-label -Wunused-local-typedefs
179 -Wunused-macros -Wunused-parameter -Wno-unused-result
180 -Wunused-value -Wunused-variable -Wunused-const-variable
181 -Wunused-const-variable=n -Wunused-but-set-parameter
182 -Wunused-but-set-variable -Wuseless-cast -Wvariadic-macros
183 -Wvector-operation-performance -Wvla -Wvla-larger-than=n
184 -Wvolatile-register-var -Wwrite-strings
185 -Wzero-as-null-pointer-constant -Whsa
186
187 C and Objective-C-only Warning Options
188 -Wbad-function-cast -Wmissing-declarations
189 -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs
190 -Wold-style-declaration -Wold-style-definition -Wstrict-prototypes
191 -Wtraditional -Wtraditional-conversion
192 -Wdeclaration-after-statement -Wpointer-sign
193
194 Debugging Options
195 -g -glevel -gdwarf -gdwarf-version -ggdb -grecord-gcc-switches
196 -gno-record-gcc-switches -gstabs -gstabs+ -gstrict-dwarf
197 -gno-strict-dwarf -gas-loc-support -gno-as-loc-support
198 -gas-locview-support -gno-as-locview-support -gcolumn-info
199 -gno-column-info -gstatement-frontiers -gno-statement-frontiers
200 -gvariable-location-views -gno-variable-location-views
201 -ginternal-reset-location-views -gno-internal-reset-location-views
202 -ginline-points -gno-inline-points -gvms -gxcoff -gxcoff+
203 -gz[=type] -fdebug-prefix-map=old=new -fdebug-types-section
204 -fno-eliminate-unused-debug-types -femit-struct-debug-baseonly
205 -femit-struct-debug-reduced -femit-struct-debug-detailed[=spec-
206 list] -feliminate-unused-debug-symbols -femit-class-debug-always
207 -fno-merge-debug-strings -fno-dwarf2-cfi-asm -fvar-tracking
208 -fvar-tracking-assignments
209
210 Optimization Options
211 -faggressive-loop-optimizations -falign-functions[=n]
212 -falign-jumps[=n] -falign-labels[=n] -falign-loops[=n]
213 -fassociative-math -fauto-profile -fauto-profile[=path]
214 -fauto-inc-dec -fbranch-probabilities
215 -fbranch-target-load-optimize -fbranch-target-load-optimize2
216 -fbtr-bb-exclusive -fcaller-saves -fcombine-stack-adjustments
217 -fconserve-stack -fcompare-elim -fcprop-registers -fcrossjumping
218 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules
219 -fcx-limited-range -fdata-sections -fdce -fdelayed-branch
220 -fdelete-null-pointer-checks -fdevirtualize
221 -fdevirtualize-speculatively -fdevirtualize-at-ltrans -fdse
222 -fearly-inlining -fipa-sra -fexpensive-optimizations
223 -ffat-lto-objects -ffast-math -ffinite-math-only -ffloat-store
224 -fexcess-precision=style -fforward-propagate -ffp-contract=style
225 -ffunction-sections -fgcse -fgcse-after-reload -fgcse-las
226 -fgcse-lm -fgraphite-identity -fgcse-sm -fhoist-adjacent-loads
227 -fif-conversion -fif-conversion2 -findirect-inlining
228 -finline-functions -finline-functions-called-once
229 -finline-limit=n -finline-small-functions -fipa-cp -fipa-cp-clone
230 -fipa-bit-cp -fipa-vrp -fipa-pta -fipa-profile -fipa-pure-const
231 -fipa-reference -fipa-icf -fira-algorithm=algorithm
232 -fira-region=region -fira-hoist-pressure -fira-loop-pressure
233 -fno-ira-share-save-slots -fno-ira-share-spill-slots
234 -fisolate-erroneous-paths-dereference
235 -fisolate-erroneous-paths-attribute -fivopts
236 -fkeep-inline-functions -fkeep-static-functions
237 -fkeep-static-consts -flimit-function-alignment
238 -flive-range-shrinkage -floop-block -floop-interchange
239 -floop-strip-mine -floop-unroll-and-jam -floop-nest-optimize
240 -floop-parallelize-all -flra-remat -flto -flto-compression-level
241 -flto-partition=alg -fmerge-all-constants -fmerge-constants
242 -fmodulo-sched -fmodulo-sched-allow-regmoves
243 -fmove-loop-invariants -fno-branch-count-reg -fno-defer-pop
244 -fno-fp-int-builtin-inexact -fno-function-cse
245 -fno-guess-branch-probability -fno-inline -fno-math-errno
246 -fno-peephole -fno-peephole2 -fno-printf-return-value
247 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros
248 -fno-toplevel-reorder -fno-trapping-math
249 -fno-zero-initialized-in-bss -fomit-frame-pointer
250 -foptimize-sibling-calls -fpartial-inlining -fpeel-loops
251 -fpredictive-commoning -fprefetch-loop-arrays -fprofile-correction
252 -fprofile-use -fprofile-use=path -fprofile-values
253 -fprofile-reorder-functions -freciprocal-math -free
254 -frename-registers -freorder-blocks
255 -freorder-blocks-algorithm=algorithm -freorder-blocks-and-partition
256 -freorder-functions -frerun-cse-after-loop
257 -freschedule-modulo-scheduled-loops -frounding-math
258 -fsched2-use-superblocks -fsched-pressure -fsched-spec-load
259 -fsched-spec-load-dangerous -fsched-stalled-insns-dep[=n]
260 -fsched-stalled-insns[=n] -fsched-group-heuristic
261 -fsched-critical-path-heuristic -fsched-spec-insn-heuristic
262 -fsched-rank-heuristic -fsched-last-insn-heuristic
263 -fsched-dep-count-heuristic -fschedule-fusion -fschedule-insns
264 -fschedule-insns2 -fsection-anchors -fselective-scheduling
265 -fselective-scheduling2 -fsel-sched-pipelining
266 -fsel-sched-pipelining-outer-loops -fsemantic-interposition
267 -fshrink-wrap -fshrink-wrap-separate -fsignaling-nans
268 -fsingle-precision-constant -fsplit-ivs-in-unroller -fsplit-loops
269 -fsplit-paths -fsplit-wide-types -fssa-backprop -fssa-phiopt
270 -fstdarg-opt -fstore-merging -fstrict-aliasing -fthread-jumps
271 -ftracer -ftree-bit-ccp -ftree-builtin-call-dce -ftree-ccp
272 -ftree-ch -ftree-coalesce-vars -ftree-copy-prop -ftree-dce
273 -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre
274 -fcode-hoisting -ftree-loop-if-convert -ftree-loop-im
275 -ftree-phiprop -ftree-loop-distribution
276 -ftree-loop-distribute-patterns -ftree-loop-ivcanon
277 -ftree-loop-linear -ftree-loop-optimize -ftree-loop-vectorize
278 -ftree-parallelize-loops=n -ftree-pre -ftree-partial-pre
279 -ftree-pta -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra
280 -ftree-switch-conversion -ftree-tail-merge -ftree-ter
281 -ftree-vectorize -ftree-vrp -funconstrained-commons
282 -funit-at-a-time -funroll-all-loops -funroll-loops
283 -funsafe-math-optimizations -funswitch-loops -fipa-ra
284 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb
285 -fwhole-program -fwpa -fuse-linker-plugin --param name=value -O
286 -O0 -O1 -O2 -O3 -Os -Ofast -Og
287
288 Program Instrumentation Options
289 -p -pg -fprofile-arcs --coverage -ftest-coverage
290 -fprofile-abs-path -fprofile-dir=path -fprofile-generate
291 -fprofile-generate=path -fsanitize=style -fsanitize-recover
292 -fsanitize-recover=style -fasan-shadow-offset=number
293 -fsanitize-sections=s1,s2,... -fsanitize-undefined-trap-on-error
294 -fbounds-check -fcheck-pointer-bounds -fchkp-check-incomplete-type
295 -fchkp-first-field-has-own-bounds -fchkp-narrow-bounds
296 -fchkp-narrow-to-innermost-array -fchkp-optimize
297 -fchkp-use-fast-string-functions -fchkp-use-nochk-string-functions
298 -fchkp-use-static-bounds -fchkp-use-static-const-bounds
299 -fchkp-treat-zero-dynamic-size-as-infinite -fchkp-check-read
300 -fchkp-check-read -fchkp-check-write -fchkp-store-bounds
301 -fchkp-instrument-calls -fchkp-instrument-marked-only
302 -fchkp-use-wrappers -fchkp-flexible-struct-trailing-arrays
303 -fcf-protection=[full|branch|return|none] -fstack-protector
304 -fstack-protector-all -fstack-protector-strong
305 -fstack-protector-explicit -fstack-check
306 -fstack-limit-register=reg -fstack-limit-symbol=sym
307 -fno-stack-limit -fsplit-stack -fvtable-verify=[std|preinit|none]
308 -fvtv-counts -fvtv-debug -finstrument-functions
309 -finstrument-functions-exclude-function-list=sym,sym,...
310 -finstrument-functions-exclude-file-list=file,file,...
311
312 Preprocessor Options
313 -Aquestion=answer -A-question[=answer] -C -CC -Dmacro[=defn] -dD
314 -dI -dM -dN -dU -fdebug-cpp -fdirectives-only
315 -fdollars-in-identifiers -fexec-charset=charset
316 -fextended-identifiers -finput-charset=charset
317 -fmacro-prefix-map=old=new -fno-canonical-system-headers
318 -fpch-deps -fpch-preprocess -fpreprocessed -ftabstop=width
319 -ftrack-macro-expansion -fwide-exec-charset=charset
320 -fworking-directory -H -imacros file -include file -M -MD -MF
321 -MG -MM -MMD -MP -MQ -MT -no-integrated-cpp -P -pthread
322 -remap -traditional -traditional-cpp -trigraphs -Umacro -undef
323 -Wp,option -Xpreprocessor option
324
325 Assembler Options
326 -Wa,option -Xassembler option
327
328 Linker Options
329 object-file-name -fuse-ld=linker -llibrary -nostartfiles
330 -nodefaultlibs -nostdlib -pie -pthread -rdynamic -s -static
331 -static-pie -static-libgcc -static-libstdc++ -static-libasan
332 -static-libtsan -static-liblsan -static-libubsan -static-libmpx
333 -static-libmpxwrappers -shared -shared-libgcc -symbolic -T script
334 -Wl,option -Xlinker option -u symbol -z keyword
335
336 Directory Options
337 -Bprefix -Idir -I- -idirafter dir -imacros file -imultilib dir
338 -iplugindir=dir -iprefix file -iquote dir -isysroot dir -isystem
339 dir -iwithprefix dir -iwithprefixbefore dir -Ldir
340 -no-canonical-prefixes --no-sysroot-suffix -nostdinc -nostdinc++
341 --sysroot=dir
342
343 Code Generation Options
344 -fcall-saved-reg -fcall-used-reg -ffixed-reg -fexceptions
345 -fnon-call-exceptions -fdelete-dead-exceptions -funwind-tables
346 -fasynchronous-unwind-tables -fno-gnu-unique
347 -finhibit-size-directive -fno-common -fno-ident
348 -fpcc-struct-return -fpic -fPIC -fpie -fPIE -fno-plt
349 -fno-jump-tables -frecord-gcc-switches -freg-struct-return
350 -fshort-enums -fshort-wchar -fverbose-asm -fpack-struct[=n]
351 -fleading-underscore -ftls-model=model -fstack-reuse=reuse_level
352 -ftrampolines -ftrapv -fwrapv
353 -fvisibility=[default|internal|hidden|protected]
354 -fstrict-volatile-bitfields -fsync-libcalls
355
356 Developer Options
357 -dletters -dumpspecs -dumpmachine -dumpversion -dumpfullversion
358 -fchecking -fchecking=n -fdbg-cnt-list -fdbg-cnt=counter-value-
359 list -fdisable-ipa-pass_name -fdisable-rtl-pass_name
360 -fdisable-rtl-pass-name=range-list -fdisable-tree-pass_name
361 -fdisable-tree-pass-name=range-list -fdump-noaddr
362 -fdump-unnumbered -fdump-unnumbered-links
363 -fdump-class-hierarchy[-n] -fdump-final-insns[=file] -fdump-ipa-all
364 -fdump-ipa-cgraph -fdump-ipa-inline -fdump-lang-all
365 -fdump-lang-switch -fdump-lang-switch-options
366 -fdump-lang-switch-options=filename -fdump-passes -fdump-rtl-pass
367 -fdump-rtl-pass=filename -fdump-statistics -fdump-tree-all
368 -fdump-tree-switch -fdump-tree-switch-options
369 -fdump-tree-switch-options=filename -fcompare-debug[=opts]
370 -fcompare-debug-second -fenable-kind-pass -fenable-kind-pass=range-
371 list -fira-verbose=n -flto-report -flto-report-wpa
372 -fmem-report-wpa -fmem-report -fpre-ipa-mem-report
373 -fpost-ipa-mem-report -fopt-info -fopt-info-options[=file]
374 -fprofile-report -frandom-seed=string -fsched-verbose=n
375 -fsel-sched-verbose -fsel-sched-dump-cfg
376 -fsel-sched-pipelining-verbose -fstats -fstack-usage
377 -ftime-report -ftime-report-details
378 -fvar-tracking-assignments-toggle -gtoggle
379 -print-file-name=library -print-libgcc-file-name
380 -print-multi-directory -print-multi-lib -print-multi-os-directory
381 -print-prog-name=program -print-search-dirs -Q -print-sysroot
382 -print-sysroot-headers-suffix -save-temps -save-temps=cwd
383 -save-temps=obj -time[=file]
384
385 Machine-Dependent Options
386 AArch64 Options -mabi=name -mbig-endian -mlittle-endian
387 -mgeneral-regs-only -mcmodel=tiny -mcmodel=small -mcmodel=large
388 -mstrict-align -momit-leaf-frame-pointer -mtls-dialect=desc
389 -mtls-dialect=traditional -mtls-size=size -mfix-cortex-a53-835769
390 -mfix-cortex-a53-843419 -mlow-precision-recip-sqrt
391 -mlow-precision-sqrt -mlow-precision-div
392 -mpc-relative-literal-loads -msign-return-address=scope -march=name
393 -mcpu=name -mtune=name -moverride=string -mverbose-cost-dump
394
395 Adapteva Epiphany Options -mhalf-reg-file -mprefer-short-insn-regs
396 -mbranch-cost=num -mcmove -mnops=num -msoft-cmpsf -msplit-lohi
397 -mpost-inc -mpost-modify -mstack-offset=num -mround-nearest
398 -mlong-calls -mshort-calls -msmall16 -mfp-mode=mode
399 -mvect-double -max-vect-align=num -msplit-vecmove-early
400 -m1reg-reg
401
402 ARC Options -mbarrel-shifter -mjli-always -mcpu=cpu -mA6 -mARC600
403 -mA7 -mARC700 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr
404 -mea -mno-mpy -mmul32x16 -mmul64 -matomic -mnorm -mspfp
405 -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap -mcrc
406 -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape
407 -mtelephony -mxy -misize -mannotate-align -marclinux
408 -marclinux_prof -mlong-calls -mmedium-calls -msdata
409 -mirq-ctrl-saved -mrgf-banked-regs -mlpc-width=width -G num
410 -mvolatile-cache -mtp-regno=regno -malign-call -mauto-modify-reg
411 -mbbit-peephole -mno-brcc -mcase-vector-pcrel -mcompact-casesi
412 -mno-cond-exec -mearly-cbranchsi -mexpand-adddi -mindexed-loads
413 -mlra -mlra-priority-none -mlra-priority-compact mlra-priority-
414 noncompact -mno-millicode -mmixed-code -mq-class -mRcq -mRcw
415 -msize-level=level -mtune=cpu -mmultcost=num
416 -munalign-prob-threshold=probability -mmpy-option=multo -mdiv-rem
417 -mcode-density -mll64 -mfpu=fpu -mrf16
418
419 ARM Options -mapcs-frame -mno-apcs-frame -mabi=name
420 -mapcs-stack-check -mno-apcs-stack-check -mapcs-reentrant
421 -mno-apcs-reentrant -msched-prolog -mno-sched-prolog
422 -mlittle-endian -mbig-endian -mbe8 -mbe32 -mfloat-abi=name
423 -mfp16-format=name -mthumb-interwork -mno-thumb-interwork
424 -mcpu=name -march=name -mfpu=name -mtune=name -mprint-tune-info
425 -mstructure-size-boundary=n -mabort-on-noreturn -mlong-calls
426 -mno-long-calls -msingle-pic-base -mno-single-pic-base
427 -mpic-register=reg -mnop-fun-dllimport -mpoke-function-name -mthumb
428 -marm -mflip-thumb -mtpcs-frame -mtpcs-leaf-frame
429 -mcaller-super-interworking -mcallee-super-interworking -mtp=name
430 -mtls-dialect=dialect -mword-relocations -mfix-cortex-m3-ldrd
431 -munaligned-access -mneon-for-64bits -mslow-flash-data
432 -masm-syntax-unified -mrestrict-it -mverbose-cost-dump -mpure-code
433 -mcmse
434
435 AVR Options -mmcu=mcu -mabsdata -maccumulate-args
436 -mbranch-cost=cost -mcall-prologues -mgas-isr-prologues -mint8
437 -mn_flash=size -mno-interrupts -mmain-is-OS_task -mrelax -mrmw
438 -mstrict-X -mtiny-stack -mfract-convert-truncate -mshort-calls
439 -nodevicelib -Waddr-space-convert -Wmisspelled-isr
440
441 Blackfin Options -mcpu=cpu[-sirevision] -msim
442 -momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer
443 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly
444 -mno-csync-anomaly -mlow-64k -mno-low64k -mstack-check-l1
445 -mid-shared-library -mno-id-shared-library -mshared-library-id=n
446 -mleaf-id-shared-library -mno-leaf-id-shared-library -msep-data
447 -mno-sep-data -mlong-calls -mno-long-calls -mfast-fp
448 -minline-plt -mmulticore -mcorea -mcoreb -msdram -micplb
449
450 C6X Options -mbig-endian -mlittle-endian -march=cpu -msim
451 -msdata=sdata-type
452
453 CRIS Options -mcpu=cpu -march=cpu -mtune=cpu -mmax-stack-frame=n
454 -melinux-stacksize=n -metrax4 -metrax100 -mpdebug -mcc-init
455 -mno-side-effects -mstack-align -mdata-align -mconst-align
456 -m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt
457 -melf -maout -melinux -mlinux -sim -sim2 -mmul-bug-workaround
458 -mno-mul-bug-workaround
459
460 CR16 Options -mmac -mcr16cplus -mcr16c -msim -mint32 -mbit-ops
461 -mdata-model=model
462
463 Darwin Options -all_load -allowable_client -arch
464 -arch_errors_fatal -arch_only -bind_at_load -bundle
465 -bundle_loader -client_name -compatibility_version
466 -current_version -dead_strip -dependency-file -dylib_file
467 -dylinker_install_name -dynamic -dynamiclib
468 -exported_symbols_list -filelist -flat_namespace
469 -force_cpusubtype_ALL -force_flat_namespace
470 -headerpad_max_install_names -iframework -image_base -init
471 -install_name -keep_private_externs -multi_module
472 -multiply_defined -multiply_defined_unused -noall_load
473 -no_dead_strip_inits_and_terms -nofixprebinding -nomultidefs
474 -noprebind -noseglinkedit -pagezero_size -prebind
475 -prebind_all_twolevel_modules -private_bundle -read_only_relocs
476 -sectalign -sectobjectsymbols -whyload -seg1addr -sectcreate
477 -sectobjectsymbols -sectorder -segaddr -segs_read_only_addr
478 -segs_read_write_addr -seg_addr_table -seg_addr_table_filename
479 -seglinkedit -segprot -segs_read_only_addr -segs_read_write_addr
480 -single_module -static -sub_library -sub_umbrella
481 -twolevel_namespace -umbrella -undefined -unexported_symbols_list
482 -weak_reference_mismatches -whatsloaded -F -gused -gfull
483 -mmacosx-version-min=version -mkernel -mone-byte-bool
484
485 DEC Alpha Options -mno-fp-regs -msoft-float -mieee
486 -mieee-with-inexact -mieee-conformant -mfp-trap-mode=mode
487 -mfp-rounding-mode=mode -mtrap-precision=mode -mbuild-constants
488 -mcpu=cpu-type -mtune=cpu-type -mbwx -mmax -mfix -mcix
489 -mfloat-vax -mfloat-ieee -mexplicit-relocs -msmall-data
490 -mlarge-data -msmall-text -mlarge-text -mmemory-latency=time
491
492 FR30 Options -msmall-model -mno-lsim
493
494 FT32 Options -msim -mlra -mnodiv -mft32b -mcompress -mnopm
495
496 FRV Options -mgpr-32 -mgpr-64 -mfpr-32 -mfpr-64 -mhard-float
497 -msoft-float -malloc-cc -mfixed-cc -mdword -mno-dword -mdouble
498 -mno-double -mmedia -mno-media -mmuladd -mno-muladd -mfdpic
499 -minline-plt -mgprel-ro -multilib-library-pic -mlinked-fp
500 -mlong-calls -malign-labels -mlibrary-pic -macc-4 -macc-8 -mpack
501 -mno-pack -mno-eflags -mcond-move -mno-cond-move
502 -moptimize-membar -mno-optimize-membar -mscc -mno-scc
503 -mcond-exec -mno-cond-exec -mvliw-branch -mno-vliw-branch
504 -mmulti-cond-exec -mno-multi-cond-exec -mnested-cond-exec
505 -mno-nested-cond-exec -mtomcat-stats -mTLS -mtls -mcpu=cpu
506
507 GNU/Linux Options -mglibc -muclibc -mmusl -mbionic -mandroid
508 -tno-android-cc -tno-android-ld
509
510 H8/300 Options -mrelax -mh -ms -mn -mexr -mno-exr -mint32
511 -malign-300
512
513 HPPA Options -march=architecture-type -mcaller-copies
514 -mdisable-fpregs -mdisable-indexing -mfast-indirect-calls -mgas
515 -mgnu-ld -mhp-ld -mfixed-range=register-range -mjump-in-delay
516 -mlinker-opt -mlong-calls -mlong-load-store -mno-disable-fpregs
517 -mno-disable-indexing -mno-fast-indirect-calls -mno-gas
518 -mno-jump-in-delay -mno-long-load-store -mno-portable-runtime
519 -mno-soft-float -mno-space-regs -msoft-float -mpa-risc-1-0
520 -mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime -mschedule=cpu-
521 type -mspace-regs -msio -mwsio -munix=unix-std -nolibdld
522 -static -threads
523
524 IA-64 Options -mbig-endian -mlittle-endian -mgnu-as -mgnu-ld
525 -mno-pic -mvolatile-asm-stop -mregister-names -msdata -mno-sdata
526 -mconstant-gp -mauto-pic -mfused-madd
527 -minline-float-divide-min-latency
528 -minline-float-divide-max-throughput -mno-inline-float-divide
529 -minline-int-divide-min-latency -minline-int-divide-max-throughput
530 -mno-inline-int-divide -minline-sqrt-min-latency
531 -minline-sqrt-max-throughput -mno-inline-sqrt -mdwarf2-asm
532 -mearly-stop-bits -mfixed-range=register-range -mtls-size=tls-size
533 -mtune=cpu-type -milp32 -mlp64 -msched-br-data-spec
534 -msched-ar-data-spec -msched-control-spec -msched-br-in-data-spec
535 -msched-ar-in-data-spec -msched-in-control-spec -msched-spec-ldc
536 -msched-spec-control-ldc -msched-prefer-non-data-spec-insns
537 -msched-prefer-non-control-spec-insns
538 -msched-stop-bits-after-every-cycle
539 -msched-count-spec-in-critical-path
540 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost
541 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=max-
542 insns
543
544 LM32 Options -mbarrel-shift-enabled -mdivide-enabled
545 -mmultiply-enabled -msign-extend-enabled -muser-enabled
546
547 M32R/D Options -m32r2 -m32rx -m32r -mdebug -malign-loops
548 -mno-align-loops -missue-rate=number -mbranch-cost=number
549 -mmodel=code-size-model-type -msdata=sdata-type -mno-flush-func
550 -mflush-func=name -mno-flush-trap -mflush-trap=number -G num
551
552 M32C Options -mcpu=cpu -msim -memregs=number
553
554 M680x0 Options -march=arch -mcpu=cpu -mtune=tune -m68000 -m68020
555 -m68020-40 -m68020-60 -m68030 -m68040 -m68060 -mcpu32 -m5200
556 -m5206e -m528x -m5307 -m5407 -mcfv4e -mbitfield -mno-bitfield
557 -mc68000 -mc68020 -mnobitfield -mrtd -mno-rtd -mdiv -mno-div
558 -mshort -mno-short -mhard-float -m68881 -msoft-float -mpcrel
559 -malign-int -mstrict-align -msep-data -mno-sep-data
560 -mshared-library-id=n -mid-shared-library -mno-id-shared-library
561 -mxgot -mno-xgot -mlong-jump-table-offsets
562
563 MCore Options -mhardlit -mno-hardlit -mdiv -mno-div
564 -mrelax-immediates -mno-relax-immediates -mwide-bitfields
565 -mno-wide-bitfields -m4byte-functions -mno-4byte-functions
566 -mcallgraph-data -mno-callgraph-data -mslow-bytes -mno-slow-bytes
567 -mno-lsim -mlittle-endian -mbig-endian -m210 -m340
568 -mstack-increment
569
570 MeP Options -mabsdiff -mall-opts -maverage -mbased=n -mbitops
571 -mc=n -mclip -mconfig=name -mcop -mcop32 -mcop64 -mivc2 -mdc
572 -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax
573 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim
574 -msimnovec -mtf -mtiny=n
575
576 MicroBlaze Options -msoft-float -mhard-float -msmall-divides
577 -mcpu=cpu -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift
578 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss
579 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt
580 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-app-model
581
582 MIPS Options -EL -EB -march=arch -mtune=arch -mips1 -mips2
583 -mips3 -mips4 -mips32 -mips32r2 -mips32r3 -mips32r5 -mips32r6
584 -mips64 -mips64r2 -mips64r3 -mips64r5 -mips64r6 -mips16
585 -mno-mips16 -mflip-mips16 -minterlink-compressed
586 -mno-interlink-compressed -minterlink-mips16 -mno-interlink-mips16
587 -mabi=abi -mabicalls -mno-abicalls -mshared -mno-shared -mplt
588 -mno-plt -mxgot -mno-xgot -mgp32 -mgp64 -mfp32 -mfpxx -mfp64
589 -mhard-float -msoft-float -mno-float -msingle-float
590 -mdouble-float -modd-spreg -mno-odd-spreg -mabs=mode
591 -mnan=encoding -mdsp -mno-dsp -mdspr2 -mno-dspr2 -mmcu
592 -mmno-mcu -meva -mno-eva -mvirt -mno-virt -mxpa -mno-xpa
593 -mmicromips -mno-micromips -mmsa -mno-msa -mfpu=fpu-type
594 -msmartmips -mno-smartmips -mpaired-single -mno-paired-single
595 -mdmx -mno-mdmx -mips3d -mno-mips3d -mmt -mno-mt -mllsc
596 -mno-llsc -mlong64 -mlong32 -msym32 -mno-sym32 -Gnum
597 -mlocal-sdata -mno-local-sdata -mextern-sdata -mno-extern-sdata
598 -mgpopt -mno-gopt -membedded-data -mno-embedded-data
599 -muninit-const-in-rodata -mno-uninit-const-in-rodata
600 -mcode-readable=setting -msplit-addresses -mno-split-addresses
601 -mexplicit-relocs -mno-explicit-relocs -mcheck-zero-division
602 -mno-check-zero-division -mdivide-traps -mdivide-breaks
603 -mload-store-pairs -mno-load-store-pairs -mmemcpy -mno-memcpy
604 -mlong-calls -mno-long-calls -mmad -mno-mad -mimadd -mno-imadd
605 -mfused-madd -mno-fused-madd -nocpp -mfix-24k -mno-fix-24k
606 -mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400
607 -mfix-r10000 -mno-fix-r10000 -mfix-rm7000 -mno-fix-rm7000
608 -mfix-vr4120 -mno-fix-vr4120 -mfix-vr4130 -mno-fix-vr4130
609 -mfix-sb1 -mno-fix-sb1 -mflush-func=func -mno-flush-func
610 -mbranch-cost=num -mbranch-likely -mno-branch-likely
611 -mcompact-branches=policy -mfp-exceptions -mno-fp-exceptions
612 -mvr4130-align -mno-vr4130-align -msynci -mno-synci -mlxc1-sxc1
613 -mno-lxc1-sxc1 -mmadd4 -mno-madd4 -mrelax-pic-calls
614 -mno-relax-pic-calls -mmcount-ra-address -mframe-header-opt
615 -mno-frame-header-opt
616
617 MMIX Options -mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon
618 -mabi=gnu -mabi=mmixware -mzero-extend -mknuthdiv
619 -mtoplevel-symbols -melf -mbranch-predict -mno-branch-predict
620 -mbase-addresses -mno-base-addresses -msingle-exit
621 -mno-single-exit
622
623 MN10300 Options -mmult-bug -mno-mult-bug -mno-am33 -mam33
624 -mam33-2 -mam34 -mtune=cpu-type -mreturn-pointer-on-d0 -mno-crt0
625 -mrelax -mliw -msetlb
626
627 Moxie Options -meb -mel -mmul.x -mno-crt0
628
629 MSP430 Options -msim -masm-hex -mmcu= -mcpu= -mlarge -msmall
630 -mrelax -mwarn-mcu -mcode-region= -mdata-region= -msilicon-errata=
631 -msilicon-errata-warn= -mhwmult= -minrt
632
633 NDS32 Options -mbig-endian -mlittle-endian -mreduced-regs
634 -mfull-regs -mcmov -mno-cmov -mext-perf -mno-ext-perf -mext-perf2
635 -mno-ext-perf2 -mext-string -mno-ext-string -mv3push -mno-v3push
636 -m16bit -mno-16bit -misr-vector-size=num -mcache-block-size=num
637 -march=arch -mcmodel=code-model -mctor-dtor -mrelax
638
639 Nios II Options -G num -mgpopt=option -mgpopt -mno-gpopt
640 -mgprel-sec=regexp -mr0rel-sec=regexp -mel -meb -mno-bypass-cache
641 -mbypass-cache -mno-cache-volatile -mcache-volatile
642 -mno-fast-sw-div -mfast-sw-div -mhw-mul -mno-hw-mul -mhw-mulx
643 -mno-hw-mulx -mno-hw-div -mhw-div -mcustom-insn=N
644 -mno-custom-insn -mcustom-fpu-cfg=name -mhal -msmallc
645 -msys-crt0=name -msys-lib=name -march=arch -mbmx -mno-bmx -mcdx
646 -mno-cdx
647
648 Nvidia PTX Options -m32 -m64 -mmainkernel -moptimize
649
650 PDP-11 Options -mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45
651 -m10 -mbcopy -mbcopy-builtin -mint32 -mno-int16 -mint16
652 -mno-int32 -mfloat32 -mno-float64 -mfloat64 -mno-float32
653 -mabshi -mno-abshi -mbranch-expensive -mbranch-cheap -munix-asm
654 -mdec-asm
655
656 picoChip Options -mae=ae_type -mvliw-lookahead=N
657 -msymbol-as-address -mno-inefficient-warnings
658
659 PowerPC Options See RS/6000 and PowerPC Options.
660
661 PowerPC SPE Options -mcpu=cpu-type -mtune=cpu-type -mmfcrf
662 -mno-mfcrf -mpopcntb -mno-popcntb -mfull-toc -mminimal-toc
663 -mno-fp-in-toc -mno-sum-in-toc -m32 -mxl-compat -mno-xl-compat
664 -malign-power -malign-natural -msoft-float -mhard-float
665 -mmultiple -mno-multiple -msingle-float -mdouble-float -mupdate
666 -mno-update -mavoid-indexed-addresses -mno-avoid-indexed-addresses
667 -mstrict-align -mno-strict-align -mrelocatable -mno-relocatable
668 -mrelocatable-lib -mno-relocatable-lib -mtoc -mno-toc -mlittle
669 -mlittle-endian -mbig -mbig-endian -msingle-pic-base
670 -mprioritize-restricted-insns=priority
671 -msched-costly-dep=dependence_type -minsert-sched-nops=scheme
672 -mcall-sysv -mcall-netbsd -maix-struct-return
673 -msvr4-struct-return -mabi=abi-type -msecure-plt -mbss-plt
674 -mblock-move-inline-limit=num -misel -mno-isel -misel=yes
675 -misel=no -mspe -mno-spe -mspe=yes -mspe=no -mfloat-gprs=yes
676 -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double
677 -mprototype -mno-prototype -msim -mmvme -mads -myellowknife
678 -memb -msdata -msdata=opt -mvxworks -G num -mrecip -mrecip=opt
679 -mno-recip -mrecip-precision -mno-recip-precision
680 -mpointers-to-nested-functions -mno-pointers-to-nested-functions
681 -msave-toc-indirect -mno-save-toc-indirect -mcompat-align-parm
682 -mno-compat-align-parm -mfloat128 -mno-float128 -mgnu-attribute
683 -mno-gnu-attribute -mstack-protector-guard=guard
684 -mstack-protector-guard-reg=reg
685 -mstack-protector-guard-offset=offset
686
687 RISC-V Options -mbranch-cost=N-instruction -mplt -mno-plt
688 -mabi=ABI-string -mfdiv -mno-fdiv -mdiv -mno-div -march=ISA-
689 string -mtune=processor-string -mpreferred-stack-boundary=num
690 -msmall-data-limit=N-bytes -msave-restore -mno-save-restore
691 -mstrict-align -mno-strict-align -mcmodel=medlow -mcmodel=medany
692 -mexplicit-relocs -mno-explicit-relocs -mrelax -mno-relax
693
694 RL78 Options -msim -mmul=none -mmul=g13 -mmul=g14 -mallregs
695 -mcpu=g10 -mcpu=g13 -mcpu=g14 -mg10 -mg13 -mg14
696 -m64bit-doubles -m32bit-doubles -msave-mduc-in-interrupts
697
698 RS/6000 and PowerPC Options -mcpu=cpu-type -mtune=cpu-type
699 -mcmodel=code-model -mpowerpc64 -maltivec -mno-altivec
700 -mpowerpc-gpopt -mno-powerpc-gpopt -mpowerpc-gfxopt
701 -mno-powerpc-gfxopt -mmfcrf -mno-mfcrf -mpopcntb -mno-popcntb
702 -mpopcntd -mno-popcntd -mfprnd -mno-fprnd -mcmpb -mno-cmpb
703 -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp -mfull-toc
704 -mminimal-toc -mno-fp-in-toc -mno-sum-in-toc -m64 -m32
705 -mxl-compat -mno-xl-compat -mpe -malign-power -malign-natural
706 -msoft-float -mhard-float -mmultiple -mno-multiple
707 -msingle-float -mdouble-float -msimple-fpu -mupdate -mno-update
708 -mavoid-indexed-addresses -mno-avoid-indexed-addresses
709 -mfused-madd -mno-fused-madd -mbit-align -mno-bit-align
710 -mstrict-align -mno-strict-align -mrelocatable -mno-relocatable
711 -mrelocatable-lib -mno-relocatable-lib -mtoc -mno-toc -mlittle
712 -mlittle-endian -mbig -mbig-endian -mdynamic-no-pic -maltivec
713 -mswdiv -msingle-pic-base -mprioritize-restricted-insns=priority
714 -msched-costly-dep=dependence_type -minsert-sched-nops=scheme
715 -mcall-aixdesc -mcall-eabi -mcall-freebsd -mcall-linux
716 -mcall-netbsd -mcall-openbsd -mcall-sysv -mcall-sysv-eabi
717 -mcall-sysv-noeabi -mtraceback=traceback_type -maix-struct-return
718 -msvr4-struct-return -mabi=abi-type -msecure-plt -mbss-plt
719 -mblock-move-inline-limit=num -mblock-compare-inline-limit=num
720 -mblock-compare-inline-loop-limit=num
721 -mstring-compare-inline-limit=num -misel -mno-isel -misel=yes
722 -misel=no -mpaired -mvrsave -mno-vrsave -mmulhw -mno-mulhw
723 -mdlmzb -mno-dlmzb -mprototype -mno-prototype -msim -mmvme
724 -mads -myellowknife -memb -msdata -msdata=opt
725 -mreadonly-in-sdata -mvxworks -G num -mrecip -mrecip=opt
726 -mno-recip -mrecip-precision -mno-recip-precision -mveclibabi=type
727 -mfriz -mno-friz -mpointers-to-nested-functions
728 -mno-pointers-to-nested-functions -msave-toc-indirect
729 -mno-save-toc-indirect -mpower8-fusion -mno-mpower8-fusion
730 -mpower8-vector -mno-power8-vector -mcrypto -mno-crypto -mhtm
731 -mno-htm -mquad-memory -mno-quad-memory -mquad-memory-atomic
732 -mno-quad-memory-atomic -mcompat-align-parm -mno-compat-align-parm
733 -mfloat128 -mno-float128 -mfloat128-hardware
734 -mno-float128-hardware -mgnu-attribute -mno-gnu-attribute
735 -mstack-protector-guard=guard -mstack-protector-guard-reg=reg
736 -mstack-protector-guard-offset=offset
737
738 RX Options -m64bit-doubles -m32bit-doubles -fpu -nofpu -mcpu=
739 -mbig-endian-data -mlittle-endian-data -msmall-data -msim
740 -mno-sim -mas100-syntax -mno-as100-syntax -mrelax
741 -mmax-constant-size= -mint-register= -mpid -mallow-string-insns
742 -mno-allow-string-insns -mjsr -mno-warn-multiple-fast-interrupts
743 -msave-acc-in-interrupts
744
745 S/390 and zSeries Options -mtune=cpu-type -march=cpu-type
746 -mhard-float -msoft-float -mhard-dfp -mno-hard-dfp
747 -mlong-double-64 -mlong-double-128 -mbackchain -mno-backchain
748 -mpacked-stack -mno-packed-stack -msmall-exec -mno-small-exec
749 -mmvcle -mno-mvcle -m64 -m31 -mdebug -mno-debug -mesa -mzarch
750 -mhtm -mvx -mzvector -mtpf-trace -mno-tpf-trace -mfused-madd
751 -mno-fused-madd -mwarn-framesize -mwarn-dynamicstack -mstack-size
752 -mstack-guard -mhotpatch=halfwords,halfwords
753
754 Score Options -meb -mel -mnhwloop -muls -mmac -mscore5 -mscore5u
755 -mscore7 -mscore7d
756
757 SH Options -m1 -m2 -m2e -m2a-nofpu -m2a-single-only -m2a-single
758 -m2a -m3 -m3e -m4-nofpu -m4-single-only -m4-single -m4
759 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al -mb -ml
760 -mdalign -mrelax -mbigtable -mfmovd -mrenesas -mno-renesas
761 -mnomacsave -mieee -mno-ieee -mbitops -misize
762 -minline-ic_invalidate -mpadstruct -mprefergot -musermode
763 -multcost=number -mdiv=strategy -mdivsi3_libfunc=name
764 -mfixed-range=register-range -maccumulate-outgoing-args
765 -matomic-model=atomic-model -mbranch-cost=num -mzdcbranch
766 -mno-zdcbranch -mcbranch-force-delay-slot -mfused-madd
767 -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra
768 -mpretend-cmove -mtas
769
770 Solaris 2 Options -mclear-hwcap -mno-clear-hwcap -mimpure-text
771 -mno-impure-text -pthreads
772
773 SPARC Options -mcpu=cpu-type -mtune=cpu-type -mcmodel=code-model
774 -mmemory-model=mem-model -m32 -m64 -mapp-regs -mno-app-regs
775 -mfaster-structs -mno-faster-structs -mflat -mno-flat -mfpu
776 -mno-fpu -mhard-float -msoft-float -mhard-quad-float
777 -msoft-quad-float -mstack-bias -mno-stack-bias -mstd-struct-return
778 -mno-std-struct-return -munaligned-doubles -mno-unaligned-doubles
779 -muser-mode -mno-user-mode -mv8plus -mno-v8plus -mvis -mno-vis
780 -mvis2 -mno-vis2 -mvis3 -mno-vis3 -mvis4 -mno-vis4 -mvis4b
781 -mno-vis4b -mcbcond -mno-cbcond -mfmaf -mno-fmaf -mfsmuld
782 -mno-fsmuld -mpopc -mno-popc -msubxc -mno-subxc -mfix-at697f
783 -mfix-ut699 -mfix-ut700 -mfix-gr712rc -mlra -mno-lra
784
785 SPU Options -mwarn-reloc -merror-reloc -msafe-dma -munsafe-dma
786 -mbranch-hints -msmall-mem -mlarge-mem -mstdmain
787 -mfixed-range=register-range -mea32 -mea64
788 -maddress-space-conversion -mno-address-space-conversion
789 -mcache-size=cache-size -matomic-updates -mno-atomic-updates
790
791 System V Options -Qy -Qn -YP,paths -Ym,dir
792
793 TILE-Gx Options -mcpu=CPU -m32 -m64 -mbig-endian
794 -mlittle-endian -mcmodel=code-model
795
796 TILEPro Options -mcpu=cpu -m32
797
798 V850 Options -mlong-calls -mno-long-calls -mep -mno-ep
799 -mprolog-function -mno-prolog-function -mspace -mtda=n -msda=n
800 -mzda=n -mapp-regs -mno-app-regs -mdisable-callt
801 -mno-disable-callt -mv850e2v3 -mv850e2 -mv850e1 -mv850es -mv850e
802 -mv850 -mv850e3v5 -mloop -mrelax -mlong-jumps -msoft-float
803 -mhard-float -mgcc-abi -mrh850-abi -mbig-switch
804
805 VAX Options -mg -mgnu -munix
806
807 Visium Options -mdebug -msim -mfpu -mno-fpu -mhard-float
808 -msoft-float -mcpu=cpu-type -mtune=cpu-type -msv-mode
809 -muser-mode
810
811 VMS Options -mvms-return-codes -mdebug-main=prefix -mmalloc64
812 -mpointer-size=size
813
814 VxWorks Options -mrtp -non-static -Bstatic -Bdynamic -Xbind-lazy
815 -Xbind-now
816
817 x86 Options -mtune=cpu-type -march=cpu-type -mtune-ctrl=feature-
818 list -mdump-tune-features -mno-default -mfpmath=unit
819 -masm=dialect -mno-fancy-math-387 -mno-fp-ret-in-387 -m80387
820 -mhard-float -msoft-float -mno-wide-multiply -mrtd
821 -malign-double -mpreferred-stack-boundary=num
822 -mincoming-stack-boundary=num -mcld -mcx16 -msahf -mmovbe
823 -mcrc32 -mrecip -mrecip=opt -mvzeroupper -mprefer-avx128
824 -mprefer-vector-width=opt -mmmx -msse -msse2 -msse3 -mssse3
825 -msse4.1 -msse4.2 -msse4 -mavx -mavx2 -mavx512f -mavx512pf
826 -mavx512er -mavx512cd -mavx512vl -mavx512bw -mavx512dq
827 -mavx512ifma -mavx512vbmi -msha -maes -mpclmul -mfsgsbase
828 -mrdrnd -mf16c -mfma -mpconfig -mwbnoinvd -mprefetchwt1
829 -mclflushopt -mxsavec -mxsaves -msse4a -m3dnow -m3dnowa
830 -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt -mbmi2
831 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mmpx -mmwaitx -mclzero
832 -mpku -mthreads -mgfni -mvaes -mshstk -mforce-indirect-call
833 -mavx512vbmi2 -mvpclmulqdq -mavx512bitalg -mmovdiri -mmovdir64b
834 -mavx512vpopcntdq -mms-bitfields -mno-align-stringops
835 -minline-all-stringops -minline-stringops-dynamically
836 -mstringop-strategy=alg -mmemcpy-strategy=strategy
837 -mmemset-strategy=strategy -mpush-args -maccumulate-outgoing-args
838 -m128bit-long-double -m96bit-long-double -mlong-double-64
839 -mlong-double-80 -mlong-double-128 -mregparm=num -msseregparm
840 -mveclibabi=type -mvect8-ret-in-mem -mpc32 -mpc64 -mpc80
841 -mstackrealign -momit-leaf-frame-pointer -mno-red-zone
842 -mno-tls-direct-seg-refs -mcmodel=code-model -mabi=name
843 -maddress-mode=mode -m32 -m64 -mx32 -m16 -miamcu
844 -mlarge-data-threshold=num -msse2avx -mfentry -mrecord-mcount
845 -mnop-mcount -m8bit-idiv -mavx256-split-unaligned-load
846 -mavx256-split-unaligned-store -malign-data=type
847 -mstack-protector-guard=guard -mstack-protector-guard-reg=reg
848 -mstack-protector-guard-offset=offset
849 -mstack-protector-guard-symbol=symbol -mmitigate-rop
850 -mgeneral-regs-only -mcall-ms2sysv-xlogues -mindirect-branch=choice
851 -mfunction-return=choice -mindirect-branch-register
852
853 x86 Windows Options -mconsole -mcygwin -mno-cygwin -mdll
854 -mnop-fun-dllimport -mthread -municode -mwin32 -mwindows
855 -fno-set-stack-executable
856
857 Xstormy16 Options -msim
858
859 Xtensa Options -mconst16 -mno-const16 -mfused-madd
860 -mno-fused-madd -mforce-no-pic -mserialize-volatile
861 -mno-serialize-volatile -mtext-section-literals
862 -mno-text-section-literals -mauto-litpools -mno-auto-litpools
863 -mtarget-align -mno-target-align -mlongcalls -mno-longcalls
864
865 zSeries Options See S/390 and zSeries Options.
866
867 Options Controlling the Kind of Output
868 Compilation can involve up to four stages: preprocessing, compilation
869 proper, assembly and linking, always in that order. GCC is capable of
870 preprocessing and compiling several files either into several assembler
871 input files, or into one assembler input file; then each assembler
872 input file produces an object file, and linking combines all the object
873 files (those newly compiled, and those specified as input) into an
874 executable file.
875
876 For any given input file, the file name suffix determines what kind of
877 compilation is done:
878
879 file.c
880 C source code that must be preprocessed.
881
882 file.i
883 C source code that should not be preprocessed.
884
885 file.ii
886 C++ source code that should not be preprocessed.
887
888 file.m
889 Objective-C source code. Note that you must link with the libobjc
890 library to make an Objective-C program work.
891
892 file.mi
893 Objective-C source code that should not be preprocessed.
894
895 file.mm
896 file.M
897 Objective-C++ source code. Note that you must link with the
898 libobjc library to make an Objective-C++ program work. Note that
899 .M refers to a literal capital M.
900
901 file.mii
902 Objective-C++ source code that should not be preprocessed.
903
904 file.h
905 C, C++, Objective-C or Objective-C++ header file to be turned into
906 a precompiled header (default), or C, C++ header file to be turned
907 into an Ada spec (via the -fdump-ada-spec switch).
908
909 file.cc
910 file.cp
911 file.cxx
912 file.cpp
913 file.CPP
914 file.c++
915 file.C
916 C++ source code that must be preprocessed. Note that in .cxx, the
917 last two letters must both be literally x. Likewise, .C refers to
918 a literal capital C.
919
920 file.mm
921 file.M
922 Objective-C++ source code that must be preprocessed.
923
924 file.mii
925 Objective-C++ source code that should not be preprocessed.
926
927 file.hh
928 file.H
929 file.hp
930 file.hxx
931 file.hpp
932 file.HPP
933 file.h++
934 file.tcc
935 C++ header file to be turned into a precompiled header or Ada spec.
936
937 file.f
938 file.for
939 file.ftn
940 Fixed form Fortran source code that should not be preprocessed.
941
942 file.F
943 file.FOR
944 file.fpp
945 file.FPP
946 file.FTN
947 Fixed form Fortran source code that must be preprocessed (with the
948 traditional preprocessor).
949
950 file.f90
951 file.f95
952 file.f03
953 file.f08
954 Free form Fortran source code that should not be preprocessed.
955
956 file.F90
957 file.F95
958 file.F03
959 file.F08
960 Free form Fortran source code that must be preprocessed (with the
961 traditional preprocessor).
962
963 file.go
964 Go source code.
965
966 file.brig
967 BRIG files (binary representation of HSAIL).
968
969 file.ads
970 Ada source code file that contains a library unit declaration (a
971 declaration of a package, subprogram, or generic, or a generic
972 instantiation), or a library unit renaming declaration (a package,
973 generic, or subprogram renaming declaration). Such files are also
974 called specs.
975
976 file.adb
977 Ada source code file containing a library unit body (a subprogram
978 or package body). Such files are also called bodies.
979
980 file.s
981 Assembler code.
982
983 file.S
984 file.sx
985 Assembler code that must be preprocessed.
986
987 other
988 An object file to be fed straight into linking. Any file name with
989 no recognized suffix is treated this way.
990
991 You can specify the input language explicitly with the -x option:
992
993 -x language
994 Specify explicitly the language for the following input files
995 (rather than letting the compiler choose a default based on the
996 file name suffix). This option applies to all following input
997 files until the next -x option. Possible values for language are:
998
999 c c-header cpp-output
1000 c++ c++-header c++-cpp-output
1001 objective-c objective-c-header objective-c-cpp-output
1002 objective-c++ objective-c++-header objective-c++-cpp-output
1003 assembler assembler-with-cpp
1004 ada
1005 f77 f77-cpp-input f95 f95-cpp-input
1006 go
1007 brig
1008
1009 -x none
1010 Turn off any specification of a language, so that subsequent files
1011 are handled according to their file name suffixes (as they are if
1012 -x has not been used at all).
1013
1014 If you only want some of the stages of compilation, you can use -x (or
1015 filename suffixes) to tell gcc where to start, and one of the options
1016 -c, -S, or -E to say where gcc is to stop. Note that some combinations
1017 (for example, -x cpp-output -E) instruct gcc to do nothing at all.
1018
1019 -c Compile or assemble the source files, but do not link. The linking
1020 stage simply is not done. The ultimate output is in the form of an
1021 object file for each source file.
1022
1023 By default, the object file name for a source file is made by
1024 replacing the suffix .c, .i, .s, etc., with .o.
1025
1026 Unrecognized input files, not requiring compilation or assembly,
1027 are ignored.
1028
1029 -S Stop after the stage of compilation proper; do not assemble. The
1030 output is in the form of an assembler code file for each non-
1031 assembler input file specified.
1032
1033 By default, the assembler file name for a source file is made by
1034 replacing the suffix .c, .i, etc., with .s.
1035
1036 Input files that don't require compilation are ignored.
1037
1038 -E Stop after the preprocessing stage; do not run the compiler proper.
1039 The output is in the form of preprocessed source code, which is
1040 sent to the standard output.
1041
1042 Input files that don't require preprocessing are ignored.
1043
1044 -o file
1045 Place output in file file. This applies to whatever sort of output
1046 is being produced, whether it be an executable file, an object
1047 file, an assembler file or preprocessed C code.
1048
1049 If -o is not specified, the default is to put an executable file in
1050 a.out, the object file for source.suffix in source.o, its assembler
1051 file in source.s, a precompiled header file in source.suffix.gch,
1052 and all preprocessed C source on standard output.
1053
1054 -v Print (on standard error output) the commands executed to run the
1055 stages of compilation. Also print the version number of the
1056 compiler driver program and of the preprocessor and the compiler
1057 proper.
1058
1059 -###
1060 Like -v except the commands are not executed and arguments are
1061 quoted unless they contain only alphanumeric characters or "./-_".
1062 This is useful for shell scripts to capture the driver-generated
1063 command lines.
1064
1065 --help
1066 Print (on the standard output) a description of the command-line
1067 options understood by gcc. If the -v option is also specified then
1068 --help is also passed on to the various processes invoked by gcc,
1069 so that they can display the command-line options they accept. If
1070 the -Wextra option has also been specified (prior to the --help
1071 option), then command-line options that have no documentation
1072 associated with them are also displayed.
1073
1074 --target-help
1075 Print (on the standard output) a description of target-specific
1076 command-line options for each tool. For some targets extra target-
1077 specific information may also be printed.
1078
1079 --help={class|[^]qualifier}[,...]
1080 Print (on the standard output) a description of the command-line
1081 options understood by the compiler that fit into all specified
1082 classes and qualifiers. These are the supported classes:
1083
1084 optimizers
1085 Display all of the optimization options supported by the
1086 compiler.
1087
1088 warnings
1089 Display all of the options controlling warning messages
1090 produced by the compiler.
1091
1092 target
1093 Display target-specific options. Unlike the --target-help
1094 option however, target-specific options of the linker and
1095 assembler are not displayed. This is because those tools do
1096 not currently support the extended --help= syntax.
1097
1098 params
1099 Display the values recognized by the --param option.
1100
1101 language
1102 Display the options supported for language, where language is
1103 the name of one of the languages supported in this version of
1104 GCC.
1105
1106 common
1107 Display the options that are common to all languages.
1108
1109 These are the supported qualifiers:
1110
1111 undocumented
1112 Display only those options that are undocumented.
1113
1114 joined
1115 Display options taking an argument that appears after an equal
1116 sign in the same continuous piece of text, such as:
1117 --help=target.
1118
1119 separate
1120 Display options taking an argument that appears as a separate
1121 word following the original option, such as: -o output-file.
1122
1123 Thus for example to display all the undocumented target-specific
1124 switches supported by the compiler, use:
1125
1126 --help=target,undocumented
1127
1128 The sense of a qualifier can be inverted by prefixing it with the ^
1129 character, so for example to display all binary warning options
1130 (i.e., ones that are either on or off and that do not take an
1131 argument) that have a description, use:
1132
1133 --help=warnings,^joined,^undocumented
1134
1135 The argument to --help= should not consist solely of inverted
1136 qualifiers.
1137
1138 Combining several classes is possible, although this usually
1139 restricts the output so much that there is nothing to display. One
1140 case where it does work, however, is when one of the classes is
1141 target. For example, to display all the target-specific
1142 optimization options, use:
1143
1144 --help=target,optimizers
1145
1146 The --help= option can be repeated on the command line. Each
1147 successive use displays its requested class of options, skipping
1148 those that have already been displayed.
1149
1150 If the -Q option appears on the command line before the --help=
1151 option, then the descriptive text displayed by --help= is changed.
1152 Instead of describing the displayed options, an indication is given
1153 as to whether the option is enabled, disabled or set to a specific
1154 value (assuming that the compiler knows this at the point where the
1155 --help= option is used).
1156
1157 Here is a truncated example from the ARM port of gcc:
1158
1159 % gcc -Q -mabi=2 --help=target -c
1160 The following options are target specific:
1161 -mabi= 2
1162 -mabort-on-noreturn [disabled]
1163 -mapcs [disabled]
1164
1165 The output is sensitive to the effects of previous command-line
1166 options, so for example it is possible to find out which
1167 optimizations are enabled at -O2 by using:
1168
1169 -Q -O2 --help=optimizers
1170
1171 Alternatively you can discover which binary optimizations are
1172 enabled by -O3 by using:
1173
1174 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1175 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1176 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1177
1178 --version
1179 Display the version number and copyrights of the invoked GCC.
1180
1181 -pass-exit-codes
1182 Normally the gcc program exits with the code of 1 if any phase of
1183 the compiler returns a non-success return code. If you specify
1184 -pass-exit-codes, the gcc program instead returns with the
1185 numerically highest error produced by any phase returning an error
1186 indication. The C, C++, and Fortran front ends return 4 if an
1187 internal compiler error is encountered.
1188
1189 -pipe
1190 Use pipes rather than temporary files for communication between the
1191 various stages of compilation. This fails to work on some systems
1192 where the assembler is unable to read from a pipe; but the GNU
1193 assembler has no trouble.
1194
1195 -specs=file
1196 Process file after the compiler reads in the standard specs file,
1197 in order to override the defaults which the gcc driver program uses
1198 when determining what switches to pass to cc1, cc1plus, as, ld,
1199 etc. More than one -specs=file can be specified on the command
1200 line, and they are processed in order, from left to right.
1201
1202 -wrapper
1203 Invoke all subcommands under a wrapper program. The name of the
1204 wrapper program and its parameters are passed as a comma separated
1205 list.
1206
1207 gcc -c t.c -wrapper gdb,--args
1208
1209 This invokes all subprograms of gcc under gdb --args, thus the
1210 invocation of cc1 is gdb --args cc1 ....
1211
1212 -ffile-prefix-map=old=new
1213 When compiling files residing in directory old, record any
1214 references to them in the result of the compilation as if the files
1215 resided in directory new instead. Specifying this option is
1216 equivalent to specifying all the individual -f*-prefix-map options.
1217 This can be used to make reproducible builds that are location
1218 independent. See also -fmacro-prefix-map and -fdebug-prefix-map.
1219
1220 -fplugin=name.so
1221 Load the plugin code in file name.so, assumed to be a shared object
1222 to be dlopen'd by the compiler. The base name of the shared object
1223 file is used to identify the plugin for the purposes of argument
1224 parsing (See -fplugin-arg-name-key=value below). Each plugin
1225 should define the callback functions specified in the Plugins API.
1226
1227 -fplugin-arg-name-key=value
1228 Define an argument called key with a value of value for the plugin
1229 called name.
1230
1231 -fdump-ada-spec[-slim]
1232 For C and C++ source and include files, generate corresponding Ada
1233 specs.
1234
1235 -fada-spec-parent=unit
1236 In conjunction with -fdump-ada-spec[-slim] above, generate Ada
1237 specs as child units of parent unit.
1238
1239 -fdump-go-spec=file
1240 For input files in any language, generate corresponding Go
1241 declarations in file. This generates Go "const", "type", "var",
1242 and "func" declarations which may be a useful way to start writing
1243 a Go interface to code written in some other language.
1244
1245 @file
1246 Read command-line options from file. The options read are inserted
1247 in place of the original @file option. If file does not exist, or
1248 cannot be read, then the option will be treated literally, and not
1249 removed.
1250
1251 Options in file are separated by whitespace. A whitespace
1252 character may be included in an option by surrounding the entire
1253 option in either single or double quotes. Any character (including
1254 a backslash) may be included by prefixing the character to be
1255 included with a backslash. The file may itself contain additional
1256 @file options; any such options will be processed recursively.
1257
1258 Compiling C++ Programs
1259 C++ source files conventionally use one of the suffixes .C, .cc, .cpp,
1260 .CPP, .c++, .cp, or .cxx; C++ header files often use .hh, .hpp, .H, or
1261 (for shared template code) .tcc; and preprocessed C++ files use the
1262 suffix .ii. GCC recognizes files with these names and compiles them as
1263 C++ programs even if you call the compiler the same way as for
1264 compiling C programs (usually with the name gcc).
1265
1266 However, the use of gcc does not add the C++ library. g++ is a program
1267 that calls GCC and automatically specifies linking against the C++
1268 library. It treats .c, .h and .i files as C++ source files instead of
1269 C source files unless -x is used. This program is also useful when
1270 precompiling a C header file with a .h extension for use in C++
1271 compilations. On many systems, g++ is also installed with the name
1272 c++.
1273
1274 When you compile C++ programs, you may specify many of the same
1275 command-line options that you use for compiling programs in any
1276 language; or command-line options meaningful for C and related
1277 languages; or options that are meaningful only for C++ programs.
1278
1279 Options Controlling C Dialect
1280 The following options control the dialect of C (or languages derived
1281 from C, such as C++, Objective-C and Objective-C++) that the compiler
1282 accepts:
1283
1284 -ansi
1285 In C mode, this is equivalent to -std=c90. In C++ mode, it is
1286 equivalent to -std=c++98.
1287
1288 This turns off certain features of GCC that are incompatible with
1289 ISO C90 (when compiling C code), or of standard C++ (when compiling
1290 C++ code), such as the "asm" and "typeof" keywords, and predefined
1291 macros such as "unix" and "vax" that identify the type of system
1292 you are using. It also enables the undesirable and rarely used ISO
1293 trigraph feature. For the C compiler, it disables recognition of
1294 C++ style // comments as well as the "inline" keyword.
1295
1296 The alternate keywords "__asm__", "__extension__", "__inline__" and
1297 "__typeof__" continue to work despite -ansi. You would not want to
1298 use them in an ISO C program, of course, but it is useful to put
1299 them in header files that might be included in compilations done
1300 with -ansi. Alternate predefined macros such as "__unix__" and
1301 "__vax__" are also available, with or without -ansi.
1302
1303 The -ansi option does not cause non-ISO programs to be rejected
1304 gratuitously. For that, -Wpedantic is required in addition to
1305 -ansi.
1306
1307 The macro "__STRICT_ANSI__" is predefined when the -ansi option is
1308 used. Some header files may notice this macro and refrain from
1309 declaring certain functions or defining certain macros that the ISO
1310 standard doesn't call for; this is to avoid interfering with any
1311 programs that might use these names for other things.
1312
1313 Functions that are normally built in but do not have semantics
1314 defined by ISO C (such as "alloca" and "ffs") are not built-in
1315 functions when -ansi is used.
1316
1317 -std=
1318 Determine the language standard. This option is currently only
1319 supported when compiling C or C++.
1320
1321 The compiler can accept several base standards, such as c90 or
1322 c++98, and GNU dialects of those standards, such as gnu90 or
1323 gnu++98. When a base standard is specified, the compiler accepts
1324 all programs following that standard plus those using GNU
1325 extensions that do not contradict it. For example, -std=c90 turns
1326 off certain features of GCC that are incompatible with ISO C90,
1327 such as the "asm" and "typeof" keywords, but not other GNU
1328 extensions that do not have a meaning in ISO C90, such as omitting
1329 the middle term of a "?:" expression. On the other hand, when a GNU
1330 dialect of a standard is specified, all features supported by the
1331 compiler are enabled, even when those features change the meaning
1332 of the base standard. As a result, some strict-conforming programs
1333 may be rejected. The particular standard is used by -Wpedantic to
1334 identify which features are GNU extensions given that version of
1335 the standard. For example -std=gnu90 -Wpedantic warns about C++
1336 style // comments, while -std=gnu99 -Wpedantic does not.
1337
1338 A value for this option must be provided; possible values are
1339
1340 c90
1341 c89
1342 iso9899:1990
1343 Support all ISO C90 programs (certain GNU extensions that
1344 conflict with ISO C90 are disabled). Same as -ansi for C code.
1345
1346 iso9899:199409
1347 ISO C90 as modified in amendment 1.
1348
1349 c99
1350 c9x
1351 iso9899:1999
1352 iso9899:199x
1353 ISO C99. This standard is substantially completely supported,
1354 modulo bugs and floating-point issues (mainly but not entirely
1355 relating to optional C99 features from Annexes F and G). See
1356 <http://gcc.gnu.org/c99status.html> for more information. The
1357 names c9x and iso9899:199x are deprecated.
1358
1359 c11
1360 c1x
1361 iso9899:2011
1362 ISO C11, the 2011 revision of the ISO C standard. This
1363 standard is substantially completely supported, modulo bugs,
1364 floating-point issues (mainly but not entirely relating to
1365 optional C11 features from Annexes F and G) and the optional
1366 Annexes K (Bounds-checking interfaces) and L (Analyzability).
1367 The name c1x is deprecated.
1368
1369 c17
1370 c18
1371 iso9899:2017
1372 iso9899:2018
1373 ISO C17, the 2017 revision of the ISO C standard (expected to
1374 be published in 2018). This standard is same as C11 except for
1375 corrections of defects (all of which are also applied with
1376 -std=c11) and a new value of "__STDC_VERSION__", and so is
1377 supported to the same extent as C11.
1378
1379 gnu90
1380 gnu89
1381 GNU dialect of ISO C90 (including some C99 features).
1382
1383 gnu99
1384 gnu9x
1385 GNU dialect of ISO C99. The name gnu9x is deprecated.
1386
1387 gnu11
1388 gnu1x
1389 GNU dialect of ISO C11. The name gnu1x is deprecated.
1390
1391 gnu17
1392 gnu18
1393 GNU dialect of ISO C17. This is the default for C code.
1394
1395 c++98
1396 c++03
1397 The 1998 ISO C++ standard plus the 2003 technical corrigendum
1398 and some additional defect reports. Same as -ansi for C++ code.
1399
1400 gnu++98
1401 gnu++03
1402 GNU dialect of -std=c++98.
1403
1404 c++11
1405 c++0x
1406 The 2011 ISO C++ standard plus amendments. The name c++0x is
1407 deprecated.
1408
1409 gnu++11
1410 gnu++0x
1411 GNU dialect of -std=c++11. The name gnu++0x is deprecated.
1412
1413 c++14
1414 c++1y
1415 The 2014 ISO C++ standard plus amendments. The name c++1y is
1416 deprecated.
1417
1418 gnu++14
1419 gnu++1y
1420 GNU dialect of -std=c++14. This is the default for C++ code.
1421 The name gnu++1y is deprecated.
1422
1423 c++17
1424 c++1z
1425 The 2017 ISO C++ standard plus amendments. The name c++1z is
1426 deprecated.
1427
1428 gnu++17
1429 gnu++1z
1430 GNU dialect of -std=c++17. The name gnu++1z is deprecated.
1431
1432 c++2a
1433 The next revision of the ISO C++ standard, tentatively planned
1434 for 2020. Support is highly experimental, and will almost
1435 certainly change in incompatible ways in future releases.
1436
1437 gnu++2a
1438 GNU dialect of -std=c++2a. Support is highly experimental, and
1439 will almost certainly change in incompatible ways in future
1440 releases.
1441
1442 -fgnu89-inline
1443 The option -fgnu89-inline tells GCC to use the traditional GNU
1444 semantics for "inline" functions when in C99 mode.
1445
1446 Using this option is roughly equivalent to adding the "gnu_inline"
1447 function attribute to all inline functions.
1448
1449 The option -fno-gnu89-inline explicitly tells GCC to use the C99
1450 semantics for "inline" when in C99 or gnu99 mode (i.e., it
1451 specifies the default behavior). This option is not supported in
1452 -std=c90 or -std=gnu90 mode.
1453
1454 The preprocessor macros "__GNUC_GNU_INLINE__" and
1455 "__GNUC_STDC_INLINE__" may be used to check which semantics are in
1456 effect for "inline" functions.
1457
1458 -fpermitted-flt-eval-methods=style
1459 ISO/IEC TS 18661-3 defines new permissible values for
1460 "FLT_EVAL_METHOD" that indicate that operations and constants with
1461 a semantic type that is an interchange or extended format should be
1462 evaluated to the precision and range of that type. These new
1463 values are a superset of those permitted under C99/C11, which does
1464 not specify the meaning of other positive values of
1465 "FLT_EVAL_METHOD". As such, code conforming to C11 may not have
1466 been written expecting the possibility of the new values.
1467
1468 -fpermitted-flt-eval-methods specifies whether the compiler should
1469 allow only the values of "FLT_EVAL_METHOD" specified in C99/C11, or
1470 the extended set of values specified in ISO/IEC TS 18661-3.
1471
1472 style is either "c11" or "ts-18661-3" as appropriate.
1473
1474 The default when in a standards compliant mode (-std=c11 or
1475 similar) is -fpermitted-flt-eval-methods=c11. The default when in
1476 a GNU dialect (-std=gnu11 or similar) is
1477 -fpermitted-flt-eval-methods=ts-18661-3.
1478
1479 -aux-info filename
1480 Output to the given filename prototyped declarations for all
1481 functions declared and/or defined in a translation unit, including
1482 those in header files. This option is silently ignored in any
1483 language other than C.
1484
1485 Besides declarations, the file indicates, in comments, the origin
1486 of each declaration (source file and line), whether the declaration
1487 was implicit, prototyped or unprototyped (I, N for new or O for
1488 old, respectively, in the first character after the line number and
1489 the colon), and whether it came from a declaration or a definition
1490 (C or F, respectively, in the following character). In the case of
1491 function definitions, a K&R-style list of arguments followed by
1492 their declarations is also provided, inside comments, after the
1493 declaration.
1494
1495 -fallow-parameterless-variadic-functions
1496 Accept variadic functions without named parameters.
1497
1498 Although it is possible to define such a function, this is not very
1499 useful as it is not possible to read the arguments. This is only
1500 supported for C as this construct is allowed by C++.
1501
1502 -fno-asm
1503 Do not recognize "asm", "inline" or "typeof" as a keyword, so that
1504 code can use these words as identifiers. You can use the keywords
1505 "__asm__", "__inline__" and "__typeof__" instead. -ansi implies
1506 -fno-asm.
1507
1508 In C++, this switch only affects the "typeof" keyword, since "asm"
1509 and "inline" are standard keywords. You may want to use the
1510 -fno-gnu-keywords flag instead, which has the same effect. In C99
1511 mode (-std=c99 or -std=gnu99), this switch only affects the "asm"
1512 and "typeof" keywords, since "inline" is a standard keyword in ISO
1513 C99.
1514
1515 -fno-builtin
1516 -fno-builtin-function
1517 Don't recognize built-in functions that do not begin with
1518 __builtin_ as prefix.
1519
1520 GCC normally generates special code to handle certain built-in
1521 functions more efficiently; for instance, calls to "alloca" may
1522 become single instructions which adjust the stack directly, and
1523 calls to "memcpy" may become inline copy loops. The resulting code
1524 is often both smaller and faster, but since the function calls no
1525 longer appear as such, you cannot set a breakpoint on those calls,
1526 nor can you change the behavior of the functions by linking with a
1527 different library. In addition, when a function is recognized as a
1528 built-in function, GCC may use information about that function to
1529 warn about problems with calls to that function, or to generate
1530 more efficient code, even if the resulting code still contains
1531 calls to that function. For example, warnings are given with
1532 -Wformat for bad calls to "printf" when "printf" is built in and
1533 "strlen" is known not to modify global memory.
1534
1535 With the -fno-builtin-function option only the built-in function
1536 function is disabled. function must not begin with __builtin_. If
1537 a function is named that is not built-in in this version of GCC,
1538 this option is ignored. There is no corresponding
1539 -fbuiltin-function option; if you wish to enable built-in functions
1540 selectively when using -fno-builtin or -ffreestanding, you may
1541 define macros such as:
1542
1543 #define abs(n) __builtin_abs ((n))
1544 #define strcpy(d, s) __builtin_strcpy ((d), (s))
1545
1546 -fgimple
1547 Enable parsing of function definitions marked with "__GIMPLE".
1548 This is an experimental feature that allows unit testing of GIMPLE
1549 passes.
1550
1551 -fhosted
1552 Assert that compilation targets a hosted environment. This implies
1553 -fbuiltin. A hosted environment is one in which the entire
1554 standard library is available, and in which "main" has a return
1555 type of "int". Examples are nearly everything except a kernel.
1556 This is equivalent to -fno-freestanding.
1557
1558 -ffreestanding
1559 Assert that compilation targets a freestanding environment. This
1560 implies -fno-builtin. A freestanding environment is one in which
1561 the standard library may not exist, and program startup may not
1562 necessarily be at "main". The most obvious example is an OS
1563 kernel. This is equivalent to -fno-hosted.
1564
1565 -fopenacc
1566 Enable handling of OpenACC directives "#pragma acc" in C/C++ and
1567 "!$acc" in Fortran. When -fopenacc is specified, the compiler
1568 generates accelerated code according to the OpenACC Application
1569 Programming Interface v2.0 <https://www.openacc.org>. This option
1570 implies -pthread, and thus is only supported on targets that have
1571 support for -pthread.
1572
1573 -fopenacc-dim=geom
1574 Specify default compute dimensions for parallel offload regions
1575 that do not explicitly specify. The geom value is a triple of
1576 ':'-separated sizes, in order 'gang', 'worker' and, 'vector'. A
1577 size can be omitted, to use a target-specific default value.
1578
1579 -fopenmp
1580 Enable handling of OpenMP directives "#pragma omp" in C/C++ and
1581 "!$omp" in Fortran. When -fopenmp is specified, the compiler
1582 generates parallel code according to the OpenMP Application Program
1583 Interface v4.5 <http://www.openmp.org/>. This option implies
1584 -pthread, and thus is only supported on targets that have support
1585 for -pthread. -fopenmp implies -fopenmp-simd.
1586
1587 -fopenmp-simd
1588 Enable handling of OpenMP's SIMD directives with "#pragma omp" in
1589 C/C++ and "!$omp" in Fortran. Other OpenMP directives are ignored.
1590
1591 -fgnu-tm
1592 When the option -fgnu-tm is specified, the compiler generates code
1593 for the Linux variant of Intel's current Transactional Memory ABI
1594 specification document (Revision 1.1, May 6 2009). This is an
1595 experimental feature whose interface may change in future versions
1596 of GCC, as the official specification changes. Please note that
1597 not all architectures are supported for this feature.
1598
1599 For more information on GCC's support for transactional memory,
1600
1601 Note that the transactional memory feature is not supported with
1602 non-call exceptions (-fnon-call-exceptions).
1603
1604 -fms-extensions
1605 Accept some non-standard constructs used in Microsoft header files.
1606
1607 In C++ code, this allows member names in structures to be similar
1608 to previous types declarations.
1609
1610 typedef int UOW;
1611 struct ABC {
1612 UOW UOW;
1613 };
1614
1615 Some cases of unnamed fields in structures and unions are only
1616 accepted with this option.
1617
1618 Note that this option is off for all targets but x86 targets using
1619 ms-abi.
1620
1621 -fplan9-extensions
1622 Accept some non-standard constructs used in Plan 9 code.
1623
1624 This enables -fms-extensions, permits passing pointers to
1625 structures with anonymous fields to functions that expect pointers
1626 to elements of the type of the field, and permits referring to
1627 anonymous fields declared using a typedef. This is only
1628 supported for C, not C++.
1629
1630 -fcond-mismatch
1631 Allow conditional expressions with mismatched types in the second
1632 and third arguments. The value of such an expression is void.
1633 This option is not supported for C++.
1634
1635 -flax-vector-conversions
1636 Allow implicit conversions between vectors with differing numbers
1637 of elements and/or incompatible element types. This option should
1638 not be used for new code.
1639
1640 -funsigned-char
1641 Let the type "char" be unsigned, like "unsigned char".
1642
1643 Each kind of machine has a default for what "char" should be. It
1644 is either like "unsigned char" by default or like "signed char" by
1645 default.
1646
1647 Ideally, a portable program should always use "signed char" or
1648 "unsigned char" when it depends on the signedness of an object.
1649 But many programs have been written to use plain "char" and expect
1650 it to be signed, or expect it to be unsigned, depending on the
1651 machines they were written for. This option, and its inverse, let
1652 you make such a program work with the opposite default.
1653
1654 The type "char" is always a distinct type from each of "signed
1655 char" or "unsigned char", even though its behavior is always just
1656 like one of those two.
1657
1658 -fsigned-char
1659 Let the type "char" be signed, like "signed char".
1660
1661 Note that this is equivalent to -fno-unsigned-char, which is the
1662 negative form of -funsigned-char. Likewise, the option
1663 -fno-signed-char is equivalent to -funsigned-char.
1664
1665 -fsigned-bitfields
1666 -funsigned-bitfields
1667 -fno-signed-bitfields
1668 -fno-unsigned-bitfields
1669 These options control whether a bit-field is signed or unsigned,
1670 when the declaration does not use either "signed" or "unsigned".
1671 By default, such a bit-field is signed, because this is consistent:
1672 the basic integer types such as "int" are signed types.
1673
1674 -fsso-struct=endianness
1675 Set the default scalar storage order of structures and unions to
1676 the specified endianness. The accepted values are big-endian,
1677 little-endian and native for the native endianness of the target
1678 (the default). This option is not supported for C++.
1679
1680 Warning: the -fsso-struct switch causes GCC to generate code that
1681 is not binary compatible with code generated without it if the
1682 specified endianness is not the native endianness of the target.
1683
1684 Options Controlling C++ Dialect
1685 This section describes the command-line options that are only
1686 meaningful for C++ programs. You can also use most of the GNU compiler
1687 options regardless of what language your program is in. For example,
1688 you might compile a file firstClass.C like this:
1689
1690 g++ -g -fstrict-enums -O -c firstClass.C
1691
1692 In this example, only -fstrict-enums is an option meant only for C++
1693 programs; you can use the other options with any language supported by
1694 GCC.
1695
1696 Some options for compiling C programs, such as -std, are also relevant
1697 for C++ programs.
1698
1699 Here is a list of options that are only for compiling C++ programs:
1700
1701 -fabi-version=n
1702 Use version n of the C++ ABI. The default is version 0.
1703
1704 Version 0 refers to the version conforming most closely to the C++
1705 ABI specification. Therefore, the ABI obtained using version 0
1706 will change in different versions of G++ as ABI bugs are fixed.
1707
1708 Version 1 is the version of the C++ ABI that first appeared in G++
1709 3.2.
1710
1711 Version 2 is the version of the C++ ABI that first appeared in G++
1712 3.4, and was the default through G++ 4.9.
1713
1714 Version 3 corrects an error in mangling a constant address as a
1715 template argument.
1716
1717 Version 4, which first appeared in G++ 4.5, implements a standard
1718 mangling for vector types.
1719
1720 Version 5, which first appeared in G++ 4.6, corrects the mangling
1721 of attribute const/volatile on function pointer types, decltype of
1722 a plain decl, and use of a function parameter in the declaration of
1723 another parameter.
1724
1725 Version 6, which first appeared in G++ 4.7, corrects the promotion
1726 behavior of C++11 scoped enums and the mangling of template
1727 argument packs, const/static_cast, prefix ++ and --, and a class
1728 scope function used as a template argument.
1729
1730 Version 7, which first appeared in G++ 4.8, that treats nullptr_t
1731 as a builtin type and corrects the mangling of lambdas in default
1732 argument scope.
1733
1734 Version 8, which first appeared in G++ 4.9, corrects the
1735 substitution behavior of function types with function-cv-
1736 qualifiers.
1737
1738 Version 9, which first appeared in G++ 5.2, corrects the alignment
1739 of "nullptr_t".
1740
1741 Version 10, which first appeared in G++ 6.1, adds mangling of
1742 attributes that affect type identity, such as ia32 calling
1743 convention attributes (e.g. stdcall).
1744
1745 Version 11, which first appeared in G++ 7, corrects the mangling of
1746 sizeof... expressions and operator names. For multiple entities
1747 with the same name within a function, that are declared in
1748 different scopes, the mangling now changes starting with the
1749 twelfth occurrence. It also implies -fnew-inheriting-ctors.
1750
1751 Version 12, which first appeared in G++ 8, corrects the calling
1752 conventions for empty classes on the x86_64 target and for classes
1753 with only deleted copy/move constructors. It accidentally changes
1754 the calling convention for classes with a deleted copy constructor
1755 and a trivial move constructor.
1756
1757 Version 13, which first appeared in G++ 8.2, fixes the accidental
1758 change in version 12.
1759
1760 See also -Wabi.
1761
1762 -fabi-compat-version=n
1763 On targets that support strong aliases, G++ works around mangling
1764 changes by creating an alias with the correct mangled name when
1765 defining a symbol with an incorrect mangled name. This switch
1766 specifies which ABI version to use for the alias.
1767
1768 With -fabi-version=0 (the default), this defaults to 11 (GCC 7
1769 compatibility). If another ABI version is explicitly selected,
1770 this defaults to 0. For compatibility with GCC versions 3.2
1771 through 4.9, use -fabi-compat-version=2.
1772
1773 If this option is not provided but -Wabi=n is, that version is used
1774 for compatibility aliases. If this option is provided along with
1775 -Wabi (without the version), the version from this option is used
1776 for the warning.
1777
1778 -fno-access-control
1779 Turn off all access checking. This switch is mainly useful for
1780 working around bugs in the access control code.
1781
1782 -faligned-new
1783 Enable support for C++17 "new" of types that require more alignment
1784 than "void* ::operator new(std::size_t)" provides. A numeric
1785 argument such as "-faligned-new=32" can be used to specify how much
1786 alignment (in bytes) is provided by that function, but few users
1787 will need to override the default of "alignof(std::max_align_t)".
1788
1789 This flag is enabled by default for -std=c++17.
1790
1791 -fcheck-new
1792 Check that the pointer returned by "operator new" is non-null
1793 before attempting to modify the storage allocated. This check is
1794 normally unnecessary because the C++ standard specifies that
1795 "operator new" only returns 0 if it is declared "throw()", in which
1796 case the compiler always checks the return value even without this
1797 option. In all other cases, when "operator new" has a non-empty
1798 exception specification, memory exhaustion is signalled by throwing
1799 "std::bad_alloc". See also new (nothrow).
1800
1801 -fconcepts
1802 Enable support for the C++ Extensions for Concepts Technical
1803 Specification, ISO 19217 (2015), which allows code like
1804
1805 template <class T> concept bool Addable = requires (T t) { t + t; };
1806 template <Addable T> T add (T a, T b) { return a + b; }
1807
1808 -fconstexpr-depth=n
1809 Set the maximum nested evaluation depth for C++11 constexpr
1810 functions to n. A limit is needed to detect endless recursion
1811 during constant expression evaluation. The minimum specified by
1812 the standard is 512.
1813
1814 -fconstexpr-loop-limit=n
1815 Set the maximum number of iterations for a loop in C++14 constexpr
1816 functions to n. A limit is needed to detect infinite loops during
1817 constant expression evaluation. The default is 262144 (1<<18).
1818
1819 -fdeduce-init-list
1820 Enable deduction of a template type parameter as
1821 "std::initializer_list" from a brace-enclosed initializer list,
1822 i.e.
1823
1824 template <class T> auto forward(T t) -> decltype (realfn (t))
1825 {
1826 return realfn (t);
1827 }
1828
1829 void f()
1830 {
1831 forward({1,2}); // call forward<std::initializer_list<int>>
1832 }
1833
1834 This deduction was implemented as a possible extension to the
1835 originally proposed semantics for the C++11 standard, but was not
1836 part of the final standard, so it is disabled by default. This
1837 option is deprecated, and may be removed in a future version of
1838 G++.
1839
1840 -ffriend-injection
1841 Inject friend functions into the enclosing namespace, so that they
1842 are visible outside the scope of the class in which they are
1843 declared. Friend functions were documented to work this way in the
1844 old Annotated C++ Reference Manual. However, in ISO C++ a friend
1845 function that is not declared in an enclosing scope can only be
1846 found using argument dependent lookup. GCC defaults to the
1847 standard behavior.
1848
1849 This option is deprecated and will be removed.
1850
1851 -fno-elide-constructors
1852 The C++ standard allows an implementation to omit creating a
1853 temporary that is only used to initialize another object of the
1854 same type. Specifying this option disables that optimization, and
1855 forces G++ to call the copy constructor in all cases. This option
1856 also causes G++ to call trivial member functions which otherwise
1857 would be expanded inline.
1858
1859 In C++17, the compiler is required to omit these temporaries, but
1860 this option still affects trivial member functions.
1861
1862 -fno-enforce-eh-specs
1863 Don't generate code to check for violation of exception
1864 specifications at run time. This option violates the C++ standard,
1865 but may be useful for reducing code size in production builds, much
1866 like defining "NDEBUG". This does not give user code permission to
1867 throw exceptions in violation of the exception specifications; the
1868 compiler still optimizes based on the specifications, so throwing
1869 an unexpected exception results in undefined behavior at run time.
1870
1871 -fextern-tls-init
1872 -fno-extern-tls-init
1873 The C++11 and OpenMP standards allow "thread_local" and
1874 "threadprivate" variables to have dynamic (runtime) initialization.
1875 To support this, any use of such a variable goes through a wrapper
1876 function that performs any necessary initialization. When the use
1877 and definition of the variable are in the same translation unit,
1878 this overhead can be optimized away, but when the use is in a
1879 different translation unit there is significant overhead even if
1880 the variable doesn't actually need dynamic initialization. If the
1881 programmer can be sure that no use of the variable in a non-
1882 defining TU needs to trigger dynamic initialization (either because
1883 the variable is statically initialized, or a use of the variable in
1884 the defining TU will be executed before any uses in another TU),
1885 they can avoid this overhead with the -fno-extern-tls-init option.
1886
1887 On targets that support symbol aliases, the default is
1888 -fextern-tls-init. On targets that do not support symbol aliases,
1889 the default is -fno-extern-tls-init.
1890
1891 -ffor-scope
1892 -fno-for-scope
1893 If -ffor-scope is specified, the scope of variables declared in a
1894 for-init-statement is limited to the "for" loop itself, as
1895 specified by the C++ standard. If -fno-for-scope is specified, the
1896 scope of variables declared in a for-init-statement extends to the
1897 end of the enclosing scope, as was the case in old versions of G++,
1898 and other (traditional) implementations of C++.
1899
1900 This option is deprecated and the associated non-standard
1901 functionality will be removed.
1902
1903 -fno-gnu-keywords
1904 Do not recognize "typeof" as a keyword, so that code can use this
1905 word as an identifier. You can use the keyword "__typeof__"
1906 instead. This option is implied by the strict ISO C++ dialects:
1907 -ansi, -std=c++98, -std=c++11, etc.
1908
1909 -fno-implicit-templates
1910 Never emit code for non-inline templates that are instantiated
1911 implicitly (i.e. by use); only emit code for explicit
1912 instantiations.
1913
1914 -fno-implicit-inline-templates
1915 Don't emit code for implicit instantiations of inline templates,
1916 either. The default is to handle inlines differently so that
1917 compiles with and without optimization need the same set of
1918 explicit instantiations.
1919
1920 -fno-implement-inlines
1921 To save space, do not emit out-of-line copies of inline functions
1922 controlled by "#pragma implementation". This causes linker errors
1923 if these functions are not inlined everywhere they are called.
1924
1925 -fms-extensions
1926 Disable Wpedantic warnings about constructs used in MFC, such as
1927 implicit int and getting a pointer to member function via non-
1928 standard syntax.
1929
1930 -fnew-inheriting-ctors
1931 Enable the P0136 adjustment to the semantics of C++11 constructor
1932 inheritance. This is part of C++17 but also considered to be a
1933 Defect Report against C++11 and C++14. This flag is enabled by
1934 default unless -fabi-version=10 or lower is specified.
1935
1936 -fnew-ttp-matching
1937 Enable the P0522 resolution to Core issue 150, template template
1938 parameters and default arguments: this allows a template with
1939 default template arguments as an argument for a template template
1940 parameter with fewer template parameters. This flag is enabled by
1941 default for -std=c++17.
1942
1943 -fno-nonansi-builtins
1944 Disable built-in declarations of functions that are not mandated by
1945 ANSI/ISO C. These include "ffs", "alloca", "_exit", "index",
1946 "bzero", "conjf", and other related functions.
1947
1948 -fnothrow-opt
1949 Treat a "throw()" exception specification as if it were a
1950 "noexcept" specification to reduce or eliminate the text size
1951 overhead relative to a function with no exception specification.
1952 If the function has local variables of types with non-trivial
1953 destructors, the exception specification actually makes the
1954 function smaller because the EH cleanups for those variables can be
1955 optimized away. The semantic effect is that an exception thrown
1956 out of a function with such an exception specification results in a
1957 call to "terminate" rather than "unexpected".
1958
1959 -fno-operator-names
1960 Do not treat the operator name keywords "and", "bitand", "bitor",
1961 "compl", "not", "or" and "xor" as synonyms as keywords.
1962
1963 -fno-optional-diags
1964 Disable diagnostics that the standard says a compiler does not need
1965 to issue. Currently, the only such diagnostic issued by G++ is the
1966 one for a name having multiple meanings within a class.
1967
1968 -fpermissive
1969 Downgrade some diagnostics about nonconformant code from errors to
1970 warnings. Thus, using -fpermissive allows some nonconforming code
1971 to compile.
1972
1973 -fno-pretty-templates
1974 When an error message refers to a specialization of a function
1975 template, the compiler normally prints the signature of the
1976 template followed by the template arguments and any typedefs or
1977 typenames in the signature (e.g. "void f(T) [with T = int]" rather
1978 than "void f(int)") so that it's clear which template is involved.
1979 When an error message refers to a specialization of a class
1980 template, the compiler omits any template arguments that match the
1981 default template arguments for that template. If either of these
1982 behaviors make it harder to understand the error message rather
1983 than easier, you can use -fno-pretty-templates to disable them.
1984
1985 -frepo
1986 Enable automatic template instantiation at link time. This option
1987 also implies -fno-implicit-templates.
1988
1989 -fno-rtti
1990 Disable generation of information about every class with virtual
1991 functions for use by the C++ run-time type identification features
1992 ("dynamic_cast" and "typeid"). If you don't use those parts of the
1993 language, you can save some space by using this flag. Note that
1994 exception handling uses the same information, but G++ generates it
1995 as needed. The "dynamic_cast" operator can still be used for casts
1996 that do not require run-time type information, i.e. casts to "void
1997 *" or to unambiguous base classes.
1998
1999 -fsized-deallocation
2000 Enable the built-in global declarations
2001
2002 void operator delete (void *, std::size_t) noexcept;
2003 void operator delete[] (void *, std::size_t) noexcept;
2004
2005 as introduced in C++14. This is useful for user-defined
2006 replacement deallocation functions that, for example, use the size
2007 of the object to make deallocation faster. Enabled by default
2008 under -std=c++14 and above. The flag -Wsized-deallocation warns
2009 about places that might want to add a definition.
2010
2011 -fstrict-enums
2012 Allow the compiler to optimize using the assumption that a value of
2013 enumerated type can only be one of the values of the enumeration
2014 (as defined in the C++ standard; basically, a value that can be
2015 represented in the minimum number of bits needed to represent all
2016 the enumerators). This assumption may not be valid if the program
2017 uses a cast to convert an arbitrary integer value to the enumerated
2018 type.
2019
2020 -fstrong-eval-order
2021 Evaluate member access, array subscripting, and shift expressions
2022 in left-to-right order, and evaluate assignment in right-to-left
2023 order, as adopted for C++17. Enabled by default with -std=c++17.
2024 -fstrong-eval-order=some enables just the ordering of member access
2025 and shift expressions, and is the default without -std=c++17.
2026
2027 -ftemplate-backtrace-limit=n
2028 Set the maximum number of template instantiation notes for a single
2029 warning or error to n. The default value is 10.
2030
2031 -ftemplate-depth=n
2032 Set the maximum instantiation depth for template classes to n. A
2033 limit on the template instantiation depth is needed to detect
2034 endless recursions during template class instantiation. ANSI/ISO
2035 C++ conforming programs must not rely on a maximum depth greater
2036 than 17 (changed to 1024 in C++11). The default value is 900, as
2037 the compiler can run out of stack space before hitting 1024 in some
2038 situations.
2039
2040 -fno-threadsafe-statics
2041 Do not emit the extra code to use the routines specified in the C++
2042 ABI for thread-safe initialization of local statics. You can use
2043 this option to reduce code size slightly in code that doesn't need
2044 to be thread-safe.
2045
2046 -fuse-cxa-atexit
2047 Register destructors for objects with static storage duration with
2048 the "__cxa_atexit" function rather than the "atexit" function.
2049 This option is required for fully standards-compliant handling of
2050 static destructors, but only works if your C library supports
2051 "__cxa_atexit".
2052
2053 -fno-use-cxa-get-exception-ptr
2054 Don't use the "__cxa_get_exception_ptr" runtime routine. This
2055 causes "std::uncaught_exception" to be incorrect, but is necessary
2056 if the runtime routine is not available.
2057
2058 -fvisibility-inlines-hidden
2059 This switch declares that the user does not attempt to compare
2060 pointers to inline functions or methods where the addresses of the
2061 two functions are taken in different shared objects.
2062
2063 The effect of this is that GCC may, effectively, mark inline
2064 methods with "__attribute__ ((visibility ("hidden")))" so that they
2065 do not appear in the export table of a DSO and do not require a PLT
2066 indirection when used within the DSO. Enabling this option can
2067 have a dramatic effect on load and link times of a DSO as it
2068 massively reduces the size of the dynamic export table when the
2069 library makes heavy use of templates.
2070
2071 The behavior of this switch is not quite the same as marking the
2072 methods as hidden directly, because it does not affect static
2073 variables local to the function or cause the compiler to deduce
2074 that the function is defined in only one shared object.
2075
2076 You may mark a method as having a visibility explicitly to negate
2077 the effect of the switch for that method. For example, if you do
2078 want to compare pointers to a particular inline method, you might
2079 mark it as having default visibility. Marking the enclosing class
2080 with explicit visibility has no effect.
2081
2082 Explicitly instantiated inline methods are unaffected by this
2083 option as their linkage might otherwise cross a shared library
2084 boundary.
2085
2086 -fvisibility-ms-compat
2087 This flag attempts to use visibility settings to make GCC's C++
2088 linkage model compatible with that of Microsoft Visual Studio.
2089
2090 The flag makes these changes to GCC's linkage model:
2091
2092 1. It sets the default visibility to "hidden", like
2093 -fvisibility=hidden.
2094
2095 2. Types, but not their members, are not hidden by default.
2096
2097 3. The One Definition Rule is relaxed for types without explicit
2098 visibility specifications that are defined in more than one
2099 shared object: those declarations are permitted if they are
2100 permitted when this option is not used.
2101
2102 In new code it is better to use -fvisibility=hidden and export
2103 those classes that are intended to be externally visible.
2104 Unfortunately it is possible for code to rely, perhaps
2105 accidentally, on the Visual Studio behavior.
2106
2107 Among the consequences of these changes are that static data
2108 members of the same type with the same name but defined in
2109 different shared objects are different, so changing one does not
2110 change the other; and that pointers to function members defined in
2111 different shared objects may not compare equal. When this flag is
2112 given, it is a violation of the ODR to define types with the same
2113 name differently.
2114
2115 -fno-weak
2116 Do not use weak symbol support, even if it is provided by the
2117 linker. By default, G++ uses weak symbols if they are available.
2118 This option exists only for testing, and should not be used by end-
2119 users; it results in inferior code and has no benefits. This
2120 option may be removed in a future release of G++.
2121
2122 -nostdinc++
2123 Do not search for header files in the standard directories specific
2124 to C++, but do still search the other standard directories. (This
2125 option is used when building the C++ library.)
2126
2127 In addition, these optimization, warning, and code generation options
2128 have meanings only for C++ programs:
2129
2130 -Wabi (C, Objective-C, C++ and Objective-C++ only)
2131 Warn when G++ it generates code that is probably not compatible
2132 with the vendor-neutral C++ ABI. Since G++ now defaults to
2133 updating the ABI with each major release, normally -Wabi will warn
2134 only if there is a check added later in a release series for an ABI
2135 issue discovered since the initial release. -Wabi will warn about
2136 more things if an older ABI version is selected (with
2137 -fabi-version=n).
2138
2139 -Wabi can also be used with an explicit version number to warn
2140 about compatibility with a particular -fabi-version level, e.g.
2141 -Wabi=2 to warn about changes relative to -fabi-version=2.
2142
2143 If an explicit version number is provided and -fabi-compat-version
2144 is not specified, the version number from this option is used for
2145 compatibility aliases. If no explicit version number is provided
2146 with this option, but -fabi-compat-version is specified, that
2147 version number is used for ABI warnings.
2148
2149 Although an effort has been made to warn about all such cases,
2150 there are probably some cases that are not warned about, even
2151 though G++ is generating incompatible code. There may also be
2152 cases where warnings are emitted even though the code that is
2153 generated is compatible.
2154
2155 You should rewrite your code to avoid these warnings if you are
2156 concerned about the fact that code generated by G++ may not be
2157 binary compatible with code generated by other compilers.
2158
2159 Known incompatibilities in -fabi-version=2 (which was the default
2160 from GCC 3.4 to 4.9) include:
2161
2162 * A template with a non-type template parameter of reference type
2163 was mangled incorrectly:
2164
2165 extern int N;
2166 template <int &> struct S {};
2167 void n (S<N>) {2}
2168
2169 This was fixed in -fabi-version=3.
2170
2171 * SIMD vector types declared using "__attribute ((vector_size))"
2172 were mangled in a non-standard way that does not allow for
2173 overloading of functions taking vectors of different sizes.
2174
2175 The mangling was changed in -fabi-version=4.
2176
2177 * "__attribute ((const))" and "noreturn" were mangled as type
2178 qualifiers, and "decltype" of a plain declaration was folded
2179 away.
2180
2181 These mangling issues were fixed in -fabi-version=5.
2182
2183 * Scoped enumerators passed as arguments to a variadic function
2184 are promoted like unscoped enumerators, causing "va_arg" to
2185 complain. On most targets this does not actually affect the
2186 parameter passing ABI, as there is no way to pass an argument
2187 smaller than "int".
2188
2189 Also, the ABI changed the mangling of template argument packs,
2190 "const_cast", "static_cast", prefix increment/decrement, and a
2191 class scope function used as a template argument.
2192
2193 These issues were corrected in -fabi-version=6.
2194
2195 * Lambdas in default argument scope were mangled incorrectly, and
2196 the ABI changed the mangling of "nullptr_t".
2197
2198 These issues were corrected in -fabi-version=7.
2199
2200 * When mangling a function type with function-cv-qualifiers, the
2201 un-qualified function type was incorrectly treated as a
2202 substitution candidate.
2203
2204 This was fixed in -fabi-version=8, the default for GCC 5.1.
2205
2206 * "decltype(nullptr)" incorrectly had an alignment of 1, leading
2207 to unaligned accesses. Note that this did not affect the ABI
2208 of a function with a "nullptr_t" parameter, as parameters have
2209 a minimum alignment.
2210
2211 This was fixed in -fabi-version=9, the default for GCC 5.2.
2212
2213 * Target-specific attributes that affect the identity of a type,
2214 such as ia32 calling conventions on a function type (stdcall,
2215 regparm, etc.), did not affect the mangled name, leading to
2216 name collisions when function pointers were used as template
2217 arguments.
2218
2219 This was fixed in -fabi-version=10, the default for GCC 6.1.
2220
2221 It also warns about psABI-related changes. The known psABI changes
2222 at this point include:
2223
2224 * For SysV/x86-64, unions with "long double" members are passed
2225 in memory as specified in psABI. For example:
2226
2227 union U {
2228 long double ld;
2229 int i;
2230 };
2231
2232 "union U" is always passed in memory.
2233
2234 -Wabi-tag (C++ and Objective-C++ only)
2235 Warn when a type with an ABI tag is used in a context that does not
2236 have that ABI tag. See C++ Attributes for more information about
2237 ABI tags.
2238
2239 -Wctor-dtor-privacy (C++ and Objective-C++ only)
2240 Warn when a class seems unusable because all the constructors or
2241 destructors in that class are private, and it has neither friends
2242 nor public static member functions. Also warn if there are no non-
2243 private methods, and there's at least one private member function
2244 that isn't a constructor or destructor.
2245
2246 -Wdelete-non-virtual-dtor (C++ and Objective-C++ only)
2247 Warn when "delete" is used to destroy an instance of a class that
2248 has virtual functions and non-virtual destructor. It is unsafe to
2249 delete an instance of a derived class through a pointer to a base
2250 class if the base class does not have a virtual destructor. This
2251 warning is enabled by -Wall.
2252
2253 -Wliteral-suffix (C++ and Objective-C++ only)
2254 Warn when a string or character literal is followed by a ud-suffix
2255 which does not begin with an underscore. As a conforming
2256 extension, GCC treats such suffixes as separate preprocessing
2257 tokens in order to maintain backwards compatibility with code that
2258 uses formatting macros from "<inttypes.h>". For example:
2259
2260 #define __STDC_FORMAT_MACROS
2261 #include <inttypes.h>
2262 #include <stdio.h>
2263
2264 int main() {
2265 int64_t i64 = 123;
2266 printf("My int64: %" PRId64"\n", i64);
2267 }
2268
2269 In this case, "PRId64" is treated as a separate preprocessing
2270 token.
2271
2272 Additionally, warn when a user-defined literal operator is declared
2273 with a literal suffix identifier that doesn't begin with an
2274 underscore. Literal suffix identifiers that don't begin with an
2275 underscore are reserved for future standardization.
2276
2277 This warning is enabled by default.
2278
2279 -Wlto-type-mismatch
2280 During the link-time optimization warn about type mismatches in
2281 global declarations from different compilation units. Requires
2282 -flto to be enabled. Enabled by default.
2283
2284 -Wno-narrowing (C++ and Objective-C++ only)
2285 For C++11 and later standards, narrowing conversions are diagnosed
2286 by default, as required by the standard. A narrowing conversion
2287 from a constant produces an error, and a narrowing conversion from
2288 a non-constant produces a warning, but -Wno-narrowing suppresses
2289 the diagnostic. Note that this does not affect the meaning of
2290 well-formed code; narrowing conversions are still considered ill-
2291 formed in SFINAE contexts.
2292
2293 With -Wnarrowing in C++98, warn when a narrowing conversion
2294 prohibited by C++11 occurs within { }, e.g.
2295
2296 int i = { 2.2 }; // error: narrowing from double to int
2297
2298 This flag is included in -Wall and -Wc++11-compat.
2299
2300 -Wnoexcept (C++ and Objective-C++ only)
2301 Warn when a noexcept-expression evaluates to false because of a
2302 call to a function that does not have a non-throwing exception
2303 specification (i.e. "throw()" or "noexcept") but is known by the
2304 compiler to never throw an exception.
2305
2306 -Wnoexcept-type (C++ and Objective-C++ only)
2307 Warn if the C++17 feature making "noexcept" part of a function type
2308 changes the mangled name of a symbol relative to C++14. Enabled by
2309 -Wabi and -Wc++17-compat.
2310
2311 As an example:
2312
2313 template <class T> void f(T t) { t(); };
2314 void g() noexcept;
2315 void h() { f(g); }
2316
2317 In C++14, "f" calls calls "f<void(*)()>", but in C++17 it calls
2318 "f<void(*)()noexcept>".
2319
2320 -Wclass-memaccess (C++ and Objective-C++ only)
2321 Warn when the destination of a call to a raw memory function such
2322 as "memset" or "memcpy" is an object of class type, and when
2323 writing into such an object might bypass the class non-trivial or
2324 deleted constructor or copy assignment, violate const-correctness
2325 or encapsulation, or corrupt virtual table pointers. Modifying the
2326 representation of such objects may violate invariants maintained by
2327 member functions of the class. For example, the call to "memset"
2328 below is undefined because it modifies a non-trivial class object
2329 and is, therefore, diagnosed. The safe way to either initialize or
2330 clear the storage of objects of such types is by using the
2331 appropriate constructor or assignment operator, if one is
2332 available.
2333
2334 std::string str = "abc";
2335 memset (&str, 0, sizeof str);
2336
2337 The -Wclass-memaccess option is enabled by -Wall. Explicitly
2338 casting the pointer to the class object to "void *" or to a type
2339 that can be safely accessed by the raw memory function suppresses
2340 the warning.
2341
2342 -Wnon-virtual-dtor (C++ and Objective-C++ only)
2343 Warn when a class has virtual functions and an accessible non-
2344 virtual destructor itself or in an accessible polymorphic base
2345 class, in which case it is possible but unsafe to delete an
2346 instance of a derived class through a pointer to the class itself
2347 or base class. This warning is automatically enabled if -Weffc++
2348 is specified.
2349
2350 -Wregister (C++ and Objective-C++ only)
2351 Warn on uses of the "register" storage class specifier, except when
2352 it is part of the GNU Explicit Register Variables extension. The
2353 use of the "register" keyword as storage class specifier has been
2354 deprecated in C++11 and removed in C++17. Enabled by default with
2355 -std=c++17.
2356
2357 -Wreorder (C++ and Objective-C++ only)
2358 Warn when the order of member initializers given in the code does
2359 not match the order in which they must be executed. For instance:
2360
2361 struct A {
2362 int i;
2363 int j;
2364 A(): j (0), i (1) { }
2365 };
2366
2367 The compiler rearranges the member initializers for "i" and "j" to
2368 match the declaration order of the members, emitting a warning to
2369 that effect. This warning is enabled by -Wall.
2370
2371 -fext-numeric-literals (C++ and Objective-C++ only)
2372 Accept imaginary, fixed-point, or machine-defined literal number
2373 suffixes as GNU extensions. When this option is turned off these
2374 suffixes are treated as C++11 user-defined literal numeric
2375 suffixes. This is on by default for all pre-C++11 dialects and all
2376 GNU dialects: -std=c++98, -std=gnu++98, -std=gnu++11, -std=gnu++14.
2377 This option is off by default for ISO C++11 onwards (-std=c++11,
2378 ...).
2379
2380 The following -W... options are not affected by -Wall.
2381
2382 -Weffc++ (C++ and Objective-C++ only)
2383 Warn about violations of the following style guidelines from Scott
2384 Meyers' Effective C++ series of books:
2385
2386 * Define a copy constructor and an assignment operator for
2387 classes with dynamically-allocated memory.
2388
2389 * Prefer initialization to assignment in constructors.
2390
2391 * Have "operator=" return a reference to *this.
2392
2393 * Don't try to return a reference when you must return an object.
2394
2395 * Distinguish between prefix and postfix forms of increment and
2396 decrement operators.
2397
2398 * Never overload "&&", "||", or ",".
2399
2400 This option also enables -Wnon-virtual-dtor, which is also one of
2401 the effective C++ recommendations. However, the check is extended
2402 to warn about the lack of virtual destructor in accessible non-
2403 polymorphic bases classes too.
2404
2405 When selecting this option, be aware that the standard library
2406 headers do not obey all of these guidelines; use grep -v to filter
2407 out those warnings.
2408
2409 -Wstrict-null-sentinel (C++ and Objective-C++ only)
2410 Warn about the use of an uncasted "NULL" as sentinel. When
2411 compiling only with GCC this is a valid sentinel, as "NULL" is
2412 defined to "__null". Although it is a null pointer constant rather
2413 than a null pointer, it is guaranteed to be of the same size as a
2414 pointer. But this use is not portable across different compilers.
2415
2416 -Wno-non-template-friend (C++ and Objective-C++ only)
2417 Disable warnings when non-template friend functions are declared
2418 within a template. In very old versions of GCC that predate
2419 implementation of the ISO standard, declarations such as friend int
2420 foo(int), where the name of the friend is an unqualified-id, could
2421 be interpreted as a particular specialization of a template
2422 function; the warning exists to diagnose compatibility problems,
2423 and is enabled by default.
2424
2425 -Wold-style-cast (C++ and Objective-C++ only)
2426 Warn if an old-style (C-style) cast to a non-void type is used
2427 within a C++ program. The new-style casts ("dynamic_cast",
2428 "static_cast", "reinterpret_cast", and "const_cast") are less
2429 vulnerable to unintended effects and much easier to search for.
2430
2431 -Woverloaded-virtual (C++ and Objective-C++ only)
2432 Warn when a function declaration hides virtual functions from a
2433 base class. For example, in:
2434
2435 struct A {
2436 virtual void f();
2437 };
2438
2439 struct B: public A {
2440 void f(int);
2441 };
2442
2443 the "A" class version of "f" is hidden in "B", and code like:
2444
2445 B* b;
2446 b->f();
2447
2448 fails to compile.
2449
2450 -Wno-pmf-conversions (C++ and Objective-C++ only)
2451 Disable the diagnostic for converting a bound pointer to member
2452 function to a plain pointer.
2453
2454 -Wsign-promo (C++ and Objective-C++ only)
2455 Warn when overload resolution chooses a promotion from unsigned or
2456 enumerated type to a signed type, over a conversion to an unsigned
2457 type of the same size. Previous versions of G++ tried to preserve
2458 unsignedness, but the standard mandates the current behavior.
2459
2460 -Wtemplates (C++ and Objective-C++ only)
2461 Warn when a primary template declaration is encountered. Some
2462 coding rules disallow templates, and this may be used to enforce
2463 that rule. The warning is inactive inside a system header file,
2464 such as the STL, so one can still use the STL. One may also
2465 instantiate or specialize templates.
2466
2467 -Wmultiple-inheritance (C++ and Objective-C++ only)
2468 Warn when a class is defined with multiple direct base classes.
2469 Some coding rules disallow multiple inheritance, and this may be
2470 used to enforce that rule. The warning is inactive inside a system
2471 header file, such as the STL, so one can still use the STL. One
2472 may also define classes that indirectly use multiple inheritance.
2473
2474 -Wvirtual-inheritance
2475 Warn when a class is defined with a virtual direct base class.
2476 Some coding rules disallow multiple inheritance, and this may be
2477 used to enforce that rule. The warning is inactive inside a system
2478 header file, such as the STL, so one can still use the STL. One
2479 may also define classes that indirectly use virtual inheritance.
2480
2481 -Wnamespaces
2482 Warn when a namespace definition is opened. Some coding rules
2483 disallow namespaces, and this may be used to enforce that rule.
2484 The warning is inactive inside a system header file, such as the
2485 STL, so one can still use the STL. One may also use using
2486 directives and qualified names.
2487
2488 -Wno-terminate (C++ and Objective-C++ only)
2489 Disable the warning about a throw-expression that will immediately
2490 result in a call to "terminate".
2491
2492 Options Controlling Objective-C and Objective-C++ Dialects
2493 (NOTE: This manual does not describe the Objective-C and Objective-C++
2494 languages themselves.
2495
2496 This section describes the command-line options that are only
2497 meaningful for Objective-C and Objective-C++ programs. You can also
2498 use most of the language-independent GNU compiler options. For
2499 example, you might compile a file some_class.m like this:
2500
2501 gcc -g -fgnu-runtime -O -c some_class.m
2502
2503 In this example, -fgnu-runtime is an option meant only for Objective-C
2504 and Objective-C++ programs; you can use the other options with any
2505 language supported by GCC.
2506
2507 Note that since Objective-C is an extension of the C language,
2508 Objective-C compilations may also use options specific to the C front-
2509 end (e.g., -Wtraditional). Similarly, Objective-C++ compilations may
2510 use C++-specific options (e.g., -Wabi).
2511
2512 Here is a list of options that are only for compiling Objective-C and
2513 Objective-C++ programs:
2514
2515 -fconstant-string-class=class-name
2516 Use class-name as the name of the class to instantiate for each
2517 literal string specified with the syntax "@"..."". The default
2518 class name is "NXConstantString" if the GNU runtime is being used,
2519 and "NSConstantString" if the NeXT runtime is being used (see
2520 below). The -fconstant-cfstrings option, if also present,
2521 overrides the -fconstant-string-class setting and cause "@"...""
2522 literals to be laid out as constant CoreFoundation strings.
2523
2524 -fgnu-runtime
2525 Generate object code compatible with the standard GNU Objective-C
2526 runtime. This is the default for most types of systems.
2527
2528 -fnext-runtime
2529 Generate output compatible with the NeXT runtime. This is the
2530 default for NeXT-based systems, including Darwin and Mac OS X. The
2531 macro "__NEXT_RUNTIME__" is predefined if (and only if) this option
2532 is used.
2533
2534 -fno-nil-receivers
2535 Assume that all Objective-C message dispatches ("[receiver
2536 message:arg]") in this translation unit ensure that the receiver is
2537 not "nil". This allows for more efficient entry points in the
2538 runtime to be used. This option is only available in conjunction
2539 with the NeXT runtime and ABI version 0 or 1.
2540
2541 -fobjc-abi-version=n
2542 Use version n of the Objective-C ABI for the selected runtime.
2543 This option is currently supported only for the NeXT runtime. In
2544 that case, Version 0 is the traditional (32-bit) ABI without
2545 support for properties and other Objective-C 2.0 additions.
2546 Version 1 is the traditional (32-bit) ABI with support for
2547 properties and other Objective-C 2.0 additions. Version 2 is the
2548 modern (64-bit) ABI. If nothing is specified, the default is
2549 Version 0 on 32-bit target machines, and Version 2 on 64-bit target
2550 machines.
2551
2552 -fobjc-call-cxx-cdtors
2553 For each Objective-C class, check if any of its instance variables
2554 is a C++ object with a non-trivial default constructor. If so,
2555 synthesize a special "- (id) .cxx_construct" instance method which
2556 runs non-trivial default constructors on any such instance
2557 variables, in order, and then return "self". Similarly, check if
2558 any instance variable is a C++ object with a non-trivial
2559 destructor, and if so, synthesize a special "- (void)
2560 .cxx_destruct" method which runs all such default destructors, in
2561 reverse order.
2562
2563 The "- (id) .cxx_construct" and "- (void) .cxx_destruct" methods
2564 thusly generated only operate on instance variables declared in the
2565 current Objective-C class, and not those inherited from
2566 superclasses. It is the responsibility of the Objective-C runtime
2567 to invoke all such methods in an object's inheritance hierarchy.
2568 The "- (id) .cxx_construct" methods are invoked by the runtime
2569 immediately after a new object instance is allocated; the "- (void)
2570 .cxx_destruct" methods are invoked immediately before the runtime
2571 deallocates an object instance.
2572
2573 As of this writing, only the NeXT runtime on Mac OS X 10.4 and
2574 later has support for invoking the "- (id) .cxx_construct" and "-
2575 (void) .cxx_destruct" methods.
2576
2577 -fobjc-direct-dispatch
2578 Allow fast jumps to the message dispatcher. On Darwin this is
2579 accomplished via the comm page.
2580
2581 -fobjc-exceptions
2582 Enable syntactic support for structured exception handling in
2583 Objective-C, similar to what is offered by C++. This option is
2584 required to use the Objective-C keywords @try, @throw, @catch,
2585 @finally and @synchronized. This option is available with both the
2586 GNU runtime and the NeXT runtime (but not available in conjunction
2587 with the NeXT runtime on Mac OS X 10.2 and earlier).
2588
2589 -fobjc-gc
2590 Enable garbage collection (GC) in Objective-C and Objective-C++
2591 programs. This option is only available with the NeXT runtime; the
2592 GNU runtime has a different garbage collection implementation that
2593 does not require special compiler flags.
2594
2595 -fobjc-nilcheck
2596 For the NeXT runtime with version 2 of the ABI, check for a nil
2597 receiver in method invocations before doing the actual method call.
2598 This is the default and can be disabled using -fno-objc-nilcheck.
2599 Class methods and super calls are never checked for nil in this way
2600 no matter what this flag is set to. Currently this flag does
2601 nothing when the GNU runtime, or an older version of the NeXT
2602 runtime ABI, is used.
2603
2604 -fobjc-std=objc1
2605 Conform to the language syntax of Objective-C 1.0, the language
2606 recognized by GCC 4.0. This only affects the Objective-C additions
2607 to the C/C++ language; it does not affect conformance to C/C++
2608 standards, which is controlled by the separate C/C++ dialect option
2609 flags. When this option is used with the Objective-C or
2610 Objective-C++ compiler, any Objective-C syntax that is not
2611 recognized by GCC 4.0 is rejected. This is useful if you need to
2612 make sure that your Objective-C code can be compiled with older
2613 versions of GCC.
2614
2615 -freplace-objc-classes
2616 Emit a special marker instructing ld(1) not to statically link in
2617 the resulting object file, and allow dyld(1) to load it in at run
2618 time instead. This is used in conjunction with the Fix-and-
2619 Continue debugging mode, where the object file in question may be
2620 recompiled and dynamically reloaded in the course of program
2621 execution, without the need to restart the program itself.
2622 Currently, Fix-and-Continue functionality is only available in
2623 conjunction with the NeXT runtime on Mac OS X 10.3 and later.
2624
2625 -fzero-link
2626 When compiling for the NeXT runtime, the compiler ordinarily
2627 replaces calls to "objc_getClass("...")" (when the name of the
2628 class is known at compile time) with static class references that
2629 get initialized at load time, which improves run-time performance.
2630 Specifying the -fzero-link flag suppresses this behavior and causes
2631 calls to "objc_getClass("...")" to be retained. This is useful in
2632 Zero-Link debugging mode, since it allows for individual class
2633 implementations to be modified during program execution. The GNU
2634 runtime currently always retains calls to "objc_get_class("...")"
2635 regardless of command-line options.
2636
2637 -fno-local-ivars
2638 By default instance variables in Objective-C can be accessed as if
2639 they were local variables from within the methods of the class
2640 they're declared in. This can lead to shadowing between instance
2641 variables and other variables declared either locally inside a
2642 class method or globally with the same name. Specifying the
2643 -fno-local-ivars flag disables this behavior thus avoiding variable
2644 shadowing issues.
2645
2646 -fivar-visibility=[public|protected|private|package]
2647 Set the default instance variable visibility to the specified
2648 option so that instance variables declared outside the scope of any
2649 access modifier directives default to the specified visibility.
2650
2651 -gen-decls
2652 Dump interface declarations for all classes seen in the source file
2653 to a file named sourcename.decl.
2654
2655 -Wassign-intercept (Objective-C and Objective-C++ only)
2656 Warn whenever an Objective-C assignment is being intercepted by the
2657 garbage collector.
2658
2659 -Wno-protocol (Objective-C and Objective-C++ only)
2660 If a class is declared to implement a protocol, a warning is issued
2661 for every method in the protocol that is not implemented by the
2662 class. The default behavior is to issue a warning for every method
2663 not explicitly implemented in the class, even if a method
2664 implementation is inherited from the superclass. If you use the
2665 -Wno-protocol option, then methods inherited from the superclass
2666 are considered to be implemented, and no warning is issued for
2667 them.
2668
2669 -Wselector (Objective-C and Objective-C++ only)
2670 Warn if multiple methods of different types for the same selector
2671 are found during compilation. The check is performed on the list
2672 of methods in the final stage of compilation. Additionally, a
2673 check is performed for each selector appearing in a
2674 "@selector(...)" expression, and a corresponding method for that
2675 selector has been found during compilation. Because these checks
2676 scan the method table only at the end of compilation, these
2677 warnings are not produced if the final stage of compilation is not
2678 reached, for example because an error is found during compilation,
2679 or because the -fsyntax-only option is being used.
2680
2681 -Wstrict-selector-match (Objective-C and Objective-C++ only)
2682 Warn if multiple methods with differing argument and/or return
2683 types are found for a given selector when attempting to send a
2684 message using this selector to a receiver of type "id" or "Class".
2685 When this flag is off (which is the default behavior), the compiler
2686 omits such warnings if any differences found are confined to types
2687 that share the same size and alignment.
2688
2689 -Wundeclared-selector (Objective-C and Objective-C++ only)
2690 Warn if a "@selector(...)" expression referring to an undeclared
2691 selector is found. A selector is considered undeclared if no
2692 method with that name has been declared before the "@selector(...)"
2693 expression, either explicitly in an @interface or @protocol
2694 declaration, or implicitly in an @implementation section. This
2695 option always performs its checks as soon as a "@selector(...)"
2696 expression is found, while -Wselector only performs its checks in
2697 the final stage of compilation. This also enforces the coding
2698 style convention that methods and selectors must be declared before
2699 being used.
2700
2701 -print-objc-runtime-info
2702 Generate C header describing the largest structure that is passed
2703 by value, if any.
2704
2705 Options to Control Diagnostic Messages Formatting
2706 Traditionally, diagnostic messages have been formatted irrespective of
2707 the output device's aspect (e.g. its width, ...). You can use the
2708 options described below to control the formatting algorithm for
2709 diagnostic messages, e.g. how many characters per line, how often
2710 source location information should be reported. Note that some
2711 language front ends may not honor these options.
2712
2713 -fmessage-length=n
2714 Try to format error messages so that they fit on lines of about n
2715 characters. If n is zero, then no line-wrapping is done; each
2716 error message appears on a single line. This is the default for
2717 all front ends.
2718
2719 -fdiagnostics-show-location=once
2720 Only meaningful in line-wrapping mode. Instructs the diagnostic
2721 messages reporter to emit source location information once; that
2722 is, in case the message is too long to fit on a single physical
2723 line and has to be wrapped, the source location won't be emitted
2724 (as prefix) again, over and over, in subsequent continuation lines.
2725 This is the default behavior.
2726
2727 -fdiagnostics-show-location=every-line
2728 Only meaningful in line-wrapping mode. Instructs the diagnostic
2729 messages reporter to emit the same source location information (as
2730 prefix) for physical lines that result from the process of breaking
2731 a message which is too long to fit on a single line.
2732
2733 -fdiagnostics-color[=WHEN]
2734 -fno-diagnostics-color
2735 Use color in diagnostics. WHEN is never, always, or auto. The
2736 default depends on how the compiler has been configured, it can be
2737 any of the above WHEN options or also never if GCC_COLORS
2738 environment variable isn't present in the environment, and auto
2739 otherwise. auto means to use color only when the standard error is
2740 a terminal. The forms -fdiagnostics-color and
2741 -fno-diagnostics-color are aliases for -fdiagnostics-color=always
2742 and -fdiagnostics-color=never, respectively.
2743
2744 The colors are defined by the environment variable GCC_COLORS. Its
2745 value is a colon-separated list of capabilities and Select Graphic
2746 Rendition (SGR) substrings. SGR commands are interpreted by the
2747 terminal or terminal emulator. (See the section in the
2748 documentation of your text terminal for permitted values and their
2749 meanings as character attributes.) These substring values are
2750 integers in decimal representation and can be concatenated with
2751 semicolons. Common values to concatenate include 1 for bold, 4 for
2752 underline, 5 for blink, 7 for inverse, 39 for default foreground
2753 color, 30 to 37 for foreground colors, 90 to 97 for 16-color mode
2754 foreground colors, 38;5;0 to 38;5;255 for 88-color and 256-color
2755 modes foreground colors, 49 for default background color, 40 to 47
2756 for background colors, 100 to 107 for 16-color mode background
2757 colors, and 48;5;0 to 48;5;255 for 88-color and 256-color modes
2758 background colors.
2759
2760 The default GCC_COLORS is
2761
2762 error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:\
2763 quote=01:fixit-insert=32:fixit-delete=31:\
2764 diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32:\
2765 type-diff=01;32
2766
2767 where 01;31 is bold red, 01;35 is bold magenta, 01;36 is bold cyan,
2768 32 is green, 34 is blue, 01 is bold, and 31 is red. Setting
2769 GCC_COLORS to the empty string disables colors. Supported
2770 capabilities are as follows.
2771
2772 "error="
2773 SGR substring for error: markers.
2774
2775 "warning="
2776 SGR substring for warning: markers.
2777
2778 "note="
2779 SGR substring for note: markers.
2780
2781 "range1="
2782 SGR substring for first additional range.
2783
2784 "range2="
2785 SGR substring for second additional range.
2786
2787 "locus="
2788 SGR substring for location information, file:line or
2789 file:line:column etc.
2790
2791 "quote="
2792 SGR substring for information printed within quotes.
2793
2794 "fixit-insert="
2795 SGR substring for fix-it hints suggesting text to be inserted
2796 or replaced.
2797
2798 "fixit-delete="
2799 SGR substring for fix-it hints suggesting text to be deleted.
2800
2801 "diff-filename="
2802 SGR substring for filename headers within generated patches.
2803
2804 "diff-hunk="
2805 SGR substring for the starts of hunks within generated patches.
2806
2807 "diff-delete="
2808 SGR substring for deleted lines within generated patches.
2809
2810 "diff-insert="
2811 SGR substring for inserted lines within generated patches.
2812
2813 "type-diff="
2814 SGR substring for highlighting mismatching types within
2815 template arguments in the C++ frontend.
2816
2817 -fno-diagnostics-show-option
2818 By default, each diagnostic emitted includes text indicating the
2819 command-line option that directly controls the diagnostic (if such
2820 an option is known to the diagnostic machinery). Specifying the
2821 -fno-diagnostics-show-option flag suppresses that behavior.
2822
2823 -fno-diagnostics-show-caret
2824 By default, each diagnostic emitted includes the original source
2825 line and a caret ^ indicating the column. This option suppresses
2826 this information. The source line is truncated to n characters, if
2827 the -fmessage-length=n option is given. When the output is done to
2828 the terminal, the width is limited to the width given by the
2829 COLUMNS environment variable or, if not set, to the terminal width.
2830
2831 -fdiagnostics-parseable-fixits
2832 Emit fix-it hints in a machine-parseable format, suitable for
2833 consumption by IDEs. For each fix-it, a line will be printed after
2834 the relevant diagnostic, starting with the string "fix-it:". For
2835 example:
2836
2837 fix-it:"test.c":{45:3-45:21}:"gtk_widget_show_all"
2838
2839 The location is expressed as a half-open range, expressed as a
2840 count of bytes, starting at byte 1 for the initial column. In the
2841 above example, bytes 3 through 20 of line 45 of "test.c" are to be
2842 replaced with the given string:
2843
2844 00000000011111111112222222222
2845 12345678901234567890123456789
2846 gtk_widget_showall (dlg);
2847 ^^^^^^^^^^^^^^^^^^
2848 gtk_widget_show_all
2849
2850 The filename and replacement string escape backslash as "\\", tab
2851 as "\t", newline as "\n", double quotes as "\"", non-printable
2852 characters as octal (e.g. vertical tab as "\013").
2853
2854 An empty replacement string indicates that the given range is to be
2855 removed. An empty range (e.g. "45:3-45:3") indicates that the
2856 string is to be inserted at the given position.
2857
2858 -fdiagnostics-generate-patch
2859 Print fix-it hints to stderr in unified diff format, after any
2860 diagnostics are printed. For example:
2861
2862 --- test.c
2863 +++ test.c
2864 @ -42,5 +42,5 @
2865
2866 void show_cb(GtkDialog *dlg)
2867 {
2868 - gtk_widget_showall(dlg);
2869 + gtk_widget_show_all(dlg);
2870 }
2871
2872 The diff may or may not be colorized, following the same rules as
2873 for diagnostics (see -fdiagnostics-color).
2874
2875 -fdiagnostics-show-template-tree
2876 In the C++ frontend, when printing diagnostics showing mismatching
2877 template types, such as:
2878
2879 could not convert 'std::map<int, std::vector<double> >()'
2880 from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
2881
2882 the -fdiagnostics-show-template-tree flag enables printing a tree-
2883 like structure showing the common and differing parts of the types,
2884 such as:
2885
2886 map<
2887 [...],
2888 vector<
2889 [double != float]>>
2890
2891 The parts that differ are highlighted with color ("double" and
2892 "float" in this case).
2893
2894 -fno-elide-type
2895 By default when the C++ frontend prints diagnostics showing
2896 mismatching template types, common parts of the types are printed
2897 as "[...]" to simplify the error message. For example:
2898
2899 could not convert 'std::map<int, std::vector<double> >()'
2900 from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
2901
2902 Specifying the -fno-elide-type flag suppresses that behavior. This
2903 flag also affects the output of the
2904 -fdiagnostics-show-template-tree flag.
2905
2906 -fno-show-column
2907 Do not print column numbers in diagnostics. This may be necessary
2908 if diagnostics are being scanned by a program that does not
2909 understand the column numbers, such as dejagnu.
2910
2911 Options to Request or Suppress Warnings
2912 Warnings are diagnostic messages that report constructions that are not
2913 inherently erroneous but that are risky or suggest there may have been
2914 an error.
2915
2916 The following language-independent options do not enable specific
2917 warnings but control the kinds of diagnostics produced by GCC.
2918
2919 -fsyntax-only
2920 Check the code for syntax errors, but don't do anything beyond
2921 that.
2922
2923 -fmax-errors=n
2924 Limits the maximum number of error messages to n, at which point
2925 GCC bails out rather than attempting to continue processing the
2926 source code. If n is 0 (the default), there is no limit on the
2927 number of error messages produced. If -Wfatal-errors is also
2928 specified, then -Wfatal-errors takes precedence over this option.
2929
2930 -w Inhibit all warning messages.
2931
2932 -Werror
2933 Make all warnings into errors.
2934
2935 -Werror=
2936 Make the specified warning into an error. The specifier for a
2937 warning is appended; for example -Werror=switch turns the warnings
2938 controlled by -Wswitch into errors. This switch takes a negative
2939 form, to be used to negate -Werror for specific warnings; for
2940 example -Wno-error=switch makes -Wswitch warnings not be errors,
2941 even when -Werror is in effect.
2942
2943 The warning message for each controllable warning includes the
2944 option that controls the warning. That option can then be used
2945 with -Werror= and -Wno-error= as described above. (Printing of the
2946 option in the warning message can be disabled using the
2947 -fno-diagnostics-show-option flag.)
2948
2949 Note that specifying -Werror=foo automatically implies -Wfoo.
2950 However, -Wno-error=foo does not imply anything.
2951
2952 -Wfatal-errors
2953 This option causes the compiler to abort compilation on the first
2954 error occurred rather than trying to keep going and printing
2955 further error messages.
2956
2957 You can request many specific warnings with options beginning with -W,
2958 for example -Wimplicit to request warnings on implicit declarations.
2959 Each of these specific warning options also has a negative form
2960 beginning -Wno- to turn off warnings; for example, -Wno-implicit. This
2961 manual lists only one of the two forms, whichever is not the default.
2962 For further language-specific options also refer to C++ Dialect Options
2963 and Objective-C and Objective-C++ Dialect Options.
2964
2965 Some options, such as -Wall and -Wextra, turn on other options, such as
2966 -Wunused, which may turn on further options, such as -Wunused-value.
2967 The combined effect of positive and negative forms is that more
2968 specific options have priority over less specific ones, independently
2969 of their position in the command-line. For options of the same
2970 specificity, the last one takes effect. Options enabled or disabled via
2971 pragmas take effect as if they appeared at the end of the command-line.
2972
2973 When an unrecognized warning option is requested (e.g.,
2974 -Wunknown-warning), GCC emits a diagnostic stating that the option is
2975 not recognized. However, if the -Wno- form is used, the behavior is
2976 slightly different: no diagnostic is produced for -Wno-unknown-warning
2977 unless other diagnostics are being produced. This allows the use of
2978 new -Wno- options with old compilers, but if something goes wrong, the
2979 compiler warns that an unrecognized option is present.
2980
2981 -Wpedantic
2982 -pedantic
2983 Issue all the warnings demanded by strict ISO C and ISO C++; reject
2984 all programs that use forbidden extensions, and some other programs
2985 that do not follow ISO C and ISO C++. For ISO C, follows the
2986 version of the ISO C standard specified by any -std option used.
2987
2988 Valid ISO C and ISO C++ programs should compile properly with or
2989 without this option (though a rare few require -ansi or a -std
2990 option specifying the required version of ISO C). However, without
2991 this option, certain GNU extensions and traditional C and C++
2992 features are supported as well. With this option, they are
2993 rejected.
2994
2995 -Wpedantic does not cause warning messages for use of the alternate
2996 keywords whose names begin and end with __. Pedantic warnings are
2997 also disabled in the expression that follows "__extension__".
2998 However, only system header files should use these escape routes;
2999 application programs should avoid them.
3000
3001 Some users try to use -Wpedantic to check programs for strict ISO C
3002 conformance. They soon find that it does not do quite what they
3003 want: it finds some non-ISO practices, but not all---only those for
3004 which ISO C requires a diagnostic, and some others for which
3005 diagnostics have been added.
3006
3007 A feature to report any failure to conform to ISO C might be useful
3008 in some instances, but would require considerable additional work
3009 and would be quite different from -Wpedantic. We don't have plans
3010 to support such a feature in the near future.
3011
3012 Where the standard specified with -std represents a GNU extended
3013 dialect of C, such as gnu90 or gnu99, there is a corresponding base
3014 standard, the version of ISO C on which the GNU extended dialect is
3015 based. Warnings from -Wpedantic are given where they are required
3016 by the base standard. (It does not make sense for such warnings to
3017 be given only for features not in the specified GNU C dialect,
3018 since by definition the GNU dialects of C include all features the
3019 compiler supports with the given option, and there would be nothing
3020 to warn about.)
3021
3022 -pedantic-errors
3023 Give an error whenever the base standard (see -Wpedantic) requires
3024 a diagnostic, in some cases where there is undefined behavior at
3025 compile-time and in some other cases that do not prevent
3026 compilation of programs that are valid according to the standard.
3027 This is not equivalent to -Werror=pedantic, since there are errors
3028 enabled by this option and not enabled by the latter and vice
3029 versa.
3030
3031 -Wall
3032 This enables all the warnings about constructions that some users
3033 consider questionable, and that are easy to avoid (or modify to
3034 prevent the warning), even in conjunction with macros. This also
3035 enables some language-specific warnings described in C++ Dialect
3036 Options and Objective-C and Objective-C++ Dialect Options.
3037
3038 -Wall turns on the following warning flags:
3039
3040 -Waddress -Warray-bounds=1 (only with -O2) -Wbool-compare
3041 -Wbool-operation -Wc++11-compat -Wc++14-compat -Wcatch-value (C++
3042 and Objective-C++ only) -Wchar-subscripts -Wcomment
3043 -Wduplicate-decl-specifier (C and Objective-C only) -Wenum-compare
3044 (in C/ObjC; this is on by default in C++) -Wformat
3045 -Wint-in-bool-context -Wimplicit (C and Objective-C only)
3046 -Wimplicit-int (C and Objective-C only)
3047 -Wimplicit-function-declaration (C and Objective-C only)
3048 -Winit-self (only for C++) -Wlogical-not-parentheses -Wmain (only
3049 for C/ObjC and unless -ffreestanding) -Wmaybe-uninitialized
3050 -Wmemset-elt-size -Wmemset-transposed-args -Wmisleading-indentation
3051 (only for C/C++) -Wmissing-attributes -Wmissing-braces (only for
3052 C/ObjC) -Wmultistatement-macros -Wnarrowing (only for C++)
3053 -Wnonnull -Wnonnull-compare -Wopenmp-simd -Wparentheses
3054 -Wpointer-sign -Wreorder -Wrestrict -Wreturn-type -Wsequence-point
3055 -Wsign-compare (only in C++) -Wsizeof-pointer-div
3056 -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-overflow=1
3057 -Wswitch -Wtautological-compare -Wtrigraphs -Wuninitialized
3058 -Wunknown-pragmas -Wunused-function -Wunused-label -Wunused-value
3059 -Wunused-variable -Wvolatile-register-var
3060
3061 Note that some warning flags are not implied by -Wall. Some of
3062 them warn about constructions that users generally do not consider
3063 questionable, but which occasionally you might wish to check for;
3064 others warn about constructions that are necessary or hard to avoid
3065 in some cases, and there is no simple way to modify the code to
3066 suppress the warning. Some of them are enabled by -Wextra but many
3067 of them must be enabled individually.
3068
3069 -Wextra
3070 This enables some extra warning flags that are not enabled by
3071 -Wall. (This option used to be called -W. The older name is still
3072 supported, but the newer name is more descriptive.)
3073
3074 -Wclobbered -Wcast-function-type -Wempty-body -Wignored-qualifiers
3075 -Wimplicit-fallthrough=3 -Wmissing-field-initializers
3076 -Wmissing-parameter-type (C only) -Wold-style-declaration (C only)
3077 -Woverride-init -Wsign-compare (C only) -Wtype-limits
3078 -Wuninitialized -Wshift-negative-value (in C++03 and in C99 and
3079 newer) -Wunused-parameter (only with -Wunused or -Wall)
3080 -Wunused-but-set-parameter (only with -Wunused or -Wall)
3081
3082 The option -Wextra also prints warning messages for the following
3083 cases:
3084
3085 * A pointer is compared against integer zero with "<", "<=", ">",
3086 or ">=".
3087
3088 * (C++ only) An enumerator and a non-enumerator both appear in a
3089 conditional expression.
3090
3091 * (C++ only) Ambiguous virtual bases.
3092
3093 * (C++ only) Subscripting an array that has been declared
3094 "register".
3095
3096 * (C++ only) Taking the address of a variable that has been
3097 declared "register".
3098
3099 * (C++ only) A base class is not initialized in the copy
3100 constructor of a derived class.
3101
3102 -Wchar-subscripts
3103 Warn if an array subscript has type "char". This is a common cause
3104 of error, as programmers often forget that this type is signed on
3105 some machines. This warning is enabled by -Wall.
3106
3107 -Wchkp
3108 Warn about an invalid memory access that is found by Pointer Bounds
3109 Checker (-fcheck-pointer-bounds).
3110
3111 -Wno-coverage-mismatch
3112 Warn if feedback profiles do not match when using the -fprofile-use
3113 option. If a source file is changed between compiling with
3114 -fprofile-gen and with -fprofile-use, the files with the profile
3115 feedback can fail to match the source file and GCC cannot use the
3116 profile feedback information. By default, this warning is enabled
3117 and is treated as an error. -Wno-coverage-mismatch can be used to
3118 disable the warning or -Wno-error=coverage-mismatch can be used to
3119 disable the error. Disabling the error for this warning can result
3120 in poorly optimized code and is useful only in the case of very
3121 minor changes such as bug fixes to an existing code-base.
3122 Completely disabling the warning is not recommended.
3123
3124 -Wno-cpp
3125 (C, Objective-C, C++, Objective-C++ and Fortran only)
3126
3127 Suppress warning messages emitted by "#warning" directives.
3128
3129 -Wdouble-promotion (C, C++, Objective-C and Objective-C++ only)
3130 Give a warning when a value of type "float" is implicitly promoted
3131 to "double". CPUs with a 32-bit "single-precision" floating-point
3132 unit implement "float" in hardware, but emulate "double" in
3133 software. On such a machine, doing computations using "double"
3134 values is much more expensive because of the overhead required for
3135 software emulation.
3136
3137 It is easy to accidentally do computations with "double" because
3138 floating-point literals are implicitly of type "double". For
3139 example, in:
3140
3141 float area(float radius)
3142 {
3143 return 3.14159 * radius * radius;
3144 }
3145
3146 the compiler performs the entire computation with "double" because
3147 the floating-point literal is a "double".
3148
3149 -Wduplicate-decl-specifier (C and Objective-C only)
3150 Warn if a declaration has duplicate "const", "volatile", "restrict"
3151 or "_Atomic" specifier. This warning is enabled by -Wall.
3152
3153 -Wformat
3154 -Wformat=n
3155 Check calls to "printf" and "scanf", etc., to make sure that the
3156 arguments supplied have types appropriate to the format string
3157 specified, and that the conversions specified in the format string
3158 make sense. This includes standard functions, and others specified
3159 by format attributes, in the "printf", "scanf", "strftime" and
3160 "strfmon" (an X/Open extension, not in the C standard) families (or
3161 other target-specific families). Which functions are checked
3162 without format attributes having been specified depends on the
3163 standard version selected, and such checks of functions without the
3164 attribute specified are disabled by -ffreestanding or -fno-builtin.
3165
3166 The formats are checked against the format features supported by
3167 GNU libc version 2.2. These include all ISO C90 and C99 features,
3168 as well as features from the Single Unix Specification and some BSD
3169 and GNU extensions. Other library implementations may not support
3170 all these features; GCC does not support warning about features
3171 that go beyond a particular library's limitations. However, if
3172 -Wpedantic is used with -Wformat, warnings are given about format
3173 features not in the selected standard version (but not for
3174 "strfmon" formats, since those are not in any version of the C
3175 standard).
3176
3177 -Wformat=1
3178 -Wformat
3179 Option -Wformat is equivalent to -Wformat=1, and -Wno-format is
3180 equivalent to -Wformat=0. Since -Wformat also checks for null
3181 format arguments for several functions, -Wformat also implies
3182 -Wnonnull. Some aspects of this level of format checking can
3183 be disabled by the options: -Wno-format-contains-nul,
3184 -Wno-format-extra-args, and -Wno-format-zero-length. -Wformat
3185 is enabled by -Wall.
3186
3187 -Wno-format-contains-nul
3188 If -Wformat is specified, do not warn about format strings that
3189 contain NUL bytes.
3190
3191 -Wno-format-extra-args
3192 If -Wformat is specified, do not warn about excess arguments to
3193 a "printf" or "scanf" format function. The C standard
3194 specifies that such arguments are ignored.
3195
3196 Where the unused arguments lie between used arguments that are
3197 specified with $ operand number specifications, normally
3198 warnings are still given, since the implementation could not
3199 know what type to pass to "va_arg" to skip the unused
3200 arguments. However, in the case of "scanf" formats, this
3201 option suppresses the warning if the unused arguments are all
3202 pointers, since the Single Unix Specification says that such
3203 unused arguments are allowed.
3204
3205 -Wformat-overflow
3206 -Wformat-overflow=level
3207 Warn about calls to formatted input/output functions such as
3208 "sprintf" and "vsprintf" that might overflow the destination
3209 buffer. When the exact number of bytes written by a format
3210 directive cannot be determined at compile-time it is estimated
3211 based on heuristics that depend on the level argument and on
3212 optimization. While enabling optimization will in most cases
3213 improve the accuracy of the warning, it may also result in
3214 false positives.
3215
3216 -Wformat-overflow
3217 -Wformat-overflow=1
3218 Level 1 of -Wformat-overflow enabled by -Wformat employs a
3219 conservative approach that warns only about calls that most
3220 likely overflow the buffer. At this level, numeric
3221 arguments to format directives with unknown values are
3222 assumed to have the value of one, and strings of unknown
3223 length to be empty. Numeric arguments that are known to be
3224 bounded to a subrange of their type, or string arguments
3225 whose output is bounded either by their directive's
3226 precision or by a finite set of string literals, are
3227 assumed to take on the value within the range that results
3228 in the most bytes on output. For example, the call to
3229 "sprintf" below is diagnosed because even with both a and b
3230 equal to zero, the terminating NUL character ('\0')
3231 appended by the function to the destination buffer will be
3232 written past its end. Increasing the size of the buffer by
3233 a single byte is sufficient to avoid the warning, though it
3234 may not be sufficient to avoid the overflow.
3235
3236 void f (int a, int b)
3237 {
3238 char buf [13];
3239 sprintf (buf, "a = %i, b = %i\n", a, b);
3240 }
3241
3242 -Wformat-overflow=2
3243 Level 2 warns also about calls that might overflow the
3244 destination buffer given an argument of sufficient length
3245 or magnitude. At level 2, unknown numeric arguments are
3246 assumed to have the minimum representable value for signed
3247 types with a precision greater than 1, and the maximum
3248 representable value otherwise. Unknown string arguments
3249 whose length cannot be assumed to be bounded either by the
3250 directive's precision, or by a finite set of string
3251 literals they may evaluate to, or the character array they
3252 may point to, are assumed to be 1 character long.
3253
3254 At level 2, the call in the example above is again
3255 diagnosed, but this time because with a equal to a 32-bit
3256 "INT_MIN" the first %i directive will write some of its
3257 digits beyond the end of the destination buffer. To make
3258 the call safe regardless of the values of the two
3259 variables, the size of the destination buffer must be
3260 increased to at least 34 bytes. GCC includes the minimum
3261 size of the buffer in an informational note following the
3262 warning.
3263
3264 An alternative to increasing the size of the destination
3265 buffer is to constrain the range of formatted values. The
3266 maximum length of string arguments can be bounded by
3267 specifying the precision in the format directive. When
3268 numeric arguments of format directives can be assumed to be
3269 bounded by less than the precision of their type, choosing
3270 an appropriate length modifier to the format specifier will
3271 reduce the required buffer size. For example, if a and b
3272 in the example above can be assumed to be within the
3273 precision of the "short int" type then using either the %hi
3274 format directive or casting the argument to "short" reduces
3275 the maximum required size of the buffer to 24 bytes.
3276
3277 void f (int a, int b)
3278 {
3279 char buf [23];
3280 sprintf (buf, "a = %hi, b = %i\n", a, (short)b);
3281 }
3282
3283 -Wno-format-zero-length
3284 If -Wformat is specified, do not warn about zero-length
3285 formats. The C standard specifies that zero-length formats are
3286 allowed.
3287
3288 -Wformat=2
3289 Enable -Wformat plus additional format checks. Currently
3290 equivalent to -Wformat -Wformat-nonliteral -Wformat-security
3291 -Wformat-y2k.
3292
3293 -Wformat-nonliteral
3294 If -Wformat is specified, also warn if the format string is not
3295 a string literal and so cannot be checked, unless the format
3296 function takes its format arguments as a "va_list".
3297
3298 -Wformat-security
3299 If -Wformat is specified, also warn about uses of format
3300 functions that represent possible security problems. At
3301 present, this warns about calls to "printf" and "scanf"
3302 functions where the format string is not a string literal and
3303 there are no format arguments, as in "printf (foo);". This may
3304 be a security hole if the format string came from untrusted
3305 input and contains %n. (This is currently a subset of what
3306 -Wformat-nonliteral warns about, but in future warnings may be
3307 added to -Wformat-security that are not included in
3308 -Wformat-nonliteral.)
3309
3310 -Wformat-signedness
3311 If -Wformat is specified, also warn if the format string
3312 requires an unsigned argument and the argument is signed and
3313 vice versa.
3314
3315 -Wformat-truncation
3316 -Wformat-truncation=level
3317 Warn about calls to formatted input/output functions such as
3318 "snprintf" and "vsnprintf" that might result in output
3319 truncation. When the exact number of bytes written by a format
3320 directive cannot be determined at compile-time it is estimated
3321 based on heuristics that depend on the level argument and on
3322 optimization. While enabling optimization will in most cases
3323 improve the accuracy of the warning, it may also result in
3324 false positives. Except as noted otherwise, the option uses
3325 the same logic -Wformat-overflow.
3326
3327 -Wformat-truncation
3328 -Wformat-truncation=1
3329 Level 1 of -Wformat-truncation enabled by -Wformat employs
3330 a conservative approach that warns only about calls to
3331 bounded functions whose return value is unused and that
3332 will most likely result in output truncation.
3333
3334 -Wformat-truncation=2
3335 Level 2 warns also about calls to bounded functions whose
3336 return value is used and that might result in truncation
3337 given an argument of sufficient length or magnitude.
3338
3339 -Wformat-y2k
3340 If -Wformat is specified, also warn about "strftime" formats
3341 that may yield only a two-digit year.
3342
3343 -Wnonnull
3344 Warn about passing a null pointer for arguments marked as requiring
3345 a non-null value by the "nonnull" function attribute.
3346
3347 -Wnonnull is included in -Wall and -Wformat. It can be disabled
3348 with the -Wno-nonnull option.
3349
3350 -Wnonnull-compare
3351 Warn when comparing an argument marked with the "nonnull" function
3352 attribute against null inside the function.
3353
3354 -Wnonnull-compare is included in -Wall. It can be disabled with
3355 the -Wno-nonnull-compare option.
3356
3357 -Wnull-dereference
3358 Warn if the compiler detects paths that trigger erroneous or
3359 undefined behavior due to dereferencing a null pointer. This
3360 option is only active when -fdelete-null-pointer-checks is active,
3361 which is enabled by optimizations in most targets. The precision
3362 of the warnings depends on the optimization options used.
3363
3364 -Winit-self (C, C++, Objective-C and Objective-C++ only)
3365 Warn about uninitialized variables that are initialized with
3366 themselves. Note this option can only be used with the
3367 -Wuninitialized option.
3368
3369 For example, GCC warns about "i" being uninitialized in the
3370 following snippet only when -Winit-self has been specified:
3371
3372 int f()
3373 {
3374 int i = i;
3375 return i;
3376 }
3377
3378 This warning is enabled by -Wall in C++.
3379
3380 -Wimplicit-int (C and Objective-C only)
3381 Warn when a declaration does not specify a type. This warning is
3382 enabled by -Wall.
3383
3384 -Wimplicit-function-declaration (C and Objective-C only)
3385 Give a warning whenever a function is used before being declared.
3386 In C99 mode (-std=c99 or -std=gnu99), this warning is enabled by
3387 default and it is made into an error by -pedantic-errors. This
3388 warning is also enabled by -Wall.
3389
3390 -Wimplicit (C and Objective-C only)
3391 Same as -Wimplicit-int and -Wimplicit-function-declaration. This
3392 warning is enabled by -Wall.
3393
3394 -Wimplicit-fallthrough
3395 -Wimplicit-fallthrough is the same as -Wimplicit-fallthrough=3 and
3396 -Wno-implicit-fallthrough is the same as -Wimplicit-fallthrough=0.
3397
3398 -Wimplicit-fallthrough=n
3399 Warn when a switch case falls through. For example:
3400
3401 switch (cond)
3402 {
3403 case 1:
3404 a = 1;
3405 break;
3406 case 2:
3407 a = 2;
3408 case 3:
3409 a = 3;
3410 break;
3411 }
3412
3413 This warning does not warn when the last statement of a case cannot
3414 fall through, e.g. when there is a return statement or a call to
3415 function declared with the noreturn attribute.
3416 -Wimplicit-fallthrough= also takes into account control flow
3417 statements, such as ifs, and only warns when appropriate. E.g.
3418
3419 switch (cond)
3420 {
3421 case 1:
3422 if (i > 3) {
3423 bar (5);
3424 break;
3425 } else if (i < 1) {
3426 bar (0);
3427 } else
3428 return;
3429 default:
3430 ...
3431 }
3432
3433 Since there are occasions where a switch case fall through is
3434 desirable, GCC provides an attribute, "__attribute__
3435 ((fallthrough))", that is to be used along with a null statement to
3436 suppress this warning that would normally occur:
3437
3438 switch (cond)
3439 {
3440 case 1:
3441 bar (0);
3442 __attribute__ ((fallthrough));
3443 default:
3444 ...
3445 }
3446
3447 C++17 provides a standard way to suppress the
3448 -Wimplicit-fallthrough warning using "[[fallthrough]];" instead of
3449 the GNU attribute. In C++11 or C++14 users can use
3450 "[[gnu::fallthrough]];", which is a GNU extension. Instead of
3451 these attributes, it is also possible to add a fallthrough comment
3452 to silence the warning. The whole body of the C or C++ style
3453 comment should match the given regular expressions listed below.
3454 The option argument n specifies what kind of comments are accepted:
3455
3456 *<-Wimplicit-fallthrough=0 disables the warning altogether.>
3457 *<-Wimplicit-fallthrough=1 matches ".*" regular>
3458 expression, any comment is used as fallthrough comment.
3459
3460 *<-Wimplicit-fallthrough=2 case insensitively matches>
3461 ".*falls?[ \t-]*thr(ough|u).*" regular expression.
3462
3463 *<-Wimplicit-fallthrough=3 case sensitively matches one of the>
3464 following regular expressions:
3465
3466 *<"-fallthrough">
3467 *<"@fallthrough@">
3468 *<"lint -fallthrough[ \t]*">
3469 *<"[ \t.!]*(ELSE,? |INTENTIONAL(LY)? )?FALL(S |
3470 |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?">
3471 *<"[ \t.!]*(Else,? |Intentional(ly)? )?Fall((s |
3472 |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?">
3473 *<"[ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?fall(s |
3474 |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?">
3475 *<-Wimplicit-fallthrough=4 case sensitively matches one of the>
3476 following regular expressions:
3477
3478 *<"-fallthrough">
3479 *<"@fallthrough@">
3480 *<"lint -fallthrough[ \t]*">
3481 *<"[ \t]*FALLTHR(OUGH|U)[ \t]*">
3482 *<-Wimplicit-fallthrough=5 doesn't recognize any comments as>
3483 fallthrough comments, only attributes disable the warning.
3484
3485 The comment needs to be followed after optional whitespace and
3486 other comments by "case" or "default" keywords or by a user label
3487 that precedes some "case" or "default" label.
3488
3489 switch (cond)
3490 {
3491 case 1:
3492 bar (0);
3493 /* FALLTHRU */
3494 default:
3495 ...
3496 }
3497
3498 The -Wimplicit-fallthrough=3 warning is enabled by -Wextra.
3499
3500 -Wif-not-aligned (C, C++, Objective-C and Objective-C++ only)
3501 Control if warning triggered by the "warn_if_not_aligned" attribute
3502 should be issued. This is is enabled by default. Use
3503 -Wno-if-not-aligned to disable it.
3504
3505 -Wignored-qualifiers (C and C++ only)
3506 Warn if the return type of a function has a type qualifier such as
3507 "const". For ISO C such a type qualifier has no effect, since the
3508 value returned by a function is not an lvalue. For C++, the
3509 warning is only emitted for scalar types or "void". ISO C
3510 prohibits qualified "void" return types on function definitions, so
3511 such return types always receive a warning even without this
3512 option.
3513
3514 This warning is also enabled by -Wextra.
3515
3516 -Wignored-attributes (C and C++ only)
3517 Warn when an attribute is ignored. This is different from the
3518 -Wattributes option in that it warns whenever the compiler decides
3519 to drop an attribute, not that the attribute is either unknown,
3520 used in a wrong place, etc. This warning is enabled by default.
3521
3522 -Wmain
3523 Warn if the type of "main" is suspicious. "main" should be a
3524 function with external linkage, returning int, taking either zero
3525 arguments, two, or three arguments of appropriate types. This
3526 warning is enabled by default in C++ and is enabled by either -Wall
3527 or -Wpedantic.
3528
3529 -Wmisleading-indentation (C and C++ only)
3530 Warn when the indentation of the code does not reflect the block
3531 structure. Specifically, a warning is issued for "if", "else",
3532 "while", and "for" clauses with a guarded statement that does not
3533 use braces, followed by an unguarded statement with the same
3534 indentation.
3535
3536 In the following example, the call to "bar" is misleadingly
3537 indented as if it were guarded by the "if" conditional.
3538
3539 if (some_condition ())
3540 foo ();
3541 bar (); /* Gotcha: this is not guarded by the "if". */
3542
3543 In the case of mixed tabs and spaces, the warning uses the
3544 -ftabstop= option to determine if the statements line up
3545 (defaulting to 8).
3546
3547 The warning is not issued for code involving multiline preprocessor
3548 logic such as the following example.
3549
3550 if (flagA)
3551 foo (0);
3552 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
3553 if (flagB)
3554 #endif
3555 foo (1);
3556
3557 The warning is not issued after a "#line" directive, since this
3558 typically indicates autogenerated code, and no assumptions can be
3559 made about the layout of the file that the directive references.
3560
3561 This warning is enabled by -Wall in C and C++.
3562
3563 -Wmissing-attributes
3564 Warn when a declaration of a function is missing one or more
3565 attributes that a related function is declared with and whose
3566 absence may adversely affect the correctness or efficiency of
3567 generated code. For example, in C++, the warning is issued when an
3568 explicit specialization of a primary template declared with
3569 attribute "alloc_align", "alloc_size", "assume_aligned", "format",
3570 "format_arg", "malloc", or "nonnull" is declared without it.
3571 Attributes "deprecated", "error", and "warning" suppress the
3572 warning..
3573
3574 -Wmissing-attributes is enabled by -Wall.
3575
3576 For example, since the declaration of the primary function template
3577 below makes use of both attribute "malloc" and "alloc_size" the
3578 declaration of the explicit specialization of the template is
3579 diagnosed because it is missing one of the attributes.
3580
3581 template <class T>
3582 T* __attribute__ ((malloc, alloc_size (1)))
3583 allocate (size_t);
3584
3585 template <>
3586 void* __attribute__ ((malloc)) // missing alloc_size
3587 allocate<void> (size_t);
3588
3589 -Wmissing-braces
3590 Warn if an aggregate or union initializer is not fully bracketed.
3591 In the following example, the initializer for "a" is not fully
3592 bracketed, but that for "b" is fully bracketed. This warning is
3593 enabled by -Wall in C.
3594
3595 int a[2][2] = { 0, 1, 2, 3 };
3596 int b[2][2] = { { 0, 1 }, { 2, 3 } };
3597
3598 This warning is enabled by -Wall.
3599
3600 -Wmissing-include-dirs (C, C++, Objective-C and Objective-C++ only)
3601 Warn if a user-supplied include directory does not exist.
3602
3603 -Wmultistatement-macros
3604 Warn about unsafe multiple statement macros that appear to be
3605 guarded by a clause such as "if", "else", "for", "switch", or
3606 "while", in which only the first statement is actually guarded
3607 after the macro is expanded.
3608
3609 For example:
3610
3611 #define DOIT x++; y++
3612 if (c)
3613 DOIT;
3614
3615 will increment "y" unconditionally, not just when "c" holds. The
3616 can usually be fixed by wrapping the macro in a do-while loop:
3617
3618 #define DOIT do { x++; y++; } while (0)
3619 if (c)
3620 DOIT;
3621
3622 This warning is enabled by -Wall in C and C++.
3623
3624 -Wparentheses
3625 Warn if parentheses are omitted in certain contexts, such as when
3626 there is an assignment in a context where a truth value is
3627 expected, or when operators are nested whose precedence people
3628 often get confused about.
3629
3630 Also warn if a comparison like "x<=y<=z" appears; this is
3631 equivalent to "(x<=y ? 1 : 0) <= z", which is a different
3632 interpretation from that of ordinary mathematical notation.
3633
3634 Also warn for dangerous uses of the GNU extension to "?:" with
3635 omitted middle operand. When the condition in the "?": operator is
3636 a boolean expression, the omitted value is always 1. Often
3637 programmers expect it to be a value computed inside the conditional
3638 expression instead.
3639
3640 For C++ this also warns for some cases of unnecessary parentheses
3641 in declarations, which can indicate an attempt at a function call
3642 instead of a declaration:
3643
3644 {
3645 // Declares a local variable called mymutex.
3646 std::unique_lock<std::mutex> (mymutex);
3647 // User meant std::unique_lock<std::mutex> lock (mymutex);
3648 }
3649
3650 This warning is enabled by -Wall.
3651
3652 -Wsequence-point
3653 Warn about code that may have undefined semantics because of
3654 violations of sequence point rules in the C and C++ standards.
3655
3656 The C and C++ standards define the order in which expressions in a
3657 C/C++ program are evaluated in terms of sequence points, which
3658 represent a partial ordering between the execution of parts of the
3659 program: those executed before the sequence point, and those
3660 executed after it. These occur after the evaluation of a full
3661 expression (one which is not part of a larger expression), after
3662 the evaluation of the first operand of a "&&", "||", "? :" or ","
3663 (comma) operator, before a function is called (but after the
3664 evaluation of its arguments and the expression denoting the called
3665 function), and in certain other places. Other than as expressed by
3666 the sequence point rules, the order of evaluation of subexpressions
3667 of an expression is not specified. All these rules describe only a
3668 partial order rather than a total order, since, for example, if two
3669 functions are called within one expression with no sequence point
3670 between them, the order in which the functions are called is not
3671 specified. However, the standards committee have ruled that
3672 function calls do not overlap.
3673
3674 It is not specified when between sequence points modifications to
3675 the values of objects take effect. Programs whose behavior depends
3676 on this have undefined behavior; the C and C++ standards specify
3677 that "Between the previous and next sequence point an object shall
3678 have its stored value modified at most once by the evaluation of an
3679 expression. Furthermore, the prior value shall be read only to
3680 determine the value to be stored.". If a program breaks these
3681 rules, the results on any particular implementation are entirely
3682 unpredictable.
3683
3684 Examples of code with undefined behavior are "a = a++;", "a[n] =
3685 b[n++]" and "a[i++] = i;". Some more complicated cases are not
3686 diagnosed by this option, and it may give an occasional false
3687 positive result, but in general it has been found fairly effective
3688 at detecting this sort of problem in programs.
3689
3690 The C++17 standard will define the order of evaluation of operands
3691 in more cases: in particular it requires that the right-hand side
3692 of an assignment be evaluated before the left-hand side, so the
3693 above examples are no longer undefined. But this warning will
3694 still warn about them, to help people avoid writing code that is
3695 undefined in C and earlier revisions of C++.
3696
3697 The standard is worded confusingly, therefore there is some debate
3698 over the precise meaning of the sequence point rules in subtle
3699 cases. Links to discussions of the problem, including proposed
3700 formal definitions, may be found on the GCC readings page, at
3701 <http://gcc.gnu.org/readings.html>.
3702
3703 This warning is enabled by -Wall for C and C++.
3704
3705 -Wno-return-local-addr
3706 Do not warn about returning a pointer (or in C++, a reference) to a
3707 variable that goes out of scope after the function returns.
3708
3709 -Wreturn-type
3710 Warn whenever a function is defined with a return type that
3711 defaults to "int". Also warn about any "return" statement with no
3712 return value in a function whose return type is not "void" (falling
3713 off the end of the function body is considered returning without a
3714 value).
3715
3716 For C only, warn about a "return" statement with an expression in a
3717 function whose return type is "void", unless the expression type is
3718 also "void". As a GNU extension, the latter case is accepted
3719 without a warning unless -Wpedantic is used.
3720
3721 For C++, a function without return type always produces a
3722 diagnostic message, even when -Wno-return-type is specified. The
3723 only exceptions are "main" and functions defined in system headers.
3724
3725 This warning is enabled by default for C++ and is enabled by -Wall.
3726
3727 -Wshift-count-negative
3728 Warn if shift count is negative. This warning is enabled by
3729 default.
3730
3731 -Wshift-count-overflow
3732 Warn if shift count >= width of type. This warning is enabled by
3733 default.
3734
3735 -Wshift-negative-value
3736 Warn if left shifting a negative value. This warning is enabled by
3737 -Wextra in C99 and C++11 modes (and newer).
3738
3739 -Wshift-overflow
3740 -Wshift-overflow=n
3741 Warn about left shift overflows. This warning is enabled by
3742 default in C99 and C++11 modes (and newer).
3743
3744 -Wshift-overflow=1
3745 This is the warning level of -Wshift-overflow and is enabled by
3746 default in C99 and C++11 modes (and newer). This warning level
3747 does not warn about left-shifting 1 into the sign bit.
3748 (However, in C, such an overflow is still rejected in contexts
3749 where an integer constant expression is required.)
3750
3751 -Wshift-overflow=2
3752 This warning level also warns about left-shifting 1 into the
3753 sign bit, unless C++14 mode is active.
3754
3755 -Wswitch
3756 Warn whenever a "switch" statement has an index of enumerated type
3757 and lacks a "case" for one or more of the named codes of that
3758 enumeration. (The presence of a "default" label prevents this
3759 warning.) "case" labels outside the enumeration range also provoke
3760 warnings when this option is used (even if there is a "default"
3761 label). This warning is enabled by -Wall.
3762
3763 -Wswitch-default
3764 Warn whenever a "switch" statement does not have a "default" case.
3765
3766 -Wswitch-enum
3767 Warn whenever a "switch" statement has an index of enumerated type
3768 and lacks a "case" for one or more of the named codes of that
3769 enumeration. "case" labels outside the enumeration range also
3770 provoke warnings when this option is used. The only difference
3771 between -Wswitch and this option is that this option gives a
3772 warning about an omitted enumeration code even if there is a
3773 "default" label.
3774
3775 -Wswitch-bool
3776 Warn whenever a "switch" statement has an index of boolean type and
3777 the case values are outside the range of a boolean type. It is
3778 possible to suppress this warning by casting the controlling
3779 expression to a type other than "bool". For example:
3780
3781 switch ((int) (a == 4))
3782 {
3783 ...
3784 }
3785
3786 This warning is enabled by default for C and C++ programs.
3787
3788 -Wswitch-unreachable
3789 Warn whenever a "switch" statement contains statements between the
3790 controlling expression and the first case label, which will never
3791 be executed. For example:
3792
3793 switch (cond)
3794 {
3795 i = 15;
3796 ...
3797 case 5:
3798 ...
3799 }
3800
3801 -Wswitch-unreachable does not warn if the statement between the
3802 controlling expression and the first case label is just a
3803 declaration:
3804
3805 switch (cond)
3806 {
3807 int i;
3808 ...
3809 case 5:
3810 i = 5;
3811 ...
3812 }
3813
3814 This warning is enabled by default for C and C++ programs.
3815
3816 -Wsync-nand (C and C++ only)
3817 Warn when "__sync_fetch_and_nand" and "__sync_nand_and_fetch"
3818 built-in functions are used. These functions changed semantics in
3819 GCC 4.4.
3820
3821 -Wunused-but-set-parameter
3822 Warn whenever a function parameter is assigned to, but otherwise
3823 unused (aside from its declaration).
3824
3825 To suppress this warning use the "unused" attribute.
3826
3827 This warning is also enabled by -Wunused together with -Wextra.
3828
3829 -Wunused-but-set-variable
3830 Warn whenever a local variable is assigned to, but otherwise unused
3831 (aside from its declaration). This warning is enabled by -Wall.
3832
3833 To suppress this warning use the "unused" attribute.
3834
3835 This warning is also enabled by -Wunused, which is enabled by
3836 -Wall.
3837
3838 -Wunused-function
3839 Warn whenever a static function is declared but not defined or a
3840 non-inline static function is unused. This warning is enabled by
3841 -Wall.
3842
3843 -Wunused-label
3844 Warn whenever a label is declared but not used. This warning is
3845 enabled by -Wall.
3846
3847 To suppress this warning use the "unused" attribute.
3848
3849 -Wunused-local-typedefs (C, Objective-C, C++ and Objective-C++ only)
3850 Warn when a typedef locally defined in a function is not used.
3851 This warning is enabled by -Wall.
3852
3853 -Wunused-parameter
3854 Warn whenever a function parameter is unused aside from its
3855 declaration.
3856
3857 To suppress this warning use the "unused" attribute.
3858
3859 -Wno-unused-result
3860 Do not warn if a caller of a function marked with attribute
3861 "warn_unused_result" does not use its return value. The default is
3862 -Wunused-result.
3863
3864 -Wunused-variable
3865 Warn whenever a local or static variable is unused aside from its
3866 declaration. This option implies -Wunused-const-variable=1 for C,
3867 but not for C++. This warning is enabled by -Wall.
3868
3869 To suppress this warning use the "unused" attribute.
3870
3871 -Wunused-const-variable
3872 -Wunused-const-variable=n
3873 Warn whenever a constant static variable is unused aside from its
3874 declaration. -Wunused-const-variable=1 is enabled by
3875 -Wunused-variable for C, but not for C++. In C this declares
3876 variable storage, but in C++ this is not an error since const
3877 variables take the place of "#define"s.
3878
3879 To suppress this warning use the "unused" attribute.
3880
3881 -Wunused-const-variable=1
3882 This is the warning level that is enabled by -Wunused-variable
3883 for C. It warns only about unused static const variables
3884 defined in the main compilation unit, but not about static
3885 const variables declared in any header included.
3886
3887 -Wunused-const-variable=2
3888 This warning level also warns for unused constant static
3889 variables in headers (excluding system headers). This is the
3890 warning level of -Wunused-const-variable and must be explicitly
3891 requested since in C++ this isn't an error and in C it might be
3892 harder to clean up all headers included.
3893
3894 -Wunused-value
3895 Warn whenever a statement computes a result that is explicitly not
3896 used. To suppress this warning cast the unused expression to
3897 "void". This includes an expression-statement or the left-hand side
3898 of a comma expression that contains no side effects. For example,
3899 an expression such as "x[i,j]" causes a warning, while
3900 "x[(void)i,j]" does not.
3901
3902 This warning is enabled by -Wall.
3903
3904 -Wunused
3905 All the above -Wunused options combined.
3906
3907 In order to get a warning about an unused function parameter, you
3908 must either specify -Wextra -Wunused (note that -Wall implies
3909 -Wunused), or separately specify -Wunused-parameter.
3910
3911 -Wuninitialized
3912 Warn if an automatic variable is used without first being
3913 initialized or if a variable may be clobbered by a "setjmp" call.
3914 In C++, warn if a non-static reference or non-static "const" member
3915 appears in a class without constructors.
3916
3917 If you want to warn about code that uses the uninitialized value of
3918 the variable in its own initializer, use the -Winit-self option.
3919
3920 These warnings occur for individual uninitialized or clobbered
3921 elements of structure, union or array variables as well as for
3922 variables that are uninitialized or clobbered as a whole. They do
3923 not occur for variables or elements declared "volatile". Because
3924 these warnings depend on optimization, the exact variables or
3925 elements for which there are warnings depends on the precise
3926 optimization options and version of GCC used.
3927
3928 Note that there may be no warning about a variable that is used
3929 only to compute a value that itself is never used, because such
3930 computations may be deleted by data flow analysis before the
3931 warnings are printed.
3932
3933 -Winvalid-memory-model
3934 Warn for invocations of __atomic Builtins, __sync Builtins, and the
3935 C11 atomic generic functions with a memory consistency argument
3936 that is either invalid for the operation or outside the range of
3937 values of the "memory_order" enumeration. For example, since the
3938 "__atomic_store" and "__atomic_store_n" built-ins are only defined
3939 for the relaxed, release, and sequentially consistent memory orders
3940 the following code is diagnosed:
3941
3942 void store (int *i)
3943 {
3944 __atomic_store_n (i, 0, memory_order_consume);
3945 }
3946
3947 -Winvalid-memory-model is enabled by default.
3948
3949 -Wmaybe-uninitialized
3950 For an automatic (i.e. local) variable, if there exists a path from
3951 the function entry to a use of the variable that is initialized,
3952 but there exist some other paths for which the variable is not
3953 initialized, the compiler emits a warning if it cannot prove the
3954 uninitialized paths are not executed at run time.
3955
3956 These warnings are only possible in optimizing compilation, because
3957 otherwise GCC does not keep track of the state of variables.
3958
3959 These warnings are made optional because GCC may not be able to
3960 determine when the code is correct in spite of appearing to have an
3961 error. Here is one example of how this can happen:
3962
3963 {
3964 int x;
3965 switch (y)
3966 {
3967 case 1: x = 1;
3968 break;
3969 case 2: x = 4;
3970 break;
3971 case 3: x = 5;
3972 }
3973 foo (x);
3974 }
3975
3976 If the value of "y" is always 1, 2 or 3, then "x" is always
3977 initialized, but GCC doesn't know this. To suppress the warning,
3978 you need to provide a default case with assert(0) or similar code.
3979
3980 This option also warns when a non-volatile automatic variable might
3981 be changed by a call to "longjmp". The compiler sees only the
3982 calls to "setjmp". It cannot know where "longjmp" will be called;
3983 in fact, a signal handler could call it at any point in the code.
3984 As a result, you may get a warning even when there is in fact no
3985 problem because "longjmp" cannot in fact be called at the place
3986 that would cause a problem.
3987
3988 Some spurious warnings can be avoided if you declare all the
3989 functions you use that never return as "noreturn".
3990
3991 This warning is enabled by -Wall or -Wextra.
3992
3993 -Wunknown-pragmas
3994 Warn when a "#pragma" directive is encountered that is not
3995 understood by GCC. If this command-line option is used, warnings
3996 are even issued for unknown pragmas in system header files. This
3997 is not the case if the warnings are only enabled by the -Wall
3998 command-line option.
3999
4000 -Wno-pragmas
4001 Do not warn about misuses of pragmas, such as incorrect parameters,
4002 invalid syntax, or conflicts between pragmas. See also
4003 -Wunknown-pragmas.
4004
4005 -Wstrict-aliasing
4006 This option is only active when -fstrict-aliasing is active. It
4007 warns about code that might break the strict aliasing rules that
4008 the compiler is using for optimization. The warning does not catch
4009 all cases, but does attempt to catch the more common pitfalls. It
4010 is included in -Wall. It is equivalent to -Wstrict-aliasing=3
4011
4012 -Wstrict-aliasing=n
4013 This option is only active when -fstrict-aliasing is active. It
4014 warns about code that might break the strict aliasing rules that
4015 the compiler is using for optimization. Higher levels correspond
4016 to higher accuracy (fewer false positives). Higher levels also
4017 correspond to more effort, similar to the way -O works.
4018 -Wstrict-aliasing is equivalent to -Wstrict-aliasing=3.
4019
4020 Level 1: Most aggressive, quick, least accurate. Possibly useful
4021 when higher levels do not warn but -fstrict-aliasing still breaks
4022 the code, as it has very few false negatives. However, it has many
4023 false positives. Warns for all pointer conversions between
4024 possibly incompatible types, even if never dereferenced. Runs in
4025 the front end only.
4026
4027 Level 2: Aggressive, quick, not too precise. May still have many
4028 false positives (not as many as level 1 though), and few false
4029 negatives (but possibly more than level 1). Unlike level 1, it
4030 only warns when an address is taken. Warns about incomplete types.
4031 Runs in the front end only.
4032
4033 Level 3 (default for -Wstrict-aliasing): Should have very few false
4034 positives and few false negatives. Slightly slower than levels 1
4035 or 2 when optimization is enabled. Takes care of the common
4036 pun+dereference pattern in the front end: "*(int*)&some_float". If
4037 optimization is enabled, it also runs in the back end, where it
4038 deals with multiple statement cases using flow-sensitive points-to
4039 information. Only warns when the converted pointer is
4040 dereferenced. Does not warn about incomplete types.
4041
4042 -Wstrict-overflow
4043 -Wstrict-overflow=n
4044 This option is only active when signed overflow is undefined. It
4045 warns about cases where the compiler optimizes based on the
4046 assumption that signed overflow does not occur. Note that it does
4047 not warn about all cases where the code might overflow: it only
4048 warns about cases where the compiler implements some optimization.
4049 Thus this warning depends on the optimization level.
4050
4051 An optimization that assumes that signed overflow does not occur is
4052 perfectly safe if the values of the variables involved are such
4053 that overflow never does, in fact, occur. Therefore this warning
4054 can easily give a false positive: a warning about code that is not
4055 actually a problem. To help focus on important issues, several
4056 warning levels are defined. No warnings are issued for the use of
4057 undefined signed overflow when estimating how many iterations a
4058 loop requires, in particular when determining whether a loop will
4059 be executed at all.
4060
4061 -Wstrict-overflow=1
4062 Warn about cases that are both questionable and easy to avoid.
4063 For example the compiler simplifies "x + 1 > x" to 1. This
4064 level of -Wstrict-overflow is enabled by -Wall; higher levels
4065 are not, and must be explicitly requested.
4066
4067 -Wstrict-overflow=2
4068 Also warn about other cases where a comparison is simplified to
4069 a constant. For example: "abs (x) >= 0". This can only be
4070 simplified when signed integer overflow is undefined, because
4071 "abs (INT_MIN)" overflows to "INT_MIN", which is less than
4072 zero. -Wstrict-overflow (with no level) is the same as
4073 -Wstrict-overflow=2.
4074
4075 -Wstrict-overflow=3
4076 Also warn about other cases where a comparison is simplified.
4077 For example: "x + 1 > 1" is simplified to "x > 0".
4078
4079 -Wstrict-overflow=4
4080 Also warn about other simplifications not covered by the above
4081 cases. For example: "(x * 10) / 5" is simplified to "x * 2".
4082
4083 -Wstrict-overflow=5
4084 Also warn about cases where the compiler reduces the magnitude
4085 of a constant involved in a comparison. For example: "x + 2 >
4086 y" is simplified to "x + 1 >= y". This is reported only at the
4087 highest warning level because this simplification applies to
4088 many comparisons, so this warning level gives a very large
4089 number of false positives.
4090
4091 -Wstringop-overflow
4092 -Wstringop-overflow=type
4093 Warn for calls to string manipulation functions such as "memcpy"
4094 and "strcpy" that are determined to overflow the destination
4095 buffer. The optional argument is one greater than the type of
4096 Object Size Checking to perform to determine the size of the
4097 destination. The argument is meaningful only for functions that
4098 operate on character arrays but not for raw memory functions like
4099 "memcpy" which always make use of Object Size type-0. The option
4100 also warns for calls that specify a size in excess of the largest
4101 possible object or at most "SIZE_MAX / 2" bytes. The option
4102 produces the best results with optimization enabled but can detect
4103 a small subset of simple buffer overflows even without optimization
4104 in calls to the GCC built-in functions like "__builtin_memcpy" that
4105 correspond to the standard functions. In any case, the option
4106 warns about just a subset of buffer overflows detected by the
4107 corresponding overflow checking built-ins. For example, the option
4108 will issue a warning for the "strcpy" call below because it copies
4109 at least 5 characters (the string "blue" including the terminating
4110 NUL) into the buffer of size 4.
4111
4112 enum Color { blue, purple, yellow };
4113 const char* f (enum Color clr)
4114 {
4115 static char buf [4];
4116 const char *str;
4117 switch (clr)
4118 {
4119 case blue: str = "blue"; break;
4120 case purple: str = "purple"; break;
4121 case yellow: str = "yellow"; break;
4122 }
4123
4124 return strcpy (buf, str); // warning here
4125 }
4126
4127 Option -Wstringop-overflow=2 is enabled by default.
4128
4129 -Wstringop-overflow
4130 -Wstringop-overflow=1
4131 The -Wstringop-overflow=1 option uses type-zero Object Size
4132 Checking to determine the sizes of destination objects. This
4133 is the default setting of the option. At this setting the
4134 option will not warn for writes past the end of subobjects of
4135 larger objects accessed by pointers unless the size of the
4136 largest surrounding object is known. When the destination may
4137 be one of several objects it is assumed to be the largest one
4138 of them. On Linux systems, when optimization is enabled at
4139 this setting the option warns for the same code as when the
4140 "_FORTIFY_SOURCE" macro is defined to a non-zero value.
4141
4142 -Wstringop-overflow=2
4143 The -Wstringop-overflow=2 option uses type-one Object Size
4144 Checking to determine the sizes of destination objects. At
4145 this setting the option will warn about overflows when writing
4146 to members of the largest complete objects whose exact size is
4147 known. It will, however, not warn for excessive writes to the
4148 same members of unknown objects referenced by pointers since
4149 they may point to arrays containing unknown numbers of
4150 elements.
4151
4152 -Wstringop-overflow=3
4153 The -Wstringop-overflow=3 option uses type-two Object Size
4154 Checking to determine the sizes of destination objects. At
4155 this setting the option warns about overflowing the smallest
4156 object or data member. This is the most restrictive setting of
4157 the option that may result in warnings for safe code.
4158
4159 -Wstringop-overflow=4
4160 The -Wstringop-overflow=4 option uses type-three Object Size
4161 Checking to determine the sizes of destination objects. At
4162 this setting the option will warn about overflowing any data
4163 members, and when the destination is one of several objects it
4164 uses the size of the largest of them to decide whether to issue
4165 a warning. Similarly to -Wstringop-overflow=3 this setting of
4166 the option may result in warnings for benign code.
4167
4168 -Wstringop-truncation
4169 Warn for calls to bounded string manipulation functions such as
4170 "strncat", "strncpy", and "stpncpy" that may either truncate the
4171 copied string or leave the destination unchanged.
4172
4173 In the following example, the call to "strncat" specifies a bound
4174 that is less than the length of the source string. As a result,
4175 the copy of the source will be truncated and so the call is
4176 diagnosed. To avoid the warning use "bufsize - strlen (buf) - 1)"
4177 as the bound.
4178
4179 void append (char *buf, size_t bufsize)
4180 {
4181 strncat (buf, ".txt", 3);
4182 }
4183
4184 As another example, the following call to "strncpy" results in
4185 copying to "d" just the characters preceding the terminating NUL,
4186 without appending the NUL to the end. Assuming the result of
4187 "strncpy" is necessarily a NUL-terminated string is a common
4188 mistake, and so the call is diagnosed. To avoid the warning when
4189 the result is not expected to be NUL-terminated, call "memcpy"
4190 instead.
4191
4192 void copy (char *d, const char *s)
4193 {
4194 strncpy (d, s, strlen (s));
4195 }
4196
4197 In the following example, the call to "strncpy" specifies the size
4198 of the destination buffer as the bound. If the length of the
4199 source string is equal to or greater than this size the result of
4200 the copy will not be NUL-terminated. Therefore, the call is also
4201 diagnosed. To avoid the warning, specify "sizeof buf - 1" as the
4202 bound and set the last element of the buffer to "NUL".
4203
4204 void copy (const char *s)
4205 {
4206 char buf[80];
4207 strncpy (buf, s, sizeof buf);
4208 ...
4209 }
4210
4211 In situations where a character array is intended to store a
4212 sequence of bytes with no terminating "NUL" such an array may be
4213 annotated with attribute "nonstring" to avoid this warning. Such
4214 arrays, however, are not suitable arguments to functions that
4215 expect "NUL"-terminated strings. To help detect accidental misuses
4216 of such arrays GCC issues warnings unless it can prove that the use
4217 is safe.
4218
4219 -Wsuggest-attribute=[pure|const|noreturn|format|cold|malloc]
4220 Warn for cases where adding an attribute may be beneficial. The
4221 attributes currently supported are listed below.
4222
4223 -Wsuggest-attribute=pure
4224 -Wsuggest-attribute=const
4225 -Wsuggest-attribute=noreturn
4226 -Wsuggest-attribute=malloc
4227 Warn about functions that might be candidates for attributes
4228 "pure", "const" or "noreturn" or "malloc". The compiler only
4229 warns for functions visible in other compilation units or (in
4230 the case of "pure" and "const") if it cannot prove that the
4231 function returns normally. A function returns normally if it
4232 doesn't contain an infinite loop or return abnormally by
4233 throwing, calling "abort" or trapping. This analysis requires
4234 option -fipa-pure-const, which is enabled by default at -O and
4235 higher. Higher optimization levels improve the accuracy of the
4236 analysis.
4237
4238 -Wsuggest-attribute=format
4239 -Wmissing-format-attribute
4240 Warn about function pointers that might be candidates for
4241 "format" attributes. Note these are only possible candidates,
4242 not absolute ones. GCC guesses that function pointers with
4243 "format" attributes that are used in assignment,
4244 initialization, parameter passing or return statements should
4245 have a corresponding "format" attribute in the resulting type.
4246 I.e. the left-hand side of the assignment or initialization,
4247 the type of the parameter variable, or the return type of the
4248 containing function respectively should also have a "format"
4249 attribute to avoid the warning.
4250
4251 GCC also warns about function definitions that might be
4252 candidates for "format" attributes. Again, these are only
4253 possible candidates. GCC guesses that "format" attributes
4254 might be appropriate for any function that calls a function
4255 like "vprintf" or "vscanf", but this might not always be the
4256 case, and some functions for which "format" attributes are
4257 appropriate may not be detected.
4258
4259 -Wsuggest-attribute=cold
4260 Warn about functions that might be candidates for "cold"
4261 attribute. This is based on static detection and generally
4262 will only warn about functions which always leads to a call to
4263 another "cold" function such as wrappers of C++ "throw" or
4264 fatal error reporting functions leading to "abort".
4265
4266 -Wsuggest-final-types
4267 Warn about types with virtual methods where code quality would be
4268 improved if the type were declared with the C++11 "final"
4269 specifier, or, if possible, declared in an anonymous namespace.
4270 This allows GCC to more aggressively devirtualize the polymorphic
4271 calls. This warning is more effective with link time optimization,
4272 where the information about the class hierarchy graph is more
4273 complete.
4274
4275 -Wsuggest-final-methods
4276 Warn about virtual methods where code quality would be improved if
4277 the method were declared with the C++11 "final" specifier, or, if
4278 possible, its type were declared in an anonymous namespace or with
4279 the "final" specifier. This warning is more effective with link-
4280 time optimization, where the information about the class hierarchy
4281 graph is more complete. It is recommended to first consider
4282 suggestions of -Wsuggest-final-types and then rebuild with new
4283 annotations.
4284
4285 -Wsuggest-override
4286 Warn about overriding virtual functions that are not marked with
4287 the override keyword.
4288
4289 -Walloc-zero
4290 Warn about calls to allocation functions decorated with attribute
4291 "alloc_size" that specify zero bytes, including those to the built-
4292 in forms of the functions "aligned_alloc", "alloca", "calloc",
4293 "malloc", and "realloc". Because the behavior of these functions
4294 when called with a zero size differs among implementations (and in
4295 the case of "realloc" has been deprecated) relying on it may result
4296 in subtle portability bugs and should be avoided.
4297
4298 -Walloc-size-larger-than=n
4299 Warn about calls to functions decorated with attribute "alloc_size"
4300 that attempt to allocate objects larger than the specified number
4301 of bytes, or where the result of the size computation in an integer
4302 type with infinite precision would exceed "SIZE_MAX / 2". The
4303 option argument n may end in one of the standard suffixes
4304 designating a multiple of bytes such as "kB" and "KiB" for kilobyte
4305 and kibibyte, respectively, "MB" and "MiB" for megabyte and
4306 mebibyte, and so on. -Walloc-size-larger-than=PTRDIFF_MAX is
4307 enabled by default. Warnings controlled by the option can be
4308 disabled by specifying n of SIZE_MAX or more.
4309
4310 -Walloca
4311 This option warns on all uses of "alloca" in the source.
4312
4313 -Walloca-larger-than=n
4314 This option warns on calls to "alloca" that are not bounded by a
4315 controlling predicate limiting its argument of integer type to at
4316 most n bytes, or calls to "alloca" where the bound is unknown.
4317 Arguments of non-integer types are considered unbounded even if
4318 they appear to be constrained to the expected range.
4319
4320 For example, a bounded case of "alloca" could be:
4321
4322 void func (size_t n)
4323 {
4324 void *p;
4325 if (n <= 1000)
4326 p = alloca (n);
4327 else
4328 p = malloc (n);
4329 f (p);
4330 }
4331
4332 In the above example, passing "-Walloca-larger-than=1000" would not
4333 issue a warning because the call to "alloca" is known to be at most
4334 1000 bytes. However, if "-Walloca-larger-than=500" were passed,
4335 the compiler would emit a warning.
4336
4337 Unbounded uses, on the other hand, are uses of "alloca" with no
4338 controlling predicate constraining its integer argument. For
4339 example:
4340
4341 void func ()
4342 {
4343 void *p = alloca (n);
4344 f (p);
4345 }
4346
4347 If "-Walloca-larger-than=500" were passed, the above would trigger
4348 a warning, but this time because of the lack of bounds checking.
4349
4350 Note, that even seemingly correct code involving signed integers
4351 could cause a warning:
4352
4353 void func (signed int n)
4354 {
4355 if (n < 500)
4356 {
4357 p = alloca (n);
4358 f (p);
4359 }
4360 }
4361
4362 In the above example, n could be negative, causing a larger than
4363 expected argument to be implicitly cast into the "alloca" call.
4364
4365 This option also warns when "alloca" is used in a loop.
4366
4367 This warning is not enabled by -Wall, and is only active when
4368 -ftree-vrp is active (default for -O2 and above).
4369
4370 See also -Wvla-larger-than=n.
4371
4372 -Warray-bounds
4373 -Warray-bounds=n
4374 This option is only active when -ftree-vrp is active (default for
4375 -O2 and above). It warns about subscripts to arrays that are always
4376 out of bounds. This warning is enabled by -Wall.
4377
4378 -Warray-bounds=1
4379 This is the warning level of -Warray-bounds and is enabled by
4380 -Wall; higher levels are not, and must be explicitly requested.
4381
4382 -Warray-bounds=2
4383 This warning level also warns about out of bounds access for
4384 arrays at the end of a struct and for arrays accessed through
4385 pointers. This warning level may give a larger number of false
4386 positives and is deactivated by default.
4387
4388 -Wattribute-alias
4389 Warn about declarations using the "alias" and similar attributes
4390 whose target is incompatible with the type of the alias.
4391
4392 -Wbool-compare
4393 Warn about boolean expression compared with an integer value
4394 different from "true"/"false". For instance, the following
4395 comparison is always false:
4396
4397 int n = 5;
4398 ...
4399 if ((n > 1) == 2) { ... }
4400
4401 This warning is enabled by -Wall.
4402
4403 -Wbool-operation
4404 Warn about suspicious operations on expressions of a boolean type.
4405 For instance, bitwise negation of a boolean is very likely a bug in
4406 the program. For C, this warning also warns about incrementing or
4407 decrementing a boolean, which rarely makes sense. (In C++,
4408 decrementing a boolean is always invalid. Incrementing a boolean
4409 is invalid in C++17, and deprecated otherwise.)
4410
4411 This warning is enabled by -Wall.
4412
4413 -Wduplicated-branches
4414 Warn when an if-else has identical branches. This warning detects
4415 cases like
4416
4417 if (p != NULL)
4418 return 0;
4419 else
4420 return 0;
4421
4422 It doesn't warn when both branches contain just a null statement.
4423 This warning also warn for conditional operators:
4424
4425 int i = x ? *p : *p;
4426
4427 -Wduplicated-cond
4428 Warn about duplicated conditions in an if-else-if chain. For
4429 instance, warn for the following code:
4430
4431 if (p->q != NULL) { ... }
4432 else if (p->q != NULL) { ... }
4433
4434 -Wframe-address
4435 Warn when the __builtin_frame_address or __builtin_return_address
4436 is called with an argument greater than 0. Such calls may return
4437 indeterminate values or crash the program. The warning is included
4438 in -Wall.
4439
4440 -Wno-discarded-qualifiers (C and Objective-C only)
4441 Do not warn if type qualifiers on pointers are being discarded.
4442 Typically, the compiler warns if a "const char *" variable is
4443 passed to a function that takes a "char *" parameter. This option
4444 can be used to suppress such a warning.
4445
4446 -Wno-discarded-array-qualifiers (C and Objective-C only)
4447 Do not warn if type qualifiers on arrays which are pointer targets
4448 are being discarded. Typically, the compiler warns if a "const int
4449 (*)[]" variable is passed to a function that takes a "int (*)[]"
4450 parameter. This option can be used to suppress such a warning.
4451
4452 -Wno-incompatible-pointer-types (C and Objective-C only)
4453 Do not warn when there is a conversion between pointers that have
4454 incompatible types. This warning is for cases not covered by
4455 -Wno-pointer-sign, which warns for pointer argument passing or
4456 assignment with different signedness.
4457
4458 -Wno-int-conversion (C and Objective-C only)
4459 Do not warn about incompatible integer to pointer and pointer to
4460 integer conversions. This warning is about implicit conversions;
4461 for explicit conversions the warnings -Wno-int-to-pointer-cast and
4462 -Wno-pointer-to-int-cast may be used.
4463
4464 -Wno-div-by-zero
4465 Do not warn about compile-time integer division by zero. Floating-
4466 point division by zero is not warned about, as it can be a
4467 legitimate way of obtaining infinities and NaNs.
4468
4469 -Wsystem-headers
4470 Print warning messages for constructs found in system header files.
4471 Warnings from system headers are normally suppressed, on the
4472 assumption that they usually do not indicate real problems and
4473 would only make the compiler output harder to read. Using this
4474 command-line option tells GCC to emit warnings from system headers
4475 as if they occurred in user code. However, note that using -Wall
4476 in conjunction with this option does not warn about unknown pragmas
4477 in system headers---for that, -Wunknown-pragmas must also be used.
4478
4479 -Wtautological-compare
4480 Warn if a self-comparison always evaluates to true or false. This
4481 warning detects various mistakes such as:
4482
4483 int i = 1;
4484 ...
4485 if (i > i) { ... }
4486
4487 This warning also warns about bitwise comparisons that always
4488 evaluate to true or false, for instance:
4489
4490 if ((a & 16) == 10) { ... }
4491
4492 will always be false.
4493
4494 This warning is enabled by -Wall.
4495
4496 -Wtrampolines
4497 Warn about trampolines generated for pointers to nested functions.
4498 A trampoline is a small piece of data or code that is created at
4499 run time on the stack when the address of a nested function is
4500 taken, and is used to call the nested function indirectly. For
4501 some targets, it is made up of data only and thus requires no
4502 special treatment. But, for most targets, it is made up of code
4503 and thus requires the stack to be made executable in order for the
4504 program to work properly.
4505
4506 -Wfloat-equal
4507 Warn if floating-point values are used in equality comparisons.
4508
4509 The idea behind this is that sometimes it is convenient (for the
4510 programmer) to consider floating-point values as approximations to
4511 infinitely precise real numbers. If you are doing this, then you
4512 need to compute (by analyzing the code, or in some other way) the
4513 maximum or likely maximum error that the computation introduces,
4514 and allow for it when performing comparisons (and when producing
4515 output, but that's a different problem). In particular, instead of
4516 testing for equality, you should check to see whether the two
4517 values have ranges that overlap; and this is done with the
4518 relational operators, so equality comparisons are probably
4519 mistaken.
4520
4521 -Wtraditional (C and Objective-C only)
4522 Warn about certain constructs that behave differently in
4523 traditional and ISO C. Also warn about ISO C constructs that have
4524 no traditional C equivalent, and/or problematic constructs that
4525 should be avoided.
4526
4527 * Macro parameters that appear within string literals in the
4528 macro body. In traditional C macro replacement takes place
4529 within string literals, but in ISO C it does not.
4530
4531 * In traditional C, some preprocessor directives did not exist.
4532 Traditional preprocessors only considered a line to be a
4533 directive if the # appeared in column 1 on the line. Therefore
4534 -Wtraditional warns about directives that traditional C
4535 understands but ignores because the # does not appear as the
4536 first character on the line. It also suggests you hide
4537 directives like "#pragma" not understood by traditional C by
4538 indenting them. Some traditional implementations do not
4539 recognize "#elif", so this option suggests avoiding it
4540 altogether.
4541
4542 * A function-like macro that appears without arguments.
4543
4544 * The unary plus operator.
4545
4546 * The U integer constant suffix, or the F or L floating-point
4547 constant suffixes. (Traditional C does support the L suffix on
4548 integer constants.) Note, these suffixes appear in macros
4549 defined in the system headers of most modern systems, e.g. the
4550 _MIN/_MAX macros in "<limits.h>". Use of these macros in user
4551 code might normally lead to spurious warnings, however GCC's
4552 integrated preprocessor has enough context to avoid warning in
4553 these cases.
4554
4555 * A function declared external in one block and then used after
4556 the end of the block.
4557
4558 * A "switch" statement has an operand of type "long".
4559
4560 * A non-"static" function declaration follows a "static" one.
4561 This construct is not accepted by some traditional C compilers.
4562
4563 * The ISO type of an integer constant has a different width or
4564 signedness from its traditional type. This warning is only
4565 issued if the base of the constant is ten. I.e. hexadecimal or
4566 octal values, which typically represent bit patterns, are not
4567 warned about.
4568
4569 * Usage of ISO string concatenation is detected.
4570
4571 * Initialization of automatic aggregates.
4572
4573 * Identifier conflicts with labels. Traditional C lacks a
4574 separate namespace for labels.
4575
4576 * Initialization of unions. If the initializer is zero, the
4577 warning is omitted. This is done under the assumption that the
4578 zero initializer in user code appears conditioned on e.g.
4579 "__STDC__" to avoid missing initializer warnings and relies on
4580 default initialization to zero in the traditional C case.
4581
4582 * Conversions by prototypes between fixed/floating-point values
4583 and vice versa. The absence of these prototypes when compiling
4584 with traditional C causes serious problems. This is a subset
4585 of the possible conversion warnings; for the full set use
4586 -Wtraditional-conversion.
4587
4588 * Use of ISO C style function definitions. This warning
4589 intentionally is not issued for prototype declarations or
4590 variadic functions because these ISO C features appear in your
4591 code when using libiberty's traditional C compatibility macros,
4592 "PARAMS" and "VPARAMS". This warning is also bypassed for
4593 nested functions because that feature is already a GCC
4594 extension and thus not relevant to traditional C compatibility.
4595
4596 -Wtraditional-conversion (C and Objective-C only)
4597 Warn if a prototype causes a type conversion that is different from
4598 what would happen to the same argument in the absence of a
4599 prototype. This includes conversions of fixed point to floating
4600 and vice versa, and conversions changing the width or signedness of
4601 a fixed-point argument except when the same as the default
4602 promotion.
4603
4604 -Wdeclaration-after-statement (C and Objective-C only)
4605 Warn when a declaration is found after a statement in a block.
4606 This construct, known from C++, was introduced with ISO C99 and is
4607 by default allowed in GCC. It is not supported by ISO C90.
4608
4609 -Wshadow
4610 Warn whenever a local variable or type declaration shadows another
4611 variable, parameter, type, class member (in C++), or instance
4612 variable (in Objective-C) or whenever a built-in function is
4613 shadowed. Note that in C++, the compiler warns if a local variable
4614 shadows an explicit typedef, but not if it shadows a
4615 struct/class/enum. Same as -Wshadow=global.
4616
4617 -Wno-shadow-ivar (Objective-C only)
4618 Do not warn whenever a local variable shadows an instance variable
4619 in an Objective-C method.
4620
4621 -Wshadow=global
4622 The default for -Wshadow. Warns for any (global) shadowing.
4623
4624 -Wshadow=local
4625 Warn when a local variable shadows another local variable or
4626 parameter. This warning is enabled by -Wshadow=global.
4627
4628 -Wshadow=compatible-local
4629 Warn when a local variable shadows another local variable or
4630 parameter whose type is compatible with that of the shadowing
4631 variable. In C++, type compatibility here means the type of the
4632 shadowing variable can be converted to that of the shadowed
4633 variable. The creation of this flag (in addition to -Wshadow=local)
4634 is based on the idea that when a local variable shadows another one
4635 of incompatible type, it is most likely intentional, not a bug or
4636 typo, as shown in the following example:
4637
4638 for (SomeIterator i = SomeObj.begin(); i != SomeObj.end(); ++i)
4639 {
4640 for (int i = 0; i < N; ++i)
4641 {
4642 ...
4643 }
4644 ...
4645 }
4646
4647 Since the two variable "i" in the example above have incompatible
4648 types, enabling only -Wshadow=compatible-local will not emit a
4649 warning. Because their types are incompatible, if a programmer
4650 accidentally uses one in place of the other, type checking will
4651 catch that and emit an error or warning. So not warning (about
4652 shadowing) in this case will not lead to undetected bugs. Use of
4653 this flag instead of -Wshadow=local can possibly reduce the number
4654 of warnings triggered by intentional shadowing.
4655
4656 This warning is enabled by -Wshadow=local.
4657
4658 -Wlarger-than=len
4659 Warn whenever an object of larger than len bytes is defined.
4660
4661 -Wframe-larger-than=len
4662 Warn if the size of a function frame is larger than len bytes. The
4663 computation done to determine the stack frame size is approximate
4664 and not conservative. The actual requirements may be somewhat
4665 greater than len even if you do not get a warning. In addition,
4666 any space allocated via "alloca", variable-length arrays, or
4667 related constructs is not included by the compiler when determining
4668 whether or not to issue a warning.
4669
4670 -Wno-free-nonheap-object
4671 Do not warn when attempting to free an object that was not
4672 allocated on the heap.
4673
4674 -Wstack-usage=len
4675 Warn if the stack usage of a function might be larger than len
4676 bytes. The computation done to determine the stack usage is
4677 conservative. Any space allocated via "alloca", variable-length
4678 arrays, or related constructs is included by the compiler when
4679 determining whether or not to issue a warning.
4680
4681 The message is in keeping with the output of -fstack-usage.
4682
4683 * If the stack usage is fully static but exceeds the specified
4684 amount, it's:
4685
4686 warning: stack usage is 1120 bytes
4687
4688 * If the stack usage is (partly) dynamic but bounded, it's:
4689
4690 warning: stack usage might be 1648 bytes
4691
4692 * If the stack usage is (partly) dynamic and not bounded, it's:
4693
4694 warning: stack usage might be unbounded
4695
4696 -Wno-pedantic-ms-format (MinGW targets only)
4697 When used in combination with -Wformat and -pedantic without GNU
4698 extensions, this option disables the warnings about non-ISO
4699 "printf" / "scanf" format width specifiers "I32", "I64", and "I"
4700 used on Windows targets, which depend on the MS runtime.
4701
4702 -Waligned-new
4703 Warn about a new-expression of a type that requires greater
4704 alignment than the "alignof(std::max_align_t)" but uses an
4705 allocation function without an explicit alignment parameter. This
4706 option is enabled by -Wall.
4707
4708 Normally this only warns about global allocation functions, but
4709 -Waligned-new=all also warns about class member allocation
4710 functions.
4711
4712 -Wplacement-new
4713 -Wplacement-new=n
4714 Warn about placement new expressions with undefined behavior, such
4715 as constructing an object in a buffer that is smaller than the type
4716 of the object. For example, the placement new expression below is
4717 diagnosed because it attempts to construct an array of 64 integers
4718 in a buffer only 64 bytes large.
4719
4720 char buf [64];
4721 new (buf) int[64];
4722
4723 This warning is enabled by default.
4724
4725 -Wplacement-new=1
4726 This is the default warning level of -Wplacement-new. At this
4727 level the warning is not issued for some strictly undefined
4728 constructs that GCC allows as extensions for compatibility with
4729 legacy code. For example, the following "new" expression is
4730 not diagnosed at this level even though it has undefined
4731 behavior according to the C++ standard because it writes past
4732 the end of the one-element array.
4733
4734 struct S { int n, a[1]; };
4735 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
4736 new (s->a)int [32]();
4737
4738 -Wplacement-new=2
4739 At this level, in addition to diagnosing all the same
4740 constructs as at level 1, a diagnostic is also issued for
4741 placement new expressions that construct an object in the last
4742 member of structure whose type is an array of a single element
4743 and whose size is less than the size of the object being
4744 constructed. While the previous example would be diagnosed,
4745 the following construct makes use of the flexible member array
4746 extension to avoid the warning at level 2.
4747
4748 struct S { int n, a[]; };
4749 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
4750 new (s->a)int [32]();
4751
4752 -Wpointer-arith
4753 Warn about anything that depends on the "size of" a function type
4754 or of "void". GNU C assigns these types a size of 1, for
4755 convenience in calculations with "void *" pointers and pointers to
4756 functions. In C++, warn also when an arithmetic operation involves
4757 "NULL". This warning is also enabled by -Wpedantic.
4758
4759 -Wpointer-compare
4760 Warn if a pointer is compared with a zero character constant. This
4761 usually means that the pointer was meant to be dereferenced. For
4762 example:
4763
4764 const char *p = foo ();
4765 if (p == '\0')
4766 return 42;
4767
4768 Note that the code above is invalid in C++11.
4769
4770 This warning is enabled by default.
4771
4772 -Wtype-limits
4773 Warn if a comparison is always true or always false due to the
4774 limited range of the data type, but do not warn for constant
4775 expressions. For example, warn if an unsigned variable is compared
4776 against zero with "<" or ">=". This warning is also enabled by
4777 -Wextra.
4778
4779 -Wcomment
4780 -Wcomments
4781 Warn whenever a comment-start sequence /* appears in a /* comment,
4782 or whenever a backslash-newline appears in a // comment. This
4783 warning is enabled by -Wall.
4784
4785 -Wtrigraphs
4786 Warn if any trigraphs are encountered that might change the meaning
4787 of the program. Trigraphs within comments are not warned about,
4788 except those that would form escaped newlines.
4789
4790 This option is implied by -Wall. If -Wall is not given, this
4791 option is still enabled unless trigraphs are enabled. To get
4792 trigraph conversion without warnings, but get the other -Wall
4793 warnings, use -trigraphs -Wall -Wno-trigraphs.
4794
4795 -Wundef
4796 Warn if an undefined identifier is evaluated in an "#if" directive.
4797 Such identifiers are replaced with zero.
4798
4799 -Wexpansion-to-defined
4800 Warn whenever defined is encountered in the expansion of a macro
4801 (including the case where the macro is expanded by an #if
4802 directive). Such usage is not portable. This warning is also
4803 enabled by -Wpedantic and -Wextra.
4804
4805 -Wunused-macros
4806 Warn about macros defined in the main file that are unused. A
4807 macro is used if it is expanded or tested for existence at least
4808 once. The preprocessor also warns if the macro has not been used
4809 at the time it is redefined or undefined.
4810
4811 Built-in macros, macros defined on the command line, and macros
4812 defined in include files are not warned about.
4813
4814 Note: If a macro is actually used, but only used in skipped
4815 conditional blocks, then the preprocessor reports it as unused. To
4816 avoid the warning in such a case, you might improve the scope of
4817 the macro's definition by, for example, moving it into the first
4818 skipped block. Alternatively, you could provide a dummy use with
4819 something like:
4820
4821 #if defined the_macro_causing_the_warning
4822 #endif
4823
4824 -Wno-endif-labels
4825 Do not warn whenever an "#else" or an "#endif" are followed by
4826 text. This sometimes happens in older programs with code of the
4827 form
4828
4829 #if FOO
4830 ...
4831 #else FOO
4832 ...
4833 #endif FOO
4834
4835 The second and third "FOO" should be in comments. This warning is
4836 on by default.
4837
4838 -Wbad-function-cast (C and Objective-C only)
4839 Warn when a function call is cast to a non-matching type. For
4840 example, warn if a call to a function returning an integer type is
4841 cast to a pointer type.
4842
4843 -Wc90-c99-compat (C and Objective-C only)
4844 Warn about features not present in ISO C90, but present in ISO C99.
4845 For instance, warn about use of variable length arrays, "long long"
4846 type, "bool" type, compound literals, designated initializers, and
4847 so on. This option is independent of the standards mode. Warnings
4848 are disabled in the expression that follows "__extension__".
4849
4850 -Wc99-c11-compat (C and Objective-C only)
4851 Warn about features not present in ISO C99, but present in ISO C11.
4852 For instance, warn about use of anonymous structures and unions,
4853 "_Atomic" type qualifier, "_Thread_local" storage-class specifier,
4854 "_Alignas" specifier, "Alignof" operator, "_Generic" keyword, and
4855 so on. This option is independent of the standards mode. Warnings
4856 are disabled in the expression that follows "__extension__".
4857
4858 -Wc++-compat (C and Objective-C only)
4859 Warn about ISO C constructs that are outside of the common subset
4860 of ISO C and ISO C++, e.g. request for implicit conversion from
4861 "void *" to a pointer to non-"void" type.
4862
4863 -Wc++11-compat (C++ and Objective-C++ only)
4864 Warn about C++ constructs whose meaning differs between ISO C++
4865 1998 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are
4866 keywords in ISO C++ 2011. This warning turns on -Wnarrowing and is
4867 enabled by -Wall.
4868
4869 -Wc++14-compat (C++ and Objective-C++ only)
4870 Warn about C++ constructs whose meaning differs between ISO C++
4871 2011 and ISO C++ 2014. This warning is enabled by -Wall.
4872
4873 -Wc++17-compat (C++ and Objective-C++ only)
4874 Warn about C++ constructs whose meaning differs between ISO C++
4875 2014 and ISO C++ 2017. This warning is enabled by -Wall.
4876
4877 -Wcast-qual
4878 Warn whenever a pointer is cast so as to remove a type qualifier
4879 from the target type. For example, warn if a "const char *" is
4880 cast to an ordinary "char *".
4881
4882 Also warn when making a cast that introduces a type qualifier in an
4883 unsafe way. For example, casting "char **" to "const char **" is
4884 unsafe, as in this example:
4885
4886 /* p is char ** value. */
4887 const char **q = (const char **) p;
4888 /* Assignment of readonly string to const char * is OK. */
4889 *q = "string";
4890 /* Now char** pointer points to read-only memory. */
4891 **p = 'b';
4892
4893 -Wcast-align
4894 Warn whenever a pointer is cast such that the required alignment of
4895 the target is increased. For example, warn if a "char *" is cast
4896 to an "int *" on machines where integers can only be accessed at
4897 two- or four-byte boundaries.
4898
4899 -Wcast-align=strict
4900 Warn whenever a pointer is cast such that the required alignment of
4901 the target is increased. For example, warn if a "char *" is cast
4902 to an "int *" regardless of the target machine.
4903
4904 -Wcast-function-type
4905 Warn when a function pointer is cast to an incompatible function
4906 pointer. In a cast involving function types with a variable
4907 argument list only the types of initial arguments that are provided
4908 are considered. Any parameter of pointer-type matches any other
4909 pointer-type. Any benign differences in integral types are
4910 ignored, like "int" vs. "long" on ILP32 targets. Likewise type
4911 qualifiers are ignored. The function type "void (*) (void)" is
4912 special and matches everything, which can be used to suppress this
4913 warning. In a cast involving pointer to member types this warning
4914 warns whenever the type cast is changing the pointer to member
4915 type. This warning is enabled by -Wextra.
4916
4917 -Wwrite-strings
4918 When compiling C, give string constants the type "const
4919 char[length]" so that copying the address of one into a non-"const"
4920 "char *" pointer produces a warning. These warnings help you find
4921 at compile time code that can try to write into a string constant,
4922 but only if you have been very careful about using "const" in
4923 declarations and prototypes. Otherwise, it is just a nuisance.
4924 This is why we did not make -Wall request these warnings.
4925
4926 When compiling C++, warn about the deprecated conversion from
4927 string literals to "char *". This warning is enabled by default
4928 for C++ programs.
4929
4930 -Wcatch-value
4931 -Wcatch-value=n (C++ and Objective-C++ only)
4932 Warn about catch handlers that do not catch via reference. With
4933 -Wcatch-value=1 (or -Wcatch-value for short) warn about polymorphic
4934 class types that are caught by value. With -Wcatch-value=2 warn
4935 about all class types that are caught by value. With
4936 -Wcatch-value=3 warn about all types that are not caught by
4937 reference. -Wcatch-value is enabled by -Wall.
4938
4939 -Wclobbered
4940 Warn for variables that might be changed by "longjmp" or "vfork".
4941 This warning is also enabled by -Wextra.
4942
4943 -Wconditionally-supported (C++ and Objective-C++ only)
4944 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4945
4946 -Wconversion
4947 Warn for implicit conversions that may alter a value. This includes
4948 conversions between real and integer, like "abs (x)" when "x" is
4949 "double"; conversions between signed and unsigned, like "unsigned
4950 ui = -1"; and conversions to smaller types, like "sqrtf (M_PI)". Do
4951 not warn for explicit casts like "abs ((int) x)" and "ui =
4952 (unsigned) -1", or if the value is not changed by the conversion
4953 like in "abs (2.0)". Warnings about conversions between signed and
4954 unsigned integers can be disabled by using -Wno-sign-conversion.
4955
4956 For C++, also warn for confusing overload resolution for user-
4957 defined conversions; and conversions that never use a type
4958 conversion operator: conversions to "void", the same type, a base
4959 class or a reference to them. Warnings about conversions between
4960 signed and unsigned integers are disabled by default in C++ unless
4961 -Wsign-conversion is explicitly enabled.
4962
4963 -Wno-conversion-null (C++ and Objective-C++ only)
4964 Do not warn for conversions between "NULL" and non-pointer types.
4965 -Wconversion-null is enabled by default.
4966
4967 -Wzero-as-null-pointer-constant (C++ and Objective-C++ only)
4968 Warn when a literal 0 is used as null pointer constant. This can
4969 be useful to facilitate the conversion to "nullptr" in C++11.
4970
4971 -Wsubobject-linkage (C++ and Objective-C++ only)
4972 Warn if a class type has a base or a field whose type uses the
4973 anonymous namespace or depends on a type with no linkage. If a
4974 type A depends on a type B with no or internal linkage, defining it
4975 in multiple translation units would be an ODR violation because the
4976 meaning of B is different in each translation unit. If A only
4977 appears in a single translation unit, the best way to silence the
4978 warning is to give it internal linkage by putting it in an
4979 anonymous namespace as well. The compiler doesn't give this
4980 warning for types defined in the main .C file, as those are
4981 unlikely to have multiple definitions. -Wsubobject-linkage is
4982 enabled by default.
4983
4984 -Wdangling-else
4985 Warn about constructions where there may be confusion to which "if"
4986 statement an "else" branch belongs. Here is an example of such a
4987 case:
4988
4989 {
4990 if (a)
4991 if (b)
4992 foo ();
4993 else
4994 bar ();
4995 }
4996
4997 In C/C++, every "else" branch belongs to the innermost possible
4998 "if" statement, which in this example is "if (b)". This is often
4999 not what the programmer expected, as illustrated in the above
5000 example by indentation the programmer chose. When there is the
5001 potential for this confusion, GCC issues a warning when this flag
5002 is specified. To eliminate the warning, add explicit braces around
5003 the innermost "if" statement so there is no way the "else" can
5004 belong to the enclosing "if". The resulting code looks like this:
5005
5006 {
5007 if (a)
5008 {
5009 if (b)
5010 foo ();
5011 else
5012 bar ();
5013 }
5014 }
5015
5016 This warning is enabled by -Wparentheses.
5017
5018 -Wdate-time
5019 Warn when macros "__TIME__", "__DATE__" or "__TIMESTAMP__" are
5020 encountered as they might prevent bit-wise-identical reproducible
5021 compilations.
5022
5023 -Wdelete-incomplete (C++ and Objective-C++ only)
5024 Warn when deleting a pointer to incomplete type, which may cause
5025 undefined behavior at runtime. This warning is enabled by default.
5026
5027 -Wuseless-cast (C++ and Objective-C++ only)
5028 Warn when an expression is casted to its own type.
5029
5030 -Wempty-body
5031 Warn if an empty body occurs in an "if", "else" or "do while"
5032 statement. This warning is also enabled by -Wextra.
5033
5034 -Wenum-compare
5035 Warn about a comparison between values of different enumerated
5036 types. In C++ enumerated type mismatches in conditional
5037 expressions are also diagnosed and the warning is enabled by
5038 default. In C this warning is enabled by -Wall.
5039
5040 -Wextra-semi (C++, Objective-C++ only)
5041 Warn about redundant semicolon after in-class function definition.
5042
5043 -Wjump-misses-init (C, Objective-C only)
5044 Warn if a "goto" statement or a "switch" statement jumps forward
5045 across the initialization of a variable, or jumps backward to a
5046 label after the variable has been initialized. This only warns
5047 about variables that are initialized when they are declared. This
5048 warning is only supported for C and Objective-C; in C++ this sort
5049 of branch is an error in any case.
5050
5051 -Wjump-misses-init is included in -Wc++-compat. It can be disabled
5052 with the -Wno-jump-misses-init option.
5053
5054 -Wsign-compare
5055 Warn when a comparison between signed and unsigned values could
5056 produce an incorrect result when the signed value is converted to
5057 unsigned. In C++, this warning is also enabled by -Wall. In C, it
5058 is also enabled by -Wextra.
5059
5060 -Wsign-conversion
5061 Warn for implicit conversions that may change the sign of an
5062 integer value, like assigning a signed integer expression to an
5063 unsigned integer variable. An explicit cast silences the warning.
5064 In C, this option is enabled also by -Wconversion.
5065
5066 -Wfloat-conversion
5067 Warn for implicit conversions that reduce the precision of a real
5068 value. This includes conversions from real to integer, and from
5069 higher precision real to lower precision real values. This option
5070 is also enabled by -Wconversion.
5071
5072 -Wno-scalar-storage-order
5073 Do not warn on suspicious constructs involving reverse scalar
5074 storage order.
5075
5076 -Wsized-deallocation (C++ and Objective-C++ only)
5077 Warn about a definition of an unsized deallocation function
5078
5079 void operator delete (void *) noexcept;
5080 void operator delete[] (void *) noexcept;
5081
5082 without a definition of the corresponding sized deallocation
5083 function
5084
5085 void operator delete (void *, std::size_t) noexcept;
5086 void operator delete[] (void *, std::size_t) noexcept;
5087
5088 or vice versa. Enabled by -Wextra along with -fsized-deallocation.
5089
5090 -Wsizeof-pointer-div
5091 Warn for suspicious divisions of two sizeof expressions that divide
5092 the pointer size by the element size, which is the usual way to
5093 compute the array size but won't work out correctly with pointers.
5094 This warning warns e.g. about "sizeof (ptr) / sizeof (ptr[0])" if
5095 "ptr" is not an array, but a pointer. This warning is enabled by
5096 -Wall.
5097
5098 -Wsizeof-pointer-memaccess
5099 Warn for suspicious length parameters to certain string and memory
5100 built-in functions if the argument uses "sizeof". This warning
5101 triggers for example for "memset (ptr, 0, sizeof (ptr));" if "ptr"
5102 is not an array, but a pointer, and suggests a possible fix, or
5103 about "memcpy (&foo, ptr, sizeof (&foo));".
5104 -Wsizeof-pointer-memaccess also warns about calls to bounded string
5105 copy functions like "strncat" or "strncpy" that specify as the
5106 bound a "sizeof" expression of the source array. For example, in
5107 the following function the call to "strncat" specifies the size of
5108 the source string as the bound. That is almost certainly a mistake
5109 and so the call is diagnosed.
5110
5111 void make_file (const char *name)
5112 {
5113 char path[PATH_MAX];
5114 strncpy (path, name, sizeof path - 1);
5115 strncat (path, ".text", sizeof ".text");
5116 ...
5117 }
5118
5119 The -Wsizeof-pointer-memaccess option is enabled by -Wall.
5120
5121 -Wsizeof-array-argument
5122 Warn when the "sizeof" operator is applied to a parameter that is
5123 declared as an array in a function definition. This warning is
5124 enabled by default for C and C++ programs.
5125
5126 -Wmemset-elt-size
5127 Warn for suspicious calls to the "memset" built-in function, if the
5128 first argument references an array, and the third argument is a
5129 number equal to the number of elements, but not equal to the size
5130 of the array in memory. This indicates that the user has omitted a
5131 multiplication by the element size. This warning is enabled by
5132 -Wall.
5133
5134 -Wmemset-transposed-args
5135 Warn for suspicious calls to the "memset" built-in function, if the
5136 second argument is not zero and the third argument is zero. This
5137 warns e.g.@ about "memset (buf, sizeof buf, 0)" where most probably
5138 "memset (buf, 0, sizeof buf)" was meant instead. The diagnostics
5139 is only emitted if the third argument is literal zero. If it is
5140 some expression that is folded to zero, a cast of zero to some
5141 type, etc., it is far less likely that the user has mistakenly
5142 exchanged the arguments and no warning is emitted. This warning is
5143 enabled by -Wall.
5144
5145 -Waddress
5146 Warn about suspicious uses of memory addresses. These include using
5147 the address of a function in a conditional expression, such as
5148 "void func(void); if (func)", and comparisons against the memory
5149 address of a string literal, such as "if (x == "abc")". Such uses
5150 typically indicate a programmer error: the address of a function
5151 always evaluates to true, so their use in a conditional usually
5152 indicate that the programmer forgot the parentheses in a function
5153 call; and comparisons against string literals result in unspecified
5154 behavior and are not portable in C, so they usually indicate that
5155 the programmer intended to use "strcmp". This warning is enabled
5156 by -Wall.
5157
5158 -Wlogical-op
5159 Warn about suspicious uses of logical operators in expressions.
5160 This includes using logical operators in contexts where a bit-wise
5161 operator is likely to be expected. Also warns when the operands of
5162 a logical operator are the same:
5163
5164 extern int a;
5165 if (a < 0 && a < 0) { ... }
5166
5167 -Wlogical-not-parentheses
5168 Warn about logical not used on the left hand side operand of a
5169 comparison. This option does not warn if the right operand is
5170 considered to be a boolean expression. Its purpose is to detect
5171 suspicious code like the following:
5172
5173 int a;
5174 ...
5175 if (!a > 1) { ... }
5176
5177 It is possible to suppress the warning by wrapping the LHS into
5178 parentheses:
5179
5180 if ((!a) > 1) { ... }
5181
5182 This warning is enabled by -Wall.
5183
5184 -Waggregate-return
5185 Warn if any functions that return structures or unions are defined
5186 or called. (In languages where you can return an array, this also
5187 elicits a warning.)
5188
5189 -Wno-aggressive-loop-optimizations
5190 Warn if in a loop with constant number of iterations the compiler
5191 detects undefined behavior in some statement during one or more of
5192 the iterations.
5193
5194 -Wno-attributes
5195 Do not warn if an unexpected "__attribute__" is used, such as
5196 unrecognized attributes, function attributes applied to variables,
5197 etc. This does not stop errors for incorrect use of supported
5198 attributes.
5199
5200 -Wno-builtin-declaration-mismatch
5201 Warn if a built-in function is declared with the wrong signature or
5202 as non-function. This warning is enabled by default.
5203
5204 -Wno-builtin-macro-redefined
5205 Do not warn if certain built-in macros are redefined. This
5206 suppresses warnings for redefinition of "__TIMESTAMP__",
5207 "__TIME__", "__DATE__", "__FILE__", and "__BASE_FILE__".
5208
5209 -Wstrict-prototypes (C and Objective-C only)
5210 Warn if a function is declared or defined without specifying the
5211 argument types. (An old-style function definition is permitted
5212 without a warning if preceded by a declaration that specifies the
5213 argument types.)
5214
5215 -Wold-style-declaration (C and Objective-C only)
5216 Warn for obsolescent usages, according to the C Standard, in a
5217 declaration. For example, warn if storage-class specifiers like
5218 "static" are not the first things in a declaration. This warning
5219 is also enabled by -Wextra.
5220
5221 -Wold-style-definition (C and Objective-C only)
5222 Warn if an old-style function definition is used. A warning is
5223 given even if there is a previous prototype.
5224
5225 -Wmissing-parameter-type (C and Objective-C only)
5226 A function parameter is declared without a type specifier in
5227 K&R-style functions:
5228
5229 void foo(bar) { }
5230
5231 This warning is also enabled by -Wextra.
5232
5233 -Wmissing-prototypes (C and Objective-C only)
5234 Warn if a global function is defined without a previous prototype
5235 declaration. This warning is issued even if the definition itself
5236 provides a prototype. Use this option to detect global functions
5237 that do not have a matching prototype declaration in a header file.
5238 This option is not valid for C++ because all function declarations
5239 provide prototypes and a non-matching declaration declares an
5240 overload rather than conflict with an earlier declaration. Use
5241 -Wmissing-declarations to detect missing declarations in C++.
5242
5243 -Wmissing-declarations
5244 Warn if a global function is defined without a previous
5245 declaration. Do so even if the definition itself provides a
5246 prototype. Use this option to detect global functions that are not
5247 declared in header files. In C, no warnings are issued for
5248 functions with previous non-prototype declarations; use
5249 -Wmissing-prototypes to detect missing prototypes. In C++, no
5250 warnings are issued for function templates, or for inline
5251 functions, or for functions in anonymous namespaces.
5252
5253 -Wmissing-field-initializers
5254 Warn if a structure's initializer has some fields missing. For
5255 example, the following code causes such a warning, because "x.h" is
5256 implicitly zero:
5257
5258 struct s { int f, g, h; };
5259 struct s x = { 3, 4 };
5260
5261 This option does not warn about designated initializers, so the
5262 following modification does not trigger a warning:
5263
5264 struct s { int f, g, h; };
5265 struct s x = { .f = 3, .g = 4 };
5266
5267 In C this option does not warn about the universal zero initializer
5268 { 0 }:
5269
5270 struct s { int f, g, h; };
5271 struct s x = { 0 };
5272
5273 Likewise, in C++ this option does not warn about the empty { }
5274 initializer, for example:
5275
5276 struct s { int f, g, h; };
5277 s x = { };
5278
5279 This warning is included in -Wextra. To get other -Wextra warnings
5280 without this one, use -Wextra -Wno-missing-field-initializers.
5281
5282 -Wno-multichar
5283 Do not warn if a multicharacter constant ('FOOF') is used. Usually
5284 they indicate a typo in the user's code, as they have
5285 implementation-defined values, and should not be used in portable
5286 code.
5287
5288 -Wnormalized=[none|id|nfc|nfkc]
5289 In ISO C and ISO C++, two identifiers are different if they are
5290 different sequences of characters. However, sometimes when
5291 characters outside the basic ASCII character set are used, you can
5292 have two different character sequences that look the same. To
5293 avoid confusion, the ISO 10646 standard sets out some normalization
5294 rules which when applied ensure that two sequences that look the
5295 same are turned into the same sequence. GCC can warn you if you
5296 are using identifiers that have not been normalized; this option
5297 controls that warning.
5298
5299 There are four levels of warning supported by GCC. The default is
5300 -Wnormalized=nfc, which warns about any identifier that is not in
5301 the ISO 10646 "C" normalized form, NFC. NFC is the recommended
5302 form for most uses. It is equivalent to -Wnormalized.
5303
5304 Unfortunately, there are some characters allowed in identifiers by
5305 ISO C and ISO C++ that, when turned into NFC, are not allowed in
5306 identifiers. That is, there's no way to use these symbols in
5307 portable ISO C or C++ and have all your identifiers in NFC.
5308 -Wnormalized=id suppresses the warning for these characters. It is
5309 hoped that future versions of the standards involved will correct
5310 this, which is why this option is not the default.
5311
5312 You can switch the warning off for all characters by writing
5313 -Wnormalized=none or -Wno-normalized. You should only do this if
5314 you are using some other normalization scheme (like "D"), because
5315 otherwise you can easily create bugs that are literally impossible
5316 to see.
5317
5318 Some characters in ISO 10646 have distinct meanings but look
5319 identical in some fonts or display methodologies, especially once
5320 formatting has been applied. For instance "\u207F", "SUPERSCRIPT
5321 LATIN SMALL LETTER N", displays just like a regular "n" that has
5322 been placed in a superscript. ISO 10646 defines the NFKC
5323 normalization scheme to convert all these into a standard form as
5324 well, and GCC warns if your code is not in NFKC if you use
5325 -Wnormalized=nfkc. This warning is comparable to warning about
5326 every identifier that contains the letter O because it might be
5327 confused with the digit 0, and so is not the default, but may be
5328 useful as a local coding convention if the programming environment
5329 cannot be fixed to display these characters distinctly.
5330
5331 -Wno-deprecated
5332 Do not warn about usage of deprecated features.
5333
5334 -Wno-deprecated-declarations
5335 Do not warn about uses of functions, variables, and types marked as
5336 deprecated by using the "deprecated" attribute.
5337
5338 -Wno-overflow
5339 Do not warn about compile-time overflow in constant expressions.
5340
5341 -Wno-odr
5342 Warn about One Definition Rule violations during link-time
5343 optimization. Requires -flto-odr-type-merging to be enabled.
5344 Enabled by default.
5345
5346 -Wopenmp-simd
5347 Warn if the vectorizer cost model overrides the OpenMP simd
5348 directive set by user. The -fsimd-cost-model=unlimited option can
5349 be used to relax the cost model.
5350
5351 -Woverride-init (C and Objective-C only)
5352 Warn if an initialized field without side effects is overridden
5353 when using designated initializers.
5354
5355 This warning is included in -Wextra. To get other -Wextra warnings
5356 without this one, use -Wextra -Wno-override-init.
5357
5358 -Woverride-init-side-effects (C and Objective-C only)
5359 Warn if an initialized field with side effects is overridden when
5360 using designated initializers. This warning is enabled by default.
5361
5362 -Wpacked
5363 Warn if a structure is given the packed attribute, but the packed
5364 attribute has no effect on the layout or size of the structure.
5365 Such structures may be mis-aligned for little benefit. For
5366 instance, in this code, the variable "f.x" in "struct bar" is
5367 misaligned even though "struct bar" does not itself have the packed
5368 attribute:
5369
5370 struct foo {
5371 int x;
5372 char a, b, c, d;
5373 } __attribute__((packed));
5374 struct bar {
5375 char z;
5376 struct foo f;
5377 };
5378
5379 -Wpacked-bitfield-compat
5380 The 4.1, 4.2 and 4.3 series of GCC ignore the "packed" attribute on
5381 bit-fields of type "char". This has been fixed in GCC 4.4 but the
5382 change can lead to differences in the structure layout. GCC
5383 informs you when the offset of such a field has changed in GCC 4.4.
5384 For example there is no longer a 4-bit padding between field "a"
5385 and "b" in this structure:
5386
5387 struct foo
5388 {
5389 char a:4;
5390 char b:8;
5391 } __attribute__ ((packed));
5392
5393 This warning is enabled by default. Use
5394 -Wno-packed-bitfield-compat to disable this warning.
5395
5396 -Wpacked-not-aligned (C, C++, Objective-C and Objective-C++ only)
5397 Warn if a structure field with explicitly specified alignment in a
5398 packed struct or union is misaligned. For example, a warning will
5399 be issued on "struct S", like, "warning: alignment 1 of 'struct S'
5400 is less than 8", in this code:
5401
5402 struct __attribute__ ((aligned (8))) S8 { char a[8]; };
5403 struct __attribute__ ((packed)) S {
5404 struct S8 s8;
5405 };
5406
5407 This warning is enabled by -Wall.
5408
5409 -Wpadded
5410 Warn if padding is included in a structure, either to align an
5411 element of the structure or to align the whole structure.
5412 Sometimes when this happens it is possible to rearrange the fields
5413 of the structure to reduce the padding and so make the structure
5414 smaller.
5415
5416 -Wredundant-decls
5417 Warn if anything is declared more than once in the same scope, even
5418 in cases where multiple declaration is valid and changes nothing.
5419
5420 -Wno-restrict
5421 Warn when an object referenced by a "restrict"-qualified parameter
5422 (or, in C++, a "__restrict"-qualified parameter) is aliased by
5423 another argument, or when copies between such objects overlap. For
5424 example, the call to the "strcpy" function below attempts to
5425 truncate the string by replacing its initial characters with the
5426 last four. However, because the call writes the terminating NUL
5427 into "a[4]", the copies overlap and the call is diagnosed.
5428
5429 void foo (void)
5430 {
5431 char a[] = "abcd1234";
5432 strcpy (a, a + 4);
5433 ...
5434 }
5435
5436 The -Wrestrict option detects some instances of simple overlap even
5437 without optimization but works best at -O2 and above. It is
5438 included in -Wall.
5439
5440 -Wnested-externs (C and Objective-C only)
5441 Warn if an "extern" declaration is encountered within a function.
5442
5443 -Wno-inherited-variadic-ctor
5444 Suppress warnings about use of C++11 inheriting constructors when
5445 the base class inherited from has a C variadic constructor; the
5446 warning is on by default because the ellipsis is not inherited.
5447
5448 -Winline
5449 Warn if a function that is declared as inline cannot be inlined.
5450 Even with this option, the compiler does not warn about failures to
5451 inline functions declared in system headers.
5452
5453 The compiler uses a variety of heuristics to determine whether or
5454 not to inline a function. For example, the compiler takes into
5455 account the size of the function being inlined and the amount of
5456 inlining that has already been done in the current function.
5457 Therefore, seemingly insignificant changes in the source program
5458 can cause the warnings produced by -Winline to appear or disappear.
5459
5460 -Wno-invalid-offsetof (C++ and Objective-C++ only)
5461 Suppress warnings from applying the "offsetof" macro to a non-POD
5462 type. According to the 2014 ISO C++ standard, applying "offsetof"
5463 to a non-standard-layout type is undefined. In existing C++
5464 implementations, however, "offsetof" typically gives meaningful
5465 results. This flag is for users who are aware that they are
5466 writing nonportable code and who have deliberately chosen to ignore
5467 the warning about it.
5468
5469 The restrictions on "offsetof" may be relaxed in a future version
5470 of the C++ standard.
5471
5472 -Wint-in-bool-context
5473 Warn for suspicious use of integer values where boolean values are
5474 expected, such as conditional expressions (?:) using non-boolean
5475 integer constants in boolean context, like "if (a <= b ? 2 : 3)".
5476 Or left shifting of signed integers in boolean context, like "for
5477 (a = 0; 1 << a; a++);". Likewise for all kinds of multiplications
5478 regardless of the data type. This warning is enabled by -Wall.
5479
5480 -Wno-int-to-pointer-cast
5481 Suppress warnings from casts to pointer type of an integer of a
5482 different size. In C++, casting to a pointer type of smaller size
5483 is an error. Wint-to-pointer-cast is enabled by default.
5484
5485 -Wno-pointer-to-int-cast (C and Objective-C only)
5486 Suppress warnings from casts from a pointer to an integer type of a
5487 different size.
5488
5489 -Winvalid-pch
5490 Warn if a precompiled header is found in the search path but cannot
5491 be used.
5492
5493 -Wlong-long
5494 Warn if "long long" type is used. This is enabled by either
5495 -Wpedantic or -Wtraditional in ISO C90 and C++98 modes. To inhibit
5496 the warning messages, use -Wno-long-long.
5497
5498 -Wvariadic-macros
5499 Warn if variadic macros are used in ISO C90 mode, or if the GNU
5500 alternate syntax is used in ISO C99 mode. This is enabled by
5501 either -Wpedantic or -Wtraditional. To inhibit the warning
5502 messages, use -Wno-variadic-macros.
5503
5504 -Wvarargs
5505 Warn upon questionable usage of the macros used to handle variable
5506 arguments like "va_start". This is default. To inhibit the
5507 warning messages, use -Wno-varargs.
5508
5509 -Wvector-operation-performance
5510 Warn if vector operation is not implemented via SIMD capabilities
5511 of the architecture. Mainly useful for the performance tuning.
5512 Vector operation can be implemented "piecewise", which means that
5513 the scalar operation is performed on every vector element; "in
5514 parallel", which means that the vector operation is implemented
5515 using scalars of wider type, which normally is more performance
5516 efficient; and "as a single scalar", which means that vector fits
5517 into a scalar type.
5518
5519 -Wno-virtual-move-assign
5520 Suppress warnings about inheriting from a virtual base with a non-
5521 trivial C++11 move assignment operator. This is dangerous because
5522 if the virtual base is reachable along more than one path, it is
5523 moved multiple times, which can mean both objects end up in the
5524 moved-from state. If the move assignment operator is written to
5525 avoid moving from a moved-from object, this warning can be
5526 disabled.
5527
5528 -Wvla
5529 Warn if a variable-length array is used in the code. -Wno-vla
5530 prevents the -Wpedantic warning of the variable-length array.
5531
5532 -Wvla-larger-than=n
5533 If this option is used, the compiler will warn on uses of variable-
5534 length arrays where the size is either unbounded, or bounded by an
5535 argument that can be larger than n bytes. This is similar to how
5536 -Walloca-larger-than=n works, but with variable-length arrays.
5537
5538 Note that GCC may optimize small variable-length arrays of a known
5539 value into plain arrays, so this warning may not get triggered for
5540 such arrays.
5541
5542 This warning is not enabled by -Wall, and is only active when
5543 -ftree-vrp is active (default for -O2 and above).
5544
5545 See also -Walloca-larger-than=n.
5546
5547 -Wvolatile-register-var
5548 Warn if a register variable is declared volatile. The volatile
5549 modifier does not inhibit all optimizations that may eliminate
5550 reads and/or writes to register variables. This warning is enabled
5551 by -Wall.
5552
5553 -Wdisabled-optimization
5554 Warn if a requested optimization pass is disabled. This warning
5555 does not generally indicate that there is anything wrong with your
5556 code; it merely indicates that GCC's optimizers are unable to
5557 handle the code effectively. Often, the problem is that your code
5558 is too big or too complex; GCC refuses to optimize programs when
5559 the optimization itself is likely to take inordinate amounts of
5560 time.
5561
5562 -Wpointer-sign (C and Objective-C only)
5563 Warn for pointer argument passing or assignment with different
5564 signedness. This option is only supported for C and Objective-C.
5565 It is implied by -Wall and by -Wpedantic, which can be disabled
5566 with -Wno-pointer-sign.
5567
5568 -Wstack-protector
5569 This option is only active when -fstack-protector is active. It
5570 warns about functions that are not protected against stack
5571 smashing.
5572
5573 -Woverlength-strings
5574 Warn about string constants that are longer than the "minimum
5575 maximum" length specified in the C standard. Modern compilers
5576 generally allow string constants that are much longer than the
5577 standard's minimum limit, but very portable programs should avoid
5578 using longer strings.
5579
5580 The limit applies after string constant concatenation, and does not
5581 count the trailing NUL. In C90, the limit was 509 characters; in
5582 C99, it was raised to 4095. C++98 does not specify a normative
5583 minimum maximum, so we do not diagnose overlength strings in C++.
5584
5585 This option is implied by -Wpedantic, and can be disabled with
5586 -Wno-overlength-strings.
5587
5588 -Wunsuffixed-float-constants (C and Objective-C only)
5589 Issue a warning for any floating constant that does not have a
5590 suffix. When used together with -Wsystem-headers it warns about
5591 such constants in system header files. This can be useful when
5592 preparing code to use with the "FLOAT_CONST_DECIMAL64" pragma from
5593 the decimal floating-point extension to C99.
5594
5595 -Wno-designated-init (C and Objective-C only)
5596 Suppress warnings when a positional initializer is used to
5597 initialize a structure that has been marked with the
5598 "designated_init" attribute.
5599
5600 -Whsa
5601 Issue a warning when HSAIL cannot be emitted for the compiled
5602 function or OpenMP construct.
5603
5604 Options for Debugging Your Program
5605 To tell GCC to emit extra information for use by a debugger, in almost
5606 all cases you need only to add -g to your other options.
5607
5608 GCC allows you to use -g with -O. The shortcuts taken by optimized
5609 code may occasionally be surprising: some variables you declared may
5610 not exist at all; flow of control may briefly move where you did not
5611 expect it; some statements may not be executed because they compute
5612 constant results or their values are already at hand; some statements
5613 may execute in different places because they have been moved out of
5614 loops. Nevertheless it is possible to debug optimized output. This
5615 makes it reasonable to use the optimizer for programs that might have
5616 bugs.
5617
5618 If you are not using some other optimization option, consider using -Og
5619 with -g. With no -O option at all, some compiler passes that collect
5620 information useful for debugging do not run at all, so that -Og may
5621 result in a better debugging experience.
5622
5623 -g Produce debugging information in the operating system's native
5624 format (stabs, COFF, XCOFF, or DWARF). GDB can work with this
5625 debugging information.
5626
5627 On most systems that use stabs format, -g enables use of extra
5628 debugging information that only GDB can use; this extra information
5629 makes debugging work better in GDB but probably makes other
5630 debuggers crash or refuse to read the program. If you want to
5631 control for certain whether to generate the extra information, use
5632 -gstabs+, -gstabs, -gxcoff+, -gxcoff, or -gvms (see below).
5633
5634 -ggdb
5635 Produce debugging information for use by GDB. This means to use
5636 the most expressive format available (DWARF, stabs, or the native
5637 format if neither of those are supported), including GDB extensions
5638 if at all possible.
5639
5640 -gdwarf
5641 -gdwarf-version
5642 Produce debugging information in DWARF format (if that is
5643 supported). The value of version may be either 2, 3, 4 or 5; the
5644 default version for most targets is 4. DWARF Version 5 is only
5645 experimental.
5646
5647 Note that with DWARF Version 2, some ports require and always use
5648 some non-conflicting DWARF 3 extensions in the unwind tables.
5649
5650 Version 4 may require GDB 7.0 and -fvar-tracking-assignments for
5651 maximum benefit.
5652
5653 GCC no longer supports DWARF Version 1, which is substantially
5654 different than Version 2 and later. For historical reasons, some
5655 other DWARF-related options such as -fno-dwarf2-cfi-asm) retain a
5656 reference to DWARF Version 2 in their names, but apply to all
5657 currently-supported versions of DWARF.
5658
5659 -gstabs
5660 Produce debugging information in stabs format (if that is
5661 supported), without GDB extensions. This is the format used by DBX
5662 on most BSD systems. On MIPS, Alpha and System V Release 4 systems
5663 this option produces stabs debugging output that is not understood
5664 by DBX. On System V Release 4 systems this option requires the GNU
5665 assembler.
5666
5667 -gstabs+
5668 Produce debugging information in stabs format (if that is
5669 supported), using GNU extensions understood only by the GNU
5670 debugger (GDB). The use of these extensions is likely to make
5671 other debuggers crash or refuse to read the program.
5672
5673 -gxcoff
5674 Produce debugging information in XCOFF format (if that is
5675 supported). This is the format used by the DBX debugger on IBM
5676 RS/6000 systems.
5677
5678 -gxcoff+
5679 Produce debugging information in XCOFF format (if that is
5680 supported), using GNU extensions understood only by the GNU
5681 debugger (GDB). The use of these extensions is likely to make
5682 other debuggers crash or refuse to read the program, and may cause
5683 assemblers other than the GNU assembler (GAS) to fail with an
5684 error.
5685
5686 -gvms
5687 Produce debugging information in Alpha/VMS debug format (if that is
5688 supported). This is the format used by DEBUG on Alpha/VMS systems.
5689
5690 -glevel
5691 -ggdblevel
5692 -gstabslevel
5693 -gxcofflevel
5694 -gvmslevel
5695 Request debugging information and also use level to specify how
5696 much information. The default level is 2.
5697
5698 Level 0 produces no debug information at all. Thus, -g0 negates
5699 -g.
5700
5701 Level 1 produces minimal information, enough for making backtraces
5702 in parts of the program that you don't plan to debug. This
5703 includes descriptions of functions and external variables, and line
5704 number tables, but no information about local variables.
5705
5706 Level 3 includes extra information, such as all the macro
5707 definitions present in the program. Some debuggers support macro
5708 expansion when you use -g3.
5709
5710 -gdwarf does not accept a concatenated debug level, to avoid
5711 confusion with -gdwarf-level. Instead use an additional -glevel
5712 option to change the debug level for DWARF.
5713
5714 -feliminate-unused-debug-symbols
5715 Produce debugging information in stabs format (if that is
5716 supported), for only symbols that are actually used.
5717
5718 -femit-class-debug-always
5719 Instead of emitting debugging information for a C++ class in only
5720 one object file, emit it in all object files using the class. This
5721 option should be used only with debuggers that are unable to handle
5722 the way GCC normally emits debugging information for classes
5723 because using this option increases the size of debugging
5724 information by as much as a factor of two.
5725
5726 -fno-merge-debug-strings
5727 Direct the linker to not merge together strings in the debugging
5728 information that are identical in different object files. Merging
5729 is not supported by all assemblers or linkers. Merging decreases
5730 the size of the debug information in the output file at the cost of
5731 increasing link processing time. Merging is enabled by default.
5732
5733 -fdebug-prefix-map=old=new
5734 When compiling files residing in directory old, record debugging
5735 information describing them as if the files resided in directory
5736 new instead. This can be used to replace a build-time path with an
5737 install-time path in the debug info. It can also be used to change
5738 an absolute path to a relative path by using . for new. This can
5739 give more reproducible builds, which are location independent, but
5740 may require an extra command to tell GDB where to find the source
5741 files. See also -ffile-prefix-map.
5742
5743 -fvar-tracking
5744 Run variable tracking pass. It computes where variables are stored
5745 at each position in code. Better debugging information is then
5746 generated (if the debugging information format supports this
5747 information).
5748
5749 It is enabled by default when compiling with optimization (-Os, -O,
5750 -O2, ...), debugging information (-g) and the debug info format
5751 supports it.
5752
5753 -fvar-tracking-assignments
5754 Annotate assignments to user variables early in the compilation and
5755 attempt to carry the annotations over throughout the compilation
5756 all the way to the end, in an attempt to improve debug information
5757 while optimizing. Use of -gdwarf-4 is recommended along with it.
5758
5759 It can be enabled even if var-tracking is disabled, in which case
5760 annotations are created and maintained, but discarded at the end.
5761 By default, this flag is enabled together with -fvar-tracking,
5762 except when selective scheduling is enabled.
5763
5764 -gsplit-dwarf
5765 Separate as much DWARF debugging information as possible into a
5766 separate output file with the extension .dwo. This option allows
5767 the build system to avoid linking files with debug information. To
5768 be useful, this option requires a debugger capable of reading .dwo
5769 files.
5770
5771 -gpubnames
5772 Generate DWARF ".debug_pubnames" and ".debug_pubtypes" sections.
5773
5774 -ggnu-pubnames
5775 Generate ".debug_pubnames" and ".debug_pubtypes" sections in a
5776 format suitable for conversion into a GDB index. This option is
5777 only useful with a linker that can produce GDB index version 7.
5778
5779 -fdebug-types-section
5780 When using DWARF Version 4 or higher, type DIEs can be put into
5781 their own ".debug_types" section instead of making them part of the
5782 ".debug_info" section. It is more efficient to put them in a
5783 separate comdat sections since the linker can then remove
5784 duplicates. But not all DWARF consumers support ".debug_types"
5785 sections yet and on some objects ".debug_types" produces larger
5786 instead of smaller debugging information.
5787
5788 -grecord-gcc-switches
5789 -gno-record-gcc-switches
5790 This switch causes the command-line options used to invoke the
5791 compiler that may affect code generation to be appended to the
5792 DW_AT_producer attribute in DWARF debugging information. The
5793 options are concatenated with spaces separating them from each
5794 other and from the compiler version. It is enabled by default.
5795 See also -frecord-gcc-switches for another way of storing compiler
5796 options into the object file.
5797
5798 -gstrict-dwarf
5799 Disallow using extensions of later DWARF standard version than
5800 selected with -gdwarf-version. On most targets using non-
5801 conflicting DWARF extensions from later standard versions is
5802 allowed.
5803
5804 -gno-strict-dwarf
5805 Allow using extensions of later DWARF standard version than
5806 selected with -gdwarf-version.
5807
5808 -gas-loc-support
5809 Inform the compiler that the assembler supports ".loc" directives.
5810 It may then use them for the assembler to generate DWARF2+ line
5811 number tables.
5812
5813 This is generally desirable, because assembler-generated line-
5814 number tables are a lot more compact than those the compiler can
5815 generate itself.
5816
5817 This option will be enabled by default if, at GCC configure time,
5818 the assembler was found to support such directives.
5819
5820 -gno-as-loc-support
5821 Force GCC to generate DWARF2+ line number tables internally, if
5822 DWARF2+ line number tables are to be generated.
5823
5824 gas-locview-support
5825 Inform the compiler that the assembler supports "view" assignment
5826 and reset assertion checking in ".loc" directives.
5827
5828 This option will be enabled by default if, at GCC configure time,
5829 the assembler was found to support them.
5830
5831 gno-as-locview-support
5832 Force GCC to assign view numbers internally, if
5833 -gvariable-location-views are explicitly requested.
5834
5835 -gcolumn-info
5836 -gno-column-info
5837 Emit location column information into DWARF debugging information,
5838 rather than just file and line. This option is enabled by default.
5839
5840 -gstatement-frontiers
5841 -gno-statement-frontiers
5842 This option causes GCC to create markers in the internal
5843 representation at the beginning of statements, and to keep them
5844 roughly in place throughout compilation, using them to guide the
5845 output of "is_stmt" markers in the line number table. This is
5846 enabled by default when compiling with optimization (-Os, -O, -O2,
5847 ...), and outputting DWARF 2 debug information at the normal level.
5848
5849 -gvariable-location-views
5850 -gvariable-location-views=incompat5
5851 -gno-variable-location-views
5852 Augment variable location lists with progressive view numbers
5853 implied from the line number table. This enables debug information
5854 consumers to inspect state at certain points of the program, even
5855 if no instructions associated with the corresponding source
5856 locations are present at that point. If the assembler lacks
5857 support for view numbers in line number tables, this will cause the
5858 compiler to emit the line number table, which generally makes them
5859 somewhat less compact. The augmented line number tables and
5860 location lists are fully backward-compatible, so they can be
5861 consumed by debug information consumers that are not aware of these
5862 augmentations, but they won't derive any benefit from them either.
5863
5864 This is enabled by default when outputting DWARF 2 debug
5865 information at the normal level, as long as there is assembler
5866 support, -fvar-tracking-assignments is enabled and -gstrict-dwarf
5867 is not. When assembler support is not available, this may still be
5868 enabled, but it will force GCC to output internal line number
5869 tables, and if -ginternal-reset-location-views is not enabled, that
5870 will most certainly lead to silently mismatching location views.
5871
5872 There is a proposed representation for view numbers that is not
5873 backward compatible with the location list format introduced in
5874 DWARF 5, that can be enabled with
5875 -gvariable-location-views=incompat5. This option may be removed in
5876 the future, is only provided as a reference implementation of the
5877 proposed representation. Debug information consumers are not
5878 expected to support this extended format, and they would be
5879 rendered unable to decode location lists using it.
5880
5881 -ginternal-reset-location-views
5882 -gnointernal-reset-location-views
5883 Attempt to determine location views that can be omitted from
5884 location view lists. This requires the compiler to have very
5885 accurate insn length estimates, which isn't always the case, and it
5886 may cause incorrect view lists to be generated silently when using
5887 an assembler that does not support location view lists. The GNU
5888 assembler will flag any such error as a "view number mismatch".
5889 This is only enabled on ports that define a reliable estimation
5890 function.
5891
5892 -ginline-points
5893 -gno-inline-points
5894 Generate extended debug information for inlined functions.
5895 Location view tracking markers are inserted at inlined entry
5896 points, so that address and view numbers can be computed and output
5897 in debug information. This can be enabled independently of
5898 location views, in which case the view numbers won't be output, but
5899 it can only be enabled along with statement frontiers, and it is
5900 only enabled by default if location views are enabled.
5901
5902 -gz[=type]
5903 Produce compressed debug sections in DWARF format, if that is
5904 supported. If type is not given, the default type depends on the
5905 capabilities of the assembler and linker used. type may be one of
5906 none (don't compress debug sections), zlib (use zlib compression in
5907 ELF gABI format), or zlib-gnu (use zlib compression in traditional
5908 GNU format). If the linker doesn't support writing compressed
5909 debug sections, the option is rejected. Otherwise, if the
5910 assembler does not support them, -gz is silently ignored when
5911 producing object files.
5912
5913 -femit-struct-debug-baseonly
5914 Emit debug information for struct-like types only when the base
5915 name of the compilation source file matches the base name of file
5916 in which the struct is defined.
5917
5918 This option substantially reduces the size of debugging
5919 information, but at significant potential loss in type information
5920 to the debugger. See -femit-struct-debug-reduced for a less
5921 aggressive option. See -femit-struct-debug-detailed for more
5922 detailed control.
5923
5924 This option works only with DWARF debug output.
5925
5926 -femit-struct-debug-reduced
5927 Emit debug information for struct-like types only when the base
5928 name of the compilation source file matches the base name of file
5929 in which the type is defined, unless the struct is a template or
5930 defined in a system header.
5931
5932 This option significantly reduces the size of debugging
5933 information, with some potential loss in type information to the
5934 debugger. See -femit-struct-debug-baseonly for a more aggressive
5935 option. See -femit-struct-debug-detailed for more detailed
5936 control.
5937
5938 This option works only with DWARF debug output.
5939
5940 -femit-struct-debug-detailed[=spec-list]
5941 Specify the struct-like types for which the compiler generates
5942 debug information. The intent is to reduce duplicate struct debug
5943 information between different object files within the same program.
5944
5945 This option is a detailed version of -femit-struct-debug-reduced
5946 and -femit-struct-debug-baseonly, which serves for most needs.
5947
5948 A specification has the
5949 syntax[dir:|ind:][ord:|gen:](any|sys|base|none)
5950
5951 The optional first word limits the specification to structs that
5952 are used directly (dir:) or used indirectly (ind:). A struct type
5953 is used directly when it is the type of a variable, member.
5954 Indirect uses arise through pointers to structs. That is, when use
5955 of an incomplete struct is valid, the use is indirect. An example
5956 is struct one direct; struct two * indirect;.
5957
5958 The optional second word limits the specification to ordinary
5959 structs (ord:) or generic structs (gen:). Generic structs are a
5960 bit complicated to explain. For C++, these are non-explicit
5961 specializations of template classes, or non-template classes within
5962 the above. Other programming languages have generics, but
5963 -femit-struct-debug-detailed does not yet implement them.
5964
5965 The third word specifies the source files for those structs for
5966 which the compiler should emit debug information. The values none
5967 and any have the normal meaning. The value base means that the
5968 base of name of the file in which the type declaration appears must
5969 match the base of the name of the main compilation file. In
5970 practice, this means that when compiling foo.c, debug information
5971 is generated for types declared in that file and foo.h, but not
5972 other header files. The value sys means those types satisfying
5973 base or declared in system or compiler headers.
5974
5975 You may need to experiment to determine the best settings for your
5976 application.
5977
5978 The default is -femit-struct-debug-detailed=all.
5979
5980 This option works only with DWARF debug output.
5981
5982 -fno-dwarf2-cfi-asm
5983 Emit DWARF unwind info as compiler generated ".eh_frame" section
5984 instead of using GAS ".cfi_*" directives.
5985
5986 -fno-eliminate-unused-debug-types
5987 Normally, when producing DWARF output, GCC avoids producing debug
5988 symbol output for types that are nowhere used in the source file
5989 being compiled. Sometimes it is useful to have GCC emit debugging
5990 information for all types declared in a compilation unit,
5991 regardless of whether or not they are actually used in that
5992 compilation unit, for example if, in the debugger, you want to cast
5993 a value to a type that is not actually used in your program (but is
5994 declared). More often, however, this results in a significant
5995 amount of wasted space.
5996
5997 Options That Control Optimization
5998 These options control various sorts of optimizations.
5999
6000 Without any optimization option, the compiler's goal is to reduce the
6001 cost of compilation and to make debugging produce the expected results.
6002 Statements are independent: if you stop the program with a breakpoint
6003 between statements, you can then assign a new value to any variable or
6004 change the program counter to any other statement in the function and
6005 get exactly the results you expect from the source code.
6006
6007 Turning on optimization flags makes the compiler attempt to improve the
6008 performance and/or code size at the expense of compilation time and
6009 possibly the ability to debug the program.
6010
6011 The compiler performs optimization based on the knowledge it has of the
6012 program. Compiling multiple files at once to a single output file mode
6013 allows the compiler to use information gained from all of the files
6014 when compiling each of them.
6015
6016 Not all optimizations are controlled directly by a flag. Only
6017 optimizations that have a flag are listed in this section.
6018
6019 Most optimizations are only enabled if an -O level is set on the
6020 command line. Otherwise they are disabled, even if individual
6021 optimization flags are specified.
6022
6023 Depending on the target and how GCC was configured, a slightly
6024 different set of optimizations may be enabled at each -O level than
6025 those listed here. You can invoke GCC with -Q --help=optimizers to
6026 find out the exact set of optimizations that are enabled at each level.
6027
6028 -O
6029 -O1 Optimize. Optimizing compilation takes somewhat more time, and a
6030 lot more memory for a large function.
6031
6032 With -O, the compiler tries to reduce code size and execution time,
6033 without performing any optimizations that take a great deal of
6034 compilation time.
6035
6036 -O turns on the following optimization flags:
6037
6038 -fauto-inc-dec -fbranch-count-reg -fcombine-stack-adjustments
6039 -fcompare-elim -fcprop-registers -fdce -fdefer-pop -fdelayed-branch
6040 -fdse -fforward-propagate -fguess-branch-probability
6041 -fif-conversion2 -fif-conversion -finline-functions-called-once
6042 -fipa-pure-const -fipa-profile -fipa-reference -fmerge-constants
6043 -fmove-loop-invariants -fomit-frame-pointer -freorder-blocks
6044 -fshrink-wrap -fshrink-wrap-separate -fsplit-wide-types
6045 -fssa-backprop -fssa-phiopt -ftree-bit-ccp -ftree-ccp -ftree-ch
6046 -ftree-coalesce-vars -ftree-copy-prop -ftree-dce
6047 -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre
6048 -ftree-phiprop -ftree-sink -ftree-slsr -ftree-sra -ftree-pta
6049 -ftree-ter -funit-at-a-time
6050
6051 -O2 Optimize even more. GCC performs nearly all supported
6052 optimizations that do not involve a space-speed tradeoff. As
6053 compared to -O, this option increases both compilation time and the
6054 performance of the generated code.
6055
6056 -O2 turns on all optimization flags specified by -O. It also turns
6057 on the following optimization flags: -fthread-jumps
6058 -falign-functions -falign-jumps -falign-loops -falign-labels
6059 -fcaller-saves -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks
6060 -fdelete-null-pointer-checks -fdevirtualize
6061 -fdevirtualize-speculatively -fexpensive-optimizations -fgcse
6062 -fgcse-lm -fhoist-adjacent-loads -finline-small-functions
6063 -findirect-inlining -fipa-cp -fipa-bit-cp -fipa-vrp -fipa-sra
6064 -fipa-icf -fisolate-erroneous-paths-dereference -flra-remat
6065 -foptimize-sibling-calls -foptimize-strlen -fpartial-inlining
6066 -fpeephole2 -freorder-blocks-algorithm=stc
6067 -freorder-blocks-and-partition -freorder-functions
6068 -frerun-cse-after-loop -fsched-interblock -fsched-spec
6069 -fschedule-insns -fschedule-insns2 -fstore-merging
6070 -fstrict-aliasing -ftree-builtin-call-dce -ftree-switch-conversion
6071 -ftree-tail-merge -fcode-hoisting -ftree-pre -ftree-vrp -fipa-ra
6072
6073 Please note the warning under -fgcse about invoking -O2 on programs
6074 that use computed gotos.
6075
6076 -O3 Optimize yet more. -O3 turns on all optimizations specified by -O2
6077 and also turns on the following optimization flags:
6078 -finline-functions -funswitch-loops -fpredictive-commoning
6079 -fgcse-after-reload -ftree-loop-vectorize -ftree-loop-distribution
6080 -ftree-loop-distribute-patterns -floop-interchange
6081 -floop-unroll-and-jam -fsplit-paths -ftree-slp-vectorize
6082 -fvect-cost-model -ftree-partial-pre -fpeel-loops -fipa-cp-clone
6083
6084 -O0 Reduce compilation time and make debugging produce the expected
6085 results. This is the default.
6086
6087 -Os Optimize for size. -Os enables all -O2 optimizations that do not
6088 typically increase code size. It also performs further
6089 optimizations designed to reduce code size.
6090
6091 -Os disables the following optimization flags: -falign-functions
6092 -falign-jumps -falign-loops -falign-labels -freorder-blocks
6093 -freorder-blocks-algorithm=stc -freorder-blocks-and-partition
6094 -fprefetch-loop-arrays
6095
6096 -Ofast
6097 Disregard strict standards compliance. -Ofast enables all -O3
6098 optimizations. It also enables optimizations that are not valid
6099 for all standard-compliant programs. It turns on -ffast-math and
6100 the Fortran-specific -fstack-arrays, unless -fmax-stack-var-size is
6101 specified, and -fno-protect-parens.
6102
6103 -Og Optimize debugging experience. -Og enables optimizations that do
6104 not interfere with debugging. It should be the optimization level
6105 of choice for the standard edit-compile-debug cycle, offering a
6106 reasonable level of optimization while maintaining fast compilation
6107 and a good debugging experience.
6108
6109 If you use multiple -O options, with or without level numbers, the last
6110 such option is the one that is effective.
6111
6112 Options of the form -fflag specify machine-independent flags. Most
6113 flags have both positive and negative forms; the negative form of -ffoo
6114 is -fno-foo. In the table below, only one of the forms is listed---the
6115 one you typically use. You can figure out the other form by either
6116 removing no- or adding it.
6117
6118 The following options control specific optimizations. They are either
6119 activated by -O options or are related to ones that are. You can use
6120 the following flags in the rare cases when "fine-tuning" of
6121 optimizations to be performed is desired.
6122
6123 -fno-defer-pop
6124 Always pop the arguments to each function call as soon as that
6125 function returns. For machines that must pop arguments after a
6126 function call, the compiler normally lets arguments accumulate on
6127 the stack for several function calls and pops them all at once.
6128
6129 Disabled at levels -O, -O2, -O3, -Os.
6130
6131 -fforward-propagate
6132 Perform a forward propagation pass on RTL. The pass tries to
6133 combine two instructions and checks if the result can be
6134 simplified. If loop unrolling is active, two passes are performed
6135 and the second is scheduled after loop unrolling.
6136
6137 This option is enabled by default at optimization levels -O, -O2,
6138 -O3, -Os.
6139
6140 -ffp-contract=style
6141 -ffp-contract=off disables floating-point expression contraction.
6142 -ffp-contract=fast enables floating-point expression contraction
6143 such as forming of fused multiply-add operations if the target has
6144 native support for them. -ffp-contract=on enables floating-point
6145 expression contraction if allowed by the language standard. This
6146 is currently not implemented and treated equal to
6147 -ffp-contract=off.
6148
6149 The default is -ffp-contract=fast.
6150
6151 -fomit-frame-pointer
6152 Omit the frame pointer in functions that don't need one. This
6153 avoids the instructions to save, set up and restore the frame
6154 pointer; on many targets it also makes an extra register available.
6155
6156 On some targets this flag has no effect because the standard
6157 calling sequence always uses a frame pointer, so it cannot be
6158 omitted.
6159
6160 Note that -fno-omit-frame-pointer doesn't guarantee the frame
6161 pointer is used in all functions. Several targets always omit the
6162 frame pointer in leaf functions.
6163
6164 Enabled by default at -O and higher.
6165
6166 -foptimize-sibling-calls
6167 Optimize sibling and tail recursive calls.
6168
6169 Enabled at levels -O2, -O3, -Os.
6170
6171 -foptimize-strlen
6172 Optimize various standard C string functions (e.g. "strlen",
6173 "strchr" or "strcpy") and their "_FORTIFY_SOURCE" counterparts into
6174 faster alternatives.
6175
6176 Enabled at levels -O2, -O3.
6177
6178 -fno-inline
6179 Do not expand any functions inline apart from those marked with the
6180 "always_inline" attribute. This is the default when not
6181 optimizing.
6182
6183 Single functions can be exempted from inlining by marking them with
6184 the "noinline" attribute.
6185
6186 -finline-small-functions
6187 Integrate functions into their callers when their body is smaller
6188 than expected function call code (so overall size of program gets
6189 smaller). The compiler heuristically decides which functions are
6190 simple enough to be worth integrating in this way. This inlining
6191 applies to all functions, even those not declared inline.
6192
6193 Enabled at levels -O2, -O3, -Os.
6194
6195 -findirect-inlining
6196 Inline also indirect calls that are discovered to be known at
6197 compile time thanks to previous inlining. This option has any
6198 effect only when inlining itself is turned on by the
6199 -finline-functions or -finline-small-functions options.
6200
6201 Enabled at levels -O2, -O3, -Os.
6202
6203 -finline-functions
6204 Consider all functions for inlining, even if they are not declared
6205 inline. The compiler heuristically decides which functions are
6206 worth integrating in this way.
6207
6208 If all calls to a given function are integrated, and the function
6209 is declared "static", then the function is normally not output as
6210 assembler code in its own right.
6211
6212 Enabled at levels -O2, -O3, -Os.
6213
6214 -finline-functions-called-once
6215 Consider all "static" functions called once for inlining into their
6216 caller even if they are not marked "inline". If a call to a given
6217 function is integrated, then the function is not output as
6218 assembler code in its own right.
6219
6220 Enabled at levels -O1, -O2, -O3 and -Os.
6221
6222 -fearly-inlining
6223 Inline functions marked by "always_inline" and functions whose body
6224 seems smaller than the function call overhead early before doing
6225 -fprofile-generate instrumentation and real inlining pass. Doing
6226 so makes profiling significantly cheaper and usually inlining
6227 faster on programs having large chains of nested wrapper functions.
6228
6229 Enabled by default.
6230
6231 -fipa-sra
6232 Perform interprocedural scalar replacement of aggregates, removal
6233 of unused parameters and replacement of parameters passed by
6234 reference by parameters passed by value.
6235
6236 Enabled at levels -O2, -O3 and -Os.
6237
6238 -finline-limit=n
6239 By default, GCC limits the size of functions that can be inlined.
6240 This flag allows coarse control of this limit. n is the size of
6241 functions that can be inlined in number of pseudo instructions.
6242
6243 Inlining is actually controlled by a number of parameters, which
6244 may be specified individually by using --param name=value. The
6245 -finline-limit=n option sets some of these parameters as follows:
6246
6247 max-inline-insns-single
6248 is set to n/2.
6249
6250 max-inline-insns-auto
6251 is set to n/2.
6252
6253 See below for a documentation of the individual parameters
6254 controlling inlining and for the defaults of these parameters.
6255
6256 Note: there may be no value to -finline-limit that results in
6257 default behavior.
6258
6259 Note: pseudo instruction represents, in this particular context, an
6260 abstract measurement of function's size. In no way does it
6261 represent a count of assembly instructions and as such its exact
6262 meaning might change from one release to an another.
6263
6264 -fno-keep-inline-dllexport
6265 This is a more fine-grained version of -fkeep-inline-functions,
6266 which applies only to functions that are declared using the
6267 "dllexport" attribute or declspec.
6268
6269 -fkeep-inline-functions
6270 In C, emit "static" functions that are declared "inline" into the
6271 object file, even if the function has been inlined into all of its
6272 callers. This switch does not affect functions using the "extern
6273 inline" extension in GNU C90. In C++, emit any and all inline
6274 functions into the object file.
6275
6276 -fkeep-static-functions
6277 Emit "static" functions into the object file, even if the function
6278 is never used.
6279
6280 -fkeep-static-consts
6281 Emit variables declared "static const" when optimization isn't
6282 turned on, even if the variables aren't referenced.
6283
6284 GCC enables this option by default. If you want to force the
6285 compiler to check if a variable is referenced, regardless of
6286 whether or not optimization is turned on, use the
6287 -fno-keep-static-consts option.
6288
6289 -fmerge-constants
6290 Attempt to merge identical constants (string constants and
6291 floating-point constants) across compilation units.
6292
6293 This option is the default for optimized compilation if the
6294 assembler and linker support it. Use -fno-merge-constants to
6295 inhibit this behavior.
6296
6297 Enabled at levels -O, -O2, -O3, -Os.
6298
6299 -fmerge-all-constants
6300 Attempt to merge identical constants and identical variables.
6301
6302 This option implies -fmerge-constants. In addition to
6303 -fmerge-constants this considers e.g. even constant initialized
6304 arrays or initialized constant variables with integral or floating-
6305 point types. Languages like C or C++ require each variable,
6306 including multiple instances of the same variable in recursive
6307 calls, to have distinct locations, so using this option results in
6308 non-conforming behavior.
6309
6310 -fmodulo-sched
6311 Perform swing modulo scheduling immediately before the first
6312 scheduling pass. This pass looks at innermost loops and reorders
6313 their instructions by overlapping different iterations.
6314
6315 -fmodulo-sched-allow-regmoves
6316 Perform more aggressive SMS-based modulo scheduling with register
6317 moves allowed. By setting this flag certain anti-dependences edges
6318 are deleted, which triggers the generation of reg-moves based on
6319 the life-range analysis. This option is effective only with
6320 -fmodulo-sched enabled.
6321
6322 -fno-branch-count-reg
6323 Avoid running a pass scanning for opportunities to use "decrement
6324 and branch" instructions on a count register instead of generating
6325 sequences of instructions that decrement a register, compare it
6326 against zero, and then branch based upon the result. This option
6327 is only meaningful on architectures that support such instructions,
6328 which include x86, PowerPC, IA-64 and S/390. Note that the
6329 -fno-branch-count-reg option doesn't remove the decrement and
6330 branch instructions from the generated instruction stream
6331 introduced by other optimization passes.
6332
6333 Enabled by default at -O1 and higher.
6334
6335 The default is -fbranch-count-reg.
6336
6337 -fno-function-cse
6338 Do not put function addresses in registers; make each instruction
6339 that calls a constant function contain the function's address
6340 explicitly.
6341
6342 This option results in less efficient code, but some strange hacks
6343 that alter the assembler output may be confused by the
6344 optimizations performed when this option is not used.
6345
6346 The default is -ffunction-cse
6347
6348 -fno-zero-initialized-in-bss
6349 If the target supports a BSS section, GCC by default puts variables
6350 that are initialized to zero into BSS. This can save space in the
6351 resulting code.
6352
6353 This option turns off this behavior because some programs
6354 explicitly rely on variables going to the data section---e.g., so
6355 that the resulting executable can find the beginning of that
6356 section and/or make assumptions based on that.
6357
6358 The default is -fzero-initialized-in-bss.
6359
6360 -fthread-jumps
6361 Perform optimizations that check to see if a jump branches to a
6362 location where another comparison subsumed by the first is found.
6363 If so, the first branch is redirected to either the destination of
6364 the second branch or a point immediately following it, depending on
6365 whether the condition is known to be true or false.
6366
6367 Enabled at levels -O2, -O3, -Os.
6368
6369 -fsplit-wide-types
6370 When using a type that occupies multiple registers, such as "long
6371 long" on a 32-bit system, split the registers apart and allocate
6372 them independently. This normally generates better code for those
6373 types, but may make debugging more difficult.
6374
6375 Enabled at levels -O, -O2, -O3, -Os.
6376
6377 -fcse-follow-jumps
6378 In common subexpression elimination (CSE), scan through jump
6379 instructions when the target of the jump is not reached by any
6380 other path. For example, when CSE encounters an "if" statement
6381 with an "else" clause, CSE follows the jump when the condition
6382 tested is false.
6383
6384 Enabled at levels -O2, -O3, -Os.
6385
6386 -fcse-skip-blocks
6387 This is similar to -fcse-follow-jumps, but causes CSE to follow
6388 jumps that conditionally skip over blocks. When CSE encounters a
6389 simple "if" statement with no else clause, -fcse-skip-blocks causes
6390 CSE to follow the jump around the body of the "if".
6391
6392 Enabled at levels -O2, -O3, -Os.
6393
6394 -frerun-cse-after-loop
6395 Re-run common subexpression elimination after loop optimizations
6396 are performed.
6397
6398 Enabled at levels -O2, -O3, -Os.
6399
6400 -fgcse
6401 Perform a global common subexpression elimination pass. This pass
6402 also performs global constant and copy propagation.
6403
6404 Note: When compiling a program using computed gotos, a GCC
6405 extension, you may get better run-time performance if you disable
6406 the global common subexpression elimination pass by adding
6407 -fno-gcse to the command line.
6408
6409 Enabled at levels -O2, -O3, -Os.
6410
6411 -fgcse-lm
6412 When -fgcse-lm is enabled, global common subexpression elimination
6413 attempts to move loads that are only killed by stores into
6414 themselves. This allows a loop containing a load/store sequence to
6415 be changed to a load outside the loop, and a copy/store within the
6416 loop.
6417
6418 Enabled by default when -fgcse is enabled.
6419
6420 -fgcse-sm
6421 When -fgcse-sm is enabled, a store motion pass is run after global
6422 common subexpression elimination. This pass attempts to move
6423 stores out of loops. When used in conjunction with -fgcse-lm,
6424 loops containing a load/store sequence can be changed to a load
6425 before the loop and a store after the loop.
6426
6427 Not enabled at any optimization level.
6428
6429 -fgcse-las
6430 When -fgcse-las is enabled, the global common subexpression
6431 elimination pass eliminates redundant loads that come after stores
6432 to the same memory location (both partial and full redundancies).
6433
6434 Not enabled at any optimization level.
6435
6436 -fgcse-after-reload
6437 When -fgcse-after-reload is enabled, a redundant load elimination
6438 pass is performed after reload. The purpose of this pass is to
6439 clean up redundant spilling.
6440
6441 -faggressive-loop-optimizations
6442 This option tells the loop optimizer to use language constraints to
6443 derive bounds for the number of iterations of a loop. This assumes
6444 that loop code does not invoke undefined behavior by for example
6445 causing signed integer overflows or out-of-bound array accesses.
6446 The bounds for the number of iterations of a loop are used to guide
6447 loop unrolling and peeling and loop exit test optimizations. This
6448 option is enabled by default.
6449
6450 -funconstrained-commons
6451 This option tells the compiler that variables declared in common
6452 blocks (e.g. Fortran) may later be overridden with longer trailing
6453 arrays. This prevents certain optimizations that depend on knowing
6454 the array bounds.
6455
6456 -fcrossjumping
6457 Perform cross-jumping transformation. This transformation unifies
6458 equivalent code and saves code size. The resulting code may or may
6459 not perform better than without cross-jumping.
6460
6461 Enabled at levels -O2, -O3, -Os.
6462
6463 -fauto-inc-dec
6464 Combine increments or decrements of addresses with memory accesses.
6465 This pass is always skipped on architectures that do not have
6466 instructions to support this. Enabled by default at -O and higher
6467 on architectures that support this.
6468
6469 -fdce
6470 Perform dead code elimination (DCE) on RTL. Enabled by default at
6471 -O and higher.
6472
6473 -fdse
6474 Perform dead store elimination (DSE) on RTL. Enabled by default at
6475 -O and higher.
6476
6477 -fif-conversion
6478 Attempt to transform conditional jumps into branch-less
6479 equivalents. This includes use of conditional moves, min, max, set
6480 flags and abs instructions, and some tricks doable by standard
6481 arithmetics. The use of conditional execution on chips where it is
6482 available is controlled by -fif-conversion2.
6483
6484 Enabled at levels -O, -O2, -O3, -Os.
6485
6486 -fif-conversion2
6487 Use conditional execution (where available) to transform
6488 conditional jumps into branch-less equivalents.
6489
6490 Enabled at levels -O, -O2, -O3, -Os.
6491
6492 -fdeclone-ctor-dtor
6493 The C++ ABI requires multiple entry points for constructors and
6494 destructors: one for a base subobject, one for a complete object,
6495 and one for a virtual destructor that calls operator delete
6496 afterwards. For a hierarchy with virtual bases, the base and
6497 complete variants are clones, which means two copies of the
6498 function. With this option, the base and complete variants are
6499 changed to be thunks that call a common implementation.
6500
6501 Enabled by -Os.
6502
6503 -fdelete-null-pointer-checks
6504 Assume that programs cannot safely dereference null pointers, and
6505 that no code or data element resides at address zero. This option
6506 enables simple constant folding optimizations at all optimization
6507 levels. In addition, other optimization passes in GCC use this
6508 flag to control global dataflow analyses that eliminate useless
6509 checks for null pointers; these assume that a memory access to
6510 address zero always results in a trap, so that if a pointer is
6511 checked after it has already been dereferenced, it cannot be null.
6512
6513 Note however that in some environments this assumption is not true.
6514 Use -fno-delete-null-pointer-checks to disable this optimization
6515 for programs that depend on that behavior.
6516
6517 This option is enabled by default on most targets. On Nios II ELF,
6518 it defaults to off. On AVR, CR16, and MSP430, this option is
6519 completely disabled.
6520
6521 Passes that use the dataflow information are enabled independently
6522 at different optimization levels.
6523
6524 -fdevirtualize
6525 Attempt to convert calls to virtual functions to direct calls.
6526 This is done both within a procedure and interprocedurally as part
6527 of indirect inlining (-findirect-inlining) and interprocedural
6528 constant propagation (-fipa-cp). Enabled at levels -O2, -O3, -Os.
6529
6530 -fdevirtualize-speculatively
6531 Attempt to convert calls to virtual functions to speculative direct
6532 calls. Based on the analysis of the type inheritance graph,
6533 determine for a given call the set of likely targets. If the set is
6534 small, preferably of size 1, change the call into a conditional
6535 deciding between direct and indirect calls. The speculative calls
6536 enable more optimizations, such as inlining. When they seem
6537 useless after further optimization, they are converted back into
6538 original form.
6539
6540 -fdevirtualize-at-ltrans
6541 Stream extra information needed for aggressive devirtualization
6542 when running the link-time optimizer in local transformation mode.
6543 This option enables more devirtualization but significantly
6544 increases the size of streamed data. For this reason it is disabled
6545 by default.
6546
6547 -fexpensive-optimizations
6548 Perform a number of minor optimizations that are relatively
6549 expensive.
6550
6551 Enabled at levels -O2, -O3, -Os.
6552
6553 -free
6554 Attempt to remove redundant extension instructions. This is
6555 especially helpful for the x86-64 architecture, which implicitly
6556 zero-extends in 64-bit registers after writing to their lower
6557 32-bit half.
6558
6559 Enabled for Alpha, AArch64 and x86 at levels -O2, -O3, -Os.
6560
6561 -fno-lifetime-dse
6562 In C++ the value of an object is only affected by changes within
6563 its lifetime: when the constructor begins, the object has an
6564 indeterminate value, and any changes during the lifetime of the
6565 object are dead when the object is destroyed. Normally dead store
6566 elimination will take advantage of this; if your code relies on the
6567 value of the object storage persisting beyond the lifetime of the
6568 object, you can use this flag to disable this optimization. To
6569 preserve stores before the constructor starts (e.g. because your
6570 operator new clears the object storage) but still treat the object
6571 as dead after the destructor you, can use -flifetime-dse=1. The
6572 default behavior can be explicitly selected with -flifetime-dse=2.
6573 -flifetime-dse=0 is equivalent to -fno-lifetime-dse.
6574
6575 -flive-range-shrinkage
6576 Attempt to decrease register pressure through register live range
6577 shrinkage. This is helpful for fast processors with small or
6578 moderate size register sets.
6579
6580 -fira-algorithm=algorithm
6581 Use the specified coloring algorithm for the integrated register
6582 allocator. The algorithm argument can be priority, which specifies
6583 Chow's priority coloring, or CB, which specifies Chaitin-Briggs
6584 coloring. Chaitin-Briggs coloring is not implemented for all
6585 architectures, but for those targets that do support it, it is the
6586 default because it generates better code.
6587
6588 -fira-region=region
6589 Use specified regions for the integrated register allocator. The
6590 region argument should be one of the following:
6591
6592 all Use all loops as register allocation regions. This can give
6593 the best results for machines with a small and/or irregular
6594 register set.
6595
6596 mixed
6597 Use all loops except for loops with small register pressure as
6598 the regions. This value usually gives the best results in most
6599 cases and for most architectures, and is enabled by default
6600 when compiling with optimization for speed (-O, -O2, ...).
6601
6602 one Use all functions as a single region. This typically results
6603 in the smallest code size, and is enabled by default for -Os or
6604 -O0.
6605
6606 -fira-hoist-pressure
6607 Use IRA to evaluate register pressure in the code hoisting pass for
6608 decisions to hoist expressions. This option usually results in
6609 smaller code, but it can slow the compiler down.
6610
6611 This option is enabled at level -Os for all targets.
6612
6613 -fira-loop-pressure
6614 Use IRA to evaluate register pressure in loops for decisions to
6615 move loop invariants. This option usually results in generation of
6616 faster and smaller code on machines with large register files (>=
6617 32 registers), but it can slow the compiler down.
6618
6619 This option is enabled at level -O3 for some targets.
6620
6621 -fno-ira-share-save-slots
6622 Disable sharing of stack slots used for saving call-used hard
6623 registers living through a call. Each hard register gets a
6624 separate stack slot, and as a result function stack frames are
6625 larger.
6626
6627 -fno-ira-share-spill-slots
6628 Disable sharing of stack slots allocated for pseudo-registers.
6629 Each pseudo-register that does not get a hard register gets a
6630 separate stack slot, and as a result function stack frames are
6631 larger.
6632
6633 -flra-remat
6634 Enable CFG-sensitive rematerialization in LRA. Instead of loading
6635 values of spilled pseudos, LRA tries to rematerialize (recalculate)
6636 values if it is profitable.
6637
6638 Enabled at levels -O2, -O3, -Os.
6639
6640 -fdelayed-branch
6641 If supported for the target machine, attempt to reorder
6642 instructions to exploit instruction slots available after delayed
6643 branch instructions.
6644
6645 Enabled at levels -O, -O2, -O3, -Os.
6646
6647 -fschedule-insns
6648 If supported for the target machine, attempt to reorder
6649 instructions to eliminate execution stalls due to required data
6650 being unavailable. This helps machines that have slow floating
6651 point or memory load instructions by allowing other instructions to
6652 be issued until the result of the load or floating-point
6653 instruction is required.
6654
6655 Enabled at levels -O2, -O3.
6656
6657 -fschedule-insns2
6658 Similar to -fschedule-insns, but requests an additional pass of
6659 instruction scheduling after register allocation has been done.
6660 This is especially useful on machines with a relatively small
6661 number of registers and where memory load instructions take more
6662 than one cycle.
6663
6664 Enabled at levels -O2, -O3, -Os.
6665
6666 -fno-sched-interblock
6667 Don't schedule instructions across basic blocks. This is normally
6668 enabled by default when scheduling before register allocation, i.e.
6669 with -fschedule-insns or at -O2 or higher.
6670
6671 -fno-sched-spec
6672 Don't allow speculative motion of non-load instructions. This is
6673 normally enabled by default when scheduling before register
6674 allocation, i.e. with -fschedule-insns or at -O2 or higher.
6675
6676 -fsched-pressure
6677 Enable register pressure sensitive insn scheduling before register
6678 allocation. This only makes sense when scheduling before register
6679 allocation is enabled, i.e. with -fschedule-insns or at -O2 or
6680 higher. Usage of this option can improve the generated code and
6681 decrease its size by preventing register pressure increase above
6682 the number of available hard registers and subsequent spills in
6683 register allocation.
6684
6685 -fsched-spec-load
6686 Allow speculative motion of some load instructions. This only
6687 makes sense when scheduling before register allocation, i.e. with
6688 -fschedule-insns or at -O2 or higher.
6689
6690 -fsched-spec-load-dangerous
6691 Allow speculative motion of more load instructions. This only
6692 makes sense when scheduling before register allocation, i.e. with
6693 -fschedule-insns or at -O2 or higher.
6694
6695 -fsched-stalled-insns
6696 -fsched-stalled-insns=n
6697 Define how many insns (if any) can be moved prematurely from the
6698 queue of stalled insns into the ready list during the second
6699 scheduling pass. -fno-sched-stalled-insns means that no insns are
6700 moved prematurely, -fsched-stalled-insns=0 means there is no limit
6701 on how many queued insns can be moved prematurely.
6702 -fsched-stalled-insns without a value is equivalent to
6703 -fsched-stalled-insns=1.
6704
6705 -fsched-stalled-insns-dep
6706 -fsched-stalled-insns-dep=n
6707 Define how many insn groups (cycles) are examined for a dependency
6708 on a stalled insn that is a candidate for premature removal from
6709 the queue of stalled insns. This has an effect only during the
6710 second scheduling pass, and only if -fsched-stalled-insns is used.
6711 -fno-sched-stalled-insns-dep is equivalent to
6712 -fsched-stalled-insns-dep=0. -fsched-stalled-insns-dep without a
6713 value is equivalent to -fsched-stalled-insns-dep=1.
6714
6715 -fsched2-use-superblocks
6716 When scheduling after register allocation, use superblock
6717 scheduling. This allows motion across basic block boundaries,
6718 resulting in faster schedules. This option is experimental, as not
6719 all machine descriptions used by GCC model the CPU closely enough
6720 to avoid unreliable results from the algorithm.
6721
6722 This only makes sense when scheduling after register allocation,
6723 i.e. with -fschedule-insns2 or at -O2 or higher.
6724
6725 -fsched-group-heuristic
6726 Enable the group heuristic in the scheduler. This heuristic favors
6727 the instruction that belongs to a schedule group. This is enabled
6728 by default when scheduling is enabled, i.e. with -fschedule-insns
6729 or -fschedule-insns2 or at -O2 or higher.
6730
6731 -fsched-critical-path-heuristic
6732 Enable the critical-path heuristic in the scheduler. This
6733 heuristic favors instructions on the critical path. This is
6734 enabled by default when scheduling is enabled, i.e. with
6735 -fschedule-insns or -fschedule-insns2 or at -O2 or higher.
6736
6737 -fsched-spec-insn-heuristic
6738 Enable the speculative instruction heuristic in the scheduler.
6739 This heuristic favors speculative instructions with greater
6740 dependency weakness. This is enabled by default when scheduling is
6741 enabled, i.e. with -fschedule-insns or -fschedule-insns2 or at -O2
6742 or higher.
6743
6744 -fsched-rank-heuristic
6745 Enable the rank heuristic in the scheduler. This heuristic favors
6746 the instruction belonging to a basic block with greater size or
6747 frequency. This is enabled by default when scheduling is enabled,
6748 i.e. with -fschedule-insns or -fschedule-insns2 or at -O2 or
6749 higher.
6750
6751 -fsched-last-insn-heuristic
6752 Enable the last-instruction heuristic in the scheduler. This
6753 heuristic favors the instruction that is less dependent on the last
6754 instruction scheduled. This is enabled by default when scheduling
6755 is enabled, i.e. with -fschedule-insns or -fschedule-insns2 or at
6756 -O2 or higher.
6757
6758 -fsched-dep-count-heuristic
6759 Enable the dependent-count heuristic in the scheduler. This
6760 heuristic favors the instruction that has more instructions
6761 depending on it. This is enabled by default when scheduling is
6762 enabled, i.e. with -fschedule-insns or -fschedule-insns2 or at -O2
6763 or higher.
6764
6765 -freschedule-modulo-scheduled-loops
6766 Modulo scheduling is performed before traditional scheduling. If a
6767 loop is modulo scheduled, later scheduling passes may change its
6768 schedule. Use this option to control that behavior.
6769
6770 -fselective-scheduling
6771 Schedule instructions using selective scheduling algorithm.
6772 Selective scheduling runs instead of the first scheduler pass.
6773
6774 -fselective-scheduling2
6775 Schedule instructions using selective scheduling algorithm.
6776 Selective scheduling runs instead of the second scheduler pass.
6777
6778 -fsel-sched-pipelining
6779 Enable software pipelining of innermost loops during selective
6780 scheduling. This option has no effect unless one of
6781 -fselective-scheduling or -fselective-scheduling2 is turned on.
6782
6783 -fsel-sched-pipelining-outer-loops
6784 When pipelining loops during selective scheduling, also pipeline
6785 outer loops. This option has no effect unless
6786 -fsel-sched-pipelining is turned on.
6787
6788 -fsemantic-interposition
6789 Some object formats, like ELF, allow interposing of symbols by the
6790 dynamic linker. This means that for symbols exported from the DSO,
6791 the compiler cannot perform interprocedural propagation, inlining
6792 and other optimizations in anticipation that the function or
6793 variable in question may change. While this feature is useful, for
6794 example, to rewrite memory allocation functions by a debugging
6795 implementation, it is expensive in the terms of code quality. With
6796 -fno-semantic-interposition the compiler assumes that if
6797 interposition happens for functions the overwriting function will
6798 have precisely the same semantics (and side effects). Similarly if
6799 interposition happens for variables, the constructor of the
6800 variable will be the same. The flag has no effect for functions
6801 explicitly declared inline (where it is never allowed for
6802 interposition to change semantics) and for symbols explicitly
6803 declared weak.
6804
6805 -fshrink-wrap
6806 Emit function prologues only before parts of the function that need
6807 it, rather than at the top of the function. This flag is enabled
6808 by default at -O and higher.
6809
6810 -fshrink-wrap-separate
6811 Shrink-wrap separate parts of the prologue and epilogue separately,
6812 so that those parts are only executed when needed. This option is
6813 on by default, but has no effect unless -fshrink-wrap is also
6814 turned on and the target supports this.
6815
6816 -fcaller-saves
6817 Enable allocation of values to registers that are clobbered by
6818 function calls, by emitting extra instructions to save and restore
6819 the registers around such calls. Such allocation is done only when
6820 it seems to result in better code.
6821
6822 This option is always enabled by default on certain machines,
6823 usually those which have no call-preserved registers to use
6824 instead.
6825
6826 Enabled at levels -O2, -O3, -Os.
6827
6828 -fcombine-stack-adjustments
6829 Tracks stack adjustments (pushes and pops) and stack memory
6830 references and then tries to find ways to combine them.
6831
6832 Enabled by default at -O1 and higher.
6833
6834 -fipa-ra
6835 Use caller save registers for allocation if those registers are not
6836 used by any called function. In that case it is not necessary to
6837 save and restore them around calls. This is only possible if
6838 called functions are part of same compilation unit as current
6839 function and they are compiled before it.
6840
6841 Enabled at levels -O2, -O3, -Os, however the option is disabled if
6842 generated code will be instrumented for profiling (-p, or -pg) or
6843 if callee's register usage cannot be known exactly (this happens on
6844 targets that do not expose prologues and epilogues in RTL).
6845
6846 -fconserve-stack
6847 Attempt to minimize stack usage. The compiler attempts to use less
6848 stack space, even if that makes the program slower. This option
6849 implies setting the large-stack-frame parameter to 100 and the
6850 large-stack-frame-growth parameter to 400.
6851
6852 -ftree-reassoc
6853 Perform reassociation on trees. This flag is enabled by default at
6854 -O and higher.
6855
6856 -fcode-hoisting
6857 Perform code hoisting. Code hoisting tries to move the evaluation
6858 of expressions executed on all paths to the function exit as early
6859 as possible. This is especially useful as a code size
6860 optimization, but it often helps for code speed as well. This flag
6861 is enabled by default at -O2 and higher.
6862
6863 -ftree-pre
6864 Perform partial redundancy elimination (PRE) on trees. This flag
6865 is enabled by default at -O2 and -O3.
6866
6867 -ftree-partial-pre
6868 Make partial redundancy elimination (PRE) more aggressive. This
6869 flag is enabled by default at -O3.
6870
6871 -ftree-forwprop
6872 Perform forward propagation on trees. This flag is enabled by
6873 default at -O and higher.
6874
6875 -ftree-fre
6876 Perform full redundancy elimination (FRE) on trees. The difference
6877 between FRE and PRE is that FRE only considers expressions that are
6878 computed on all paths leading to the redundant computation. This
6879 analysis is faster than PRE, though it exposes fewer redundancies.
6880 This flag is enabled by default at -O and higher.
6881
6882 -ftree-phiprop
6883 Perform hoisting of loads from conditional pointers on trees. This
6884 pass is enabled by default at -O and higher.
6885
6886 -fhoist-adjacent-loads
6887 Speculatively hoist loads from both branches of an if-then-else if
6888 the loads are from adjacent locations in the same structure and the
6889 target architecture has a conditional move instruction. This flag
6890 is enabled by default at -O2 and higher.
6891
6892 -ftree-copy-prop
6893 Perform copy propagation on trees. This pass eliminates
6894 unnecessary copy operations. This flag is enabled by default at -O
6895 and higher.
6896
6897 -fipa-pure-const
6898 Discover which functions are pure or constant. Enabled by default
6899 at -O and higher.
6900
6901 -fipa-reference
6902 Discover which static variables do not escape the compilation unit.
6903 Enabled by default at -O and higher.
6904
6905 -fipa-pta
6906 Perform interprocedural pointer analysis and interprocedural
6907 modification and reference analysis. This option can cause
6908 excessive memory and compile-time usage on large compilation units.
6909 It is not enabled by default at any optimization level.
6910
6911 -fipa-profile
6912 Perform interprocedural profile propagation. The functions called
6913 only from cold functions are marked as cold. Also functions
6914 executed once (such as "cold", "noreturn", static constructors or
6915 destructors) are identified. Cold functions and loop less parts of
6916 functions executed once are then optimized for size. Enabled by
6917 default at -O and higher.
6918
6919 -fipa-cp
6920 Perform interprocedural constant propagation. This optimization
6921 analyzes the program to determine when values passed to functions
6922 are constants and then optimizes accordingly. This optimization
6923 can substantially increase performance if the application has
6924 constants passed to functions. This flag is enabled by default at
6925 -O2, -Os and -O3.
6926
6927 -fipa-cp-clone
6928 Perform function cloning to make interprocedural constant
6929 propagation stronger. When enabled, interprocedural constant
6930 propagation performs function cloning when externally visible
6931 function can be called with constant arguments. Because this
6932 optimization can create multiple copies of functions, it may
6933 significantly increase code size (see --param
6934 ipcp-unit-growth=value). This flag is enabled by default at -O3.
6935
6936 -fipa-bit-cp
6937 When enabled, perform interprocedural bitwise constant propagation.
6938 This flag is enabled by default at -O2. It requires that -fipa-cp
6939 is enabled.
6940
6941 -fipa-vrp
6942 When enabled, perform interprocedural propagation of value ranges.
6943 This flag is enabled by default at -O2. It requires that -fipa-cp
6944 is enabled.
6945
6946 -fipa-icf
6947 Perform Identical Code Folding for functions and read-only
6948 variables. The optimization reduces code size and may disturb
6949 unwind stacks by replacing a function by equivalent one with a
6950 different name. The optimization works more effectively with link-
6951 time optimization enabled.
6952
6953 Nevertheless the behavior is similar to Gold Linker ICF
6954 optimization, GCC ICF works on different levels and thus the
6955 optimizations are not same - there are equivalences that are found
6956 only by GCC and equivalences found only by Gold.
6957
6958 This flag is enabled by default at -O2 and -Os.
6959
6960 -fisolate-erroneous-paths-dereference
6961 Detect paths that trigger erroneous or undefined behavior due to
6962 dereferencing a null pointer. Isolate those paths from the main
6963 control flow and turn the statement with erroneous or undefined
6964 behavior into a trap. This flag is enabled by default at -O2 and
6965 higher and depends on -fdelete-null-pointer-checks also being
6966 enabled.
6967
6968 -fisolate-erroneous-paths-attribute
6969 Detect paths that trigger erroneous or undefined behavior due to a
6970 null value being used in a way forbidden by a "returns_nonnull" or
6971 "nonnull" attribute. Isolate those paths from the main control
6972 flow and turn the statement with erroneous or undefined behavior
6973 into a trap. This is not currently enabled, but may be enabled by
6974 -O2 in the future.
6975
6976 -ftree-sink
6977 Perform forward store motion on trees. This flag is enabled by
6978 default at -O and higher.
6979
6980 -ftree-bit-ccp
6981 Perform sparse conditional bit constant propagation on trees and
6982 propagate pointer alignment information. This pass only operates
6983 on local scalar variables and is enabled by default at -O and
6984 higher. It requires that -ftree-ccp is enabled.
6985
6986 -ftree-ccp
6987 Perform sparse conditional constant propagation (CCP) on trees.
6988 This pass only operates on local scalar variables and is enabled by
6989 default at -O and higher.
6990
6991 -fssa-backprop
6992 Propagate information about uses of a value up the definition chain
6993 in order to simplify the definitions. For example, this pass
6994 strips sign operations if the sign of a value never matters. The
6995 flag is enabled by default at -O and higher.
6996
6997 -fssa-phiopt
6998 Perform pattern matching on SSA PHI nodes to optimize conditional
6999 code. This pass is enabled by default at -O and higher.
7000
7001 -ftree-switch-conversion
7002 Perform conversion of simple initializations in a switch to
7003 initializations from a scalar array. This flag is enabled by
7004 default at -O2 and higher.
7005
7006 -ftree-tail-merge
7007 Look for identical code sequences. When found, replace one with a
7008 jump to the other. This optimization is known as tail merging or
7009 cross jumping. This flag is enabled by default at -O2 and higher.
7010 The compilation time in this pass can be limited using max-tail-
7011 merge-comparisons parameter and max-tail-merge-iterations
7012 parameter.
7013
7014 -ftree-dce
7015 Perform dead code elimination (DCE) on trees. This flag is enabled
7016 by default at -O and higher.
7017
7018 -ftree-builtin-call-dce
7019 Perform conditional dead code elimination (DCE) for calls to built-
7020 in functions that may set "errno" but are otherwise free of side
7021 effects. This flag is enabled by default at -O2 and higher if -Os
7022 is not also specified.
7023
7024 -ftree-dominator-opts
7025 Perform a variety of simple scalar cleanups (constant/copy
7026 propagation, redundancy elimination, range propagation and
7027 expression simplification) based on a dominator tree traversal.
7028 This also performs jump threading (to reduce jumps to jumps). This
7029 flag is enabled by default at -O and higher.
7030
7031 -ftree-dse
7032 Perform dead store elimination (DSE) on trees. A dead store is a
7033 store into a memory location that is later overwritten by another
7034 store without any intervening loads. In this case the earlier
7035 store can be deleted. This flag is enabled by default at -O and
7036 higher.
7037
7038 -ftree-ch
7039 Perform loop header copying on trees. This is beneficial since it
7040 increases effectiveness of code motion optimizations. It also
7041 saves one jump. This flag is enabled by default at -O and higher.
7042 It is not enabled for -Os, since it usually increases code size.
7043
7044 -ftree-loop-optimize
7045 Perform loop optimizations on trees. This flag is enabled by
7046 default at -O and higher.
7047
7048 -ftree-loop-linear
7049 -floop-strip-mine
7050 -floop-block
7051 Perform loop nest optimizations. Same as -floop-nest-optimize. To
7052 use this code transformation, GCC has to be configured with
7053 --with-isl to enable the Graphite loop transformation
7054 infrastructure.
7055
7056 -fgraphite-identity
7057 Enable the identity transformation for graphite. For every SCoP we
7058 generate the polyhedral representation and transform it back to
7059 gimple. Using -fgraphite-identity we can check the costs or
7060 benefits of the GIMPLE -> GRAPHITE -> GIMPLE transformation. Some
7061 minimal optimizations are also performed by the code generator isl,
7062 like index splitting and dead code elimination in loops.
7063
7064 -floop-nest-optimize
7065 Enable the isl based loop nest optimizer. This is a generic loop
7066 nest optimizer based on the Pluto optimization algorithms. It
7067 calculates a loop structure optimized for data-locality and
7068 parallelism. This option is experimental.
7069
7070 -floop-parallelize-all
7071 Use the Graphite data dependence analysis to identify loops that
7072 can be parallelized. Parallelize all the loops that can be
7073 analyzed to not contain loop carried dependences without checking
7074 that it is profitable to parallelize the loops.
7075
7076 -ftree-coalesce-vars
7077 While transforming the program out of the SSA representation,
7078 attempt to reduce copying by coalescing versions of different user-
7079 defined variables, instead of just compiler temporaries. This may
7080 severely limit the ability to debug an optimized program compiled
7081 with -fno-var-tracking-assignments. In the negated form, this flag
7082 prevents SSA coalescing of user variables. This option is enabled
7083 by default if optimization is enabled, and it does very little
7084 otherwise.
7085
7086 -ftree-loop-if-convert
7087 Attempt to transform conditional jumps in the innermost loops to
7088 branch-less equivalents. The intent is to remove control-flow from
7089 the innermost loops in order to improve the ability of the
7090 vectorization pass to handle these loops. This is enabled by
7091 default if vectorization is enabled.
7092
7093 -ftree-loop-distribution
7094 Perform loop distribution. This flag can improve cache performance
7095 on big loop bodies and allow further loop optimizations, like
7096 parallelization or vectorization, to take place. For example, the
7097 loop
7098
7099 DO I = 1, N
7100 A(I) = B(I) + C
7101 D(I) = E(I) * F
7102 ENDDO
7103
7104 is transformed to
7105
7106 DO I = 1, N
7107 A(I) = B(I) + C
7108 ENDDO
7109 DO I = 1, N
7110 D(I) = E(I) * F
7111 ENDDO
7112
7113 -ftree-loop-distribute-patterns
7114 Perform loop distribution of patterns that can be code generated
7115 with calls to a library. This flag is enabled by default at -O3.
7116
7117 This pass distributes the initialization loops and generates a call
7118 to memset zero. For example, the loop
7119
7120 DO I = 1, N
7121 A(I) = 0
7122 B(I) = A(I) + I
7123 ENDDO
7124
7125 is transformed to
7126
7127 DO I = 1, N
7128 A(I) = 0
7129 ENDDO
7130 DO I = 1, N
7131 B(I) = A(I) + I
7132 ENDDO
7133
7134 and the initialization loop is transformed into a call to memset
7135 zero.
7136
7137 -floop-interchange
7138 Perform loop interchange outside of graphite. This flag can
7139 improve cache performance on loop nest and allow further loop
7140 optimizations, like vectorization, to take place. For example, the
7141 loop
7142
7143 for (int i = 0; i < N; i++)
7144 for (int j = 0; j < N; j++)
7145 for (int k = 0; k < N; k++)
7146 c[i][j] = c[i][j] + a[i][k]*b[k][j];
7147
7148 is transformed to
7149
7150 for (int i = 0; i < N; i++)
7151 for (int k = 0; k < N; k++)
7152 for (int j = 0; j < N; j++)
7153 c[i][j] = c[i][j] + a[i][k]*b[k][j];
7154
7155 This flag is enabled by default at -O3.
7156
7157 -floop-unroll-and-jam
7158 Apply unroll and jam transformations on feasible loops. In a loop
7159 nest this unrolls the outer loop by some factor and fuses the
7160 resulting multiple inner loops. This flag is enabled by default at
7161 -O3.
7162
7163 -ftree-loop-im
7164 Perform loop invariant motion on trees. This pass moves only
7165 invariants that are hard to handle at RTL level (function calls,
7166 operations that expand to nontrivial sequences of insns). With
7167 -funswitch-loops it also moves operands of conditions that are
7168 invariant out of the loop, so that we can use just trivial
7169 invariantness analysis in loop unswitching. The pass also includes
7170 store motion.
7171
7172 -ftree-loop-ivcanon
7173 Create a canonical counter for number of iterations in loops for
7174 which determining number of iterations requires complicated
7175 analysis. Later optimizations then may determine the number
7176 easily. Useful especially in connection with unrolling.
7177
7178 -fivopts
7179 Perform induction variable optimizations (strength reduction,
7180 induction variable merging and induction variable elimination) on
7181 trees.
7182
7183 -ftree-parallelize-loops=n
7184 Parallelize loops, i.e., split their iteration space to run in n
7185 threads. This is only possible for loops whose iterations are
7186 independent and can be arbitrarily reordered. The optimization is
7187 only profitable on multiprocessor machines, for loops that are CPU-
7188 intensive, rather than constrained e.g. by memory bandwidth. This
7189 option implies -pthread, and thus is only supported on targets that
7190 have support for -pthread.
7191
7192 -ftree-pta
7193 Perform function-local points-to analysis on trees. This flag is
7194 enabled by default at -O and higher.
7195
7196 -ftree-sra
7197 Perform scalar replacement of aggregates. This pass replaces
7198 structure references with scalars to prevent committing structures
7199 to memory too early. This flag is enabled by default at -O and
7200 higher.
7201
7202 -fstore-merging
7203 Perform merging of narrow stores to consecutive memory addresses.
7204 This pass merges contiguous stores of immediate values narrower
7205 than a word into fewer wider stores to reduce the number of
7206 instructions. This is enabled by default at -O2 and higher as well
7207 as -Os.
7208
7209 -ftree-ter
7210 Perform temporary expression replacement during the SSA->normal
7211 phase. Single use/single def temporaries are replaced at their use
7212 location with their defining expression. This results in non-
7213 GIMPLE code, but gives the expanders much more complex trees to
7214 work on resulting in better RTL generation. This is enabled by
7215 default at -O and higher.
7216
7217 -ftree-slsr
7218 Perform straight-line strength reduction on trees. This recognizes
7219 related expressions involving multiplications and replaces them by
7220 less expensive calculations when possible. This is enabled by
7221 default at -O and higher.
7222
7223 -ftree-vectorize
7224 Perform vectorization on trees. This flag enables
7225 -ftree-loop-vectorize and -ftree-slp-vectorize if not explicitly
7226 specified.
7227
7228 -ftree-loop-vectorize
7229 Perform loop vectorization on trees. This flag is enabled by
7230 default at -O3 and when -ftree-vectorize is enabled.
7231
7232 -ftree-slp-vectorize
7233 Perform basic block vectorization on trees. This flag is enabled by
7234 default at -O3 and when -ftree-vectorize is enabled.
7235
7236 -fvect-cost-model=model
7237 Alter the cost model used for vectorization. The model argument
7238 should be one of unlimited, dynamic or cheap. With the unlimited
7239 model the vectorized code-path is assumed to be profitable while
7240 with the dynamic model a runtime check guards the vectorized code-
7241 path to enable it only for iteration counts that will likely
7242 execute faster than when executing the original scalar loop. The
7243 cheap model disables vectorization of loops where doing so would be
7244 cost prohibitive for example due to required runtime checks for
7245 data dependence or alignment but otherwise is equal to the dynamic
7246 model. The default cost model depends on other optimization flags
7247 and is either dynamic or cheap.
7248
7249 -fsimd-cost-model=model
7250 Alter the cost model used for vectorization of loops marked with
7251 the OpenMP simd directive. The model argument should be one of
7252 unlimited, dynamic, cheap. All values of model have the same
7253 meaning as described in -fvect-cost-model and by default a cost
7254 model defined with -fvect-cost-model is used.
7255
7256 -ftree-vrp
7257 Perform Value Range Propagation on trees. This is similar to the
7258 constant propagation pass, but instead of values, ranges of values
7259 are propagated. This allows the optimizers to remove unnecessary
7260 range checks like array bound checks and null pointer checks. This
7261 is enabled by default at -O2 and higher. Null pointer check
7262 elimination is only done if -fdelete-null-pointer-checks is
7263 enabled.
7264
7265 -fsplit-paths
7266 Split paths leading to loop backedges. This can improve dead code
7267 elimination and common subexpression elimination. This is enabled
7268 by default at -O2 and above.
7269
7270 -fsplit-ivs-in-unroller
7271 Enables expression of values of induction variables in later
7272 iterations of the unrolled loop using the value in the first
7273 iteration. This breaks long dependency chains, thus improving
7274 efficiency of the scheduling passes.
7275
7276 A combination of -fweb and CSE is often sufficient to obtain the
7277 same effect. However, that is not reliable in cases where the loop
7278 body is more complicated than a single basic block. It also does
7279 not work at all on some architectures due to restrictions in the
7280 CSE pass.
7281
7282 This optimization is enabled by default.
7283
7284 -fvariable-expansion-in-unroller
7285 With this option, the compiler creates multiple copies of some
7286 local variables when unrolling a loop, which can result in superior
7287 code.
7288
7289 -fpartial-inlining
7290 Inline parts of functions. This option has any effect only when
7291 inlining itself is turned on by the -finline-functions or
7292 -finline-small-functions options.
7293
7294 Enabled at levels -O2, -O3, -Os.
7295
7296 -fpredictive-commoning
7297 Perform predictive commoning optimization, i.e., reusing
7298 computations (especially memory loads and stores) performed in
7299 previous iterations of loops.
7300
7301 This option is enabled at level -O3.
7302
7303 -fprefetch-loop-arrays
7304 If supported by the target machine, generate instructions to
7305 prefetch memory to improve the performance of loops that access
7306 large arrays.
7307
7308 This option may generate better or worse code; results are highly
7309 dependent on the structure of loops within the source code.
7310
7311 Disabled at level -Os.
7312
7313 -fno-printf-return-value
7314 Do not substitute constants for known return value of formatted
7315 output functions such as "sprintf", "snprintf", "vsprintf", and
7316 "vsnprintf" (but not "printf" of "fprintf"). This transformation
7317 allows GCC to optimize or even eliminate branches based on the
7318 known return value of these functions called with arguments that
7319 are either constant, or whose values are known to be in a range
7320 that makes determining the exact return value possible. For
7321 example, when -fprintf-return-value is in effect, both the branch
7322 and the body of the "if" statement (but not the call to "snprint")
7323 can be optimized away when "i" is a 32-bit or smaller integer
7324 because the return value is guaranteed to be at most 8.
7325
7326 char buf[9];
7327 if (snprintf (buf, "%08x", i) >= sizeof buf)
7328 ...
7329
7330 The -fprintf-return-value option relies on other optimizations and
7331 yields best results with -O2 and above. It works in tandem with
7332 the -Wformat-overflow and -Wformat-truncation options. The
7333 -fprintf-return-value option is enabled by default.
7334
7335 -fno-peephole
7336 -fno-peephole2
7337 Disable any machine-specific peephole optimizations. The
7338 difference between -fno-peephole and -fno-peephole2 is in how they
7339 are implemented in the compiler; some targets use one, some use the
7340 other, a few use both.
7341
7342 -fpeephole is enabled by default. -fpeephole2 enabled at levels
7343 -O2, -O3, -Os.
7344
7345 -fno-guess-branch-probability
7346 Do not guess branch probabilities using heuristics.
7347
7348 GCC uses heuristics to guess branch probabilities if they are not
7349 provided by profiling feedback (-fprofile-arcs). These heuristics
7350 are based on the control flow graph. If some branch probabilities
7351 are specified by "__builtin_expect", then the heuristics are used
7352 to guess branch probabilities for the rest of the control flow
7353 graph, taking the "__builtin_expect" info into account. The
7354 interactions between the heuristics and "__builtin_expect" can be
7355 complex, and in some cases, it may be useful to disable the
7356 heuristics so that the effects of "__builtin_expect" are easier to
7357 understand.
7358
7359 The default is -fguess-branch-probability at levels -O, -O2, -O3,
7360 -Os.
7361
7362 -freorder-blocks
7363 Reorder basic blocks in the compiled function in order to reduce
7364 number of taken branches and improve code locality.
7365
7366 Enabled at levels -O, -O2, -O3, -Os.
7367
7368 -freorder-blocks-algorithm=algorithm
7369 Use the specified algorithm for basic block reordering. The
7370 algorithm argument can be simple, which does not increase code size
7371 (except sometimes due to secondary effects like alignment), or stc,
7372 the "software trace cache" algorithm, which tries to put all often
7373 executed code together, minimizing the number of branches executed
7374 by making extra copies of code.
7375
7376 The default is simple at levels -O, -Os, and stc at levels -O2,
7377 -O3.
7378
7379 -freorder-blocks-and-partition
7380 In addition to reordering basic blocks in the compiled function, in
7381 order to reduce number of taken branches, partitions hot and cold
7382 basic blocks into separate sections of the assembly and .o files,
7383 to improve paging and cache locality performance.
7384
7385 This optimization is automatically turned off in the presence of
7386 exception handling or unwind tables (on targets using
7387 setjump/longjump or target specific scheme), for linkonce sections,
7388 for functions with a user-defined section attribute and on any
7389 architecture that does not support named sections. When
7390 -fsplit-stack is used this option is not enabled by default (to
7391 avoid linker errors), but may be enabled explicitly (if using a
7392 working linker).
7393
7394 Enabled for x86 at levels -O2, -O3, -Os.
7395
7396 -freorder-functions
7397 Reorder functions in the object file in order to improve code
7398 locality. This is implemented by using special subsections
7399 ".text.hot" for most frequently executed functions and
7400 ".text.unlikely" for unlikely executed functions. Reordering is
7401 done by the linker so object file format must support named
7402 sections and linker must place them in a reasonable way.
7403
7404 Also profile feedback must be available to make this option
7405 effective. See -fprofile-arcs for details.
7406
7407 Enabled at levels -O2, -O3, -Os.
7408
7409 -fstrict-aliasing
7410 Allow the compiler to assume the strictest aliasing rules
7411 applicable to the language being compiled. For C (and C++), this
7412 activates optimizations based on the type of expressions. In
7413 particular, an object of one type is assumed never to reside at the
7414 same address as an object of a different type, unless the types are
7415 almost the same. For example, an "unsigned int" can alias an
7416 "int", but not a "void*" or a "double". A character type may alias
7417 any other type.
7418
7419 Pay special attention to code like this:
7420
7421 union a_union {
7422 int i;
7423 double d;
7424 };
7425
7426 int f() {
7427 union a_union t;
7428 t.d = 3.0;
7429 return t.i;
7430 }
7431
7432 The practice of reading from a different union member than the one
7433 most recently written to (called "type-punning") is common. Even
7434 with -fstrict-aliasing, type-punning is allowed, provided the
7435 memory is accessed through the union type. So, the code above
7436 works as expected. However, this code might not:
7437
7438 int f() {
7439 union a_union t;
7440 int* ip;
7441 t.d = 3.0;
7442 ip = &t.i;
7443 return *ip;
7444 }
7445
7446 Similarly, access by taking the address, casting the resulting
7447 pointer and dereferencing the result has undefined behavior, even
7448 if the cast uses a union type, e.g.:
7449
7450 int f() {
7451 double d = 3.0;
7452 return ((union a_union *) &d)->i;
7453 }
7454
7455 The -fstrict-aliasing option is enabled at levels -O2, -O3, -Os.
7456
7457 -falign-functions
7458 -falign-functions=n
7459 Align the start of functions to the next power-of-two greater than
7460 n, skipping up to n bytes. For instance, -falign-functions=32
7461 aligns functions to the next 32-byte boundary, but
7462 -falign-functions=24 aligns to the next 32-byte boundary only if
7463 this can be done by skipping 23 bytes or less.
7464
7465 -fno-align-functions and -falign-functions=1 are equivalent and
7466 mean that functions are not aligned.
7467
7468 Some assemblers only support this flag when n is a power of two; in
7469 that case, it is rounded up.
7470
7471 If n is not specified or is zero, use a machine-dependent default.
7472 The maximum allowed n option value is 65536.
7473
7474 Enabled at levels -O2, -O3.
7475
7476 -flimit-function-alignment
7477 If this option is enabled, the compiler tries to avoid
7478 unnecessarily overaligning functions. It attempts to instruct the
7479 assembler to align by the amount specified by -falign-functions,
7480 but not to skip more bytes than the size of the function.
7481
7482 -falign-labels
7483 -falign-labels=n
7484 Align all branch targets to a power-of-two boundary, skipping up to
7485 n bytes like -falign-functions. This option can easily make code
7486 slower, because it must insert dummy operations for when the branch
7487 target is reached in the usual flow of the code.
7488
7489 -fno-align-labels and -falign-labels=1 are equivalent and mean that
7490 labels are not aligned.
7491
7492 If -falign-loops or -falign-jumps are applicable and are greater
7493 than this value, then their values are used instead.
7494
7495 If n is not specified or is zero, use a machine-dependent default
7496 which is very likely to be 1, meaning no alignment. The maximum
7497 allowed n option value is 65536.
7498
7499 Enabled at levels -O2, -O3.
7500
7501 -falign-loops
7502 -falign-loops=n
7503 Align loops to a power-of-two boundary, skipping up to n bytes like
7504 -falign-functions. If the loops are executed many times, this
7505 makes up for any execution of the dummy operations.
7506
7507 -fno-align-loops and -falign-loops=1 are equivalent and mean that
7508 loops are not aligned. The maximum allowed n option value is
7509 65536.
7510
7511 If n is not specified or is zero, use a machine-dependent default.
7512
7513 Enabled at levels -O2, -O3.
7514
7515 -falign-jumps
7516 -falign-jumps=n
7517 Align branch targets to a power-of-two boundary, for branch targets
7518 where the targets can only be reached by jumping, skipping up to n
7519 bytes like -falign-functions. In this case, no dummy operations
7520 need be executed.
7521
7522 -fno-align-jumps and -falign-jumps=1 are equivalent and mean that
7523 loops are not aligned.
7524
7525 If n is not specified or is zero, use a machine-dependent default.
7526 The maximum allowed n option value is 65536.
7527
7528 Enabled at levels -O2, -O3.
7529
7530 -funit-at-a-time
7531 This option is left for compatibility reasons. -funit-at-a-time has
7532 no effect, while -fno-unit-at-a-time implies -fno-toplevel-reorder
7533 and -fno-section-anchors.
7534
7535 Enabled by default.
7536
7537 -fno-toplevel-reorder
7538 Do not reorder top-level functions, variables, and "asm"
7539 statements. Output them in the same order that they appear in the
7540 input file. When this option is used, unreferenced static
7541 variables are not removed. This option is intended to support
7542 existing code that relies on a particular ordering. For new code,
7543 it is better to use attributes when possible.
7544
7545 Enabled at level -O0. When disabled explicitly, it also implies
7546 -fno-section-anchors, which is otherwise enabled at -O0 on some
7547 targets.
7548
7549 -fweb
7550 Constructs webs as commonly used for register allocation purposes
7551 and assign each web individual pseudo register. This allows the
7552 register allocation pass to operate on pseudos directly, but also
7553 strengthens several other optimization passes, such as CSE, loop
7554 optimizer and trivial dead code remover. It can, however, make
7555 debugging impossible, since variables no longer stay in a "home
7556 register".
7557
7558 Enabled by default with -funroll-loops.
7559
7560 -fwhole-program
7561 Assume that the current compilation unit represents the whole
7562 program being compiled. All public functions and variables with
7563 the exception of "main" and those merged by attribute
7564 "externally_visible" become static functions and in effect are
7565 optimized more aggressively by interprocedural optimizers.
7566
7567 This option should not be used in combination with -flto. Instead
7568 relying on a linker plugin should provide safer and more precise
7569 information.
7570
7571 -flto[=n]
7572 This option runs the standard link-time optimizer. When invoked
7573 with source code, it generates GIMPLE (one of GCC's internal
7574 representations) and writes it to special ELF sections in the
7575 object file. When the object files are linked together, all the
7576 function bodies are read from these ELF sections and instantiated
7577 as if they had been part of the same translation unit.
7578
7579 To use the link-time optimizer, -flto and optimization options
7580 should be specified at compile time and during the final link. It
7581 is recommended that you compile all the files participating in the
7582 same link with the same options and also specify those options at
7583 link time. For example:
7584
7585 gcc -c -O2 -flto foo.c
7586 gcc -c -O2 -flto bar.c
7587 gcc -o myprog -flto -O2 foo.o bar.o
7588
7589 The first two invocations to GCC save a bytecode representation of
7590 GIMPLE into special ELF sections inside foo.o and bar.o. The final
7591 invocation reads the GIMPLE bytecode from foo.o and bar.o, merges
7592 the two files into a single internal image, and compiles the result
7593 as usual. Since both foo.o and bar.o are merged into a single
7594 image, this causes all the interprocedural analyses and
7595 optimizations in GCC to work across the two files as if they were a
7596 single one. This means, for example, that the inliner is able to
7597 inline functions in bar.o into functions in foo.o and vice-versa.
7598
7599 Another (simpler) way to enable link-time optimization is:
7600
7601 gcc -o myprog -flto -O2 foo.c bar.c
7602
7603 The above generates bytecode for foo.c and bar.c, merges them
7604 together into a single GIMPLE representation and optimizes them as
7605 usual to produce myprog.
7606
7607 The only important thing to keep in mind is that to enable link-
7608 time optimizations you need to use the GCC driver to perform the
7609 link step. GCC then automatically performs link-time optimization
7610 if any of the objects involved were compiled with the -flto
7611 command-line option. You generally should specify the optimization
7612 options to be used for link-time optimization though GCC tries to
7613 be clever at guessing an optimization level to use from the options
7614 used at compile time if you fail to specify one at link time. You
7615 can always override the automatic decision to do link-time
7616 optimization by passing -fno-lto to the link command.
7617
7618 To make whole program optimization effective, it is necessary to
7619 make certain whole program assumptions. The compiler needs to know
7620 what functions and variables can be accessed by libraries and
7621 runtime outside of the link-time optimized unit. When supported by
7622 the linker, the linker plugin (see -fuse-linker-plugin) passes
7623 information to the compiler about used and externally visible
7624 symbols. When the linker plugin is not available, -fwhole-program
7625 should be used to allow the compiler to make these assumptions,
7626 which leads to more aggressive optimization decisions.
7627
7628 When -fuse-linker-plugin is not enabled, when a file is compiled
7629 with -flto, the generated object file is larger than a regular
7630 object file because it contains GIMPLE bytecodes and the usual
7631 final code (see -ffat-lto-objects. This means that object files
7632 with LTO information can be linked as normal object files; if
7633 -fno-lto is passed to the linker, no interprocedural optimizations
7634 are applied. Note that when -fno-fat-lto-objects is enabled the
7635 compile stage is faster but you cannot perform a regular, non-LTO
7636 link on them.
7637
7638 Additionally, the optimization flags used to compile individual
7639 files are not necessarily related to those used at link time. For
7640 instance,
7641
7642 gcc -c -O0 -ffat-lto-objects -flto foo.c
7643 gcc -c -O0 -ffat-lto-objects -flto bar.c
7644 gcc -o myprog -O3 foo.o bar.o
7645
7646 This produces individual object files with unoptimized assembler
7647 code, but the resulting binary myprog is optimized at -O3. If,
7648 instead, the final binary is generated with -fno-lto, then myprog
7649 is not optimized.
7650
7651 When producing the final binary, GCC only applies link-time
7652 optimizations to those files that contain bytecode. Therefore, you
7653 can mix and match object files and libraries with GIMPLE bytecodes
7654 and final object code. GCC automatically selects which files to
7655 optimize in LTO mode and which files to link without further
7656 processing.
7657
7658 There are some code generation flags preserved by GCC when
7659 generating bytecodes, as they need to be used during the final link
7660 stage. Generally options specified at link time override those
7661 specified at compile time.
7662
7663 If you do not specify an optimization level option -O at link time,
7664 then GCC uses the highest optimization level used when compiling
7665 the object files.
7666
7667 Currently, the following options and their settings are taken from
7668 the first object file that explicitly specifies them: -fPIC, -fpic,
7669 -fpie, -fcommon, -fexceptions, -fnon-call-exceptions, -fgnu-tm and
7670 all the -m target flags.
7671
7672 Certain ABI-changing flags are required to match in all compilation
7673 units, and trying to override this at link time with a conflicting
7674 value is ignored. This includes options such as
7675 -freg-struct-return and -fpcc-struct-return.
7676
7677 Other options such as -ffp-contract, -fno-strict-overflow, -fwrapv,
7678 -fno-trapv or -fno-strict-aliasing are passed through to the link
7679 stage and merged conservatively for conflicting translation units.
7680 Specifically -fno-strict-overflow, -fwrapv and -fno-trapv take
7681 precedence; and for example -ffp-contract=off takes precedence over
7682 -ffp-contract=fast. You can override them at link time.
7683
7684 If LTO encounters objects with C linkage declared with incompatible
7685 types in separate translation units to be linked together
7686 (undefined behavior according to ISO C99 6.2.7), a non-fatal
7687 diagnostic may be issued. The behavior is still undefined at run
7688 time. Similar diagnostics may be raised for other languages.
7689
7690 Another feature of LTO is that it is possible to apply
7691 interprocedural optimizations on files written in different
7692 languages:
7693
7694 gcc -c -flto foo.c
7695 g++ -c -flto bar.cc
7696 gfortran -c -flto baz.f90
7697 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
7698
7699 Notice that the final link is done with g++ to get the C++ runtime
7700 libraries and -lgfortran is added to get the Fortran runtime
7701 libraries. In general, when mixing languages in LTO mode, you
7702 should use the same link command options as when mixing languages
7703 in a regular (non-LTO) compilation.
7704
7705 If object files containing GIMPLE bytecode are stored in a library
7706 archive, say libfoo.a, it is possible to extract and use them in an
7707 LTO link if you are using a linker with plugin support. To create
7708 static libraries suitable for LTO, use gcc-ar and gcc-ranlib
7709 instead of ar and ranlib; to show the symbols of object files with
7710 GIMPLE bytecode, use gcc-nm. Those commands require that ar,
7711 ranlib and nm have been compiled with plugin support. At link
7712 time, use the the flag -fuse-linker-plugin to ensure that the
7713 library participates in the LTO optimization process:
7714
7715 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
7716
7717 With the linker plugin enabled, the linker extracts the needed
7718 GIMPLE files from libfoo.a and passes them on to the running GCC to
7719 make them part of the aggregated GIMPLE image to be optimized.
7720
7721 If you are not using a linker with plugin support and/or do not
7722 enable the linker plugin, then the objects inside libfoo.a are
7723 extracted and linked as usual, but they do not participate in the
7724 LTO optimization process. In order to make a static library
7725 suitable for both LTO optimization and usual linkage, compile its
7726 object files with -flto -ffat-lto-objects.
7727
7728 Link-time optimizations do not require the presence of the whole
7729 program to operate. If the program does not require any symbols to
7730 be exported, it is possible to combine -flto and -fwhole-program to
7731 allow the interprocedural optimizers to use more aggressive
7732 assumptions which may lead to improved optimization opportunities.
7733 Use of -fwhole-program is not needed when linker plugin is active
7734 (see -fuse-linker-plugin).
7735
7736 The current implementation of LTO makes no attempt to generate
7737 bytecode that is portable between different types of hosts. The
7738 bytecode files are versioned and there is a strict version check,
7739 so bytecode files generated in one version of GCC do not work with
7740 an older or newer version of GCC.
7741
7742 Link-time optimization does not work well with generation of
7743 debugging information on systems other than those using a
7744 combination of ELF and DWARF.
7745
7746 If you specify the optional n, the optimization and code generation
7747 done at link time is executed in parallel using n parallel jobs by
7748 utilizing an installed make program. The environment variable MAKE
7749 may be used to override the program used. The default value for n
7750 is 1.
7751
7752 You can also specify -flto=jobserver to use GNU make's job server
7753 mode to determine the number of parallel jobs. This is useful when
7754 the Makefile calling GCC is already executing in parallel. You
7755 must prepend a + to the command recipe in the parent Makefile for
7756 this to work. This option likely only works if MAKE is GNU make.
7757
7758 -flto-partition=alg
7759 Specify the partitioning algorithm used by the link-time optimizer.
7760 The value is either 1to1 to specify a partitioning mirroring the
7761 original source files or balanced to specify partitioning into
7762 equally sized chunks (whenever possible) or max to create new
7763 partition for every symbol where possible. Specifying none as an
7764 algorithm disables partitioning and streaming completely. The
7765 default value is balanced. While 1to1 can be used as an workaround
7766 for various code ordering issues, the max partitioning is intended
7767 for internal testing only. The value one specifies that exactly
7768 one partition should be used while the value none bypasses
7769 partitioning and executes the link-time optimization step directly
7770 from the WPA phase.
7771
7772 -flto-odr-type-merging
7773 Enable streaming of mangled types names of C++ types and their
7774 unification at link time. This increases size of LTO object files,
7775 but enables diagnostics about One Definition Rule violations.
7776
7777 -flto-compression-level=n
7778 This option specifies the level of compression used for
7779 intermediate language written to LTO object files, and is only
7780 meaningful in conjunction with LTO mode (-flto). Valid values are
7781 0 (no compression) to 9 (maximum compression). Values outside this
7782 range are clamped to either 0 or 9. If the option is not given, a
7783 default balanced compression setting is used.
7784
7785 -fuse-linker-plugin
7786 Enables the use of a linker plugin during link-time optimization.
7787 This option relies on plugin support in the linker, which is
7788 available in gold or in GNU ld 2.21 or newer.
7789
7790 This option enables the extraction of object files with GIMPLE
7791 bytecode out of library archives. This improves the quality of
7792 optimization by exposing more code to the link-time optimizer.
7793 This information specifies what symbols can be accessed externally
7794 (by non-LTO object or during dynamic linking). Resulting code
7795 quality improvements on binaries (and shared libraries that use
7796 hidden visibility) are similar to -fwhole-program. See -flto for a
7797 description of the effect of this flag and how to use it.
7798
7799 This option is enabled by default when LTO support in GCC is
7800 enabled and GCC was configured for use with a linker supporting
7801 plugins (GNU ld 2.21 or newer or gold).
7802
7803 -ffat-lto-objects
7804 Fat LTO objects are object files that contain both the intermediate
7805 language and the object code. This makes them usable for both LTO
7806 linking and normal linking. This option is effective only when
7807 compiling with -flto and is ignored at link time.
7808
7809 -fno-fat-lto-objects improves compilation time over plain LTO, but
7810 requires the complete toolchain to be aware of LTO. It requires a
7811 linker with linker plugin support for basic functionality.
7812 Additionally, nm, ar and ranlib need to support linker plugins to
7813 allow a full-featured build environment (capable of building static
7814 libraries etc). GCC provides the gcc-ar, gcc-nm, gcc-ranlib
7815 wrappers to pass the right options to these tools. With non fat LTO
7816 makefiles need to be modified to use them.
7817
7818 Note that modern binutils provide plugin auto-load mechanism.
7819 Installing the linker plugin into $libdir/bfd-plugins has the same
7820 effect as usage of the command wrappers (gcc-ar, gcc-nm and gcc-
7821 ranlib).
7822
7823 The default is -fno-fat-lto-objects on targets with linker plugin
7824 support.
7825
7826 -fcompare-elim
7827 After register allocation and post-register allocation instruction
7828 splitting, identify arithmetic instructions that compute processor
7829 flags similar to a comparison operation based on that arithmetic.
7830 If possible, eliminate the explicit comparison operation.
7831
7832 This pass only applies to certain targets that cannot explicitly
7833 represent the comparison operation before register allocation is
7834 complete.
7835
7836 Enabled at levels -O, -O2, -O3, -Os.
7837
7838 -fcprop-registers
7839 After register allocation and post-register allocation instruction
7840 splitting, perform a copy-propagation pass to try to reduce
7841 scheduling dependencies and occasionally eliminate the copy.
7842
7843 Enabled at levels -O, -O2, -O3, -Os.
7844
7845 -fprofile-correction
7846 Profiles collected using an instrumented binary for multi-threaded
7847 programs may be inconsistent due to missed counter updates. When
7848 this option is specified, GCC uses heuristics to correct or smooth
7849 out such inconsistencies. By default, GCC emits an error message
7850 when an inconsistent profile is detected.
7851
7852 -fprofile-use
7853 -fprofile-use=path
7854 Enable profile feedback-directed optimizations, and the following
7855 optimizations which are generally profitable only with profile
7856 feedback available: -fbranch-probabilities, -fvpt, -funroll-loops,
7857 -fpeel-loops, -ftracer, -ftree-vectorize, and ftree-loop-
7858 distribute-patterns.
7859
7860 Before you can use this option, you must first generate profiling
7861 information.
7862
7863 By default, GCC emits an error message if the feedback profiles do
7864 not match the source code. This error can be turned into a warning
7865 by using -Wcoverage-mismatch. Note this may result in poorly
7866 optimized code.
7867
7868 If path is specified, GCC looks at the path to find the profile
7869 feedback data files. See -fprofile-dir.
7870
7871 -fauto-profile
7872 -fauto-profile=path
7873 Enable sampling-based feedback-directed optimizations, and the
7874 following optimizations which are generally profitable only with
7875 profile feedback available: -fbranch-probabilities, -fvpt,
7876 -funroll-loops, -fpeel-loops, -ftracer, -ftree-vectorize,
7877 -finline-functions, -fipa-cp, -fipa-cp-clone,
7878 -fpredictive-commoning, -funswitch-loops, -fgcse-after-reload, and
7879 -ftree-loop-distribute-patterns.
7880
7881 path is the name of a file containing AutoFDO profile information.
7882 If omitted, it defaults to fbdata.afdo in the current directory.
7883
7884 Producing an AutoFDO profile data file requires running your
7885 program with the perf utility on a supported GNU/Linux target
7886 system. For more information, see <https://perf.wiki.kernel.org/>.
7887
7888 E.g.
7889
7890 perf record -e br_inst_retired:near_taken -b -o perf.data \
7891 -- your_program
7892
7893 Then use the create_gcov tool to convert the raw profile data to a
7894 format that can be used by GCC. You must also supply the
7895 unstripped binary for your program to this tool. See
7896 <https://github.com/google/autofdo>.
7897
7898 E.g.
7899
7900 create_gcov --binary=your_program.unstripped --profile=perf.data \
7901 --gcov=profile.afdo
7902
7903 The following options control compiler behavior regarding floating-
7904 point arithmetic. These options trade off between speed and
7905 correctness. All must be specifically enabled.
7906
7907 -ffloat-store
7908 Do not store floating-point variables in registers, and inhibit
7909 other options that might change whether a floating-point value is
7910 taken from a register or memory.
7911
7912 This option prevents undesirable excess precision on machines such
7913 as the 68000 where the floating registers (of the 68881) keep more
7914 precision than a "double" is supposed to have. Similarly for the
7915 x86 architecture. For most programs, the excess precision does
7916 only good, but a few programs rely on the precise definition of
7917 IEEE floating point. Use -ffloat-store for such programs, after
7918 modifying them to store all pertinent intermediate computations
7919 into variables.
7920
7921 -fexcess-precision=style
7922 This option allows further control over excess precision on
7923 machines where floating-point operations occur in a format with
7924 more precision or range than the IEEE standard and interchange
7925 floating-point types. By default, -fexcess-precision=fast is in
7926 effect; this means that operations may be carried out in a wider
7927 precision than the types specified in the source if that would
7928 result in faster code, and it is unpredictable when rounding to the
7929 types specified in the source code takes place. When compiling C,
7930 if -fexcess-precision=standard is specified then excess precision
7931 follows the rules specified in ISO C99; in particular, both casts
7932 and assignments cause values to be rounded to their semantic types
7933 (whereas -ffloat-store only affects assignments). This option is
7934 enabled by default for C if a strict conformance option such as
7935 -std=c99 is used. -ffast-math enables -fexcess-precision=fast by
7936 default regardless of whether a strict conformance option is used.
7937
7938 -fexcess-precision=standard is not implemented for languages other
7939 than C. On the x86, it has no effect if -mfpmath=sse or
7940 -mfpmath=sse+387 is specified; in the former case, IEEE semantics
7941 apply without excess precision, and in the latter, rounding is
7942 unpredictable.
7943
7944 -ffast-math
7945 Sets the options -fno-math-errno, -funsafe-math-optimizations,
7946 -ffinite-math-only, -fno-rounding-math, -fno-signaling-nans,
7947 -fcx-limited-range and -fexcess-precision=fast.
7948
7949 This option causes the preprocessor macro "__FAST_MATH__" to be
7950 defined.
7951
7952 This option is not turned on by any -O option besides -Ofast since
7953 it can result in incorrect output for programs that depend on an
7954 exact implementation of IEEE or ISO rules/specifications for math
7955 functions. It may, however, yield faster code for programs that do
7956 not require the guarantees of these specifications.
7957
7958 -fno-math-errno
7959 Do not set "errno" after calling math functions that are executed
7960 with a single instruction, e.g., "sqrt". A program that relies on
7961 IEEE exceptions for math error handling may want to use this flag
7962 for speed while maintaining IEEE arithmetic compatibility.
7963
7964 This option is not turned on by any -O option since it can result
7965 in incorrect output for programs that depend on an exact
7966 implementation of IEEE or ISO rules/specifications for math
7967 functions. It may, however, yield faster code for programs that do
7968 not require the guarantees of these specifications.
7969
7970 The default is -fmath-errno.
7971
7972 On Darwin systems, the math library never sets "errno". There is
7973 therefore no reason for the compiler to consider the possibility
7974 that it might, and -fno-math-errno is the default.
7975
7976 -funsafe-math-optimizations
7977 Allow optimizations for floating-point arithmetic that (a) assume
7978 that arguments and results are valid and (b) may violate IEEE or
7979 ANSI standards. When used at link time, it may include libraries
7980 or startup files that change the default FPU control word or other
7981 similar optimizations.
7982
7983 This option is not turned on by any -O option since it can result
7984 in incorrect output for programs that depend on an exact
7985 implementation of IEEE or ISO rules/specifications for math
7986 functions. It may, however, yield faster code for programs that do
7987 not require the guarantees of these specifications. Enables
7988 -fno-signed-zeros, -fno-trapping-math, -fassociative-math and
7989 -freciprocal-math.
7990
7991 The default is -fno-unsafe-math-optimizations.
7992
7993 -fassociative-math
7994 Allow re-association of operands in series of floating-point
7995 operations. This violates the ISO C and C++ language standard by
7996 possibly changing computation result. NOTE: re-ordering may change
7997 the sign of zero as well as ignore NaNs and inhibit or create
7998 underflow or overflow (and thus cannot be used on code that relies
7999 on rounding behavior like "(x + 2**52) - 2**52". May also reorder
8000 floating-point comparisons and thus may not be used when ordered
8001 comparisons are required. This option requires that both
8002 -fno-signed-zeros and -fno-trapping-math be in effect. Moreover,
8003 it doesn't make much sense with -frounding-math. For Fortran the
8004 option is automatically enabled when both -fno-signed-zeros and
8005 -fno-trapping-math are in effect.
8006
8007 The default is -fno-associative-math.
8008
8009 -freciprocal-math
8010 Allow the reciprocal of a value to be used instead of dividing by
8011 the value if this enables optimizations. For example "x / y" can
8012 be replaced with "x * (1/y)", which is useful if "(1/y)" is subject
8013 to common subexpression elimination. Note that this loses
8014 precision and increases the number of flops operating on the value.
8015
8016 The default is -fno-reciprocal-math.
8017
8018 -ffinite-math-only
8019 Allow optimizations for floating-point arithmetic that assume that
8020 arguments and results are not NaNs or +-Infs.
8021
8022 This option is not turned on by any -O option since it can result
8023 in incorrect output for programs that depend on an exact
8024 implementation of IEEE or ISO rules/specifications for math
8025 functions. It may, however, yield faster code for programs that do
8026 not require the guarantees of these specifications.
8027
8028 The default is -fno-finite-math-only.
8029
8030 -fno-signed-zeros
8031 Allow optimizations for floating-point arithmetic that ignore the
8032 signedness of zero. IEEE arithmetic specifies the behavior of
8033 distinct +0.0 and -0.0 values, which then prohibits simplification
8034 of expressions such as x+0.0 or 0.0*x (even with
8035 -ffinite-math-only). This option implies that the sign of a zero
8036 result isn't significant.
8037
8038 The default is -fsigned-zeros.
8039
8040 -fno-trapping-math
8041 Compile code assuming that floating-point operations cannot
8042 generate user-visible traps. These traps include division by zero,
8043 overflow, underflow, inexact result and invalid operation. This
8044 option requires that -fno-signaling-nans be in effect. Setting
8045 this option may allow faster code if one relies on "non-stop" IEEE
8046 arithmetic, for example.
8047
8048 This option should never be turned on by any -O option since it can
8049 result in incorrect output for programs that depend on an exact
8050 implementation of IEEE or ISO rules/specifications for math
8051 functions.
8052
8053 The default is -ftrapping-math.
8054
8055 -frounding-math
8056 Disable transformations and optimizations that assume default
8057 floating-point rounding behavior. This is round-to-zero for all
8058 floating point to integer conversions, and round-to-nearest for all
8059 other arithmetic truncations. This option should be specified for
8060 programs that change the FP rounding mode dynamically, or that may
8061 be executed with a non-default rounding mode. This option disables
8062 constant folding of floating-point expressions at compile time
8063 (which may be affected by rounding mode) and arithmetic
8064 transformations that are unsafe in the presence of sign-dependent
8065 rounding modes.
8066
8067 The default is -fno-rounding-math.
8068
8069 This option is experimental and does not currently guarantee to
8070 disable all GCC optimizations that are affected by rounding mode.
8071 Future versions of GCC may provide finer control of this setting
8072 using C99's "FENV_ACCESS" pragma. This command-line option will be
8073 used to specify the default state for "FENV_ACCESS".
8074
8075 -fsignaling-nans
8076 Compile code assuming that IEEE signaling NaNs may generate user-
8077 visible traps during floating-point operations. Setting this
8078 option disables optimizations that may change the number of
8079 exceptions visible with signaling NaNs. This option implies
8080 -ftrapping-math.
8081
8082 This option causes the preprocessor macro "__SUPPORT_SNAN__" to be
8083 defined.
8084
8085 The default is -fno-signaling-nans.
8086
8087 This option is experimental and does not currently guarantee to
8088 disable all GCC optimizations that affect signaling NaN behavior.
8089
8090 -fno-fp-int-builtin-inexact
8091 Do not allow the built-in functions "ceil", "floor", "round" and
8092 "trunc", and their "float" and "long double" variants, to generate
8093 code that raises the "inexact" floating-point exception for
8094 noninteger arguments. ISO C99 and C11 allow these functions to
8095 raise the "inexact" exception, but ISO/IEC TS 18661-1:2014, the C
8096 bindings to IEEE 754-2008, does not allow these functions to do so.
8097
8098 The default is -ffp-int-builtin-inexact, allowing the exception to
8099 be raised. This option does nothing unless -ftrapping-math is in
8100 effect.
8101
8102 Even if -fno-fp-int-builtin-inexact is used, if the functions
8103 generate a call to a library function then the "inexact" exception
8104 may be raised if the library implementation does not follow TS
8105 18661.
8106
8107 -fsingle-precision-constant
8108 Treat floating-point constants as single precision instead of
8109 implicitly converting them to double-precision constants.
8110
8111 -fcx-limited-range
8112 When enabled, this option states that a range reduction step is not
8113 needed when performing complex division. Also, there is no
8114 checking whether the result of a complex multiplication or division
8115 is "NaN + I*NaN", with an attempt to rescue the situation in that
8116 case. The default is -fno-cx-limited-range, but is enabled by
8117 -ffast-math.
8118
8119 This option controls the default setting of the ISO C99
8120 "CX_LIMITED_RANGE" pragma. Nevertheless, the option applies to all
8121 languages.
8122
8123 -fcx-fortran-rules
8124 Complex multiplication and division follow Fortran rules. Range
8125 reduction is done as part of complex division, but there is no
8126 checking whether the result of a complex multiplication or division
8127 is "NaN + I*NaN", with an attempt to rescue the situation in that
8128 case.
8129
8130 The default is -fno-cx-fortran-rules.
8131
8132 The following options control optimizations that may improve
8133 performance, but are not enabled by any -O options. This section
8134 includes experimental options that may produce broken code.
8135
8136 -fbranch-probabilities
8137 After running a program compiled with -fprofile-arcs, you can
8138 compile it a second time using -fbranch-probabilities, to improve
8139 optimizations based on the number of times each branch was taken.
8140 When a program compiled with -fprofile-arcs exits, it saves arc
8141 execution counts to a file called sourcename.gcda for each source
8142 file. The information in this data file is very dependent on the
8143 structure of the generated code, so you must use the same source
8144 code and the same optimization options for both compilations.
8145
8146 With -fbranch-probabilities, GCC puts a REG_BR_PROB note on each
8147 JUMP_INSN and CALL_INSN. These can be used to improve
8148 optimization. Currently, they are only used in one place: in
8149 reorg.c, instead of guessing which path a branch is most likely to
8150 take, the REG_BR_PROB values are used to exactly determine which
8151 path is taken more often.
8152
8153 -fprofile-values
8154 If combined with -fprofile-arcs, it adds code so that some data
8155 about values of expressions in the program is gathered.
8156
8157 With -fbranch-probabilities, it reads back the data gathered from
8158 profiling values of expressions for usage in optimizations.
8159
8160 Enabled with -fprofile-generate and -fprofile-use.
8161
8162 -fprofile-reorder-functions
8163 Function reordering based on profile instrumentation collects first
8164 time of execution of a function and orders these functions in
8165 ascending order.
8166
8167 Enabled with -fprofile-use.
8168
8169 -fvpt
8170 If combined with -fprofile-arcs, this option instructs the compiler
8171 to add code to gather information about values of expressions.
8172
8173 With -fbranch-probabilities, it reads back the data gathered and
8174 actually performs the optimizations based on them. Currently the
8175 optimizations include specialization of division operations using
8176 the knowledge about the value of the denominator.
8177
8178 -frename-registers
8179 Attempt to avoid false dependencies in scheduled code by making use
8180 of registers left over after register allocation. This
8181 optimization most benefits processors with lots of registers.
8182 Depending on the debug information format adopted by the target,
8183 however, it can make debugging impossible, since variables no
8184 longer stay in a "home register".
8185
8186 Enabled by default with -funroll-loops.
8187
8188 -fschedule-fusion
8189 Performs a target dependent pass over the instruction stream to
8190 schedule instructions of same type together because target machine
8191 can execute them more efficiently if they are adjacent to each
8192 other in the instruction flow.
8193
8194 Enabled at levels -O2, -O3, -Os.
8195
8196 -ftracer
8197 Perform tail duplication to enlarge superblock size. This
8198 transformation simplifies the control flow of the function allowing
8199 other optimizations to do a better job.
8200
8201 Enabled with -fprofile-use.
8202
8203 -funroll-loops
8204 Unroll loops whose number of iterations can be determined at
8205 compile time or upon entry to the loop. -funroll-loops implies
8206 -frerun-cse-after-loop, -fweb and -frename-registers. It also
8207 turns on complete loop peeling (i.e. complete removal of loops with
8208 a small constant number of iterations). This option makes code
8209 larger, and may or may not make it run faster.
8210
8211 Enabled with -fprofile-use.
8212
8213 -funroll-all-loops
8214 Unroll all loops, even if their number of iterations is uncertain
8215 when the loop is entered. This usually makes programs run more
8216 slowly. -funroll-all-loops implies the same options as
8217 -funroll-loops.
8218
8219 -fpeel-loops
8220 Peels loops for which there is enough information that they do not
8221 roll much (from profile feedback or static analysis). It also
8222 turns on complete loop peeling (i.e. complete removal of loops with
8223 small constant number of iterations).
8224
8225 Enabled with -O3 and/or -fprofile-use.
8226
8227 -fmove-loop-invariants
8228 Enables the loop invariant motion pass in the RTL loop optimizer.
8229 Enabled at level -O1
8230
8231 -fsplit-loops
8232 Split a loop into two if it contains a condition that's always true
8233 for one side of the iteration space and false for the other.
8234
8235 -funswitch-loops
8236 Move branches with loop invariant conditions out of the loop, with
8237 duplicates of the loop on both branches (modified according to
8238 result of the condition).
8239
8240 -ffunction-sections
8241 -fdata-sections
8242 Place each function or data item into its own section in the output
8243 file if the target supports arbitrary sections. The name of the
8244 function or the name of the data item determines the section's name
8245 in the output file.
8246
8247 Use these options on systems where the linker can perform
8248 optimizations to improve locality of reference in the instruction
8249 space. Most systems using the ELF object format have linkers with
8250 such optimizations. On AIX, the linker rearranges sections
8251 (CSECTs) based on the call graph. The performance impact varies.
8252
8253 Together with a linker garbage collection (linker --gc-sections
8254 option) these options may lead to smaller statically-linked
8255 executables (after stripping).
8256
8257 On ELF/DWARF systems these options do not degenerate the quality of
8258 the debug information. There could be issues with other object
8259 files/debug info formats.
8260
8261 Only use these options when there are significant benefits from
8262 doing so. When you specify these options, the assembler and linker
8263 create larger object and executable files and are also slower.
8264 These options affect code generation. They prevent optimizations
8265 by the compiler and assembler using relative locations inside a
8266 translation unit since the locations are unknown until link time.
8267 An example of such an optimization is relaxing calls to short call
8268 instructions.
8269
8270 -fbranch-target-load-optimize
8271 Perform branch target register load optimization before prologue /
8272 epilogue threading. The use of target registers can typically be
8273 exposed only during reload, thus hoisting loads out of loops and
8274 doing inter-block scheduling needs a separate optimization pass.
8275
8276 -fbranch-target-load-optimize2
8277 Perform branch target register load optimization after prologue /
8278 epilogue threading.
8279
8280 -fbtr-bb-exclusive
8281 When performing branch target register load optimization, don't
8282 reuse branch target registers within any basic block.
8283
8284 -fstdarg-opt
8285 Optimize the prologue of variadic argument functions with respect
8286 to usage of those arguments.
8287
8288 -fsection-anchors
8289 Try to reduce the number of symbolic address calculations by using
8290 shared "anchor" symbols to address nearby objects. This
8291 transformation can help to reduce the number of GOT entries and GOT
8292 accesses on some targets.
8293
8294 For example, the implementation of the following function "foo":
8295
8296 static int a, b, c;
8297 int foo (void) { return a + b + c; }
8298
8299 usually calculates the addresses of all three variables, but if you
8300 compile it with -fsection-anchors, it accesses the variables from a
8301 common anchor point instead. The effect is similar to the
8302 following pseudocode (which isn't valid C):
8303
8304 int foo (void)
8305 {
8306 register int *xr = &x;
8307 return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8308 }
8309
8310 Not all targets support this option.
8311
8312 --param name=value
8313 In some places, GCC uses various constants to control the amount of
8314 optimization that is done. For example, GCC does not inline
8315 functions that contain more than a certain number of instructions.
8316 You can control some of these constants on the command line using
8317 the --param option.
8318
8319 The names of specific parameters, and the meaning of the values,
8320 are tied to the internals of the compiler, and are subject to
8321 change without notice in future releases.
8322
8323 In each case, the value is an integer. The allowable choices for
8324 name are:
8325
8326 predictable-branch-outcome
8327 When branch is predicted to be taken with probability lower
8328 than this threshold (in percent), then it is considered well
8329 predictable. The default is 10.
8330
8331 max-rtl-if-conversion-insns
8332 RTL if-conversion tries to remove conditional branches around a
8333 block and replace them with conditionally executed
8334 instructions. This parameter gives the maximum number of
8335 instructions in a block which should be considered for if-
8336 conversion. The default is 10, though the compiler will also
8337 use other heuristics to decide whether if-conversion is likely
8338 to be profitable.
8339
8340 max-rtl-if-conversion-predictable-cost
8341 max-rtl-if-conversion-unpredictable-cost
8342 RTL if-conversion will try to remove conditional branches
8343 around a block and replace them with conditionally executed
8344 instructions. These parameters give the maximum permissible
8345 cost for the sequence that would be generated by if-conversion
8346 depending on whether the branch is statically determined to be
8347 predictable or not. The units for this parameter are the same
8348 as those for the GCC internal seq_cost metric. The compiler
8349 will try to provide a reasonable default for this parameter
8350 using the BRANCH_COST target macro.
8351
8352 max-crossjump-edges
8353 The maximum number of incoming edges to consider for cross-
8354 jumping. The algorithm used by -fcrossjumping is O(N^2) in the
8355 number of edges incoming to each block. Increasing values mean
8356 more aggressive optimization, making the compilation time
8357 increase with probably small improvement in executable size.
8358
8359 min-crossjump-insns
8360 The minimum number of instructions that must be matched at the
8361 end of two blocks before cross-jumping is performed on them.
8362 This value is ignored in the case where all instructions in the
8363 block being cross-jumped from are matched. The default value
8364 is 5.
8365
8366 max-grow-copy-bb-insns
8367 The maximum code size expansion factor when copying basic
8368 blocks instead of jumping. The expansion is relative to a jump
8369 instruction. The default value is 8.
8370
8371 max-goto-duplication-insns
8372 The maximum number of instructions to duplicate to a block that
8373 jumps to a computed goto. To avoid O(N^2) behavior in a number
8374 of passes, GCC factors computed gotos early in the compilation
8375 process, and unfactors them as late as possible. Only computed
8376 jumps at the end of a basic blocks with no more than max-goto-
8377 duplication-insns are unfactored. The default value is 8.
8378
8379 max-delay-slot-insn-search
8380 The maximum number of instructions to consider when looking for
8381 an instruction to fill a delay slot. If more than this
8382 arbitrary number of instructions are searched, the time savings
8383 from filling the delay slot are minimal, so stop searching.
8384 Increasing values mean more aggressive optimization, making the
8385 compilation time increase with probably small improvement in
8386 execution time.
8387
8388 max-delay-slot-live-search
8389 When trying to fill delay slots, the maximum number of
8390 instructions to consider when searching for a block with valid
8391 live register information. Increasing this arbitrarily chosen
8392 value means more aggressive optimization, increasing the
8393 compilation time. This parameter should be removed when the
8394 delay slot code is rewritten to maintain the control-flow
8395 graph.
8396
8397 max-gcse-memory
8398 The approximate maximum amount of memory that can be allocated
8399 in order to perform the global common subexpression elimination
8400 optimization. If more memory than specified is required, the
8401 optimization is not done.
8402
8403 max-gcse-insertion-ratio
8404 If the ratio of expression insertions to deletions is larger
8405 than this value for any expression, then RTL PRE inserts or
8406 removes the expression and thus leaves partially redundant
8407 computations in the instruction stream. The default value is
8408 20.
8409
8410 max-pending-list-length
8411 The maximum number of pending dependencies scheduling allows
8412 before flushing the current state and starting over. Large
8413 functions with few branches or calls can create excessively
8414 large lists which needlessly consume memory and resources.
8415
8416 max-modulo-backtrack-attempts
8417 The maximum number of backtrack attempts the scheduler should
8418 make when modulo scheduling a loop. Larger values can
8419 exponentially increase compilation time.
8420
8421 max-inline-insns-single
8422 Several parameters control the tree inliner used in GCC. This
8423 number sets the maximum number of instructions (counted in
8424 GCC's internal representation) in a single function that the
8425 tree inliner considers for inlining. This only affects
8426 functions declared inline and methods implemented in a class
8427 declaration (C++). The default value is 400.
8428
8429 max-inline-insns-auto
8430 When you use -finline-functions (included in -O3), a lot of
8431 functions that would otherwise not be considered for inlining
8432 by the compiler are investigated. To those functions, a
8433 different (more restrictive) limit compared to functions
8434 declared inline can be applied. The default value is 30.
8435
8436 inline-min-speedup
8437 When estimated performance improvement of caller + callee
8438 runtime exceeds this threshold (in percent), the function can
8439 be inlined regardless of the limit on --param max-inline-insns-
8440 single and --param max-inline-insns-auto. The default value is
8441 15.
8442
8443 large-function-insns
8444 The limit specifying really large functions. For functions
8445 larger than this limit after inlining, inlining is constrained
8446 by --param large-function-growth. This parameter is useful
8447 primarily to avoid extreme compilation time caused by non-
8448 linear algorithms used by the back end. The default value is
8449 2700.
8450
8451 large-function-growth
8452 Specifies maximal growth of large function caused by inlining
8453 in percents. The default value is 100 which limits large
8454 function growth to 2.0 times the original size.
8455
8456 large-unit-insns
8457 The limit specifying large translation unit. Growth caused by
8458 inlining of units larger than this limit is limited by --param
8459 inline-unit-growth. For small units this might be too tight.
8460 For example, consider a unit consisting of function A that is
8461 inline and B that just calls A three times. If B is small
8462 relative to A, the growth of unit is 300\% and yet such
8463 inlining is very sane. For very large units consisting of
8464 small inlineable functions, however, the overall unit growth
8465 limit is needed to avoid exponential explosion of code size.
8466 Thus for smaller units, the size is increased to --param large-
8467 unit-insns before applying --param inline-unit-growth. The
8468 default is 10000.
8469
8470 inline-unit-growth
8471 Specifies maximal overall growth of the compilation unit caused
8472 by inlining. The default value is 20 which limits unit growth
8473 to 1.2 times the original size. Cold functions (either marked
8474 cold via an attribute or by profile feedback) are not accounted
8475 into the unit size.
8476
8477 ipcp-unit-growth
8478 Specifies maximal overall growth of the compilation unit caused
8479 by interprocedural constant propagation. The default value is
8480 10 which limits unit growth to 1.1 times the original size.
8481
8482 large-stack-frame
8483 The limit specifying large stack frames. While inlining the
8484 algorithm is trying to not grow past this limit too much. The
8485 default value is 256 bytes.
8486
8487 large-stack-frame-growth
8488 Specifies maximal growth of large stack frames caused by
8489 inlining in percents. The default value is 1000 which limits
8490 large stack frame growth to 11 times the original size.
8491
8492 max-inline-insns-recursive
8493 max-inline-insns-recursive-auto
8494 Specifies the maximum number of instructions an out-of-line
8495 copy of a self-recursive inline function can grow into by
8496 performing recursive inlining.
8497
8498 --param max-inline-insns-recursive applies to functions
8499 declared inline. For functions not declared inline, recursive
8500 inlining happens only when -finline-functions (included in -O3)
8501 is enabled; --param max-inline-insns-recursive-auto applies
8502 instead. The default value is 450.
8503
8504 max-inline-recursive-depth
8505 max-inline-recursive-depth-auto
8506 Specifies the maximum recursion depth used for recursive
8507 inlining.
8508
8509 --param max-inline-recursive-depth applies to functions
8510 declared inline. For functions not declared inline, recursive
8511 inlining happens only when -finline-functions (included in -O3)
8512 is enabled; --param max-inline-recursive-depth-auto applies
8513 instead. The default value is 8.
8514
8515 min-inline-recursive-probability
8516 Recursive inlining is profitable only for function having deep
8517 recursion in average and can hurt for function having little
8518 recursion depth by increasing the prologue size or complexity
8519 of function body to other optimizers.
8520
8521 When profile feedback is available (see -fprofile-generate) the
8522 actual recursion depth can be guessed from the probability that
8523 function recurses via a given call expression. This parameter
8524 limits inlining only to call expressions whose probability
8525 exceeds the given threshold (in percents). The default value
8526 is 10.
8527
8528 early-inlining-insns
8529 Specify growth that the early inliner can make. In effect it
8530 increases the amount of inlining for code having a large
8531 abstraction penalty. The default value is 14.
8532
8533 max-early-inliner-iterations
8534 Limit of iterations of the early inliner. This basically
8535 bounds the number of nested indirect calls the early inliner
8536 can resolve. Deeper chains are still handled by late inlining.
8537
8538 comdat-sharing-probability
8539 Probability (in percent) that C++ inline function with comdat
8540 visibility are shared across multiple compilation units. The
8541 default value is 20.
8542
8543 profile-func-internal-id
8544 A parameter to control whether to use function internal id in
8545 profile database lookup. If the value is 0, the compiler uses
8546 an id that is based on function assembler name and filename,
8547 which makes old profile data more tolerant to source changes
8548 such as function reordering etc. The default value is 0.
8549
8550 min-vect-loop-bound
8551 The minimum number of iterations under which loops are not
8552 vectorized when -ftree-vectorize is used. The number of
8553 iterations after vectorization needs to be greater than the
8554 value specified by this option to allow vectorization. The
8555 default value is 0.
8556
8557 gcse-cost-distance-ratio
8558 Scaling factor in calculation of maximum distance an expression
8559 can be moved by GCSE optimizations. This is currently
8560 supported only in the code hoisting pass. The bigger the
8561 ratio, the more aggressive code hoisting is with simple
8562 expressions, i.e., the expressions that have cost less than
8563 gcse-unrestricted-cost. Specifying 0 disables hoisting of
8564 simple expressions. The default value is 10.
8565
8566 gcse-unrestricted-cost
8567 Cost, roughly measured as the cost of a single typical machine
8568 instruction, at which GCSE optimizations do not constrain the
8569 distance an expression can travel. This is currently supported
8570 only in the code hoisting pass. The lesser the cost, the more
8571 aggressive code hoisting is. Specifying 0 allows all
8572 expressions to travel unrestricted distances. The default
8573 value is 3.
8574
8575 max-hoist-depth
8576 The depth of search in the dominator tree for expressions to
8577 hoist. This is used to avoid quadratic behavior in hoisting
8578 algorithm. The value of 0 does not limit on the search, but
8579 may slow down compilation of huge functions. The default value
8580 is 30.
8581
8582 max-tail-merge-comparisons
8583 The maximum amount of similar bbs to compare a bb with. This
8584 is used to avoid quadratic behavior in tree tail merging. The
8585 default value is 10.
8586
8587 max-tail-merge-iterations
8588 The maximum amount of iterations of the pass over the function.
8589 This is used to limit compilation time in tree tail merging.
8590 The default value is 2.
8591
8592 store-merging-allow-unaligned
8593 Allow the store merging pass to introduce unaligned stores if
8594 it is legal to do so. The default value is 1.
8595
8596 max-stores-to-merge
8597 The maximum number of stores to attempt to merge into wider
8598 stores in the store merging pass. The minimum value is 2 and
8599 the default is 64.
8600
8601 max-unrolled-insns
8602 The maximum number of instructions that a loop may have to be
8603 unrolled. If a loop is unrolled, this parameter also
8604 determines how many times the loop code is unrolled.
8605
8606 max-average-unrolled-insns
8607 The maximum number of instructions biased by probabilities of
8608 their execution that a loop may have to be unrolled. If a loop
8609 is unrolled, this parameter also determines how many times the
8610 loop code is unrolled.
8611
8612 max-unroll-times
8613 The maximum number of unrollings of a single loop.
8614
8615 max-peeled-insns
8616 The maximum number of instructions that a loop may have to be
8617 peeled. If a loop is peeled, this parameter also determines
8618 how many times the loop code is peeled.
8619
8620 max-peel-times
8621 The maximum number of peelings of a single loop.
8622
8623 max-peel-branches
8624 The maximum number of branches on the hot path through the
8625 peeled sequence.
8626
8627 max-completely-peeled-insns
8628 The maximum number of insns of a completely peeled loop.
8629
8630 max-completely-peel-times
8631 The maximum number of iterations of a loop to be suitable for
8632 complete peeling.
8633
8634 max-completely-peel-loop-nest-depth
8635 The maximum depth of a loop nest suitable for complete peeling.
8636
8637 max-unswitch-insns
8638 The maximum number of insns of an unswitched loop.
8639
8640 max-unswitch-level
8641 The maximum number of branches unswitched in a single loop.
8642
8643 max-loop-headers-insns
8644 The maximum number of insns in loop header duplicated by the
8645 copy loop headers pass.
8646
8647 lim-expensive
8648 The minimum cost of an expensive expression in the loop
8649 invariant motion.
8650
8651 iv-consider-all-candidates-bound
8652 Bound on number of candidates for induction variables, below
8653 which all candidates are considered for each use in induction
8654 variable optimizations. If there are more candidates than
8655 this, only the most relevant ones are considered to avoid
8656 quadratic time complexity.
8657
8658 iv-max-considered-uses
8659 The induction variable optimizations give up on loops that
8660 contain more induction variable uses.
8661
8662 iv-always-prune-cand-set-bound
8663 If the number of candidates in the set is smaller than this
8664 value, always try to remove unnecessary ivs from the set when
8665 adding a new one.
8666
8667 avg-loop-niter
8668 Average number of iterations of a loop.
8669
8670 dse-max-object-size
8671 Maximum size (in bytes) of objects tracked bytewise by dead
8672 store elimination. Larger values may result in larger
8673 compilation times.
8674
8675 scev-max-expr-size
8676 Bound on size of expressions used in the scalar evolutions
8677 analyzer. Large expressions slow the analyzer.
8678
8679 scev-max-expr-complexity
8680 Bound on the complexity of the expressions in the scalar
8681 evolutions analyzer. Complex expressions slow the analyzer.
8682
8683 max-tree-if-conversion-phi-args
8684 Maximum number of arguments in a PHI supported by TREE if
8685 conversion unless the loop is marked with simd pragma.
8686
8687 vect-max-version-for-alignment-checks
8688 The maximum number of run-time checks that can be performed
8689 when doing loop versioning for alignment in the vectorizer.
8690
8691 vect-max-version-for-alias-checks
8692 The maximum number of run-time checks that can be performed
8693 when doing loop versioning for alias in the vectorizer.
8694
8695 vect-max-peeling-for-alignment
8696 The maximum number of loop peels to enhance access alignment
8697 for vectorizer. Value -1 means no limit.
8698
8699 max-iterations-to-track
8700 The maximum number of iterations of a loop the brute-force
8701 algorithm for analysis of the number of iterations of the loop
8702 tries to evaluate.
8703
8704 hot-bb-count-ws-permille
8705 A basic block profile count is considered hot if it contributes
8706 to the given permillage (i.e. 0...1000) of the entire profiled
8707 execution.
8708
8709 hot-bb-frequency-fraction
8710 Select fraction of the entry block frequency of executions of
8711 basic block in function given basic block needs to have to be
8712 considered hot.
8713
8714 max-predicted-iterations
8715 The maximum number of loop iterations we predict statically.
8716 This is useful in cases where a function contains a single loop
8717 with known bound and another loop with unknown bound. The
8718 known number of iterations is predicted correctly, while the
8719 unknown number of iterations average to roughly 10. This means
8720 that the loop without bounds appears artificially cold relative
8721 to the other one.
8722
8723 builtin-expect-probability
8724 Control the probability of the expression having the specified
8725 value. This parameter takes a percentage (i.e. 0 ... 100) as
8726 input. The default probability of 90 is obtained empirically.
8727
8728 align-threshold
8729 Select fraction of the maximal frequency of executions of a
8730 basic block in a function to align the basic block.
8731
8732 align-loop-iterations
8733 A loop expected to iterate at least the selected number of
8734 iterations is aligned.
8735
8736 tracer-dynamic-coverage
8737 tracer-dynamic-coverage-feedback
8738 This value is used to limit superblock formation once the given
8739 percentage of executed instructions is covered. This limits
8740 unnecessary code size expansion.
8741
8742 The tracer-dynamic-coverage-feedback parameter is used only
8743 when profile feedback is available. The real profiles (as
8744 opposed to statically estimated ones) are much less balanced
8745 allowing the threshold to be larger value.
8746
8747 tracer-max-code-growth
8748 Stop tail duplication once code growth has reached given
8749 percentage. This is a rather artificial limit, as most of the
8750 duplicates are eliminated later in cross jumping, so it may be
8751 set to much higher values than is the desired code growth.
8752
8753 tracer-min-branch-ratio
8754 Stop reverse growth when the reverse probability of best edge
8755 is less than this threshold (in percent).
8756
8757 tracer-min-branch-probability
8758 tracer-min-branch-probability-feedback
8759 Stop forward growth if the best edge has probability lower than
8760 this threshold.
8761
8762 Similarly to tracer-dynamic-coverage two parameters are
8763 provided. tracer-min-branch-probability-feedback is used for
8764 compilation with profile feedback and tracer-min-branch-
8765 probability compilation without. The value for compilation
8766 with profile feedback needs to be more conservative (higher) in
8767 order to make tracer effective.
8768
8769 stack-clash-protection-guard-size
8770 Specify the size of the operating system provided stack guard
8771 as 2 raised to num bytes. The default value is 12 (4096
8772 bytes). Acceptable values are between 12 and 30. Higher
8773 values may reduce the number of explicit probes, but a value
8774 larger than the operating system provided guard will leave code
8775 vulnerable to stack clash style attacks.
8776
8777 stack-clash-protection-probe-interval
8778 Stack clash protection involves probing stack space as it is
8779 allocated. This param controls the maximum distance between
8780 probes into the stack as 2 raised to num bytes. Acceptable
8781 values are between 10 and 16 and defaults to 12. Higher values
8782 may reduce the number of explicit probes, but a value larger
8783 than the operating system provided guard will leave code
8784 vulnerable to stack clash style attacks.
8785
8786 max-cse-path-length
8787 The maximum number of basic blocks on path that CSE considers.
8788 The default is 10.
8789
8790 max-cse-insns
8791 The maximum number of instructions CSE processes before
8792 flushing. The default is 1000.
8793
8794 ggc-min-expand
8795 GCC uses a garbage collector to manage its own memory
8796 allocation. This parameter specifies the minimum percentage by
8797 which the garbage collector's heap should be allowed to expand
8798 between collections. Tuning this may improve compilation
8799 speed; it has no effect on code generation.
8800
8801 The default is 30% + 70% * (RAM/1GB) with an upper bound of
8802 100% when RAM >= 1GB. If "getrlimit" is available, the notion
8803 of "RAM" is the smallest of actual RAM and "RLIMIT_DATA" or
8804 "RLIMIT_AS". If GCC is not able to calculate RAM on a
8805 particular platform, the lower bound of 30% is used. Setting
8806 this parameter and ggc-min-heapsize to zero causes a full
8807 collection to occur at every opportunity. This is extremely
8808 slow, but can be useful for debugging.
8809
8810 ggc-min-heapsize
8811 Minimum size of the garbage collector's heap before it begins
8812 bothering to collect garbage. The first collection occurs
8813 after the heap expands by ggc-min-expand% beyond ggc-min-
8814 heapsize. Again, tuning this may improve compilation speed,
8815 and has no effect on code generation.
8816
8817 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit
8818 that tries to ensure that RLIMIT_DATA or RLIMIT_AS are not
8819 exceeded, but with a lower bound of 4096 (four megabytes) and
8820 an upper bound of 131072 (128 megabytes). If GCC is not able
8821 to calculate RAM on a particular platform, the lower bound is
8822 used. Setting this parameter very large effectively disables
8823 garbage collection. Setting this parameter and ggc-min-expand
8824 to zero causes a full collection to occur at every opportunity.
8825
8826 max-reload-search-insns
8827 The maximum number of instruction reload should look backward
8828 for equivalent register. Increasing values mean more
8829 aggressive optimization, making the compilation time increase
8830 with probably slightly better performance. The default value
8831 is 100.
8832
8833 max-cselib-memory-locations
8834 The maximum number of memory locations cselib should take into
8835 account. Increasing values mean more aggressive optimization,
8836 making the compilation time increase with probably slightly
8837 better performance. The default value is 500.
8838
8839 max-sched-ready-insns
8840 The maximum number of instructions ready to be issued the
8841 scheduler should consider at any given time during the first
8842 scheduling pass. Increasing values mean more thorough
8843 searches, making the compilation time increase with probably
8844 little benefit. The default value is 100.
8845
8846 max-sched-region-blocks
8847 The maximum number of blocks in a region to be considered for
8848 interblock scheduling. The default value is 10.
8849
8850 max-pipeline-region-blocks
8851 The maximum number of blocks in a region to be considered for
8852 pipelining in the selective scheduler. The default value is
8853 15.
8854
8855 max-sched-region-insns
8856 The maximum number of insns in a region to be considered for
8857 interblock scheduling. The default value is 100.
8858
8859 max-pipeline-region-insns
8860 The maximum number of insns in a region to be considered for
8861 pipelining in the selective scheduler. The default value is
8862 200.
8863
8864 min-spec-prob
8865 The minimum probability (in percents) of reaching a source
8866 block for interblock speculative scheduling. The default value
8867 is 40.
8868
8869 max-sched-extend-regions-iters
8870 The maximum number of iterations through CFG to extend regions.
8871 A value of 0 (the default) disables region extensions.
8872
8873 max-sched-insn-conflict-delay
8874 The maximum conflict delay for an insn to be considered for
8875 speculative motion. The default value is 3.
8876
8877 sched-spec-prob-cutoff
8878 The minimal probability of speculation success (in percents),
8879 so that speculative insns are scheduled. The default value is
8880 40.
8881
8882 sched-state-edge-prob-cutoff
8883 The minimum probability an edge must have for the scheduler to
8884 save its state across it. The default value is 10.
8885
8886 sched-mem-true-dep-cost
8887 Minimal distance (in CPU cycles) between store and load
8888 targeting same memory locations. The default value is 1.
8889
8890 selsched-max-lookahead
8891 The maximum size of the lookahead window of selective
8892 scheduling. It is a depth of search for available
8893 instructions. The default value is 50.
8894
8895 selsched-max-sched-times
8896 The maximum number of times that an instruction is scheduled
8897 during selective scheduling. This is the limit on the number
8898 of iterations through which the instruction may be pipelined.
8899 The default value is 2.
8900
8901 selsched-insns-to-rename
8902 The maximum number of best instructions in the ready list that
8903 are considered for renaming in the selective scheduler. The
8904 default value is 2.
8905
8906 sms-min-sc
8907 The minimum value of stage count that swing modulo scheduler
8908 generates. The default value is 2.
8909
8910 max-last-value-rtl
8911 The maximum size measured as number of RTLs that can be
8912 recorded in an expression in combiner for a pseudo register as
8913 last known value of that register. The default is 10000.
8914
8915 max-combine-insns
8916 The maximum number of instructions the RTL combiner tries to
8917 combine. The default value is 2 at -Og and 4 otherwise.
8918
8919 integer-share-limit
8920 Small integer constants can use a shared data structure,
8921 reducing the compiler's memory usage and increasing its speed.
8922 This sets the maximum value of a shared integer constant. The
8923 default value is 256.
8924
8925 ssp-buffer-size
8926 The minimum size of buffers (i.e. arrays) that receive stack
8927 smashing protection when -fstack-protection is used.
8928
8929 min-size-for-stack-sharing
8930 The minimum size of variables taking part in stack slot sharing
8931 when not optimizing. The default value is 32.
8932
8933 max-jump-thread-duplication-stmts
8934 Maximum number of statements allowed in a block that needs to
8935 be duplicated when threading jumps.
8936
8937 max-fields-for-field-sensitive
8938 Maximum number of fields in a structure treated in a field
8939 sensitive manner during pointer analysis. The default is zero
8940 for -O0 and -O1, and 100 for -Os, -O2, and -O3.
8941
8942 prefetch-latency
8943 Estimate on average number of instructions that are executed
8944 before prefetch finishes. The distance prefetched ahead is
8945 proportional to this constant. Increasing this number may also
8946 lead to less streams being prefetched (see simultaneous-
8947 prefetches).
8948
8949 simultaneous-prefetches
8950 Maximum number of prefetches that can run at the same time.
8951
8952 l1-cache-line-size
8953 The size of cache line in L1 cache, in bytes.
8954
8955 l1-cache-size
8956 The size of L1 cache, in kilobytes.
8957
8958 l2-cache-size
8959 The size of L2 cache, in kilobytes.
8960
8961 loop-interchange-max-num-stmts
8962 The maximum number of stmts in a loop to be interchanged.
8963
8964 loop-interchange-stride-ratio
8965 The minimum ratio between stride of two loops for interchange
8966 to be profitable.
8967
8968 min-insn-to-prefetch-ratio
8969 The minimum ratio between the number of instructions and the
8970 number of prefetches to enable prefetching in a loop.
8971
8972 prefetch-min-insn-to-mem-ratio
8973 The minimum ratio between the number of instructions and the
8974 number of memory references to enable prefetching in a loop.
8975
8976 use-canonical-types
8977 Whether the compiler should use the "canonical" type system.
8978 By default, this should always be 1, which uses a more
8979 efficient internal mechanism for comparing types in C++ and
8980 Objective-C++. However, if bugs in the canonical type system
8981 are causing compilation failures, set this value to 0 to
8982 disable canonical types.
8983
8984 switch-conversion-max-branch-ratio
8985 Switch initialization conversion refuses to create arrays that
8986 are bigger than switch-conversion-max-branch-ratio times the
8987 number of branches in the switch.
8988
8989 max-partial-antic-length
8990 Maximum length of the partial antic set computed during the
8991 tree partial redundancy elimination optimization (-ftree-pre)
8992 when optimizing at -O3 and above. For some sorts of source
8993 code the enhanced partial redundancy elimination optimization
8994 can run away, consuming all of the memory available on the host
8995 machine. This parameter sets a limit on the length of the sets
8996 that are computed, which prevents the runaway behavior.
8997 Setting a value of 0 for this parameter allows an unlimited set
8998 length.
8999
9000 sccvn-max-scc-size
9001 Maximum size of a strongly connected component (SCC) during
9002 SCCVN processing. If this limit is hit, SCCVN processing for
9003 the whole function is not done and optimizations depending on
9004 it are disabled. The default maximum SCC size is 10000.
9005
9006 sccvn-max-alias-queries-per-access
9007 Maximum number of alias-oracle queries we perform when looking
9008 for redundancies for loads and stores. If this limit is hit
9009 the search is aborted and the load or store is not considered
9010 redundant. The number of queries is algorithmically limited to
9011 the number of stores on all paths from the load to the function
9012 entry. The default maximum number of queries is 1000.
9013
9014 ira-max-loops-num
9015 IRA uses regional register allocation by default. If a
9016 function contains more loops than the number given by this
9017 parameter, only at most the given number of the most
9018 frequently-executed loops form regions for regional register
9019 allocation. The default value of the parameter is 100.
9020
9021 ira-max-conflict-table-size
9022 Although IRA uses a sophisticated algorithm to compress the
9023 conflict table, the table can still require excessive amounts
9024 of memory for huge functions. If the conflict table for a
9025 function could be more than the size in MB given by this
9026 parameter, the register allocator instead uses a faster,
9027 simpler, and lower-quality algorithm that does not require
9028 building a pseudo-register conflict table. The default value
9029 of the parameter is 2000.
9030
9031 ira-loop-reserved-regs
9032 IRA can be used to evaluate more accurate register pressure in
9033 loops for decisions to move loop invariants (see -O3). The
9034 number of available registers reserved for some other purposes
9035 is given by this parameter. The default value of the parameter
9036 is 2, which is the minimal number of registers needed by
9037 typical instructions. This value is the best found from
9038 numerous experiments.
9039
9040 lra-inheritance-ebb-probability-cutoff
9041 LRA tries to reuse values reloaded in registers in subsequent
9042 insns. This optimization is called inheritance. EBB is used
9043 as a region to do this optimization. The parameter defines a
9044 minimal fall-through edge probability in percentage used to add
9045 BB to inheritance EBB in LRA. The default value of the
9046 parameter is 40. The value was chosen from numerous runs of
9047 SPEC2000 on x86-64.
9048
9049 loop-invariant-max-bbs-in-loop
9050 Loop invariant motion can be very expensive, both in
9051 compilation time and in amount of needed compile-time memory,
9052 with very large loops. Loops with more basic blocks than this
9053 parameter won't have loop invariant motion optimization
9054 performed on them. The default value of the parameter is 1000
9055 for -O1 and 10000 for -O2 and above.
9056
9057 loop-max-datarefs-for-datadeps
9058 Building data dependencies is expensive for very large loops.
9059 This parameter limits the number of data references in loops
9060 that are considered for data dependence analysis. These large
9061 loops are no handled by the optimizations using loop data
9062 dependencies. The default value is 1000.
9063
9064 max-vartrack-size
9065 Sets a maximum number of hash table slots to use during
9066 variable tracking dataflow analysis of any function. If this
9067 limit is exceeded with variable tracking at assignments
9068 enabled, analysis for that function is retried without it,
9069 after removing all debug insns from the function. If the limit
9070 is exceeded even without debug insns, var tracking analysis is
9071 completely disabled for the function. Setting the parameter to
9072 zero makes it unlimited.
9073
9074 max-vartrack-expr-depth
9075 Sets a maximum number of recursion levels when attempting to
9076 map variable names or debug temporaries to value expressions.
9077 This trades compilation time for more complete debug
9078 information. If this is set too low, value expressions that
9079 are available and could be represented in debug information may
9080 end up not being used; setting this higher may enable the
9081 compiler to find more complex debug expressions, but compile
9082 time and memory use may grow. The default is 12.
9083
9084 max-debug-marker-count
9085 Sets a threshold on the number of debug markers (e.g. begin
9086 stmt markers) to avoid complexity explosion at inlining or
9087 expanding to RTL. If a function has more such gimple stmts
9088 than the set limit, such stmts will be dropped from the inlined
9089 copy of a function, and from its RTL expansion. The default is
9090 100000.
9091
9092 min-nondebug-insn-uid
9093 Use uids starting at this parameter for nondebug insns. The
9094 range below the parameter is reserved exclusively for debug
9095 insns created by -fvar-tracking-assignments, but debug insns
9096 may get (non-overlapping) uids above it if the reserved range
9097 is exhausted.
9098
9099 ipa-sra-ptr-growth-factor
9100 IPA-SRA replaces a pointer to an aggregate with one or more new
9101 parameters only when their cumulative size is less or equal to
9102 ipa-sra-ptr-growth-factor times the size of the original
9103 pointer parameter.
9104
9105 sra-max-scalarization-size-Ospeed
9106 sra-max-scalarization-size-Osize
9107 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA)
9108 aim to replace scalar parts of aggregates with uses of
9109 independent scalar variables. These parameters control the
9110 maximum size, in storage units, of aggregate which is
9111 considered for replacement when compiling for speed (sra-max-
9112 scalarization-size-Ospeed) or size (sra-max-scalarization-size-
9113 Osize) respectively.
9114
9115 tm-max-aggregate-size
9116 When making copies of thread-local variables in a transaction,
9117 this parameter specifies the size in bytes after which
9118 variables are saved with the logging functions as opposed to
9119 save/restore code sequence pairs. This option only applies
9120 when using -fgnu-tm.
9121
9122 graphite-max-nb-scop-params
9123 To avoid exponential effects in the Graphite loop transforms,
9124 the number of parameters in a Static Control Part (SCoP) is
9125 bounded. The default value is 10 parameters, a value of zero
9126 can be used to lift the bound. A variable whose value is
9127 unknown at compilation time and defined outside a SCoP is a
9128 parameter of the SCoP.
9129
9130 loop-block-tile-size
9131 Loop blocking or strip mining transforms, enabled with
9132 -floop-block or -floop-strip-mine, strip mine each loop in the
9133 loop nest by a given number of iterations. The strip length
9134 can be changed using the loop-block-tile-size parameter. The
9135 default value is 51 iterations.
9136
9137 loop-unroll-jam-size
9138 Specify the unroll factor for the -floop-unroll-and-jam option.
9139 The default value is 4.
9140
9141 loop-unroll-jam-depth
9142 Specify the dimension to be unrolled (counting from the most
9143 inner loop) for the -floop-unroll-and-jam. The default value
9144 is 2.
9145
9146 ipa-cp-value-list-size
9147 IPA-CP attempts to track all possible values and types passed
9148 to a function's parameter in order to propagate them and
9149 perform devirtualization. ipa-cp-value-list-size is the
9150 maximum number of values and types it stores per one formal
9151 parameter of a function.
9152
9153 ipa-cp-eval-threshold
9154 IPA-CP calculates its own score of cloning profitability
9155 heuristics and performs those cloning opportunities with scores
9156 that exceed ipa-cp-eval-threshold.
9157
9158 ipa-cp-recursion-penalty
9159 Percentage penalty the recursive functions will receive when
9160 they are evaluated for cloning.
9161
9162 ipa-cp-single-call-penalty
9163 Percentage penalty functions containing a single call to
9164 another function will receive when they are evaluated for
9165 cloning.
9166
9167 ipa-max-agg-items
9168 IPA-CP is also capable to propagate a number of scalar values
9169 passed in an aggregate. ipa-max-agg-items controls the maximum
9170 number of such values per one parameter.
9171
9172 ipa-cp-loop-hint-bonus
9173 When IPA-CP determines that a cloning candidate would make the
9174 number of iterations of a loop known, it adds a bonus of ipa-
9175 cp-loop-hint-bonus to the profitability score of the candidate.
9176
9177 ipa-cp-array-index-hint-bonus
9178 When IPA-CP determines that a cloning candidate would make the
9179 index of an array access known, it adds a bonus of ipa-cp-
9180 array-index-hint-bonus to the profitability score of the
9181 candidate.
9182
9183 ipa-max-aa-steps
9184 During its analysis of function bodies, IPA-CP employs alias
9185 analysis in order to track values pointed to by function
9186 parameters. In order not spend too much time analyzing huge
9187 functions, it gives up and consider all memory clobbered after
9188 examining ipa-max-aa-steps statements modifying memory.
9189
9190 lto-partitions
9191 Specify desired number of partitions produced during WHOPR
9192 compilation. The number of partitions should exceed the number
9193 of CPUs used for compilation. The default value is 32.
9194
9195 lto-min-partition
9196 Size of minimal partition for WHOPR (in estimated
9197 instructions). This prevents expenses of splitting very small
9198 programs into too many partitions.
9199
9200 lto-max-partition
9201 Size of max partition for WHOPR (in estimated instructions).
9202 to provide an upper bound for individual size of partition.
9203 Meant to be used only with balanced partitioning.
9204
9205 cxx-max-namespaces-for-diagnostic-help
9206 The maximum number of namespaces to consult for suggestions
9207 when C++ name lookup fails for an identifier. The default is
9208 1000.
9209
9210 sink-frequency-threshold
9211 The maximum relative execution frequency (in percents) of the
9212 target block relative to a statement's original block to allow
9213 statement sinking of a statement. Larger numbers result in
9214 more aggressive statement sinking. The default value is 75. A
9215 small positive adjustment is applied for statements with memory
9216 operands as those are even more profitable so sink.
9217
9218 max-stores-to-sink
9219 The maximum number of conditional store pairs that can be sunk.
9220 Set to 0 if either vectorization (-ftree-vectorize) or if-
9221 conversion (-ftree-loop-if-convert) is disabled. The default
9222 is 2.
9223
9224 allow-store-data-races
9225 Allow optimizers to introduce new data races on stores. Set to
9226 1 to allow, otherwise to 0. This option is enabled by default
9227 at optimization level -Ofast.
9228
9229 case-values-threshold
9230 The smallest number of different values for which it is best to
9231 use a jump-table instead of a tree of conditional branches. If
9232 the value is 0, use the default for the machine. The default
9233 is 0.
9234
9235 tree-reassoc-width
9236 Set the maximum number of instructions executed in parallel in
9237 reassociated tree. This parameter overrides target dependent
9238 heuristics used by default if has non zero value.
9239
9240 sched-pressure-algorithm
9241 Choose between the two available implementations of
9242 -fsched-pressure. Algorithm 1 is the original implementation
9243 and is the more likely to prevent instructions from being
9244 reordered. Algorithm 2 was designed to be a compromise between
9245 the relatively conservative approach taken by algorithm 1 and
9246 the rather aggressive approach taken by the default scheduler.
9247 It relies more heavily on having a regular register file and
9248 accurate register pressure classes. See haifa-sched.c in the
9249 GCC sources for more details.
9250
9251 The default choice depends on the target.
9252
9253 max-slsr-cand-scan
9254 Set the maximum number of existing candidates that are
9255 considered when seeking a basis for a new straight-line
9256 strength reduction candidate.
9257
9258 asan-globals
9259 Enable buffer overflow detection for global objects. This kind
9260 of protection is enabled by default if you are using
9261 -fsanitize=address option. To disable global objects
9262 protection use --param asan-globals=0.
9263
9264 asan-stack
9265 Enable buffer overflow detection for stack objects. This kind
9266 of protection is enabled by default when using
9267 -fsanitize=address. To disable stack protection use --param
9268 asan-stack=0 option.
9269
9270 asan-instrument-reads
9271 Enable buffer overflow detection for memory reads. This kind
9272 of protection is enabled by default when using
9273 -fsanitize=address. To disable memory reads protection use
9274 --param asan-instrument-reads=0.
9275
9276 asan-instrument-writes
9277 Enable buffer overflow detection for memory writes. This kind
9278 of protection is enabled by default when using
9279 -fsanitize=address. To disable memory writes protection use
9280 --param asan-instrument-writes=0 option.
9281
9282 asan-memintrin
9283 Enable detection for built-in functions. This kind of
9284 protection is enabled by default when using -fsanitize=address.
9285 To disable built-in functions protection use --param
9286 asan-memintrin=0.
9287
9288 asan-use-after-return
9289 Enable detection of use-after-return. This kind of protection
9290 is enabled by default when using the -fsanitize=address option.
9291 To disable it use --param asan-use-after-return=0.
9292
9293 Note: By default the check is disabled at run time. To enable
9294 it, add "detect_stack_use_after_return=1" to the environment
9295 variable ASAN_OPTIONS.
9296
9297 asan-instrumentation-with-call-threshold
9298 If number of memory accesses in function being instrumented is
9299 greater or equal to this number, use callbacks instead of
9300 inline checks. E.g. to disable inline code use --param
9301 asan-instrumentation-with-call-threshold=0.
9302
9303 use-after-scope-direct-emission-threshold
9304 If the size of a local variable in bytes is smaller or equal to
9305 this number, directly poison (or unpoison) shadow memory
9306 instead of using run-time callbacks. The default value is 256.
9307
9308 chkp-max-ctor-size
9309 Static constructors generated by Pointer Bounds Checker may
9310 become very large and significantly increase compile time at
9311 optimization level -O1 and higher. This parameter is a maximum
9312 number of statements in a single generated constructor.
9313 Default value is 5000.
9314
9315 max-fsm-thread-path-insns
9316 Maximum number of instructions to copy when duplicating blocks
9317 on a finite state automaton jump thread path. The default is
9318 100.
9319
9320 max-fsm-thread-length
9321 Maximum number of basic blocks on a finite state automaton jump
9322 thread path. The default is 10.
9323
9324 max-fsm-thread-paths
9325 Maximum number of new jump thread paths to create for a finite
9326 state automaton. The default is 50.
9327
9328 parloops-chunk-size
9329 Chunk size of omp schedule for loops parallelized by parloops.
9330 The default is 0.
9331
9332 parloops-schedule
9333 Schedule type of omp schedule for loops parallelized by
9334 parloops (static, dynamic, guided, auto, runtime). The default
9335 is static.
9336
9337 parloops-min-per-thread
9338 The minimum number of iterations per thread of an innermost
9339 parallelized loop for which the parallelized variant is
9340 prefered over the single threaded one. The default is 100.
9341 Note that for a parallelized loop nest the minimum number of
9342 iterations of the outermost loop per thread is two.
9343
9344 max-ssa-name-query-depth
9345 Maximum depth of recursion when querying properties of SSA
9346 names in things like fold routines. One level of recursion
9347 corresponds to following a use-def chain.
9348
9349 hsa-gen-debug-stores
9350 Enable emission of special debug stores within HSA kernels
9351 which are then read and reported by libgomp plugin. Generation
9352 of these stores is disabled by default, use --param
9353 hsa-gen-debug-stores=1 to enable it.
9354
9355 max-speculative-devirt-maydefs
9356 The maximum number of may-defs we analyze when looking for a
9357 must-def specifying the dynamic type of an object that invokes
9358 a virtual call we may be able to devirtualize speculatively.
9359
9360 max-vrp-switch-assertions
9361 The maximum number of assertions to add along the default edge
9362 of a switch statement during VRP. The default is 10.
9363
9364 unroll-jam-min-percent
9365 The minimum percentage of memory references that must be
9366 optimized away for the unroll-and-jam transformation to be
9367 considered profitable.
9368
9369 unroll-jam-max-unroll
9370 The maximum number of times the outer loop should be unrolled
9371 by the unroll-and-jam transformation.
9372
9373 Program Instrumentation Options
9374 GCC supports a number of command-line options that control adding run-
9375 time instrumentation to the code it normally generates. For example,
9376 one purpose of instrumentation is collect profiling statistics for use
9377 in finding program hot spots, code coverage analysis, or profile-guided
9378 optimizations. Another class of program instrumentation is adding run-
9379 time checking to detect programming errors like invalid pointer
9380 dereferences or out-of-bounds array accesses, as well as deliberately
9381 hostile attacks such as stack smashing or C++ vtable hijacking. There
9382 is also a general hook which can be used to implement other forms of
9383 tracing or function-level instrumentation for debug or program analysis
9384 purposes.
9385
9386 -p Generate extra code to write profile information suitable for the
9387 analysis program prof. You must use this option when compiling the
9388 source files you want data about, and you must also use it when
9389 linking.
9390
9391 -pg Generate extra code to write profile information suitable for the
9392 analysis program gprof. You must use this option when compiling
9393 the source files you want data about, and you must also use it when
9394 linking.
9395
9396 -fprofile-arcs
9397 Add code so that program flow arcs are instrumented. During
9398 execution the program records how many times each branch and call
9399 is executed and how many times it is taken or returns. On targets
9400 that support constructors with priority support, profiling properly
9401 handles constructors, destructors and C++ constructors (and
9402 destructors) of classes which are used as a type of a global
9403 variable.
9404
9405 When the compiled program exits it saves this data to a file called
9406 auxname.gcda for each source file. The data may be used for
9407 profile-directed optimizations (-fbranch-probabilities), or for
9408 test coverage analysis (-ftest-coverage). Each object file's
9409 auxname is generated from the name of the output file, if
9410 explicitly specified and it is not the final executable, otherwise
9411 it is the basename of the source file. In both cases any suffix is
9412 removed (e.g. foo.gcda for input file dir/foo.c, or dir/foo.gcda
9413 for output file specified as -o dir/foo.o).
9414
9415 --coverage
9416 This option is used to compile and link code instrumented for
9417 coverage analysis. The option is a synonym for -fprofile-arcs
9418 -ftest-coverage (when compiling) and -lgcov (when linking). See
9419 the documentation for those options for more details.
9420
9421 * Compile the source files with -fprofile-arcs plus optimization
9422 and code generation options. For test coverage analysis, use
9423 the additional -ftest-coverage option. You do not need to
9424 profile every source file in a program.
9425
9426 * Compile the source files additionally with -fprofile-abs-path
9427 to create absolute path names in the .gcno files. This allows
9428 gcov to find the correct sources in projects where compilations
9429 occur with different working directories.
9430
9431 * Link your object files with -lgcov or -fprofile-arcs (the
9432 latter implies the former).
9433
9434 * Run the program on a representative workload to generate the
9435 arc profile information. This may be repeated any number of
9436 times. You can run concurrent instances of your program, and
9437 provided that the file system supports locking, the data files
9438 will be correctly updated. Unless a strict ISO C dialect
9439 option is in effect, "fork" calls are detected and correctly
9440 handled without double counting.
9441
9442 * For profile-directed optimizations, compile the source files
9443 again with the same optimization and code generation options
9444 plus -fbranch-probabilities.
9445
9446 * For test coverage analysis, use gcov to produce human readable
9447 information from the .gcno and .gcda files. Refer to the gcov
9448 documentation for further information.
9449
9450 With -fprofile-arcs, for each function of your program GCC creates
9451 a program flow graph, then finds a spanning tree for the graph.
9452 Only arcs that are not on the spanning tree have to be
9453 instrumented: the compiler adds code to count the number of times
9454 that these arcs are executed. When an arc is the only exit or only
9455 entrance to a block, the instrumentation code can be added to the
9456 block; otherwise, a new basic block must be created to hold the
9457 instrumentation code.
9458
9459 -ftest-coverage
9460 Produce a notes file that the gcov code-coverage utility can use to
9461 show program coverage. Each source file's note file is called
9462 auxname.gcno. Refer to the -fprofile-arcs option above for a
9463 description of auxname and instructions on how to generate test
9464 coverage data. Coverage data matches the source files more closely
9465 if you do not optimize.
9466
9467 -fprofile-abs-path
9468 Automatically convert relative source file names to absolute path
9469 names in the .gcno files. This allows gcov to find the correct
9470 sources in projects where compilations occur with different working
9471 directories.
9472
9473 -fprofile-dir=path
9474 Set the directory to search for the profile data files in to path.
9475 This option affects only the profile data generated by
9476 -fprofile-generate, -ftest-coverage, -fprofile-arcs and used by
9477 -fprofile-use and -fbranch-probabilities and its related options.
9478 Both absolute and relative paths can be used. By default, GCC uses
9479 the current directory as path, thus the profile data file appears
9480 in the same directory as the object file.
9481
9482 -fprofile-generate
9483 -fprofile-generate=path
9484 Enable options usually used for instrumenting application to
9485 produce profile useful for later recompilation with profile
9486 feedback based optimization. You must use -fprofile-generate both
9487 when compiling and when linking your program.
9488
9489 The following options are enabled: -fprofile-arcs,
9490 -fprofile-values, -fvpt.
9491
9492 If path is specified, GCC looks at the path to find the profile
9493 feedback data files. See -fprofile-dir.
9494
9495 To optimize the program based on the collected profile information,
9496 use -fprofile-use.
9497
9498 -fprofile-update=method
9499 Alter the update method for an application instrumented for profile
9500 feedback based optimization. The method argument should be one of
9501 single, atomic or prefer-atomic. The first one is useful for
9502 single-threaded applications, while the second one prevents profile
9503 corruption by emitting thread-safe code.
9504
9505 Warning: When an application does not properly join all threads (or
9506 creates an detached thread), a profile file can be still corrupted.
9507
9508 Using prefer-atomic would be transformed either to atomic, when
9509 supported by a target, or to single otherwise. The GCC driver
9510 automatically selects prefer-atomic when -pthread is present in the
9511 command line.
9512
9513 -fsanitize=address
9514 Enable AddressSanitizer, a fast memory error detector. Memory
9515 access instructions are instrumented to detect out-of-bounds and
9516 use-after-free bugs. The option enables
9517 -fsanitize-address-use-after-scope. See
9518 <https://github.com/google/sanitizers/wiki/AddressSanitizer> for
9519 more details. The run-time behavior can be influenced using the
9520 ASAN_OPTIONS environment variable. When set to "help=1", the
9521 available options are shown at startup of the instrumented program.
9522 See
9523 <https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags>
9524 for a list of supported options. The option cannot be combined
9525 with -fsanitize=thread and/or -fcheck-pointer-bounds.
9526
9527 -fsanitize=kernel-address
9528 Enable AddressSanitizer for Linux kernel. See
9529 <https://github.com/google/kasan/wiki> for more details. The
9530 option cannot be combined with -fcheck-pointer-bounds.
9531
9532 -fsanitize=pointer-compare
9533 Instrument comparison operation (<, <=, >, >=) with pointer
9534 operands. The option must be combined with either
9535 -fsanitize=kernel-address or -fsanitize=address The option cannot
9536 be combined with -fsanitize=thread and/or -fcheck-pointer-bounds.
9537 Note: By default the check is disabled at run time. To enable it,
9538 add "detect_invalid_pointer_pairs=2" to the environment variable
9539 ASAN_OPTIONS. Using "detect_invalid_pointer_pairs=1" detects
9540 invalid operation only when both pointers are non-null.
9541
9542 -fsanitize=pointer-subtract
9543 Instrument subtraction with pointer operands. The option must be
9544 combined with either -fsanitize=kernel-address or
9545 -fsanitize=address The option cannot be combined with
9546 -fsanitize=thread and/or -fcheck-pointer-bounds. Note: By default
9547 the check is disabled at run time. To enable it, add
9548 "detect_invalid_pointer_pairs=2" to the environment variable
9549 ASAN_OPTIONS. Using "detect_invalid_pointer_pairs=1" detects
9550 invalid operation only when both pointers are non-null.
9551
9552 -fsanitize=thread
9553 Enable ThreadSanitizer, a fast data race detector. Memory access
9554 instructions are instrumented to detect data race bugs. See
9555 <https://github.com/google/sanitizers/wiki#threadsanitizer> for
9556 more details. The run-time behavior can be influenced using the
9557 TSAN_OPTIONS environment variable; see
9558 <https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags>
9559 for a list of supported options. The option cannot be combined
9560 with -fsanitize=address, -fsanitize=leak and/or
9561 -fcheck-pointer-bounds.
9562
9563 Note that sanitized atomic builtins cannot throw exceptions when
9564 operating on invalid memory addresses with non-call exceptions
9565 (-fnon-call-exceptions).
9566
9567 -fsanitize=leak
9568 Enable LeakSanitizer, a memory leak detector. This option only
9569 matters for linking of executables and the executable is linked
9570 against a library that overrides "malloc" and other allocator
9571 functions. See
9572 <https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer>
9573 for more details. The run-time behavior can be influenced using
9574 the LSAN_OPTIONS environment variable. The option cannot be
9575 combined with -fsanitize=thread.
9576
9577 -fsanitize=undefined
9578 Enable UndefinedBehaviorSanitizer, a fast undefined behavior
9579 detector. Various computations are instrumented to detect
9580 undefined behavior at runtime. Current suboptions are:
9581
9582 -fsanitize=shift
9583 This option enables checking that the result of a shift
9584 operation is not undefined. Note that what exactly is
9585 considered undefined differs slightly between C and C++, as
9586 well as between ISO C90 and C99, etc. This option has two
9587 suboptions, -fsanitize=shift-base and
9588 -fsanitize=shift-exponent.
9589
9590 -fsanitize=shift-exponent
9591 This option enables checking that the second argument of a
9592 shift operation is not negative and is smaller than the
9593 precision of the promoted first argument.
9594
9595 -fsanitize=shift-base
9596 If the second argument of a shift operation is within range,
9597 check that the result of a shift operation is not undefined.
9598 Note that what exactly is considered undefined differs slightly
9599 between C and C++, as well as between ISO C90 and C99, etc.
9600
9601 -fsanitize=integer-divide-by-zero
9602 Detect integer division by zero as well as "INT_MIN / -1"
9603 division.
9604
9605 -fsanitize=unreachable
9606 With this option, the compiler turns the
9607 "__builtin_unreachable" call into a diagnostics message call
9608 instead. When reaching the "__builtin_unreachable" call, the
9609 behavior is undefined.
9610
9611 -fsanitize=vla-bound
9612 This option instructs the compiler to check that the size of a
9613 variable length array is positive.
9614
9615 -fsanitize=null
9616 This option enables pointer checking. Particularly, the
9617 application built with this option turned on will issue an
9618 error message when it tries to dereference a NULL pointer, or
9619 if a reference (possibly an rvalue reference) is bound to a
9620 NULL pointer, or if a method is invoked on an object pointed by
9621 a NULL pointer.
9622
9623 -fsanitize=return
9624 This option enables return statement checking. Programs built
9625 with this option turned on will issue an error message when the
9626 end of a non-void function is reached without actually
9627 returning a value. This option works in C++ only.
9628
9629 -fsanitize=signed-integer-overflow
9630 This option enables signed integer overflow checking. We check
9631 that the result of "+", "*", and both unary and binary "-" does
9632 not overflow in the signed arithmetics. Note, integer
9633 promotion rules must be taken into account. That is, the
9634 following is not an overflow:
9635
9636 signed char a = SCHAR_MAX;
9637 a++;
9638
9639 -fsanitize=bounds
9640 This option enables instrumentation of array bounds. Various
9641 out of bounds accesses are detected. Flexible array members,
9642 flexible array member-like arrays, and initializers of
9643 variables with static storage are not instrumented. The option
9644 cannot be combined with -fcheck-pointer-bounds.
9645
9646 -fsanitize=bounds-strict
9647 This option enables strict instrumentation of array bounds.
9648 Most out of bounds accesses are detected, including flexible
9649 array members and flexible array member-like arrays.
9650 Initializers of variables with static storage are not
9651 instrumented. The option cannot be combined with
9652 -fcheck-pointer-bounds.
9653
9654 -fsanitize=alignment
9655 This option enables checking of alignment of pointers when they
9656 are dereferenced, or when a reference is bound to
9657 insufficiently aligned target, or when a method or constructor
9658 is invoked on insufficiently aligned object.
9659
9660 -fsanitize=object-size
9661 This option enables instrumentation of memory references using
9662 the "__builtin_object_size" function. Various out of bounds
9663 pointer accesses are detected.
9664
9665 -fsanitize=float-divide-by-zero
9666 Detect floating-point division by zero. Unlike other similar
9667 options, -fsanitize=float-divide-by-zero is not enabled by
9668 -fsanitize=undefined, since floating-point division by zero can
9669 be a legitimate way of obtaining infinities and NaNs.
9670
9671 -fsanitize=float-cast-overflow
9672 This option enables floating-point type to integer conversion
9673 checking. We check that the result of the conversion does not
9674 overflow. Unlike other similar options,
9675 -fsanitize=float-cast-overflow is not enabled by
9676 -fsanitize=undefined. This option does not work well with
9677 "FE_INVALID" exceptions enabled.
9678
9679 -fsanitize=nonnull-attribute
9680 This option enables instrumentation of calls, checking whether
9681 null values are not passed to arguments marked as requiring a
9682 non-null value by the "nonnull" function attribute.
9683
9684 -fsanitize=returns-nonnull-attribute
9685 This option enables instrumentation of return statements in
9686 functions marked with "returns_nonnull" function attribute, to
9687 detect returning of null values from such functions.
9688
9689 -fsanitize=bool
9690 This option enables instrumentation of loads from bool. If a
9691 value other than 0/1 is loaded, a run-time error is issued.
9692
9693 -fsanitize=enum
9694 This option enables instrumentation of loads from an enum type.
9695 If a value outside the range of values for the enum type is
9696 loaded, a run-time error is issued.
9697
9698 -fsanitize=vptr
9699 This option enables instrumentation of C++ member function
9700 calls, member accesses and some conversions between pointers to
9701 base and derived classes, to verify the referenced object has
9702 the correct dynamic type.
9703
9704 -fsanitize=pointer-overflow
9705 This option enables instrumentation of pointer arithmetics. If
9706 the pointer arithmetics overflows, a run-time error is issued.
9707
9708 -fsanitize=builtin
9709 This option enables instrumentation of arguments to selected
9710 builtin functions. If an invalid value is passed to such
9711 arguments, a run-time error is issued. E.g. passing 0 as the
9712 argument to "__builtin_ctz" or "__builtin_clz" invokes
9713 undefined behavior and is diagnosed by this option.
9714
9715 While -ftrapv causes traps for signed overflows to be emitted,
9716 -fsanitize=undefined gives a diagnostic message. This currently
9717 works only for the C family of languages.
9718
9719 -fno-sanitize=all
9720 This option disables all previously enabled sanitizers.
9721 -fsanitize=all is not allowed, as some sanitizers cannot be used
9722 together.
9723
9724 -fasan-shadow-offset=number
9725 This option forces GCC to use custom shadow offset in
9726 AddressSanitizer checks. It is useful for experimenting with
9727 different shadow memory layouts in Kernel AddressSanitizer.
9728
9729 -fsanitize-sections=s1,s2,...
9730 Sanitize global variables in selected user-defined sections. si
9731 may contain wildcards.
9732
9733 -fsanitize-recover[=opts]
9734 -fsanitize-recover= controls error recovery mode for sanitizers
9735 mentioned in comma-separated list of opts. Enabling this option
9736 for a sanitizer component causes it to attempt to continue running
9737 the program as if no error happened. This means multiple runtime
9738 errors can be reported in a single program run, and the exit code
9739 of the program may indicate success even when errors have been
9740 reported. The -fno-sanitize-recover= option can be used to alter
9741 this behavior: only the first detected error is reported and
9742 program then exits with a non-zero exit code.
9743
9744 Currently this feature only works for -fsanitize=undefined (and its
9745 suboptions except for -fsanitize=unreachable and
9746 -fsanitize=return), -fsanitize=float-cast-overflow,
9747 -fsanitize=float-divide-by-zero, -fsanitize=bounds-strict,
9748 -fsanitize=kernel-address and -fsanitize=address. For these
9749 sanitizers error recovery is turned on by default, except
9750 -fsanitize=address, for which this feature is experimental.
9751 -fsanitize-recover=all and -fno-sanitize-recover=all is also
9752 accepted, the former enables recovery for all sanitizers that
9753 support it, the latter disables recovery for all sanitizers that
9754 support it.
9755
9756 Even if a recovery mode is turned on the compiler side, it needs to
9757 be also enabled on the runtime library side, otherwise the failures
9758 are still fatal. The runtime library defaults to "halt_on_error=0"
9759 for ThreadSanitizer and UndefinedBehaviorSanitizer, while default
9760 value for AddressSanitizer is "halt_on_error=1". This can be
9761 overridden through setting the "halt_on_error" flag in the
9762 corresponding environment variable.
9763
9764 Syntax without an explicit opts parameter is deprecated. It is
9765 equivalent to specifying an opts list of:
9766
9767 undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
9768
9769 -fsanitize-address-use-after-scope
9770 Enable sanitization of local variables to detect use-after-scope
9771 bugs. The option sets -fstack-reuse to none.
9772
9773 -fsanitize-undefined-trap-on-error
9774 The -fsanitize-undefined-trap-on-error option instructs the
9775 compiler to report undefined behavior using "__builtin_trap" rather
9776 than a "libubsan" library routine. The advantage of this is that
9777 the "libubsan" library is not needed and is not linked in, so this
9778 is usable even in freestanding environments.
9779
9780 -fsanitize-coverage=trace-pc
9781 Enable coverage-guided fuzzing code instrumentation. Inserts a
9782 call to "__sanitizer_cov_trace_pc" into every basic block.
9783
9784 -fsanitize-coverage=trace-cmp
9785 Enable dataflow guided fuzzing code instrumentation. Inserts a
9786 call to "__sanitizer_cov_trace_cmp1", "__sanitizer_cov_trace_cmp2",
9787 "__sanitizer_cov_trace_cmp4" or "__sanitizer_cov_trace_cmp8" for
9788 integral comparison with both operands variable or
9789 "__sanitizer_cov_trace_const_cmp1",
9790 "__sanitizer_cov_trace_const_cmp2",
9791 "__sanitizer_cov_trace_const_cmp4" or
9792 "__sanitizer_cov_trace_const_cmp8" for integral comparison with one
9793 operand constant, "__sanitizer_cov_trace_cmpf" or
9794 "__sanitizer_cov_trace_cmpd" for float or double comparisons and
9795 "__sanitizer_cov_trace_switch" for switch statements.
9796
9797 -fbounds-check
9798 For front ends that support it, generate additional code to check
9799 that indices used to access arrays are within the declared range.
9800 This is currently only supported by the Fortran front end, where
9801 this option defaults to false.
9802
9803 -fcheck-pointer-bounds
9804 Enable Pointer Bounds Checker instrumentation. Each memory
9805 reference is instrumented with checks of the pointer used for
9806 memory access against bounds associated with that pointer.
9807
9808 Currently there is only an implementation for Intel MPX available,
9809 thus x86 GNU/Linux target and -mmpx are required to enable this
9810 feature. MPX-based instrumentation requires a runtime library to
9811 enable MPX in hardware and handle bounds violation signals. By
9812 default when -fcheck-pointer-bounds and -mmpx options are used to
9813 link a program, the GCC driver links against the libmpx and
9814 libmpxwrappers libraries. Bounds checking on calls to dynamic
9815 libraries requires a linker with -z bndplt support; if GCC was
9816 configured with a linker without support for this option (including
9817 the Gold linker and older versions of ld), a warning is given if
9818 you link with -mmpx without also specifying -static, since the
9819 overall effectiveness of the bounds checking protection is reduced.
9820 See also -static-libmpxwrappers.
9821
9822 MPX-based instrumentation may be used for debugging and also may be
9823 included in production code to increase program security.
9824 Depending on usage, you may have different requirements for the
9825 runtime library. The current version of the MPX runtime library is
9826 more oriented for use as a debugging tool. MPX runtime library
9827 usage implies -lpthread. See also -static-libmpx. The runtime
9828 library behavior can be influenced using various CHKP_RT_*
9829 environment variables. See
9830 <https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler>
9831 for more details.
9832
9833 Generated instrumentation may be controlled by various -fchkp-*
9834 options and by the "bnd_variable_size" structure field attribute
9835 and "bnd_legacy", and "bnd_instrument" function attributes. GCC
9836 also provides a number of built-in functions for controlling the
9837 Pointer Bounds Checker.
9838
9839 -fchkp-check-incomplete-type
9840 Generate pointer bounds checks for variables with incomplete type.
9841 Enabled by default.
9842
9843 -fchkp-narrow-bounds
9844 Controls bounds used by Pointer Bounds Checker for pointers to
9845 object fields. If narrowing is enabled then field bounds are used.
9846 Otherwise object bounds are used. See also
9847 -fchkp-narrow-to-innermost-array and
9848 -fchkp-first-field-has-own-bounds. Enabled by default.
9849
9850 -fchkp-first-field-has-own-bounds
9851 Forces Pointer Bounds Checker to use narrowed bounds for the
9852 address of the first field in the structure. By default a pointer
9853 to the first field has the same bounds as a pointer to the whole
9854 structure.
9855
9856 -fchkp-flexible-struct-trailing-arrays
9857 Forces Pointer Bounds Checker to treat all trailing arrays in
9858 structures as possibly flexible. By default only array fields with
9859 zero length or that are marked with attribute bnd_variable_size are
9860 treated as flexible.
9861
9862 -fchkp-narrow-to-innermost-array
9863 Forces Pointer Bounds Checker to use bounds of the innermost arrays
9864 in case of nested static array access. By default this option is
9865 disabled and bounds of the outermost array are used.
9866
9867 -fchkp-optimize
9868 Enables Pointer Bounds Checker optimizations. Enabled by default
9869 at optimization levels -O, -O2, -O3.
9870
9871 -fchkp-use-fast-string-functions
9872 Enables use of *_nobnd versions of string functions (not copying
9873 bounds) by Pointer Bounds Checker. Disabled by default.
9874
9875 -fchkp-use-nochk-string-functions
9876 Enables use of *_nochk versions of string functions (not checking
9877 bounds) by Pointer Bounds Checker. Disabled by default.
9878
9879 -fchkp-use-static-bounds
9880 Allow Pointer Bounds Checker to generate static bounds holding
9881 bounds of static variables. Enabled by default.
9882
9883 -fchkp-use-static-const-bounds
9884 Use statically-initialized bounds for constant bounds instead of
9885 generating them each time they are required. By default enabled
9886 when -fchkp-use-static-bounds is enabled.
9887
9888 -fchkp-treat-zero-dynamic-size-as-infinite
9889 With this option, objects with incomplete type whose dynamically-
9890 obtained size is zero are treated as having infinite size instead
9891 by Pointer Bounds Checker. This option may be helpful if a program
9892 is linked with a library missing size information for some symbols.
9893 Disabled by default.
9894
9895 -fchkp-check-read
9896 Instructs Pointer Bounds Checker to generate checks for all read
9897 accesses to memory. Enabled by default.
9898
9899 -fchkp-check-write
9900 Instructs Pointer Bounds Checker to generate checks for all write
9901 accesses to memory. Enabled by default.
9902
9903 -fchkp-store-bounds
9904 Instructs Pointer Bounds Checker to generate bounds stores for
9905 pointer writes. Enabled by default.
9906
9907 -fchkp-instrument-calls
9908 Instructs Pointer Bounds Checker to pass pointer bounds to calls.
9909 Enabled by default.
9910
9911 -fchkp-instrument-marked-only
9912 Instructs Pointer Bounds Checker to instrument only functions
9913 marked with the "bnd_instrument" attribute. Disabled by default.
9914
9915 -fchkp-use-wrappers
9916 Allows Pointer Bounds Checker to replace calls to built-in
9917 functions with calls to wrapper functions. When
9918 -fchkp-use-wrappers is used to link a program, the GCC driver
9919 automatically links against libmpxwrappers. See also
9920 -static-libmpxwrappers. Enabled by default.
9921
9922 -fcf-protection=[full|branch|return|none]
9923 Enable code instrumentation of control-flow transfers to increase
9924 program security by checking that target addresses of control-flow
9925 transfer instructions (such as indirect function call, function
9926 return, indirect jump) are valid. This prevents diverting the flow
9927 of control to an unexpected target. This is intended to protect
9928 against such threats as Return-oriented Programming (ROP), and
9929 similarly call/jmp-oriented programming (COP/JOP).
9930
9931 The value "branch" tells the compiler to implement checking of
9932 validity of control-flow transfer at the point of indirect branch
9933 instructions, i.e. call/jmp instructions. The value "return"
9934 implements checking of validity at the point of returning from a
9935 function. The value "full" is an alias for specifying both
9936 "branch" and "return". The value "none" turns off instrumentation.
9937
9938 The macro "__CET__" is defined when -fcf-protection is used. The
9939 first bit of "__CET__" is set to 1 for the value "branch" and the
9940 second bit of "__CET__" is set to 1 for the "return".
9941
9942 You can also use the "nocf_check" attribute to identify which
9943 functions and calls should be skipped from instrumentation.
9944
9945 Currently the x86 GNU/Linux target provides an implementation based
9946 on Intel Control-flow Enforcement Technology (CET).
9947
9948 -fstack-protector
9949 Emit extra code to check for buffer overflows, such as stack
9950 smashing attacks. This is done by adding a guard variable to
9951 functions with vulnerable objects. This includes functions that
9952 call "alloca", and functions with buffers larger than 8 bytes. The
9953 guards are initialized when a function is entered and then checked
9954 when the function exits. If a guard check fails, an error message
9955 is printed and the program exits.
9956
9957 -fstack-protector-all
9958 Like -fstack-protector except that all functions are protected.
9959
9960 -fstack-protector-strong
9961 Like -fstack-protector but includes additional functions to be
9962 protected --- those that have local array definitions, or have
9963 references to local frame addresses.
9964
9965 -fstack-protector-explicit
9966 Like -fstack-protector but only protects those functions which have
9967 the "stack_protect" attribute.
9968
9969 -fstack-check
9970 Generate code to verify that you do not go beyond the boundary of
9971 the stack. You should specify this flag if you are running in an
9972 environment with multiple threads, but you only rarely need to
9973 specify it in a single-threaded environment since stack overflow is
9974 automatically detected on nearly all systems if there is only one
9975 stack.
9976
9977 Note that this switch does not actually cause checking to be done;
9978 the operating system or the language runtime must do that. The
9979 switch causes generation of code to ensure that they see the stack
9980 being extended.
9981
9982 You can additionally specify a string parameter: no means no
9983 checking, generic means force the use of old-style checking,
9984 specific means use the best checking method and is equivalent to
9985 bare -fstack-check.
9986
9987 Old-style checking is a generic mechanism that requires no specific
9988 target support in the compiler but comes with the following
9989 drawbacks:
9990
9991 1. Modified allocation strategy for large objects: they are always
9992 allocated dynamically if their size exceeds a fixed threshold.
9993 Note this may change the semantics of some code.
9994
9995 2. Fixed limit on the size of the static frame of functions: when
9996 it is topped by a particular function, stack checking is not
9997 reliable and a warning is issued by the compiler.
9998
9999 3. Inefficiency: because of both the modified allocation strategy
10000 and the generic implementation, code performance is hampered.
10001
10002 Note that old-style stack checking is also the fallback method for
10003 specific if no target support has been added in the compiler.
10004
10005 -fstack-check= is designed for Ada's needs to detect infinite
10006 recursion and stack overflows. specific is an excellent choice
10007 when compiling Ada code. It is not generally sufficient to protect
10008 against stack-clash attacks. To protect against those you want
10009 -fstack-clash-protection.
10010
10011 -fstack-clash-protection
10012 Generate code to prevent stack clash style attacks. When this
10013 option is enabled, the compiler will only allocate one page of
10014 stack space at a time and each page is accessed immediately after
10015 allocation. Thus, it prevents allocations from jumping over any
10016 stack guard page provided by the operating system.
10017
10018 Most targets do not fully support stack clash protection. However,
10019 on those targets -fstack-clash-protection will protect dynamic
10020 stack allocations. -fstack-clash-protection may also provide
10021 limited protection for static stack allocations if the target
10022 supports -fstack-check=specific.
10023
10024 -fstack-limit-register=reg
10025 -fstack-limit-symbol=sym
10026 -fno-stack-limit
10027 Generate code to ensure that the stack does not grow beyond a
10028 certain value, either the value of a register or the address of a
10029 symbol. If a larger stack is required, a signal is raised at run
10030 time. For most targets, the signal is raised before the stack
10031 overruns the boundary, so it is possible to catch the signal
10032 without taking special precautions.
10033
10034 For instance, if the stack starts at absolute address 0x80000000
10035 and grows downwards, you can use the flags
10036 -fstack-limit-symbol=__stack_limit and
10037 -Wl,--defsym,__stack_limit=0x7ffe0000 to enforce a stack limit of
10038 128KB. Note that this may only work with the GNU linker.
10039
10040 You can locally override stack limit checking by using the
10041 "no_stack_limit" function attribute.
10042
10043 -fsplit-stack
10044 Generate code to automatically split the stack before it overflows.
10045 The resulting program has a discontiguous stack which can only
10046 overflow if the program is unable to allocate any more memory.
10047 This is most useful when running threaded programs, as it is no
10048 longer necessary to calculate a good stack size to use for each
10049 thread. This is currently only implemented for the x86 targets
10050 running GNU/Linux.
10051
10052 When code compiled with -fsplit-stack calls code compiled without
10053 -fsplit-stack, there may not be much stack space available for the
10054 latter code to run. If compiling all code, including library code,
10055 with -fsplit-stack is not an option, then the linker can fix up
10056 these calls so that the code compiled without -fsplit-stack always
10057 has a large stack. Support for this is implemented in the gold
10058 linker in GNU binutils release 2.21 and later.
10059
10060 -fvtable-verify=[std|preinit|none]
10061 This option is only available when compiling C++ code. It turns on
10062 (or off, if using -fvtable-verify=none) the security feature that
10063 verifies at run time, for every virtual call, that the vtable
10064 pointer through which the call is made is valid for the type of the
10065 object, and has not been corrupted or overwritten. If an invalid
10066 vtable pointer is detected at run time, an error is reported and
10067 execution of the program is immediately halted.
10068
10069 This option causes run-time data structures to be built at program
10070 startup, which are used for verifying the vtable pointers. The
10071 options std and preinit control the timing of when these data
10072 structures are built. In both cases the data structures are built
10073 before execution reaches "main". Using -fvtable-verify=std causes
10074 the data structures to be built after shared libraries have been
10075 loaded and initialized. -fvtable-verify=preinit causes them to be
10076 built before shared libraries have been loaded and initialized.
10077
10078 If this option appears multiple times in the command line with
10079 different values specified, none takes highest priority over both
10080 std and preinit; preinit takes priority over std.
10081
10082 -fvtv-debug
10083 When used in conjunction with -fvtable-verify=std or
10084 -fvtable-verify=preinit, causes debug versions of the runtime
10085 functions for the vtable verification feature to be called. This
10086 flag also causes the compiler to log information about which vtable
10087 pointers it finds for each class. This information is written to a
10088 file named vtv_set_ptr_data.log in the directory named by the
10089 environment variable VTV_LOGS_DIR if that is defined or the current
10090 working directory otherwise.
10091
10092 Note: This feature appends data to the log file. If you want a
10093 fresh log file, be sure to delete any existing one.
10094
10095 -fvtv-counts
10096 This is a debugging flag. When used in conjunction with
10097 -fvtable-verify=std or -fvtable-verify=preinit, this causes the
10098 compiler to keep track of the total number of virtual calls it
10099 encounters and the number of verifications it inserts. It also
10100 counts the number of calls to certain run-time library functions
10101 that it inserts and logs this information for each compilation
10102 unit. The compiler writes this information to a file named
10103 vtv_count_data.log in the directory named by the environment
10104 variable VTV_LOGS_DIR if that is defined or the current working
10105 directory otherwise. It also counts the size of the vtable pointer
10106 sets for each class, and writes this information to
10107 vtv_class_set_sizes.log in the same directory.
10108
10109 Note: This feature appends data to the log files. To get fresh
10110 log files, be sure to delete any existing ones.
10111
10112 -finstrument-functions
10113 Generate instrumentation calls for entry and exit to functions.
10114 Just after function entry and just before function exit, the
10115 following profiling functions are called with the address of the
10116 current function and its call site. (On some platforms,
10117 "__builtin_return_address" does not work beyond the current
10118 function, so the call site information may not be available to the
10119 profiling functions otherwise.)
10120
10121 void __cyg_profile_func_enter (void *this_fn,
10122 void *call_site);
10123 void __cyg_profile_func_exit (void *this_fn,
10124 void *call_site);
10125
10126 The first argument is the address of the start of the current
10127 function, which may be looked up exactly in the symbol table.
10128
10129 This instrumentation is also done for functions expanded inline in
10130 other functions. The profiling calls indicate where, conceptually,
10131 the inline function is entered and exited. This means that
10132 addressable versions of such functions must be available. If all
10133 your uses of a function are expanded inline, this may mean an
10134 additional expansion of code size. If you use "extern inline" in
10135 your C code, an addressable version of such functions must be
10136 provided. (This is normally the case anyway, but if you get lucky
10137 and the optimizer always expands the functions inline, you might
10138 have gotten away without providing static copies.)
10139
10140 A function may be given the attribute "no_instrument_function", in
10141 which case this instrumentation is not done. This can be used, for
10142 example, for the profiling functions listed above, high-priority
10143 interrupt routines, and any functions from which the profiling
10144 functions cannot safely be called (perhaps signal handlers, if the
10145 profiling routines generate output or allocate memory).
10146
10147 -finstrument-functions-exclude-file-list=file,file,...
10148 Set the list of functions that are excluded from instrumentation
10149 (see the description of -finstrument-functions). If the file that
10150 contains a function definition matches with one of file, then that
10151 function is not instrumented. The match is done on substrings: if
10152 the file parameter is a substring of the file name, it is
10153 considered to be a match.
10154
10155 For example:
10156
10157 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
10158
10159 excludes any inline function defined in files whose pathnames
10160 contain /bits/stl or include/sys.
10161
10162 If, for some reason, you want to include letter , in one of sym,
10163 write ,. For example,
10164 -finstrument-functions-exclude-file-list=',,tmp' (note the single
10165 quote surrounding the option).
10166
10167 -finstrument-functions-exclude-function-list=sym,sym,...
10168 This is similar to -finstrument-functions-exclude-file-list, but
10169 this option sets the list of function names to be excluded from
10170 instrumentation. The function name to be matched is its user-
10171 visible name, such as "vector<int> blah(const vector<int> &)", not
10172 the internal mangled name (e.g., "_Z4blahRSt6vectorIiSaIiEE"). The
10173 match is done on substrings: if the sym parameter is a substring of
10174 the function name, it is considered to be a match. For C99 and C++
10175 extended identifiers, the function name must be given in UTF-8, not
10176 using universal character names.
10177
10178 -fpatchable-function-entry=N[,M]
10179 Generate N NOPs right at the beginning of each function, with the
10180 function entry point before the Mth NOP. If M is omitted, it
10181 defaults to 0 so the function entry points to the address just at
10182 the first NOP. The NOP instructions reserve extra space which can
10183 be used to patch in any desired instrumentation at run time,
10184 provided that the code segment is writable. The amount of space is
10185 controllable indirectly via the number of NOPs; the NOP instruction
10186 used corresponds to the instruction emitted by the internal GCC
10187 back-end interface "gen_nop". This behavior is target-specific and
10188 may also depend on the architecture variant and/or other
10189 compilation options.
10190
10191 For run-time identification, the starting addresses of these areas,
10192 which correspond to their respective function entries minus M, are
10193 additionally collected in the "__patchable_function_entries"
10194 section of the resulting binary.
10195
10196 Note that the value of "__attribute__ ((patchable_function_entry
10197 (N,M)))" takes precedence over command-line option
10198 -fpatchable-function-entry=N,M. This can be used to increase the
10199 area size or to remove it completely on a single function. If
10200 "N=0", no pad location is recorded.
10201
10202 The NOP instructions are inserted at---and maybe before, depending
10203 on M---the function entry address, even before the prologue.
10204
10205 Options Controlling the Preprocessor
10206 These options control the C preprocessor, which is run on each C source
10207 file before actual compilation.
10208
10209 If you use the -E option, nothing is done except preprocessing. Some
10210 of these options make sense only together with -E because they cause
10211 the preprocessor output to be unsuitable for actual compilation.
10212
10213 In addition to the options listed here, there are a number of options
10214 to control search paths for include files documented in Directory
10215 Options. Options to control preprocessor diagnostics are listed in
10216 Warning Options.
10217
10218 -D name
10219 Predefine name as a macro, with definition 1.
10220
10221 -D name=definition
10222 The contents of definition are tokenized and processed as if they
10223 appeared during translation phase three in a #define directive. In
10224 particular, the definition is truncated by embedded newline
10225 characters.
10226
10227 If you are invoking the preprocessor from a shell or shell-like
10228 program you may need to use the shell's quoting syntax to protect
10229 characters such as spaces that have a meaning in the shell syntax.
10230
10231 If you wish to define a function-like macro on the command line,
10232 write its argument list with surrounding parentheses before the
10233 equals sign (if any). Parentheses are meaningful to most shells,
10234 so you should quote the option. With sh and csh,
10235 -D'name(args...)=definition' works.
10236
10237 -D and -U options are processed in the order they are given on the
10238 command line. All -imacros file and -include file options are
10239 processed after all -D and -U options.
10240
10241 -U name
10242 Cancel any previous definition of name, either built in or provided
10243 with a -D option.
10244
10245 -include file
10246 Process file as if "#include "file"" appeared as the first line of
10247 the primary source file. However, the first directory searched for
10248 file is the preprocessor's working directory instead of the
10249 directory containing the main source file. If not found there, it
10250 is searched for in the remainder of the "#include "..."" search
10251 chain as normal.
10252
10253 If multiple -include options are given, the files are included in
10254 the order they appear on the command line.
10255
10256 -imacros file
10257 Exactly like -include, except that any output produced by scanning
10258 file is thrown away. Macros it defines remain defined. This
10259 allows you to acquire all the macros from a header without also
10260 processing its declarations.
10261
10262 All files specified by -imacros are processed before all files
10263 specified by -include.
10264
10265 -undef
10266 Do not predefine any system-specific or GCC-specific macros. The
10267 standard predefined macros remain defined.
10268
10269 -pthread
10270 Define additional macros required for using the POSIX threads
10271 library. You should use this option consistently for both
10272 compilation and linking. This option is supported on GNU/Linux
10273 targets, most other Unix derivatives, and also on x86 Cygwin and
10274 MinGW targets.
10275
10276 -M Instead of outputting the result of preprocessing, output a rule
10277 suitable for make describing the dependencies of the main source
10278 file. The preprocessor outputs one make rule containing the object
10279 file name for that source file, a colon, and the names of all the
10280 included files, including those coming from -include or -imacros
10281 command-line options.
10282
10283 Unless specified explicitly (with -MT or -MQ), the object file name
10284 consists of the name of the source file with any suffix replaced
10285 with object file suffix and with any leading directory parts
10286 removed. If there are many included files then the rule is split
10287 into several lines using \-newline. The rule has no commands.
10288
10289 This option does not suppress the preprocessor's debug output, such
10290 as -dM. To avoid mixing such debug output with the dependency
10291 rules you should explicitly specify the dependency output file with
10292 -MF, or use an environment variable like DEPENDENCIES_OUTPUT.
10293 Debug output is still sent to the regular output stream as normal.
10294
10295 Passing -M to the driver implies -E, and suppresses warnings with
10296 an implicit -w.
10297
10298 -MM Like -M but do not mention header files that are found in system
10299 header directories, nor header files that are included, directly or
10300 indirectly, from such a header.
10301
10302 This implies that the choice of angle brackets or double quotes in
10303 an #include directive does not in itself determine whether that
10304 header appears in -MM dependency output.
10305
10306 -MF file
10307 When used with -M or -MM, specifies a file to write the
10308 dependencies to. If no -MF switch is given the preprocessor sends
10309 the rules to the same place it would send preprocessed output.
10310
10311 When used with the driver options -MD or -MMD, -MF overrides the
10312 default dependency output file.
10313
10314 If file is -, then the dependencies are written to stdout.
10315
10316 -MG In conjunction with an option such as -M requesting dependency
10317 generation, -MG assumes missing header files are generated files
10318 and adds them to the dependency list without raising an error. The
10319 dependency filename is taken directly from the "#include" directive
10320 without prepending any path. -MG also suppresses preprocessed
10321 output, as a missing header file renders this useless.
10322
10323 This feature is used in automatic updating of makefiles.
10324
10325 -MP This option instructs CPP to add a phony target for each dependency
10326 other than the main file, causing each to depend on nothing. These
10327 dummy rules work around errors make gives if you remove header
10328 files without updating the Makefile to match.
10329
10330 This is typical output:
10331
10332 test.o: test.c test.h
10333
10334 test.h:
10335
10336 -MT target
10337 Change the target of the rule emitted by dependency generation. By
10338 default CPP takes the name of the main input file, deletes any
10339 directory components and any file suffix such as .c, and appends
10340 the platform's usual object suffix. The result is the target.
10341
10342 An -MT option sets the target to be exactly the string you specify.
10343 If you want multiple targets, you can specify them as a single
10344 argument to -MT, or use multiple -MT options.
10345
10346 For example, -MT '$(objpfx)foo.o' might give
10347
10348 $(objpfx)foo.o: foo.c
10349
10350 -MQ target
10351 Same as -MT, but it quotes any characters which are special to
10352 Make. -MQ '$(objpfx)foo.o' gives
10353
10354 $$(objpfx)foo.o: foo.c
10355
10356 The default target is automatically quoted, as if it were given
10357 with -MQ.
10358
10359 -MD -MD is equivalent to -M -MF file, except that -E is not implied.
10360 The driver determines file based on whether an -o option is given.
10361 If it is, the driver uses its argument but with a suffix of .d,
10362 otherwise it takes the name of the input file, removes any
10363 directory components and suffix, and applies a .d suffix.
10364
10365 If -MD is used in conjunction with -E, any -o switch is understood
10366 to specify the dependency output file, but if used without -E, each
10367 -o is understood to specify a target object file.
10368
10369 Since -E is not implied, -MD can be used to generate a dependency
10370 output file as a side effect of the compilation process.
10371
10372 -MMD
10373 Like -MD except mention only user header files, not system header
10374 files.
10375
10376 -fpreprocessed
10377 Indicate to the preprocessor that the input file has already been
10378 preprocessed. This suppresses things like macro expansion,
10379 trigraph conversion, escaped newline splicing, and processing of
10380 most directives. The preprocessor still recognizes and removes
10381 comments, so that you can pass a file preprocessed with -C to the
10382 compiler without problems. In this mode the integrated
10383 preprocessor is little more than a tokenizer for the front ends.
10384
10385 -fpreprocessed is implicit if the input file has one of the
10386 extensions .i, .ii or .mi. These are the extensions that GCC uses
10387 for preprocessed files created by -save-temps.
10388
10389 -fdirectives-only
10390 When preprocessing, handle directives, but do not expand macros.
10391
10392 The option's behavior depends on the -E and -fpreprocessed options.
10393
10394 With -E, preprocessing is limited to the handling of directives
10395 such as "#define", "#ifdef", and "#error". Other preprocessor
10396 operations, such as macro expansion and trigraph conversion are not
10397 performed. In addition, the -dD option is implicitly enabled.
10398
10399 With -fpreprocessed, predefinition of command line and most builtin
10400 macros is disabled. Macros such as "__LINE__", which are
10401 contextually dependent, are handled normally. This enables
10402 compilation of files previously preprocessed with "-E
10403 -fdirectives-only".
10404
10405 With both -E and -fpreprocessed, the rules for -fpreprocessed take
10406 precedence. This enables full preprocessing of files previously
10407 preprocessed with "-E -fdirectives-only".
10408
10409 -fdollars-in-identifiers
10410 Accept $ in identifiers.
10411
10412 -fextended-identifiers
10413 Accept universal character names in identifiers. This option is
10414 enabled by default for C99 (and later C standard versions) and C++.
10415
10416 -fno-canonical-system-headers
10417 When preprocessing, do not shorten system header paths with
10418 canonicalization.
10419
10420 -ftabstop=width
10421 Set the distance between tab stops. This helps the preprocessor
10422 report correct column numbers in warnings or errors, even if tabs
10423 appear on the line. If the value is less than 1 or greater than
10424 100, the option is ignored. The default is 8.
10425
10426 -ftrack-macro-expansion[=level]
10427 Track locations of tokens across macro expansions. This allows the
10428 compiler to emit diagnostic about the current macro expansion stack
10429 when a compilation error occurs in a macro expansion. Using this
10430 option makes the preprocessor and the compiler consume more memory.
10431 The level parameter can be used to choose the level of precision of
10432 token location tracking thus decreasing the memory consumption if
10433 necessary. Value 0 of level de-activates this option. Value 1
10434 tracks tokens locations in a degraded mode for the sake of minimal
10435 memory overhead. In this mode all tokens resulting from the
10436 expansion of an argument of a function-like macro have the same
10437 location. Value 2 tracks tokens locations completely. This value is
10438 the most memory hungry. When this option is given no argument, the
10439 default parameter value is 2.
10440
10441 Note that "-ftrack-macro-expansion=2" is activated by default.
10442
10443 -fmacro-prefix-map=old=new
10444 When preprocessing files residing in directory old, expand the
10445 "__FILE__" and "__BASE_FILE__" macros as if the files resided in
10446 directory new instead. This can be used to change an absolute path
10447 to a relative path by using . for new which can result in more
10448 reproducible builds that are location independent. This option
10449 also affects "__builtin_FILE()" during compilation. See also
10450 -ffile-prefix-map.
10451
10452 -fexec-charset=charset
10453 Set the execution character set, used for string and character
10454 constants. The default is UTF-8. charset can be any encoding
10455 supported by the system's "iconv" library routine.
10456
10457 -fwide-exec-charset=charset
10458 Set the wide execution character set, used for wide string and
10459 character constants. The default is UTF-32 or UTF-16, whichever
10460 corresponds to the width of "wchar_t". As with -fexec-charset,
10461 charset can be any encoding supported by the system's "iconv"
10462 library routine; however, you will have problems with encodings
10463 that do not fit exactly in "wchar_t".
10464
10465 -finput-charset=charset
10466 Set the input character set, used for translation from the
10467 character set of the input file to the source character set used by
10468 GCC. If the locale does not specify, or GCC cannot get this
10469 information from the locale, the default is UTF-8. This can be
10470 overridden by either the locale or this command-line option.
10471 Currently the command-line option takes precedence if there's a
10472 conflict. charset can be any encoding supported by the system's
10473 "iconv" library routine.
10474
10475 -fpch-deps
10476 When using precompiled headers, this flag causes the dependency-
10477 output flags to also list the files from the precompiled header's
10478 dependencies. If not specified, only the precompiled header are
10479 listed and not the files that were used to create it, because those
10480 files are not consulted when a precompiled header is used.
10481
10482 -fpch-preprocess
10483 This option allows use of a precompiled header together with -E.
10484 It inserts a special "#pragma", "#pragma GCC pch_preprocess
10485 "filename"" in the output to mark the place where the precompiled
10486 header was found, and its filename. When -fpreprocessed is in use,
10487 GCC recognizes this "#pragma" and loads the PCH.
10488
10489 This option is off by default, because the resulting preprocessed
10490 output is only really suitable as input to GCC. It is switched on
10491 by -save-temps.
10492
10493 You should not write this "#pragma" in your own code, but it is
10494 safe to edit the filename if the PCH file is available in a
10495 different location. The filename may be absolute or it may be
10496 relative to GCC's current directory.
10497
10498 -fworking-directory
10499 Enable generation of linemarkers in the preprocessor output that
10500 let the compiler know the current working directory at the time of
10501 preprocessing. When this option is enabled, the preprocessor
10502 emits, after the initial linemarker, a second linemarker with the
10503 current working directory followed by two slashes. GCC uses this
10504 directory, when it's present in the preprocessed input, as the
10505 directory emitted as the current working directory in some
10506 debugging information formats. This option is implicitly enabled
10507 if debugging information is enabled, but this can be inhibited with
10508 the negated form -fno-working-directory. If the -P flag is present
10509 in the command line, this option has no effect, since no "#line"
10510 directives are emitted whatsoever.
10511
10512 -A predicate=answer
10513 Make an assertion with the predicate predicate and answer answer.
10514 This form is preferred to the older form -A predicate(answer),
10515 which is still supported, because it does not use shell special
10516 characters.
10517
10518 -A -predicate=answer
10519 Cancel an assertion with the predicate predicate and answer answer.
10520
10521 -C Do not discard comments. All comments are passed through to the
10522 output file, except for comments in processed directives, which are
10523 deleted along with the directive.
10524
10525 You should be prepared for side effects when using -C; it causes
10526 the preprocessor to treat comments as tokens in their own right.
10527 For example, comments appearing at the start of what would be a
10528 directive line have the effect of turning that line into an
10529 ordinary source line, since the first token on the line is no
10530 longer a #.
10531
10532 -CC Do not discard comments, including during macro expansion. This is
10533 like -C, except that comments contained within macros are also
10534 passed through to the output file where the macro is expanded.
10535
10536 In addition to the side effects of the -C option, the -CC option
10537 causes all C++-style comments inside a macro to be converted to
10538 C-style comments. This is to prevent later use of that macro from
10539 inadvertently commenting out the remainder of the source line.
10540
10541 The -CC option is generally used to support lint comments.
10542
10543 -P Inhibit generation of linemarkers in the output from the
10544 preprocessor. This might be useful when running the preprocessor
10545 on something that is not C code, and will be sent to a program
10546 which might be confused by the linemarkers.
10547
10548 -traditional
10549 -traditional-cpp
10550 Try to imitate the behavior of pre-standard C preprocessors, as
10551 opposed to ISO C preprocessors. See the GNU CPP manual for
10552 details.
10553
10554 Note that GCC does not otherwise attempt to emulate a pre-standard
10555 C compiler, and these options are only supported with the -E
10556 switch, or when invoking CPP explicitly.
10557
10558 -trigraphs
10559 Support ISO C trigraphs. These are three-character sequences, all
10560 starting with ??, that are defined by ISO C to stand for single
10561 characters. For example, ??/ stands for \, so '??/n' is a
10562 character constant for a newline.
10563
10564 The nine trigraphs and their replacements are
10565
10566 Trigraph: ??( ??) ??< ??> ??= ??/ ??' ??! ??-
10567 Replacement: [ ] { } # \ ^ | ~
10568
10569 By default, GCC ignores trigraphs, but in standard-conforming modes
10570 it converts them. See the -std and -ansi options.
10571
10572 -remap
10573 Enable special code to work around file systems which only permit
10574 very short file names, such as MS-DOS.
10575
10576 -H Print the name of each header file used, in addition to other
10577 normal activities. Each name is indented to show how deep in the
10578 #include stack it is. Precompiled header files are also printed,
10579 even if they are found to be invalid; an invalid precompiled header
10580 file is printed with ...x and a valid one with ...! .
10581
10582 -dletters
10583 Says to make debugging dumps during compilation as specified by
10584 letters. The flags documented here are those relevant to the
10585 preprocessor. Other letters are interpreted by the compiler
10586 proper, or reserved for future versions of GCC, and so are silently
10587 ignored. If you specify letters whose behavior conflicts, the
10588 result is undefined.
10589
10590 -dM Instead of the normal output, generate a list of #define
10591 directives for all the macros defined during the execution of
10592 the preprocessor, including predefined macros. This gives you
10593 a way of finding out what is predefined in your version of the
10594 preprocessor. Assuming you have no file foo.h, the command
10595
10596 touch foo.h; cpp -dM foo.h
10597
10598 shows all the predefined macros.
10599
10600 If you use -dM without the -E option, -dM is interpreted as a
10601 synonym for -fdump-rtl-mach.
10602
10603 -dD Like -dM except in two respects: it does not include the
10604 predefined macros, and it outputs both the #define directives
10605 and the result of preprocessing. Both kinds of output go to
10606 the standard output file.
10607
10608 -dN Like -dD, but emit only the macro names, not their expansions.
10609
10610 -dI Output #include directives in addition to the result of
10611 preprocessing.
10612
10613 -dU Like -dD except that only macros that are expanded, or whose
10614 definedness is tested in preprocessor directives, are output;
10615 the output is delayed until the use or test of the macro; and
10616 #undef directives are also output for macros tested but
10617 undefined at the time.
10618
10619 -fdebug-cpp
10620 This option is only useful for debugging GCC. When used from CPP
10621 or with -E, it dumps debugging information about location maps.
10622 Every token in the output is preceded by the dump of the map its
10623 location belongs to.
10624
10625 When used from GCC without -E, this option has no effect.
10626
10627 -Wp,option
10628 You can use -Wp,option to bypass the compiler driver and pass
10629 option directly through to the preprocessor. If option contains
10630 commas, it is split into multiple options at the commas. However,
10631 many options are modified, translated or interpreted by the
10632 compiler driver before being passed to the preprocessor, and -Wp
10633 forcibly bypasses this phase. The preprocessor's direct interface
10634 is undocumented and subject to change, so whenever possible you
10635 should avoid using -Wp and let the driver handle the options
10636 instead.
10637
10638 -Xpreprocessor option
10639 Pass option as an option to the preprocessor. You can use this to
10640 supply system-specific preprocessor options that GCC does not
10641 recognize.
10642
10643 If you want to pass an option that takes an argument, you must use
10644 -Xpreprocessor twice, once for the option and once for the
10645 argument.
10646
10647 -no-integrated-cpp
10648 Perform preprocessing as a separate pass before compilation. By
10649 default, GCC performs preprocessing as an integrated part of input
10650 tokenization and parsing. If this option is provided, the
10651 appropriate language front end (cc1, cc1plus, or cc1obj for C, C++,
10652 and Objective-C, respectively) is instead invoked twice, once for
10653 preprocessing only and once for actual compilation of the
10654 preprocessed input. This option may be useful in conjunction with
10655 the -B or -wrapper options to specify an alternate preprocessor or
10656 perform additional processing of the program source between normal
10657 preprocessing and compilation.
10658
10659 Passing Options to the Assembler
10660 You can pass options to the assembler.
10661
10662 -Wa,option
10663 Pass option as an option to the assembler. If option contains
10664 commas, it is split into multiple options at the commas.
10665
10666 -Xassembler option
10667 Pass option as an option to the assembler. You can use this to
10668 supply system-specific assembler options that GCC does not
10669 recognize.
10670
10671 If you want to pass an option that takes an argument, you must use
10672 -Xassembler twice, once for the option and once for the argument.
10673
10674 Options for Linking
10675 These options come into play when the compiler links object files into
10676 an executable output file. They are meaningless if the compiler is not
10677 doing a link step.
10678
10679 object-file-name
10680 A file name that does not end in a special recognized suffix is
10681 considered to name an object file or library. (Object files are
10682 distinguished from libraries by the linker according to the file
10683 contents.) If linking is done, these object files are used as
10684 input to the linker.
10685
10686 -c
10687 -S
10688 -E If any of these options is used, then the linker is not run, and
10689 object file names should not be used as arguments.
10690
10691 -fuse-ld=bfd
10692 Use the bfd linker instead of the default linker.
10693
10694 -fuse-ld=gold
10695 Use the gold linker instead of the default linker.
10696
10697 -llibrary
10698 -l library
10699 Search the library named library when linking. (The second
10700 alternative with the library as a separate argument is only for
10701 POSIX compliance and is not recommended.)
10702
10703 It makes a difference where in the command you write this option;
10704 the linker searches and processes libraries and object files in the
10705 order they are specified. Thus, foo.o -lz bar.o searches library z
10706 after file foo.o but before bar.o. If bar.o refers to functions in
10707 z, those functions may not be loaded.
10708
10709 The linker searches a standard list of directories for the library,
10710 which is actually a file named liblibrary.a. The linker then uses
10711 this file as if it had been specified precisely by name.
10712
10713 The directories searched include several standard system
10714 directories plus any that you specify with -L.
10715
10716 Normally the files found this way are library files---archive files
10717 whose members are object files. The linker handles an archive file
10718 by scanning through it for members which define symbols that have
10719 so far been referenced but not defined. But if the file that is
10720 found is an ordinary object file, it is linked in the usual
10721 fashion. The only difference between using an -l option and
10722 specifying a file name is that -l surrounds library with lib and .a
10723 and searches several directories.
10724
10725 -lobjc
10726 You need this special case of the -l option in order to link an
10727 Objective-C or Objective-C++ program.
10728
10729 -nostartfiles
10730 Do not use the standard system startup files when linking. The
10731 standard system libraries are used normally, unless -nostdlib or
10732 -nodefaultlibs is used.
10733
10734 -nodefaultlibs
10735 Do not use the standard system libraries when linking. Only the
10736 libraries you specify are passed to the linker, and options
10737 specifying linkage of the system libraries, such as -static-libgcc
10738 or -shared-libgcc, are ignored. The standard startup files are
10739 used normally, unless -nostartfiles is used.
10740
10741 The compiler may generate calls to "memcmp", "memset", "memcpy" and
10742 "memmove". These entries are usually resolved by entries in libc.
10743 These entry points should be supplied through some other mechanism
10744 when this option is specified.
10745
10746 -nostdlib
10747 Do not use the standard system startup files or libraries when
10748 linking. No startup files and only the libraries you specify are
10749 passed to the linker, and options specifying linkage of the system
10750 libraries, such as -static-libgcc or -shared-libgcc, are ignored.
10751
10752 The compiler may generate calls to "memcmp", "memset", "memcpy" and
10753 "memmove". These entries are usually resolved by entries in libc.
10754 These entry points should be supplied through some other mechanism
10755 when this option is specified.
10756
10757 One of the standard libraries bypassed by -nostdlib and
10758 -nodefaultlibs is libgcc.a, a library of internal subroutines which
10759 GCC uses to overcome shortcomings of particular machines, or
10760 special needs for some languages.
10761
10762 In most cases, you need libgcc.a even when you want to avoid other
10763 standard libraries. In other words, when you specify -nostdlib or
10764 -nodefaultlibs you should usually specify -lgcc as well. This
10765 ensures that you have no unresolved references to internal GCC
10766 library subroutines. (An example of such an internal subroutine is
10767 "__main", used to ensure C++ constructors are called.)
10768
10769 -pie
10770 Produce a dynamically linked position independent executable on
10771 targets that support it. For predictable results, you must also
10772 specify the same set of options used for compilation (-fpie, -fPIE,
10773 or model suboptions) when you specify this linker option.
10774
10775 -no-pie
10776 Don't produce a dynamically linked position independent executable.
10777
10778 -static-pie
10779 Produce a static position independent executable on targets that
10780 support it. A static position independent executable is similar to
10781 a static executable, but can be loaded at any address without a
10782 dynamic linker. For predictable results, you must also specify the
10783 same set of options used for compilation (-fpie, -fPIE, or model
10784 suboptions) when you specify this linker option.
10785
10786 -pthread
10787 Link with the POSIX threads library. This option is supported on
10788 GNU/Linux targets, most other Unix derivatives, and also on x86
10789 Cygwin and MinGW targets. On some targets this option also sets
10790 flags for the preprocessor, so it should be used consistently for
10791 both compilation and linking.
10792
10793 -rdynamic
10794 Pass the flag -export-dynamic to the ELF linker, on targets that
10795 support it. This instructs the linker to add all symbols, not only
10796 used ones, to the dynamic symbol table. This option is needed for
10797 some uses of "dlopen" or to allow obtaining backtraces from within
10798 a program.
10799
10800 -s Remove all symbol table and relocation information from the
10801 executable.
10802
10803 -static
10804 On systems that support dynamic linking, this overrides -pie and
10805 prevents linking with the shared libraries. On other systems, this
10806 option has no effect.
10807
10808 -shared
10809 Produce a shared object which can then be linked with other objects
10810 to form an executable. Not all systems support this option. For
10811 predictable results, you must also specify the same set of options
10812 used for compilation (-fpic, -fPIC, or model suboptions) when you
10813 specify this linker option.[1]
10814
10815 -shared-libgcc
10816 -static-libgcc
10817 On systems that provide libgcc as a shared library, these options
10818 force the use of either the shared or static version, respectively.
10819 If no shared version of libgcc was built when the compiler was
10820 configured, these options have no effect.
10821
10822 There are several situations in which an application should use the
10823 shared libgcc instead of the static version. The most common of
10824 these is when the application wishes to throw and catch exceptions
10825 across different shared libraries. In that case, each of the
10826 libraries as well as the application itself should use the shared
10827 libgcc.
10828
10829 Therefore, the G++ and driver automatically adds -shared-libgcc
10830 whenever you build a shared library or a main executable, because
10831 C++
10832 programs typically use exceptions, so this is the right thing to
10833 do.
10834
10835 If, instead, you use the GCC driver to create shared libraries, you
10836 may find that they are not always linked with the shared libgcc.
10837 If GCC finds, at its configuration time, that you have a non-GNU
10838 linker or a GNU linker that does not support option --eh-frame-hdr,
10839 it links the shared version of libgcc into shared libraries by
10840 default. Otherwise, it takes advantage of the linker and optimizes
10841 away the linking with the shared version of libgcc, linking with
10842 the static version of libgcc by default. This allows exceptions to
10843 propagate through such shared libraries, without incurring
10844 relocation costs at library load time.
10845
10846 However, if a library or main executable is supposed to throw or
10847 catch exceptions, you must link it using the G++ driver, as
10848 appropriate for the languages used in the program, or using the
10849 option -shared-libgcc, such that it is linked with the shared
10850 libgcc.
10851
10852 -static-libasan
10853 When the -fsanitize=address option is used to link a program, the
10854 GCC driver automatically links against libasan. If libasan is
10855 available as a shared library, and the -static option is not used,
10856 then this links against the shared version of libasan. The
10857 -static-libasan option directs the GCC driver to link libasan
10858 statically, without necessarily linking other libraries statically.
10859
10860 -static-libtsan
10861 When the -fsanitize=thread option is used to link a program, the
10862 GCC driver automatically links against libtsan. If libtsan is
10863 available as a shared library, and the -static option is not used,
10864 then this links against the shared version of libtsan. The
10865 -static-libtsan option directs the GCC driver to link libtsan
10866 statically, without necessarily linking other libraries statically.
10867
10868 -static-liblsan
10869 When the -fsanitize=leak option is used to link a program, the GCC
10870 driver automatically links against liblsan. If liblsan is
10871 available as a shared library, and the -static option is not used,
10872 then this links against the shared version of liblsan. The
10873 -static-liblsan option directs the GCC driver to link liblsan
10874 statically, without necessarily linking other libraries statically.
10875
10876 -static-libubsan
10877 When the -fsanitize=undefined option is used to link a program, the
10878 GCC driver automatically links against libubsan. If libubsan is
10879 available as a shared library, and the -static option is not used,
10880 then this links against the shared version of libubsan. The
10881 -static-libubsan option directs the GCC driver to link libubsan
10882 statically, without necessarily linking other libraries statically.
10883
10884 -static-libmpx
10885 When the -fcheck-pointer bounds and -mmpx options are used to link
10886 a program, the GCC driver automatically links against libmpx. If
10887 libmpx is available as a shared library, and the -static option is
10888 not used, then this links against the shared version of libmpx.
10889 The -static-libmpx option directs the GCC driver to link libmpx
10890 statically, without necessarily linking other libraries statically.
10891
10892 -static-libmpxwrappers
10893 When the -fcheck-pointer bounds and -mmpx options are used to link
10894 a program without also using -fno-chkp-use-wrappers, the GCC driver
10895 automatically links against libmpxwrappers. If libmpxwrappers is
10896 available as a shared library, and the -static option is not used,
10897 then this links against the shared version of libmpxwrappers. The
10898 -static-libmpxwrappers option directs the GCC driver to link
10899 libmpxwrappers statically, without necessarily linking other
10900 libraries statically.
10901
10902 -static-libstdc++
10903 When the g++ program is used to link a C++ program, it normally
10904 automatically links against libstdc++. If libstdc++ is available
10905 as a shared library, and the -static option is not used, then this
10906 links against the shared version of libstdc++. That is normally
10907 fine. However, it is sometimes useful to freeze the version of
10908 libstdc++ used by the program without going all the way to a fully
10909 static link. The -static-libstdc++ option directs the g++ driver
10910 to link libstdc++ statically, without necessarily linking other
10911 libraries statically.
10912
10913 -symbolic
10914 Bind references to global symbols when building a shared object.
10915 Warn about any unresolved references (unless overridden by the link
10916 editor option -Xlinker -z -Xlinker defs). Only a few systems
10917 support this option.
10918
10919 -T script
10920 Use script as the linker script. This option is supported by most
10921 systems using the GNU linker. On some targets, such as bare-board
10922 targets without an operating system, the -T option may be required
10923 when linking to avoid references to undefined symbols.
10924
10925 -Xlinker option
10926 Pass option as an option to the linker. You can use this to supply
10927 system-specific linker options that GCC does not recognize.
10928
10929 If you want to pass an option that takes a separate argument, you
10930 must use -Xlinker twice, once for the option and once for the
10931 argument. For example, to pass -assert definitions, you must write
10932 -Xlinker -assert -Xlinker definitions. It does not work to write
10933 -Xlinker "-assert definitions", because this passes the entire
10934 string as a single argument, which is not what the linker expects.
10935
10936 When using the GNU linker, it is usually more convenient to pass
10937 arguments to linker options using the option=value syntax than as
10938 separate arguments. For example, you can specify -Xlinker
10939 -Map=output.map rather than -Xlinker -Map -Xlinker output.map.
10940 Other linkers may not support this syntax for command-line options.
10941
10942 -Wl,option
10943 Pass option as an option to the linker. If option contains commas,
10944 it is split into multiple options at the commas. You can use this
10945 syntax to pass an argument to the option. For example,
10946 -Wl,-Map,output.map passes -Map output.map to the linker. When
10947 using the GNU linker, you can also get the same effect with
10948 -Wl,-Map=output.map.
10949
10950 -u symbol
10951 Pretend the symbol symbol is undefined, to force linking of library
10952 modules to define it. You can use -u multiple times with different
10953 symbols to force loading of additional library modules.
10954
10955 -z keyword
10956 -z is passed directly on to the linker along with the keyword
10957 keyword. See the section in the documentation of your linker for
10958 permitted values and their meanings.
10959
10960 Options for Directory Search
10961 These options specify directories to search for header files, for
10962 libraries and for parts of the compiler:
10963
10964 -I dir
10965 -iquote dir
10966 -isystem dir
10967 -idirafter dir
10968 Add the directory dir to the list of directories to be searched for
10969 header files during preprocessing. If dir begins with = or
10970 $SYSROOT, then the = or $SYSROOT is replaced by the sysroot prefix;
10971 see --sysroot and -isysroot.
10972
10973 Directories specified with -iquote apply only to the quote form of
10974 the directive, "#include "file"". Directories specified with -I,
10975 -isystem, or -idirafter apply to lookup for both the
10976 "#include "file"" and "#include <file>" directives.
10977
10978 You can specify any number or combination of these options on the
10979 command line to search for header files in several directories.
10980 The lookup order is as follows:
10981
10982 1. For the quote form of the include directive, the directory of
10983 the current file is searched first.
10984
10985 2. For the quote form of the include directive, the directories
10986 specified by -iquote options are searched in left-to-right
10987 order, as they appear on the command line.
10988
10989 3. Directories specified with -I options are scanned in left-to-
10990 right order.
10991
10992 4. Directories specified with -isystem options are scanned in
10993 left-to-right order.
10994
10995 5. Standard system directories are scanned.
10996
10997 6. Directories specified with -idirafter options are scanned in
10998 left-to-right order.
10999
11000 You can use -I to override a system header file, substituting your
11001 own version, since these directories are searched before the
11002 standard system header file directories. However, you should not
11003 use this option to add directories that contain vendor-supplied
11004 system header files; use -isystem for that.
11005
11006 The -isystem and -idirafter options also mark the directory as a
11007 system directory, so that it gets the same special treatment that
11008 is applied to the standard system directories.
11009
11010 If a standard system include directory, or a directory specified
11011 with -isystem, is also specified with -I, the -I option is ignored.
11012 The directory is still searched but as a system directory at its
11013 normal position in the system include chain. This is to ensure
11014 that GCC's procedure to fix buggy system headers and the ordering
11015 for the "#include_next" directive are not inadvertently changed.
11016 If you really need to change the search order for system
11017 directories, use the -nostdinc and/or -isystem options.
11018
11019 -I- Split the include path. This option has been deprecated. Please
11020 use -iquote instead for -I directories before the -I- and remove
11021 the -I- option.
11022
11023 Any directories specified with -I options before -I- are searched
11024 only for headers requested with "#include "file""; they are not
11025 searched for "#include <file>". If additional directories are
11026 specified with -I options after the -I-, those directories are
11027 searched for all #include directives.
11028
11029 In addition, -I- inhibits the use of the directory of the current
11030 file directory as the first search directory for "#include "file"".
11031 There is no way to override this effect of -I-.
11032
11033 -iprefix prefix
11034 Specify prefix as the prefix for subsequent -iwithprefix options.
11035 If the prefix represents a directory, you should include the final
11036 /.
11037
11038 -iwithprefix dir
11039 -iwithprefixbefore dir
11040 Append dir to the prefix specified previously with -iprefix, and
11041 add the resulting directory to the include search path.
11042 -iwithprefixbefore puts it in the same place -I would; -iwithprefix
11043 puts it where -idirafter would.
11044
11045 -isysroot dir
11046 This option is like the --sysroot option, but applies only to
11047 header files (except for Darwin targets, where it applies to both
11048 header files and libraries). See the --sysroot option for more
11049 information.
11050
11051 -imultilib dir
11052 Use dir as a subdirectory of the directory containing target-
11053 specific C++ headers.
11054
11055 -nostdinc
11056 Do not search the standard system directories for header files.
11057 Only the directories explicitly specified with -I, -iquote,
11058 -isystem, and/or -idirafter options (and the directory of the
11059 current file, if appropriate) are searched.
11060
11061 -nostdinc++
11062 Do not search for header files in the C++-specific standard
11063 directories, but do still search the other standard directories.
11064 (This option is used when building the C++ library.)
11065
11066 -iplugindir=dir
11067 Set the directory to search for plugins that are passed by
11068 -fplugin=name instead of -fplugin=path/name.so. This option is not
11069 meant to be used by the user, but only passed by the driver.
11070
11071 -Ldir
11072 Add directory dir to the list of directories to be searched for -l.
11073
11074 -Bprefix
11075 This option specifies where to find the executables, libraries,
11076 include files, and data files of the compiler itself.
11077
11078 The compiler driver program runs one or more of the subprograms
11079 cpp, cc1, as and ld. It tries prefix as a prefix for each program
11080 it tries to run, both with and without machine/version/ for the
11081 corresponding target machine and compiler version.
11082
11083 For each subprogram to be run, the compiler driver first tries the
11084 -B prefix, if any. If that name is not found, or if -B is not
11085 specified, the driver tries two standard prefixes, /usr/lib/gcc/
11086 and /usr/local/lib/gcc/. If neither of those results in a file
11087 name that is found, the unmodified program name is searched for
11088 using the directories specified in your PATH environment variable.
11089
11090 The compiler checks to see if the path provided by -B refers to a
11091 directory, and if necessary it adds a directory separator character
11092 at the end of the path.
11093
11094 -B prefixes that effectively specify directory names also apply to
11095 libraries in the linker, because the compiler translates these
11096 options into -L options for the linker. They also apply to include
11097 files in the preprocessor, because the compiler translates these
11098 options into -isystem options for the preprocessor. In this case,
11099 the compiler appends include to the prefix.
11100
11101 The runtime support file libgcc.a can also be searched for using
11102 the -B prefix, if needed. If it is not found there, the two
11103 standard prefixes above are tried, and that is all. The file is
11104 left out of the link if it is not found by those means.
11105
11106 Another way to specify a prefix much like the -B prefix is to use
11107 the environment variable GCC_EXEC_PREFIX.
11108
11109 As a special kludge, if the path provided by -B is [dir/]stageN/,
11110 where N is a number in the range 0 to 9, then it is replaced by
11111 [dir/]include. This is to help with boot-strapping the compiler.
11112
11113 -no-canonical-prefixes
11114 Do not expand any symbolic links, resolve references to /../ or
11115 /./, or make the path absolute when generating a relative prefix.
11116
11117 --sysroot=dir
11118 Use dir as the logical root directory for headers and libraries.
11119 For example, if the compiler normally searches for headers in
11120 /usr/include and libraries in /usr/lib, it instead searches
11121 dir/usr/include and dir/usr/lib.
11122
11123 If you use both this option and the -isysroot option, then the
11124 --sysroot option applies to libraries, but the -isysroot option
11125 applies to header files.
11126
11127 The GNU linker (beginning with version 2.16) has the necessary
11128 support for this option. If your linker does not support this
11129 option, the header file aspect of --sysroot still works, but the
11130 library aspect does not.
11131
11132 --no-sysroot-suffix
11133 For some targets, a suffix is added to the root directory specified
11134 with --sysroot, depending on the other options used, so that
11135 headers may for example be found in dir/suffix/usr/include instead
11136 of dir/usr/include. This option disables the addition of such a
11137 suffix.
11138
11139 Options for Code Generation Conventions
11140 These machine-independent options control the interface conventions
11141 used in code generation.
11142
11143 Most of them have both positive and negative forms; the negative form
11144 of -ffoo is -fno-foo. In the table below, only one of the forms is
11145 listed---the one that is not the default. You can figure out the other
11146 form by either removing no- or adding it.
11147
11148 -fstack-reuse=reuse-level
11149 This option controls stack space reuse for user declared local/auto
11150 variables and compiler generated temporaries. reuse_level can be
11151 all, named_vars, or none. all enables stack reuse for all local
11152 variables and temporaries, named_vars enables the reuse only for
11153 user defined local variables with names, and none disables stack
11154 reuse completely. The default value is all. The option is needed
11155 when the program extends the lifetime of a scoped local variable or
11156 a compiler generated temporary beyond the end point defined by the
11157 language. When a lifetime of a variable ends, and if the variable
11158 lives in memory, the optimizing compiler has the freedom to reuse
11159 its stack space with other temporaries or scoped local variables
11160 whose live range does not overlap with it. Legacy code extending
11161 local lifetime is likely to break with the stack reuse
11162 optimization.
11163
11164 For example,
11165
11166 int *p;
11167 {
11168 int local1;
11169
11170 p = &local1;
11171 local1 = 10;
11172 ....
11173 }
11174 {
11175 int local2;
11176 local2 = 20;
11177 ...
11178 }
11179
11180 if (*p == 10) // out of scope use of local1
11181 {
11182
11183 }
11184
11185 Another example:
11186
11187 struct A
11188 {
11189 A(int k) : i(k), j(k) { }
11190 int i;
11191 int j;
11192 };
11193
11194 A *ap;
11195
11196 void foo(const A& ar)
11197 {
11198 ap = &ar;
11199 }
11200
11201 void bar()
11202 {
11203 foo(A(10)); // temp object's lifetime ends when foo returns
11204
11205 {
11206 A a(20);
11207 ....
11208 }
11209 ap->i+= 10; // ap references out of scope temp whose space
11210 // is reused with a. What is the value of ap->i?
11211 }
11212
11213 The lifetime of a compiler generated temporary is well defined by
11214 the C++ standard. When a lifetime of a temporary ends, and if the
11215 temporary lives in memory, the optimizing compiler has the freedom
11216 to reuse its stack space with other temporaries or scoped local
11217 variables whose live range does not overlap with it. However some
11218 of the legacy code relies on the behavior of older compilers in
11219 which temporaries' stack space is not reused, the aggressive stack
11220 reuse can lead to runtime errors. This option is used to control
11221 the temporary stack reuse optimization.
11222
11223 -ftrapv
11224 This option generates traps for signed overflow on addition,
11225 subtraction, multiplication operations. The options -ftrapv and
11226 -fwrapv override each other, so using -ftrapv -fwrapv on the
11227 command-line results in -fwrapv being effective. Note that only
11228 active options override, so using -ftrapv -fwrapv -fno-wrapv on the
11229 command-line results in -ftrapv being effective.
11230
11231 -fwrapv
11232 This option instructs the compiler to assume that signed arithmetic
11233 overflow of addition, subtraction and multiplication wraps around
11234 using twos-complement representation. This flag enables some
11235 optimizations and disables others. The options -ftrapv and -fwrapv
11236 override each other, so using -ftrapv -fwrapv on the command-line
11237 results in -fwrapv being effective. Note that only active options
11238 override, so using -ftrapv -fwrapv -fno-wrapv on the command-line
11239 results in -ftrapv being effective.
11240
11241 -fwrapv-pointer
11242 This option instructs the compiler to assume that pointer
11243 arithmetic overflow on addition and subtraction wraps around using
11244 twos-complement representation. This flag disables some
11245 optimizations which assume pointer overflow is invalid.
11246
11247 -fstrict-overflow
11248 This option implies -fno-wrapv -fno-wrapv-pointer and when negated
11249 implies -fwrapv -fwrapv-pointer.
11250
11251 -fexceptions
11252 Enable exception handling. Generates extra code needed to
11253 propagate exceptions. For some targets, this implies GCC generates
11254 frame unwind information for all functions, which can produce
11255 significant data size overhead, although it does not affect
11256 execution. If you do not specify this option, GCC enables it by
11257 default for languages like C++ that normally require exception
11258 handling, and disables it for languages like C that do not normally
11259 require it. However, you may need to enable this option when
11260 compiling C code that needs to interoperate properly with exception
11261 handlers written in C++. You may also wish to disable this option
11262 if you are compiling older C++ programs that don't use exception
11263 handling.
11264
11265 -fnon-call-exceptions
11266 Generate code that allows trapping instructions to throw
11267 exceptions. Note that this requires platform-specific runtime
11268 support that does not exist everywhere. Moreover, it only allows
11269 trapping instructions to throw exceptions, i.e. memory references
11270 or floating-point instructions. It does not allow exceptions to be
11271 thrown from arbitrary signal handlers such as "SIGALRM".
11272
11273 -fdelete-dead-exceptions
11274 Consider that instructions that may throw exceptions but don't
11275 otherwise contribute to the execution of the program can be
11276 optimized away. This option is enabled by default for the Ada
11277 front end, as permitted by the Ada language specification.
11278 Optimization passes that cause dead exceptions to be removed are
11279 enabled independently at different optimization levels.
11280
11281 -funwind-tables
11282 Similar to -fexceptions, except that it just generates any needed
11283 static data, but does not affect the generated code in any other
11284 way. You normally do not need to enable this option; instead, a
11285 language processor that needs this handling enables it on your
11286 behalf.
11287
11288 -fasynchronous-unwind-tables
11289 Generate unwind table in DWARF format, if supported by target
11290 machine. The table is exact at each instruction boundary, so it
11291 can be used for stack unwinding from asynchronous events (such as
11292 debugger or garbage collector).
11293
11294 -fno-gnu-unique
11295 On systems with recent GNU assembler and C library, the C++
11296 compiler uses the "STB_GNU_UNIQUE" binding to make sure that
11297 definitions of template static data members and static local
11298 variables in inline functions are unique even in the presence of
11299 "RTLD_LOCAL"; this is necessary to avoid problems with a library
11300 used by two different "RTLD_LOCAL" plugins depending on a
11301 definition in one of them and therefore disagreeing with the other
11302 one about the binding of the symbol. But this causes "dlclose" to
11303 be ignored for affected DSOs; if your program relies on
11304 reinitialization of a DSO via "dlclose" and "dlopen", you can use
11305 -fno-gnu-unique.
11306
11307 -fpcc-struct-return
11308 Return "short" "struct" and "union" values in memory like longer
11309 ones, rather than in registers. This convention is less efficient,
11310 but it has the advantage of allowing intercallability between GCC-
11311 compiled files and files compiled with other compilers,
11312 particularly the Portable C Compiler (pcc).
11313
11314 The precise convention for returning structures in memory depends
11315 on the target configuration macros.
11316
11317 Short structures and unions are those whose size and alignment
11318 match that of some integer type.
11319
11320 Warning: code compiled with the -fpcc-struct-return switch is not
11321 binary compatible with code compiled with the -freg-struct-return
11322 switch. Use it to conform to a non-default application binary
11323 interface.
11324
11325 -freg-struct-return
11326 Return "struct" and "union" values in registers when possible.
11327 This is more efficient for small structures than
11328 -fpcc-struct-return.
11329
11330 If you specify neither -fpcc-struct-return nor -freg-struct-return,
11331 GCC defaults to whichever convention is standard for the target.
11332 If there is no standard convention, GCC defaults to
11333 -fpcc-struct-return, except on targets where GCC is the principal
11334 compiler. In those cases, we can choose the standard, and we chose
11335 the more efficient register return alternative.
11336
11337 Warning: code compiled with the -freg-struct-return switch is not
11338 binary compatible with code compiled with the -fpcc-struct-return
11339 switch. Use it to conform to a non-default application binary
11340 interface.
11341
11342 -fshort-enums
11343 Allocate to an "enum" type only as many bytes as it needs for the
11344 declared range of possible values. Specifically, the "enum" type
11345 is equivalent to the smallest integer type that has enough room.
11346
11347 Warning: the -fshort-enums switch causes GCC to generate code that
11348 is not binary compatible with code generated without that switch.
11349 Use it to conform to a non-default application binary interface.
11350
11351 -fshort-wchar
11352 Override the underlying type for "wchar_t" to be "short unsigned
11353 int" instead of the default for the target. This option is useful
11354 for building programs to run under WINE.
11355
11356 Warning: the -fshort-wchar switch causes GCC to generate code that
11357 is not binary compatible with code generated without that switch.
11358 Use it to conform to a non-default application binary interface.
11359
11360 -fno-common
11361 In C code, this option controls the placement of global variables
11362 defined without an initializer, known as tentative definitions in
11363 the C standard. Tentative definitions are distinct from
11364 declarations of a variable with the "extern" keyword, which do not
11365 allocate storage.
11366
11367 Unix C compilers have traditionally allocated storage for
11368 uninitialized global variables in a common block. This allows the
11369 linker to resolve all tentative definitions of the same variable in
11370 different compilation units to the same object, or to a non-
11371 tentative definition. This is the behavior specified by -fcommon,
11372 and is the default for GCC on most targets. On the other hand,
11373 this behavior is not required by ISO C, and on some targets may
11374 carry a speed or code size penalty on variable references.
11375
11376 The -fno-common option specifies that the compiler should instead
11377 place uninitialized global variables in the data section of the
11378 object file. This inhibits the merging of tentative definitions by
11379 the linker so you get a multiple-definition error if the same
11380 variable is defined in more than one compilation unit. Compiling
11381 with -fno-common is useful on targets for which it provides better
11382 performance, or if you wish to verify that the program will work on
11383 other systems that always treat uninitialized variable definitions
11384 this way.
11385
11386 -fno-ident
11387 Ignore the "#ident" directive.
11388
11389 -finhibit-size-directive
11390 Don't output a ".size" assembler directive, or anything else that
11391 would cause trouble if the function is split in the middle, and the
11392 two halves are placed at locations far apart in memory. This
11393 option is used when compiling crtstuff.c; you should not need to
11394 use it for anything else.
11395
11396 -fverbose-asm
11397 Put extra commentary information in the generated assembly code to
11398 make it more readable. This option is generally only of use to
11399 those who actually need to read the generated assembly code
11400 (perhaps while debugging the compiler itself).
11401
11402 -fno-verbose-asm, the default, causes the extra information to be
11403 omitted and is useful when comparing two assembler files.
11404
11405 The added comments include:
11406
11407 * information on the compiler version and command-line options,
11408
11409 * the source code lines associated with the assembly
11410 instructions, in the form FILENAME:LINENUMBER:CONTENT OF LINE,
11411
11412 * hints on which high-level expressions correspond to the various
11413 assembly instruction operands.
11414
11415 For example, given this C source file:
11416
11417 int test (int n)
11418 {
11419 int i;
11420 int total = 0;
11421
11422 for (i = 0; i < n; i++)
11423 total += i * i;
11424
11425 return total;
11426 }
11427
11428 compiling to (x86_64) assembly via -S and emitting the result
11429 direct to stdout via -o -
11430
11431 gcc -S test.c -fverbose-asm -Os -o -
11432
11433 gives output similar to this:
11434
11435 .file "test.c"
11436 # GNU C11 (GCC) version 7.0.0 20160809 (experimental) (x86_64-pc-linux-gnu)
11437 [...snip...]
11438 # options passed:
11439 [...snip...]
11440
11441 .text
11442 .globl test
11443 .type test, @function
11444 test:
11445 .LFB0:
11446 .cfi_startproc
11447 # test.c:4: int total = 0;
11448 xorl %eax, %eax # <retval>
11449 # test.c:6: for (i = 0; i < n; i++)
11450 xorl %edx, %edx # i
11451 .L2:
11452 # test.c:6: for (i = 0; i < n; i++)
11453 cmpl %edi, %edx # n, i
11454 jge .L5 #,
11455 # test.c:7: total += i * i;
11456 movl %edx, %ecx # i, tmp92
11457 imull %edx, %ecx # i, tmp92
11458 # test.c:6: for (i = 0; i < n; i++)
11459 incl %edx # i
11460 # test.c:7: total += i * i;
11461 addl %ecx, %eax # tmp92, <retval>
11462 jmp .L2 #
11463 .L5:
11464 # test.c:10: }
11465 ret
11466 .cfi_endproc
11467 .LFE0:
11468 .size test, .-test
11469 .ident "GCC: (GNU) 7.0.0 20160809 (experimental)"
11470 .section .note.GNU-stack,"",@progbits
11471
11472 The comments are intended for humans rather than machines and hence
11473 the precise format of the comments is subject to change.
11474
11475 -frecord-gcc-switches
11476 This switch causes the command line used to invoke the compiler to
11477 be recorded into the object file that is being created. This
11478 switch is only implemented on some targets and the exact format of
11479 the recording is target and binary file format dependent, but it
11480 usually takes the form of a section containing ASCII text. This
11481 switch is related to the -fverbose-asm switch, but that switch only
11482 records information in the assembler output file as comments, so it
11483 never reaches the object file. See also -grecord-gcc-switches for
11484 another way of storing compiler options into the object file.
11485
11486 -fpic
11487 Generate position-independent code (PIC) suitable for use in a
11488 shared library, if supported for the target machine. Such code
11489 accesses all constant addresses through a global offset table
11490 (GOT). The dynamic loader resolves the GOT entries when the
11491 program starts (the dynamic loader is not part of GCC; it is part
11492 of the operating system). If the GOT size for the linked
11493 executable exceeds a machine-specific maximum size, you get an
11494 error message from the linker indicating that -fpic does not work;
11495 in that case, recompile with -fPIC instead. (These maximums are 8k
11496 on the SPARC, 28k on AArch64 and 32k on the m68k and RS/6000. The
11497 x86 has no such limit.)
11498
11499 Position-independent code requires special support, and therefore
11500 works only on certain machines. For the x86, GCC supports PIC for
11501 System V but not for the Sun 386i. Code generated for the IBM
11502 RS/6000 is always position-independent.
11503
11504 When this flag is set, the macros "__pic__" and "__PIC__" are
11505 defined to 1.
11506
11507 -fPIC
11508 If supported for the target machine, emit position-independent
11509 code, suitable for dynamic linking and avoiding any limit on the
11510 size of the global offset table. This option makes a difference on
11511 AArch64, m68k, PowerPC and SPARC.
11512
11513 Position-independent code requires special support, and therefore
11514 works only on certain machines.
11515
11516 When this flag is set, the macros "__pic__" and "__PIC__" are
11517 defined to 2.
11518
11519 -fpie
11520 -fPIE
11521 These options are similar to -fpic and -fPIC, but generated
11522 position independent code can be only linked into executables.
11523 Usually these options are used when -pie GCC option is used during
11524 linking.
11525
11526 -fpie and -fPIE both define the macros "__pie__" and "__PIE__".
11527 The macros have the value 1 for -fpie and 2 for -fPIE.
11528
11529 -fno-plt
11530 Do not use the PLT for external function calls in position-
11531 independent code. Instead, load the callee address at call sites
11532 from the GOT and branch to it. This leads to more efficient code
11533 by eliminating PLT stubs and exposing GOT loads to optimizations.
11534 On architectures such as 32-bit x86 where PLT stubs expect the GOT
11535 pointer in a specific register, this gives more register allocation
11536 freedom to the compiler. Lazy binding requires use of the PLT;
11537 with -fno-plt all external symbols are resolved at load time.
11538
11539 Alternatively, the function attribute "noplt" can be used to avoid
11540 calls through the PLT for specific external functions.
11541
11542 In position-dependent code, a few targets also convert calls to
11543 functions that are marked to not use the PLT to use the GOT
11544 instead.
11545
11546 -fno-jump-tables
11547 Do not use jump tables for switch statements even where it would be
11548 more efficient than other code generation strategies. This option
11549 is of use in conjunction with -fpic or -fPIC for building code that
11550 forms part of a dynamic linker and cannot reference the address of
11551 a jump table. On some targets, jump tables do not require a GOT
11552 and this option is not needed.
11553
11554 -ffixed-reg
11555 Treat the register named reg as a fixed register; generated code
11556 should never refer to it (except perhaps as a stack pointer, frame
11557 pointer or in some other fixed role).
11558
11559 reg must be the name of a register. The register names accepted
11560 are machine-specific and are defined in the "REGISTER_NAMES" macro
11561 in the machine description macro file.
11562
11563 This flag does not have a negative form, because it specifies a
11564 three-way choice.
11565
11566 -fcall-used-reg
11567 Treat the register named reg as an allocable register that is
11568 clobbered by function calls. It may be allocated for temporaries
11569 or variables that do not live across a call. Functions compiled
11570 this way do not save and restore the register reg.
11571
11572 It is an error to use this flag with the frame pointer or stack
11573 pointer. Use of this flag for other registers that have fixed
11574 pervasive roles in the machine's execution model produces
11575 disastrous results.
11576
11577 This flag does not have a negative form, because it specifies a
11578 three-way choice.
11579
11580 -fcall-saved-reg
11581 Treat the register named reg as an allocable register saved by
11582 functions. It may be allocated even for temporaries or variables
11583 that live across a call. Functions compiled this way save and
11584 restore the register reg if they use it.
11585
11586 It is an error to use this flag with the frame pointer or stack
11587 pointer. Use of this flag for other registers that have fixed
11588 pervasive roles in the machine's execution model produces
11589 disastrous results.
11590
11591 A different sort of disaster results from the use of this flag for
11592 a register in which function values may be returned.
11593
11594 This flag does not have a negative form, because it specifies a
11595 three-way choice.
11596
11597 -fpack-struct[=n]
11598 Without a value specified, pack all structure members together
11599 without holes. When a value is specified (which must be a small
11600 power of two), pack structure members according to this value,
11601 representing the maximum alignment (that is, objects with default
11602 alignment requirements larger than this are output potentially
11603 unaligned at the next fitting location.
11604
11605 Warning: the -fpack-struct switch causes GCC to generate code that
11606 is not binary compatible with code generated without that switch.
11607 Additionally, it makes the code suboptimal. Use it to conform to a
11608 non-default application binary interface.
11609
11610 -fleading-underscore
11611 This option and its counterpart, -fno-leading-underscore, forcibly
11612 change the way C symbols are represented in the object file. One
11613 use is to help link with legacy assembly code.
11614
11615 Warning: the -fleading-underscore switch causes GCC to generate
11616 code that is not binary compatible with code generated without that
11617 switch. Use it to conform to a non-default application binary
11618 interface. Not all targets provide complete support for this
11619 switch.
11620
11621 -ftls-model=model
11622 Alter the thread-local storage model to be used. The model
11623 argument should be one of global-dynamic, local-dynamic, initial-
11624 exec or local-exec. Note that the choice is subject to
11625 optimization: the compiler may use a more efficient model for
11626 symbols not visible outside of the translation unit, or if -fpic is
11627 not given on the command line.
11628
11629 The default without -fpic is initial-exec; with -fpic the default
11630 is global-dynamic.
11631
11632 -ftrampolines
11633 For targets that normally need trampolines for nested functions,
11634 always generate them instead of using descriptors. Otherwise, for
11635 targets that do not need them, like for example HP-PA or IA-64, do
11636 nothing.
11637
11638 A trampoline is a small piece of code that is created at run time
11639 on the stack when the address of a nested function is taken, and is
11640 used to call the nested function indirectly. Therefore, it
11641 requires the stack to be made executable in order for the program
11642 to work properly.
11643
11644 -fno-trampolines is enabled by default on a language by language
11645 basis to let the compiler avoid generating them, if it computes
11646 that this is safe, and replace them with descriptors. Descriptors
11647 are made up of data only, but the generated code must be prepared
11648 to deal with them. As of this writing, -fno-trampolines is enabled
11649 by default only for Ada.
11650
11651 Moreover, code compiled with -ftrampolines and code compiled with
11652 -fno-trampolines are not binary compatible if nested functions are
11653 present. This option must therefore be used on a program-wide
11654 basis and be manipulated with extreme care.
11655
11656 -fvisibility=[default|internal|hidden|protected]
11657 Set the default ELF image symbol visibility to the specified
11658 option---all symbols are marked with this unless overridden within
11659 the code. Using this feature can very substantially improve
11660 linking and load times of shared object libraries, produce more
11661 optimized code, provide near-perfect API export and prevent symbol
11662 clashes. It is strongly recommended that you use this in any
11663 shared objects you distribute.
11664
11665 Despite the nomenclature, default always means public; i.e.,
11666 available to be linked against from outside the shared object.
11667 protected and internal are pretty useless in real-world usage so
11668 the only other commonly used option is hidden. The default if
11669 -fvisibility isn't specified is default, i.e., make every symbol
11670 public.
11671
11672 A good explanation of the benefits offered by ensuring ELF symbols
11673 have the correct visibility is given by "How To Write Shared
11674 Libraries" by Ulrich Drepper (which can be found at
11675 <https://www.akkadia.org/drepper/>)---however a superior solution
11676 made possible by this option to marking things hidden when the
11677 default is public is to make the default hidden and mark things
11678 public. This is the norm with DLLs on Windows and with
11679 -fvisibility=hidden and "__attribute__ ((visibility("default")))"
11680 instead of "__declspec(dllexport)" you get almost identical
11681 semantics with identical syntax. This is a great boon to those
11682 working with cross-platform projects.
11683
11684 For those adding visibility support to existing code, you may find
11685 "#pragma GCC visibility" of use. This works by you enclosing the
11686 declarations you wish to set visibility for with (for example)
11687 "#pragma GCC visibility push(hidden)" and "#pragma GCC visibility
11688 pop". Bear in mind that symbol visibility should be viewed as part
11689 of the API interface contract and thus all new code should always
11690 specify visibility when it is not the default; i.e., declarations
11691 only for use within the local DSO should always be marked
11692 explicitly as hidden as so to avoid PLT indirection
11693 overheads---making this abundantly clear also aids readability and
11694 self-documentation of the code. Note that due to ISO C++
11695 specification requirements, "operator new" and "operator delete"
11696 must always be of default visibility.
11697
11698 Be aware that headers from outside your project, in particular
11699 system headers and headers from any other library you use, may not
11700 be expecting to be compiled with visibility other than the default.
11701 You may need to explicitly say "#pragma GCC visibility
11702 push(default)" before including any such headers.
11703
11704 "extern" declarations are not affected by -fvisibility, so a lot of
11705 code can be recompiled with -fvisibility=hidden with no
11706 modifications. However, this means that calls to "extern"
11707 functions with no explicit visibility use the PLT, so it is more
11708 effective to use "__attribute ((visibility))" and/or "#pragma GCC
11709 visibility" to tell the compiler which "extern" declarations should
11710 be treated as hidden.
11711
11712 Note that -fvisibility does affect C++ vague linkage entities. This
11713 means that, for instance, an exception class that is be thrown
11714 between DSOs must be explicitly marked with default visibility so
11715 that the type_info nodes are unified between the DSOs.
11716
11717 An overview of these techniques, their benefits and how to use them
11718 is at <http://gcc.gnu.org/wiki/Visibility>.
11719
11720 -fstrict-volatile-bitfields
11721 This option should be used if accesses to volatile bit-fields (or
11722 other structure fields, although the compiler usually honors those
11723 types anyway) should use a single access of the width of the
11724 field's type, aligned to a natural alignment if possible. For
11725 example, targets with memory-mapped peripheral registers might
11726 require all such accesses to be 16 bits wide; with this flag you
11727 can declare all peripheral bit-fields as "unsigned short" (assuming
11728 short is 16 bits on these targets) to force GCC to use 16-bit
11729 accesses instead of, perhaps, a more efficient 32-bit access.
11730
11731 If this option is disabled, the compiler uses the most efficient
11732 instruction. In the previous example, that might be a 32-bit load
11733 instruction, even though that accesses bytes that do not contain
11734 any portion of the bit-field, or memory-mapped registers unrelated
11735 to the one being updated.
11736
11737 In some cases, such as when the "packed" attribute is applied to a
11738 structure field, it may not be possible to access the field with a
11739 single read or write that is correctly aligned for the target
11740 machine. In this case GCC falls back to generating multiple
11741 accesses rather than code that will fault or truncate the result at
11742 run time.
11743
11744 Note: Due to restrictions of the C/C++11 memory model, write
11745 accesses are not allowed to touch non bit-field members. It is
11746 therefore recommended to define all bits of the field's type as
11747 bit-field members.
11748
11749 The default value of this option is determined by the application
11750 binary interface for the target processor.
11751
11752 -fsync-libcalls
11753 This option controls whether any out-of-line instance of the
11754 "__sync" family of functions may be used to implement the C++11
11755 "__atomic" family of functions.
11756
11757 The default value of this option is enabled, thus the only useful
11758 form of the option is -fno-sync-libcalls. This option is used in
11759 the implementation of the libatomic runtime library.
11760
11761 GCC Developer Options
11762 This section describes command-line options that are primarily of
11763 interest to GCC developers, including options to support compiler
11764 testing and investigation of compiler bugs and compile-time performance
11765 problems. This includes options that produce debug dumps at various
11766 points in the compilation; that print statistics such as memory use and
11767 execution time; and that print information about GCC's configuration,
11768 such as where it searches for libraries. You should rarely need to use
11769 any of these options for ordinary compilation and linking tasks.
11770
11771 -dletters
11772 -fdump-rtl-pass
11773 -fdump-rtl-pass=filename
11774 Says to make debugging dumps during compilation at times specified
11775 by letters. This is used for debugging the RTL-based passes of the
11776 compiler. The file names for most of the dumps are made by
11777 appending a pass number and a word to the dumpname, and the files
11778 are created in the directory of the output file. In case of
11779 =filename option, the dump is output on the given file instead of
11780 the pass numbered dump files. Note that the pass number is
11781 assigned as passes are registered into the pass manager. Most
11782 passes are registered in the order that they will execute and for
11783 these passes the number corresponds to the pass execution order.
11784 However, passes registered by plugins, passes specific to
11785 compilation targets, or passes that are otherwise registered after
11786 all the other passes are numbered higher than a pass named "final",
11787 even if they are executed earlier. dumpname is generated from the
11788 name of the output file if explicitly specified and not an
11789 executable, otherwise it is the basename of the source file.
11790
11791 Some -dletters switches have different meaning when -E is used for
11792 preprocessing.
11793
11794 Debug dumps can be enabled with a -fdump-rtl switch or some -d
11795 option letters. Here are the possible letters for use in pass and
11796 letters, and their meanings:
11797
11798 -fdump-rtl-alignments
11799 Dump after branch alignments have been computed.
11800
11801 -fdump-rtl-asmcons
11802 Dump after fixing rtl statements that have unsatisfied in/out
11803 constraints.
11804
11805 -fdump-rtl-auto_inc_dec
11806 Dump after auto-inc-dec discovery. This pass is only run on
11807 architectures that have auto inc or auto dec instructions.
11808
11809 -fdump-rtl-barriers
11810 Dump after cleaning up the barrier instructions.
11811
11812 -fdump-rtl-bbpart
11813 Dump after partitioning hot and cold basic blocks.
11814
11815 -fdump-rtl-bbro
11816 Dump after block reordering.
11817
11818 -fdump-rtl-btl1
11819 -fdump-rtl-btl2
11820 -fdump-rtl-btl1 and -fdump-rtl-btl2 enable dumping after the
11821 two branch target load optimization passes.
11822
11823 -fdump-rtl-bypass
11824 Dump after jump bypassing and control flow optimizations.
11825
11826 -fdump-rtl-combine
11827 Dump after the RTL instruction combination pass.
11828
11829 -fdump-rtl-compgotos
11830 Dump after duplicating the computed gotos.
11831
11832 -fdump-rtl-ce1
11833 -fdump-rtl-ce2
11834 -fdump-rtl-ce3
11835 -fdump-rtl-ce1, -fdump-rtl-ce2, and -fdump-rtl-ce3 enable
11836 dumping after the three if conversion passes.
11837
11838 -fdump-rtl-cprop_hardreg
11839 Dump after hard register copy propagation.
11840
11841 -fdump-rtl-csa
11842 Dump after combining stack adjustments.
11843
11844 -fdump-rtl-cse1
11845 -fdump-rtl-cse2
11846 -fdump-rtl-cse1 and -fdump-rtl-cse2 enable dumping after the
11847 two common subexpression elimination passes.
11848
11849 -fdump-rtl-dce
11850 Dump after the standalone dead code elimination passes.
11851
11852 -fdump-rtl-dbr
11853 Dump after delayed branch scheduling.
11854
11855 -fdump-rtl-dce1
11856 -fdump-rtl-dce2
11857 -fdump-rtl-dce1 and -fdump-rtl-dce2 enable dumping after the
11858 two dead store elimination passes.
11859
11860 -fdump-rtl-eh
11861 Dump after finalization of EH handling code.
11862
11863 -fdump-rtl-eh_ranges
11864 Dump after conversion of EH handling range regions.
11865
11866 -fdump-rtl-expand
11867 Dump after RTL generation.
11868
11869 -fdump-rtl-fwprop1
11870 -fdump-rtl-fwprop2
11871 -fdump-rtl-fwprop1 and -fdump-rtl-fwprop2 enable dumping after
11872 the two forward propagation passes.
11873
11874 -fdump-rtl-gcse1
11875 -fdump-rtl-gcse2
11876 -fdump-rtl-gcse1 and -fdump-rtl-gcse2 enable dumping after
11877 global common subexpression elimination.
11878
11879 -fdump-rtl-init-regs
11880 Dump after the initialization of the registers.
11881
11882 -fdump-rtl-initvals
11883 Dump after the computation of the initial value sets.
11884
11885 -fdump-rtl-into_cfglayout
11886 Dump after converting to cfglayout mode.
11887
11888 -fdump-rtl-ira
11889 Dump after iterated register allocation.
11890
11891 -fdump-rtl-jump
11892 Dump after the second jump optimization.
11893
11894 -fdump-rtl-loop2
11895 -fdump-rtl-loop2 enables dumping after the rtl loop
11896 optimization passes.
11897
11898 -fdump-rtl-mach
11899 Dump after performing the machine dependent reorganization
11900 pass, if that pass exists.
11901
11902 -fdump-rtl-mode_sw
11903 Dump after removing redundant mode switches.
11904
11905 -fdump-rtl-rnreg
11906 Dump after register renumbering.
11907
11908 -fdump-rtl-outof_cfglayout
11909 Dump after converting from cfglayout mode.
11910
11911 -fdump-rtl-peephole2
11912 Dump after the peephole pass.
11913
11914 -fdump-rtl-postreload
11915 Dump after post-reload optimizations.
11916
11917 -fdump-rtl-pro_and_epilogue
11918 Dump after generating the function prologues and epilogues.
11919
11920 -fdump-rtl-sched1
11921 -fdump-rtl-sched2
11922 -fdump-rtl-sched1 and -fdump-rtl-sched2 enable dumping after
11923 the basic block scheduling passes.
11924
11925 -fdump-rtl-ree
11926 Dump after sign/zero extension elimination.
11927
11928 -fdump-rtl-seqabstr
11929 Dump after common sequence discovery.
11930
11931 -fdump-rtl-shorten
11932 Dump after shortening branches.
11933
11934 -fdump-rtl-sibling
11935 Dump after sibling call optimizations.
11936
11937 -fdump-rtl-split1
11938 -fdump-rtl-split2
11939 -fdump-rtl-split3
11940 -fdump-rtl-split4
11941 -fdump-rtl-split5
11942 These options enable dumping after five rounds of instruction
11943 splitting.
11944
11945 -fdump-rtl-sms
11946 Dump after modulo scheduling. This pass is only run on some
11947 architectures.
11948
11949 -fdump-rtl-stack
11950 Dump after conversion from GCC's "flat register file" registers
11951 to the x87's stack-like registers. This pass is only run on
11952 x86 variants.
11953
11954 -fdump-rtl-subreg1
11955 -fdump-rtl-subreg2
11956 -fdump-rtl-subreg1 and -fdump-rtl-subreg2 enable dumping after
11957 the two subreg expansion passes.
11958
11959 -fdump-rtl-unshare
11960 Dump after all rtl has been unshared.
11961
11962 -fdump-rtl-vartrack
11963 Dump after variable tracking.
11964
11965 -fdump-rtl-vregs
11966 Dump after converting virtual registers to hard registers.
11967
11968 -fdump-rtl-web
11969 Dump after live range splitting.
11970
11971 -fdump-rtl-regclass
11972 -fdump-rtl-subregs_of_mode_init
11973 -fdump-rtl-subregs_of_mode_finish
11974 -fdump-rtl-dfinit
11975 -fdump-rtl-dfinish
11976 These dumps are defined but always produce empty files.
11977
11978 -da
11979 -fdump-rtl-all
11980 Produce all the dumps listed above.
11981
11982 -dA Annotate the assembler output with miscellaneous debugging
11983 information.
11984
11985 -dD Dump all macro definitions, at the end of preprocessing, in
11986 addition to normal output.
11987
11988 -dH Produce a core dump whenever an error occurs.
11989
11990 -dp Annotate the assembler output with a comment indicating which
11991 pattern and alternative is used. The length and cost of each
11992 instruction are also printed.
11993
11994 -dP Dump the RTL in the assembler output as a comment before each
11995 instruction. Also turns on -dp annotation.
11996
11997 -dx Just generate RTL for a function instead of compiling it.
11998 Usually used with -fdump-rtl-expand.
11999
12000 -fdump-noaddr
12001 When doing debugging dumps, suppress address output. This makes it
12002 more feasible to use diff on debugging dumps for compiler
12003 invocations with different compiler binaries and/or different text
12004 / bss / data / heap / stack / dso start locations.
12005
12006 -freport-bug
12007 Collect and dump debug information into a temporary file if an
12008 internal compiler error (ICE) occurs.
12009
12010 -fdump-unnumbered
12011 When doing debugging dumps, suppress instruction numbers and
12012 address output. This makes it more feasible to use diff on
12013 debugging dumps for compiler invocations with different options, in
12014 particular with and without -g.
12015
12016 -fdump-unnumbered-links
12017 When doing debugging dumps (see -d option above), suppress
12018 instruction numbers for the links to the previous and next
12019 instructions in a sequence.
12020
12021 -fdump-ipa-switch
12022 Control the dumping at various stages of inter-procedural analysis
12023 language tree to a file. The file name is generated by appending a
12024 switch specific suffix to the source file name, and the file is
12025 created in the same directory as the output file. The following
12026 dumps are possible:
12027
12028 all Enables all inter-procedural analysis dumps.
12029
12030 cgraph
12031 Dumps information about call-graph optimization, unused
12032 function removal, and inlining decisions.
12033
12034 inline
12035 Dump after function inlining.
12036
12037 -fdump-lang-all
12038 -fdump-lang-switch
12039 -fdump-lang-switch-options
12040 -fdump-lang-switch-options=filename
12041 Control the dumping of language-specific information. The options
12042 and filename portions behave as described in the -fdump-tree
12043 option. The following switch values are accepted:
12044
12045 all Enable all language-specific dumps.
12046
12047 class
12048 Dump class hierarchy information. Virtual table information is
12049 emitted unless 'slim' is specified. This option is applicable
12050 to C++ only.
12051
12052 raw Dump the raw internal tree data. This option is applicable to
12053 C++ only.
12054
12055 -fdump-passes
12056 Print on stderr the list of optimization passes that are turned on
12057 and off by the current command-line options.
12058
12059 -fdump-statistics-option
12060 Enable and control dumping of pass statistics in a separate file.
12061 The file name is generated by appending a suffix ending in
12062 .statistics to the source file name, and the file is created in the
12063 same directory as the output file. If the -option form is used,
12064 -stats causes counters to be summed over the whole compilation unit
12065 while -details dumps every event as the passes generate them. The
12066 default with no option is to sum counters for each function
12067 compiled.
12068
12069 -fdump-tree-all
12070 -fdump-tree-switch
12071 -fdump-tree-switch-options
12072 -fdump-tree-switch-options=filename
12073 Control the dumping at various stages of processing the
12074 intermediate language tree to a file. The file name is generated
12075 by appending a switch-specific suffix to the source file name, and
12076 the file is created in the same directory as the output file. In
12077 case of =filename option, the dump is output on the given file
12078 instead of the auto named dump files. If the -options form is
12079 used, options is a list of - separated options which control the
12080 details of the dump. Not all options are applicable to all dumps;
12081 those that are not meaningful are ignored. The following options
12082 are available
12083
12084 address
12085 Print the address of each node. Usually this is not meaningful
12086 as it changes according to the environment and source file.
12087 Its primary use is for tying up a dump file with a debug
12088 environment.
12089
12090 asmname
12091 If "DECL_ASSEMBLER_NAME" has been set for a given decl, use
12092 that in the dump instead of "DECL_NAME". Its primary use is
12093 ease of use working backward from mangled names in the assembly
12094 file.
12095
12096 slim
12097 When dumping front-end intermediate representations, inhibit
12098 dumping of members of a scope or body of a function merely
12099 because that scope has been reached. Only dump such items when
12100 they are directly reachable by some other path.
12101
12102 When dumping pretty-printed trees, this option inhibits dumping
12103 the bodies of control structures.
12104
12105 When dumping RTL, print the RTL in slim (condensed) form
12106 instead of the default LISP-like representation.
12107
12108 raw Print a raw representation of the tree. By default, trees are
12109 pretty-printed into a C-like representation.
12110
12111 details
12112 Enable more detailed dumps (not honored by every dump option).
12113 Also include information from the optimization passes.
12114
12115 stats
12116 Enable dumping various statistics about the pass (not honored
12117 by every dump option).
12118
12119 blocks
12120 Enable showing basic block boundaries (disabled in raw dumps).
12121
12122 graph
12123 For each of the other indicated dump files (-fdump-rtl-pass),
12124 dump a representation of the control flow graph suitable for
12125 viewing with GraphViz to file.passid.pass.dot. Each function
12126 in the file is pretty-printed as a subgraph, so that GraphViz
12127 can render them all in a single plot.
12128
12129 This option currently only works for RTL dumps, and the RTL is
12130 always dumped in slim form.
12131
12132 vops
12133 Enable showing virtual operands for every statement.
12134
12135 lineno
12136 Enable showing line numbers for statements.
12137
12138 uid Enable showing the unique ID ("DECL_UID") for each variable.
12139
12140 verbose
12141 Enable showing the tree dump for each statement.
12142
12143 eh Enable showing the EH region number holding each statement.
12144
12145 scev
12146 Enable showing scalar evolution analysis details.
12147
12148 optimized
12149 Enable showing optimization information (only available in
12150 certain passes).
12151
12152 missed
12153 Enable showing missed optimization information (only available
12154 in certain passes).
12155
12156 note
12157 Enable other detailed optimization information (only available
12158 in certain passes).
12159
12160 =filename
12161 Instead of an auto named dump file, output into the given file
12162 name. The file names stdout and stderr are treated specially
12163 and are considered already open standard streams. For example,
12164
12165 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
12166 -fdump-tree-pre=/dev/stderr file.c
12167
12168 outputs vectorizer dump into foo.dump, while the PRE dump is
12169 output on to stderr. If two conflicting dump filenames are
12170 given for the same pass, then the latter option overrides the
12171 earlier one.
12172
12173 all Turn on all options, except raw, slim, verbose and lineno.
12174
12175 optall
12176 Turn on all optimization options, i.e., optimized, missed, and
12177 note.
12178
12179 To determine what tree dumps are available or find the dump for a
12180 pass of interest follow the steps below.
12181
12182 1. Invoke GCC with -fdump-passes and in the stderr output look for
12183 a code that corresponds to the pass you are interested in. For
12184 example, the codes "tree-evrp", "tree-vrp1", and "tree-vrp2"
12185 correspond to the three Value Range Propagation passes. The
12186 number at the end distinguishes distinct invocations of the
12187 same pass.
12188
12189 2. To enable the creation of the dump file, append the pass code
12190 to the -fdump- option prefix and invoke GCC with it. For
12191 example, to enable the dump from the Early Value Range
12192 Propagation pass, invoke GCC with the -fdump-tree-evrp option.
12193 Optionally, you may specify the name of the dump file. If you
12194 don't specify one, GCC creates as described below.
12195
12196 3. Find the pass dump in a file whose name is composed of three
12197 components separated by a period: the name of the source file
12198 GCC was invoked to compile, a numeric suffix indicating the
12199 pass number followed by the letter t for tree passes (and the
12200 letter r for RTL passes), and finally the pass code. For
12201 example, the Early VRP pass dump might be in a file named
12202 myfile.c.038t.evrp in the current working directory. Note that
12203 the numeric codes are not stable and may change from one
12204 version of GCC to another.
12205
12206 -fopt-info
12207 -fopt-info-options
12208 -fopt-info-options=filename
12209 Controls optimization dumps from various optimization passes. If
12210 the -options form is used, options is a list of - separated option
12211 keywords to select the dump details and optimizations.
12212
12213 The options can be divided into two groups: options describing the
12214 verbosity of the dump, and options describing which optimizations
12215 should be included. The options from both the groups can be freely
12216 mixed as they are non-overlapping. However, in case of any
12217 conflicts, the later options override the earlier options on the
12218 command line.
12219
12220 The following options control the dump verbosity:
12221
12222 optimized
12223 Print information when an optimization is successfully applied.
12224 It is up to a pass to decide which information is relevant. For
12225 example, the vectorizer passes print the source location of
12226 loops which are successfully vectorized.
12227
12228 missed
12229 Print information about missed optimizations. Individual passes
12230 control which information to include in the output.
12231
12232 note
12233 Print verbose information about optimizations, such as certain
12234 transformations, more detailed messages about decisions etc.
12235
12236 all Print detailed optimization information. This includes
12237 optimized, missed, and note.
12238
12239 One or more of the following option keywords can be used to
12240 describe a group of optimizations:
12241
12242 ipa Enable dumps from all interprocedural optimizations.
12243
12244 loop
12245 Enable dumps from all loop optimizations.
12246
12247 inline
12248 Enable dumps from all inlining optimizations.
12249
12250 omp Enable dumps from all OMP (Offloading and Multi Processing)
12251 optimizations.
12252
12253 vec Enable dumps from all vectorization optimizations.
12254
12255 optall
12256 Enable dumps from all optimizations. This is a superset of the
12257 optimization groups listed above.
12258
12259 If options is omitted, it defaults to optimized-optall, which means
12260 to dump all info about successful optimizations from all the
12261 passes.
12262
12263 If the filename is provided, then the dumps from all the applicable
12264 optimizations are concatenated into the filename. Otherwise the
12265 dump is output onto stderr. Though multiple -fopt-info options are
12266 accepted, only one of them can include a filename. If other
12267 filenames are provided then all but the first such option are
12268 ignored.
12269
12270 Note that the output filename is overwritten in case of multiple
12271 translation units. If a combined output from multiple translation
12272 units is desired, stderr should be used instead.
12273
12274 In the following example, the optimization info is output to
12275 stderr:
12276
12277 gcc -O3 -fopt-info
12278
12279 This example:
12280
12281 gcc -O3 -fopt-info-missed=missed.all
12282
12283 outputs missed optimization report from all the passes into
12284 missed.all, and this one:
12285
12286 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
12287
12288 prints information about missed optimization opportunities from
12289 vectorization passes on stderr. Note that -fopt-info-vec-missed is
12290 equivalent to -fopt-info-missed-vec. The order of the optimization
12291 group names and message types listed after -fopt-info does not
12292 matter.
12293
12294 As another example,
12295
12296 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
12297
12298 outputs information about missed optimizations as well as optimized
12299 locations from all the inlining passes into inline.txt.
12300
12301 Finally, consider:
12302
12303 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
12304
12305 Here the two output filenames vec.miss and loop.opt are in conflict
12306 since only one output file is allowed. In this case, only the first
12307 option takes effect and the subsequent options are ignored. Thus
12308 only vec.miss is produced which contains dumps from the vectorizer
12309 about missed opportunities.
12310
12311 -fsched-verbose=n
12312 On targets that use instruction scheduling, this option controls
12313 the amount of debugging output the scheduler prints to the dump
12314 files.
12315
12316 For n greater than zero, -fsched-verbose outputs the same
12317 information as -fdump-rtl-sched1 and -fdump-rtl-sched2. For n
12318 greater than one, it also output basic block probabilities,
12319 detailed ready list information and unit/insn info. For n greater
12320 than two, it includes RTL at abort point, control-flow and regions
12321 info. And for n over four, -fsched-verbose also includes
12322 dependence info.
12323
12324 -fenable-kind-pass
12325 -fdisable-kind-pass=range-list
12326 This is a set of options that are used to explicitly disable/enable
12327 optimization passes. These options are intended for use for
12328 debugging GCC. Compiler users should use regular options for
12329 enabling/disabling passes instead.
12330
12331 -fdisable-ipa-pass
12332 Disable IPA pass pass. pass is the pass name. If the same pass
12333 is statically invoked in the compiler multiple times, the pass
12334 name should be appended with a sequential number starting from
12335 1.
12336
12337 -fdisable-rtl-pass
12338 -fdisable-rtl-pass=range-list
12339 Disable RTL pass pass. pass is the pass name. If the same
12340 pass is statically invoked in the compiler multiple times, the
12341 pass name should be appended with a sequential number starting
12342 from 1. range-list is a comma-separated list of function
12343 ranges or assembler names. Each range is a number pair
12344 separated by a colon. The range is inclusive in both ends. If
12345 the range is trivial, the number pair can be simplified as a
12346 single number. If the function's call graph node's uid falls
12347 within one of the specified ranges, the pass is disabled for
12348 that function. The uid is shown in the function header of a
12349 dump file, and the pass names can be dumped by using option
12350 -fdump-passes.
12351
12352 -fdisable-tree-pass
12353 -fdisable-tree-pass=range-list
12354 Disable tree pass pass. See -fdisable-rtl for the description
12355 of option arguments.
12356
12357 -fenable-ipa-pass
12358 Enable IPA pass pass. pass is the pass name. If the same pass
12359 is statically invoked in the compiler multiple times, the pass
12360 name should be appended with a sequential number starting from
12361 1.
12362
12363 -fenable-rtl-pass
12364 -fenable-rtl-pass=range-list
12365 Enable RTL pass pass. See -fdisable-rtl for option argument
12366 description and examples.
12367
12368 -fenable-tree-pass
12369 -fenable-tree-pass=range-list
12370 Enable tree pass pass. See -fdisable-rtl for the description
12371 of option arguments.
12372
12373 Here are some examples showing uses of these options.
12374
12375 # disable ccp1 for all functions
12376 -fdisable-tree-ccp1
12377 # disable complete unroll for function whose cgraph node uid is 1
12378 -fenable-tree-cunroll=1
12379 # disable gcse2 for functions at the following ranges [1,1],
12380 # [300,400], and [400,1000]
12381 # disable gcse2 for functions foo and foo2
12382 -fdisable-rtl-gcse2=foo,foo2
12383 # disable early inlining
12384 -fdisable-tree-einline
12385 # disable ipa inlining
12386 -fdisable-ipa-inline
12387 # enable tree full unroll
12388 -fenable-tree-unroll
12389
12390 -fchecking
12391 -fchecking=n
12392 Enable internal consistency checking. The default depends on the
12393 compiler configuration. -fchecking=2 enables further internal
12394 consistency checking that might affect code generation.
12395
12396 -frandom-seed=string
12397 This option provides a seed that GCC uses in place of random
12398 numbers in generating certain symbol names that have to be
12399 different in every compiled file. It is also used to place unique
12400 stamps in coverage data files and the object files that produce
12401 them. You can use the -frandom-seed option to produce reproducibly
12402 identical object files.
12403
12404 The string can either be a number (decimal, octal or hex) or an
12405 arbitrary string (in which case it's converted to a number by
12406 computing CRC32).
12407
12408 The string should be different for every file you compile.
12409
12410 -save-temps
12411 -save-temps=cwd
12412 Store the usual "temporary" intermediate files permanently; place
12413 them in the current directory and name them based on the source
12414 file. Thus, compiling foo.c with -c -save-temps produces files
12415 foo.i and foo.s, as well as foo.o. This creates a preprocessed
12416 foo.i output file even though the compiler now normally uses an
12417 integrated preprocessor.
12418
12419 When used in combination with the -x command-line option,
12420 -save-temps is sensible enough to avoid over writing an input
12421 source file with the same extension as an intermediate file. The
12422 corresponding intermediate file may be obtained by renaming the
12423 source file before using -save-temps.
12424
12425 If you invoke GCC in parallel, compiling several different source
12426 files that share a common base name in different subdirectories or
12427 the same source file compiled for multiple output destinations, it
12428 is likely that the different parallel compilers will interfere with
12429 each other, and overwrite the temporary files. For instance:
12430
12431 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
12432 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
12433
12434 may result in foo.i and foo.o being written to simultaneously by
12435 both compilers.
12436
12437 -save-temps=obj
12438 Store the usual "temporary" intermediate files permanently. If the
12439 -o option is used, the temporary files are based on the object
12440 file. If the -o option is not used, the -save-temps=obj switch
12441 behaves like -save-temps.
12442
12443 For example:
12444
12445 gcc -save-temps=obj -c foo.c
12446 gcc -save-temps=obj -c bar.c -o dir/xbar.o
12447 gcc -save-temps=obj foobar.c -o dir2/yfoobar
12448
12449 creates foo.i, foo.s, dir/xbar.i, dir/xbar.s, dir2/yfoobar.i,
12450 dir2/yfoobar.s, and dir2/yfoobar.o.
12451
12452 -time[=file]
12453 Report the CPU time taken by each subprocess in the compilation
12454 sequence. For C source files, this is the compiler proper and
12455 assembler (plus the linker if linking is done).
12456
12457 Without the specification of an output file, the output looks like
12458 this:
12459
12460 # cc1 0.12 0.01
12461 # as 0.00 0.01
12462
12463 The first number on each line is the "user time", that is time
12464 spent executing the program itself. The second number is "system
12465 time", time spent executing operating system routines on behalf of
12466 the program. Both numbers are in seconds.
12467
12468 With the specification of an output file, the output is appended to
12469 the named file, and it looks like this:
12470
12471 0.12 0.01 cc1 <options>
12472 0.00 0.01 as <options>
12473
12474 The "user time" and the "system time" are moved before the program
12475 name, and the options passed to the program are displayed, so that
12476 one can later tell what file was being compiled, and with which
12477 options.
12478
12479 -fdump-final-insns[=file]
12480 Dump the final internal representation (RTL) to file. If the
12481 optional argument is omitted (or if file is "."), the name of the
12482 dump file is determined by appending ".gkd" to the compilation
12483 output file name.
12484
12485 -fcompare-debug[=opts]
12486 If no error occurs during compilation, run the compiler a second
12487 time, adding opts and -fcompare-debug-second to the arguments
12488 passed to the second compilation. Dump the final internal
12489 representation in both compilations, and print an error if they
12490 differ.
12491
12492 If the equal sign is omitted, the default -gtoggle is used.
12493
12494 The environment variable GCC_COMPARE_DEBUG, if defined, non-empty
12495 and nonzero, implicitly enables -fcompare-debug. If
12496 GCC_COMPARE_DEBUG is defined to a string starting with a dash, then
12497 it is used for opts, otherwise the default -gtoggle is used.
12498
12499 -fcompare-debug=, with the equal sign but without opts, is
12500 equivalent to -fno-compare-debug, which disables the dumping of the
12501 final representation and the second compilation, preventing even
12502 GCC_COMPARE_DEBUG from taking effect.
12503
12504 To verify full coverage during -fcompare-debug testing, set
12505 GCC_COMPARE_DEBUG to say -fcompare-debug-not-overridden, which GCC
12506 rejects as an invalid option in any actual compilation (rather than
12507 preprocessing, assembly or linking). To get just a warning,
12508 setting GCC_COMPARE_DEBUG to -w%n-fcompare-debug not overridden
12509 will do.
12510
12511 -fcompare-debug-second
12512 This option is implicitly passed to the compiler for the second
12513 compilation requested by -fcompare-debug, along with options to
12514 silence warnings, and omitting other options that would cause the
12515 compiler to produce output to files or to standard output as a side
12516 effect. Dump files and preserved temporary files are renamed so as
12517 to contain the ".gk" additional extension during the second
12518 compilation, to avoid overwriting those generated by the first.
12519
12520 When this option is passed to the compiler driver, it causes the
12521 first compilation to be skipped, which makes it useful for little
12522 other than debugging the compiler proper.
12523
12524 -gtoggle
12525 Turn off generation of debug info, if leaving out this option
12526 generates it, or turn it on at level 2 otherwise. The position of
12527 this argument in the command line does not matter; it takes effect
12528 after all other options are processed, and it does so only once, no
12529 matter how many times it is given. This is mainly intended to be
12530 used with -fcompare-debug.
12531
12532 -fvar-tracking-assignments-toggle
12533 Toggle -fvar-tracking-assignments, in the same way that -gtoggle
12534 toggles -g.
12535
12536 -Q Makes the compiler print out each function name as it is compiled,
12537 and print some statistics about each pass when it finishes.
12538
12539 -ftime-report
12540 Makes the compiler print some statistics about the time consumed by
12541 each pass when it finishes.
12542
12543 -ftime-report-details
12544 Record the time consumed by infrastructure parts separately for
12545 each pass.
12546
12547 -fira-verbose=n
12548 Control the verbosity of the dump file for the integrated register
12549 allocator. The default value is 5. If the value n is greater or
12550 equal to 10, the dump output is sent to stderr using the same
12551 format as n minus 10.
12552
12553 -flto-report
12554 Prints a report with internal details on the workings of the link-
12555 time optimizer. The contents of this report vary from version to
12556 version. It is meant to be useful to GCC developers when
12557 processing object files in LTO mode (via -flto).
12558
12559 Disabled by default.
12560
12561 -flto-report-wpa
12562 Like -flto-report, but only print for the WPA phase of Link Time
12563 Optimization.
12564
12565 -fmem-report
12566 Makes the compiler print some statistics about permanent memory
12567 allocation when it finishes.
12568
12569 -fmem-report-wpa
12570 Makes the compiler print some statistics about permanent memory
12571 allocation for the WPA phase only.
12572
12573 -fpre-ipa-mem-report
12574 -fpost-ipa-mem-report
12575 Makes the compiler print some statistics about permanent memory
12576 allocation before or after interprocedural optimization.
12577
12578 -fprofile-report
12579 Makes the compiler print some statistics about consistency of the
12580 (estimated) profile and effect of individual passes.
12581
12582 -fstack-usage
12583 Makes the compiler output stack usage information for the program,
12584 on a per-function basis. The filename for the dump is made by
12585 appending .su to the auxname. auxname is generated from the name
12586 of the output file, if explicitly specified and it is not an
12587 executable, otherwise it is the basename of the source file. An
12588 entry is made up of three fields:
12589
12590 * The name of the function.
12591
12592 * A number of bytes.
12593
12594 * One or more qualifiers: "static", "dynamic", "bounded".
12595
12596 The qualifier "static" means that the function manipulates the
12597 stack statically: a fixed number of bytes are allocated for the
12598 frame on function entry and released on function exit; no stack
12599 adjustments are otherwise made in the function. The second field
12600 is this fixed number of bytes.
12601
12602 The qualifier "dynamic" means that the function manipulates the
12603 stack dynamically: in addition to the static allocation described
12604 above, stack adjustments are made in the body of the function, for
12605 example to push/pop arguments around function calls. If the
12606 qualifier "bounded" is also present, the amount of these
12607 adjustments is bounded at compile time and the second field is an
12608 upper bound of the total amount of stack used by the function. If
12609 it is not present, the amount of these adjustments is not bounded
12610 at compile time and the second field only represents the bounded
12611 part.
12612
12613 -fstats
12614 Emit statistics about front-end processing at the end of the
12615 compilation. This option is supported only by the C++ front end,
12616 and the information is generally only useful to the G++ development
12617 team.
12618
12619 -fdbg-cnt-list
12620 Print the name and the counter upper bound for all debug counters.
12621
12622 -fdbg-cnt=counter-value-list
12623 Set the internal debug counter upper bound. counter-value-list is
12624 a comma-separated list of name:value pairs which sets the upper
12625 bound of each debug counter name to value. All debug counters have
12626 the initial upper bound of "UINT_MAX"; thus "dbg_cnt" returns true
12627 always unless the upper bound is set by this option. For example,
12628 with -fdbg-cnt=dce:10,tail_call:0, "dbg_cnt(dce)" returns true only
12629 for first 10 invocations.
12630
12631 -print-file-name=library
12632 Print the full absolute name of the library file library that would
12633 be used when linking---and don't do anything else. With this
12634 option, GCC does not compile or link anything; it just prints the
12635 file name.
12636
12637 -print-multi-directory
12638 Print the directory name corresponding to the multilib selected by
12639 any other switches present in the command line. This directory is
12640 supposed to exist in GCC_EXEC_PREFIX.
12641
12642 -print-multi-lib
12643 Print the mapping from multilib directory names to compiler
12644 switches that enable them. The directory name is separated from
12645 the switches by ;, and each switch starts with an @ instead of the
12646 -, without spaces between multiple switches. This is supposed to
12647 ease shell processing.
12648
12649 -print-multi-os-directory
12650 Print the path to OS libraries for the selected multilib, relative
12651 to some lib subdirectory. If OS libraries are present in the lib
12652 subdirectory and no multilibs are used, this is usually just ., if
12653 OS libraries are present in libsuffix sibling directories this
12654 prints e.g. ../lib64, ../lib or ../lib32, or if OS libraries are
12655 present in lib/subdir subdirectories it prints e.g. amd64, sparcv9
12656 or ev6.
12657
12658 -print-multiarch
12659 Print the path to OS libraries for the selected multiarch, relative
12660 to some lib subdirectory.
12661
12662 -print-prog-name=program
12663 Like -print-file-name, but searches for a program such as cpp.
12664
12665 -print-libgcc-file-name
12666 Same as -print-file-name=libgcc.a.
12667
12668 This is useful when you use -nostdlib or -nodefaultlibs but you do
12669 want to link with libgcc.a. You can do:
12670
12671 gcc -nostdlib <files>... `gcc -print-libgcc-file-name`
12672
12673 -print-search-dirs
12674 Print the name of the configured installation directory and a list
12675 of program and library directories gcc searches---and don't do
12676 anything else.
12677
12678 This is useful when gcc prints the error message installation
12679 problem, cannot exec cpp0: No such file or directory. To resolve
12680 this you either need to put cpp0 and the other compiler components
12681 where gcc expects to find them, or you can set the environment
12682 variable GCC_EXEC_PREFIX to the directory where you installed them.
12683 Don't forget the trailing /.
12684
12685 -print-sysroot
12686 Print the target sysroot directory that is used during compilation.
12687 This is the target sysroot specified either at configure time or
12688 using the --sysroot option, possibly with an extra suffix that
12689 depends on compilation options. If no target sysroot is specified,
12690 the option prints nothing.
12691
12692 -print-sysroot-headers-suffix
12693 Print the suffix added to the target sysroot when searching for
12694 headers, or give an error if the compiler is not configured with
12695 such a suffix---and don't do anything else.
12696
12697 -dumpmachine
12698 Print the compiler's target machine (for example,
12699 i686-pc-linux-gnu)---and don't do anything else.
12700
12701 -dumpversion
12702 Print the compiler version (for example, 3.0, 6.3.0 or 7)---and
12703 don't do anything else. This is the compiler version used in
12704 filesystem paths, specs, can be depending on how the compiler has
12705 been configured just a single number (major version), two numbers
12706 separated by dot (major and minor version) or three numbers
12707 separated by dots (major, minor and patchlevel version).
12708
12709 -dumpfullversion
12710 Print the full compiler version, always 3 numbers separated by
12711 dots, major, minor and patchlevel version.
12712
12713 -dumpspecs
12714 Print the compiler's built-in specs---and don't do anything else.
12715 (This is used when GCC itself is being built.)
12716
12717 Machine-Dependent Options
12718 Each target machine supported by GCC can have its own options---for
12719 example, to allow you to compile for a particular processor variant or
12720 ABI, or to control optimizations specific to that machine. By
12721 convention, the names of machine-specific options start with -m.
12722
12723 Some configurations of the compiler also support additional target-
12724 specific options, usually for compatibility with other compilers on the
12725 same platform.
12726
12727 AArch64 Options
12728
12729 These options are defined for AArch64 implementations:
12730
12731 -mabi=name
12732 Generate code for the specified data model. Permissible values are
12733 ilp32 for SysV-like data model where int, long int and pointers are
12734 32 bits, and lp64 for SysV-like data model where int is 32 bits,
12735 but long int and pointers are 64 bits.
12736
12737 The default depends on the specific target configuration. Note
12738 that the LP64 and ILP32 ABIs are not link-compatible; you must
12739 compile your entire program with the same ABI, and link with a
12740 compatible set of libraries.
12741
12742 -mbig-endian
12743 Generate big-endian code. This is the default when GCC is
12744 configured for an aarch64_be-*-* target.
12745
12746 -mgeneral-regs-only
12747 Generate code which uses only the general-purpose registers. This
12748 will prevent the compiler from using floating-point and Advanced
12749 SIMD registers but will not impose any restrictions on the
12750 assembler.
12751
12752 -mlittle-endian
12753 Generate little-endian code. This is the default when GCC is
12754 configured for an aarch64-*-* but not an aarch64_be-*-* target.
12755
12756 -mcmodel=tiny
12757 Generate code for the tiny code model. The program and its
12758 statically defined symbols must be within 1MB of each other.
12759 Programs can be statically or dynamically linked.
12760
12761 -mcmodel=small
12762 Generate code for the small code model. The program and its
12763 statically defined symbols must be within 4GB of each other.
12764 Programs can be statically or dynamically linked. This is the
12765 default code model.
12766
12767 -mcmodel=large
12768 Generate code for the large code model. This makes no assumptions
12769 about addresses and sizes of sections. Programs can be statically
12770 linked only.
12771
12772 -mstrict-align
12773 Avoid generating memory accesses that may not be aligned on a
12774 natural object boundary as described in the architecture
12775 specification.
12776
12777 -momit-leaf-frame-pointer
12778 -mno-omit-leaf-frame-pointer
12779 Omit or keep the frame pointer in leaf functions. The former
12780 behavior is the default.
12781
12782 -mtls-dialect=desc
12783 Use TLS descriptors as the thread-local storage mechanism for
12784 dynamic accesses of TLS variables. This is the default.
12785
12786 -mtls-dialect=traditional
12787 Use traditional TLS as the thread-local storage mechanism for
12788 dynamic accesses of TLS variables.
12789
12790 -mtls-size=size
12791 Specify bit size of immediate TLS offsets. Valid values are 12,
12792 24, 32, 48. This option requires binutils 2.26 or newer.
12793
12794 -mfix-cortex-a53-835769
12795 -mno-fix-cortex-a53-835769
12796 Enable or disable the workaround for the ARM Cortex-A53 erratum
12797 number 835769. This involves inserting a NOP instruction between
12798 memory instructions and 64-bit integer multiply-accumulate
12799 instructions.
12800
12801 -mfix-cortex-a53-843419
12802 -mno-fix-cortex-a53-843419
12803 Enable or disable the workaround for the ARM Cortex-A53 erratum
12804 number 843419. This erratum workaround is made at link time and
12805 this will only pass the corresponding flag to the linker.
12806
12807 -mlow-precision-recip-sqrt
12808 -mno-low-precision-recip-sqrt
12809 Enable or disable the reciprocal square root approximation. This
12810 option only has an effect if -ffast-math or
12811 -funsafe-math-optimizations is used as well. Enabling this reduces
12812 precision of reciprocal square root results to about 16 bits for
12813 single precision and to 32 bits for double precision.
12814
12815 -mlow-precision-sqrt
12816 -mno-low-precision-sqrt
12817 Enable or disable the square root approximation. This option only
12818 has an effect if -ffast-math or -funsafe-math-optimizations is used
12819 as well. Enabling this reduces precision of square root results to
12820 about 16 bits for single precision and to 32 bits for double
12821 precision. If enabled, it implies -mlow-precision-recip-sqrt.
12822
12823 -mlow-precision-div
12824 -mno-low-precision-div
12825 Enable or disable the division approximation. This option only has
12826 an effect if -ffast-math or -funsafe-math-optimizations is used as
12827 well. Enabling this reduces precision of division results to about
12828 16 bits for single precision and to 32 bits for double precision.
12829
12830 -march=name
12831 Specify the name of the target architecture and, optionally, one or
12832 more feature modifiers. This option has the form
12833 -march=arch{+[no]feature}*.
12834
12835 The permissible values for arch are armv8-a, armv8.1-a, armv8.2-a,
12836 armv8.3-a or armv8.4-a or native.
12837
12838 The value armv8.4-a implies armv8.3-a and enables compiler support
12839 for the ARMv8.4-A architecture extensions.
12840
12841 The value armv8.3-a implies armv8.2-a and enables compiler support
12842 for the ARMv8.3-A architecture extensions.
12843
12844 The value armv8.2-a implies armv8.1-a and enables compiler support
12845 for the ARMv8.2-A architecture extensions.
12846
12847 The value armv8.1-a implies armv8-a and enables compiler support
12848 for the ARMv8.1-A architecture extension. In particular, it
12849 enables the +crc, +lse, and +rdma features.
12850
12851 The value native is available on native AArch64 GNU/Linux and
12852 causes the compiler to pick the architecture of the host system.
12853 This option has no effect if the compiler is unable to recognize
12854 the architecture of the host system,
12855
12856 The permissible values for feature are listed in the sub-section on
12857 aarch64-feature-modifiers,,-march and -mcpu Feature Modifiers.
12858 Where conflicting feature modifiers are specified, the right-most
12859 feature is used.
12860
12861 GCC uses name to determine what kind of instructions it can emit
12862 when generating assembly code. If -march is specified without
12863 either of -mtune or -mcpu also being specified, the code is tuned
12864 to perform well across a range of target processors implementing
12865 the target architecture.
12866
12867 -mtune=name
12868 Specify the name of the target processor for which GCC should tune
12869 the performance of the code. Permissible values for this option
12870 are: generic, cortex-a35, cortex-a53, cortex-a55, cortex-a57,
12871 cortex-a72, cortex-a73, cortex-a75, exynos-m1, falkor, qdf24xx,
12872 saphira, xgene1, vulcan, thunderx, thunderxt88, thunderxt88p1,
12873 thunderxt81, thunderxt83, thunderx2t99, cortex-a57.cortex-a53,
12874 cortex-a72.cortex-a53, cortex-a73.cortex-a35,
12875 cortex-a73.cortex-a53, cortex-a75.cortex-a55, native.
12876
12877 The values cortex-a57.cortex-a53, cortex-a72.cortex-a53,
12878 cortex-a73.cortex-a35, cortex-a73.cortex-a53, cortex-a75.cortex-a55
12879 specify that GCC should tune for a big.LITTLE system.
12880
12881 Additionally on native AArch64 GNU/Linux systems the value native
12882 tunes performance to the host system. This option has no effect if
12883 the compiler is unable to recognize the processor of the host
12884 system.
12885
12886 Where none of -mtune=, -mcpu= or -march= are specified, the code is
12887 tuned to perform well across a range of target processors.
12888
12889 This option cannot be suffixed by feature modifiers.
12890
12891 -mcpu=name
12892 Specify the name of the target processor, optionally suffixed by
12893 one or more feature modifiers. This option has the form
12894 -mcpu=cpu{+[no]feature}*, where the permissible values for cpu are
12895 the same as those available for -mtune. The permissible values for
12896 feature are documented in the sub-section on
12897 aarch64-feature-modifiers,,-march and -mcpu Feature Modifiers.
12898 Where conflicting feature modifiers are specified, the right-most
12899 feature is used.
12900
12901 GCC uses name to determine what kind of instructions it can emit
12902 when generating assembly code (as if by -march) and to determine
12903 the target processor for which to tune for performance (as if by
12904 -mtune). Where this option is used in conjunction with -march or
12905 -mtune, those options take precedence over the appropriate part of
12906 this option.
12907
12908 -moverride=string
12909 Override tuning decisions made by the back-end in response to a
12910 -mtune= switch. The syntax, semantics, and accepted values for
12911 string in this option are not guaranteed to be consistent across
12912 releases.
12913
12914 This option is only intended to be useful when developing GCC.
12915
12916 -mverbose-cost-dump
12917 Enable verbose cost model dumping in the debug dump files. This
12918 option is provided for use in debugging the compiler.
12919
12920 -mpc-relative-literal-loads
12921 -mno-pc-relative-literal-loads
12922 Enable or disable PC-relative literal loads. With this option
12923 literal pools are accessed using a single instruction and emitted
12924 after each function. This limits the maximum size of functions to
12925 1MB. This is enabled by default for -mcmodel=tiny.
12926
12927 -msign-return-address=scope
12928 Select the function scope on which return address signing will be
12929 applied. Permissible values are none, which disables return
12930 address signing, non-leaf, which enables pointer signing for
12931 functions which are not leaf functions, and all, which enables
12932 pointer signing for all functions. The default value is none.
12933
12934 -msve-vector-bits=bits
12935 Specify the number of bits in an SVE vector register. This option
12936 only has an effect when SVE is enabled.
12937
12938 GCC supports two forms of SVE code generation: "vector-length
12939 agnostic" output that works with any size of vector register and
12940 "vector-length specific" output that only works when the vector
12941 registers are a particular size. Replacing bits with scalable
12942 selects vector-length agnostic output while replacing it with a
12943 number selects vector-length specific output. The possible lengths
12944 in the latter case are: 128, 256, 512, 1024 and 2048. scalable is
12945 the default.
12946
12947 At present, -msve-vector-bits=128 produces the same output as
12948 -msve-vector-bits=scalable.
12949
12950 -march and -mcpu Feature Modifiers
12951
12952 Feature modifiers used with -march and -mcpu can be any of the
12953 following and their inverses nofeature:
12954
12955 crc Enable CRC extension. This is on by default for -march=armv8.1-a.
12956
12957 crypto
12958 Enable Crypto extension. This also enables Advanced SIMD and
12959 floating-point instructions.
12960
12961 fp Enable floating-point instructions. This is on by default for all
12962 possible values for options -march and -mcpu.
12963
12964 simd
12965 Enable Advanced SIMD instructions. This also enables floating-
12966 point instructions. This is on by default for all possible values
12967 for options -march and -mcpu.
12968
12969 sve Enable Scalable Vector Extension instructions. This also enables
12970 Advanced SIMD and floating-point instructions.
12971
12972 lse Enable Large System Extension instructions. This is on by default
12973 for -march=armv8.1-a.
12974
12975 rdma
12976 Enable Round Double Multiply Accumulate instructions. This is on
12977 by default for -march=armv8.1-a.
12978
12979 fp16
12980 Enable FP16 extension. This also enables floating-point
12981 instructions.
12982
12983 fp16fml
12984 Enable FP16 fmla extension. This also enables FP16 extensions and
12985 floating-point instructions. This option is enabled by default for
12986 -march=armv8.4-a. Use of this option with architectures prior to
12987 Armv8.2-A is not supported.
12988
12989 rcpc
12990 Enable the RcPc extension. This does not change code generation
12991 from GCC, but is passed on to the assembler, enabling inline asm
12992 statements to use instructions from the RcPc extension.
12993
12994 dotprod
12995 Enable the Dot Product extension. This also enables Advanced SIMD
12996 instructions.
12997
12998 aes Enable the Armv8-a aes and pmull crypto extension. This also
12999 enables Advanced SIMD instructions.
13000
13001 sha2
13002 Enable the Armv8-a sha2 crypto extension. This also enables
13003 Advanced SIMD instructions.
13004
13005 sha3
13006 Enable the sha512 and sha3 crypto extension. This also enables
13007 Advanced SIMD instructions. Use of this option with architectures
13008 prior to Armv8.2-A is not supported.
13009
13010 sm4 Enable the sm3 and sm4 crypto extension. This also enables
13011 Advanced SIMD instructions. Use of this option with architectures
13012 prior to Armv8.2-A is not supported.
13013
13014 Feature crypto implies aes, sha2, and simd, which implies fp.
13015 Conversely, nofp implies nosimd, which implies nocrypto, noaes and
13016 nosha2.
13017
13018 Adapteva Epiphany Options
13019
13020 These -m options are defined for Adapteva Epiphany:
13021
13022 -mhalf-reg-file
13023 Don't allocate any register in the range "r32"..."r63". That
13024 allows code to run on hardware variants that lack these registers.
13025
13026 -mprefer-short-insn-regs
13027 Preferentially allocate registers that allow short instruction
13028 generation. This can result in increased instruction count, so
13029 this may either reduce or increase overall code size.
13030
13031 -mbranch-cost=num
13032 Set the cost of branches to roughly num "simple" instructions.
13033 This cost is only a heuristic and is not guaranteed to produce
13034 consistent results across releases.
13035
13036 -mcmove
13037 Enable the generation of conditional moves.
13038
13039 -mnops=num
13040 Emit num NOPs before every other generated instruction.
13041
13042 -mno-soft-cmpsf
13043 For single-precision floating-point comparisons, emit an "fsub"
13044 instruction and test the flags. This is faster than a software
13045 comparison, but can get incorrect results in the presence of NaNs,
13046 or when two different small numbers are compared such that their
13047 difference is calculated as zero. The default is -msoft-cmpsf,
13048 which uses slower, but IEEE-compliant, software comparisons.
13049
13050 -mstack-offset=num
13051 Set the offset between the top of the stack and the stack pointer.
13052 E.g., a value of 8 means that the eight bytes in the range
13053 "sp+0...sp+7" can be used by leaf functions without stack
13054 allocation. Values other than 8 or 16 are untested and unlikely to
13055 work. Note also that this option changes the ABI; compiling a
13056 program with a different stack offset than the libraries have been
13057 compiled with generally does not work. This option can be useful
13058 if you want to evaluate if a different stack offset would give you
13059 better code, but to actually use a different stack offset to build
13060 working programs, it is recommended to configure the toolchain with
13061 the appropriate --with-stack-offset=num option.
13062
13063 -mno-round-nearest
13064 Make the scheduler assume that the rounding mode has been set to
13065 truncating. The default is -mround-nearest.
13066
13067 -mlong-calls
13068 If not otherwise specified by an attribute, assume all calls might
13069 be beyond the offset range of the "b" / "bl" instructions, and
13070 therefore load the function address into a register before
13071 performing a (otherwise direct) call. This is the default.
13072
13073 -mshort-calls
13074 If not otherwise specified by an attribute, assume all direct calls
13075 are in the range of the "b" / "bl" instructions, so use these
13076 instructions for direct calls. The default is -mlong-calls.
13077
13078 -msmall16
13079 Assume addresses can be loaded as 16-bit unsigned values. This
13080 does not apply to function addresses for which -mlong-calls
13081 semantics are in effect.
13082
13083 -mfp-mode=mode
13084 Set the prevailing mode of the floating-point unit. This
13085 determines the floating-point mode that is provided and expected at
13086 function call and return time. Making this mode match the mode you
13087 predominantly need at function start can make your programs smaller
13088 and faster by avoiding unnecessary mode switches.
13089
13090 mode can be set to one the following values:
13091
13092 caller
13093 Any mode at function entry is valid, and retained or restored
13094 when the function returns, and when it calls other functions.
13095 This mode is useful for compiling libraries or other
13096 compilation units you might want to incorporate into different
13097 programs with different prevailing FPU modes, and the
13098 convenience of being able to use a single object file outweighs
13099 the size and speed overhead for any extra mode switching that
13100 might be needed, compared with what would be needed with a more
13101 specific choice of prevailing FPU mode.
13102
13103 truncate
13104 This is the mode used for floating-point calculations with
13105 truncating (i.e. round towards zero) rounding mode. That
13106 includes conversion from floating point to integer.
13107
13108 round-nearest
13109 This is the mode used for floating-point calculations with
13110 round-to-nearest-or-even rounding mode.
13111
13112 int This is the mode used to perform integer calculations in the
13113 FPU, e.g. integer multiply, or integer multiply-and-
13114 accumulate.
13115
13116 The default is -mfp-mode=caller
13117
13118 -mnosplit-lohi
13119 -mno-postinc
13120 -mno-postmodify
13121 Code generation tweaks that disable, respectively, splitting of
13122 32-bit loads, generation of post-increment addresses, and
13123 generation of post-modify addresses. The defaults are msplit-lohi,
13124 -mpost-inc, and -mpost-modify.
13125
13126 -mnovect-double
13127 Change the preferred SIMD mode to SImode. The default is
13128 -mvect-double, which uses DImode as preferred SIMD mode.
13129
13130 -max-vect-align=num
13131 The maximum alignment for SIMD vector mode types. num may be 4 or
13132 8. The default is 8. Note that this is an ABI change, even though
13133 many library function interfaces are unaffected if they don't use
13134 SIMD vector modes in places that affect size and/or alignment of
13135 relevant types.
13136
13137 -msplit-vecmove-early
13138 Split vector moves into single word moves before reload. In theory
13139 this can give better register allocation, but so far the reverse
13140 seems to be generally the case.
13141
13142 -m1reg-reg
13143 Specify a register to hold the constant -1, which makes loading
13144 small negative constants and certain bitmasks faster. Allowable
13145 values for reg are r43 and r63, which specify use of that register
13146 as a fixed register, and none, which means that no register is used
13147 for this purpose. The default is -m1reg-none.
13148
13149 ARC Options
13150
13151 The following options control the architecture variant for which code
13152 is being compiled:
13153
13154 -mbarrel-shifter
13155 Generate instructions supported by barrel shifter. This is the
13156 default unless -mcpu=ARC601 or -mcpu=ARCEM is in effect.
13157
13158 -mjli-always
13159 Force to call a function using jli_s instruction. This option is
13160 valid only for ARCv2 architecture.
13161
13162 -mcpu=cpu
13163 Set architecture type, register usage, and instruction scheduling
13164 parameters for cpu. There are also shortcut alias options
13165 available for backward compatibility and convenience. Supported
13166 values for cpu are
13167
13168 arc600
13169 Compile for ARC600. Aliases: -mA6, -mARC600.
13170
13171 arc601
13172 Compile for ARC601. Alias: -mARC601.
13173
13174 arc700
13175 Compile for ARC700. Aliases: -mA7, -mARC700. This is the
13176 default when configured with --with-cpu=arc700.
13177
13178 arcem
13179 Compile for ARC EM.
13180
13181 archs
13182 Compile for ARC HS.
13183
13184 em Compile for ARC EM CPU with no hardware extensions.
13185
13186 em4 Compile for ARC EM4 CPU.
13187
13188 em4_dmips
13189 Compile for ARC EM4 DMIPS CPU.
13190
13191 em4_fpus
13192 Compile for ARC EM4 DMIPS CPU with the single-precision
13193 floating-point extension.
13194
13195 em4_fpuda
13196 Compile for ARC EM4 DMIPS CPU with single-precision floating-
13197 point and double assist instructions.
13198
13199 hs Compile for ARC HS CPU with no hardware extensions except the
13200 atomic instructions.
13201
13202 hs34
13203 Compile for ARC HS34 CPU.
13204
13205 hs38
13206 Compile for ARC HS38 CPU.
13207
13208 hs38_linux
13209 Compile for ARC HS38 CPU with all hardware extensions on.
13210
13211 arc600_norm
13212 Compile for ARC 600 CPU with "norm" instructions enabled.
13213
13214 arc600_mul32x16
13215 Compile for ARC 600 CPU with "norm" and 32x16-bit multiply
13216 instructions enabled.
13217
13218 arc600_mul64
13219 Compile for ARC 600 CPU with "norm" and "mul64"-family
13220 instructions enabled.
13221
13222 arc601_norm
13223 Compile for ARC 601 CPU with "norm" instructions enabled.
13224
13225 arc601_mul32x16
13226 Compile for ARC 601 CPU with "norm" and 32x16-bit multiply
13227 instructions enabled.
13228
13229 arc601_mul64
13230 Compile for ARC 601 CPU with "norm" and "mul64"-family
13231 instructions enabled.
13232
13233 nps400
13234 Compile for ARC 700 on NPS400 chip.
13235
13236 em_mini
13237 Compile for ARC EM minimalist configuration featuring reduced
13238 register set.
13239
13240 -mdpfp
13241 -mdpfp-compact
13242 Generate double-precision FPX instructions, tuned for the compact
13243 implementation.
13244
13245 -mdpfp-fast
13246 Generate double-precision FPX instructions, tuned for the fast
13247 implementation.
13248
13249 -mno-dpfp-lrsr
13250 Disable "lr" and "sr" instructions from using FPX extension aux
13251 registers.
13252
13253 -mea
13254 Generate extended arithmetic instructions. Currently only "divaw",
13255 "adds", "subs", and "sat16" are supported. This is always enabled
13256 for -mcpu=ARC700.
13257
13258 -mno-mpy
13259 Do not generate "mpy"-family instructions for ARC700. This option
13260 is deprecated.
13261
13262 -mmul32x16
13263 Generate 32x16-bit multiply and multiply-accumulate instructions.
13264
13265 -mmul64
13266 Generate "mul64" and "mulu64" instructions. Only valid for
13267 -mcpu=ARC600.
13268
13269 -mnorm
13270 Generate "norm" instructions. This is the default if -mcpu=ARC700
13271 is in effect.
13272
13273 -mspfp
13274 -mspfp-compact
13275 Generate single-precision FPX instructions, tuned for the compact
13276 implementation.
13277
13278 -mspfp-fast
13279 Generate single-precision FPX instructions, tuned for the fast
13280 implementation.
13281
13282 -msimd
13283 Enable generation of ARC SIMD instructions via target-specific
13284 builtins. Only valid for -mcpu=ARC700.
13285
13286 -msoft-float
13287 This option ignored; it is provided for compatibility purposes
13288 only. Software floating-point code is emitted by default, and this
13289 default can overridden by FPX options; -mspfp, -mspfp-compact, or
13290 -mspfp-fast for single precision, and -mdpfp, -mdpfp-compact, or
13291 -mdpfp-fast for double precision.
13292
13293 -mswap
13294 Generate "swap" instructions.
13295
13296 -matomic
13297 This enables use of the locked load/store conditional extension to
13298 implement atomic memory built-in functions. Not available for ARC
13299 6xx or ARC EM cores.
13300
13301 -mdiv-rem
13302 Enable "div" and "rem" instructions for ARCv2 cores.
13303
13304 -mcode-density
13305 Enable code density instructions for ARC EM. This option is on by
13306 default for ARC HS.
13307
13308 -mll64
13309 Enable double load/store operations for ARC HS cores.
13310
13311 -mtp-regno=regno
13312 Specify thread pointer register number.
13313
13314 -mmpy-option=multo
13315 Compile ARCv2 code with a multiplier design option. You can
13316 specify the option using either a string or numeric value for
13317 multo. wlh1 is the default value. The recognized values are:
13318
13319 0
13320 none
13321 No multiplier available.
13322
13323 1
13324 w 16x16 multiplier, fully pipelined. The following instructions
13325 are enabled: "mpyw" and "mpyuw".
13326
13327 2
13328 wlh1
13329 32x32 multiplier, fully pipelined (1 stage). The following
13330 instructions are additionally enabled: "mpy", "mpyu", "mpym",
13331 "mpymu", and "mpy_s".
13332
13333 3
13334 wlh2
13335 32x32 multiplier, fully pipelined (2 stages). The following
13336 instructions are additionally enabled: "mpy", "mpyu", "mpym",
13337 "mpymu", and "mpy_s".
13338
13339 4
13340 wlh3
13341 Two 16x16 multipliers, blocking, sequential. The following
13342 instructions are additionally enabled: "mpy", "mpyu", "mpym",
13343 "mpymu", and "mpy_s".
13344
13345 5
13346 wlh4
13347 One 16x16 multiplier, blocking, sequential. The following
13348 instructions are additionally enabled: "mpy", "mpyu", "mpym",
13349 "mpymu", and "mpy_s".
13350
13351 6
13352 wlh5
13353 One 32x4 multiplier, blocking, sequential. The following
13354 instructions are additionally enabled: "mpy", "mpyu", "mpym",
13355 "mpymu", and "mpy_s".
13356
13357 7
13358 plus_dmpy
13359 ARC HS SIMD support.
13360
13361 8
13362 plus_macd
13363 ARC HS SIMD support.
13364
13365 9
13366 plus_qmacw
13367 ARC HS SIMD support.
13368
13369 This option is only available for ARCv2 cores.
13370
13371 -mfpu=fpu
13372 Enables support for specific floating-point hardware extensions for
13373 ARCv2 cores. Supported values for fpu are:
13374
13375 fpus
13376 Enables support for single-precision floating-point hardware
13377 extensions.
13378
13379 fpud
13380 Enables support for double-precision floating-point hardware
13381 extensions. The single-precision floating-point extension is
13382 also enabled. Not available for ARC EM.
13383
13384 fpuda
13385 Enables support for double-precision floating-point hardware
13386 extensions using double-precision assist instructions. The
13387 single-precision floating-point extension is also enabled.
13388 This option is only available for ARC EM.
13389
13390 fpuda_div
13391 Enables support for double-precision floating-point hardware
13392 extensions using double-precision assist instructions. The
13393 single-precision floating-point, square-root, and divide
13394 extensions are also enabled. This option is only available for
13395 ARC EM.
13396
13397 fpuda_fma
13398 Enables support for double-precision floating-point hardware
13399 extensions using double-precision assist instructions. The
13400 single-precision floating-point and fused multiply and add
13401 hardware extensions are also enabled. This option is only
13402 available for ARC EM.
13403
13404 fpuda_all
13405 Enables support for double-precision floating-point hardware
13406 extensions using double-precision assist instructions. All
13407 single-precision floating-point hardware extensions are also
13408 enabled. This option is only available for ARC EM.
13409
13410 fpus_div
13411 Enables support for single-precision floating-point, square-
13412 root and divide hardware extensions.
13413
13414 fpud_div
13415 Enables support for double-precision floating-point, square-
13416 root and divide hardware extensions. This option includes
13417 option fpus_div. Not available for ARC EM.
13418
13419 fpus_fma
13420 Enables support for single-precision floating-point and fused
13421 multiply and add hardware extensions.
13422
13423 fpud_fma
13424 Enables support for double-precision floating-point and fused
13425 multiply and add hardware extensions. This option includes
13426 option fpus_fma. Not available for ARC EM.
13427
13428 fpus_all
13429 Enables support for all single-precision floating-point
13430 hardware extensions.
13431
13432 fpud_all
13433 Enables support for all single- and double-precision floating-
13434 point hardware extensions. Not available for ARC EM.
13435
13436 -mirq-ctrl-saved=register-range, blink, lp_count
13437 Specifies general-purposes registers that the processor
13438 automatically saves/restores on interrupt entry and exit.
13439 register-range is specified as two registers separated by a dash.
13440 The register range always starts with "r0", the upper limit is "fp"
13441 register. blink and lp_count are optional. This option is only
13442 valid for ARC EM and ARC HS cores.
13443
13444 -mrgf-banked-regs=number
13445 Specifies the number of registers replicated in second register
13446 bank on entry to fast interrupt. Fast interrupts are interrupts
13447 with the highest priority level P0. These interrupts save only PC
13448 and STATUS32 registers to avoid memory transactions during
13449 interrupt entry and exit sequences. Use this option when you are
13450 using fast interrupts in an ARC V2 family processor. Permitted
13451 values are 4, 8, 16, and 32.
13452
13453 -mlpc-width=width
13454 Specify the width of the "lp_count" register. Valid values for
13455 width are 8, 16, 20, 24, 28 and 32 bits. The default width is
13456 fixed to 32 bits. If the width is less than 32, the compiler does
13457 not attempt to transform loops in your program to use the zero-
13458 delay loop mechanism unless it is known that the "lp_count"
13459 register can hold the required loop-counter value. Depending on
13460 the width specified, the compiler and run-time library might
13461 continue to use the loop mechanism for various needs. This option
13462 defines macro "__ARC_LPC_WIDTH__" with the value of width.
13463
13464 -mrf16
13465 This option instructs the compiler to generate code for a 16-entry
13466 register file. This option defines the "__ARC_RF16__" preprocessor
13467 macro.
13468
13469 The following options are passed through to the assembler, and also
13470 define preprocessor macro symbols.
13471
13472 -mdsp-packa
13473 Passed down to the assembler to enable the DSP Pack A extensions.
13474 Also sets the preprocessor symbol "__Xdsp_packa". This option is
13475 deprecated.
13476
13477 -mdvbf
13478 Passed down to the assembler to enable the dual Viterbi butterfly
13479 extension. Also sets the preprocessor symbol "__Xdvbf". This
13480 option is deprecated.
13481
13482 -mlock
13483 Passed down to the assembler to enable the locked load/store
13484 conditional extension. Also sets the preprocessor symbol
13485 "__Xlock".
13486
13487 -mmac-d16
13488 Passed down to the assembler. Also sets the preprocessor symbol
13489 "__Xxmac_d16". This option is deprecated.
13490
13491 -mmac-24
13492 Passed down to the assembler. Also sets the preprocessor symbol
13493 "__Xxmac_24". This option is deprecated.
13494
13495 -mrtsc
13496 Passed down to the assembler to enable the 64-bit time-stamp
13497 counter extension instruction. Also sets the preprocessor symbol
13498 "__Xrtsc". This option is deprecated.
13499
13500 -mswape
13501 Passed down to the assembler to enable the swap byte ordering
13502 extension instruction. Also sets the preprocessor symbol
13503 "__Xswape".
13504
13505 -mtelephony
13506 Passed down to the assembler to enable dual- and single-operand
13507 instructions for telephony. Also sets the preprocessor symbol
13508 "__Xtelephony". This option is deprecated.
13509
13510 -mxy
13511 Passed down to the assembler to enable the XY memory extension.
13512 Also sets the preprocessor symbol "__Xxy".
13513
13514 The following options control how the assembly code is annotated:
13515
13516 -misize
13517 Annotate assembler instructions with estimated addresses.
13518
13519 -mannotate-align
13520 Explain what alignment considerations lead to the decision to make
13521 an instruction short or long.
13522
13523 The following options are passed through to the linker:
13524
13525 -marclinux
13526 Passed through to the linker, to specify use of the "arclinux"
13527 emulation. This option is enabled by default in tool chains built
13528 for "arc-linux-uclibc" and "arceb-linux-uclibc" targets when
13529 profiling is not requested.
13530
13531 -marclinux_prof
13532 Passed through to the linker, to specify use of the "arclinux_prof"
13533 emulation. This option is enabled by default in tool chains built
13534 for "arc-linux-uclibc" and "arceb-linux-uclibc" targets when
13535 profiling is requested.
13536
13537 The following options control the semantics of generated code:
13538
13539 -mlong-calls
13540 Generate calls as register indirect calls, thus providing access to
13541 the full 32-bit address range.
13542
13543 -mmedium-calls
13544 Don't use less than 25-bit addressing range for calls, which is the
13545 offset available for an unconditional branch-and-link instruction.
13546 Conditional execution of function calls is suppressed, to allow use
13547 of the 25-bit range, rather than the 21-bit range with conditional
13548 branch-and-link. This is the default for tool chains built for
13549 "arc-linux-uclibc" and "arceb-linux-uclibc" targets.
13550
13551 -G num
13552 Put definitions of externally-visible data in a small data section
13553 if that data is no bigger than num bytes. The default value of num
13554 is 4 for any ARC configuration, or 8 when we have double load/store
13555 operations.
13556
13557 -mno-sdata
13558 Do not generate sdata references. This is the default for tool
13559 chains built for "arc-linux-uclibc" and "arceb-linux-uclibc"
13560 targets.
13561
13562 -mvolatile-cache
13563 Use ordinarily cached memory accesses for volatile references.
13564 This is the default.
13565
13566 -mno-volatile-cache
13567 Enable cache bypass for volatile references.
13568
13569 The following options fine tune code generation:
13570
13571 -malign-call
13572 Do alignment optimizations for call instructions.
13573
13574 -mauto-modify-reg
13575 Enable the use of pre/post modify with register displacement.
13576
13577 -mbbit-peephole
13578 Enable bbit peephole2.
13579
13580 -mno-brcc
13581 This option disables a target-specific pass in arc_reorg to
13582 generate compare-and-branch ("brcc") instructions. It has no
13583 effect on generation of these instructions driven by the combiner
13584 pass.
13585
13586 -mcase-vector-pcrel
13587 Use PC-relative switch case tables to enable case table shortening.
13588 This is the default for -Os.
13589
13590 -mcompact-casesi
13591 Enable compact "casesi" pattern. This is the default for -Os, and
13592 only available for ARCv1 cores.
13593
13594 -mno-cond-exec
13595 Disable the ARCompact-specific pass to generate conditional
13596 execution instructions.
13597
13598 Due to delay slot scheduling and interactions between operand
13599 numbers, literal sizes, instruction lengths, and the support for
13600 conditional execution, the target-independent pass to generate
13601 conditional execution is often lacking, so the ARC port has kept a
13602 special pass around that tries to find more conditional execution
13603 generation opportunities after register allocation, branch
13604 shortening, and delay slot scheduling have been done. This pass
13605 generally, but not always, improves performance and code size, at
13606 the cost of extra compilation time, which is why there is an option
13607 to switch it off. If you have a problem with call instructions
13608 exceeding their allowable offset range because they are
13609 conditionalized, you should consider using -mmedium-calls instead.
13610
13611 -mearly-cbranchsi
13612 Enable pre-reload use of the "cbranchsi" pattern.
13613
13614 -mexpand-adddi
13615 Expand "adddi3" and "subdi3" at RTL generation time into "add.f",
13616 "adc" etc. This option is deprecated.
13617
13618 -mindexed-loads
13619 Enable the use of indexed loads. This can be problematic because
13620 some optimizers then assume that indexed stores exist, which is not
13621 the case.
13622
13623 -mlra
13624 Enable Local Register Allocation. This is still experimental for
13625 ARC, so by default the compiler uses standard reload (i.e.
13626 -mno-lra).
13627
13628 -mlra-priority-none
13629 Don't indicate any priority for target registers.
13630
13631 -mlra-priority-compact
13632 Indicate target register priority for r0..r3 / r12..r15.
13633
13634 -mlra-priority-noncompact
13635 Reduce target register priority for r0..r3 / r12..r15.
13636
13637 -mno-millicode
13638 When optimizing for size (using -Os), prologues and epilogues that
13639 have to save or restore a large number of registers are often
13640 shortened by using call to a special function in libgcc; this is
13641 referred to as a millicode call. As these calls can pose
13642 performance issues, and/or cause linking issues when linking in a
13643 nonstandard way, this option is provided to turn off millicode call
13644 generation.
13645
13646 -mmixed-code
13647 Tweak register allocation to help 16-bit instruction generation.
13648 This generally has the effect of decreasing the average instruction
13649 size while increasing the instruction count.
13650
13651 -mq-class
13652 Enable q instruction alternatives. This is the default for -Os.
13653
13654 -mRcq
13655 Enable Rcq constraint handling. Most short code generation depends
13656 on this. This is the default.
13657
13658 -mRcw
13659 Enable Rcw constraint handling. Most ccfsm condexec mostly depends
13660 on this. This is the default.
13661
13662 -msize-level=level
13663 Fine-tune size optimization with regards to instruction lengths and
13664 alignment. The recognized values for level are:
13665
13666 0 No size optimization. This level is deprecated and treated
13667 like 1.
13668
13669 1 Short instructions are used opportunistically.
13670
13671 2 In addition, alignment of loops and of code after barriers are
13672 dropped.
13673
13674 3 In addition, optional data alignment is dropped, and the option
13675 Os is enabled.
13676
13677 This defaults to 3 when -Os is in effect. Otherwise, the behavior
13678 when this is not set is equivalent to level 1.
13679
13680 -mtune=cpu
13681 Set instruction scheduling parameters for cpu, overriding any
13682 implied by -mcpu=.
13683
13684 Supported values for cpu are
13685
13686 ARC600
13687 Tune for ARC600 CPU.
13688
13689 ARC601
13690 Tune for ARC601 CPU.
13691
13692 ARC700
13693 Tune for ARC700 CPU with standard multiplier block.
13694
13695 ARC700-xmac
13696 Tune for ARC700 CPU with XMAC block.
13697
13698 ARC725D
13699 Tune for ARC725D CPU.
13700
13701 ARC750D
13702 Tune for ARC750D CPU.
13703
13704 -mmultcost=num
13705 Cost to assume for a multiply instruction, with 4 being equal to a
13706 normal instruction.
13707
13708 -munalign-prob-threshold=probability
13709 Set probability threshold for unaligning branches. When tuning for
13710 ARC700 and optimizing for speed, branches without filled delay slot
13711 are preferably emitted unaligned and long, unless profiling
13712 indicates that the probability for the branch to be taken is below
13713 probability. The default is (REG_BR_PROB_BASE/2), i.e. 5000.
13714
13715 The following options are maintained for backward compatibility, but
13716 are now deprecated and will be removed in a future release:
13717
13718 -margonaut
13719 Obsolete FPX.
13720
13721 -mbig-endian
13722 -EB Compile code for big-endian targets. Use of these options is now
13723 deprecated. Big-endian code is supported by configuring GCC to
13724 build "arceb-elf32" and "arceb-linux-uclibc" targets, for which big
13725 endian is the default.
13726
13727 -mlittle-endian
13728 -EL Compile code for little-endian targets. Use of these options is
13729 now deprecated. Little-endian code is supported by configuring GCC
13730 to build "arc-elf32" and "arc-linux-uclibc" targets, for which
13731 little endian is the default.
13732
13733 -mbarrel_shifter
13734 Replaced by -mbarrel-shifter.
13735
13736 -mdpfp_compact
13737 Replaced by -mdpfp-compact.
13738
13739 -mdpfp_fast
13740 Replaced by -mdpfp-fast.
13741
13742 -mdsp_packa
13743 Replaced by -mdsp-packa.
13744
13745 -mEA
13746 Replaced by -mea.
13747
13748 -mmac_24
13749 Replaced by -mmac-24.
13750
13751 -mmac_d16
13752 Replaced by -mmac-d16.
13753
13754 -mspfp_compact
13755 Replaced by -mspfp-compact.
13756
13757 -mspfp_fast
13758 Replaced by -mspfp-fast.
13759
13760 -mtune=cpu
13761 Values arc600, arc601, arc700 and arc700-xmac for cpu are replaced
13762 by ARC600, ARC601, ARC700 and ARC700-xmac respectively.
13763
13764 -multcost=num
13765 Replaced by -mmultcost.
13766
13767 ARM Options
13768
13769 These -m options are defined for the ARM port:
13770
13771 -mabi=name
13772 Generate code for the specified ABI. Permissible values are: apcs-
13773 gnu, atpcs, aapcs, aapcs-linux and iwmmxt.
13774
13775 -mapcs-frame
13776 Generate a stack frame that is compliant with the ARM Procedure
13777 Call Standard for all functions, even if this is not strictly
13778 necessary for correct execution of the code. Specifying
13779 -fomit-frame-pointer with this option causes the stack frames not
13780 to be generated for leaf functions. The default is
13781 -mno-apcs-frame. This option is deprecated.
13782
13783 -mapcs
13784 This is a synonym for -mapcs-frame and is deprecated.
13785
13786 -mthumb-interwork
13787 Generate code that supports calling between the ARM and Thumb
13788 instruction sets. Without this option, on pre-v5 architectures,
13789 the two instruction sets cannot be reliably used inside one
13790 program. The default is -mno-thumb-interwork, since slightly
13791 larger code is generated when -mthumb-interwork is specified. In
13792 AAPCS configurations this option is meaningless.
13793
13794 -mno-sched-prolog
13795 Prevent the reordering of instructions in the function prologue, or
13796 the merging of those instruction with the instructions in the
13797 function's body. This means that all functions start with a
13798 recognizable set of instructions (or in fact one of a choice from a
13799 small set of different function prologues), and this information
13800 can be used to locate the start of functions inside an executable
13801 piece of code. The default is -msched-prolog.
13802
13803 -mfloat-abi=name
13804 Specifies which floating-point ABI to use. Permissible values are:
13805 soft, softfp and hard.
13806
13807 Specifying soft causes GCC to generate output containing library
13808 calls for floating-point operations. softfp allows the generation
13809 of code using hardware floating-point instructions, but still uses
13810 the soft-float calling conventions. hard allows generation of
13811 floating-point instructions and uses FPU-specific calling
13812 conventions.
13813
13814 The default depends on the specific target configuration. Note
13815 that the hard-float and soft-float ABIs are not link-compatible;
13816 you must compile your entire program with the same ABI, and link
13817 with a compatible set of libraries.
13818
13819 -mlittle-endian
13820 Generate code for a processor running in little-endian mode. This
13821 is the default for all standard configurations.
13822
13823 -mbig-endian
13824 Generate code for a processor running in big-endian mode; the
13825 default is to compile code for a little-endian processor.
13826
13827 -mbe8
13828 -mbe32
13829 When linking a big-endian image select between BE8 and BE32
13830 formats. The option has no effect for little-endian images and is
13831 ignored. The default is dependent on the selected target
13832 architecture. For ARMv6 and later architectures the default is
13833 BE8, for older architectures the default is BE32. BE32 format has
13834 been deprecated by ARM.
13835
13836 -march=name[+extension...]
13837 This specifies the name of the target ARM architecture. GCC uses
13838 this name to determine what kind of instructions it can emit when
13839 generating assembly code. This option can be used in conjunction
13840 with or instead of the -mcpu= option.
13841
13842 Permissible names are: armv4t, armv5t, armv5te, armv6, armv6j,
13843 armv6k, armv6kz, armv6t2, armv6z, armv6zk, armv7, armv7-a, armv7ve,
13844 armv8-a, armv8.1-a, armv8.2-a, armv8.3-a, armv8.4-a, armv7-r,
13845 armv8-r, armv6-m, armv6s-m, armv7-m, armv7e-m, armv8-m.base,
13846 armv8-m.main, iwmmxt and iwmmxt2.
13847
13848 Additionally, the following architectures, which lack support for
13849 the Thumb execution state, are recognized but support is
13850 deprecated: armv2, armv2a, armv3, armv3m, armv4, armv5 and armv5e.
13851
13852 Many of the architectures support extensions. These can be added
13853 by appending +extension to the architecture name. Extension
13854 options are processed in order and capabilities accumulate. An
13855 extension will also enable any necessary base extensions upon which
13856 it depends. For example, the +crypto extension will always enable
13857 the +simd extension. The exception to the additive construction is
13858 for extensions that are prefixed with +no...: these extensions
13859 disable the specified option and any other extensions that may
13860 depend on the presence of that extension.
13861
13862 For example, -march=armv7-a+simd+nofp+vfpv4 is equivalent to
13863 writing -march=armv7-a+vfpv4 since the +simd option is entirely
13864 disabled by the +nofp option that follows it.
13865
13866 Most extension names are generically named, but have an effect that
13867 is dependent upon the architecture to which it is applied. For
13868 example, the +simd option can be applied to both armv7-a and
13869 armv8-a architectures, but will enable the original ARMv7-A
13870 Advanced SIMD (Neon) extensions for armv7-a and the ARMv8-A variant
13871 for armv8-a.
13872
13873 The table below lists the supported extensions for each
13874 architecture. Architectures not mentioned do not support any
13875 extensions.
13876
13877 armv5e
13878 armv5te
13879 armv6
13880 armv6j
13881 armv6k
13882 armv6kz
13883 armv6t2
13884 armv6z
13885 armv6zk
13886 +fp The VFPv2 floating-point instructions. The extension
13887 +vfpv2 can be used as an alias for this extension.
13888
13889 +nofp
13890 Disable the floating-point instructions.
13891
13892 armv7
13893 The common subset of the ARMv7-A, ARMv7-R and ARMv7-M
13894 architectures.
13895
13896 +fp The VFPv3 floating-point instructions, with 16 double-
13897 precision registers. The extension +vfpv3-d16 can be used
13898 as an alias for this extension. Note that floating-point
13899 is not supported by the base ARMv7-M architecture, but is
13900 compatible with both the ARMv7-A and ARMv7-R architectures.
13901
13902 +nofp
13903 Disable the floating-point instructions.
13904
13905 armv7-a
13906 +fp The VFPv3 floating-point instructions, with 16 double-
13907 precision registers. The extension +vfpv3-d16 can be used
13908 as an alias for this extension.
13909
13910 +simd
13911 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point
13912 instructions. The extensions +neon and +neon-vfpv3 can be
13913 used as aliases for this extension.
13914
13915 +vfpv3
13916 The VFPv3 floating-point instructions, with 32 double-
13917 precision registers.
13918
13919 +vfpv3-d16-fp16
13920 The VFPv3 floating-point instructions, with 16 double-
13921 precision registers and the half-precision floating-point
13922 conversion operations.
13923
13924 +vfpv3-fp16
13925 The VFPv3 floating-point instructions, with 32 double-
13926 precision registers and the half-precision floating-point
13927 conversion operations.
13928
13929 +vfpv4-d16
13930 The VFPv4 floating-point instructions, with 16 double-
13931 precision registers.
13932
13933 +vfpv4
13934 The VFPv4 floating-point instructions, with 32 double-
13935 precision registers.
13936
13937 +neon-fp16
13938 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point
13939 instructions, with the half-precision floating-point
13940 conversion operations.
13941
13942 +neon-vfpv4
13943 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point
13944 instructions.
13945
13946 +nosimd
13947 Disable the Advanced SIMD instructions (does not disable
13948 floating point).
13949
13950 +nofp
13951 Disable the floating-point and Advanced SIMD instructions.
13952
13953 armv7ve
13954 The extended version of the ARMv7-A architecture with support
13955 for virtualization.
13956
13957 +fp The VFPv4 floating-point instructions, with 16 double-
13958 precision registers. The extension +vfpv4-d16 can be used
13959 as an alias for this extension.
13960
13961 +simd
13962 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point
13963 instructions. The extension +neon-vfpv4 can be used as an
13964 alias for this extension.
13965
13966 +vfpv3-d16
13967 The VFPv3 floating-point instructions, with 16 double-
13968 precision registers.
13969
13970 +vfpv3
13971 The VFPv3 floating-point instructions, with 32 double-
13972 precision registers.
13973
13974 +vfpv3-d16-fp16
13975 The VFPv3 floating-point instructions, with 16 double-
13976 precision registers and the half-precision floating-point
13977 conversion operations.
13978
13979 +vfpv3-fp16
13980 The VFPv3 floating-point instructions, with 32 double-
13981 precision registers and the half-precision floating-point
13982 conversion operations.
13983
13984 +vfpv4-d16
13985 The VFPv4 floating-point instructions, with 16 double-
13986 precision registers.
13987
13988 +vfpv4
13989 The VFPv4 floating-point instructions, with 32 double-
13990 precision registers.
13991
13992 +neon
13993 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point
13994 instructions. The extension +neon-vfpv3 can be used as an
13995 alias for this extension.
13996
13997 +neon-fp16
13998 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point
13999 instructions, with the half-precision floating-point
14000 conversion operations.
14001
14002 +nosimd
14003 Disable the Advanced SIMD instructions (does not disable
14004 floating point).
14005
14006 +nofp
14007 Disable the floating-point and Advanced SIMD instructions.
14008
14009 armv8-a
14010 +crc
14011 The Cyclic Redundancy Check (CRC) instructions.
14012
14013 +simd
14014 The ARMv8-A Advanced SIMD and floating-point instructions.
14015
14016 +crypto
14017 The cryptographic instructions.
14018
14019 +nocrypto
14020 Disable the cryptographic instructions.
14021
14022 +nofp
14023 Disable the floating-point, Advanced SIMD and cryptographic
14024 instructions.
14025
14026 armv8.1-a
14027 +simd
14028 The ARMv8.1-A Advanced SIMD and floating-point
14029 instructions.
14030
14031 +crypto
14032 The cryptographic instructions. This also enables the
14033 Advanced SIMD and floating-point instructions.
14034
14035 +nocrypto
14036 Disable the cryptographic instructions.
14037
14038 +nofp
14039 Disable the floating-point, Advanced SIMD and cryptographic
14040 instructions.
14041
14042 armv8.2-a
14043 armv8.3-a
14044 +fp16
14045 The half-precision floating-point data processing
14046 instructions. This also enables the Advanced SIMD and
14047 floating-point instructions.
14048
14049 +fp16fml
14050 The half-precision floating-point fmla extension. This
14051 also enables the half-precision floating-point extension
14052 and Advanced SIMD and floating-point instructions.
14053
14054 +simd
14055 The ARMv8.1-A Advanced SIMD and floating-point
14056 instructions.
14057
14058 +crypto
14059 The cryptographic instructions. This also enables the
14060 Advanced SIMD and floating-point instructions.
14061
14062 +dotprod
14063 Enable the Dot Product extension. This also enables
14064 Advanced SIMD instructions.
14065
14066 +nocrypto
14067 Disable the cryptographic extension.
14068
14069 +nofp
14070 Disable the floating-point, Advanced SIMD and cryptographic
14071 instructions.
14072
14073 armv8.4-a
14074 +fp16
14075 The half-precision floating-point data processing
14076 instructions. This also enables the Advanced SIMD and
14077 floating-point instructions as well as the Dot Product
14078 extension and the half-precision floating-point fmla
14079 extension.
14080
14081 +simd
14082 The ARMv8.3-A Advanced SIMD and floating-point instructions
14083 as well as the Dot Product extension.
14084
14085 +crypto
14086 The cryptographic instructions. This also enables the
14087 Advanced SIMD and floating-point instructions as well as
14088 the Dot Product extension.
14089
14090 +nocrypto
14091 Disable the cryptographic extension.
14092
14093 +nofp
14094 Disable the floating-point, Advanced SIMD and cryptographic
14095 instructions.
14096
14097 armv7-r
14098 +fp.sp
14099 The single-precision VFPv3 floating-point instructions.
14100 The extension +vfpv3xd can be used as an alias for this
14101 extension.
14102
14103 +fp The VFPv3 floating-point instructions with 16 double-
14104 precision registers. The extension +vfpv3-d16 can be used
14105 as an alias for this extension.
14106
14107 +nofp
14108 Disable the floating-point extension.
14109
14110 +idiv
14111 The ARM-state integer division instructions.
14112
14113 +noidiv
14114 Disable the ARM-state integer division extension.
14115
14116 armv7e-m
14117 +fp The single-precision VFPv4 floating-point instructions.
14118
14119 +fpv5
14120 The single-precision FPv5 floating-point instructions.
14121
14122 +fp.dp
14123 The single- and double-precision FPv5 floating-point
14124 instructions.
14125
14126 +nofp
14127 Disable the floating-point extensions.
14128
14129 armv8-m.main
14130 +dsp
14131 The DSP instructions.
14132
14133 +nodsp
14134 Disable the DSP extension.
14135
14136 +fp The single-precision floating-point instructions.
14137
14138 +fp.dp
14139 The single- and double-precision floating-point
14140 instructions.
14141
14142 +nofp
14143 Disable the floating-point extension.
14144
14145 armv8-r
14146 +crc
14147 The Cyclic Redundancy Check (CRC) instructions.
14148
14149 +fp.sp
14150 The single-precision FPv5 floating-point instructions.
14151
14152 +simd
14153 The ARMv8-A Advanced SIMD and floating-point instructions.
14154
14155 +crypto
14156 The cryptographic instructions.
14157
14158 +nocrypto
14159 Disable the cryptographic instructions.
14160
14161 +nofp
14162 Disable the floating-point, Advanced SIMD and cryptographic
14163 instructions.
14164
14165 -march=native causes the compiler to auto-detect the architecture
14166 of the build computer. At present, this feature is only supported
14167 on GNU/Linux, and not all architectures are recognized. If the
14168 auto-detect is unsuccessful the option has no effect.
14169
14170 -mtune=name
14171 This option specifies the name of the target ARM processor for
14172 which GCC should tune the performance of the code. For some ARM
14173 implementations better performance can be obtained by using this
14174 option. Permissible names are: arm2, arm250, arm3, arm6, arm60,
14175 arm600, arm610, arm620, arm7, arm7m, arm7d, arm7dm, arm7di,
14176 arm7dmi, arm70, arm700, arm700i, arm710, arm710c, arm7100, arm720,
14177 arm7500, arm7500fe, arm7tdmi, arm7tdmi-s, arm710t, arm720t,
14178 arm740t, strongarm, strongarm110, strongarm1100, strongarm1110,
14179 arm8, arm810, arm9, arm9e, arm920, arm920t, arm922t, arm946e-s,
14180 arm966e-s, arm968e-s, arm926ej-s, arm940t, arm9tdmi, arm10tdmi,
14181 arm1020t, arm1026ej-s, arm10e, arm1020e, arm1022e, arm1136j-s,
14182 arm1136jf-s, mpcore, mpcorenovfp, arm1156t2-s, arm1156t2f-s,
14183 arm1176jz-s, arm1176jzf-s, generic-armv7-a, cortex-a5, cortex-a7,
14184 cortex-a8, cortex-a9, cortex-a12, cortex-a15, cortex-a17,
14185 cortex-a32, cortex-a35, cortex-a53, cortex-a55, cortex-a57,
14186 cortex-a72, cortex-a73, cortex-a75, cortex-r4, cortex-r4f,
14187 cortex-r5, cortex-r7, cortex-r8, cortex-r52, cortex-m33,
14188 cortex-m23, cortex-m7, cortex-m4, cortex-m3, cortex-m1, cortex-m0,
14189 cortex-m0plus, cortex-m1.small-multiply, cortex-m0.small-multiply,
14190 cortex-m0plus.small-multiply, exynos-m1, marvell-pj4, xscale,
14191 iwmmxt, iwmmxt2, ep9312, fa526, fa626, fa606te, fa626te, fmp626,
14192 fa726te, xgene1.
14193
14194 Additionally, this option can specify that GCC should tune the
14195 performance of the code for a big.LITTLE system. Permissible names
14196 are: cortex-a15.cortex-a7, cortex-a17.cortex-a7,
14197 cortex-a57.cortex-a53, cortex-a72.cortex-a53,
14198 cortex-a72.cortex-a35, cortex-a73.cortex-a53,
14199 cortex-a75.cortex-a55.
14200
14201 -mtune=generic-arch specifies that GCC should tune the performance
14202 for a blend of processors within architecture arch. The aim is to
14203 generate code that run well on the current most popular processors,
14204 balancing between optimizations that benefit some CPUs in the
14205 range, and avoiding performance pitfalls of other CPUs. The
14206 effects of this option may change in future GCC versions as CPU
14207 models come and go.
14208
14209 -mtune permits the same extension options as -mcpu, but the
14210 extension options do not affect the tuning of the generated code.
14211
14212 -mtune=native causes the compiler to auto-detect the CPU of the
14213 build computer. At present, this feature is only supported on
14214 GNU/Linux, and not all architectures are recognized. If the auto-
14215 detect is unsuccessful the option has no effect.
14216
14217 -mcpu=name[+extension...]
14218 This specifies the name of the target ARM processor. GCC uses this
14219 name to derive the name of the target ARM architecture (as if
14220 specified by -march) and the ARM processor type for which to tune
14221 for performance (as if specified by -mtune). Where this option is
14222 used in conjunction with -march or -mtune, those options take
14223 precedence over the appropriate part of this option.
14224
14225 Many of the supported CPUs implement optional architectural
14226 extensions. Where this is so the architectural extensions are
14227 normally enabled by default. If implementations that lack the
14228 extension exist, then the extension syntax can be used to disable
14229 those extensions that have been omitted. For floating-point and
14230 Advanced SIMD (Neon) instructions, the settings of the options
14231 -mfloat-abi and -mfpu must also be considered: floating-point and
14232 Advanced SIMD instructions will only be used if -mfloat-abi is not
14233 set to soft; and any setting of -mfpu other than auto will override
14234 the available floating-point and SIMD extension instructions.
14235
14236 For example, cortex-a9 can be found in three major configurations:
14237 integer only, with just a floating-point unit or with floating-
14238 point and Advanced SIMD. The default is to enable all the
14239 instructions, but the extensions +nosimd and +nofp can be used to
14240 disable just the SIMD or both the SIMD and floating-point
14241 instructions respectively.
14242
14243 Permissible names for this option are the same as those for -mtune.
14244
14245 The following extension options are common to the listed CPUs:
14246
14247 +nodsp
14248 Disable the DSP instructions on cortex-m33.
14249
14250 +nofp
14251 Disables the floating-point instructions on arm9e, arm946e-s,
14252 arm966e-s, arm968e-s, arm10e, arm1020e, arm1022e, arm926ej-s,
14253 arm1026ej-s, cortex-r5, cortex-r7, cortex-r8, cortex-m4,
14254 cortex-m7 and cortex-m33. Disables the floating-point and SIMD
14255 instructions on generic-armv7-a, cortex-a5, cortex-a7,
14256 cortex-a8, cortex-a9, cortex-a12, cortex-a15, cortex-a17,
14257 cortex-a15.cortex-a7, cortex-a17.cortex-a7, cortex-a32,
14258 cortex-a35, cortex-a53 and cortex-a55.
14259
14260 +nofp.dp
14261 Disables the double-precision component of the floating-point
14262 instructions on cortex-r5, cortex-r52 and cortex-m7.
14263
14264 +nosimd
14265 Disables the SIMD (but not floating-point) instructions on
14266 generic-armv7-a, cortex-a5, cortex-a7 and cortex-a9.
14267
14268 +crypto
14269 Enables the cryptographic instructions on cortex-a32,
14270 cortex-a35, cortex-a53, cortex-a55, cortex-a57, cortex-a72,
14271 cortex-a73, cortex-a75, exynos-m1, xgene1,
14272 cortex-a57.cortex-a53, cortex-a72.cortex-a53,
14273 cortex-a73.cortex-a35, cortex-a73.cortex-a53 and
14274 cortex-a75.cortex-a55.
14275
14276 Additionally the generic-armv7-a pseudo target defaults to VFPv3
14277 with 16 double-precision registers. It supports the following
14278 extension options: vfpv3-d16, vfpv3, vfpv3-d16-fp16, vfpv3-fp16,
14279 vfpv4-d16, vfpv4, neon, neon-vfpv3, neon-fp16, neon-vfpv4. The
14280 meanings are the same as for the extensions to -march=armv7-a.
14281
14282 -mcpu=generic-arch is also permissible, and is equivalent to
14283 -march=arch -mtune=generic-arch. See -mtune for more information.
14284
14285 -mcpu=native causes the compiler to auto-detect the CPU of the
14286 build computer. At present, this feature is only supported on
14287 GNU/Linux, and not all architectures are recognized. If the auto-
14288 detect is unsuccessful the option has no effect.
14289
14290 -mfpu=name
14291 This specifies what floating-point hardware (or hardware emulation)
14292 is available on the target. Permissible names are: auto, vfpv2,
14293 vfpv3, vfpv3-fp16, vfpv3-d16, vfpv3-d16-fp16, vfpv3xd,
14294 vfpv3xd-fp16, neon-vfpv3, neon-fp16, vfpv4, vfpv4-d16, fpv4-sp-d16,
14295 neon-vfpv4, fpv5-d16, fpv5-sp-d16, fp-armv8, neon-fp-armv8 and
14296 crypto-neon-fp-armv8. Note that neon is an alias for neon-vfpv3
14297 and vfp is an alias for vfpv2.
14298
14299 The setting auto is the default and is special. It causes the
14300 compiler to select the floating-point and Advanced SIMD
14301 instructions based on the settings of -mcpu and -march.
14302
14303 If the selected floating-point hardware includes the NEON extension
14304 (e.g. -mfpu=neon), note that floating-point operations are not
14305 generated by GCC's auto-vectorization pass unless
14306 -funsafe-math-optimizations is also specified. This is because
14307 NEON hardware does not fully implement the IEEE 754 standard for
14308 floating-point arithmetic (in particular denormal values are
14309 treated as zero), so the use of NEON instructions may lead to a
14310 loss of precision.
14311
14312 You can also set the fpu name at function level by using the
14313 "target("fpu=")" function attributes or pragmas.
14314
14315 -mfp16-format=name
14316 Specify the format of the "__fp16" half-precision floating-point
14317 type. Permissible names are none, ieee, and alternative; the
14318 default is none, in which case the "__fp16" type is not defined.
14319
14320 -mstructure-size-boundary=n
14321 The sizes of all structures and unions are rounded up to a multiple
14322 of the number of bits set by this option. Permissible values are
14323 8, 32 and 64. The default value varies for different toolchains.
14324 For the COFF targeted toolchain the default value is 8. A value of
14325 64 is only allowed if the underlying ABI supports it.
14326
14327 Specifying a larger number can produce faster, more efficient code,
14328 but can also increase the size of the program. Different values
14329 are potentially incompatible. Code compiled with one value cannot
14330 necessarily expect to work with code or libraries compiled with
14331 another value, if they exchange information using structures or
14332 unions.
14333
14334 This option is deprecated.
14335
14336 -mabort-on-noreturn
14337 Generate a call to the function "abort" at the end of a "noreturn"
14338 function. It is executed if the function tries to return.
14339
14340 -mlong-calls
14341 -mno-long-calls
14342 Tells the compiler to perform function calls by first loading the
14343 address of the function into a register and then performing a
14344 subroutine call on this register. This switch is needed if the
14345 target function lies outside of the 64-megabyte addressing range of
14346 the offset-based version of subroutine call instruction.
14347
14348 Even if this switch is enabled, not all function calls are turned
14349 into long calls. The heuristic is that static functions, functions
14350 that have the "short_call" attribute, functions that are inside the
14351 scope of a "#pragma no_long_calls" directive, and functions whose
14352 definitions have already been compiled within the current
14353 compilation unit are not turned into long calls. The exceptions to
14354 this rule are that weak function definitions, functions with the
14355 "long_call" attribute or the "section" attribute, and functions
14356 that are within the scope of a "#pragma long_calls" directive are
14357 always turned into long calls.
14358
14359 This feature is not enabled by default. Specifying -mno-long-calls
14360 restores the default behavior, as does placing the function calls
14361 within the scope of a "#pragma long_calls_off" directive. Note
14362 these switches have no effect on how the compiler generates code to
14363 handle function calls via function pointers.
14364
14365 -msingle-pic-base
14366 Treat the register used for PIC addressing as read-only, rather
14367 than loading it in the prologue for each function. The runtime
14368 system is responsible for initializing this register with an
14369 appropriate value before execution begins.
14370
14371 -mpic-register=reg
14372 Specify the register to be used for PIC addressing. For standard
14373 PIC base case, the default is any suitable register determined by
14374 compiler. For single PIC base case, the default is R9 if target is
14375 EABI based or stack-checking is enabled, otherwise the default is
14376 R10.
14377
14378 -mpic-data-is-text-relative
14379 Assume that the displacement between the text and data segments is
14380 fixed at static link time. This permits using PC-relative
14381 addressing operations to access data known to be in the data
14382 segment. For non-VxWorks RTP targets, this option is enabled by
14383 default. When disabled on such targets, it will enable
14384 -msingle-pic-base by default.
14385
14386 -mpoke-function-name
14387 Write the name of each function into the text section, directly
14388 preceding the function prologue. The generated code is similar to
14389 this:
14390
14391 t0
14392 .ascii "arm_poke_function_name", 0
14393 .align
14394 t1
14395 .word 0xff000000 + (t1 - t0)
14396 arm_poke_function_name
14397 mov ip, sp
14398 stmfd sp!, {fp, ip, lr, pc}
14399 sub fp, ip, #4
14400
14401 When performing a stack backtrace, code can inspect the value of
14402 "pc" stored at "fp + 0". If the trace function then looks at
14403 location "pc - 12" and the top 8 bits are set, then we know that
14404 there is a function name embedded immediately preceding this
14405 location and has length "((pc[-3]) & 0xff000000)".
14406
14407 -mthumb
14408 -marm
14409 Select between generating code that executes in ARM and Thumb
14410 states. The default for most configurations is to generate code
14411 that executes in ARM state, but the default can be changed by
14412 configuring GCC with the --with-mode=state configure option.
14413
14414 You can also override the ARM and Thumb mode for each function by
14415 using the "target("thumb")" and "target("arm")" function attributes
14416 or pragmas.
14417
14418 -mflip-thumb
14419 Switch ARM/Thumb modes on alternating functions. This option is
14420 provided for regression testing of mixed Thumb/ARM code generation,
14421 and is not intended for ordinary use in compiling code.
14422
14423 -mtpcs-frame
14424 Generate a stack frame that is compliant with the Thumb Procedure
14425 Call Standard for all non-leaf functions. (A leaf function is one
14426 that does not call any other functions.) The default is
14427 -mno-tpcs-frame.
14428
14429 -mtpcs-leaf-frame
14430 Generate a stack frame that is compliant with the Thumb Procedure
14431 Call Standard for all leaf functions. (A leaf function is one that
14432 does not call any other functions.) The default is
14433 -mno-apcs-leaf-frame.
14434
14435 -mcallee-super-interworking
14436 Gives all externally visible functions in the file being compiled
14437 an ARM instruction set header which switches to Thumb mode before
14438 executing the rest of the function. This allows these functions to
14439 be called from non-interworking code. This option is not valid in
14440 AAPCS configurations because interworking is enabled by default.
14441
14442 -mcaller-super-interworking
14443 Allows calls via function pointers (including virtual functions) to
14444 execute correctly regardless of whether the target code has been
14445 compiled for interworking or not. There is a small overhead in the
14446 cost of executing a function pointer if this option is enabled.
14447 This option is not valid in AAPCS configurations because
14448 interworking is enabled by default.
14449
14450 -mtp=name
14451 Specify the access model for the thread local storage pointer. The
14452 valid models are soft, which generates calls to "__aeabi_read_tp",
14453 cp15, which fetches the thread pointer from "cp15" directly
14454 (supported in the arm6k architecture), and auto, which uses the
14455 best available method for the selected processor. The default
14456 setting is auto.
14457
14458 -mtls-dialect=dialect
14459 Specify the dialect to use for accessing thread local storage. Two
14460 dialects are supported---gnu and gnu2. The gnu dialect selects the
14461 original GNU scheme for supporting local and global dynamic TLS
14462 models. The gnu2 dialect selects the GNU descriptor scheme, which
14463 provides better performance for shared libraries. The GNU
14464 descriptor scheme is compatible with the original scheme, but does
14465 require new assembler, linker and library support. Initial and
14466 local exec TLS models are unaffected by this option and always use
14467 the original scheme.
14468
14469 -mword-relocations
14470 Only generate absolute relocations on word-sized values (i.e.
14471 R_ARM_ABS32). This is enabled by default on targets (uClinux,
14472 SymbianOS) where the runtime loader imposes this restriction, and
14473 when -fpic or -fPIC is specified.
14474
14475 -mfix-cortex-m3-ldrd
14476 Some Cortex-M3 cores can cause data corruption when "ldrd"
14477 instructions with overlapping destination and base registers are
14478 used. This option avoids generating these instructions. This
14479 option is enabled by default when -mcpu=cortex-m3 is specified.
14480
14481 -munaligned-access
14482 -mno-unaligned-access
14483 Enables (or disables) reading and writing of 16- and 32- bit values
14484 from addresses that are not 16- or 32- bit aligned. By default
14485 unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
14486 ARMv8-M Baseline architectures, and enabled for all other
14487 architectures. If unaligned access is not enabled then words in
14488 packed data structures are accessed a byte at a time.
14489
14490 The ARM attribute "Tag_CPU_unaligned_access" is set in the
14491 generated object file to either true or false, depending upon the
14492 setting of this option. If unaligned access is enabled then the
14493 preprocessor symbol "__ARM_FEATURE_UNALIGNED" is also defined.
14494
14495 -mneon-for-64bits
14496 Enables using Neon to handle scalar 64-bits operations. This is
14497 disabled by default since the cost of moving data from core
14498 registers to Neon is high.
14499
14500 -mslow-flash-data
14501 Assume loading data from flash is slower than fetching instruction.
14502 Therefore literal load is minimized for better performance. This
14503 option is only supported when compiling for ARMv7 M-profile and off
14504 by default.
14505
14506 -masm-syntax-unified
14507 Assume inline assembler is using unified asm syntax. The default
14508 is currently off which implies divided syntax. This option has no
14509 impact on Thumb2. However, this may change in future releases of
14510 GCC. Divided syntax should be considered deprecated.
14511
14512 -mrestrict-it
14513 Restricts generation of IT blocks to conform to the rules of
14514 ARMv8-A. IT blocks can only contain a single 16-bit instruction
14515 from a select set of instructions. This option is on by default for
14516 ARMv8-A Thumb mode.
14517
14518 -mprint-tune-info
14519 Print CPU tuning information as comment in assembler file. This is
14520 an option used only for regression testing of the compiler and not
14521 intended for ordinary use in compiling code. This option is
14522 disabled by default.
14523
14524 -mverbose-cost-dump
14525 Enable verbose cost model dumping in the debug dump files. This
14526 option is provided for use in debugging the compiler.
14527
14528 -mpure-code
14529 Do not allow constant data to be placed in code sections.
14530 Additionally, when compiling for ELF object format give all text
14531 sections the ELF processor-specific section attribute
14532 "SHF_ARM_PURECODE". This option is only available when generating
14533 non-pic code for M-profile targets with the MOVT instruction.
14534
14535 -mcmse
14536 Generate secure code as per the "ARMv8-M Security Extensions:
14537 Requirements on Development Tools Engineering Specification", which
14538 can be found on
14539 <http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf>.
14540
14541 AVR Options
14542
14543 These options are defined for AVR implementations:
14544
14545 -mmcu=mcu
14546 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
14547
14548 The default for this option is@tie{}avr2.
14549
14550 GCC supports the following AVR devices and ISAs:
14551
14552 "avr2"
14553 "Classic" devices with up to 8@tie{}KiB of program memory.
14554 mcu@tie{}= "attiny22", "attiny26", "at90c8534", "at90s2313",
14555 "at90s2323", "at90s2333", "at90s2343", "at90s4414",
14556 "at90s4433", "at90s4434", "at90s8515", "at90s8535".
14557
14558 "avr25"
14559 "Classic" devices with up to 8@tie{}KiB of program memory and
14560 with the "MOVW" instruction. mcu@tie{}= "ata5272", "ata6616c",
14561 "attiny13", "attiny13a", "attiny2313", "attiny2313a",
14562 "attiny24", "attiny24a", "attiny25", "attiny261", "attiny261a",
14563 "attiny43u", "attiny4313", "attiny44", "attiny44a",
14564 "attiny441", "attiny45", "attiny461", "attiny461a", "attiny48",
14565 "attiny828", "attiny84", "attiny84a", "attiny841", "attiny85",
14566 "attiny861", "attiny861a", "attiny87", "attiny88", "at86rf401".
14567
14568 "avr3"
14569 "Classic" devices with 16@tie{}KiB up to 64@tie{}KiB of
14570 program memory. mcu@tie{}= "at43usb355", "at76c711".
14571
14572 "avr31"
14573 "Classic" devices with 128@tie{}KiB of program memory.
14574 mcu@tie{}= "atmega103", "at43usb320".
14575
14576 "avr35"
14577 "Classic" devices with 16@tie{}KiB up to 64@tie{}KiB of program
14578 memory and with the "MOVW" instruction. mcu@tie{}= "ata5505",
14579 "ata6617c", "ata664251", "atmega16u2", "atmega32u2",
14580 "atmega8u2", "attiny1634", "attiny167", "at90usb162",
14581 "at90usb82".
14582
14583 "avr4"
14584 "Enhanced" devices with up to 8@tie{}KiB of program memory.
14585 mcu@tie{}= "ata6285", "ata6286", "ata6289", "ata6612c",
14586 "atmega48", "atmega48a", "atmega48p", "atmega48pa",
14587 "atmega48pb", "atmega8", "atmega8a", "atmega8hva",
14588 "atmega8515", "atmega8535", "atmega88", "atmega88a",
14589 "atmega88p", "atmega88pa", "atmega88pb", "at90pwm1",
14590 "at90pwm2", "at90pwm2b", "at90pwm3", "at90pwm3b", "at90pwm81".
14591
14592 "avr5"
14593 "Enhanced" devices with 16@tie{}KiB up to 64@tie{}KiB of
14594 program memory. mcu@tie{}= "ata5702m322", "ata5782",
14595 "ata5790", "ata5790n", "ata5791", "ata5795", "ata5831",
14596 "ata6613c", "ata6614q", "ata8210", "ata8510", "atmega16",
14597 "atmega16a", "atmega16hva", "atmega16hva2", "atmega16hvb",
14598 "atmega16hvbrevb", "atmega16m1", "atmega16u4", "atmega161",
14599 "atmega162", "atmega163", "atmega164a", "atmega164p",
14600 "atmega164pa", "atmega165", "atmega165a", "atmega165p",
14601 "atmega165pa", "atmega168", "atmega168a", "atmega168p",
14602 "atmega168pa", "atmega168pb", "atmega169", "atmega169a",
14603 "atmega169p", "atmega169pa", "atmega32", "atmega32a",
14604 "atmega32c1", "atmega32hvb", "atmega32hvbrevb", "atmega32m1",
14605 "atmega32u4", "atmega32u6", "atmega323", "atmega324a",
14606 "atmega324p", "atmega324pa", "atmega325", "atmega325a",
14607 "atmega325p", "atmega325pa", "atmega3250", "atmega3250a",
14608 "atmega3250p", "atmega3250pa", "atmega328", "atmega328p",
14609 "atmega328pb", "atmega329", "atmega329a", "atmega329p",
14610 "atmega329pa", "atmega3290", "atmega3290a", "atmega3290p",
14611 "atmega3290pa", "atmega406", "atmega64", "atmega64a",
14612 "atmega64c1", "atmega64hve", "atmega64hve2", "atmega64m1",
14613 "atmega64rfr2", "atmega640", "atmega644", "atmega644a",
14614 "atmega644p", "atmega644pa", "atmega644rfr2", "atmega645",
14615 "atmega645a", "atmega645p", "atmega6450", "atmega6450a",
14616 "atmega6450p", "atmega649", "atmega649a", "atmega649p",
14617 "atmega6490", "atmega6490a", "atmega6490p", "at90can32",
14618 "at90can64", "at90pwm161", "at90pwm216", "at90pwm316",
14619 "at90scr100", "at90usb646", "at90usb647", "at94k", "m3000".
14620
14621 "avr51"
14622 "Enhanced" devices with 128@tie{}KiB of program memory.
14623 mcu@tie{}= "atmega128", "atmega128a", "atmega128rfa1",
14624 "atmega128rfr2", "atmega1280", "atmega1281", "atmega1284",
14625 "atmega1284p", "atmega1284rfr2", "at90can128", "at90usb1286",
14626 "at90usb1287".
14627
14628 "avr6"
14629 "Enhanced" devices with 3-byte PC, i.e. with more than
14630 128@tie{}KiB of program memory. mcu@tie{}= "atmega256rfr2",
14631 "atmega2560", "atmega2561", "atmega2564rfr2".
14632
14633 "avrxmega2"
14634 "XMEGA" devices with more than 8@tie{}KiB and up to 64@tie{}KiB
14635 of program memory. mcu@tie{}= "atxmega16a4", "atxmega16a4u",
14636 "atxmega16c4", "atxmega16d4", "atxmega16e5", "atxmega32a4",
14637 "atxmega32a4u", "atxmega32c3", "atxmega32c4", "atxmega32d3",
14638 "atxmega32d4", "atxmega32e5", "atxmega8e5".
14639
14640 "avrxmega3"
14641 "XMEGA" devices with up to 64@tie{}KiB of combined program
14642 memory and RAM, and with program memory visible in the RAM
14643 address space. mcu@tie{}= "attiny1614", "attiny1616",
14644 "attiny1617", "attiny212", "attiny214", "attiny3214",
14645 "attiny3216", "attiny3217", "attiny412", "attiny414",
14646 "attiny416", "attiny417", "attiny814", "attiny816",
14647 "attiny817".
14648
14649 "avrxmega4"
14650 "XMEGA" devices with more than 64@tie{}KiB and up to
14651 128@tie{}KiB of program memory. mcu@tie{}= "atxmega64a3",
14652 "atxmega64a3u", "atxmega64a4u", "atxmega64b1", "atxmega64b3",
14653 "atxmega64c3", "atxmega64d3", "atxmega64d4".
14654
14655 "avrxmega5"
14656 "XMEGA" devices with more than 64@tie{}KiB and up to
14657 128@tie{}KiB of program memory and more than 64@tie{}KiB of
14658 RAM. mcu@tie{}= "atxmega64a1", "atxmega64a1u".
14659
14660 "avrxmega6"
14661 "XMEGA" devices with more than 128@tie{}KiB of program memory.
14662 mcu@tie{}= "atxmega128a3", "atxmega128a3u", "atxmega128b1",
14663 "atxmega128b3", "atxmega128c3", "atxmega128d3", "atxmega128d4",
14664 "atxmega192a3", "atxmega192a3u", "atxmega192c3",
14665 "atxmega192d3", "atxmega256a3", "atxmega256a3b",
14666 "atxmega256a3bu", "atxmega256a3u", "atxmega256c3",
14667 "atxmega256d3", "atxmega384c3", "atxmega384d3".
14668
14669 "avrxmega7"
14670 "XMEGA" devices with more than 128@tie{}KiB of program memory
14671 and more than 64@tie{}KiB of RAM. mcu@tie{}= "atxmega128a1",
14672 "atxmega128a1u", "atxmega128a4u".
14673
14674 "avrtiny"
14675 "TINY" Tiny core devices with 512@tie{}B up to 4@tie{}KiB of
14676 program memory. mcu@tie{}= "attiny10", "attiny20", "attiny4",
14677 "attiny40", "attiny5", "attiny9".
14678
14679 "avr1"
14680 This ISA is implemented by the minimal AVR core and supported
14681 for assembler only. mcu@tie{}= "attiny11", "attiny12",
14682 "attiny15", "attiny28", "at90s1200".
14683
14684 -mabsdata
14685 Assume that all data in static storage can be accessed by LDS / STS
14686 instructions. This option has only an effect on reduced Tiny
14687 devices like ATtiny40. See also the "absdata" AVR Variable
14688 Attributes,variable attribute.
14689
14690 -maccumulate-args
14691 Accumulate outgoing function arguments and acquire/release the
14692 needed stack space for outgoing function arguments once in function
14693 prologue/epilogue. Without this option, outgoing arguments are
14694 pushed before calling a function and popped afterwards.
14695
14696 Popping the arguments after the function call can be expensive on
14697 AVR so that accumulating the stack space might lead to smaller
14698 executables because arguments need not be removed from the stack
14699 after such a function call.
14700
14701 This option can lead to reduced code size for functions that
14702 perform several calls to functions that get their arguments on the
14703 stack like calls to printf-like functions.
14704
14705 -mbranch-cost=cost
14706 Set the branch costs for conditional branch instructions to cost.
14707 Reasonable values for cost are small, non-negative integers. The
14708 default branch cost is 0.
14709
14710 -mcall-prologues
14711 Functions prologues/epilogues are expanded as calls to appropriate
14712 subroutines. Code size is smaller.
14713
14714 -mgas-isr-prologues
14715 Interrupt service routines (ISRs) may use the "__gcc_isr" pseudo
14716 instruction supported by GNU Binutils. If this option is on, the
14717 feature can still be disabled for individual ISRs by means of the
14718 AVR Function Attributes,,"no_gccisr" function attribute. This
14719 feature is activated per default if optimization is on (but not
14720 with -Og, @pxref{Optimize Options}), and if GNU Binutils support
14721 PR21683 ("https://sourceware.org/PR21683").
14722
14723 -mint8
14724 Assume "int" to be 8-bit integer. This affects the sizes of all
14725 types: a "char" is 1 byte, an "int" is 1 byte, a "long" is 2 bytes,
14726 and "long long" is 4 bytes. Please note that this option does not
14727 conform to the C standards, but it results in smaller code size.
14728
14729 -mmain-is-OS_task
14730 Do not save registers in "main". The effect is the same like
14731 attaching attribute AVR Function Attributes,,"OS_task" to "main".
14732 It is activated per default if optimization is on.
14733
14734 -mn-flash=num
14735 Assume that the flash memory has a size of num times 64@tie{}KiB.
14736
14737 -mno-interrupts
14738 Generated code is not compatible with hardware interrupts. Code
14739 size is smaller.
14740
14741 -mrelax
14742 Try to replace "CALL" resp. "JMP" instruction by the shorter
14743 "RCALL" resp. "RJMP" instruction if applicable. Setting -mrelax
14744 just adds the --mlink-relax option to the assembler's command line
14745 and the --relax option to the linker's command line.
14746
14747 Jump relaxing is performed by the linker because jump offsets are
14748 not known before code is located. Therefore, the assembler code
14749 generated by the compiler is the same, but the instructions in the
14750 executable may differ from instructions in the assembler code.
14751
14752 Relaxing must be turned on if linker stubs are needed, see the
14753 section on "EIND" and linker stubs below.
14754
14755 -mrmw
14756 Assume that the device supports the Read-Modify-Write instructions
14757 "XCH", "LAC", "LAS" and "LAT".
14758
14759 -mshort-calls
14760 Assume that "RJMP" and "RCALL" can target the whole program memory.
14761
14762 This option is used internally for multilib selection. It is not
14763 an optimization option, and you don't need to set it by hand.
14764
14765 -msp8
14766 Treat the stack pointer register as an 8-bit register, i.e. assume
14767 the high byte of the stack pointer is zero. In general, you don't
14768 need to set this option by hand.
14769
14770 This option is used internally by the compiler to select and build
14771 multilibs for architectures "avr2" and "avr25". These
14772 architectures mix devices with and without "SPH". For any setting
14773 other than -mmcu=avr2 or -mmcu=avr25 the compiler driver adds or
14774 removes this option from the compiler proper's command line,
14775 because the compiler then knows if the device or architecture has
14776 an 8-bit stack pointer and thus no "SPH" register or not.
14777
14778 -mstrict-X
14779 Use address register "X" in a way proposed by the hardware. This
14780 means that "X" is only used in indirect, post-increment or pre-
14781 decrement addressing.
14782
14783 Without this option, the "X" register may be used in the same way
14784 as "Y" or "Z" which then is emulated by additional instructions.
14785 For example, loading a value with "X+const" addressing with a small
14786 non-negative "const < 64" to a register Rn is performed as
14787
14788 adiw r26, const ; X += const
14789 ld <Rn>, X ; <Rn> = *X
14790 sbiw r26, const ; X -= const
14791
14792 -mtiny-stack
14793 Only change the lower 8@tie{}bits of the stack pointer.
14794
14795 -mfract-convert-truncate
14796 Allow to use truncation instead of rounding towards zero for
14797 fractional fixed-point types.
14798
14799 -nodevicelib
14800 Don't link against AVR-LibC's device specific library "lib<mcu>.a".
14801
14802 -Waddr-space-convert
14803 Warn about conversions between address spaces in the case where the
14804 resulting address space is not contained in the incoming address
14805 space.
14806
14807 -Wmisspelled-isr
14808 Warn if the ISR is misspelled, i.e. without __vector prefix.
14809 Enabled by default.
14810
14811 "EIND" and Devices with More Than 128 Ki Bytes of Flash
14812
14813 Pointers in the implementation are 16@tie{}bits wide. The address of a
14814 function or label is represented as word address so that indirect jumps
14815 and calls can target any code address in the range of 64@tie{}Ki words.
14816
14817 In order to facilitate indirect jump on devices with more than
14818 128@tie{}Ki bytes of program memory space, there is a special function
14819 register called "EIND" that serves as most significant part of the
14820 target address when "EICALL" or "EIJMP" instructions are used.
14821
14822 Indirect jumps and calls on these devices are handled as follows by the
14823 compiler and are subject to some limitations:
14824
14825 * The compiler never sets "EIND".
14826
14827 * The compiler uses "EIND" implicitly in "EICALL"/"EIJMP"
14828 instructions or might read "EIND" directly in order to emulate an
14829 indirect call/jump by means of a "RET" instruction.
14830
14831 * The compiler assumes that "EIND" never changes during the startup
14832 code or during the application. In particular, "EIND" is not
14833 saved/restored in function or interrupt service routine
14834 prologue/epilogue.
14835
14836 * For indirect calls to functions and computed goto, the linker
14837 generates stubs. Stubs are jump pads sometimes also called
14838 trampolines. Thus, the indirect call/jump jumps to such a stub.
14839 The stub contains a direct jump to the desired address.
14840
14841 * Linker relaxation must be turned on so that the linker generates
14842 the stubs correctly in all situations. See the compiler option
14843 -mrelax and the linker option --relax. There are corner cases
14844 where the linker is supposed to generate stubs but aborts without
14845 relaxation and without a helpful error message.
14846
14847 * The default linker script is arranged for code with "EIND = 0". If
14848 code is supposed to work for a setup with "EIND != 0", a custom
14849 linker script has to be used in order to place the sections whose
14850 name start with ".trampolines" into the segment where "EIND" points
14851 to.
14852
14853 * The startup code from libgcc never sets "EIND". Notice that
14854 startup code is a blend of code from libgcc and AVR-LibC. For the
14855 impact of AVR-LibC on "EIND", see the AVR-LibC user manual
14856 ("http://nongnu.org/avr-libc/user-manual/").
14857
14858 * It is legitimate for user-specific startup code to set up "EIND"
14859 early, for example by means of initialization code located in
14860 section ".init3". Such code runs prior to general startup code that
14861 initializes RAM and calls constructors, but after the bit of
14862 startup code from AVR-LibC that sets "EIND" to the segment where
14863 the vector table is located.
14864
14865 #include <avr/io.h>
14866
14867 static void
14868 __attribute__((section(".init3"),naked,used,no_instrument_function))
14869 init3_set_eind (void)
14870 {
14871 __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
14872 "out %i0,r24" :: "n" (&EIND) : "r24","memory");
14873 }
14874
14875 The "__trampolines_start" symbol is defined in the linker script.
14876
14877 * Stubs are generated automatically by the linker if the following
14878 two conditions are met:
14879
14880 -<The address of a label is taken by means of the "gs" modifier>
14881 (short for generate stubs) like so:
14882
14883 LDI r24, lo8(gs(<func>))
14884 LDI r25, hi8(gs(<func>))
14885
14886 -<The final location of that label is in a code segment>
14887 outside the segment where the stubs are located.
14888
14889 * The compiler emits such "gs" modifiers for code labels in the
14890 following situations:
14891
14892 -<Taking address of a function or code label.>
14893 -<Computed goto.>
14894 -<If prologue-save function is used, see -mcall-prologues>
14895 command-line option.
14896
14897 -<Switch/case dispatch tables. If you do not want such dispatch>
14898 tables you can specify the -fno-jump-tables command-line
14899 option.
14900
14901 -<C and C++ constructors/destructors called during
14902 startup/shutdown.>
14903 -<If the tools hit a "gs()" modifier explained above.>
14904 * Jumping to non-symbolic addresses like so is not supported:
14905
14906 int main (void)
14907 {
14908 /* Call function at word address 0x2 */
14909 return ((int(*)(void)) 0x2)();
14910 }
14911
14912 Instead, a stub has to be set up, i.e. the function has to be
14913 called through a symbol ("func_4" in the example):
14914
14915 int main (void)
14916 {
14917 extern int func_4 (void);
14918
14919 /* Call function at byte address 0x4 */
14920 return func_4();
14921 }
14922
14923 and the application be linked with -Wl,--defsym,func_4=0x4.
14924 Alternatively, "func_4" can be defined in the linker script.
14925
14926 Handling of the "RAMPD", "RAMPX", "RAMPY" and "RAMPZ" Special Function
14927 Registers
14928
14929 Some AVR devices support memories larger than the 64@tie{}KiB range
14930 that can be accessed with 16-bit pointers. To access memory locations
14931 outside this 64@tie{}KiB range, the content of a "RAMP" register is
14932 used as high part of the address: The "X", "Y", "Z" address register is
14933 concatenated with the "RAMPX", "RAMPY", "RAMPZ" special function
14934 register, respectively, to get a wide address. Similarly, "RAMPD" is
14935 used together with direct addressing.
14936
14937 * The startup code initializes the "RAMP" special function registers
14938 with zero.
14939
14940 * If a AVR Named Address Spaces,named address space other than
14941 generic or "__flash" is used, then "RAMPZ" is set as needed before
14942 the operation.
14943
14944 * If the device supports RAM larger than 64@tie{}KiB and the compiler
14945 needs to change "RAMPZ" to accomplish an operation, "RAMPZ" is
14946 reset to zero after the operation.
14947
14948 * If the device comes with a specific "RAMP" register, the ISR
14949 prologue/epilogue saves/restores that SFR and initializes it with
14950 zero in case the ISR code might (implicitly) use it.
14951
14952 * RAM larger than 64@tie{}KiB is not supported by GCC for AVR
14953 targets. If you use inline assembler to read from locations
14954 outside the 16-bit address range and change one of the "RAMP"
14955 registers, you must reset it to zero after the access.
14956
14957 AVR Built-in Macros
14958
14959 GCC defines several built-in macros so that the user code can test for
14960 the presence or absence of features. Almost any of the following
14961 built-in macros are deduced from device capabilities and thus triggered
14962 by the -mmcu= command-line option.
14963
14964 For even more AVR-specific built-in macros see AVR Named Address Spaces
14965 and AVR Built-in Functions.
14966
14967 "__AVR_ARCH__"
14968 Build-in macro that resolves to a decimal number that identifies
14969 the architecture and depends on the -mmcu=mcu option. Possible
14970 values are:
14971
14972 2, 25, 3, 31, 35, 4, 5, 51, 6
14973
14974 for mcu="avr2", "avr25", "avr3", "avr31", "avr35", "avr4", "avr5",
14975 "avr51", "avr6",
14976
14977 respectively and
14978
14979 100, 102, 103, 104, 105, 106, 107
14980
14981 for mcu="avrtiny", "avrxmega2", "avrxmega3", "avrxmega4",
14982 "avrxmega5", "avrxmega6", "avrxmega7", respectively. If mcu
14983 specifies a device, this built-in macro is set accordingly. For
14984 example, with -mmcu=atmega8 the macro is defined to 4.
14985
14986 "__AVR_Device__"
14987 Setting -mmcu=device defines this built-in macro which reflects the
14988 device's name. For example, -mmcu=atmega8 defines the built-in
14989 macro "__AVR_ATmega8__", -mmcu=attiny261a defines
14990 "__AVR_ATtiny261A__", etc.
14991
14992 The built-in macros' names follow the scheme "__AVR_Device__" where
14993 Device is the device name as from the AVR user manual. The
14994 difference between Device in the built-in macro and device in
14995 -mmcu=device is that the latter is always lowercase.
14996
14997 If device is not a device but only a core architecture like avr51,
14998 this macro is not defined.
14999
15000 "__AVR_DEVICE_NAME__"
15001 Setting -mmcu=device defines this built-in macro to the device's
15002 name. For example, with -mmcu=atmega8 the macro is defined to
15003 "atmega8".
15004
15005 If device is not a device but only a core architecture like avr51,
15006 this macro is not defined.
15007
15008 "__AVR_XMEGA__"
15009 The device / architecture belongs to the XMEGA family of devices.
15010
15011 "__AVR_HAVE_ELPM__"
15012 The device has the "ELPM" instruction.
15013
15014 "__AVR_HAVE_ELPMX__"
15015 The device has the "ELPM Rn,Z" and "ELPM Rn,Z+" instructions.
15016
15017 "__AVR_HAVE_MOVW__"
15018 The device has the "MOVW" instruction to perform 16-bit register-
15019 register moves.
15020
15021 "__AVR_HAVE_LPMX__"
15022 The device has the "LPM Rn,Z" and "LPM Rn,Z+" instructions.
15023
15024 "__AVR_HAVE_MUL__"
15025 The device has a hardware multiplier.
15026
15027 "__AVR_HAVE_JMP_CALL__"
15028 The device has the "JMP" and "CALL" instructions. This is the case
15029 for devices with more than 8@tie{}KiB of program memory.
15030
15031 "__AVR_HAVE_EIJMP_EICALL__"
15032 "__AVR_3_BYTE_PC__"
15033 The device has the "EIJMP" and "EICALL" instructions. This is the
15034 case for devices with more than 128@tie{}KiB of program memory.
15035 This also means that the program counter (PC) is 3@tie{}bytes wide.
15036
15037 "__AVR_2_BYTE_PC__"
15038 The program counter (PC) is 2@tie{}bytes wide. This is the case for
15039 devices with up to 128@tie{}KiB of program memory.
15040
15041 "__AVR_HAVE_8BIT_SP__"
15042 "__AVR_HAVE_16BIT_SP__"
15043 The stack pointer (SP) register is treated as 8-bit respectively
15044 16-bit register by the compiler. The definition of these macros is
15045 affected by -mtiny-stack.
15046
15047 "__AVR_HAVE_SPH__"
15048 "__AVR_SP8__"
15049 The device has the SPH (high part of stack pointer) special
15050 function register or has an 8-bit stack pointer, respectively. The
15051 definition of these macros is affected by -mmcu= and in the cases
15052 of -mmcu=avr2 and -mmcu=avr25 also by -msp8.
15053
15054 "__AVR_HAVE_RAMPD__"
15055 "__AVR_HAVE_RAMPX__"
15056 "__AVR_HAVE_RAMPY__"
15057 "__AVR_HAVE_RAMPZ__"
15058 The device has the "RAMPD", "RAMPX", "RAMPY", "RAMPZ" special
15059 function register, respectively.
15060
15061 "__NO_INTERRUPTS__"
15062 This macro reflects the -mno-interrupts command-line option.
15063
15064 "__AVR_ERRATA_SKIP__"
15065 "__AVR_ERRATA_SKIP_JMP_CALL__"
15066 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
15067 instructions because of a hardware erratum. Skip instructions are
15068 "SBRS", "SBRC", "SBIS", "SBIC" and "CPSE". The second macro is
15069 only defined if "__AVR_HAVE_JMP_CALL__" is also set.
15070
15071 "__AVR_ISA_RMW__"
15072 The device has Read-Modify-Write instructions (XCH, LAC, LAS and
15073 LAT).
15074
15075 "__AVR_SFR_OFFSET__=offset"
15076 Instructions that can address I/O special function registers
15077 directly like "IN", "OUT", "SBI", etc. may use a different address
15078 as if addressed by an instruction to access RAM like "LD" or "STS".
15079 This offset depends on the device architecture and has to be
15080 subtracted from the RAM address in order to get the respective
15081 I/O@tie{}address.
15082
15083 "__AVR_SHORT_CALLS__"
15084 The -mshort-calls command line option is set.
15085
15086 "__AVR_PM_BASE_ADDRESS__=addr"
15087 Some devices support reading from flash memory by means of "LD*"
15088 instructions. The flash memory is seen in the data address space
15089 at an offset of "__AVR_PM_BASE_ADDRESS__". If this macro is not
15090 defined, this feature is not available. If defined, the address
15091 space is linear and there is no need to put ".rodata" into RAM.
15092 This is handled by the default linker description file, and is
15093 currently available for "avrtiny" and "avrxmega3". Even more
15094 convenient, there is no need to use address spaces like "__flash"
15095 or features like attribute "progmem" and "pgm_read_*".
15096
15097 "__WITH_AVRLIBC__"
15098 The compiler is configured to be used together with AVR-Libc. See
15099 the --with-avrlibc configure option.
15100
15101 Blackfin Options
15102
15103 -mcpu=cpu[-sirevision]
15104 Specifies the name of the target Blackfin processor. Currently,
15105 cpu can be one of bf512, bf514, bf516, bf518, bf522, bf523, bf524,
15106 bf525, bf526, bf527, bf531, bf532, bf533, bf534, bf536, bf537,
15107 bf538, bf539, bf542, bf544, bf547, bf548, bf549, bf542m, bf544m,
15108 bf547m, bf548m, bf549m, bf561, bf592.
15109
15110 The optional sirevision specifies the silicon revision of the
15111 target Blackfin processor. Any workarounds available for the
15112 targeted silicon revision are enabled. If sirevision is none, no
15113 workarounds are enabled. If sirevision is any, all workarounds for
15114 the targeted processor are enabled. The "__SILICON_REVISION__"
15115 macro is defined to two hexadecimal digits representing the major
15116 and minor numbers in the silicon revision. If sirevision is none,
15117 the "__SILICON_REVISION__" is not defined. If sirevision is any,
15118 the "__SILICON_REVISION__" is defined to be 0xffff. If this
15119 optional sirevision is not used, GCC assumes the latest known
15120 silicon revision of the targeted Blackfin processor.
15121
15122 GCC defines a preprocessor macro for the specified cpu. For the
15123 bfin-elf toolchain, this option causes the hardware BSP provided by
15124 libgloss to be linked in if -msim is not given.
15125
15126 Without this option, bf532 is used as the processor by default.
15127
15128 Note that support for bf561 is incomplete. For bf561, only the
15129 preprocessor macro is defined.
15130
15131 -msim
15132 Specifies that the program will be run on the simulator. This
15133 causes the simulator BSP provided by libgloss to be linked in.
15134 This option has effect only for bfin-elf toolchain. Certain other
15135 options, such as -mid-shared-library and -mfdpic, imply -msim.
15136
15137 -momit-leaf-frame-pointer
15138 Don't keep the frame pointer in a register for leaf functions.
15139 This avoids the instructions to save, set up and restore frame
15140 pointers and makes an extra register available in leaf functions.
15141
15142 -mspecld-anomaly
15143 When enabled, the compiler ensures that the generated code does not
15144 contain speculative loads after jump instructions. If this option
15145 is used, "__WORKAROUND_SPECULATIVE_LOADS" is defined.
15146
15147 -mno-specld-anomaly
15148 Don't generate extra code to prevent speculative loads from
15149 occurring.
15150
15151 -mcsync-anomaly
15152 When enabled, the compiler ensures that the generated code does not
15153 contain CSYNC or SSYNC instructions too soon after conditional
15154 branches. If this option is used, "__WORKAROUND_SPECULATIVE_SYNCS"
15155 is defined.
15156
15157 -mno-csync-anomaly
15158 Don't generate extra code to prevent CSYNC or SSYNC instructions
15159 from occurring too soon after a conditional branch.
15160
15161 -mlow-64k
15162 When enabled, the compiler is free to take advantage of the
15163 knowledge that the entire program fits into the low 64k of memory.
15164
15165 -mno-low-64k
15166 Assume that the program is arbitrarily large. This is the default.
15167
15168 -mstack-check-l1
15169 Do stack checking using information placed into L1 scratchpad
15170 memory by the uClinux kernel.
15171
15172 -mid-shared-library
15173 Generate code that supports shared libraries via the library ID
15174 method. This allows for execute in place and shared libraries in
15175 an environment without virtual memory management. This option
15176 implies -fPIC. With a bfin-elf target, this option implies -msim.
15177
15178 -mno-id-shared-library
15179 Generate code that doesn't assume ID-based shared libraries are
15180 being used. This is the default.
15181
15182 -mleaf-id-shared-library
15183 Generate code that supports shared libraries via the library ID
15184 method, but assumes that this library or executable won't link
15185 against any other ID shared libraries. That allows the compiler to
15186 use faster code for jumps and calls.
15187
15188 -mno-leaf-id-shared-library
15189 Do not assume that the code being compiled won't link against any
15190 ID shared libraries. Slower code is generated for jump and call
15191 insns.
15192
15193 -mshared-library-id=n
15194 Specifies the identification number of the ID-based shared library
15195 being compiled. Specifying a value of 0 generates more compact
15196 code; specifying other values forces the allocation of that number
15197 to the current library but is no more space- or time-efficient than
15198 omitting this option.
15199
15200 -msep-data
15201 Generate code that allows the data segment to be located in a
15202 different area of memory from the text segment. This allows for
15203 execute in place in an environment without virtual memory
15204 management by eliminating relocations against the text section.
15205
15206 -mno-sep-data
15207 Generate code that assumes that the data segment follows the text
15208 segment. This is the default.
15209
15210 -mlong-calls
15211 -mno-long-calls
15212 Tells the compiler to perform function calls by first loading the
15213 address of the function into a register and then performing a
15214 subroutine call on this register. This switch is needed if the
15215 target function lies outside of the 24-bit addressing range of the
15216 offset-based version of subroutine call instruction.
15217
15218 This feature is not enabled by default. Specifying -mno-long-calls
15219 restores the default behavior. Note these switches have no effect
15220 on how the compiler generates code to handle function calls via
15221 function pointers.
15222
15223 -mfast-fp
15224 Link with the fast floating-point library. This library relaxes
15225 some of the IEEE floating-point standard's rules for checking
15226 inputs against Not-a-Number (NAN), in the interest of performance.
15227
15228 -minline-plt
15229 Enable inlining of PLT entries in function calls to functions that
15230 are not known to bind locally. It has no effect without -mfdpic.
15231
15232 -mmulticore
15233 Build a standalone application for multicore Blackfin processors.
15234 This option causes proper start files and link scripts supporting
15235 multicore to be used, and defines the macro "__BFIN_MULTICORE". It
15236 can only be used with -mcpu=bf561[-sirevision].
15237
15238 This option can be used with -mcorea or -mcoreb, which selects the
15239 one-application-per-core programming model. Without -mcorea or
15240 -mcoreb, the single-application/dual-core programming model is
15241 used. In this model, the main function of Core B should be named as
15242 "coreb_main".
15243
15244 If this option is not used, the single-core application programming
15245 model is used.
15246
15247 -mcorea
15248 Build a standalone application for Core A of BF561 when using the
15249 one-application-per-core programming model. Proper start files and
15250 link scripts are used to support Core A, and the macro
15251 "__BFIN_COREA" is defined. This option can only be used in
15252 conjunction with -mmulticore.
15253
15254 -mcoreb
15255 Build a standalone application for Core B of BF561 when using the
15256 one-application-per-core programming model. Proper start files and
15257 link scripts are used to support Core B, and the macro
15258 "__BFIN_COREB" is defined. When this option is used, "coreb_main"
15259 should be used instead of "main". This option can only be used in
15260 conjunction with -mmulticore.
15261
15262 -msdram
15263 Build a standalone application for SDRAM. Proper start files and
15264 link scripts are used to put the application into SDRAM, and the
15265 macro "__BFIN_SDRAM" is defined. The loader should initialize
15266 SDRAM before loading the application.
15267
15268 -micplb
15269 Assume that ICPLBs are enabled at run time. This has an effect on
15270 certain anomaly workarounds. For Linux targets, the default is to
15271 assume ICPLBs are enabled; for standalone applications the default
15272 is off.
15273
15274 C6X Options
15275
15276 -march=name
15277 This specifies the name of the target architecture. GCC uses this
15278 name to determine what kind of instructions it can emit when
15279 generating assembly code. Permissible names are: c62x, c64x,
15280 c64x+, c67x, c67x+, c674x.
15281
15282 -mbig-endian
15283 Generate code for a big-endian target.
15284
15285 -mlittle-endian
15286 Generate code for a little-endian target. This is the default.
15287
15288 -msim
15289 Choose startup files and linker script suitable for the simulator.
15290
15291 -msdata=default
15292 Put small global and static data in the ".neardata" section, which
15293 is pointed to by register "B14". Put small uninitialized global
15294 and static data in the ".bss" section, which is adjacent to the
15295 ".neardata" section. Put small read-only data into the ".rodata"
15296 section. The corresponding sections used for large pieces of data
15297 are ".fardata", ".far" and ".const".
15298
15299 -msdata=all
15300 Put all data, not just small objects, into the sections reserved
15301 for small data, and use addressing relative to the "B14" register
15302 to access them.
15303
15304 -msdata=none
15305 Make no use of the sections reserved for small data, and use
15306 absolute addresses to access all data. Put all initialized global
15307 and static data in the ".fardata" section, and all uninitialized
15308 data in the ".far" section. Put all constant data into the
15309 ".const" section.
15310
15311 CRIS Options
15312
15313 These options are defined specifically for the CRIS ports.
15314
15315 -march=architecture-type
15316 -mcpu=architecture-type
15317 Generate code for the specified architecture. The choices for
15318 architecture-type are v3, v8 and v10 for respectively ETRAX 4,
15319 ETRAX 100, and ETRAX 100 LX. Default is v0 except for cris-axis-
15320 linux-gnu, where the default is v10.
15321
15322 -mtune=architecture-type
15323 Tune to architecture-type everything applicable about the generated
15324 code, except for the ABI and the set of available instructions.
15325 The choices for architecture-type are the same as for
15326 -march=architecture-type.
15327
15328 -mmax-stack-frame=n
15329 Warn when the stack frame of a function exceeds n bytes.
15330
15331 -metrax4
15332 -metrax100
15333 The options -metrax4 and -metrax100 are synonyms for -march=v3 and
15334 -march=v8 respectively.
15335
15336 -mmul-bug-workaround
15337 -mno-mul-bug-workaround
15338 Work around a bug in the "muls" and "mulu" instructions for CPU
15339 models where it applies. This option is active by default.
15340
15341 -mpdebug
15342 Enable CRIS-specific verbose debug-related information in the
15343 assembly code. This option also has the effect of turning off the
15344 #NO_APP formatted-code indicator to the assembler at the beginning
15345 of the assembly file.
15346
15347 -mcc-init
15348 Do not use condition-code results from previous instruction; always
15349 emit compare and test instructions before use of condition codes.
15350
15351 -mno-side-effects
15352 Do not emit instructions with side effects in addressing modes
15353 other than post-increment.
15354
15355 -mstack-align
15356 -mno-stack-align
15357 -mdata-align
15358 -mno-data-align
15359 -mconst-align
15360 -mno-const-align
15361 These options (no- options) arrange (eliminate arrangements) for
15362 the stack frame, individual data and constants to be aligned for
15363 the maximum single data access size for the chosen CPU model. The
15364 default is to arrange for 32-bit alignment. ABI details such as
15365 structure layout are not affected by these options.
15366
15367 -m32-bit
15368 -m16-bit
15369 -m8-bit
15370 Similar to the stack- data- and const-align options above, these
15371 options arrange for stack frame, writable data and constants to all
15372 be 32-bit, 16-bit or 8-bit aligned. The default is 32-bit
15373 alignment.
15374
15375 -mno-prologue-epilogue
15376 -mprologue-epilogue
15377 With -mno-prologue-epilogue, the normal function prologue and
15378 epilogue which set up the stack frame are omitted and no return
15379 instructions or return sequences are generated in the code. Use
15380 this option only together with visual inspection of the compiled
15381 code: no warnings or errors are generated when call-saved registers
15382 must be saved, or storage for local variables needs to be
15383 allocated.
15384
15385 -mno-gotplt
15386 -mgotplt
15387 With -fpic and -fPIC, don't generate (do generate) instruction
15388 sequences that load addresses for functions from the PLT part of
15389 the GOT rather than (traditional on other architectures) calls to
15390 the PLT. The default is -mgotplt.
15391
15392 -melf
15393 Legacy no-op option only recognized with the cris-axis-elf and
15394 cris-axis-linux-gnu targets.
15395
15396 -mlinux
15397 Legacy no-op option only recognized with the cris-axis-linux-gnu
15398 target.
15399
15400 -sim
15401 This option, recognized for the cris-axis-elf, arranges to link
15402 with input-output functions from a simulator library. Code,
15403 initialized data and zero-initialized data are allocated
15404 consecutively.
15405
15406 -sim2
15407 Like -sim, but pass linker options to locate initialized data at
15408 0x40000000 and zero-initialized data at 0x80000000.
15409
15410 CR16 Options
15411
15412 These options are defined specifically for the CR16 ports.
15413
15414 -mmac
15415 Enable the use of multiply-accumulate instructions. Disabled by
15416 default.
15417
15418 -mcr16cplus
15419 -mcr16c
15420 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture
15421 is default.
15422
15423 -msim
15424 Links the library libsim.a which is in compatible with simulator.
15425 Applicable to ELF compiler only.
15426
15427 -mint32
15428 Choose integer type as 32-bit wide.
15429
15430 -mbit-ops
15431 Generates "sbit"/"cbit" instructions for bit manipulations.
15432
15433 -mdata-model=model
15434 Choose a data model. The choices for model are near, far or medium.
15435 medium is default. However, far is not valid with -mcr16c, as the
15436 CR16C architecture does not support the far data model.
15437
15438 Darwin Options
15439
15440 These options are defined for all architectures running the Darwin
15441 operating system.
15442
15443 FSF GCC on Darwin does not create "fat" object files; it creates an
15444 object file for the single architecture that GCC was built to target.
15445 Apple's GCC on Darwin does create "fat" files if multiple -arch options
15446 are used; it does so by running the compiler or linker multiple times
15447 and joining the results together with lipo.
15448
15449 The subtype of the file created (like ppc7400 or ppc970 or i686) is
15450 determined by the flags that specify the ISA that GCC is targeting,
15451 like -mcpu or -march. The -force_cpusubtype_ALL option can be used to
15452 override this.
15453
15454 The Darwin tools vary in their behavior when presented with an ISA
15455 mismatch. The assembler, as, only permits instructions to be used that
15456 are valid for the subtype of the file it is generating, so you cannot
15457 put 64-bit instructions in a ppc750 object file. The linker for shared
15458 libraries, /usr/bin/libtool, fails and prints an error if asked to
15459 create a shared library with a less restrictive subtype than its input
15460 files (for instance, trying to put a ppc970 object file in a ppc7400
15461 library). The linker for executables, ld, quietly gives the executable
15462 the most restrictive subtype of any of its input files.
15463
15464 -Fdir
15465 Add the framework directory dir to the head of the list of
15466 directories to be searched for header files. These directories are
15467 interleaved with those specified by -I options and are scanned in a
15468 left-to-right order.
15469
15470 A framework directory is a directory with frameworks in it. A
15471 framework is a directory with a Headers and/or PrivateHeaders
15472 directory contained directly in it that ends in .framework. The
15473 name of a framework is the name of this directory excluding the
15474 .framework. Headers associated with the framework are found in one
15475 of those two directories, with Headers being searched first. A
15476 subframework is a framework directory that is in a framework's
15477 Frameworks directory. Includes of subframework headers can only
15478 appear in a header of a framework that contains the subframework,
15479 or in a sibling subframework header. Two subframeworks are
15480 siblings if they occur in the same framework. A subframework
15481 should not have the same name as a framework; a warning is issued
15482 if this is violated. Currently a subframework cannot have
15483 subframeworks; in the future, the mechanism may be extended to
15484 support this. The standard frameworks can be found in
15485 /System/Library/Frameworks and /Library/Frameworks. An example
15486 include looks like "#include <Framework/header.h>", where Framework
15487 denotes the name of the framework and header.h is found in the
15488 PrivateHeaders or Headers directory.
15489
15490 -iframeworkdir
15491 Like -F except the directory is a treated as a system directory.
15492 The main difference between this -iframework and -F is that with
15493 -iframework the compiler does not warn about constructs contained
15494 within header files found via dir. This option is valid only for
15495 the C family of languages.
15496
15497 -gused
15498 Emit debugging information for symbols that are used. For stabs
15499 debugging format, this enables -feliminate-unused-debug-symbols.
15500 This is by default ON.
15501
15502 -gfull
15503 Emit debugging information for all symbols and types.
15504
15505 -mmacosx-version-min=version
15506 The earliest version of MacOS X that this executable will run on is
15507 version. Typical values of version include 10.1, 10.2, and 10.3.9.
15508
15509 If the compiler was built to use the system's headers by default,
15510 then the default for this option is the system version on which the
15511 compiler is running, otherwise the default is to make choices that
15512 are compatible with as many systems and code bases as possible.
15513
15514 -mkernel
15515 Enable kernel development mode. The -mkernel option sets -static,
15516 -fno-common, -fno-use-cxa-atexit, -fno-exceptions,
15517 -fno-non-call-exceptions, -fapple-kext, -fno-weak and -fno-rtti
15518 where applicable. This mode also sets -mno-altivec, -msoft-float,
15519 -fno-builtin and -mlong-branch for PowerPC targets.
15520
15521 -mone-byte-bool
15522 Override the defaults for "bool" so that "sizeof(bool)==1". By
15523 default "sizeof(bool)" is 4 when compiling for Darwin/PowerPC and 1
15524 when compiling for Darwin/x86, so this option has no effect on x86.
15525
15526 Warning: The -mone-byte-bool switch causes GCC to generate code
15527 that is not binary compatible with code generated without that
15528 switch. Using this switch may require recompiling all other
15529 modules in a program, including system libraries. Use this switch
15530 to conform to a non-default data model.
15531
15532 -mfix-and-continue
15533 -ffix-and-continue
15534 -findirect-data
15535 Generate code suitable for fast turnaround development, such as to
15536 allow GDB to dynamically load .o files into already-running
15537 programs. -findirect-data and -ffix-and-continue are provided for
15538 backwards compatibility.
15539
15540 -all_load
15541 Loads all members of static archive libraries. See man ld(1) for
15542 more information.
15543
15544 -arch_errors_fatal
15545 Cause the errors having to do with files that have the wrong
15546 architecture to be fatal.
15547
15548 -bind_at_load
15549 Causes the output file to be marked such that the dynamic linker
15550 will bind all undefined references when the file is loaded or
15551 launched.
15552
15553 -bundle
15554 Produce a Mach-o bundle format file. See man ld(1) for more
15555 information.
15556
15557 -bundle_loader executable
15558 This option specifies the executable that will load the build
15559 output file being linked. See man ld(1) for more information.
15560
15561 -dynamiclib
15562 When passed this option, GCC produces a dynamic library instead of
15563 an executable when linking, using the Darwin libtool command.
15564
15565 -force_cpusubtype_ALL
15566 This causes GCC's output file to have the ALL subtype, instead of
15567 one controlled by the -mcpu or -march option.
15568
15569 -allowable_client client_name
15570 -client_name
15571 -compatibility_version
15572 -current_version
15573 -dead_strip
15574 -dependency-file
15575 -dylib_file
15576 -dylinker_install_name
15577 -dynamic
15578 -exported_symbols_list
15579 -filelist
15580 -flat_namespace
15581 -force_flat_namespace
15582 -headerpad_max_install_names
15583 -image_base
15584 -init
15585 -install_name
15586 -keep_private_externs
15587 -multi_module
15588 -multiply_defined
15589 -multiply_defined_unused
15590 -noall_load
15591 -no_dead_strip_inits_and_terms
15592 -nofixprebinding
15593 -nomultidefs
15594 -noprebind
15595 -noseglinkedit
15596 -pagezero_size
15597 -prebind
15598 -prebind_all_twolevel_modules
15599 -private_bundle
15600 -read_only_relocs
15601 -sectalign
15602 -sectobjectsymbols
15603 -whyload
15604 -seg1addr
15605 -sectcreate
15606 -sectobjectsymbols
15607 -sectorder
15608 -segaddr
15609 -segs_read_only_addr
15610 -segs_read_write_addr
15611 -seg_addr_table
15612 -seg_addr_table_filename
15613 -seglinkedit
15614 -segprot
15615 -segs_read_only_addr
15616 -segs_read_write_addr
15617 -single_module
15618 -static
15619 -sub_library
15620 -sub_umbrella
15621 -twolevel_namespace
15622 -umbrella
15623 -undefined
15624 -unexported_symbols_list
15625 -weak_reference_mismatches
15626 -whatsloaded
15627 These options are passed to the Darwin linker. The Darwin linker
15628 man page describes them in detail.
15629
15630 DEC Alpha Options
15631
15632 These -m options are defined for the DEC Alpha implementations:
15633
15634 -mno-soft-float
15635 -msoft-float
15636 Use (do not use) the hardware floating-point instructions for
15637 floating-point operations. When -msoft-float is specified,
15638 functions in libgcc.a are used to perform floating-point
15639 operations. Unless they are replaced by routines that emulate the
15640 floating-point operations, or compiled in such a way as to call
15641 such emulations routines, these routines issue floating-point
15642 operations. If you are compiling for an Alpha without floating-
15643 point operations, you must ensure that the library is built so as
15644 not to call them.
15645
15646 Note that Alpha implementations without floating-point operations
15647 are required to have floating-point registers.
15648
15649 -mfp-reg
15650 -mno-fp-regs
15651 Generate code that uses (does not use) the floating-point register
15652 set. -mno-fp-regs implies -msoft-float. If the floating-point
15653 register set is not used, floating-point operands are passed in
15654 integer registers as if they were integers and floating-point
15655 results are passed in $0 instead of $f0. This is a non-standard
15656 calling sequence, so any function with a floating-point argument or
15657 return value called by code compiled with -mno-fp-regs must also be
15658 compiled with that option.
15659
15660 A typical use of this option is building a kernel that does not
15661 use, and hence need not save and restore, any floating-point
15662 registers.
15663
15664 -mieee
15665 The Alpha architecture implements floating-point hardware optimized
15666 for maximum performance. It is mostly compliant with the IEEE
15667 floating-point standard. However, for full compliance, software
15668 assistance is required. This option generates code fully IEEE-
15669 compliant code except that the inexact-flag is not maintained (see
15670 below). If this option is turned on, the preprocessor macro
15671 "_IEEE_FP" is defined during compilation. The resulting code is
15672 less efficient but is able to correctly support denormalized
15673 numbers and exceptional IEEE values such as not-a-number and
15674 plus/minus infinity. Other Alpha compilers call this option
15675 -ieee_with_no_inexact.
15676
15677 -mieee-with-inexact
15678 This is like -mieee except the generated code also maintains the
15679 IEEE inexact-flag. Turning on this option causes the generated
15680 code to implement fully-compliant IEEE math. In addition to
15681 "_IEEE_FP", "_IEEE_FP_EXACT" is defined as a preprocessor macro.
15682 On some Alpha implementations the resulting code may execute
15683 significantly slower than the code generated by default. Since
15684 there is very little code that depends on the inexact-flag, you
15685 should normally not specify this option. Other Alpha compilers
15686 call this option -ieee_with_inexact.
15687
15688 -mfp-trap-mode=trap-mode
15689 This option controls what floating-point related traps are enabled.
15690 Other Alpha compilers call this option -fptm trap-mode. The trap
15691 mode can be set to one of four values:
15692
15693 n This is the default (normal) setting. The only traps that are
15694 enabled are the ones that cannot be disabled in software (e.g.,
15695 division by zero trap).
15696
15697 u In addition to the traps enabled by n, underflow traps are
15698 enabled as well.
15699
15700 su Like u, but the instructions are marked to be safe for software
15701 completion (see Alpha architecture manual for details).
15702
15703 sui Like su, but inexact traps are enabled as well.
15704
15705 -mfp-rounding-mode=rounding-mode
15706 Selects the IEEE rounding mode. Other Alpha compilers call this
15707 option -fprm rounding-mode. The rounding-mode can be one of:
15708
15709 n Normal IEEE rounding mode. Floating-point numbers are rounded
15710 towards the nearest machine number or towards the even machine
15711 number in case of a tie.
15712
15713 m Round towards minus infinity.
15714
15715 c Chopped rounding mode. Floating-point numbers are rounded
15716 towards zero.
15717
15718 d Dynamic rounding mode. A field in the floating-point control
15719 register (fpcr, see Alpha architecture reference manual)
15720 controls the rounding mode in effect. The C library
15721 initializes this register for rounding towards plus infinity.
15722 Thus, unless your program modifies the fpcr, d corresponds to
15723 round towards plus infinity.
15724
15725 -mtrap-precision=trap-precision
15726 In the Alpha architecture, floating-point traps are imprecise.
15727 This means without software assistance it is impossible to recover
15728 from a floating trap and program execution normally needs to be
15729 terminated. GCC can generate code that can assist operating system
15730 trap handlers in determining the exact location that caused a
15731 floating-point trap. Depending on the requirements of an
15732 application, different levels of precisions can be selected:
15733
15734 p Program precision. This option is the default and means a trap
15735 handler can only identify which program caused a floating-point
15736 exception.
15737
15738 f Function precision. The trap handler can determine the
15739 function that caused a floating-point exception.
15740
15741 i Instruction precision. The trap handler can determine the
15742 exact instruction that caused a floating-point exception.
15743
15744 Other Alpha compilers provide the equivalent options called
15745 -scope_safe and -resumption_safe.
15746
15747 -mieee-conformant
15748 This option marks the generated code as IEEE conformant. You must
15749 not use this option unless you also specify -mtrap-precision=i and
15750 either -mfp-trap-mode=su or -mfp-trap-mode=sui. Its only effect is
15751 to emit the line .eflag 48 in the function prologue of the
15752 generated assembly file.
15753
15754 -mbuild-constants
15755 Normally GCC examines a 32- or 64-bit integer constant to see if it
15756 can construct it from smaller constants in two or three
15757 instructions. If it cannot, it outputs the constant as a literal
15758 and generates code to load it from the data segment at run time.
15759
15760 Use this option to require GCC to construct all integer constants
15761 using code, even if it takes more instructions (the maximum is
15762 six).
15763
15764 You typically use this option to build a shared library dynamic
15765 loader. Itself a shared library, it must relocate itself in memory
15766 before it can find the variables and constants in its own data
15767 segment.
15768
15769 -mbwx
15770 -mno-bwx
15771 -mcix
15772 -mno-cix
15773 -mfix
15774 -mno-fix
15775 -mmax
15776 -mno-max
15777 Indicate whether GCC should generate code to use the optional BWX,
15778 CIX, FIX and MAX instruction sets. The default is to use the
15779 instruction sets supported by the CPU type specified via -mcpu=
15780 option or that of the CPU on which GCC was built if none is
15781 specified.
15782
15783 -mfloat-vax
15784 -mfloat-ieee
15785 Generate code that uses (does not use) VAX F and G floating-point
15786 arithmetic instead of IEEE single and double precision.
15787
15788 -mexplicit-relocs
15789 -mno-explicit-relocs
15790 Older Alpha assemblers provided no way to generate symbol
15791 relocations except via assembler macros. Use of these macros does
15792 not allow optimal instruction scheduling. GNU binutils as of
15793 version 2.12 supports a new syntax that allows the compiler to
15794 explicitly mark which relocations should apply to which
15795 instructions. This option is mostly useful for debugging, as GCC
15796 detects the capabilities of the assembler when it is built and sets
15797 the default accordingly.
15798
15799 -msmall-data
15800 -mlarge-data
15801 When -mexplicit-relocs is in effect, static data is accessed via
15802 gp-relative relocations. When -msmall-data is used, objects 8
15803 bytes long or smaller are placed in a small data area (the ".sdata"
15804 and ".sbss" sections) and are accessed via 16-bit relocations off
15805 of the $gp register. This limits the size of the small data area
15806 to 64KB, but allows the variables to be directly accessed via a
15807 single instruction.
15808
15809 The default is -mlarge-data. With this option the data area is
15810 limited to just below 2GB. Programs that require more than 2GB of
15811 data must use "malloc" or "mmap" to allocate the data in the heap
15812 instead of in the program's data segment.
15813
15814 When generating code for shared libraries, -fpic implies
15815 -msmall-data and -fPIC implies -mlarge-data.
15816
15817 -msmall-text
15818 -mlarge-text
15819 When -msmall-text is used, the compiler assumes that the code of
15820 the entire program (or shared library) fits in 4MB, and is thus
15821 reachable with a branch instruction. When -msmall-data is used,
15822 the compiler can assume that all local symbols share the same $gp
15823 value, and thus reduce the number of instructions required for a
15824 function call from 4 to 1.
15825
15826 The default is -mlarge-text.
15827
15828 -mcpu=cpu_type
15829 Set the instruction set and instruction scheduling parameters for
15830 machine type cpu_type. You can specify either the EV style name or
15831 the corresponding chip number. GCC supports scheduling parameters
15832 for the EV4, EV5 and EV6 family of processors and chooses the
15833 default values for the instruction set from the processor you
15834 specify. If you do not specify a processor type, GCC defaults to
15835 the processor on which the compiler was built.
15836
15837 Supported values for cpu_type are
15838
15839 ev4
15840 ev45
15841 21064
15842 Schedules as an EV4 and has no instruction set extensions.
15843
15844 ev5
15845 21164
15846 Schedules as an EV5 and has no instruction set extensions.
15847
15848 ev56
15849 21164a
15850 Schedules as an EV5 and supports the BWX extension.
15851
15852 pca56
15853 21164pc
15854 21164PC
15855 Schedules as an EV5 and supports the BWX and MAX extensions.
15856
15857 ev6
15858 21264
15859 Schedules as an EV6 and supports the BWX, FIX, and MAX
15860 extensions.
15861
15862 ev67
15863 21264a
15864 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX
15865 extensions.
15866
15867 Native toolchains also support the value native, which selects the
15868 best architecture option for the host processor. -mcpu=native has
15869 no effect if GCC does not recognize the processor.
15870
15871 -mtune=cpu_type
15872 Set only the instruction scheduling parameters for machine type
15873 cpu_type. The instruction set is not changed.
15874
15875 Native toolchains also support the value native, which selects the
15876 best architecture option for the host processor. -mtune=native has
15877 no effect if GCC does not recognize the processor.
15878
15879 -mmemory-latency=time
15880 Sets the latency the scheduler should assume for typical memory
15881 references as seen by the application. This number is highly
15882 dependent on the memory access patterns used by the application and
15883 the size of the external cache on the machine.
15884
15885 Valid options for time are
15886
15887 number
15888 A decimal number representing clock cycles.
15889
15890 L1
15891 L2
15892 L3
15893 main
15894 The compiler contains estimates of the number of clock cycles
15895 for "typical" EV4 & EV5 hardware for the Level 1, 2 & 3 caches
15896 (also called Dcache, Scache, and Bcache), as well as to main
15897 memory. Note that L3 is only valid for EV5.
15898
15899 FR30 Options
15900
15901 These options are defined specifically for the FR30 port.
15902
15903 -msmall-model
15904 Use the small address space model. This can produce smaller code,
15905 but it does assume that all symbolic values and addresses fit into
15906 a 20-bit range.
15907
15908 -mno-lsim
15909 Assume that runtime support has been provided and so there is no
15910 need to include the simulator library (libsim.a) on the linker
15911 command line.
15912
15913 FT32 Options
15914
15915 These options are defined specifically for the FT32 port.
15916
15917 -msim
15918 Specifies that the program will be run on the simulator. This
15919 causes an alternate runtime startup and library to be linked. You
15920 must not use this option when generating programs that will run on
15921 real hardware; you must provide your own runtime library for
15922 whatever I/O functions are needed.
15923
15924 -mlra
15925 Enable Local Register Allocation. This is still experimental for
15926 FT32, so by default the compiler uses standard reload.
15927
15928 -mnodiv
15929 Do not use div and mod instructions.
15930
15931 -mft32b
15932 Enable use of the extended instructions of the FT32B processor.
15933
15934 -mcompress
15935 Compress all code using the Ft32B code compression scheme.
15936
15937 -mnopm
15938 Do not generate code that reads program memory.
15939
15940 FRV Options
15941
15942 -mgpr-32
15943 Only use the first 32 general-purpose registers.
15944
15945 -mgpr-64
15946 Use all 64 general-purpose registers.
15947
15948 -mfpr-32
15949 Use only the first 32 floating-point registers.
15950
15951 -mfpr-64
15952 Use all 64 floating-point registers.
15953
15954 -mhard-float
15955 Use hardware instructions for floating-point operations.
15956
15957 -msoft-float
15958 Use library routines for floating-point operations.
15959
15960 -malloc-cc
15961 Dynamically allocate condition code registers.
15962
15963 -mfixed-cc
15964 Do not try to dynamically allocate condition code registers, only
15965 use "icc0" and "fcc0".
15966
15967 -mdword
15968 Change ABI to use double word insns.
15969
15970 -mno-dword
15971 Do not use double word instructions.
15972
15973 -mdouble
15974 Use floating-point double instructions.
15975
15976 -mno-double
15977 Do not use floating-point double instructions.
15978
15979 -mmedia
15980 Use media instructions.
15981
15982 -mno-media
15983 Do not use media instructions.
15984
15985 -mmuladd
15986 Use multiply and add/subtract instructions.
15987
15988 -mno-muladd
15989 Do not use multiply and add/subtract instructions.
15990
15991 -mfdpic
15992 Select the FDPIC ABI, which uses function descriptors to represent
15993 pointers to functions. Without any PIC/PIE-related options, it
15994 implies -fPIE. With -fpic or -fpie, it assumes GOT entries and
15995 small data are within a 12-bit range from the GOT base address;
15996 with -fPIC or -fPIE, GOT offsets are computed with 32 bits. With a
15997 bfin-elf target, this option implies -msim.
15998
15999 -minline-plt
16000 Enable inlining of PLT entries in function calls to functions that
16001 are not known to bind locally. It has no effect without -mfdpic.
16002 It's enabled by default if optimizing for speed and compiling for
16003 shared libraries (i.e., -fPIC or -fpic), or when an optimization
16004 option such as -O3 or above is present in the command line.
16005
16006 -mTLS
16007 Assume a large TLS segment when generating thread-local code.
16008
16009 -mtls
16010 Do not assume a large TLS segment when generating thread-local
16011 code.
16012
16013 -mgprel-ro
16014 Enable the use of "GPREL" relocations in the FDPIC ABI for data
16015 that is known to be in read-only sections. It's enabled by
16016 default, except for -fpic or -fpie: even though it may help make
16017 the global offset table smaller, it trades 1 instruction for 4.
16018 With -fPIC or -fPIE, it trades 3 instructions for 4, one of which
16019 may be shared by multiple symbols, and it avoids the need for a GOT
16020 entry for the referenced symbol, so it's more likely to be a win.
16021 If it is not, -mno-gprel-ro can be used to disable it.
16022
16023 -multilib-library-pic
16024 Link with the (library, not FD) pic libraries. It's implied by
16025 -mlibrary-pic, as well as by -fPIC and -fpic without -mfdpic. You
16026 should never have to use it explicitly.
16027
16028 -mlinked-fp
16029 Follow the EABI requirement of always creating a frame pointer
16030 whenever a stack frame is allocated. This option is enabled by
16031 default and can be disabled with -mno-linked-fp.
16032
16033 -mlong-calls
16034 Use indirect addressing to call functions outside the current
16035 compilation unit. This allows the functions to be placed anywhere
16036 within the 32-bit address space.
16037
16038 -malign-labels
16039 Try to align labels to an 8-byte boundary by inserting NOPs into
16040 the previous packet. This option only has an effect when VLIW
16041 packing is enabled. It doesn't create new packets; it merely adds
16042 NOPs to existing ones.
16043
16044 -mlibrary-pic
16045 Generate position-independent EABI code.
16046
16047 -macc-4
16048 Use only the first four media accumulator registers.
16049
16050 -macc-8
16051 Use all eight media accumulator registers.
16052
16053 -mpack
16054 Pack VLIW instructions.
16055
16056 -mno-pack
16057 Do not pack VLIW instructions.
16058
16059 -mno-eflags
16060 Do not mark ABI switches in e_flags.
16061
16062 -mcond-move
16063 Enable the use of conditional-move instructions (default).
16064
16065 This switch is mainly for debugging the compiler and will likely be
16066 removed in a future version.
16067
16068 -mno-cond-move
16069 Disable the use of conditional-move instructions.
16070
16071 This switch is mainly for debugging the compiler and will likely be
16072 removed in a future version.
16073
16074 -mscc
16075 Enable the use of conditional set instructions (default).
16076
16077 This switch is mainly for debugging the compiler and will likely be
16078 removed in a future version.
16079
16080 -mno-scc
16081 Disable the use of conditional set instructions.
16082
16083 This switch is mainly for debugging the compiler and will likely be
16084 removed in a future version.
16085
16086 -mcond-exec
16087 Enable the use of conditional execution (default).
16088
16089 This switch is mainly for debugging the compiler and will likely be
16090 removed in a future version.
16091
16092 -mno-cond-exec
16093 Disable the use of conditional execution.
16094
16095 This switch is mainly for debugging the compiler and will likely be
16096 removed in a future version.
16097
16098 -mvliw-branch
16099 Run a pass to pack branches into VLIW instructions (default).
16100
16101 This switch is mainly for debugging the compiler and will likely be
16102 removed in a future version.
16103
16104 -mno-vliw-branch
16105 Do not run a pass to pack branches into VLIW instructions.
16106
16107 This switch is mainly for debugging the compiler and will likely be
16108 removed in a future version.
16109
16110 -mmulti-cond-exec
16111 Enable optimization of "&&" and "||" in conditional execution
16112 (default).
16113
16114 This switch is mainly for debugging the compiler and will likely be
16115 removed in a future version.
16116
16117 -mno-multi-cond-exec
16118 Disable optimization of "&&" and "||" in conditional execution.
16119
16120 This switch is mainly for debugging the compiler and will likely be
16121 removed in a future version.
16122
16123 -mnested-cond-exec
16124 Enable nested conditional execution optimizations (default).
16125
16126 This switch is mainly for debugging the compiler and will likely be
16127 removed in a future version.
16128
16129 -mno-nested-cond-exec
16130 Disable nested conditional execution optimizations.
16131
16132 This switch is mainly for debugging the compiler and will likely be
16133 removed in a future version.
16134
16135 -moptimize-membar
16136 This switch removes redundant "membar" instructions from the
16137 compiler-generated code. It is enabled by default.
16138
16139 -mno-optimize-membar
16140 This switch disables the automatic removal of redundant "membar"
16141 instructions from the generated code.
16142
16143 -mtomcat-stats
16144 Cause gas to print out tomcat statistics.
16145
16146 -mcpu=cpu
16147 Select the processor type for which to generate code. Possible
16148 values are frv, fr550, tomcat, fr500, fr450, fr405, fr400, fr300
16149 and simple.
16150
16151 GNU/Linux Options
16152
16153 These -m options are defined for GNU/Linux targets:
16154
16155 -mglibc
16156 Use the GNU C library. This is the default except on
16157 *-*-linux-*uclibc*, *-*-linux-*musl* and *-*-linux-*android*
16158 targets.
16159
16160 -muclibc
16161 Use uClibc C library. This is the default on *-*-linux-*uclibc*
16162 targets.
16163
16164 -mmusl
16165 Use the musl C library. This is the default on *-*-linux-*musl*
16166 targets.
16167
16168 -mbionic
16169 Use Bionic C library. This is the default on *-*-linux-*android*
16170 targets.
16171
16172 -mandroid
16173 Compile code compatible with Android platform. This is the default
16174 on *-*-linux-*android* targets.
16175
16176 When compiling, this option enables -mbionic, -fPIC,
16177 -fno-exceptions and -fno-rtti by default. When linking, this
16178 option makes the GCC driver pass Android-specific options to the
16179 linker. Finally, this option causes the preprocessor macro
16180 "__ANDROID__" to be defined.
16181
16182 -tno-android-cc
16183 Disable compilation effects of -mandroid, i.e., do not enable
16184 -mbionic, -fPIC, -fno-exceptions and -fno-rtti by default.
16185
16186 -tno-android-ld
16187 Disable linking effects of -mandroid, i.e., pass standard Linux
16188 linking options to the linker.
16189
16190 H8/300 Options
16191
16192 These -m options are defined for the H8/300 implementations:
16193
16194 -mrelax
16195 Shorten some address references at link time, when possible; uses
16196 the linker option -relax.
16197
16198 -mh Generate code for the H8/300H.
16199
16200 -ms Generate code for the H8S.
16201
16202 -mn Generate code for the H8S and H8/300H in the normal mode. This
16203 switch must be used either with -mh or -ms.
16204
16205 -ms2600
16206 Generate code for the H8S/2600. This switch must be used with -ms.
16207
16208 -mexr
16209 Extended registers are stored on stack before execution of function
16210 with monitor attribute. Default option is -mexr. This option is
16211 valid only for H8S targets.
16212
16213 -mno-exr
16214 Extended registers are not stored on stack before execution of
16215 function with monitor attribute. Default option is -mno-exr. This
16216 option is valid only for H8S targets.
16217
16218 -mint32
16219 Make "int" data 32 bits by default.
16220
16221 -malign-300
16222 On the H8/300H and H8S, use the same alignment rules as for the
16223 H8/300. The default for the H8/300H and H8S is to align longs and
16224 floats on 4-byte boundaries. -malign-300 causes them to be aligned
16225 on 2-byte boundaries. This option has no effect on the H8/300.
16226
16227 HPPA Options
16228
16229 These -m options are defined for the HPPA family of computers:
16230
16231 -march=architecture-type
16232 Generate code for the specified architecture. The choices for
16233 architecture-type are 1.0 for PA 1.0, 1.1 for PA 1.1, and 2.0 for
16234 PA 2.0 processors. Refer to /usr/lib/sched.models on an HP-UX
16235 system to determine the proper architecture option for your
16236 machine. Code compiled for lower numbered architectures runs on
16237 higher numbered architectures, but not the other way around.
16238
16239 -mpa-risc-1-0
16240 -mpa-risc-1-1
16241 -mpa-risc-2-0
16242 Synonyms for -march=1.0, -march=1.1, and -march=2.0 respectively.
16243
16244 -mcaller-copies
16245 The caller copies function arguments passed by hidden reference.
16246 This option should be used with care as it is not compatible with
16247 the default 32-bit runtime. However, only aggregates larger than
16248 eight bytes are passed by hidden reference and the option provides
16249 better compatibility with OpenMP.
16250
16251 -mjump-in-delay
16252 This option is ignored and provided for compatibility purposes
16253 only.
16254
16255 -mdisable-fpregs
16256 Prevent floating-point registers from being used in any manner.
16257 This is necessary for compiling kernels that perform lazy context
16258 switching of floating-point registers. If you use this option and
16259 attempt to perform floating-point operations, the compiler aborts.
16260
16261 -mdisable-indexing
16262 Prevent the compiler from using indexing address modes. This
16263 avoids some rather obscure problems when compiling MIG generated
16264 code under MACH.
16265
16266 -mno-space-regs
16267 Generate code that assumes the target has no space registers. This
16268 allows GCC to generate faster indirect calls and use unscaled index
16269 address modes.
16270
16271 Such code is suitable for level 0 PA systems and kernels.
16272
16273 -mfast-indirect-calls
16274 Generate code that assumes calls never cross space boundaries.
16275 This allows GCC to emit code that performs faster indirect calls.
16276
16277 This option does not work in the presence of shared libraries or
16278 nested functions.
16279
16280 -mfixed-range=register-range
16281 Generate code treating the given register range as fixed registers.
16282 A fixed register is one that the register allocator cannot use.
16283 This is useful when compiling kernel code. A register range is
16284 specified as two registers separated by a dash. Multiple register
16285 ranges can be specified separated by a comma.
16286
16287 -mlong-load-store
16288 Generate 3-instruction load and store sequences as sometimes
16289 required by the HP-UX 10 linker. This is equivalent to the +k
16290 option to the HP compilers.
16291
16292 -mportable-runtime
16293 Use the portable calling conventions proposed by HP for ELF
16294 systems.
16295
16296 -mgas
16297 Enable the use of assembler directives only GAS understands.
16298
16299 -mschedule=cpu-type
16300 Schedule code according to the constraints for the machine type
16301 cpu-type. The choices for cpu-type are 700 7100, 7100LC, 7200,
16302 7300 and 8000. Refer to /usr/lib/sched.models on an HP-UX system
16303 to determine the proper scheduling option for your machine. The
16304 default scheduling is 8000.
16305
16306 -mlinker-opt
16307 Enable the optimization pass in the HP-UX linker. Note this makes
16308 symbolic debugging impossible. It also triggers a bug in the HP-UX
16309 8 and HP-UX 9 linkers in which they give bogus error messages when
16310 linking some programs.
16311
16312 -msoft-float
16313 Generate output containing library calls for floating point.
16314 Warning: the requisite libraries are not available for all HPPA
16315 targets. Normally the facilities of the machine's usual C compiler
16316 are used, but this cannot be done directly in cross-compilation.
16317 You must make your own arrangements to provide suitable library
16318 functions for cross-compilation.
16319
16320 -msoft-float changes the calling convention in the output file;
16321 therefore, it is only useful if you compile all of a program with
16322 this option. In particular, you need to compile libgcc.a, the
16323 library that comes with GCC, with -msoft-float in order for this to
16324 work.
16325
16326 -msio
16327 Generate the predefine, "_SIO", for server IO. The default is
16328 -mwsio. This generates the predefines, "__hp9000s700",
16329 "__hp9000s700__" and "_WSIO", for workstation IO. These options
16330 are available under HP-UX and HI-UX.
16331
16332 -mgnu-ld
16333 Use options specific to GNU ld. This passes -shared to ld when
16334 building a shared library. It is the default when GCC is
16335 configured, explicitly or implicitly, with the GNU linker. This
16336 option does not affect which ld is called; it only changes what
16337 parameters are passed to that ld. The ld that is called is
16338 determined by the --with-ld configure option, GCC's program search
16339 path, and finally by the user's PATH. The linker used by GCC can
16340 be printed using which `gcc -print-prog-name=ld`. This option is
16341 only available on the 64-bit HP-UX GCC, i.e. configured with
16342 hppa*64*-*-hpux*.
16343
16344 -mhp-ld
16345 Use options specific to HP ld. This passes -b to ld when building
16346 a shared library and passes +Accept TypeMismatch to ld on all
16347 links. It is the default when GCC is configured, explicitly or
16348 implicitly, with the HP linker. This option does not affect which
16349 ld is called; it only changes what parameters are passed to that
16350 ld. The ld that is called is determined by the --with-ld configure
16351 option, GCC's program search path, and finally by the user's PATH.
16352 The linker used by GCC can be printed using which `gcc
16353 -print-prog-name=ld`. This option is only available on the 64-bit
16354 HP-UX GCC, i.e. configured with hppa*64*-*-hpux*.
16355
16356 -mlong-calls
16357 Generate code that uses long call sequences. This ensures that a
16358 call is always able to reach linker generated stubs. The default
16359 is to generate long calls only when the distance from the call site
16360 to the beginning of the function or translation unit, as the case
16361 may be, exceeds a predefined limit set by the branch type being
16362 used. The limits for normal calls are 7,600,000 and 240,000 bytes,
16363 respectively for the PA 2.0 and PA 1.X architectures. Sibcalls are
16364 always limited at 240,000 bytes.
16365
16366 Distances are measured from the beginning of functions when using
16367 the -ffunction-sections option, or when using the -mgas and
16368 -mno-portable-runtime options together under HP-UX with the SOM
16369 linker.
16370
16371 It is normally not desirable to use this option as it degrades
16372 performance. However, it may be useful in large applications,
16373 particularly when partial linking is used to build the application.
16374
16375 The types of long calls used depends on the capabilities of the
16376 assembler and linker, and the type of code being generated. The
16377 impact on systems that support long absolute calls, and long pic
16378 symbol-difference or pc-relative calls should be relatively small.
16379 However, an indirect call is used on 32-bit ELF systems in pic code
16380 and it is quite long.
16381
16382 -munix=unix-std
16383 Generate compiler predefines and select a startfile for the
16384 specified UNIX standard. The choices for unix-std are 93, 95 and
16385 98. 93 is supported on all HP-UX versions. 95 is available on HP-
16386 UX 10.10 and later. 98 is available on HP-UX 11.11 and later. The
16387 default values are 93 for HP-UX 10.00, 95 for HP-UX 10.10 though to
16388 11.00, and 98 for HP-UX 11.11 and later.
16389
16390 -munix=93 provides the same predefines as GCC 3.3 and 3.4.
16391 -munix=95 provides additional predefines for "XOPEN_UNIX" and
16392 "_XOPEN_SOURCE_EXTENDED", and the startfile unix95.o. -munix=98
16393 provides additional predefines for "_XOPEN_UNIX",
16394 "_XOPEN_SOURCE_EXTENDED", "_INCLUDE__STDC_A1_SOURCE" and
16395 "_INCLUDE_XOPEN_SOURCE_500", and the startfile unix98.o.
16396
16397 It is important to note that this option changes the interfaces for
16398 various library routines. It also affects the operational behavior
16399 of the C library. Thus, extreme care is needed in using this
16400 option.
16401
16402 Library code that is intended to operate with more than one UNIX
16403 standard must test, set and restore the variable
16404 "__xpg4_extended_mask" as appropriate. Most GNU software doesn't
16405 provide this capability.
16406
16407 -nolibdld
16408 Suppress the generation of link options to search libdld.sl when
16409 the -static option is specified on HP-UX 10 and later.
16410
16411 -static
16412 The HP-UX implementation of setlocale in libc has a dependency on
16413 libdld.sl. There isn't an archive version of libdld.sl. Thus,
16414 when the -static option is specified, special link options are
16415 needed to resolve this dependency.
16416
16417 On HP-UX 10 and later, the GCC driver adds the necessary options to
16418 link with libdld.sl when the -static option is specified. This
16419 causes the resulting binary to be dynamic. On the 64-bit port, the
16420 linkers generate dynamic binaries by default in any case. The
16421 -nolibdld option can be used to prevent the GCC driver from adding
16422 these link options.
16423
16424 -threads
16425 Add support for multithreading with the dce thread library under
16426 HP-UX. This option sets flags for both the preprocessor and
16427 linker.
16428
16429 IA-64 Options
16430
16431 These are the -m options defined for the Intel IA-64 architecture.
16432
16433 -mbig-endian
16434 Generate code for a big-endian target. This is the default for HP-
16435 UX.
16436
16437 -mlittle-endian
16438 Generate code for a little-endian target. This is the default for
16439 AIX5 and GNU/Linux.
16440
16441 -mgnu-as
16442 -mno-gnu-as
16443 Generate (or don't) code for the GNU assembler. This is the
16444 default.
16445
16446 -mgnu-ld
16447 -mno-gnu-ld
16448 Generate (or don't) code for the GNU linker. This is the default.
16449
16450 -mno-pic
16451 Generate code that does not use a global pointer register. The
16452 result is not position independent code, and violates the IA-64
16453 ABI.
16454
16455 -mvolatile-asm-stop
16456 -mno-volatile-asm-stop
16457 Generate (or don't) a stop bit immediately before and after
16458 volatile asm statements.
16459
16460 -mregister-names
16461 -mno-register-names
16462 Generate (or don't) in, loc, and out register names for the stacked
16463 registers. This may make assembler output more readable.
16464
16465 -mno-sdata
16466 -msdata
16467 Disable (or enable) optimizations that use the small data section.
16468 This may be useful for working around optimizer bugs.
16469
16470 -mconstant-gp
16471 Generate code that uses a single constant global pointer value.
16472 This is useful when compiling kernel code.
16473
16474 -mauto-pic
16475 Generate code that is self-relocatable. This implies
16476 -mconstant-gp. This is useful when compiling firmware code.
16477
16478 -minline-float-divide-min-latency
16479 Generate code for inline divides of floating-point values using the
16480 minimum latency algorithm.
16481
16482 -minline-float-divide-max-throughput
16483 Generate code for inline divides of floating-point values using the
16484 maximum throughput algorithm.
16485
16486 -mno-inline-float-divide
16487 Do not generate inline code for divides of floating-point values.
16488
16489 -minline-int-divide-min-latency
16490 Generate code for inline divides of integer values using the
16491 minimum latency algorithm.
16492
16493 -minline-int-divide-max-throughput
16494 Generate code for inline divides of integer values using the
16495 maximum throughput algorithm.
16496
16497 -mno-inline-int-divide
16498 Do not generate inline code for divides of integer values.
16499
16500 -minline-sqrt-min-latency
16501 Generate code for inline square roots using the minimum latency
16502 algorithm.
16503
16504 -minline-sqrt-max-throughput
16505 Generate code for inline square roots using the maximum throughput
16506 algorithm.
16507
16508 -mno-inline-sqrt
16509 Do not generate inline code for "sqrt".
16510
16511 -mfused-madd
16512 -mno-fused-madd
16513 Do (don't) generate code that uses the fused multiply/add or
16514 multiply/subtract instructions. The default is to use these
16515 instructions.
16516
16517 -mno-dwarf2-asm
16518 -mdwarf2-asm
16519 Don't (or do) generate assembler code for the DWARF line number
16520 debugging info. This may be useful when not using the GNU
16521 assembler.
16522
16523 -mearly-stop-bits
16524 -mno-early-stop-bits
16525 Allow stop bits to be placed earlier than immediately preceding the
16526 instruction that triggered the stop bit. This can improve
16527 instruction scheduling, but does not always do so.
16528
16529 -mfixed-range=register-range
16530 Generate code treating the given register range as fixed registers.
16531 A fixed register is one that the register allocator cannot use.
16532 This is useful when compiling kernel code. A register range is
16533 specified as two registers separated by a dash. Multiple register
16534 ranges can be specified separated by a comma.
16535
16536 -mtls-size=tls-size
16537 Specify bit size of immediate TLS offsets. Valid values are 14,
16538 22, and 64.
16539
16540 -mtune=cpu-type
16541 Tune the instruction scheduling for a particular CPU, Valid values
16542 are itanium, itanium1, merced, itanium2, and mckinley.
16543
16544 -milp32
16545 -mlp64
16546 Generate code for a 32-bit or 64-bit environment. The 32-bit
16547 environment sets int, long and pointer to 32 bits. The 64-bit
16548 environment sets int to 32 bits and long and pointer to 64 bits.
16549 These are HP-UX specific flags.
16550
16551 -mno-sched-br-data-spec
16552 -msched-br-data-spec
16553 (Dis/En)able data speculative scheduling before reload. This
16554 results in generation of "ld.a" instructions and the corresponding
16555 check instructions ("ld.c" / "chk.a"). The default setting is
16556 disabled.
16557
16558 -msched-ar-data-spec
16559 -mno-sched-ar-data-spec
16560 (En/Dis)able data speculative scheduling after reload. This
16561 results in generation of "ld.a" instructions and the corresponding
16562 check instructions ("ld.c" / "chk.a"). The default setting is
16563 enabled.
16564
16565 -mno-sched-control-spec
16566 -msched-control-spec
16567 (Dis/En)able control speculative scheduling. This feature is
16568 available only during region scheduling (i.e. before reload). This
16569 results in generation of the "ld.s" instructions and the
16570 corresponding check instructions "chk.s". The default setting is
16571 disabled.
16572
16573 -msched-br-in-data-spec
16574 -mno-sched-br-in-data-spec
16575 (En/Dis)able speculative scheduling of the instructions that are
16576 dependent on the data speculative loads before reload. This is
16577 effective only with -msched-br-data-spec enabled. The default
16578 setting is enabled.
16579
16580 -msched-ar-in-data-spec
16581 -mno-sched-ar-in-data-spec
16582 (En/Dis)able speculative scheduling of the instructions that are
16583 dependent on the data speculative loads after reload. This is
16584 effective only with -msched-ar-data-spec enabled. The default
16585 setting is enabled.
16586
16587 -msched-in-control-spec
16588 -mno-sched-in-control-spec
16589 (En/Dis)able speculative scheduling of the instructions that are
16590 dependent on the control speculative loads. This is effective only
16591 with -msched-control-spec enabled. The default setting is enabled.
16592
16593 -mno-sched-prefer-non-data-spec-insns
16594 -msched-prefer-non-data-spec-insns
16595 If enabled, data-speculative instructions are chosen for schedule
16596 only if there are no other choices at the moment. This makes the
16597 use of the data speculation much more conservative. The default
16598 setting is disabled.
16599
16600 -mno-sched-prefer-non-control-spec-insns
16601 -msched-prefer-non-control-spec-insns
16602 If enabled, control-speculative instructions are chosen for
16603 schedule only if there are no other choices at the moment. This
16604 makes the use of the control speculation much more conservative.
16605 The default setting is disabled.
16606
16607 -mno-sched-count-spec-in-critical-path
16608 -msched-count-spec-in-critical-path
16609 If enabled, speculative dependencies are considered during
16610 computation of the instructions priorities. This makes the use of
16611 the speculation a bit more conservative. The default setting is
16612 disabled.
16613
16614 -msched-spec-ldc
16615 Use a simple data speculation check. This option is on by default.
16616
16617 -msched-control-spec-ldc
16618 Use a simple check for control speculation. This option is on by
16619 default.
16620
16621 -msched-stop-bits-after-every-cycle
16622 Place a stop bit after every cycle when scheduling. This option is
16623 on by default.
16624
16625 -msched-fp-mem-deps-zero-cost
16626 Assume that floating-point stores and loads are not likely to cause
16627 a conflict when placed into the same instruction group. This
16628 option is disabled by default.
16629
16630 -msel-sched-dont-check-control-spec
16631 Generate checks for control speculation in selective scheduling.
16632 This flag is disabled by default.
16633
16634 -msched-max-memory-insns=max-insns
16635 Limit on the number of memory insns per instruction group, giving
16636 lower priority to subsequent memory insns attempting to schedule in
16637 the same instruction group. Frequently useful to prevent cache bank
16638 conflicts. The default value is 1.
16639
16640 -msched-max-memory-insns-hard-limit
16641 Makes the limit specified by msched-max-memory-insns a hard limit,
16642 disallowing more than that number in an instruction group.
16643 Otherwise, the limit is "soft", meaning that non-memory operations
16644 are preferred when the limit is reached, but memory operations may
16645 still be scheduled.
16646
16647 LM32 Options
16648
16649 These -m options are defined for the LatticeMico32 architecture:
16650
16651 -mbarrel-shift-enabled
16652 Enable barrel-shift instructions.
16653
16654 -mdivide-enabled
16655 Enable divide and modulus instructions.
16656
16657 -mmultiply-enabled
16658 Enable multiply instructions.
16659
16660 -msign-extend-enabled
16661 Enable sign extend instructions.
16662
16663 -muser-enabled
16664 Enable user-defined instructions.
16665
16666 M32C Options
16667
16668 -mcpu=name
16669 Select the CPU for which code is generated. name may be one of r8c
16670 for the R8C/Tiny series, m16c for the M16C (up to /60) series,
16671 m32cm for the M16C/80 series, or m32c for the M32C/80 series.
16672
16673 -msim
16674 Specifies that the program will be run on the simulator. This
16675 causes an alternate runtime library to be linked in which supports,
16676 for example, file I/O. You must not use this option when
16677 generating programs that will run on real hardware; you must
16678 provide your own runtime library for whatever I/O functions are
16679 needed.
16680
16681 -memregs=number
16682 Specifies the number of memory-based pseudo-registers GCC uses
16683 during code generation. These pseudo-registers are used like real
16684 registers, so there is a tradeoff between GCC's ability to fit the
16685 code into available registers, and the performance penalty of using
16686 memory instead of registers. Note that all modules in a program
16687 must be compiled with the same value for this option. Because of
16688 that, you must not use this option with GCC's default runtime
16689 libraries.
16690
16691 M32R/D Options
16692
16693 These -m options are defined for Renesas M32R/D architectures:
16694
16695 -m32r2
16696 Generate code for the M32R/2.
16697
16698 -m32rx
16699 Generate code for the M32R/X.
16700
16701 -m32r
16702 Generate code for the M32R. This is the default.
16703
16704 -mmodel=small
16705 Assume all objects live in the lower 16MB of memory (so that their
16706 addresses can be loaded with the "ld24" instruction), and assume
16707 all subroutines are reachable with the "bl" instruction. This is
16708 the default.
16709
16710 The addressability of a particular object can be set with the
16711 "model" attribute.
16712
16713 -mmodel=medium
16714 Assume objects may be anywhere in the 32-bit address space (the
16715 compiler generates "seth/add3" instructions to load their
16716 addresses), and assume all subroutines are reachable with the "bl"
16717 instruction.
16718
16719 -mmodel=large
16720 Assume objects may be anywhere in the 32-bit address space (the
16721 compiler generates "seth/add3" instructions to load their
16722 addresses), and assume subroutines may not be reachable with the
16723 "bl" instruction (the compiler generates the much slower
16724 "seth/add3/jl" instruction sequence).
16725
16726 -msdata=none
16727 Disable use of the small data area. Variables are put into one of
16728 ".data", ".bss", or ".rodata" (unless the "section" attribute has
16729 been specified). This is the default.
16730
16731 The small data area consists of sections ".sdata" and ".sbss".
16732 Objects may be explicitly put in the small data area with the
16733 "section" attribute using one of these sections.
16734
16735 -msdata=sdata
16736 Put small global and static data in the small data area, but do not
16737 generate special code to reference them.
16738
16739 -msdata=use
16740 Put small global and static data in the small data area, and
16741 generate special instructions to reference them.
16742
16743 -G num
16744 Put global and static objects less than or equal to num bytes into
16745 the small data or BSS sections instead of the normal data or BSS
16746 sections. The default value of num is 8. The -msdata option must
16747 be set to one of sdata or use for this option to have any effect.
16748
16749 All modules should be compiled with the same -G num value.
16750 Compiling with different values of num may or may not work; if it
16751 doesn't the linker gives an error message---incorrect code is not
16752 generated.
16753
16754 -mdebug
16755 Makes the M32R-specific code in the compiler display some
16756 statistics that might help in debugging programs.
16757
16758 -malign-loops
16759 Align all loops to a 32-byte boundary.
16760
16761 -mno-align-loops
16762 Do not enforce a 32-byte alignment for loops. This is the default.
16763
16764 -missue-rate=number
16765 Issue number instructions per cycle. number can only be 1 or 2.
16766
16767 -mbranch-cost=number
16768 number can only be 1 or 2. If it is 1 then branches are preferred
16769 over conditional code, if it is 2, then the opposite applies.
16770
16771 -mflush-trap=number
16772 Specifies the trap number to use to flush the cache. The default
16773 is 12. Valid numbers are between 0 and 15 inclusive.
16774
16775 -mno-flush-trap
16776 Specifies that the cache cannot be flushed by using a trap.
16777
16778 -mflush-func=name
16779 Specifies the name of the operating system function to call to
16780 flush the cache. The default is _flush_cache, but a function call
16781 is only used if a trap is not available.
16782
16783 -mno-flush-func
16784 Indicates that there is no OS function for flushing the cache.
16785
16786 M680x0 Options
16787
16788 These are the -m options defined for M680x0 and ColdFire processors.
16789 The default settings depend on which architecture was selected when the
16790 compiler was configured; the defaults for the most common choices are
16791 given below.
16792
16793 -march=arch
16794 Generate code for a specific M680x0 or ColdFire instruction set
16795 architecture. Permissible values of arch for M680x0 architectures
16796 are: 68000, 68010, 68020, 68030, 68040, 68060 and cpu32. ColdFire
16797 architectures are selected according to Freescale's ISA
16798 classification and the permissible values are: isaa, isaaplus, isab
16799 and isac.
16800
16801 GCC defines a macro "__mcfarch__" whenever it is generating code
16802 for a ColdFire target. The arch in this macro is one of the -march
16803 arguments given above.
16804
16805 When used together, -march and -mtune select code that runs on a
16806 family of similar processors but that is optimized for a particular
16807 microarchitecture.
16808
16809 -mcpu=cpu
16810 Generate code for a specific M680x0 or ColdFire processor. The
16811 M680x0 cpus are: 68000, 68010, 68020, 68030, 68040, 68060, 68302,
16812 68332 and cpu32. The ColdFire cpus are given by the table below,
16813 which also classifies the CPUs into families:
16814
16815 Family : -mcpu arguments
16816 51 : 51 51ac 51ag 51cn 51em 51je 51jf 51jg 51jm 51mm 51qe 51qm
16817 5206 : 5202 5204 5206
16818 5206e : 5206e
16819 5208 : 5207 5208
16820 5211a : 5210a 5211a
16821 5213 : 5211 5212 5213
16822 5216 : 5214 5216
16823 52235 : 52230 52231 52232 52233 52234 52235
16824 5225 : 5224 5225
16825 52259 : 52252 52254 52255 52256 52258 52259
16826 5235 : 5232 5233 5234 5235 523x
16827 5249 : 5249
16828 5250 : 5250
16829 5271 : 5270 5271
16830 5272 : 5272
16831 5275 : 5274 5275
16832 5282 : 5280 5281 5282 528x
16833 53017 : 53011 53012 53013 53014 53015 53016 53017
16834 5307 : 5307
16835 5329 : 5327 5328 5329 532x
16836 5373 : 5372 5373 537x
16837 5407 : 5407
16838 5475 : 5470 5471 5472 5473 5474 5475 547x 5480 5481 5482 5483 5484
16839 5485
16840
16841 -mcpu=cpu overrides -march=arch if arch is compatible with cpu.
16842 Other combinations of -mcpu and -march are rejected.
16843
16844 GCC defines the macro "__mcf_cpu_cpu" when ColdFire target cpu is
16845 selected. It also defines "__mcf_family_family", where the value
16846 of family is given by the table above.
16847
16848 -mtune=tune
16849 Tune the code for a particular microarchitecture within the
16850 constraints set by -march and -mcpu. The M680x0 microarchitectures
16851 are: 68000, 68010, 68020, 68030, 68040, 68060 and cpu32. The
16852 ColdFire microarchitectures are: cfv1, cfv2, cfv3, cfv4 and cfv4e.
16853
16854 You can also use -mtune=68020-40 for code that needs to run
16855 relatively well on 68020, 68030 and 68040 targets. -mtune=68020-60
16856 is similar but includes 68060 targets as well. These two options
16857 select the same tuning decisions as -m68020-40 and -m68020-60
16858 respectively.
16859
16860 GCC defines the macros "__mcarch" and "__mcarch__" when tuning for
16861 680x0 architecture arch. It also defines "mcarch" unless either
16862 -ansi or a non-GNU -std option is used. If GCC is tuning for a
16863 range of architectures, as selected by -mtune=68020-40 or
16864 -mtune=68020-60, it defines the macros for every architecture in
16865 the range.
16866
16867 GCC also defines the macro "__muarch__" when tuning for ColdFire
16868 microarchitecture uarch, where uarch is one of the arguments given
16869 above.
16870
16871 -m68000
16872 -mc68000
16873 Generate output for a 68000. This is the default when the compiler
16874 is configured for 68000-based systems. It is equivalent to
16875 -march=68000.
16876
16877 Use this option for microcontrollers with a 68000 or EC000 core,
16878 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
16879
16880 -m68010
16881 Generate output for a 68010. This is the default when the compiler
16882 is configured for 68010-based systems. It is equivalent to
16883 -march=68010.
16884
16885 -m68020
16886 -mc68020
16887 Generate output for a 68020. This is the default when the compiler
16888 is configured for 68020-based systems. It is equivalent to
16889 -march=68020.
16890
16891 -m68030
16892 Generate output for a 68030. This is the default when the compiler
16893 is configured for 68030-based systems. It is equivalent to
16894 -march=68030.
16895
16896 -m68040
16897 Generate output for a 68040. This is the default when the compiler
16898 is configured for 68040-based systems. It is equivalent to
16899 -march=68040.
16900
16901 This option inhibits the use of 68881/68882 instructions that have
16902 to be emulated by software on the 68040. Use this option if your
16903 68040 does not have code to emulate those instructions.
16904
16905 -m68060
16906 Generate output for a 68060. This is the default when the compiler
16907 is configured for 68060-based systems. It is equivalent to
16908 -march=68060.
16909
16910 This option inhibits the use of 68020 and 68881/68882 instructions
16911 that have to be emulated by software on the 68060. Use this option
16912 if your 68060 does not have code to emulate those instructions.
16913
16914 -mcpu32
16915 Generate output for a CPU32. This is the default when the compiler
16916 is configured for CPU32-based systems. It is equivalent to
16917 -march=cpu32.
16918
16919 Use this option for microcontrollers with a CPU32 or CPU32+ core,
16920 including the 68330, 68331, 68332, 68333, 68334, 68336, 68340,
16921 68341, 68349 and 68360.
16922
16923 -m5200
16924 Generate output for a 520X ColdFire CPU. This is the default when
16925 the compiler is configured for 520X-based systems. It is
16926 equivalent to -mcpu=5206, and is now deprecated in favor of that
16927 option.
16928
16929 Use this option for microcontroller with a 5200 core, including the
16930 MCF5202, MCF5203, MCF5204 and MCF5206.
16931
16932 -m5206e
16933 Generate output for a 5206e ColdFire CPU. The option is now
16934 deprecated in favor of the equivalent -mcpu=5206e.
16935
16936 -m528x
16937 Generate output for a member of the ColdFire 528X family. The
16938 option is now deprecated in favor of the equivalent -mcpu=528x.
16939
16940 -m5307
16941 Generate output for a ColdFire 5307 CPU. The option is now
16942 deprecated in favor of the equivalent -mcpu=5307.
16943
16944 -m5407
16945 Generate output for a ColdFire 5407 CPU. The option is now
16946 deprecated in favor of the equivalent -mcpu=5407.
16947
16948 -mcfv4e
16949 Generate output for a ColdFire V4e family CPU (e.g. 547x/548x).
16950 This includes use of hardware floating-point instructions. The
16951 option is equivalent to -mcpu=547x, and is now deprecated in favor
16952 of that option.
16953
16954 -m68020-40
16955 Generate output for a 68040, without using any of the new
16956 instructions. This results in code that can run relatively
16957 efficiently on either a 68020/68881 or a 68030 or a 68040. The
16958 generated code does use the 68881 instructions that are emulated on
16959 the 68040.
16960
16961 The option is equivalent to -march=68020 -mtune=68020-40.
16962
16963 -m68020-60
16964 Generate output for a 68060, without using any of the new
16965 instructions. This results in code that can run relatively
16966 efficiently on either a 68020/68881 or a 68030 or a 68040. The
16967 generated code does use the 68881 instructions that are emulated on
16968 the 68060.
16969
16970 The option is equivalent to -march=68020 -mtune=68020-60.
16971
16972 -mhard-float
16973 -m68881
16974 Generate floating-point instructions. This is the default for
16975 68020 and above, and for ColdFire devices that have an FPU. It
16976 defines the macro "__HAVE_68881__" on M680x0 targets and
16977 "__mcffpu__" on ColdFire targets.
16978
16979 -msoft-float
16980 Do not generate floating-point instructions; use library calls
16981 instead. This is the default for 68000, 68010, and 68832 targets.
16982 It is also the default for ColdFire devices that have no FPU.
16983
16984 -mdiv
16985 -mno-div
16986 Generate (do not generate) ColdFire hardware divide and remainder
16987 instructions. If -march is used without -mcpu, the default is "on"
16988 for ColdFire architectures and "off" for M680x0 architectures.
16989 Otherwise, the default is taken from the target CPU (either the
16990 default CPU, or the one specified by -mcpu). For example, the
16991 default is "off" for -mcpu=5206 and "on" for -mcpu=5206e.
16992
16993 GCC defines the macro "__mcfhwdiv__" when this option is enabled.
16994
16995 -mshort
16996 Consider type "int" to be 16 bits wide, like "short int".
16997 Additionally, parameters passed on the stack are also aligned to a
16998 16-bit boundary even on targets whose API mandates promotion to
16999 32-bit.
17000
17001 -mno-short
17002 Do not consider type "int" to be 16 bits wide. This is the
17003 default.
17004
17005 -mnobitfield
17006 -mno-bitfield
17007 Do not use the bit-field instructions. The -m68000, -mcpu32 and
17008 -m5200 options imply -mnobitfield.
17009
17010 -mbitfield
17011 Do use the bit-field instructions. The -m68020 option implies
17012 -mbitfield. This is the default if you use a configuration
17013 designed for a 68020.
17014
17015 -mrtd
17016 Use a different function-calling convention, in which functions
17017 that take a fixed number of arguments return with the "rtd"
17018 instruction, which pops their arguments while returning. This
17019 saves one instruction in the caller since there is no need to pop
17020 the arguments there.
17021
17022 This calling convention is incompatible with the one normally used
17023 on Unix, so you cannot use it if you need to call libraries
17024 compiled with the Unix compiler.
17025
17026 Also, you must provide function prototypes for all functions that
17027 take variable numbers of arguments (including "printf"); otherwise
17028 incorrect code is generated for calls to those functions.
17029
17030 In addition, seriously incorrect code results if you call a
17031 function with too many arguments. (Normally, extra arguments are
17032 harmlessly ignored.)
17033
17034 The "rtd" instruction is supported by the 68010, 68020, 68030,
17035 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
17036
17037 -mno-rtd
17038 Do not use the calling conventions selected by -mrtd. This is the
17039 default.
17040
17041 -malign-int
17042 -mno-align-int
17043 Control whether GCC aligns "int", "long", "long long", "float",
17044 "double", and "long double" variables on a 32-bit boundary
17045 (-malign-int) or a 16-bit boundary (-mno-align-int). Aligning
17046 variables on 32-bit boundaries produces code that runs somewhat
17047 faster on processors with 32-bit busses at the expense of more
17048 memory.
17049
17050 Warning: if you use the -malign-int switch, GCC aligns structures
17051 containing the above types differently than most published
17052 application binary interface specifications for the m68k.
17053
17054 -mpcrel
17055 Use the pc-relative addressing mode of the 68000 directly, instead
17056 of using a global offset table. At present, this option implies
17057 -fpic, allowing at most a 16-bit offset for pc-relative addressing.
17058 -fPIC is not presently supported with -mpcrel, though this could be
17059 supported for 68020 and higher processors.
17060
17061 -mno-strict-align
17062 -mstrict-align
17063 Do not (do) assume that unaligned memory references are handled by
17064 the system.
17065
17066 -msep-data
17067 Generate code that allows the data segment to be located in a
17068 different area of memory from the text segment. This allows for
17069 execute-in-place in an environment without virtual memory
17070 management. This option implies -fPIC.
17071
17072 -mno-sep-data
17073 Generate code that assumes that the data segment follows the text
17074 segment. This is the default.
17075
17076 -mid-shared-library
17077 Generate code that supports shared libraries via the library ID
17078 method. This allows for execute-in-place and shared libraries in
17079 an environment without virtual memory management. This option
17080 implies -fPIC.
17081
17082 -mno-id-shared-library
17083 Generate code that doesn't assume ID-based shared libraries are
17084 being used. This is the default.
17085
17086 -mshared-library-id=n
17087 Specifies the identification number of the ID-based shared library
17088 being compiled. Specifying a value of 0 generates more compact
17089 code; specifying other values forces the allocation of that number
17090 to the current library, but is no more space- or time-efficient
17091 than omitting this option.
17092
17093 -mxgot
17094 -mno-xgot
17095 When generating position-independent code for ColdFire, generate
17096 code that works if the GOT has more than 8192 entries. This code
17097 is larger and slower than code generated without this option. On
17098 M680x0 processors, this option is not needed; -fPIC suffices.
17099
17100 GCC normally uses a single instruction to load values from the GOT.
17101 While this is relatively efficient, it only works if the GOT is
17102 smaller than about 64k. Anything larger causes the linker to
17103 report an error such as:
17104
17105 relocation truncated to fit: R_68K_GOT16O foobar
17106
17107 If this happens, you should recompile your code with -mxgot. It
17108 should then work with very large GOTs. However, code generated
17109 with -mxgot is less efficient, since it takes 4 instructions to
17110 fetch the value of a global symbol.
17111
17112 Note that some linkers, including newer versions of the GNU linker,
17113 can create multiple GOTs and sort GOT entries. If you have such a
17114 linker, you should only need to use -mxgot when compiling a single
17115 object file that accesses more than 8192 GOT entries. Very few do.
17116
17117 These options have no effect unless GCC is generating position-
17118 independent code.
17119
17120 -mlong-jump-table-offsets
17121 Use 32-bit offsets in "switch" tables. The default is to use
17122 16-bit offsets.
17123
17124 MCore Options
17125
17126 These are the -m options defined for the Motorola M*Core processors.
17127
17128 -mhardlit
17129 -mno-hardlit
17130 Inline constants into the code stream if it can be done in two
17131 instructions or less.
17132
17133 -mdiv
17134 -mno-div
17135 Use the divide instruction. (Enabled by default).
17136
17137 -mrelax-immediate
17138 -mno-relax-immediate
17139 Allow arbitrary-sized immediates in bit operations.
17140
17141 -mwide-bitfields
17142 -mno-wide-bitfields
17143 Always treat bit-fields as "int"-sized.
17144
17145 -m4byte-functions
17146 -mno-4byte-functions
17147 Force all functions to be aligned to a 4-byte boundary.
17148
17149 -mcallgraph-data
17150 -mno-callgraph-data
17151 Emit callgraph information.
17152
17153 -mslow-bytes
17154 -mno-slow-bytes
17155 Prefer word access when reading byte quantities.
17156
17157 -mlittle-endian
17158 -mbig-endian
17159 Generate code for a little-endian target.
17160
17161 -m210
17162 -m340
17163 Generate code for the 210 processor.
17164
17165 -mno-lsim
17166 Assume that runtime support has been provided and so omit the
17167 simulator library (libsim.a) from the linker command line.
17168
17169 -mstack-increment=size
17170 Set the maximum amount for a single stack increment operation.
17171 Large values can increase the speed of programs that contain
17172 functions that need a large amount of stack space, but they can
17173 also trigger a segmentation fault if the stack is extended too
17174 much. The default value is 0x1000.
17175
17176 MeP Options
17177
17178 -mabsdiff
17179 Enables the "abs" instruction, which is the absolute difference
17180 between two registers.
17181
17182 -mall-opts
17183 Enables all the optional instructions---average, multiply, divide,
17184 bit operations, leading zero, absolute difference, min/max, clip,
17185 and saturation.
17186
17187 -maverage
17188 Enables the "ave" instruction, which computes the average of two
17189 registers.
17190
17191 -mbased=n
17192 Variables of size n bytes or smaller are placed in the ".based"
17193 section by default. Based variables use the $tp register as a base
17194 register, and there is a 128-byte limit to the ".based" section.
17195
17196 -mbitops
17197 Enables the bit operation instructions---bit test ("btstm"), set
17198 ("bsetm"), clear ("bclrm"), invert ("bnotm"), and test-and-set
17199 ("tas").
17200
17201 -mc=name
17202 Selects which section constant data is placed in. name may be
17203 tiny, near, or far.
17204
17205 -mclip
17206 Enables the "clip" instruction. Note that -mclip is not useful
17207 unless you also provide -mminmax.
17208
17209 -mconfig=name
17210 Selects one of the built-in core configurations. Each MeP chip has
17211 one or more modules in it; each module has a core CPU and a variety
17212 of coprocessors, optional instructions, and peripherals. The
17213 "MeP-Integrator" tool, not part of GCC, provides these
17214 configurations through this option; using this option is the same
17215 as using all the corresponding command-line options. The default
17216 configuration is default.
17217
17218 -mcop
17219 Enables the coprocessor instructions. By default, this is a 32-bit
17220 coprocessor. Note that the coprocessor is normally enabled via the
17221 -mconfig= option.
17222
17223 -mcop32
17224 Enables the 32-bit coprocessor's instructions.
17225
17226 -mcop64
17227 Enables the 64-bit coprocessor's instructions.
17228
17229 -mivc2
17230 Enables IVC2 scheduling. IVC2 is a 64-bit VLIW coprocessor.
17231
17232 -mdc
17233 Causes constant variables to be placed in the ".near" section.
17234
17235 -mdiv
17236 Enables the "div" and "divu" instructions.
17237
17238 -meb
17239 Generate big-endian code.
17240
17241 -mel
17242 Generate little-endian code.
17243
17244 -mio-volatile
17245 Tells the compiler that any variable marked with the "io" attribute
17246 is to be considered volatile.
17247
17248 -ml Causes variables to be assigned to the ".far" section by default.
17249
17250 -mleadz
17251 Enables the "leadz" (leading zero) instruction.
17252
17253 -mm Causes variables to be assigned to the ".near" section by default.
17254
17255 -mminmax
17256 Enables the "min" and "max" instructions.
17257
17258 -mmult
17259 Enables the multiplication and multiply-accumulate instructions.
17260
17261 -mno-opts
17262 Disables all the optional instructions enabled by -mall-opts.
17263
17264 -mrepeat
17265 Enables the "repeat" and "erepeat" instructions, used for low-
17266 overhead looping.
17267
17268 -ms Causes all variables to default to the ".tiny" section. Note that
17269 there is a 65536-byte limit to this section. Accesses to these
17270 variables use the %gp base register.
17271
17272 -msatur
17273 Enables the saturation instructions. Note that the compiler does
17274 not currently generate these itself, but this option is included
17275 for compatibility with other tools, like "as".
17276
17277 -msdram
17278 Link the SDRAM-based runtime instead of the default ROM-based
17279 runtime.
17280
17281 -msim
17282 Link the simulator run-time libraries.
17283
17284 -msimnovec
17285 Link the simulator runtime libraries, excluding built-in support
17286 for reset and exception vectors and tables.
17287
17288 -mtf
17289 Causes all functions to default to the ".far" section. Without
17290 this option, functions default to the ".near" section.
17291
17292 -mtiny=n
17293 Variables that are n bytes or smaller are allocated to the ".tiny"
17294 section. These variables use the $gp base register. The default
17295 for this option is 4, but note that there's a 65536-byte limit to
17296 the ".tiny" section.
17297
17298 MicroBlaze Options
17299
17300 -msoft-float
17301 Use software emulation for floating point (default).
17302
17303 -mhard-float
17304 Use hardware floating-point instructions.
17305
17306 -mmemcpy
17307 Do not optimize block moves, use "memcpy".
17308
17309 -mno-clearbss
17310 This option is deprecated. Use -fno-zero-initialized-in-bss
17311 instead.
17312
17313 -mcpu=cpu-type
17314 Use features of, and schedule code for, the given CPU. Supported
17315 values are in the format vX.YY.Z, where X is a major version, YY is
17316 the minor version, and Z is compatibility code. Example values are
17317 v3.00.a, v4.00.b, v5.00.a, v5.00.b, v5.00.b, v6.00.a.
17318
17319 -mxl-soft-mul
17320 Use software multiply emulation (default).
17321
17322 -mxl-soft-div
17323 Use software emulation for divides (default).
17324
17325 -mxl-barrel-shift
17326 Use the hardware barrel shifter.
17327
17328 -mxl-pattern-compare
17329 Use pattern compare instructions.
17330
17331 -msmall-divides
17332 Use table lookup optimization for small signed integer divisions.
17333
17334 -mxl-stack-check
17335 This option is deprecated. Use -fstack-check instead.
17336
17337 -mxl-gp-opt
17338 Use GP-relative ".sdata"/".sbss" sections.
17339
17340 -mxl-multiply-high
17341 Use multiply high instructions for high part of 32x32 multiply.
17342
17343 -mxl-float-convert
17344 Use hardware floating-point conversion instructions.
17345
17346 -mxl-float-sqrt
17347 Use hardware floating-point square root instruction.
17348
17349 -mbig-endian
17350 Generate code for a big-endian target.
17351
17352 -mlittle-endian
17353 Generate code for a little-endian target.
17354
17355 -mxl-reorder
17356 Use reorder instructions (swap and byte reversed load/store).
17357
17358 -mxl-mode-app-model
17359 Select application model app-model. Valid models are
17360
17361 executable
17362 normal executable (default), uses startup code crt0.o.
17363
17364 xmdstub
17365 for use with Xilinx Microprocessor Debugger (XMD) based
17366 software intrusive debug agent called xmdstub. This uses
17367 startup file crt1.o and sets the start address of the program
17368 to 0x800.
17369
17370 bootstrap
17371 for applications that are loaded using a bootloader. This
17372 model uses startup file crt2.o which does not contain a
17373 processor reset vector handler. This is suitable for
17374 transferring control on a processor reset to the bootloader
17375 rather than the application.
17376
17377 novectors
17378 for applications that do not require any of the MicroBlaze
17379 vectors. This option may be useful for applications running
17380 within a monitoring application. This model uses crt3.o as a
17381 startup file.
17382
17383 Option -xl-mode-app-model is a deprecated alias for -mxl-mode-app-
17384 model.
17385
17386 MIPS Options
17387
17388 -EB Generate big-endian code.
17389
17390 -EL Generate little-endian code. This is the default for mips*el-*-*
17391 configurations.
17392
17393 -march=arch
17394 Generate code that runs on arch, which can be the name of a generic
17395 MIPS ISA, or the name of a particular processor. The ISA names
17396 are: mips1, mips2, mips3, mips4, mips32, mips32r2, mips32r3,
17397 mips32r5, mips32r6, mips64, mips64r2, mips64r3, mips64r5 and
17398 mips64r6. The processor names are: 4kc, 4km, 4kp, 4ksc, 4kec,
17399 4kem, 4kep, 4ksd, 5kc, 5kf, 20kc, 24kc, 24kf2_1, 24kf1_1, 24kec,
17400 24kef2_1, 24kef1_1, 34kc, 34kf2_1, 34kf1_1, 34kn, 74kc, 74kf2_1,
17401 74kf1_1, 74kf3_2, 1004kc, 1004kf2_1, 1004kf1_1, i6400, interaptiv,
17402 loongson2e, loongson2f, loongson3a, m4k, m14k, m14kc, m14ke,
17403 m14kec, m5100, m5101, octeon, octeon+, octeon2, octeon3, orion,
17404 p5600, r2000, r3000, r3900, r4000, r4400, r4600, r4650, r4700,
17405 r6000, r8000, rm7000, rm9000, r10000, r12000, r14000, r16000, sb1,
17406 sr71000, vr4100, vr4111, vr4120, vr4130, vr4300, vr5000, vr5400,
17407 vr5500, xlr and xlp. The special value from-abi selects the most
17408 compatible architecture for the selected ABI (that is, mips1 for
17409 32-bit ABIs and mips3 for 64-bit ABIs).
17410
17411 The native Linux/GNU toolchain also supports the value native,
17412 which selects the best architecture option for the host processor.
17413 -march=native has no effect if GCC does not recognize the
17414 processor.
17415
17416 In processor names, a final 000 can be abbreviated as k (for
17417 example, -march=r2k). Prefixes are optional, and vr may be written
17418 r.
17419
17420 Names of the form nf2_1 refer to processors with FPUs clocked at
17421 half the rate of the core, names of the form nf1_1 refer to
17422 processors with FPUs clocked at the same rate as the core, and
17423 names of the form nf3_2 refer to processors with FPUs clocked a
17424 ratio of 3:2 with respect to the core. For compatibility reasons,
17425 nf is accepted as a synonym for nf2_1 while nx and bfx are accepted
17426 as synonyms for nf1_1.
17427
17428 GCC defines two macros based on the value of this option. The
17429 first is "_MIPS_ARCH", which gives the name of target architecture,
17430 as a string. The second has the form "_MIPS_ARCH_foo", where foo
17431 is the capitalized value of "_MIPS_ARCH". For example,
17432 -march=r2000 sets "_MIPS_ARCH" to "r2000" and defines the macro
17433 "_MIPS_ARCH_R2000".
17434
17435 Note that the "_MIPS_ARCH" macro uses the processor names given
17436 above. In other words, it has the full prefix and does not
17437 abbreviate 000 as k. In the case of from-abi, the macro names the
17438 resolved architecture (either "mips1" or "mips3"). It names the
17439 default architecture when no -march option is given.
17440
17441 -mtune=arch
17442 Optimize for arch. Among other things, this option controls the
17443 way instructions are scheduled, and the perceived cost of
17444 arithmetic operations. The list of arch values is the same as for
17445 -march.
17446
17447 When this option is not used, GCC optimizes for the processor
17448 specified by -march. By using -march and -mtune together, it is
17449 possible to generate code that runs on a family of processors, but
17450 optimize the code for one particular member of that family.
17451
17452 -mtune defines the macros "_MIPS_TUNE" and "_MIPS_TUNE_foo", which
17453 work in the same way as the -march ones described above.
17454
17455 -mips1
17456 Equivalent to -march=mips1.
17457
17458 -mips2
17459 Equivalent to -march=mips2.
17460
17461 -mips3
17462 Equivalent to -march=mips3.
17463
17464 -mips4
17465 Equivalent to -march=mips4.
17466
17467 -mips32
17468 Equivalent to -march=mips32.
17469
17470 -mips32r3
17471 Equivalent to -march=mips32r3.
17472
17473 -mips32r5
17474 Equivalent to -march=mips32r5.
17475
17476 -mips32r6
17477 Equivalent to -march=mips32r6.
17478
17479 -mips64
17480 Equivalent to -march=mips64.
17481
17482 -mips64r2
17483 Equivalent to -march=mips64r2.
17484
17485 -mips64r3
17486 Equivalent to -march=mips64r3.
17487
17488 -mips64r5
17489 Equivalent to -march=mips64r5.
17490
17491 -mips64r6
17492 Equivalent to -march=mips64r6.
17493
17494 -mips16
17495 -mno-mips16
17496 Generate (do not generate) MIPS16 code. If GCC is targeting a
17497 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE.
17498
17499 MIPS16 code generation can also be controlled on a per-function
17500 basis by means of "mips16" and "nomips16" attributes.
17501
17502 -mflip-mips16
17503 Generate MIPS16 code on alternating functions. This option is
17504 provided for regression testing of mixed MIPS16/non-MIPS16 code
17505 generation, and is not intended for ordinary use in compiling user
17506 code.
17507
17508 -minterlink-compressed
17509 -mno-interlink-compressed
17510 Require (do not require) that code using the standard
17511 (uncompressed) MIPS ISA be link-compatible with MIPS16 and
17512 microMIPS code, and vice versa.
17513
17514 For example, code using the standard ISA encoding cannot jump
17515 directly to MIPS16 or microMIPS code; it must either use a call or
17516 an indirect jump. -minterlink-compressed therefore disables direct
17517 jumps unless GCC knows that the target of the jump is not
17518 compressed.
17519
17520 -minterlink-mips16
17521 -mno-interlink-mips16
17522 Aliases of -minterlink-compressed and -mno-interlink-compressed.
17523 These options predate the microMIPS ASE and are retained for
17524 backwards compatibility.
17525
17526 -mabi=32
17527 -mabi=o64
17528 -mabi=n32
17529 -mabi=64
17530 -mabi=eabi
17531 Generate code for the given ABI.
17532
17533 Note that the EABI has a 32-bit and a 64-bit variant. GCC normally
17534 generates 64-bit code when you select a 64-bit architecture, but
17535 you can use -mgp32 to get 32-bit code instead.
17536
17537 For information about the O64 ABI, see
17538 <http://gcc.gnu.org/projects/mipso64-abi.html>.
17539
17540 GCC supports a variant of the o32 ABI in which floating-point
17541 registers are 64 rather than 32 bits wide. You can select this
17542 combination with -mabi=32 -mfp64. This ABI relies on the "mthc1"
17543 and "mfhc1" instructions and is therefore only supported for
17544 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
17545
17546 The register assignments for arguments and return values remain the
17547 same, but each scalar value is passed in a single 64-bit register
17548 rather than a pair of 32-bit registers. For example, scalar
17549 floating-point values are returned in $f0 only, not a $f0/$f1 pair.
17550 The set of call-saved registers also remains the same in that the
17551 even-numbered double-precision registers are saved.
17552
17553 Two additional variants of the o32 ABI are supported to enable a
17554 transition from 32-bit to 64-bit registers. These are FPXX
17555 (-mfpxx) and FP64A (-mfp64 -mno-odd-spreg). The FPXX extension
17556 mandates that all code must execute correctly when run using 32-bit
17557 or 64-bit registers. The code can be interlinked with either FP32
17558 or FP64, but not both. The FP64A extension is similar to the FP64
17559 extension but forbids the use of odd-numbered single-precision
17560 registers. This can be used in conjunction with the "FRE" mode of
17561 FPUs in MIPS32R5 processors and allows both FP32 and FP64A code to
17562 interlink and run in the same process without changing FPU modes.
17563
17564 -mabicalls
17565 -mno-abicalls
17566 Generate (do not generate) code that is suitable for SVR4-style
17567 dynamic objects. -mabicalls is the default for SVR4-based systems.
17568
17569 -mshared
17570 -mno-shared
17571 Generate (do not generate) code that is fully position-independent,
17572 and that can therefore be linked into shared libraries. This
17573 option only affects -mabicalls.
17574
17575 All -mabicalls code has traditionally been position-independent,
17576 regardless of options like -fPIC and -fpic. However, as an
17577 extension, the GNU toolchain allows executables to use absolute
17578 accesses for locally-binding symbols. It can also use shorter GP
17579 initialization sequences and generate direct calls to locally-
17580 defined functions. This mode is selected by -mno-shared.
17581
17582 -mno-shared depends on binutils 2.16 or higher and generates
17583 objects that can only be linked by the GNU linker. However, the
17584 option does not affect the ABI of the final executable; it only
17585 affects the ABI of relocatable objects. Using -mno-shared
17586 generally makes executables both smaller and quicker.
17587
17588 -mshared is the default.
17589
17590 -mplt
17591 -mno-plt
17592 Assume (do not assume) that the static and dynamic linkers support
17593 PLTs and copy relocations. This option only affects -mno-shared
17594 -mabicalls. For the n64 ABI, this option has no effect without
17595 -msym32.
17596
17597 You can make -mplt the default by configuring GCC with
17598 --with-mips-plt. The default is -mno-plt otherwise.
17599
17600 -mxgot
17601 -mno-xgot
17602 Lift (do not lift) the usual restrictions on the size of the global
17603 offset table.
17604
17605 GCC normally uses a single instruction to load values from the GOT.
17606 While this is relatively efficient, it only works if the GOT is
17607 smaller than about 64k. Anything larger causes the linker to
17608 report an error such as:
17609
17610 relocation truncated to fit: R_MIPS_GOT16 foobar
17611
17612 If this happens, you should recompile your code with -mxgot. This
17613 works with very large GOTs, although the code is also less
17614 efficient, since it takes three instructions to fetch the value of
17615 a global symbol.
17616
17617 Note that some linkers can create multiple GOTs. If you have such
17618 a linker, you should only need to use -mxgot when a single object
17619 file accesses more than 64k's worth of GOT entries. Very few do.
17620
17621 These options have no effect unless GCC is generating position
17622 independent code.
17623
17624 -mgp32
17625 Assume that general-purpose registers are 32 bits wide.
17626
17627 -mgp64
17628 Assume that general-purpose registers are 64 bits wide.
17629
17630 -mfp32
17631 Assume that floating-point registers are 32 bits wide.
17632
17633 -mfp64
17634 Assume that floating-point registers are 64 bits wide.
17635
17636 -mfpxx
17637 Do not assume the width of floating-point registers.
17638
17639 -mhard-float
17640 Use floating-point coprocessor instructions.
17641
17642 -msoft-float
17643 Do not use floating-point coprocessor instructions. Implement
17644 floating-point calculations using library calls instead.
17645
17646 -mno-float
17647 Equivalent to -msoft-float, but additionally asserts that the
17648 program being compiled does not perform any floating-point
17649 operations. This option is presently supported only by some bare-
17650 metal MIPS configurations, where it may select a special set of
17651 libraries that lack all floating-point support (including, for
17652 example, the floating-point "printf" formats). If code compiled
17653 with -mno-float accidentally contains floating-point operations, it
17654 is likely to suffer a link-time or run-time failure.
17655
17656 -msingle-float
17657 Assume that the floating-point coprocessor only supports single-
17658 precision operations.
17659
17660 -mdouble-float
17661 Assume that the floating-point coprocessor supports double-
17662 precision operations. This is the default.
17663
17664 -modd-spreg
17665 -mno-odd-spreg
17666 Enable the use of odd-numbered single-precision floating-point
17667 registers for the o32 ABI. This is the default for processors that
17668 are known to support these registers. When using the o32 FPXX ABI,
17669 -mno-odd-spreg is set by default.
17670
17671 -mabs=2008
17672 -mabs=legacy
17673 These options control the treatment of the special not-a-number
17674 (NaN) IEEE 754 floating-point data with the "abs.fmt" and "neg.fmt"
17675 machine instructions.
17676
17677 By default or when -mabs=legacy is used the legacy treatment is
17678 selected. In this case these instructions are considered
17679 arithmetic and avoided where correct operation is required and the
17680 input operand might be a NaN. A longer sequence of instructions
17681 that manipulate the sign bit of floating-point datum manually is
17682 used instead unless the -ffinite-math-only option has also been
17683 specified.
17684
17685 The -mabs=2008 option selects the IEEE 754-2008 treatment. In this
17686 case these instructions are considered non-arithmetic and therefore
17687 operating correctly in all cases, including in particular where the
17688 input operand is a NaN. These instructions are therefore always
17689 used for the respective operations.
17690
17691 -mnan=2008
17692 -mnan=legacy
17693 These options control the encoding of the special not-a-number
17694 (NaN) IEEE 754 floating-point data.
17695
17696 The -mnan=legacy option selects the legacy encoding. In this case
17697 quiet NaNs (qNaNs) are denoted by the first bit of their trailing
17698 significand field being 0, whereas signaling NaNs (sNaNs) are
17699 denoted by the first bit of their trailing significand field being
17700 1.
17701
17702 The -mnan=2008 option selects the IEEE 754-2008 encoding. In this
17703 case qNaNs are denoted by the first bit of their trailing
17704 significand field being 1, whereas sNaNs are denoted by the first
17705 bit of their trailing significand field being 0.
17706
17707 The default is -mnan=legacy unless GCC has been configured with
17708 --with-nan=2008.
17709
17710 -mllsc
17711 -mno-llsc
17712 Use (do not use) ll, sc, and sync instructions to implement atomic
17713 memory built-in functions. When neither option is specified, GCC
17714 uses the instructions if the target architecture supports them.
17715
17716 -mllsc is useful if the runtime environment can emulate the
17717 instructions and -mno-llsc can be useful when compiling for
17718 nonstandard ISAs. You can make either option the default by
17719 configuring GCC with --with-llsc and --without-llsc respectively.
17720 --with-llsc is the default for some configurations; see the
17721 installation documentation for details.
17722
17723 -mdsp
17724 -mno-dsp
17725 Use (do not use) revision 1 of the MIPS DSP ASE.
17726 This option defines the preprocessor macro "__mips_dsp". It also
17727 defines "__mips_dsp_rev" to 1.
17728
17729 -mdspr2
17730 -mno-dspr2
17731 Use (do not use) revision 2 of the MIPS DSP ASE.
17732 This option defines the preprocessor macros "__mips_dsp" and
17733 "__mips_dspr2". It also defines "__mips_dsp_rev" to 2.
17734
17735 -msmartmips
17736 -mno-smartmips
17737 Use (do not use) the MIPS SmartMIPS ASE.
17738
17739 -mpaired-single
17740 -mno-paired-single
17741 Use (do not use) paired-single floating-point instructions.
17742 This option requires hardware floating-point support to be
17743 enabled.
17744
17745 -mdmx
17746 -mno-mdmx
17747 Use (do not use) MIPS Digital Media Extension instructions. This
17748 option can only be used when generating 64-bit code and requires
17749 hardware floating-point support to be enabled.
17750
17751 -mips3d
17752 -mno-mips3d
17753 Use (do not use) the MIPS-3D ASE. The option -mips3d implies
17754 -mpaired-single.
17755
17756 -mmicromips
17757 -mno-micromips
17758 Generate (do not generate) microMIPS code.
17759
17760 MicroMIPS code generation can also be controlled on a per-function
17761 basis by means of "micromips" and "nomicromips" attributes.
17762
17763 -mmt
17764 -mno-mt
17765 Use (do not use) MT Multithreading instructions.
17766
17767 -mmcu
17768 -mno-mcu
17769 Use (do not use) the MIPS MCU ASE instructions.
17770
17771 -meva
17772 -mno-eva
17773 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
17774
17775 -mvirt
17776 -mno-virt
17777 Use (do not use) the MIPS Virtualization (VZ) instructions.
17778
17779 -mxpa
17780 -mno-xpa
17781 Use (do not use) the MIPS eXtended Physical Address (XPA)
17782 instructions.
17783
17784 -mlong64
17785 Force "long" types to be 64 bits wide. See -mlong32 for an
17786 explanation of the default and the way that the pointer size is
17787 determined.
17788
17789 -mlong32
17790 Force "long", "int", and pointer types to be 32 bits wide.
17791
17792 The default size of "int"s, "long"s and pointers depends on the
17793 ABI. All the supported ABIs use 32-bit "int"s. The n64 ABI uses
17794 64-bit "long"s, as does the 64-bit EABI; the others use 32-bit
17795 "long"s. Pointers are the same size as "long"s, or the same size
17796 as integer registers, whichever is smaller.
17797
17798 -msym32
17799 -mno-sym32
17800 Assume (do not assume) that all symbols have 32-bit values,
17801 regardless of the selected ABI. This option is useful in
17802 combination with -mabi=64 and -mno-abicalls because it allows GCC
17803 to generate shorter and faster references to symbolic addresses.
17804
17805 -G num
17806 Put definitions of externally-visible data in a small data section
17807 if that data is no bigger than num bytes. GCC can then generate
17808 more efficient accesses to the data; see -mgpopt for details.
17809
17810 The default -G option depends on the configuration.
17811
17812 -mlocal-sdata
17813 -mno-local-sdata
17814 Extend (do not extend) the -G behavior to local data too, such as
17815 to static variables in C. -mlocal-sdata is the default for all
17816 configurations.
17817
17818 If the linker complains that an application is using too much small
17819 data, you might want to try rebuilding the less performance-
17820 critical parts with -mno-local-sdata. You might also want to build
17821 large libraries with -mno-local-sdata, so that the libraries leave
17822 more room for the main program.
17823
17824 -mextern-sdata
17825 -mno-extern-sdata
17826 Assume (do not assume) that externally-defined data is in a small
17827 data section if the size of that data is within the -G limit.
17828 -mextern-sdata is the default for all configurations.
17829
17830 If you compile a module Mod with -mextern-sdata -G num -mgpopt, and
17831 Mod references a variable Var that is no bigger than num bytes, you
17832 must make sure that Var is placed in a small data section. If Var
17833 is defined by another module, you must either compile that module
17834 with a high-enough -G setting or attach a "section" attribute to
17835 Var's definition. If Var is common, you must link the application
17836 with a high-enough -G setting.
17837
17838 The easiest way of satisfying these restrictions is to compile and
17839 link every module with the same -G option. However, you may wish
17840 to build a library that supports several different small data
17841 limits. You can do this by compiling the library with the highest
17842 supported -G setting and additionally using -mno-extern-sdata to
17843 stop the library from making assumptions about externally-defined
17844 data.
17845
17846 -mgpopt
17847 -mno-gpopt
17848 Use (do not use) GP-relative accesses for symbols that are known to
17849 be in a small data section; see -G, -mlocal-sdata and
17850 -mextern-sdata. -mgpopt is the default for all configurations.
17851
17852 -mno-gpopt is useful for cases where the $gp register might not
17853 hold the value of "_gp". For example, if the code is part of a
17854 library that might be used in a boot monitor, programs that call
17855 boot monitor routines pass an unknown value in $gp. (In such
17856 situations, the boot monitor itself is usually compiled with -G0.)
17857
17858 -mno-gpopt implies -mno-local-sdata and -mno-extern-sdata.
17859
17860 -membedded-data
17861 -mno-embedded-data
17862 Allocate variables to the read-only data section first if possible,
17863 then next in the small data section if possible, otherwise in data.
17864 This gives slightly slower code than the default, but reduces the
17865 amount of RAM required when executing, and thus may be preferred
17866 for some embedded systems.
17867
17868 -muninit-const-in-rodata
17869 -mno-uninit-const-in-rodata
17870 Put uninitialized "const" variables in the read-only data section.
17871 This option is only meaningful in conjunction with -membedded-data.
17872
17873 -mcode-readable=setting
17874 Specify whether GCC may generate code that reads from executable
17875 sections. There are three possible settings:
17876
17877 -mcode-readable=yes
17878 Instructions may freely access executable sections. This is
17879 the default setting.
17880
17881 -mcode-readable=pcrel
17882 MIPS16 PC-relative load instructions can access executable
17883 sections, but other instructions must not do so. This option
17884 is useful on 4KSc and 4KSd processors when the code TLBs have
17885 the Read Inhibit bit set. It is also useful on processors that
17886 can be configured to have a dual instruction/data SRAM
17887 interface and that, like the M4K, automatically redirect PC-
17888 relative loads to the instruction RAM.
17889
17890 -mcode-readable=no
17891 Instructions must not access executable sections. This option
17892 can be useful on targets that are configured to have a dual
17893 instruction/data SRAM interface but that (unlike the M4K) do
17894 not automatically redirect PC-relative loads to the instruction
17895 RAM.
17896
17897 -msplit-addresses
17898 -mno-split-addresses
17899 Enable (disable) use of the "%hi()" and "%lo()" assembler
17900 relocation operators. This option has been superseded by
17901 -mexplicit-relocs but is retained for backwards compatibility.
17902
17903 -mexplicit-relocs
17904 -mno-explicit-relocs
17905 Use (do not use) assembler relocation operators when dealing with
17906 symbolic addresses. The alternative, selected by
17907 -mno-explicit-relocs, is to use assembler macros instead.
17908
17909 -mexplicit-relocs is the default if GCC was configured to use an
17910 assembler that supports relocation operators.
17911
17912 -mcheck-zero-division
17913 -mno-check-zero-division
17914 Trap (do not trap) on integer division by zero.
17915
17916 The default is -mcheck-zero-division.
17917
17918 -mdivide-traps
17919 -mdivide-breaks
17920 MIPS systems check for division by zero by generating either a
17921 conditional trap or a break instruction. Using traps results in
17922 smaller code, but is only supported on MIPS II and later. Also,
17923 some versions of the Linux kernel have a bug that prevents trap
17924 from generating the proper signal ("SIGFPE"). Use -mdivide-traps
17925 to allow conditional traps on architectures that support them and
17926 -mdivide-breaks to force the use of breaks.
17927
17928 The default is usually -mdivide-traps, but this can be overridden
17929 at configure time using --with-divide=breaks. Divide-by-zero
17930 checks can be completely disabled using -mno-check-zero-division.
17931
17932 -mload-store-pairs
17933 -mno-load-store-pairs
17934 Enable (disable) an optimization that pairs consecutive load or
17935 store instructions to enable load/store bonding. This option is
17936 enabled by default but only takes effect when the selected
17937 architecture is known to support bonding.
17938
17939 -mmemcpy
17940 -mno-memcpy
17941 Force (do not force) the use of "memcpy" for non-trivial block
17942 moves. The default is -mno-memcpy, which allows GCC to inline most
17943 constant-sized copies.
17944
17945 -mlong-calls
17946 -mno-long-calls
17947 Disable (do not disable) use of the "jal" instruction. Calling
17948 functions using "jal" is more efficient but requires the caller and
17949 callee to be in the same 256 megabyte segment.
17950
17951 This option has no effect on abicalls code. The default is
17952 -mno-long-calls.
17953
17954 -mmad
17955 -mno-mad
17956 Enable (disable) use of the "mad", "madu" and "mul" instructions,
17957 as provided by the R4650 ISA.
17958
17959 -mimadd
17960 -mno-imadd
17961 Enable (disable) use of the "madd" and "msub" integer instructions.
17962 The default is -mimadd on architectures that support "madd" and
17963 "msub" except for the 74k architecture where it was found to
17964 generate slower code.
17965
17966 -mfused-madd
17967 -mno-fused-madd
17968 Enable (disable) use of the floating-point multiply-accumulate
17969 instructions, when they are available. The default is
17970 -mfused-madd.
17971
17972 On the R8000 CPU when multiply-accumulate instructions are used,
17973 the intermediate product is calculated to infinite precision and is
17974 not subject to the FCSR Flush to Zero bit. This may be undesirable
17975 in some circumstances. On other processors the result is
17976 numerically identical to the equivalent computation using separate
17977 multiply, add, subtract and negate instructions.
17978
17979 -nocpp
17980 Tell the MIPS assembler to not run its preprocessor over user
17981 assembler files (with a .s suffix) when assembling them.
17982
17983 -mfix-24k
17984 -mno-fix-24k
17985 Work around the 24K E48 (lost data on stores during refill) errata.
17986 The workarounds are implemented by the assembler rather than by
17987 GCC.
17988
17989 -mfix-r4000
17990 -mno-fix-r4000
17991 Work around certain R4000 CPU errata:
17992
17993 - A double-word or a variable shift may give an incorrect result
17994 if executed immediately after starting an integer division.
17995
17996 - A double-word or a variable shift may give an incorrect result
17997 if executed while an integer multiplication is in progress.
17998
17999 - An integer division may give an incorrect result if started in
18000 a delay slot of a taken branch or a jump.
18001
18002 -mfix-r4400
18003 -mno-fix-r4400
18004 Work around certain R4400 CPU errata:
18005
18006 - A double-word or a variable shift may give an incorrect result
18007 if executed immediately after starting an integer division.
18008
18009 -mfix-r10000
18010 -mno-fix-r10000
18011 Work around certain R10000 errata:
18012
18013 - "ll"/"sc" sequences may not behave atomically on revisions
18014 prior to 3.0. They may deadlock on revisions 2.6 and earlier.
18015
18016 This option can only be used if the target architecture supports
18017 branch-likely instructions. -mfix-r10000 is the default when
18018 -march=r10000 is used; -mno-fix-r10000 is the default otherwise.
18019
18020 -mfix-rm7000
18021 -mno-fix-rm7000
18022 Work around the RM7000 "dmult"/"dmultu" errata. The workarounds
18023 are implemented by the assembler rather than by GCC.
18024
18025 -mfix-vr4120
18026 -mno-fix-vr4120
18027 Work around certain VR4120 errata:
18028
18029 - "dmultu" does not always produce the correct result.
18030
18031 - "div" and "ddiv" do not always produce the correct result if
18032 one of the operands is negative.
18033
18034 The workarounds for the division errata rely on special functions
18035 in libgcc.a. At present, these functions are only provided by the
18036 "mips64vr*-elf" configurations.
18037
18038 Other VR4120 errata require a NOP to be inserted between certain
18039 pairs of instructions. These errata are handled by the assembler,
18040 not by GCC itself.
18041
18042 -mfix-vr4130
18043 Work around the VR4130 "mflo"/"mfhi" errata. The workarounds are
18044 implemented by the assembler rather than by GCC, although GCC
18045 avoids using "mflo" and "mfhi" if the VR4130 "macc", "macchi",
18046 "dmacc" and "dmacchi" instructions are available instead.
18047
18048 -mfix-sb1
18049 -mno-fix-sb1
18050 Work around certain SB-1 CPU core errata. (This flag currently
18051 works around the SB-1 revision 2 "F1" and "F2" floating-point
18052 errata.)
18053
18054 -mr10k-cache-barrier=setting
18055 Specify whether GCC should insert cache barriers to avoid the side
18056 effects of speculation on R10K processors.
18057
18058 In common with many processors, the R10K tries to predict the
18059 outcome of a conditional branch and speculatively executes
18060 instructions from the "taken" branch. It later aborts these
18061 instructions if the predicted outcome is wrong. However, on the
18062 R10K, even aborted instructions can have side effects.
18063
18064 This problem only affects kernel stores and, depending on the
18065 system, kernel loads. As an example, a speculatively-executed
18066 store may load the target memory into cache and mark the cache line
18067 as dirty, even if the store itself is later aborted. If a DMA
18068 operation writes to the same area of memory before the "dirty" line
18069 is flushed, the cached data overwrites the DMA-ed data. See the
18070 R10K processor manual for a full description, including other
18071 potential problems.
18072
18073 One workaround is to insert cache barrier instructions before every
18074 memory access that might be speculatively executed and that might
18075 have side effects even if aborted. -mr10k-cache-barrier=setting
18076 controls GCC's implementation of this workaround. It assumes that
18077 aborted accesses to any byte in the following regions does not have
18078 side effects:
18079
18080 1. the memory occupied by the current function's stack frame;
18081
18082 2. the memory occupied by an incoming stack argument;
18083
18084 3. the memory occupied by an object with a link-time-constant
18085 address.
18086
18087 It is the kernel's responsibility to ensure that speculative
18088 accesses to these regions are indeed safe.
18089
18090 If the input program contains a function declaration such as:
18091
18092 void foo (void);
18093
18094 then the implementation of "foo" must allow "j foo" and "jal foo"
18095 to be executed speculatively. GCC honors this restriction for
18096 functions it compiles itself. It expects non-GCC functions (such
18097 as hand-written assembly code) to do the same.
18098
18099 The option has three forms:
18100
18101 -mr10k-cache-barrier=load-store
18102 Insert a cache barrier before a load or store that might be
18103 speculatively executed and that might have side effects even if
18104 aborted.
18105
18106 -mr10k-cache-barrier=store
18107 Insert a cache barrier before a store that might be
18108 speculatively executed and that might have side effects even if
18109 aborted.
18110
18111 -mr10k-cache-barrier=none
18112 Disable the insertion of cache barriers. This is the default
18113 setting.
18114
18115 -mflush-func=func
18116 -mno-flush-func
18117 Specifies the function to call to flush the I and D caches, or to
18118 not call any such function. If called, the function must take the
18119 same arguments as the common "_flush_func", that is, the address of
18120 the memory range for which the cache is being flushed, the size of
18121 the memory range, and the number 3 (to flush both caches). The
18122 default depends on the target GCC was configured for, but commonly
18123 is either "_flush_func" or "__cpu_flush".
18124
18125 mbranch-cost=num
18126 Set the cost of branches to roughly num "simple" instructions.
18127 This cost is only a heuristic and is not guaranteed to produce
18128 consistent results across releases. A zero cost redundantly
18129 selects the default, which is based on the -mtune setting.
18130
18131 -mbranch-likely
18132 -mno-branch-likely
18133 Enable or disable use of Branch Likely instructions, regardless of
18134 the default for the selected architecture. By default, Branch
18135 Likely instructions may be generated if they are supported by the
18136 selected architecture. An exception is for the MIPS32 and MIPS64
18137 architectures and processors that implement those architectures;
18138 for those, Branch Likely instructions are not be generated by
18139 default because the MIPS32 and MIPS64 architectures specifically
18140 deprecate their use.
18141
18142 -mcompact-branches=never
18143 -mcompact-branches=optimal
18144 -mcompact-branches=always
18145 These options control which form of branches will be generated.
18146 The default is -mcompact-branches=optimal.
18147
18148 The -mcompact-branches=never option ensures that compact branch
18149 instructions will never be generated.
18150
18151 The -mcompact-branches=always option ensures that a compact branch
18152 instruction will be generated if available. If a compact branch
18153 instruction is not available, a delay slot form of the branch will
18154 be used instead.
18155
18156 This option is supported from MIPS Release 6 onwards.
18157
18158 The -mcompact-branches=optimal option will cause a delay slot
18159 branch to be used if one is available in the current ISA and the
18160 delay slot is successfully filled. If the delay slot is not
18161 filled, a compact branch will be chosen if one is available.
18162
18163 -mfp-exceptions
18164 -mno-fp-exceptions
18165 Specifies whether FP exceptions are enabled. This affects how FP
18166 instructions are scheduled for some processors. The default is
18167 that FP exceptions are enabled.
18168
18169 For instance, on the SB-1, if FP exceptions are disabled, and we
18170 are emitting 64-bit code, then we can use both FP pipes.
18171 Otherwise, we can only use one FP pipe.
18172
18173 -mvr4130-align
18174 -mno-vr4130-align
18175 The VR4130 pipeline is two-way superscalar, but can only issue two
18176 instructions together if the first one is 8-byte aligned. When
18177 this option is enabled, GCC aligns pairs of instructions that it
18178 thinks should execute in parallel.
18179
18180 This option only has an effect when optimizing for the VR4130. It
18181 normally makes code faster, but at the expense of making it bigger.
18182 It is enabled by default at optimization level -O3.
18183
18184 -msynci
18185 -mno-synci
18186 Enable (disable) generation of "synci" instructions on
18187 architectures that support it. The "synci" instructions (if
18188 enabled) are generated when "__builtin___clear_cache" is compiled.
18189
18190 This option defaults to -mno-synci, but the default can be
18191 overridden by configuring GCC with --with-synci.
18192
18193 When compiling code for single processor systems, it is generally
18194 safe to use "synci". However, on many multi-core (SMP) systems, it
18195 does not invalidate the instruction caches on all cores and may
18196 lead to undefined behavior.
18197
18198 -mrelax-pic-calls
18199 -mno-relax-pic-calls
18200 Try to turn PIC calls that are normally dispatched via register $25
18201 into direct calls. This is only possible if the linker can resolve
18202 the destination at link time and if the destination is within range
18203 for a direct call.
18204
18205 -mrelax-pic-calls is the default if GCC was configured to use an
18206 assembler and a linker that support the ".reloc" assembly directive
18207 and -mexplicit-relocs is in effect. With -mno-explicit-relocs,
18208 this optimization can be performed by the assembler and the linker
18209 alone without help from the compiler.
18210
18211 -mmcount-ra-address
18212 -mno-mcount-ra-address
18213 Emit (do not emit) code that allows "_mcount" to modify the calling
18214 function's return address. When enabled, this option extends the
18215 usual "_mcount" interface with a new ra-address parameter, which
18216 has type "intptr_t *" and is passed in register $12. "_mcount" can
18217 then modify the return address by doing both of the following:
18218
18219 * Returning the new address in register $31.
18220
18221 * Storing the new address in "*ra-address", if ra-address is
18222 nonnull.
18223
18224 The default is -mno-mcount-ra-address.
18225
18226 -mframe-header-opt
18227 -mno-frame-header-opt
18228 Enable (disable) frame header optimization in the o32 ABI. When
18229 using the o32 ABI, calling functions will allocate 16 bytes on the
18230 stack for the called function to write out register arguments.
18231 When enabled, this optimization will suppress the allocation of the
18232 frame header if it can be determined that it is unused.
18233
18234 This optimization is off by default at all optimization levels.
18235
18236 -mlxc1-sxc1
18237 -mno-lxc1-sxc1
18238 When applicable, enable (disable) the generation of "lwxc1",
18239 "swxc1", "ldxc1", "sdxc1" instructions. Enabled by default.
18240
18241 -mmadd4
18242 -mno-madd4
18243 When applicable, enable (disable) the generation of 4-operand
18244 "madd.s", "madd.d" and related instructions. Enabled by default.
18245
18246 MMIX Options
18247
18248 These options are defined for the MMIX:
18249
18250 -mlibfuncs
18251 -mno-libfuncs
18252 Specify that intrinsic library functions are being compiled,
18253 passing all values in registers, no matter the size.
18254
18255 -mepsilon
18256 -mno-epsilon
18257 Generate floating-point comparison instructions that compare with
18258 respect to the "rE" epsilon register.
18259
18260 -mabi=mmixware
18261 -mabi=gnu
18262 Generate code that passes function parameters and return values
18263 that (in the called function) are seen as registers $0 and up, as
18264 opposed to the GNU ABI which uses global registers $231 and up.
18265
18266 -mzero-extend
18267 -mno-zero-extend
18268 When reading data from memory in sizes shorter than 64 bits, use
18269 (do not use) zero-extending load instructions by default, rather
18270 than sign-extending ones.
18271
18272 -mknuthdiv
18273 -mno-knuthdiv
18274 Make the result of a division yielding a remainder have the same
18275 sign as the divisor. With the default, -mno-knuthdiv, the sign of
18276 the remainder follows the sign of the dividend. Both methods are
18277 arithmetically valid, the latter being almost exclusively used.
18278
18279 -mtoplevel-symbols
18280 -mno-toplevel-symbols
18281 Prepend (do not prepend) a : to all global symbols, so the assembly
18282 code can be used with the "PREFIX" assembly directive.
18283
18284 -melf
18285 Generate an executable in the ELF format, rather than the default
18286 mmo format used by the mmix simulator.
18287
18288 -mbranch-predict
18289 -mno-branch-predict
18290 Use (do not use) the probable-branch instructions, when static
18291 branch prediction indicates a probable branch.
18292
18293 -mbase-addresses
18294 -mno-base-addresses
18295 Generate (do not generate) code that uses base addresses. Using a
18296 base address automatically generates a request (handled by the
18297 assembler and the linker) for a constant to be set up in a global
18298 register. The register is used for one or more base address
18299 requests within the range 0 to 255 from the value held in the
18300 register. The generally leads to short and fast code, but the
18301 number of different data items that can be addressed is limited.
18302 This means that a program that uses lots of static data may require
18303 -mno-base-addresses.
18304
18305 -msingle-exit
18306 -mno-single-exit
18307 Force (do not force) generated code to have a single exit point in
18308 each function.
18309
18310 MN10300 Options
18311
18312 These -m options are defined for Matsushita MN10300 architectures:
18313
18314 -mmult-bug
18315 Generate code to avoid bugs in the multiply instructions for the
18316 MN10300 processors. This is the default.
18317
18318 -mno-mult-bug
18319 Do not generate code to avoid bugs in the multiply instructions for
18320 the MN10300 processors.
18321
18322 -mam33
18323 Generate code using features specific to the AM33 processor.
18324
18325 -mno-am33
18326 Do not generate code using features specific to the AM33 processor.
18327 This is the default.
18328
18329 -mam33-2
18330 Generate code using features specific to the AM33/2.0 processor.
18331
18332 -mam34
18333 Generate code using features specific to the AM34 processor.
18334
18335 -mtune=cpu-type
18336 Use the timing characteristics of the indicated CPU type when
18337 scheduling instructions. This does not change the targeted
18338 processor type. The CPU type must be one of mn10300, am33, am33-2
18339 or am34.
18340
18341 -mreturn-pointer-on-d0
18342 When generating a function that returns a pointer, return the
18343 pointer in both "a0" and "d0". Otherwise, the pointer is returned
18344 only in "a0", and attempts to call such functions without a
18345 prototype result in errors. Note that this option is on by
18346 default; use -mno-return-pointer-on-d0 to disable it.
18347
18348 -mno-crt0
18349 Do not link in the C run-time initialization object file.
18350
18351 -mrelax
18352 Indicate to the linker that it should perform a relaxation
18353 optimization pass to shorten branches, calls and absolute memory
18354 addresses. This option only has an effect when used on the command
18355 line for the final link step.
18356
18357 This option makes symbolic debugging impossible.
18358
18359 -mliw
18360 Allow the compiler to generate Long Instruction Word instructions
18361 if the target is the AM33 or later. This is the default. This
18362 option defines the preprocessor macro "__LIW__".
18363
18364 -mnoliw
18365 Do not allow the compiler to generate Long Instruction Word
18366 instructions. This option defines the preprocessor macro
18367 "__NO_LIW__".
18368
18369 -msetlb
18370 Allow the compiler to generate the SETLB and Lcc instructions if
18371 the target is the AM33 or later. This is the default. This option
18372 defines the preprocessor macro "__SETLB__".
18373
18374 -mnosetlb
18375 Do not allow the compiler to generate SETLB or Lcc instructions.
18376 This option defines the preprocessor macro "__NO_SETLB__".
18377
18378 Moxie Options
18379
18380 -meb
18381 Generate big-endian code. This is the default for moxie-*-*
18382 configurations.
18383
18384 -mel
18385 Generate little-endian code.
18386
18387 -mmul.x
18388 Generate mul.x and umul.x instructions. This is the default for
18389 moxiebox-*-* configurations.
18390
18391 -mno-crt0
18392 Do not link in the C run-time initialization object file.
18393
18394 MSP430 Options
18395
18396 These options are defined for the MSP430:
18397
18398 -masm-hex
18399 Force assembly output to always use hex constants. Normally such
18400 constants are signed decimals, but this option is available for
18401 testsuite and/or aesthetic purposes.
18402
18403 -mmcu=
18404 Select the MCU to target. This is used to create a C preprocessor
18405 symbol based upon the MCU name, converted to upper case and pre-
18406 and post-fixed with __. This in turn is used by the msp430.h
18407 header file to select an MCU-specific supplementary header file.
18408
18409 The option also sets the ISA to use. If the MCU name is one that
18410 is known to only support the 430 ISA then that is selected,
18411 otherwise the 430X ISA is selected. A generic MCU name of msp430
18412 can also be used to select the 430 ISA. Similarly the generic
18413 msp430x MCU name selects the 430X ISA.
18414
18415 In addition an MCU-specific linker script is added to the linker
18416 command line. The script's name is the name of the MCU with .ld
18417 appended. Thus specifying -mmcu=xxx on the gcc command line
18418 defines the C preprocessor symbol "__XXX__" and cause the linker to
18419 search for a script called xxx.ld.
18420
18421 This option is also passed on to the assembler.
18422
18423 -mwarn-mcu
18424 -mno-warn-mcu
18425 This option enables or disables warnings about conflicts between
18426 the MCU name specified by the -mmcu option and the ISA set by the
18427 -mcpu option and/or the hardware multiply support set by the
18428 -mhwmult option. It also toggles warnings about unrecognized MCU
18429 names. This option is on by default.
18430
18431 -mcpu=
18432 Specifies the ISA to use. Accepted values are msp430, msp430x and
18433 msp430xv2. This option is deprecated. The -mmcu= option should be
18434 used to select the ISA.
18435
18436 -msim
18437 Link to the simulator runtime libraries and linker script.
18438 Overrides any scripts that would be selected by the -mmcu= option.
18439
18440 -mlarge
18441 Use large-model addressing (20-bit pointers, 32-bit "size_t").
18442
18443 -msmall
18444 Use small-model addressing (16-bit pointers, 16-bit "size_t").
18445
18446 -mrelax
18447 This option is passed to the assembler and linker, and allows the
18448 linker to perform certain optimizations that cannot be done until
18449 the final link.
18450
18451 mhwmult=
18452 Describes the type of hardware multiply supported by the target.
18453 Accepted values are none for no hardware multiply, 16bit for the
18454 original 16-bit-only multiply supported by early MCUs. 32bit for
18455 the 16/32-bit multiply supported by later MCUs and f5series for the
18456 16/32-bit multiply supported by F5-series MCUs. A value of auto
18457 can also be given. This tells GCC to deduce the hardware multiply
18458 support based upon the MCU name provided by the -mmcu option. If
18459 no -mmcu option is specified or if the MCU name is not recognized
18460 then no hardware multiply support is assumed. "auto" is the
18461 default setting.
18462
18463 Hardware multiplies are normally performed by calling a library
18464 routine. This saves space in the generated code. When compiling
18465 at -O3 or higher however the hardware multiplier is invoked inline.
18466 This makes for bigger, but faster code.
18467
18468 The hardware multiply routines disable interrupts whilst running
18469 and restore the previous interrupt state when they finish. This
18470 makes them safe to use inside interrupt handlers as well as in
18471 normal code.
18472
18473 -minrt
18474 Enable the use of a minimum runtime environment - no static
18475 initializers or constructors. This is intended for memory-
18476 constrained devices. The compiler includes special symbols in some
18477 objects that tell the linker and runtime which code fragments are
18478 required.
18479
18480 -mcode-region=
18481 -mdata-region=
18482 These options tell the compiler where to place functions and data
18483 that do not have one of the "lower", "upper", "either" or "section"
18484 attributes. Possible values are "lower", "upper", "either" or
18485 "any". The first three behave like the corresponding attribute.
18486 The fourth possible value - "any" - is the default. It leaves
18487 placement entirely up to the linker script and how it assigns the
18488 standard sections (".text", ".data", etc) to the memory regions.
18489
18490 -msilicon-errata=
18491 This option passes on a request to assembler to enable the fixes
18492 for the named silicon errata.
18493
18494 -msilicon-errata-warn=
18495 This option passes on a request to the assembler to enable warning
18496 messages when a silicon errata might need to be applied.
18497
18498 NDS32 Options
18499
18500 These options are defined for NDS32 implementations:
18501
18502 -mbig-endian
18503 Generate code in big-endian mode.
18504
18505 -mlittle-endian
18506 Generate code in little-endian mode.
18507
18508 -mreduced-regs
18509 Use reduced-set registers for register allocation.
18510
18511 -mfull-regs
18512 Use full-set registers for register allocation.
18513
18514 -mcmov
18515 Generate conditional move instructions.
18516
18517 -mno-cmov
18518 Do not generate conditional move instructions.
18519
18520 -mext-perf
18521 Generate performance extension instructions.
18522
18523 -mno-ext-perf
18524 Do not generate performance extension instructions.
18525
18526 -mext-perf2
18527 Generate performance extension 2 instructions.
18528
18529 -mno-ext-perf2
18530 Do not generate performance extension 2 instructions.
18531
18532 -mext-string
18533 Generate string extension instructions.
18534
18535 -mno-ext-string
18536 Do not generate string extension instructions.
18537
18538 -mv3push
18539 Generate v3 push25/pop25 instructions.
18540
18541 -mno-v3push
18542 Do not generate v3 push25/pop25 instructions.
18543
18544 -m16-bit
18545 Generate 16-bit instructions.
18546
18547 -mno-16-bit
18548 Do not generate 16-bit instructions.
18549
18550 -misr-vector-size=num
18551 Specify the size of each interrupt vector, which must be 4 or 16.
18552
18553 -mcache-block-size=num
18554 Specify the size of each cache block, which must be a power of 2
18555 between 4 and 512.
18556
18557 -march=arch
18558 Specify the name of the target architecture.
18559
18560 -mcmodel=code-model
18561 Set the code model to one of
18562
18563 small
18564 All the data and read-only data segments must be within 512KB
18565 addressing space. The text segment must be within 16MB
18566 addressing space.
18567
18568 medium
18569 The data segment must be within 512KB while the read-only data
18570 segment can be within 4GB addressing space. The text segment
18571 should be still within 16MB addressing space.
18572
18573 large
18574 All the text and data segments can be within 4GB addressing
18575 space.
18576
18577 -mctor-dtor
18578 Enable constructor/destructor feature.
18579
18580 -mrelax
18581 Guide linker to relax instructions.
18582
18583 Nios II Options
18584
18585 These are the options defined for the Altera Nios II processor.
18586
18587 -G num
18588 Put global and static objects less than or equal to num bytes into
18589 the small data or BSS sections instead of the normal data or BSS
18590 sections. The default value of num is 8.
18591
18592 -mgpopt=option
18593 -mgpopt
18594 -mno-gpopt
18595 Generate (do not generate) GP-relative accesses. The following
18596 option names are recognized:
18597
18598 none
18599 Do not generate GP-relative accesses.
18600
18601 local
18602 Generate GP-relative accesses for small data objects that are
18603 not external, weak, or uninitialized common symbols. Also use
18604 GP-relative addressing for objects that have been explicitly
18605 placed in a small data section via a "section" attribute.
18606
18607 global
18608 As for local, but also generate GP-relative accesses for small
18609 data objects that are external, weak, or common. If you use
18610 this option, you must ensure that all parts of your program
18611 (including libraries) are compiled with the same -G setting.
18612
18613 data
18614 Generate GP-relative accesses for all data objects in the
18615 program. If you use this option, the entire data and BSS
18616 segments of your program must fit in 64K of memory and you must
18617 use an appropriate linker script to allocate them within the
18618 addressable range of the global pointer.
18619
18620 all Generate GP-relative addresses for function pointers as well as
18621 data pointers. If you use this option, the entire text, data,
18622 and BSS segments of your program must fit in 64K of memory and
18623 you must use an appropriate linker script to allocate them
18624 within the addressable range of the global pointer.
18625
18626 -mgpopt is equivalent to -mgpopt=local, and -mno-gpopt is
18627 equivalent to -mgpopt=none.
18628
18629 The default is -mgpopt except when -fpic or -fPIC is specified to
18630 generate position-independent code. Note that the Nios II ABI does
18631 not permit GP-relative accesses from shared libraries.
18632
18633 You may need to specify -mno-gpopt explicitly when building
18634 programs that include large amounts of small data, including large
18635 GOT data sections. In this case, the 16-bit offset for GP-relative
18636 addressing may not be large enough to allow access to the entire
18637 small data section.
18638
18639 -mgprel-sec=regexp
18640 This option specifies additional section names that can be accessed
18641 via GP-relative addressing. It is most useful in conjunction with
18642 "section" attributes on variable declarations and a custom linker
18643 script. The regexp is a POSIX Extended Regular Expression.
18644
18645 This option does not affect the behavior of the -G option, and and
18646 the specified sections are in addition to the standard ".sdata" and
18647 ".sbss" small-data sections that are recognized by -mgpopt.
18648
18649 -mr0rel-sec=regexp
18650 This option specifies names of sections that can be accessed via a
18651 16-bit offset from "r0"; that is, in the low 32K or high 32K of the
18652 32-bit address space. It is most useful in conjunction with
18653 "section" attributes on variable declarations and a custom linker
18654 script. The regexp is a POSIX Extended Regular Expression.
18655
18656 In contrast to the use of GP-relative addressing for small data,
18657 zero-based addressing is never generated by default and there are
18658 no conventional section names used in standard linker scripts for
18659 sections in the low or high areas of memory.
18660
18661 -mel
18662 -meb
18663 Generate little-endian (default) or big-endian (experimental) code,
18664 respectively.
18665
18666 -march=arch
18667 This specifies the name of the target Nios II architecture. GCC
18668 uses this name to determine what kind of instructions it can emit
18669 when generating assembly code. Permissible names are: r1, r2.
18670
18671 The preprocessor macro "__nios2_arch__" is available to programs,
18672 with value 1 or 2, indicating the targeted ISA level.
18673
18674 -mbypass-cache
18675 -mno-bypass-cache
18676 Force all load and store instructions to always bypass cache by
18677 using I/O variants of the instructions. The default is not to
18678 bypass the cache.
18679
18680 -mno-cache-volatile
18681 -mcache-volatile
18682 Volatile memory access bypass the cache using the I/O variants of
18683 the load and store instructions. The default is not to bypass the
18684 cache.
18685
18686 -mno-fast-sw-div
18687 -mfast-sw-div
18688 Do not use table-based fast divide for small numbers. The default
18689 is to use the fast divide at -O3 and above.
18690
18691 -mno-hw-mul
18692 -mhw-mul
18693 -mno-hw-mulx
18694 -mhw-mulx
18695 -mno-hw-div
18696 -mhw-div
18697 Enable or disable emitting "mul", "mulx" and "div" family of
18698 instructions by the compiler. The default is to emit "mul" and not
18699 emit "div" and "mulx".
18700
18701 -mbmx
18702 -mno-bmx
18703 -mcdx
18704 -mno-cdx
18705 Enable or disable generation of Nios II R2 BMX (bit manipulation)
18706 and CDX (code density) instructions. Enabling these instructions
18707 also requires -march=r2. Since these instructions are optional
18708 extensions to the R2 architecture, the default is not to emit them.
18709
18710 -mcustom-insn=N
18711 -mno-custom-insn
18712 Each -mcustom-insn=N option enables use of a custom instruction
18713 with encoding N when generating code that uses insn. For example,
18714 -mcustom-fadds=253 generates custom instruction 253 for single-
18715 precision floating-point add operations instead of the default
18716 behavior of using a library call.
18717
18718 The following values of insn are supported. Except as otherwise
18719 noted, floating-point operations are expected to be implemented
18720 with normal IEEE 754 semantics and correspond directly to the C
18721 operators or the equivalent GCC built-in functions.
18722
18723 Single-precision floating point:
18724
18725 fadds, fsubs, fdivs, fmuls
18726 Binary arithmetic operations.
18727
18728 fnegs
18729 Unary negation.
18730
18731 fabss
18732 Unary absolute value.
18733
18734 fcmpeqs, fcmpges, fcmpgts, fcmples, fcmplts, fcmpnes
18735 Comparison operations.
18736
18737 fmins, fmaxs
18738 Floating-point minimum and maximum. These instructions are
18739 only generated if -ffinite-math-only is specified.
18740
18741 fsqrts
18742 Unary square root operation.
18743
18744 fcoss, fsins, ftans, fatans, fexps, flogs
18745 Floating-point trigonometric and exponential functions. These
18746 instructions are only generated if -funsafe-math-optimizations
18747 is also specified.
18748
18749 Double-precision floating point:
18750
18751 faddd, fsubd, fdivd, fmuld
18752 Binary arithmetic operations.
18753
18754 fnegd
18755 Unary negation.
18756
18757 fabsd
18758 Unary absolute value.
18759
18760 fcmpeqd, fcmpged, fcmpgtd, fcmpled, fcmpltd, fcmpned
18761 Comparison operations.
18762
18763 fmind, fmaxd
18764 Double-precision minimum and maximum. These instructions are
18765 only generated if -ffinite-math-only is specified.
18766
18767 fsqrtd
18768 Unary square root operation.
18769
18770 fcosd, fsind, ftand, fatand, fexpd, flogd
18771 Double-precision trigonometric and exponential functions.
18772 These instructions are only generated if
18773 -funsafe-math-optimizations is also specified.
18774
18775 Conversions:
18776
18777 fextsd
18778 Conversion from single precision to double precision.
18779
18780 ftruncds
18781 Conversion from double precision to single precision.
18782
18783 fixsi, fixsu, fixdi, fixdu
18784 Conversion from floating point to signed or unsigned integer
18785 types, with truncation towards zero.
18786
18787 round
18788 Conversion from single-precision floating point to signed
18789 integer, rounding to the nearest integer and ties away from
18790 zero. This corresponds to the "__builtin_lroundf" function
18791 when -fno-math-errno is used.
18792
18793 floatis, floatus, floatid, floatud
18794 Conversion from signed or unsigned integer types to floating-
18795 point types.
18796
18797 In addition, all of the following transfer instructions for
18798 internal registers X and Y must be provided to use any of the
18799 double-precision floating-point instructions. Custom instructions
18800 taking two double-precision source operands expect the first
18801 operand in the 64-bit register X. The other operand (or only
18802 operand of a unary operation) is given to the custom arithmetic
18803 instruction with the least significant half in source register src1
18804 and the most significant half in src2. A custom instruction that
18805 returns a double-precision result returns the most significant 32
18806 bits in the destination register and the other half in 32-bit
18807 register Y. GCC automatically generates the necessary code
18808 sequences to write register X and/or read register Y when double-
18809 precision floating-point instructions are used.
18810
18811 fwrx
18812 Write src1 into the least significant half of X and src2 into
18813 the most significant half of X.
18814
18815 fwry
18816 Write src1 into Y.
18817
18818 frdxhi, frdxlo
18819 Read the most or least (respectively) significant half of X and
18820 store it in dest.
18821
18822 frdy
18823 Read the value of Y and store it into dest.
18824
18825 Note that you can gain more local control over generation of Nios
18826 II custom instructions by using the "target("custom-insn=N")" and
18827 "target("no-custom-insn")" function attributes or pragmas.
18828
18829 -mcustom-fpu-cfg=name
18830 This option enables a predefined, named set of custom instruction
18831 encodings (see -mcustom-insn above). Currently, the following sets
18832 are defined:
18833
18834 -mcustom-fpu-cfg=60-1 is equivalent to: -mcustom-fmuls=252
18835 -mcustom-fadds=253 -mcustom-fsubs=254 -fsingle-precision-constant
18836
18837 -mcustom-fpu-cfg=60-2 is equivalent to: -mcustom-fmuls=252
18838 -mcustom-fadds=253 -mcustom-fsubs=254 -mcustom-fdivs=255
18839 -fsingle-precision-constant
18840
18841 -mcustom-fpu-cfg=72-3 is equivalent to: -mcustom-floatus=243
18842 -mcustom-fixsi=244 -mcustom-floatis=245 -mcustom-fcmpgts=246
18843 -mcustom-fcmples=249 -mcustom-fcmpeqs=250 -mcustom-fcmpnes=251
18844 -mcustom-fmuls=252 -mcustom-fadds=253 -mcustom-fsubs=254
18845 -mcustom-fdivs=255 -fsingle-precision-constant
18846
18847 Custom instruction assignments given by individual -mcustom-insn=
18848 options override those given by -mcustom-fpu-cfg=, regardless of
18849 the order of the options on the command line.
18850
18851 Note that you can gain more local control over selection of a FPU
18852 configuration by using the "target("custom-fpu-cfg=name")" function
18853 attribute or pragma.
18854
18855 These additional -m options are available for the Altera Nios II ELF
18856 (bare-metal) target:
18857
18858 -mhal
18859 Link with HAL BSP. This suppresses linking with the GCC-provided C
18860 runtime startup and termination code, and is typically used in
18861 conjunction with -msys-crt0= to specify the location of the
18862 alternate startup code provided by the HAL BSP.
18863
18864 -msmallc
18865 Link with a limited version of the C library, -lsmallc, rather than
18866 Newlib.
18867
18868 -msys-crt0=startfile
18869 startfile is the file name of the startfile (crt0) to use when
18870 linking. This option is only useful in conjunction with -mhal.
18871
18872 -msys-lib=systemlib
18873 systemlib is the library name of the library that provides low-
18874 level system calls required by the C library, e.g. "read" and
18875 "write". This option is typically used to link with a library
18876 provided by a HAL BSP.
18877
18878 Nvidia PTX Options
18879
18880 These options are defined for Nvidia PTX:
18881
18882 -m32
18883 -m64
18884 Generate code for 32-bit or 64-bit ABI.
18885
18886 -mmainkernel
18887 Link in code for a __main kernel. This is for stand-alone instead
18888 of offloading execution.
18889
18890 -moptimize
18891 Apply partitioned execution optimizations. This is the default
18892 when any level of optimization is selected.
18893
18894 -msoft-stack
18895 Generate code that does not use ".local" memory directly for stack
18896 storage. Instead, a per-warp stack pointer is maintained
18897 explicitly. This enables variable-length stack allocation (with
18898 variable-length arrays or "alloca"), and when global memory is used
18899 for underlying storage, makes it possible to access automatic
18900 variables from other threads, or with atomic instructions. This
18901 code generation variant is used for OpenMP offloading, but the
18902 option is exposed on its own for the purpose of testing the
18903 compiler; to generate code suitable for linking into programs using
18904 OpenMP offloading, use option -mgomp.
18905
18906 -muniform-simt
18907 Switch to code generation variant that allows to execute all
18908 threads in each warp, while maintaining memory state and side
18909 effects as if only one thread in each warp was active outside of
18910 OpenMP SIMD regions. All atomic operations and calls to runtime
18911 (malloc, free, vprintf) are conditionally executed (iff current
18912 lane index equals the master lane index), and the register being
18913 assigned is copied via a shuffle instruction from the master lane.
18914 Outside of SIMD regions lane 0 is the master; inside, each thread
18915 sees itself as the master. Shared memory array "int __nvptx_uni[]"
18916 stores all-zeros or all-ones bitmasks for each warp, indicating
18917 current mode (0 outside of SIMD regions). Each thread can bitwise-
18918 and the bitmask at position "tid.y" with current lane index to
18919 compute the master lane index.
18920
18921 -mgomp
18922 Generate code for use in OpenMP offloading: enables -msoft-stack
18923 and -muniform-simt options, and selects corresponding multilib
18924 variant.
18925
18926 PDP-11 Options
18927
18928 These options are defined for the PDP-11:
18929
18930 -mfpu
18931 Use hardware FPP floating point. This is the default. (FIS
18932 floating point on the PDP-11/40 is not supported.)
18933
18934 -msoft-float
18935 Do not use hardware floating point.
18936
18937 -mac0
18938 Return floating-point results in ac0 (fr0 in Unix assembler
18939 syntax).
18940
18941 -mno-ac0
18942 Return floating-point results in memory. This is the default.
18943
18944 -m40
18945 Generate code for a PDP-11/40.
18946
18947 -m45
18948 Generate code for a PDP-11/45. This is the default.
18949
18950 -m10
18951 Generate code for a PDP-11/10.
18952
18953 -mbcopy-builtin
18954 Use inline "movmemhi" patterns for copying memory. This is the
18955 default.
18956
18957 -mbcopy
18958 Do not use inline "movmemhi" patterns for copying memory.
18959
18960 -mint16
18961 -mno-int32
18962 Use 16-bit "int". This is the default.
18963
18964 -mint32
18965 -mno-int16
18966 Use 32-bit "int".
18967
18968 -mfloat64
18969 -mno-float32
18970 Use 64-bit "float". This is the default.
18971
18972 -mfloat32
18973 -mno-float64
18974 Use 32-bit "float".
18975
18976 -mabshi
18977 Use "abshi2" pattern. This is the default.
18978
18979 -mno-abshi
18980 Do not use "abshi2" pattern.
18981
18982 -mbranch-expensive
18983 Pretend that branches are expensive. This is for experimenting
18984 with code generation only.
18985
18986 -mbranch-cheap
18987 Do not pretend that branches are expensive. This is the default.
18988
18989 -munix-asm
18990 Use Unix assembler syntax. This is the default when configured for
18991 pdp11-*-bsd.
18992
18993 -mdec-asm
18994 Use DEC assembler syntax. This is the default when configured for
18995 any PDP-11 target other than pdp11-*-bsd.
18996
18997 picoChip Options
18998
18999 These -m options are defined for picoChip implementations:
19000
19001 -mae=ae_type
19002 Set the instruction set, register set, and instruction scheduling
19003 parameters for array element type ae_type. Supported values for
19004 ae_type are ANY, MUL, and MAC.
19005
19006 -mae=ANY selects a completely generic AE type. Code generated with
19007 this option runs on any of the other AE types. The code is not as
19008 efficient as it would be if compiled for a specific AE type, and
19009 some types of operation (e.g., multiplication) do not work properly
19010 on all types of AE.
19011
19012 -mae=MUL selects a MUL AE type. This is the most useful AE type
19013 for compiled code, and is the default.
19014
19015 -mae=MAC selects a DSP-style MAC AE. Code compiled with this
19016 option may suffer from poor performance of byte (char)
19017 manipulation, since the DSP AE does not provide hardware support
19018 for byte load/stores.
19019
19020 -msymbol-as-address
19021 Enable the compiler to directly use a symbol name as an address in
19022 a load/store instruction, without first loading it into a register.
19023 Typically, the use of this option generates larger programs, which
19024 run faster than when the option isn't used. However, the results
19025 vary from program to program, so it is left as a user option,
19026 rather than being permanently enabled.
19027
19028 -mno-inefficient-warnings
19029 Disables warnings about the generation of inefficient code. These
19030 warnings can be generated, for example, when compiling code that
19031 performs byte-level memory operations on the MAC AE type. The MAC
19032 AE has no hardware support for byte-level memory operations, so all
19033 byte load/stores must be synthesized from word load/store
19034 operations. This is inefficient and a warning is generated to
19035 indicate that you should rewrite the code to avoid byte operations,
19036 or to target an AE type that has the necessary hardware support.
19037 This option disables these warnings.
19038
19039 PowerPC Options
19040
19041 These are listed under
19042
19043 PowerPC SPE Options
19044
19045 These -m options are defined for PowerPC SPE:
19046
19047 -mmfcrf
19048 -mno-mfcrf
19049 -mpopcntb
19050 -mno-popcntb
19051 You use these options to specify which instructions are available
19052 on the processor you are using. The default value of these options
19053 is determined when configuring GCC. Specifying the -mcpu=cpu_type
19054 overrides the specification of these options. We recommend you use
19055 the -mcpu=cpu_type option rather than the options listed above.
19056
19057 The -mmfcrf option allows GCC to generate the move from condition
19058 register field instruction implemented on the POWER4 processor and
19059 other processors that support the PowerPC V2.01 architecture. The
19060 -mpopcntb option allows GCC to generate the popcount and double-
19061 precision FP reciprocal estimate instruction implemented on the
19062 POWER5 processor and other processors that support the PowerPC
19063 V2.02 architecture.
19064
19065 -mcpu=cpu_type
19066 Set architecture type, register usage, and instruction scheduling
19067 parameters for machine type cpu_type. Supported values for
19068 cpu_type are 8540, 8548, and native.
19069
19070 -mcpu=powerpc specifies pure 32-bit PowerPC (either endian), with
19071 an appropriate, generic processor model assumed for scheduling
19072 purposes.
19073
19074 Specifying native as cpu type detects and selects the architecture
19075 option that corresponds to the host processor of the system
19076 performing the compilation. -mcpu=native has no effect if GCC does
19077 not recognize the processor.
19078
19079 The other options specify a specific processor. Code generated
19080 under those options runs best on that processor, and may not run at
19081 all on others.
19082
19083 The -mcpu options automatically enable or disable the following
19084 options:
19085
19086 -mhard-float -mmfcrf -mmultiple -mpopcntb -mpopcntd
19087 -msingle-float -mdouble-float -mfloat128
19088
19089 The particular options set for any particular CPU varies between
19090 compiler versions, depending on what setting seems to produce
19091 optimal code for that CPU; it doesn't necessarily reflect the
19092 actual hardware's capabilities. If you wish to set an individual
19093 option to a particular value, you may specify it after the -mcpu
19094 option, like -mcpu=8548.
19095
19096 -mtune=cpu_type
19097 Set the instruction scheduling parameters for machine type
19098 cpu_type, but do not set the architecture type or register usage,
19099 as -mcpu=cpu_type does. The same values for cpu_type are used for
19100 -mtune as for -mcpu. If both are specified, the code generated
19101 uses the architecture and registers set by -mcpu, but the
19102 scheduling parameters set by -mtune.
19103
19104 -msecure-plt
19105 Generate code that allows ld and ld.so to build executables and
19106 shared libraries with non-executable ".plt" and ".got" sections.
19107 This is a PowerPC 32-bit SYSV ABI option.
19108
19109 -mbss-plt
19110 Generate code that uses a BSS ".plt" section that ld.so fills in,
19111 and requires ".plt" and ".got" sections that are both writable and
19112 executable. This is a PowerPC 32-bit SYSV ABI option.
19113
19114 -misel
19115 -mno-isel
19116 This switch enables or disables the generation of ISEL
19117 instructions.
19118
19119 -misel=yes/no
19120 This switch has been deprecated. Use -misel and -mno-isel instead.
19121
19122 -mspe
19123 -mno-spe
19124 This switch enables or disables the generation of SPE simd
19125 instructions.
19126
19127 -mspe=yes/no
19128 This option has been deprecated. Use -mspe and -mno-spe instead.
19129
19130 -mfloat128
19131 -mno-float128
19132 Enable/disable the __float128 keyword for IEEE 128-bit floating
19133 point and use either software emulation for IEEE 128-bit floating
19134 point or hardware instructions.
19135
19136 -mfloat-gprs=yes/single/double/no
19137 -mfloat-gprs
19138 This switch enables or disables the generation of floating-point
19139 operations on the general-purpose registers for architectures that
19140 support it.
19141
19142 The argument yes or single enables the use of single-precision
19143 floating-point operations.
19144
19145 The argument double enables the use of single and double-precision
19146 floating-point operations.
19147
19148 The argument no disables floating-point operations on the general-
19149 purpose registers.
19150
19151 This option is currently only available on the MPC854x.
19152
19153 -mfull-toc
19154 -mno-fp-in-toc
19155 -mno-sum-in-toc
19156 -mminimal-toc
19157 Modify generation of the TOC (Table Of Contents), which is created
19158 for every executable file. The -mfull-toc option is selected by
19159 default. In that case, GCC allocates at least one TOC entry for
19160 each unique non-automatic variable reference in your program. GCC
19161 also places floating-point constants in the TOC. However, only
19162 16,384 entries are available in the TOC.
19163
19164 If you receive a linker error message that saying you have
19165 overflowed the available TOC space, you can reduce the amount of
19166 TOC space used with the -mno-fp-in-toc and -mno-sum-in-toc options.
19167 -mno-fp-in-toc prevents GCC from putting floating-point constants
19168 in the TOC and -mno-sum-in-toc forces GCC to generate code to
19169 calculate the sum of an address and a constant at run time instead
19170 of putting that sum into the TOC. You may specify one or both of
19171 these options. Each causes GCC to produce very slightly slower and
19172 larger code at the expense of conserving TOC space.
19173
19174 If you still run out of space in the TOC even when you specify both
19175 of these options, specify -mminimal-toc instead. This option
19176 causes GCC to make only one TOC entry for every file. When you
19177 specify this option, GCC produces code that is slower and larger
19178 but which uses extremely little TOC space. You may wish to use
19179 this option only on files that contain less frequently-executed
19180 code.
19181
19182 -maix32
19183 Disables the 64-bit ABI. GCC defaults to -maix32.
19184
19185 -mxl-compat
19186 -mno-xl-compat
19187 Produce code that conforms more closely to IBM XL compiler
19188 semantics when using AIX-compatible ABI. Pass floating-point
19189 arguments to prototyped functions beyond the register save area
19190 (RSA) on the stack in addition to argument FPRs. Do not assume
19191 that most significant double in 128-bit long double value is
19192 properly rounded when comparing values and converting to double.
19193 Use XL symbol names for long double support routines.
19194
19195 The AIX calling convention was extended but not initially
19196 documented to handle an obscure K&R C case of calling a function
19197 that takes the address of its arguments with fewer arguments than
19198 declared. IBM XL compilers access floating-point arguments that do
19199 not fit in the RSA from the stack when a subroutine is compiled
19200 without optimization. Because always storing floating-point
19201 arguments on the stack is inefficient and rarely needed, this
19202 option is not enabled by default and only is necessary when calling
19203 subroutines compiled by IBM XL compilers without optimization.
19204
19205 -malign-natural
19206 -malign-power
19207 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
19208 -malign-natural overrides the ABI-defined alignment of larger
19209 types, such as floating-point doubles, on their natural size-based
19210 boundary. The option -malign-power instructs GCC to follow the
19211 ABI-specified alignment rules. GCC defaults to the standard
19212 alignment defined in the ABI.
19213
19214 On 64-bit Darwin, natural alignment is the default, and
19215 -malign-power is not supported.
19216
19217 -msoft-float
19218 -mhard-float
19219 Generate code that does not use (uses) the floating-point register
19220 set. Software floating-point emulation is provided if you use the
19221 -msoft-float option, and pass the option to GCC when linking.
19222
19223 -msingle-float
19224 -mdouble-float
19225 Generate code for single- or double-precision floating-point
19226 operations. -mdouble-float implies -msingle-float.
19227
19228 -mmultiple
19229 -mno-multiple
19230 Generate code that uses (does not use) the load multiple word
19231 instructions and the store multiple word instructions. These
19232 instructions are generated by default on POWER systems, and not
19233 generated on PowerPC systems. Do not use -mmultiple on little-
19234 endian PowerPC systems, since those instructions do not work when
19235 the processor is in little-endian mode. The exceptions are PPC740
19236 and PPC750 which permit these instructions in little-endian mode.
19237
19238 -mupdate
19239 -mno-update
19240 Generate code that uses (does not use) the load or store
19241 instructions that update the base register to the address of the
19242 calculated memory location. These instructions are generated by
19243 default. If you use -mno-update, there is a small window between
19244 the time that the stack pointer is updated and the address of the
19245 previous frame is stored, which means code that walks the stack
19246 frame across interrupts or signals may get corrupted data.
19247
19248 -mavoid-indexed-addresses
19249 -mno-avoid-indexed-addresses
19250 Generate code that tries to avoid (not avoid) the use of indexed
19251 load or store instructions. These instructions can incur a
19252 performance penalty on Power6 processors in certain situations,
19253 such as when stepping through large arrays that cross a 16M
19254 boundary. This option is enabled by default when targeting Power6
19255 and disabled otherwise.
19256
19257 -mfused-madd
19258 -mno-fused-madd
19259 Generate code that uses (does not use) the floating-point multiply
19260 and accumulate instructions. These instructions are generated by
19261 default if hardware floating point is used. The machine-dependent
19262 -mfused-madd option is now mapped to the machine-independent
19263 -ffp-contract=fast option, and -mno-fused-madd is mapped to
19264 -ffp-contract=off.
19265
19266 -mno-strict-align
19267 -mstrict-align
19268 On System V.4 and embedded PowerPC systems do not (do) assume that
19269 unaligned memory references are handled by the system.
19270
19271 -mrelocatable
19272 -mno-relocatable
19273 Generate code that allows (does not allow) a static executable to
19274 be relocated to a different address at run time. A simple embedded
19275 PowerPC system loader should relocate the entire contents of
19276 ".got2" and 4-byte locations listed in the ".fixup" section, a
19277 table of 32-bit addresses generated by this option. For this to
19278 work, all objects linked together must be compiled with
19279 -mrelocatable or -mrelocatable-lib. -mrelocatable code aligns the
19280 stack to an 8-byte boundary.
19281
19282 -mrelocatable-lib
19283 -mno-relocatable-lib
19284 Like -mrelocatable, -mrelocatable-lib generates a ".fixup" section
19285 to allow static executables to be relocated at run time, but
19286 -mrelocatable-lib does not use the smaller stack alignment of
19287 -mrelocatable. Objects compiled with -mrelocatable-lib may be
19288 linked with objects compiled with any combination of the
19289 -mrelocatable options.
19290
19291 -mno-toc
19292 -mtoc
19293 On System V.4 and embedded PowerPC systems do not (do) assume that
19294 register 2 contains a pointer to a global area pointing to the
19295 addresses used in the program.
19296
19297 -mlittle
19298 -mlittle-endian
19299 On System V.4 and embedded PowerPC systems compile code for the
19300 processor in little-endian mode. The -mlittle-endian option is the
19301 same as -mlittle.
19302
19303 -mbig
19304 -mbig-endian
19305 On System V.4 and embedded PowerPC systems compile code for the
19306 processor in big-endian mode. The -mbig-endian option is the same
19307 as -mbig.
19308
19309 -mdynamic-no-pic
19310 On Darwin and Mac OS X systems, compile code so that it is not
19311 relocatable, but that its external references are relocatable. The
19312 resulting code is suitable for applications, but not shared
19313 libraries.
19314
19315 -msingle-pic-base
19316 Treat the register used for PIC addressing as read-only, rather
19317 than loading it in the prologue for each function. The runtime
19318 system is responsible for initializing this register with an
19319 appropriate value before execution begins.
19320
19321 -mprioritize-restricted-insns=priority
19322 This option controls the priority that is assigned to dispatch-slot
19323 restricted instructions during the second scheduling pass. The
19324 argument priority takes the value 0, 1, or 2 to assign no, highest,
19325 or second-highest (respectively) priority to dispatch-slot
19326 restricted instructions.
19327
19328 -msched-costly-dep=dependence_type
19329 This option controls which dependences are considered costly by the
19330 target during instruction scheduling. The argument dependence_type
19331 takes one of the following values:
19332
19333 no No dependence is costly.
19334
19335 all All dependences are costly.
19336
19337 true_store_to_load
19338 A true dependence from store to load is costly.
19339
19340 store_to_load
19341 Any dependence from store to load is costly.
19342
19343 number
19344 Any dependence for which the latency is greater than or equal
19345 to number is costly.
19346
19347 -minsert-sched-nops=scheme
19348 This option controls which NOP insertion scheme is used during the
19349 second scheduling pass. The argument scheme takes one of the
19350 following values:
19351
19352 no Don't insert NOPs.
19353
19354 pad Pad with NOPs any dispatch group that has vacant issue slots,
19355 according to the scheduler's grouping.
19356
19357 regroup_exact
19358 Insert NOPs to force costly dependent insns into separate
19359 groups. Insert exactly as many NOPs as needed to force an insn
19360 to a new group, according to the estimated processor grouping.
19361
19362 number
19363 Insert NOPs to force costly dependent insns into separate
19364 groups. Insert number NOPs to force an insn to a new group.
19365
19366 -mcall-sysv
19367 On System V.4 and embedded PowerPC systems compile code using
19368 calling conventions that adhere to the March 1995 draft of the
19369 System V Application Binary Interface, PowerPC processor
19370 supplement. This is the default unless you configured GCC using
19371 powerpc-*-eabiaix.
19372
19373 -mcall-sysv-eabi
19374 -mcall-eabi
19375 Specify both -mcall-sysv and -meabi options.
19376
19377 -mcall-sysv-noeabi
19378 Specify both -mcall-sysv and -mno-eabi options.
19379
19380 -mcall-aixdesc
19381 On System V.4 and embedded PowerPC systems compile code for the AIX
19382 operating system.
19383
19384 -mcall-linux
19385 On System V.4 and embedded PowerPC systems compile code for the
19386 Linux-based GNU system.
19387
19388 -mcall-freebsd
19389 On System V.4 and embedded PowerPC systems compile code for the
19390 FreeBSD operating system.
19391
19392 -mcall-netbsd
19393 On System V.4 and embedded PowerPC systems compile code for the
19394 NetBSD operating system.
19395
19396 -mcall-openbsd
19397 On System V.4 and embedded PowerPC systems compile code for the
19398 OpenBSD operating system.
19399
19400 -maix-struct-return
19401 Return all structures in memory (as specified by the AIX ABI).
19402
19403 -msvr4-struct-return
19404 Return structures smaller than 8 bytes in registers (as specified
19405 by the SVR4 ABI).
19406
19407 -mabi=abi-type
19408 Extend the current ABI with a particular extension, or remove such
19409 extension. Valid values are altivec, no-altivec, spe, no-spe,
19410 ibmlongdouble, ieeelongdouble, elfv1, elfv2.
19411
19412 -mabi=spe
19413 Extend the current ABI with SPE ABI extensions. This does not
19414 change the default ABI, instead it adds the SPE ABI extensions to
19415 the current ABI.
19416
19417 -mabi=no-spe
19418 Disable Book-E SPE ABI extensions for the current ABI.
19419
19420 -mabi=ibmlongdouble
19421 Change the current ABI to use IBM extended-precision long double.
19422 This is not likely to work if your system defaults to using IEEE
19423 extended-precision long double. If you change the long double type
19424 from IEEE extended-precision, the compiler will issue a warning
19425 unless you use the -Wno-psabi option.
19426
19427 -mabi=ieeelongdouble
19428 Change the current ABI to use IEEE extended-precision long double.
19429 This is not likely to work if your system defaults to using IBM
19430 extended-precision long double. If you change the long double type
19431 from IBM extended-precision, the compiler will issue a warning
19432 unless you use the -Wno-psabi option.
19433
19434 -mabi=elfv1
19435 Change the current ABI to use the ELFv1 ABI. This is the default
19436 ABI for big-endian PowerPC 64-bit Linux. Overriding the default
19437 ABI requires special system support and is likely to fail in
19438 spectacular ways.
19439
19440 -mabi=elfv2
19441 Change the current ABI to use the ELFv2 ABI. This is the default
19442 ABI for little-endian PowerPC 64-bit Linux. Overriding the default
19443 ABI requires special system support and is likely to fail in
19444 spectacular ways.
19445
19446 -mgnu-attribute
19447 -mno-gnu-attribute
19448 Emit .gnu_attribute assembly directives to set tag/value pairs in a
19449 .gnu.attributes section that specify ABI variations in function
19450 parameters or return values.
19451
19452 -mprototype
19453 -mno-prototype
19454 On System V.4 and embedded PowerPC systems assume that all calls to
19455 variable argument functions are properly prototyped. Otherwise,
19456 the compiler must insert an instruction before every non-prototyped
19457 call to set or clear bit 6 of the condition code register ("CR") to
19458 indicate whether floating-point values are passed in the floating-
19459 point registers in case the function takes variable arguments.
19460 With -mprototype, only calls to prototyped variable argument
19461 functions set or clear the bit.
19462
19463 -msim
19464 On embedded PowerPC systems, assume that the startup module is
19465 called sim-crt0.o and that the standard C libraries are libsim.a
19466 and libc.a. This is the default for powerpc-*-eabisim
19467 configurations.
19468
19469 -mmvme
19470 On embedded PowerPC systems, assume that the startup module is
19471 called crt0.o and the standard C libraries are libmvme.a and
19472 libc.a.
19473
19474 -mads
19475 On embedded PowerPC systems, assume that the startup module is
19476 called crt0.o and the standard C libraries are libads.a and libc.a.
19477
19478 -myellowknife
19479 On embedded PowerPC systems, assume that the startup module is
19480 called crt0.o and the standard C libraries are libyk.a and libc.a.
19481
19482 -mvxworks
19483 On System V.4 and embedded PowerPC systems, specify that you are
19484 compiling for a VxWorks system.
19485
19486 -memb
19487 On embedded PowerPC systems, set the "PPC_EMB" bit in the ELF flags
19488 header to indicate that eabi extended relocations are used.
19489
19490 -meabi
19491 -mno-eabi
19492 On System V.4 and embedded PowerPC systems do (do not) adhere to
19493 the Embedded Applications Binary Interface (EABI), which is a set
19494 of modifications to the System V.4 specifications. Selecting
19495 -meabi means that the stack is aligned to an 8-byte boundary, a
19496 function "__eabi" is called from "main" to set up the EABI
19497 environment, and the -msdata option can use both "r2" and "r13" to
19498 point to two separate small data areas. Selecting -mno-eabi means
19499 that the stack is aligned to a 16-byte boundary, no EABI
19500 initialization function is called from "main", and the -msdata
19501 option only uses "r13" to point to a single small data area. The
19502 -meabi option is on by default if you configured GCC using one of
19503 the powerpc*-*-eabi* options.
19504
19505 -msdata=eabi
19506 On System V.4 and embedded PowerPC systems, put small initialized
19507 "const" global and static data in the ".sdata2" section, which is
19508 pointed to by register "r2". Put small initialized non-"const"
19509 global and static data in the ".sdata" section, which is pointed to
19510 by register "r13". Put small uninitialized global and static data
19511 in the ".sbss" section, which is adjacent to the ".sdata" section.
19512 The -msdata=eabi option is incompatible with the -mrelocatable
19513 option. The -msdata=eabi option also sets the -memb option.
19514
19515 -msdata=sysv
19516 On System V.4 and embedded PowerPC systems, put small global and
19517 static data in the ".sdata" section, which is pointed to by
19518 register "r13". Put small uninitialized global and static data in
19519 the ".sbss" section, which is adjacent to the ".sdata" section.
19520 The -msdata=sysv option is incompatible with the -mrelocatable
19521 option.
19522
19523 -msdata=default
19524 -msdata
19525 On System V.4 and embedded PowerPC systems, if -meabi is used,
19526 compile code the same as -msdata=eabi, otherwise compile code the
19527 same as -msdata=sysv.
19528
19529 -msdata=data
19530 On System V.4 and embedded PowerPC systems, put small global data
19531 in the ".sdata" section. Put small uninitialized global data in
19532 the ".sbss" section. Do not use register "r13" to address small
19533 data however. This is the default behavior unless other -msdata
19534 options are used.
19535
19536 -msdata=none
19537 -mno-sdata
19538 On embedded PowerPC systems, put all initialized global and static
19539 data in the ".data" section, and all uninitialized data in the
19540 ".bss" section.
19541
19542 -mblock-move-inline-limit=num
19543 Inline all block moves (such as calls to "memcpy" or structure
19544 copies) less than or equal to num bytes. The minimum value for num
19545 is 32 bytes on 32-bit targets and 64 bytes on 64-bit targets. The
19546 default value is target-specific.
19547
19548 -G num
19549 On embedded PowerPC systems, put global and static items less than
19550 or equal to num bytes into the small data or BSS sections instead
19551 of the normal data or BSS section. By default, num is 8. The -G
19552 num switch is also passed to the linker. All modules should be
19553 compiled with the same -G num value.
19554
19555 -mregnames
19556 -mno-regnames
19557 On System V.4 and embedded PowerPC systems do (do not) emit
19558 register names in the assembly language output using symbolic
19559 forms.
19560
19561 -mlongcall
19562 -mno-longcall
19563 By default assume that all calls are far away so that a longer and
19564 more expensive calling sequence is required. This is required for
19565 calls farther than 32 megabytes (33,554,432 bytes) from the current
19566 location. A short call is generated if the compiler knows the call
19567 cannot be that far away. This setting can be overridden by the
19568 "shortcall" function attribute, or by "#pragma longcall(0)".
19569
19570 Some linkers are capable of detecting out-of-range calls and
19571 generating glue code on the fly. On these systems, long calls are
19572 unnecessary and generate slower code. As of this writing, the AIX
19573 linker can do this, as can the GNU linker for PowerPC/64. It is
19574 planned to add this feature to the GNU linker for 32-bit PowerPC
19575 systems as well.
19576
19577 In the future, GCC may ignore all longcall specifications when the
19578 linker is known to generate glue.
19579
19580 -mtls-markers
19581 -mno-tls-markers
19582 Mark (do not mark) calls to "__tls_get_addr" with a relocation
19583 specifying the function argument. The relocation allows the linker
19584 to reliably associate function call with argument setup
19585 instructions for TLS optimization, which in turn allows GCC to
19586 better schedule the sequence.
19587
19588 -mrecip
19589 -mno-recip
19590 This option enables use of the reciprocal estimate and reciprocal
19591 square root estimate instructions with additional Newton-Raphson
19592 steps to increase precision instead of doing a divide or square
19593 root and divide for floating-point arguments. You should use the
19594 -ffast-math option when using -mrecip (or at least
19595 -funsafe-math-optimizations, -ffinite-math-only, -freciprocal-math
19596 and -fno-trapping-math). Note that while the throughput of the
19597 sequence is generally higher than the throughput of the non-
19598 reciprocal instruction, the precision of the sequence can be
19599 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals
19600 0.99999994) for reciprocal square roots.
19601
19602 -mrecip=opt
19603 This option controls which reciprocal estimate instructions may be
19604 used. opt is a comma-separated list of options, which may be
19605 preceded by a "!" to invert the option:
19606
19607 all Enable all estimate instructions.
19608
19609 default
19610 Enable the default instructions, equivalent to -mrecip.
19611
19612 none
19613 Disable all estimate instructions, equivalent to -mno-recip.
19614
19615 div Enable the reciprocal approximation instructions for both
19616 single and double precision.
19617
19618 divf
19619 Enable the single-precision reciprocal approximation
19620 instructions.
19621
19622 divd
19623 Enable the double-precision reciprocal approximation
19624 instructions.
19625
19626 rsqrt
19627 Enable the reciprocal square root approximation instructions
19628 for both single and double precision.
19629
19630 rsqrtf
19631 Enable the single-precision reciprocal square root
19632 approximation instructions.
19633
19634 rsqrtd
19635 Enable the double-precision reciprocal square root
19636 approximation instructions.
19637
19638 So, for example, -mrecip=all,!rsqrtd enables all of the reciprocal
19639 estimate instructions, except for the "FRSQRTE", "XSRSQRTEDP", and
19640 "XVRSQRTEDP" instructions which handle the double-precision
19641 reciprocal square root calculations.
19642
19643 -mrecip-precision
19644 -mno-recip-precision
19645 Assume (do not assume) that the reciprocal estimate instructions
19646 provide higher-precision estimates than is mandated by the PowerPC
19647 ABI. Selecting -mcpu=power6, -mcpu=power7 or -mcpu=power8
19648 automatically selects -mrecip-precision. The double-precision
19649 square root estimate instructions are not generated by default on
19650 low-precision machines, since they do not provide an estimate that
19651 converges after three steps.
19652
19653 -mpointers-to-nested-functions
19654 -mno-pointers-to-nested-functions
19655 Generate (do not generate) code to load up the static chain
19656 register ("r11") when calling through a pointer on AIX and 64-bit
19657 Linux systems where a function pointer points to a 3-word
19658 descriptor giving the function address, TOC value to be loaded in
19659 register "r2", and static chain value to be loaded in register
19660 "r11". The -mpointers-to-nested-functions is on by default. You
19661 cannot call through pointers to nested functions or pointers to
19662 functions compiled in other languages that use the static chain if
19663 you use -mno-pointers-to-nested-functions.
19664
19665 -msave-toc-indirect
19666 -mno-save-toc-indirect
19667 Generate (do not generate) code to save the TOC value in the
19668 reserved stack location in the function prologue if the function
19669 calls through a pointer on AIX and 64-bit Linux systems. If the
19670 TOC value is not saved in the prologue, it is saved just before the
19671 call through the pointer. The -mno-save-toc-indirect option is the
19672 default.
19673
19674 -mcompat-align-parm
19675 -mno-compat-align-parm
19676 Generate (do not generate) code to pass structure parameters with a
19677 maximum alignment of 64 bits, for compatibility with older versions
19678 of GCC.
19679
19680 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
19681 structure parameter on a 128-bit boundary when that structure
19682 contained a member requiring 128-bit alignment. This is corrected
19683 in more recent versions of GCC. This option may be used to
19684 generate code that is compatible with functions compiled with older
19685 versions of GCC.
19686
19687 The -mno-compat-align-parm option is the default.
19688
19689 -mstack-protector-guard=guard
19690 -mstack-protector-guard-reg=reg
19691 -mstack-protector-guard-offset=offset
19692 -mstack-protector-guard-symbol=symbol
19693 Generate stack protection code using canary at guard. Supported
19694 locations are global for global canary or tls for per-thread canary
19695 in the TLS block (the default with GNU libc version 2.4 or later).
19696
19697 With the latter choice the options -mstack-protector-guard-reg=reg
19698 and -mstack-protector-guard-offset=offset furthermore specify which
19699 register to use as base register for reading the canary, and from
19700 what offset from that base register. The default for those is as
19701 specified in the relevant ABI.
19702 -mstack-protector-guard-symbol=symbol overrides the offset with a
19703 symbol reference to a canary in the TLS block.
19704
19705 RISC-V Options
19706
19707 These command-line options are defined for RISC-V targets:
19708
19709 -mbranch-cost=n
19710 Set the cost of branches to roughly n instructions.
19711
19712 -mplt
19713 -mno-plt
19714 When generating PIC code, do or don't allow the use of PLTs.
19715 Ignored for non-PIC. The default is -mplt.
19716
19717 -mabi=ABI-string
19718 Specify integer and floating-point calling convention. ABI-string
19719 contains two parts: the size of integer types and the registers
19720 used for floating-point types. For example -march=rv64ifd
19721 -mabi=lp64d means that long and pointers are 64-bit (implicitly
19722 defining int to be 32-bit), and that floating-point values up to 64
19723 bits wide are passed in F registers. Contrast this with
19724 -march=rv64ifd -mabi=lp64f, which still allows the compiler to
19725 generate code that uses the F and D extensions but only allows
19726 floating-point values up to 32 bits long to be passed in registers;
19727 or -march=rv64ifd -mabi=lp64, in which no floating-point arguments
19728 will be passed in registers.
19729
19730 The default for this argument is system dependent, users who want a
19731 specific calling convention should specify one explicitly. The
19732 valid calling conventions are: ilp32, ilp32f, ilp32d, lp64, lp64f,
19733 and lp64d. Some calling conventions are impossible to implement on
19734 some ISAs: for example, -march=rv32if -mabi=ilp32d is invalid
19735 because the ABI requires 64-bit values be passed in F registers,
19736 but F registers are only 32 bits wide.
19737
19738 -mfdiv
19739 -mno-fdiv
19740 Do or don't use hardware floating-point divide and square root
19741 instructions. This requires the F or D extensions for floating-
19742 point registers. The default is to use them if the specified
19743 architecture has these instructions.
19744
19745 -mdiv
19746 -mno-div
19747 Do or don't use hardware instructions for integer division. This
19748 requires the M extension. The default is to use them if the
19749 specified architecture has these instructions.
19750
19751 -march=ISA-string
19752 Generate code for given RISC-V ISA (e.g. rv64im). ISA strings must
19753 be lower-case. Examples include rv64i, rv32g, and rv32imaf.
19754
19755 -mtune=processor-string
19756 Optimize the output for the given processor, specified by
19757 microarchitecture name.
19758
19759 -mpreferred-stack-boundary=num
19760 Attempt to keep the stack boundary aligned to a 2 raised to num
19761 byte boundary. If -mpreferred-stack-boundary is not specified, the
19762 default is 4 (16 bytes or 128-bits).
19763
19764 Warning: If you use this switch, then you must build all modules
19765 with the same value, including any libraries. This includes the
19766 system libraries and startup modules.
19767
19768 -msmall-data-limit=n
19769 Put global and static data smaller than n bytes into a special
19770 section (on some targets).
19771
19772 -msave-restore
19773 -mno-save-restore
19774 Do or don't use smaller but slower prologue and epilogue code that
19775 uses library function calls. The default is to use fast inline
19776 prologues and epilogues.
19777
19778 -mstrict-align
19779 -mno-strict-align
19780 Do not or do generate unaligned memory accesses. The default is
19781 set depending on whether the processor we are optimizing for
19782 supports fast unaligned access or not.
19783
19784 -mcmodel=medlow
19785 Generate code for the medium-low code model. The program and its
19786 statically defined symbols must lie within a single 2 GiB address
19787 range and must lie between absolute addresses -2 GiB and +2 GiB.
19788 Programs can be statically or dynamically linked. This is the
19789 default code model.
19790
19791 -mcmodel=medany
19792 Generate code for the medium-any code model. The program and its
19793 statically defined symbols must be within any single 2 GiB address
19794 range. Programs can be statically or dynamically linked.
19795
19796 -mexplicit-relocs
19797 -mno-exlicit-relocs
19798 Use or do not use assembler relocation operators when dealing with
19799 symbolic addresses. The alternative is to use assembler macros
19800 instead, which may limit optimization.
19801
19802 -mrelax
19803 -mno-relax
19804 Take advantage of linker relaxations to reduce the number of
19805 instructions required to materialize symbol addresses. The default
19806 is to take advantage of linker relaxations.
19807
19808 RL78 Options
19809
19810 -msim
19811 Links in additional target libraries to support operation within a
19812 simulator.
19813
19814 -mmul=none
19815 -mmul=g10
19816 -mmul=g13
19817 -mmul=g14
19818 -mmul=rl78
19819 Specifies the type of hardware multiplication and division support
19820 to be used. The simplest is "none", which uses software for both
19821 multiplication and division. This is the default. The "g13" value
19822 is for the hardware multiply/divide peripheral found on the
19823 RL78/G13 (S2 core) targets. The "g14" value selects the use of the
19824 multiplication and division instructions supported by the RL78/G14
19825 (S3 core) parts. The value "rl78" is an alias for "g14" and the
19826 value "mg10" is an alias for "none".
19827
19828 In addition a C preprocessor macro is defined, based upon the
19829 setting of this option. Possible values are: "__RL78_MUL_NONE__",
19830 "__RL78_MUL_G13__" or "__RL78_MUL_G14__".
19831
19832 -mcpu=g10
19833 -mcpu=g13
19834 -mcpu=g14
19835 -mcpu=rl78
19836 Specifies the RL78 core to target. The default is the G14 core,
19837 also known as an S3 core or just RL78. The G13 or S2 core does not
19838 have multiply or divide instructions, instead it uses a hardware
19839 peripheral for these operations. The G10 or S1 core does not have
19840 register banks, so it uses a different calling convention.
19841
19842 If this option is set it also selects the type of hardware multiply
19843 support to use, unless this is overridden by an explicit -mmul=none
19844 option on the command line. Thus specifying -mcpu=g13 enables the
19845 use of the G13 hardware multiply peripheral and specifying
19846 -mcpu=g10 disables the use of hardware multiplications altogether.
19847
19848 Note, although the RL78/G14 core is the default target, specifying
19849 -mcpu=g14 or -mcpu=rl78 on the command line does change the
19850 behavior of the toolchain since it also enables G14 hardware
19851 multiply support. If these options are not specified on the
19852 command line then software multiplication routines will be used
19853 even though the code targets the RL78 core. This is for backwards
19854 compatibility with older toolchains which did not have hardware
19855 multiply and divide support.
19856
19857 In addition a C preprocessor macro is defined, based upon the
19858 setting of this option. Possible values are: "__RL78_G10__",
19859 "__RL78_G13__" or "__RL78_G14__".
19860
19861 -mg10
19862 -mg13
19863 -mg14
19864 -mrl78
19865 These are aliases for the corresponding -mcpu= option. They are
19866 provided for backwards compatibility.
19867
19868 -mallregs
19869 Allow the compiler to use all of the available registers. By
19870 default registers "r24..r31" are reserved for use in interrupt
19871 handlers. With this option enabled these registers can be used in
19872 ordinary functions as well.
19873
19874 -m64bit-doubles
19875 -m32bit-doubles
19876 Make the "double" data type be 64 bits (-m64bit-doubles) or 32 bits
19877 (-m32bit-doubles) in size. The default is -m32bit-doubles.
19878
19879 -msave-mduc-in-interrupts
19880 -mno-save-mduc-in-interrupts
19881 Specifies that interrupt handler functions should preserve the MDUC
19882 registers. This is only necessary if normal code might use the
19883 MDUC registers, for example because it performs multiplication and
19884 division operations. The default is to ignore the MDUC registers
19885 as this makes the interrupt handlers faster. The target option
19886 -mg13 needs to be passed for this to work as this feature is only
19887 available on the G13 target (S2 core). The MDUC registers will
19888 only be saved if the interrupt handler performs a multiplication or
19889 division operation or it calls another function.
19890
19891 IBM RS/6000 and PowerPC Options
19892
19893 These -m options are defined for the IBM RS/6000 and PowerPC:
19894
19895 -mpowerpc-gpopt
19896 -mno-powerpc-gpopt
19897 -mpowerpc-gfxopt
19898 -mno-powerpc-gfxopt
19899 -mpowerpc64
19900 -mno-powerpc64
19901 -mmfcrf
19902 -mno-mfcrf
19903 -mpopcntb
19904 -mno-popcntb
19905 -mpopcntd
19906 -mno-popcntd
19907 -mfprnd
19908 -mno-fprnd
19909 -mcmpb
19910 -mno-cmpb
19911 -mmfpgpr
19912 -mno-mfpgpr
19913 -mhard-dfp
19914 -mno-hard-dfp
19915 You use these options to specify which instructions are available
19916 on the processor you are using. The default value of these options
19917 is determined when configuring GCC. Specifying the -mcpu=cpu_type
19918 overrides the specification of these options. We recommend you use
19919 the -mcpu=cpu_type option rather than the options listed above.
19920
19921 Specifying -mpowerpc-gpopt allows GCC to use the optional PowerPC
19922 architecture instructions in the General Purpose group, including
19923 floating-point square root. Specifying -mpowerpc-gfxopt allows GCC
19924 to use the optional PowerPC architecture instructions in the
19925 Graphics group, including floating-point select.
19926
19927 The -mmfcrf option allows GCC to generate the move from condition
19928 register field instruction implemented on the POWER4 processor and
19929 other processors that support the PowerPC V2.01 architecture. The
19930 -mpopcntb option allows GCC to generate the popcount and double-
19931 precision FP reciprocal estimate instruction implemented on the
19932 POWER5 processor and other processors that support the PowerPC
19933 V2.02 architecture. The -mpopcntd option allows GCC to generate
19934 the popcount instruction implemented on the POWER7 processor and
19935 other processors that support the PowerPC V2.06 architecture. The
19936 -mfprnd option allows GCC to generate the FP round to integer
19937 instructions implemented on the POWER5+ processor and other
19938 processors that support the PowerPC V2.03 architecture. The -mcmpb
19939 option allows GCC to generate the compare bytes instruction
19940 implemented on the POWER6 processor and other processors that
19941 support the PowerPC V2.05 architecture. The -mmfpgpr option allows
19942 GCC to generate the FP move to/from general-purpose register
19943 instructions implemented on the POWER6X processor and other
19944 processors that support the extended PowerPC V2.05 architecture.
19945 The -mhard-dfp option allows GCC to generate the decimal floating-
19946 point instructions implemented on some POWER processors.
19947
19948 The -mpowerpc64 option allows GCC to generate the additional 64-bit
19949 instructions that are found in the full PowerPC64 architecture and
19950 to treat GPRs as 64-bit, doubleword quantities. GCC defaults to
19951 -mno-powerpc64.
19952
19953 -mcpu=cpu_type
19954 Set architecture type, register usage, and instruction scheduling
19955 parameters for machine type cpu_type. Supported values for
19956 cpu_type are 401, 403, 405, 405fp, 440, 440fp, 464, 464fp, 476,
19957 476fp, 505, 601, 602, 603, 603e, 604, 604e, 620, 630, 740, 7400,
19958 7450, 750, 801, 821, 823, 860, 970, 8540, a2, e300c2, e300c3,
19959 e500mc, e500mc64, e5500, e6500, ec603e, G3, G4, G5, titan, power3,
19960 power4, power5, power5+, power6, power6x, power7, power8, power9,
19961 powerpc, powerpc64, powerpc64le, rs64, and native.
19962
19963 -mcpu=powerpc, -mcpu=powerpc64, and -mcpu=powerpc64le specify pure
19964 32-bit PowerPC (either endian), 64-bit big endian PowerPC and
19965 64-bit little endian PowerPC architecture machine types, with an
19966 appropriate, generic processor model assumed for scheduling
19967 purposes.
19968
19969 Specifying native as cpu type detects and selects the architecture
19970 option that corresponds to the host processor of the system
19971 performing the compilation. -mcpu=native has no effect if GCC does
19972 not recognize the processor.
19973
19974 The other options specify a specific processor. Code generated
19975 under those options runs best on that processor, and may not run at
19976 all on others.
19977
19978 The -mcpu options automatically enable or disable the following
19979 options:
19980
19981 -maltivec -mfprnd -mhard-float -mmfcrf -mmultiple -mpopcntb
19982 -mpopcntd -mpowerpc64 -mpowerpc-gpopt -mpowerpc-gfxopt
19983 -msingle-float -mdouble-float -msimple-fpu -mmulhw -mdlmzb
19984 -mmfpgpr -mvsx -mcrypto -mhtm -mpower8-fusion -mpower8-vector
19985 -mquad-memory -mquad-memory-atomic -mfloat128 -mfloat128-hardware
19986
19987 The particular options set for any particular CPU varies between
19988 compiler versions, depending on what setting seems to produce
19989 optimal code for that CPU; it doesn't necessarily reflect the
19990 actual hardware's capabilities. If you wish to set an individual
19991 option to a particular value, you may specify it after the -mcpu
19992 option, like -mcpu=970 -mno-altivec.
19993
19994 On AIX, the -maltivec and -mpowerpc64 options are not enabled or
19995 disabled by the -mcpu option at present because AIX does not have
19996 full support for these options. You may still enable or disable
19997 them individually if you're sure it'll work in your environment.
19998
19999 -mtune=cpu_type
20000 Set the instruction scheduling parameters for machine type
20001 cpu_type, but do not set the architecture type or register usage,
20002 as -mcpu=cpu_type does. The same values for cpu_type are used for
20003 -mtune as for -mcpu. If both are specified, the code generated
20004 uses the architecture and registers set by -mcpu, but the
20005 scheduling parameters set by -mtune.
20006
20007 -mcmodel=small
20008 Generate PowerPC64 code for the small model: The TOC is limited to
20009 64k.
20010
20011 -mcmodel=medium
20012 Generate PowerPC64 code for the medium model: The TOC and other
20013 static data may be up to a total of 4G in size. This is the
20014 default for 64-bit Linux.
20015
20016 -mcmodel=large
20017 Generate PowerPC64 code for the large model: The TOC may be up to
20018 4G in size. Other data and code is only limited by the 64-bit
20019 address space.
20020
20021 -maltivec
20022 -mno-altivec
20023 Generate code that uses (does not use) AltiVec instructions, and
20024 also enable the use of built-in functions that allow more direct
20025 access to the AltiVec instruction set. You may also need to set
20026 -mabi=altivec to adjust the current ABI with AltiVec ABI
20027 enhancements.
20028
20029 When -maltivec is used, rather than -maltivec=le or -maltivec=be,
20030 the element order for AltiVec intrinsics such as "vec_splat",
20031 "vec_extract", and "vec_insert" match array element order
20032 corresponding to the endianness of the target. That is, element
20033 zero identifies the leftmost element in a vector register when
20034 targeting a big-endian platform, and identifies the rightmost
20035 element in a vector register when targeting a little-endian
20036 platform.
20037
20038 -maltivec=be
20039 Generate AltiVec instructions using big-endian element order,
20040 regardless of whether the target is big- or little-endian. This is
20041 the default when targeting a big-endian platform. Using this
20042 option is currently deprecated. Support for this feature will be
20043 removed in GCC 9.
20044
20045 The element order is used to interpret element numbers in AltiVec
20046 intrinsics such as "vec_splat", "vec_extract", and "vec_insert".
20047 By default, these match array element order corresponding to the
20048 endianness for the target.
20049
20050 -maltivec=le
20051 Generate AltiVec instructions using little-endian element order,
20052 regardless of whether the target is big- or little-endian. This is
20053 the default when targeting a little-endian platform. This option
20054 is currently ignored when targeting a big-endian platform.
20055
20056 The element order is used to interpret element numbers in AltiVec
20057 intrinsics such as "vec_splat", "vec_extract", and "vec_insert".
20058 By default, these match array element order corresponding to the
20059 endianness for the target.
20060
20061 -mvrsave
20062 -mno-vrsave
20063 Generate VRSAVE instructions when generating AltiVec code.
20064
20065 -msecure-plt
20066 Generate code that allows ld and ld.so to build executables and
20067 shared libraries with non-executable ".plt" and ".got" sections.
20068 This is a PowerPC 32-bit SYSV ABI option.
20069
20070 -mbss-plt
20071 Generate code that uses a BSS ".plt" section that ld.so fills in,
20072 and requires ".plt" and ".got" sections that are both writable and
20073 executable. This is a PowerPC 32-bit SYSV ABI option.
20074
20075 -misel
20076 -mno-isel
20077 This switch enables or disables the generation of ISEL
20078 instructions.
20079
20080 -misel=yes/no
20081 This switch has been deprecated. Use -misel and -mno-isel instead.
20082
20083 -mpaired
20084 -mno-paired
20085 This switch enables or disables the generation of PAIRED simd
20086 instructions.
20087
20088 -mvsx
20089 -mno-vsx
20090 Generate code that uses (does not use) vector/scalar (VSX)
20091 instructions, and also enable the use of built-in functions that
20092 allow more direct access to the VSX instruction set.
20093
20094 -mcrypto
20095 -mno-crypto
20096 Enable the use (disable) of the built-in functions that allow
20097 direct access to the cryptographic instructions that were added in
20098 version 2.07 of the PowerPC ISA.
20099
20100 -mhtm
20101 -mno-htm
20102 Enable (disable) the use of the built-in functions that allow
20103 direct access to the Hardware Transactional Memory (HTM)
20104 instructions that were added in version 2.07 of the PowerPC ISA.
20105
20106 -mpower8-fusion
20107 -mno-power8-fusion
20108 Generate code that keeps (does not keeps) some integer operations
20109 adjacent so that the instructions can be fused together on power8
20110 and later processors.
20111
20112 -mpower8-vector
20113 -mno-power8-vector
20114 Generate code that uses (does not use) the vector and scalar
20115 instructions that were added in version 2.07 of the PowerPC ISA.
20116 Also enable the use of built-in functions that allow more direct
20117 access to the vector instructions.
20118
20119 -mquad-memory
20120 -mno-quad-memory
20121 Generate code that uses (does not use) the non-atomic quad word
20122 memory instructions. The -mquad-memory option requires use of
20123 64-bit mode.
20124
20125 -mquad-memory-atomic
20126 -mno-quad-memory-atomic
20127 Generate code that uses (does not use) the atomic quad word memory
20128 instructions. The -mquad-memory-atomic option requires use of
20129 64-bit mode.
20130
20131 -mfloat128
20132 -mno-float128
20133 Enable/disable the __float128 keyword for IEEE 128-bit floating
20134 point and use either software emulation for IEEE 128-bit floating
20135 point or hardware instructions.
20136
20137 The VSX instruction set (-mvsx, -mcpu=power7, -mcpu=power8), or
20138 -mcpu=power9 must be enabled to use the IEEE 128-bit floating point
20139 support. The IEEE 128-bit floating point support only works on
20140 PowerPC Linux systems.
20141
20142 The default for -mfloat128 is enabled on PowerPC Linux systems
20143 using the VSX instruction set, and disabled on other systems.
20144
20145 If you use the ISA 3.0 instruction set (-mpower9-vector or
20146 -mcpu=power9) on a 64-bit system, the IEEE 128-bit floating point
20147 support will also enable the generation of ISA 3.0 IEEE 128-bit
20148 floating point instructions. Otherwise, if you do not specify to
20149 generate ISA 3.0 instructions or you are targeting a 32-bit big
20150 endian system, IEEE 128-bit floating point will be done with
20151 software emulation.
20152
20153 -mfloat128-hardware
20154 -mno-float128-hardware
20155 Enable/disable using ISA 3.0 hardware instructions to support the
20156 __float128 data type.
20157
20158 The default for -mfloat128-hardware is enabled on PowerPC Linux
20159 systems using the ISA 3.0 instruction set, and disabled on other
20160 systems.
20161
20162 -m32
20163 -m64
20164 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
20165 targets (including GNU/Linux). The 32-bit environment sets int,
20166 long and pointer to 32 bits and generates code that runs on any
20167 PowerPC variant. The 64-bit environment sets int to 32 bits and
20168 long and pointer to 64 bits, and generates code for PowerPC64, as
20169 for -mpowerpc64.
20170
20171 -mfull-toc
20172 -mno-fp-in-toc
20173 -mno-sum-in-toc
20174 -mminimal-toc
20175 Modify generation of the TOC (Table Of Contents), which is created
20176 for every executable file. The -mfull-toc option is selected by
20177 default. In that case, GCC allocates at least one TOC entry for
20178 each unique non-automatic variable reference in your program. GCC
20179 also places floating-point constants in the TOC. However, only
20180 16,384 entries are available in the TOC.
20181
20182 If you receive a linker error message that saying you have
20183 overflowed the available TOC space, you can reduce the amount of
20184 TOC space used with the -mno-fp-in-toc and -mno-sum-in-toc options.
20185 -mno-fp-in-toc prevents GCC from putting floating-point constants
20186 in the TOC and -mno-sum-in-toc forces GCC to generate code to
20187 calculate the sum of an address and a constant at run time instead
20188 of putting that sum into the TOC. You may specify one or both of
20189 these options. Each causes GCC to produce very slightly slower and
20190 larger code at the expense of conserving TOC space.
20191
20192 If you still run out of space in the TOC even when you specify both
20193 of these options, specify -mminimal-toc instead. This option
20194 causes GCC to make only one TOC entry for every file. When you
20195 specify this option, GCC produces code that is slower and larger
20196 but which uses extremely little TOC space. You may wish to use
20197 this option only on files that contain less frequently-executed
20198 code.
20199
20200 -maix64
20201 -maix32
20202 Enable 64-bit AIX ABI and calling convention: 64-bit pointers,
20203 64-bit "long" type, and the infrastructure needed to support them.
20204 Specifying -maix64 implies -mpowerpc64, while -maix32 disables the
20205 64-bit ABI and implies -mno-powerpc64. GCC defaults to -maix32.
20206
20207 -mxl-compat
20208 -mno-xl-compat
20209 Produce code that conforms more closely to IBM XL compiler
20210 semantics when using AIX-compatible ABI. Pass floating-point
20211 arguments to prototyped functions beyond the register save area
20212 (RSA) on the stack in addition to argument FPRs. Do not assume
20213 that most significant double in 128-bit long double value is
20214 properly rounded when comparing values and converting to double.
20215 Use XL symbol names for long double support routines.
20216
20217 The AIX calling convention was extended but not initially
20218 documented to handle an obscure K&R C case of calling a function
20219 that takes the address of its arguments with fewer arguments than
20220 declared. IBM XL compilers access floating-point arguments that do
20221 not fit in the RSA from the stack when a subroutine is compiled
20222 without optimization. Because always storing floating-point
20223 arguments on the stack is inefficient and rarely needed, this
20224 option is not enabled by default and only is necessary when calling
20225 subroutines compiled by IBM XL compilers without optimization.
20226
20227 -mpe
20228 Support IBM RS/6000 SP Parallel Environment (PE). Link an
20229 application written to use message passing with special startup
20230 code to enable the application to run. The system must have PE
20231 installed in the standard location (/usr/lpp/ppe.poe/), or the
20232 specs file must be overridden with the -specs= option to specify
20233 the appropriate directory location. The Parallel Environment does
20234 not support threads, so the -mpe option and the -pthread option are
20235 incompatible.
20236
20237 -malign-natural
20238 -malign-power
20239 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
20240 -malign-natural overrides the ABI-defined alignment of larger
20241 types, such as floating-point doubles, on their natural size-based
20242 boundary. The option -malign-power instructs GCC to follow the
20243 ABI-specified alignment rules. GCC defaults to the standard
20244 alignment defined in the ABI.
20245
20246 On 64-bit Darwin, natural alignment is the default, and
20247 -malign-power is not supported.
20248
20249 -msoft-float
20250 -mhard-float
20251 Generate code that does not use (uses) the floating-point register
20252 set. Software floating-point emulation is provided if you use the
20253 -msoft-float option, and pass the option to GCC when linking.
20254
20255 -msingle-float
20256 -mdouble-float
20257 Generate code for single- or double-precision floating-point
20258 operations. -mdouble-float implies -msingle-float.
20259
20260 -msimple-fpu
20261 Do not generate "sqrt" and "div" instructions for hardware
20262 floating-point unit.
20263
20264 -mfpu=name
20265 Specify type of floating-point unit. Valid values for name are
20266 sp_lite (equivalent to -msingle-float -msimple-fpu), dp_lite
20267 (equivalent to -mdouble-float -msimple-fpu), sp_full (equivalent to
20268 -msingle-float), and dp_full (equivalent to -mdouble-float).
20269
20270 -mxilinx-fpu
20271 Perform optimizations for the floating-point unit on Xilinx PPC
20272 405/440.
20273
20274 -mmultiple
20275 -mno-multiple
20276 Generate code that uses (does not use) the load multiple word
20277 instructions and the store multiple word instructions. These
20278 instructions are generated by default on POWER systems, and not
20279 generated on PowerPC systems. Do not use -mmultiple on little-
20280 endian PowerPC systems, since those instructions do not work when
20281 the processor is in little-endian mode. The exceptions are PPC740
20282 and PPC750 which permit these instructions in little-endian mode.
20283
20284 -mupdate
20285 -mno-update
20286 Generate code that uses (does not use) the load or store
20287 instructions that update the base register to the address of the
20288 calculated memory location. These instructions are generated by
20289 default. If you use -mno-update, there is a small window between
20290 the time that the stack pointer is updated and the address of the
20291 previous frame is stored, which means code that walks the stack
20292 frame across interrupts or signals may get corrupted data.
20293
20294 -mavoid-indexed-addresses
20295 -mno-avoid-indexed-addresses
20296 Generate code that tries to avoid (not avoid) the use of indexed
20297 load or store instructions. These instructions can incur a
20298 performance penalty on Power6 processors in certain situations,
20299 such as when stepping through large arrays that cross a 16M
20300 boundary. This option is enabled by default when targeting Power6
20301 and disabled otherwise.
20302
20303 -mfused-madd
20304 -mno-fused-madd
20305 Generate code that uses (does not use) the floating-point multiply
20306 and accumulate instructions. These instructions are generated by
20307 default if hardware floating point is used. The machine-dependent
20308 -mfused-madd option is now mapped to the machine-independent
20309 -ffp-contract=fast option, and -mno-fused-madd is mapped to
20310 -ffp-contract=off.
20311
20312 -mmulhw
20313 -mno-mulhw
20314 Generate code that uses (does not use) the half-word multiply and
20315 multiply-accumulate instructions on the IBM 405, 440, 464 and 476
20316 processors. These instructions are generated by default when
20317 targeting those processors.
20318
20319 -mdlmzb
20320 -mno-dlmzb
20321 Generate code that uses (does not use) the string-search dlmzb
20322 instruction on the IBM 405, 440, 464 and 476 processors. This
20323 instruction is generated by default when targeting those
20324 processors.
20325
20326 -mno-bit-align
20327 -mbit-align
20328 On System V.4 and embedded PowerPC systems do not (do) force
20329 structures and unions that contain bit-fields to be aligned to the
20330 base type of the bit-field.
20331
20332 For example, by default a structure containing nothing but 8
20333 "unsigned" bit-fields of length 1 is aligned to a 4-byte boundary
20334 and has a size of 4 bytes. By using -mno-bit-align, the structure
20335 is aligned to a 1-byte boundary and is 1 byte in size.
20336
20337 -mno-strict-align
20338 -mstrict-align
20339 On System V.4 and embedded PowerPC systems do not (do) assume that
20340 unaligned memory references are handled by the system.
20341
20342 -mrelocatable
20343 -mno-relocatable
20344 Generate code that allows (does not allow) a static executable to
20345 be relocated to a different address at run time. A simple embedded
20346 PowerPC system loader should relocate the entire contents of
20347 ".got2" and 4-byte locations listed in the ".fixup" section, a
20348 table of 32-bit addresses generated by this option. For this to
20349 work, all objects linked together must be compiled with
20350 -mrelocatable or -mrelocatable-lib. -mrelocatable code aligns the
20351 stack to an 8-byte boundary.
20352
20353 -mrelocatable-lib
20354 -mno-relocatable-lib
20355 Like -mrelocatable, -mrelocatable-lib generates a ".fixup" section
20356 to allow static executables to be relocated at run time, but
20357 -mrelocatable-lib does not use the smaller stack alignment of
20358 -mrelocatable. Objects compiled with -mrelocatable-lib may be
20359 linked with objects compiled with any combination of the
20360 -mrelocatable options.
20361
20362 -mno-toc
20363 -mtoc
20364 On System V.4 and embedded PowerPC systems do not (do) assume that
20365 register 2 contains a pointer to a global area pointing to the
20366 addresses used in the program.
20367
20368 -mlittle
20369 -mlittle-endian
20370 On System V.4 and embedded PowerPC systems compile code for the
20371 processor in little-endian mode. The -mlittle-endian option is the
20372 same as -mlittle.
20373
20374 -mbig
20375 -mbig-endian
20376 On System V.4 and embedded PowerPC systems compile code for the
20377 processor in big-endian mode. The -mbig-endian option is the same
20378 as -mbig.
20379
20380 -mdynamic-no-pic
20381 On Darwin and Mac OS X systems, compile code so that it is not
20382 relocatable, but that its external references are relocatable. The
20383 resulting code is suitable for applications, but not shared
20384 libraries.
20385
20386 -msingle-pic-base
20387 Treat the register used for PIC addressing as read-only, rather
20388 than loading it in the prologue for each function. The runtime
20389 system is responsible for initializing this register with an
20390 appropriate value before execution begins.
20391
20392 -mprioritize-restricted-insns=priority
20393 This option controls the priority that is assigned to dispatch-slot
20394 restricted instructions during the second scheduling pass. The
20395 argument priority takes the value 0, 1, or 2 to assign no, highest,
20396 or second-highest (respectively) priority to dispatch-slot
20397 restricted instructions.
20398
20399 -msched-costly-dep=dependence_type
20400 This option controls which dependences are considered costly by the
20401 target during instruction scheduling. The argument dependence_type
20402 takes one of the following values:
20403
20404 no No dependence is costly.
20405
20406 all All dependences are costly.
20407
20408 true_store_to_load
20409 A true dependence from store to load is costly.
20410
20411 store_to_load
20412 Any dependence from store to load is costly.
20413
20414 number
20415 Any dependence for which the latency is greater than or equal
20416 to number is costly.
20417
20418 -minsert-sched-nops=scheme
20419 This option controls which NOP insertion scheme is used during the
20420 second scheduling pass. The argument scheme takes one of the
20421 following values:
20422
20423 no Don't insert NOPs.
20424
20425 pad Pad with NOPs any dispatch group that has vacant issue slots,
20426 according to the scheduler's grouping.
20427
20428 regroup_exact
20429 Insert NOPs to force costly dependent insns into separate
20430 groups. Insert exactly as many NOPs as needed to force an insn
20431 to a new group, according to the estimated processor grouping.
20432
20433 number
20434 Insert NOPs to force costly dependent insns into separate
20435 groups. Insert number NOPs to force an insn to a new group.
20436
20437 -mcall-sysv
20438 On System V.4 and embedded PowerPC systems compile code using
20439 calling conventions that adhere to the March 1995 draft of the
20440 System V Application Binary Interface, PowerPC processor
20441 supplement. This is the default unless you configured GCC using
20442 powerpc-*-eabiaix.
20443
20444 -mcall-sysv-eabi
20445 -mcall-eabi
20446 Specify both -mcall-sysv and -meabi options.
20447
20448 -mcall-sysv-noeabi
20449 Specify both -mcall-sysv and -mno-eabi options.
20450
20451 -mcall-aixdesc
20452 On System V.4 and embedded PowerPC systems compile code for the AIX
20453 operating system.
20454
20455 -mcall-linux
20456 On System V.4 and embedded PowerPC systems compile code for the
20457 Linux-based GNU system.
20458
20459 -mcall-freebsd
20460 On System V.4 and embedded PowerPC systems compile code for the
20461 FreeBSD operating system.
20462
20463 -mcall-netbsd
20464 On System V.4 and embedded PowerPC systems compile code for the
20465 NetBSD operating system.
20466
20467 -mcall-openbsd
20468 On System V.4 and embedded PowerPC systems compile code for the
20469 OpenBSD operating system.
20470
20471 -mtraceback=traceback_type
20472 Select the type of traceback table. Valid values for traceback_type
20473 are full, part, and no.
20474
20475 -maix-struct-return
20476 Return all structures in memory (as specified by the AIX ABI).
20477
20478 -msvr4-struct-return
20479 Return structures smaller than 8 bytes in registers (as specified
20480 by the SVR4 ABI).
20481
20482 -mabi=abi-type
20483 Extend the current ABI with a particular extension, or remove such
20484 extension. Valid values are altivec, no-altivec, spe, no-spe,
20485 ibmlongdouble, ieeelongdouble, elfv1, elfv2.
20486
20487 -mabi=ibmlongdouble
20488 Change the current ABI to use IBM extended-precision long double.
20489 This is not likely to work if your system defaults to using IEEE
20490 extended-precision long double. If you change the long double type
20491 from IEEE extended-precision, the compiler will issue a warning
20492 unless you use the -Wno-psabi option.
20493
20494 -mabi=ieeelongdouble
20495 Change the current ABI to use IEEE extended-precision long double.
20496 This is not likely to work if your system defaults to using IBM
20497 extended-precision long double. If you change the long double type
20498 from IBM extended-precision, the compiler will issue a warning
20499 unless you use the -Wno-psabi option.
20500
20501 -mabi=elfv1
20502 Change the current ABI to use the ELFv1 ABI. This is the default
20503 ABI for big-endian PowerPC 64-bit Linux. Overriding the default
20504 ABI requires special system support and is likely to fail in
20505 spectacular ways.
20506
20507 -mabi=elfv2
20508 Change the current ABI to use the ELFv2 ABI. This is the default
20509 ABI for little-endian PowerPC 64-bit Linux. Overriding the default
20510 ABI requires special system support and is likely to fail in
20511 spectacular ways.
20512
20513 -mgnu-attribute
20514 -mno-gnu-attribute
20515 Emit .gnu_attribute assembly directives to set tag/value pairs in a
20516 .gnu.attributes section that specify ABI variations in function
20517 parameters or return values.
20518
20519 -mprototype
20520 -mno-prototype
20521 On System V.4 and embedded PowerPC systems assume that all calls to
20522 variable argument functions are properly prototyped. Otherwise,
20523 the compiler must insert an instruction before every non-prototyped
20524 call to set or clear bit 6 of the condition code register ("CR") to
20525 indicate whether floating-point values are passed in the floating-
20526 point registers in case the function takes variable arguments.
20527 With -mprototype, only calls to prototyped variable argument
20528 functions set or clear the bit.
20529
20530 -msim
20531 On embedded PowerPC systems, assume that the startup module is
20532 called sim-crt0.o and that the standard C libraries are libsim.a
20533 and libc.a. This is the default for powerpc-*-eabisim
20534 configurations.
20535
20536 -mmvme
20537 On embedded PowerPC systems, assume that the startup module is
20538 called crt0.o and the standard C libraries are libmvme.a and
20539 libc.a.
20540
20541 -mads
20542 On embedded PowerPC systems, assume that the startup module is
20543 called crt0.o and the standard C libraries are libads.a and libc.a.
20544
20545 -myellowknife
20546 On embedded PowerPC systems, assume that the startup module is
20547 called crt0.o and the standard C libraries are libyk.a and libc.a.
20548
20549 -mvxworks
20550 On System V.4 and embedded PowerPC systems, specify that you are
20551 compiling for a VxWorks system.
20552
20553 -memb
20554 On embedded PowerPC systems, set the "PPC_EMB" bit in the ELF flags
20555 header to indicate that eabi extended relocations are used.
20556
20557 -meabi
20558 -mno-eabi
20559 On System V.4 and embedded PowerPC systems do (do not) adhere to
20560 the Embedded Applications Binary Interface (EABI), which is a set
20561 of modifications to the System V.4 specifications. Selecting
20562 -meabi means that the stack is aligned to an 8-byte boundary, a
20563 function "__eabi" is called from "main" to set up the EABI
20564 environment, and the -msdata option can use both "r2" and "r13" to
20565 point to two separate small data areas. Selecting -mno-eabi means
20566 that the stack is aligned to a 16-byte boundary, no EABI
20567 initialization function is called from "main", and the -msdata
20568 option only uses "r13" to point to a single small data area. The
20569 -meabi option is on by default if you configured GCC using one of
20570 the powerpc*-*-eabi* options.
20571
20572 -msdata=eabi
20573 On System V.4 and embedded PowerPC systems, put small initialized
20574 "const" global and static data in the ".sdata2" section, which is
20575 pointed to by register "r2". Put small initialized non-"const"
20576 global and static data in the ".sdata" section, which is pointed to
20577 by register "r13". Put small uninitialized global and static data
20578 in the ".sbss" section, which is adjacent to the ".sdata" section.
20579 The -msdata=eabi option is incompatible with the -mrelocatable
20580 option. The -msdata=eabi option also sets the -memb option.
20581
20582 -msdata=sysv
20583 On System V.4 and embedded PowerPC systems, put small global and
20584 static data in the ".sdata" section, which is pointed to by
20585 register "r13". Put small uninitialized global and static data in
20586 the ".sbss" section, which is adjacent to the ".sdata" section.
20587 The -msdata=sysv option is incompatible with the -mrelocatable
20588 option.
20589
20590 -msdata=default
20591 -msdata
20592 On System V.4 and embedded PowerPC systems, if -meabi is used,
20593 compile code the same as -msdata=eabi, otherwise compile code the
20594 same as -msdata=sysv.
20595
20596 -msdata=data
20597 On System V.4 and embedded PowerPC systems, put small global data
20598 in the ".sdata" section. Put small uninitialized global data in
20599 the ".sbss" section. Do not use register "r13" to address small
20600 data however. This is the default behavior unless other -msdata
20601 options are used.
20602
20603 -msdata=none
20604 -mno-sdata
20605 On embedded PowerPC systems, put all initialized global and static
20606 data in the ".data" section, and all uninitialized data in the
20607 ".bss" section.
20608
20609 -mreadonly-in-sdata
20610 -mreadonly-in-sdata
20611 Put read-only objects in the ".sdata" section as well. This is the
20612 default.
20613
20614 -mblock-move-inline-limit=num
20615 Inline all block moves (such as calls to "memcpy" or structure
20616 copies) less than or equal to num bytes. The minimum value for num
20617 is 32 bytes on 32-bit targets and 64 bytes on 64-bit targets. The
20618 default value is target-specific.
20619
20620 -mblock-compare-inline-limit=num
20621 Generate non-looping inline code for all block compares (such as
20622 calls to "memcmp" or structure compares) less than or equal to num
20623 bytes. If num is 0, all inline expansion (non-loop and loop) of
20624 block compare is disabled. The default value is target-specific.
20625
20626 -mblock-compare-inline-loop-limit=num
20627 Generate an inline expansion using loop code for all block compares
20628 that are less than or equal to num bytes, but greater than the
20629 limit for non-loop inline block compare expansion. If the block
20630 length is not constant, at most num bytes will be compared before
20631 "memcmp" is called to compare the remainder of the block. The
20632 default value is target-specific.
20633
20634 -mstring-compare-inline-limit=num
20635 Generate at most num pairs of load instructions to compare the
20636 string inline. If the difference or end of string is not found at
20637 the end of the inline compare a call to "strcmp" or "strncmp" will
20638 take care of the rest of the comparison. The default is 8 pairs of
20639 loads, which will compare 64 bytes on a 64-bit target and 32 bytes
20640 on a 32-bit target.
20641
20642 -G num
20643 On embedded PowerPC systems, put global and static items less than
20644 or equal to num bytes into the small data or BSS sections instead
20645 of the normal data or BSS section. By default, num is 8. The -G
20646 num switch is also passed to the linker. All modules should be
20647 compiled with the same -G num value.
20648
20649 -mregnames
20650 -mno-regnames
20651 On System V.4 and embedded PowerPC systems do (do not) emit
20652 register names in the assembly language output using symbolic
20653 forms.
20654
20655 -mlongcall
20656 -mno-longcall
20657 By default assume that all calls are far away so that a longer and
20658 more expensive calling sequence is required. This is required for
20659 calls farther than 32 megabytes (33,554,432 bytes) from the current
20660 location. A short call is generated if the compiler knows the call
20661 cannot be that far away. This setting can be overridden by the
20662 "shortcall" function attribute, or by "#pragma longcall(0)".
20663
20664 Some linkers are capable of detecting out-of-range calls and
20665 generating glue code on the fly. On these systems, long calls are
20666 unnecessary and generate slower code. As of this writing, the AIX
20667 linker can do this, as can the GNU linker for PowerPC/64. It is
20668 planned to add this feature to the GNU linker for 32-bit PowerPC
20669 systems as well.
20670
20671 On Darwin/PPC systems, "#pragma longcall" generates "jbsr callee,
20672 L42", plus a branch island (glue code). The two target addresses
20673 represent the callee and the branch island. The Darwin/PPC linker
20674 prefers the first address and generates a "bl callee" if the PPC
20675 "bl" instruction reaches the callee directly; otherwise, the linker
20676 generates "bl L42" to call the branch island. The branch island is
20677 appended to the body of the calling function; it computes the full
20678 32-bit address of the callee and jumps to it.
20679
20680 On Mach-O (Darwin) systems, this option directs the compiler emit
20681 to the glue for every direct call, and the Darwin linker decides
20682 whether to use or discard it.
20683
20684 In the future, GCC may ignore all longcall specifications when the
20685 linker is known to generate glue.
20686
20687 -mtls-markers
20688 -mno-tls-markers
20689 Mark (do not mark) calls to "__tls_get_addr" with a relocation
20690 specifying the function argument. The relocation allows the linker
20691 to reliably associate function call with argument setup
20692 instructions for TLS optimization, which in turn allows GCC to
20693 better schedule the sequence.
20694
20695 -mrecip
20696 -mno-recip
20697 This option enables use of the reciprocal estimate and reciprocal
20698 square root estimate instructions with additional Newton-Raphson
20699 steps to increase precision instead of doing a divide or square
20700 root and divide for floating-point arguments. You should use the
20701 -ffast-math option when using -mrecip (or at least
20702 -funsafe-math-optimizations, -ffinite-math-only, -freciprocal-math
20703 and -fno-trapping-math). Note that while the throughput of the
20704 sequence is generally higher than the throughput of the non-
20705 reciprocal instruction, the precision of the sequence can be
20706 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals
20707 0.99999994) for reciprocal square roots.
20708
20709 -mrecip=opt
20710 This option controls which reciprocal estimate instructions may be
20711 used. opt is a comma-separated list of options, which may be
20712 preceded by a "!" to invert the option:
20713
20714 all Enable all estimate instructions.
20715
20716 default
20717 Enable the default instructions, equivalent to -mrecip.
20718
20719 none
20720 Disable all estimate instructions, equivalent to -mno-recip.
20721
20722 div Enable the reciprocal approximation instructions for both
20723 single and double precision.
20724
20725 divf
20726 Enable the single-precision reciprocal approximation
20727 instructions.
20728
20729 divd
20730 Enable the double-precision reciprocal approximation
20731 instructions.
20732
20733 rsqrt
20734 Enable the reciprocal square root approximation instructions
20735 for both single and double precision.
20736
20737 rsqrtf
20738 Enable the single-precision reciprocal square root
20739 approximation instructions.
20740
20741 rsqrtd
20742 Enable the double-precision reciprocal square root
20743 approximation instructions.
20744
20745 So, for example, -mrecip=all,!rsqrtd enables all of the reciprocal
20746 estimate instructions, except for the "FRSQRTE", "XSRSQRTEDP", and
20747 "XVRSQRTEDP" instructions which handle the double-precision
20748 reciprocal square root calculations.
20749
20750 -mrecip-precision
20751 -mno-recip-precision
20752 Assume (do not assume) that the reciprocal estimate instructions
20753 provide higher-precision estimates than is mandated by the PowerPC
20754 ABI. Selecting -mcpu=power6, -mcpu=power7 or -mcpu=power8
20755 automatically selects -mrecip-precision. The double-precision
20756 square root estimate instructions are not generated by default on
20757 low-precision machines, since they do not provide an estimate that
20758 converges after three steps.
20759
20760 -mveclibabi=type
20761 Specifies the ABI type to use for vectorizing intrinsics using an
20762 external library. The only type supported at present is mass,
20763 which specifies to use IBM's Mathematical Acceleration Subsystem
20764 (MASS) libraries for vectorizing intrinsics using external
20765 libraries. GCC currently emits calls to "acosd2", "acosf4",
20766 "acoshd2", "acoshf4", "asind2", "asinf4", "asinhd2", "asinhf4",
20767 "atan2d2", "atan2f4", "atand2", "atanf4", "atanhd2", "atanhf4",
20768 "cbrtd2", "cbrtf4", "cosd2", "cosf4", "coshd2", "coshf4", "erfcd2",
20769 "erfcf4", "erfd2", "erff4", "exp2d2", "exp2f4", "expd2", "expf4",
20770 "expm1d2", "expm1f4", "hypotd2", "hypotf4", "lgammad2", "lgammaf4",
20771 "log10d2", "log10f4", "log1pd2", "log1pf4", "log2d2", "log2f4",
20772 "logd2", "logf4", "powd2", "powf4", "sind2", "sinf4", "sinhd2",
20773 "sinhf4", "sqrtd2", "sqrtf4", "tand2", "tanf4", "tanhd2", and
20774 "tanhf4" when generating code for power7. Both -ftree-vectorize
20775 and -funsafe-math-optimizations must also be enabled. The MASS
20776 libraries must be specified at link time.
20777
20778 -mfriz
20779 -mno-friz
20780 Generate (do not generate) the "friz" instruction when the
20781 -funsafe-math-optimizations option is used to optimize rounding of
20782 floating-point values to 64-bit integer and back to floating point.
20783 The "friz" instruction does not return the same value if the
20784 floating-point number is too large to fit in an integer.
20785
20786 -mpointers-to-nested-functions
20787 -mno-pointers-to-nested-functions
20788 Generate (do not generate) code to load up the static chain
20789 register ("r11") when calling through a pointer on AIX and 64-bit
20790 Linux systems where a function pointer points to a 3-word
20791 descriptor giving the function address, TOC value to be loaded in
20792 register "r2", and static chain value to be loaded in register
20793 "r11". The -mpointers-to-nested-functions is on by default. You
20794 cannot call through pointers to nested functions or pointers to
20795 functions compiled in other languages that use the static chain if
20796 you use -mno-pointers-to-nested-functions.
20797
20798 -msave-toc-indirect
20799 -mno-save-toc-indirect
20800 Generate (do not generate) code to save the TOC value in the
20801 reserved stack location in the function prologue if the function
20802 calls through a pointer on AIX and 64-bit Linux systems. If the
20803 TOC value is not saved in the prologue, it is saved just before the
20804 call through the pointer. The -mno-save-toc-indirect option is the
20805 default.
20806
20807 -mcompat-align-parm
20808 -mno-compat-align-parm
20809 Generate (do not generate) code to pass structure parameters with a
20810 maximum alignment of 64 bits, for compatibility with older versions
20811 of GCC.
20812
20813 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
20814 structure parameter on a 128-bit boundary when that structure
20815 contained a member requiring 128-bit alignment. This is corrected
20816 in more recent versions of GCC. This option may be used to
20817 generate code that is compatible with functions compiled with older
20818 versions of GCC.
20819
20820 The -mno-compat-align-parm option is the default.
20821
20822 -mstack-protector-guard=guard
20823 -mstack-protector-guard-reg=reg
20824 -mstack-protector-guard-offset=offset
20825 -mstack-protector-guard-symbol=symbol
20826 Generate stack protection code using canary at guard. Supported
20827 locations are global for global canary or tls for per-thread canary
20828 in the TLS block (the default with GNU libc version 2.4 or later).
20829
20830 With the latter choice the options -mstack-protector-guard-reg=reg
20831 and -mstack-protector-guard-offset=offset furthermore specify which
20832 register to use as base register for reading the canary, and from
20833 what offset from that base register. The default for those is as
20834 specified in the relevant ABI.
20835 -mstack-protector-guard-symbol=symbol overrides the offset with a
20836 symbol reference to a canary in the TLS block.
20837
20838 RX Options
20839
20840 These command-line options are defined for RX targets:
20841
20842 -m64bit-doubles
20843 -m32bit-doubles
20844 Make the "double" data type be 64 bits (-m64bit-doubles) or 32 bits
20845 (-m32bit-doubles) in size. The default is -m32bit-doubles. Note
20846 RX floating-point hardware only works on 32-bit values, which is
20847 why the default is -m32bit-doubles.
20848
20849 -fpu
20850 -nofpu
20851 Enables (-fpu) or disables (-nofpu) the use of RX floating-point
20852 hardware. The default is enabled for the RX600 series and disabled
20853 for the RX200 series.
20854
20855 Floating-point instructions are only generated for 32-bit floating-
20856 point values, however, so the FPU hardware is not used for doubles
20857 if the -m64bit-doubles option is used.
20858
20859 Note If the -fpu option is enabled then -funsafe-math-optimizations
20860 is also enabled automatically. This is because the RX FPU
20861 instructions are themselves unsafe.
20862
20863 -mcpu=name
20864 Selects the type of RX CPU to be targeted. Currently three types
20865 are supported, the generic RX600 and RX200 series hardware and the
20866 specific RX610 CPU. The default is RX600.
20867
20868 The only difference between RX600 and RX610 is that the RX610 does
20869 not support the "MVTIPL" instruction.
20870
20871 The RX200 series does not have a hardware floating-point unit and
20872 so -nofpu is enabled by default when this type is selected.
20873
20874 -mbig-endian-data
20875 -mlittle-endian-data
20876 Store data (but not code) in the big-endian format. The default is
20877 -mlittle-endian-data, i.e. to store data in the little-endian
20878 format.
20879
20880 -msmall-data-limit=N
20881 Specifies the maximum size in bytes of global and static variables
20882 which can be placed into the small data area. Using the small data
20883 area can lead to smaller and faster code, but the size of area is
20884 limited and it is up to the programmer to ensure that the area does
20885 not overflow. Also when the small data area is used one of the
20886 RX's registers (usually "r13") is reserved for use pointing to this
20887 area, so it is no longer available for use by the compiler. This
20888 could result in slower and/or larger code if variables are pushed
20889 onto the stack instead of being held in this register.
20890
20891 Note, common variables (variables that have not been initialized)
20892 and constants are not placed into the small data area as they are
20893 assigned to other sections in the output executable.
20894
20895 The default value is zero, which disables this feature. Note, this
20896 feature is not enabled by default with higher optimization levels
20897 (-O2 etc) because of the potentially detrimental effects of
20898 reserving a register. It is up to the programmer to experiment and
20899 discover whether this feature is of benefit to their program. See
20900 the description of the -mpid option for a description of how the
20901 actual register to hold the small data area pointer is chosen.
20902
20903 -msim
20904 -mno-sim
20905 Use the simulator runtime. The default is to use the libgloss
20906 board-specific runtime.
20907
20908 -mas100-syntax
20909 -mno-as100-syntax
20910 When generating assembler output use a syntax that is compatible
20911 with Renesas's AS100 assembler. This syntax can also be handled by
20912 the GAS assembler, but it has some restrictions so it is not
20913 generated by default.
20914
20915 -mmax-constant-size=N
20916 Specifies the maximum size, in bytes, of a constant that can be
20917 used as an operand in a RX instruction. Although the RX
20918 instruction set does allow constants of up to 4 bytes in length to
20919 be used in instructions, a longer value equates to a longer
20920 instruction. Thus in some circumstances it can be beneficial to
20921 restrict the size of constants that are used in instructions.
20922 Constants that are too big are instead placed into a constant pool
20923 and referenced via register indirection.
20924
20925 The value N can be between 0 and 4. A value of 0 (the default) or
20926 4 means that constants of any size are allowed.
20927
20928 -mrelax
20929 Enable linker relaxation. Linker relaxation is a process whereby
20930 the linker attempts to reduce the size of a program by finding
20931 shorter versions of various instructions. Disabled by default.
20932
20933 -mint-register=N
20934 Specify the number of registers to reserve for fast interrupt
20935 handler functions. The value N can be between 0 and 4. A value of
20936 1 means that register "r13" is reserved for the exclusive use of
20937 fast interrupt handlers. A value of 2 reserves "r13" and "r12". A
20938 value of 3 reserves "r13", "r12" and "r11", and a value of 4
20939 reserves "r13" through "r10". A value of 0, the default, does not
20940 reserve any registers.
20941
20942 -msave-acc-in-interrupts
20943 Specifies that interrupt handler functions should preserve the
20944 accumulator register. This is only necessary if normal code might
20945 use the accumulator register, for example because it performs
20946 64-bit multiplications. The default is to ignore the accumulator
20947 as this makes the interrupt handlers faster.
20948
20949 -mpid
20950 -mno-pid
20951 Enables the generation of position independent data. When enabled
20952 any access to constant data is done via an offset from a base
20953 address held in a register. This allows the location of constant
20954 data to be determined at run time without requiring the executable
20955 to be relocated, which is a benefit to embedded applications with
20956 tight memory constraints. Data that can be modified is not
20957 affected by this option.
20958
20959 Note, using this feature reserves a register, usually "r13", for
20960 the constant data base address. This can result in slower and/or
20961 larger code, especially in complicated functions.
20962
20963 The actual register chosen to hold the constant data base address
20964 depends upon whether the -msmall-data-limit and/or the
20965 -mint-register command-line options are enabled. Starting with
20966 register "r13" and proceeding downwards, registers are allocated
20967 first to satisfy the requirements of -mint-register, then -mpid and
20968 finally -msmall-data-limit. Thus it is possible for the small data
20969 area register to be "r8" if both -mint-register=4 and -mpid are
20970 specified on the command line.
20971
20972 By default this feature is not enabled. The default can be
20973 restored via the -mno-pid command-line option.
20974
20975 -mno-warn-multiple-fast-interrupts
20976 -mwarn-multiple-fast-interrupts
20977 Prevents GCC from issuing a warning message if it finds more than
20978 one fast interrupt handler when it is compiling a file. The
20979 default is to issue a warning for each extra fast interrupt handler
20980 found, as the RX only supports one such interrupt.
20981
20982 -mallow-string-insns
20983 -mno-allow-string-insns
20984 Enables or disables the use of the string manipulation instructions
20985 "SMOVF", "SCMPU", "SMOVB", "SMOVU", "SUNTIL" "SWHILE" and also the
20986 "RMPA" instruction. These instructions may prefetch data, which is
20987 not safe to do if accessing an I/O register. (See section 12.2.7
20988 of the RX62N Group User's Manual for more information).
20989
20990 The default is to allow these instructions, but it is not possible
20991 for GCC to reliably detect all circumstances where a string
20992 instruction might be used to access an I/O register, so their use
20993 cannot be disabled automatically. Instead it is reliant upon the
20994 programmer to use the -mno-allow-string-insns option if their
20995 program accesses I/O space.
20996
20997 When the instructions are enabled GCC defines the C preprocessor
20998 symbol "__RX_ALLOW_STRING_INSNS__", otherwise it defines the symbol
20999 "__RX_DISALLOW_STRING_INSNS__".
21000
21001 -mjsr
21002 -mno-jsr
21003 Use only (or not only) "JSR" instructions to access functions.
21004 This option can be used when code size exceeds the range of "BSR"
21005 instructions. Note that -mno-jsr does not mean to not use "JSR"
21006 but instead means that any type of branch may be used.
21007
21008 Note: The generic GCC command-line option -ffixed-reg has special
21009 significance to the RX port when used with the "interrupt" function
21010 attribute. This attribute indicates a function intended to process
21011 fast interrupts. GCC ensures that it only uses the registers "r10",
21012 "r11", "r12" and/or "r13" and only provided that the normal use of the
21013 corresponding registers have been restricted via the -ffixed-reg or
21014 -mint-register command-line options.
21015
21016 S/390 and zSeries Options
21017
21018 These are the -m options defined for the S/390 and zSeries
21019 architecture.
21020
21021 -mhard-float
21022 -msoft-float
21023 Use (do not use) the hardware floating-point instructions and
21024 registers for floating-point operations. When -msoft-float is
21025 specified, functions in libgcc.a are used to perform floating-point
21026 operations. When -mhard-float is specified, the compiler generates
21027 IEEE floating-point instructions. This is the default.
21028
21029 -mhard-dfp
21030 -mno-hard-dfp
21031 Use (do not use) the hardware decimal-floating-point instructions
21032 for decimal-floating-point operations. When -mno-hard-dfp is
21033 specified, functions in libgcc.a are used to perform decimal-
21034 floating-point operations. When -mhard-dfp is specified, the
21035 compiler generates decimal-floating-point hardware instructions.
21036 This is the default for -march=z9-ec or higher.
21037
21038 -mlong-double-64
21039 -mlong-double-128
21040 These switches control the size of "long double" type. A size of 64
21041 bits makes the "long double" type equivalent to the "double" type.
21042 This is the default.
21043
21044 -mbackchain
21045 -mno-backchain
21046 Store (do not store) the address of the caller's frame as backchain
21047 pointer into the callee's stack frame. A backchain may be needed
21048 to allow debugging using tools that do not understand DWARF call
21049 frame information. When -mno-packed-stack is in effect, the
21050 backchain pointer is stored at the bottom of the stack frame; when
21051 -mpacked-stack is in effect, the backchain is placed into the
21052 topmost word of the 96/160 byte register save area.
21053
21054 In general, code compiled with -mbackchain is call-compatible with
21055 code compiled with -mmo-backchain; however, use of the backchain
21056 for debugging purposes usually requires that the whole binary is
21057 built with -mbackchain. Note that the combination of -mbackchain,
21058 -mpacked-stack and -mhard-float is not supported. In order to
21059 build a linux kernel use -msoft-float.
21060
21061 The default is to not maintain the backchain.
21062
21063 -mpacked-stack
21064 -mno-packed-stack
21065 Use (do not use) the packed stack layout. When -mno-packed-stack
21066 is specified, the compiler uses the all fields of the 96/160 byte
21067 register save area only for their default purpose; unused fields
21068 still take up stack space. When -mpacked-stack is specified,
21069 register save slots are densely packed at the top of the register
21070 save area; unused space is reused for other purposes, allowing for
21071 more efficient use of the available stack space. However, when
21072 -mbackchain is also in effect, the topmost word of the save area is
21073 always used to store the backchain, and the return address register
21074 is always saved two words below the backchain.
21075
21076 As long as the stack frame backchain is not used, code generated
21077 with -mpacked-stack is call-compatible with code generated with
21078 -mno-packed-stack. Note that some non-FSF releases of GCC 2.95 for
21079 S/390 or zSeries generated code that uses the stack frame backchain
21080 at run time, not just for debugging purposes. Such code is not
21081 call-compatible with code compiled with -mpacked-stack. Also, note
21082 that the combination of -mbackchain, -mpacked-stack and
21083 -mhard-float is not supported. In order to build a linux kernel
21084 use -msoft-float.
21085
21086 The default is to not use the packed stack layout.
21087
21088 -msmall-exec
21089 -mno-small-exec
21090 Generate (or do not generate) code using the "bras" instruction to
21091 do subroutine calls. This only works reliably if the total
21092 executable size does not exceed 64k. The default is to use the
21093 "basr" instruction instead, which does not have this limitation.
21094
21095 -m64
21096 -m31
21097 When -m31 is specified, generate code compliant to the GNU/Linux
21098 for S/390 ABI. When -m64 is specified, generate code compliant to
21099 the GNU/Linux for zSeries ABI. This allows GCC in particular to
21100 generate 64-bit instructions. For the s390 targets, the default is
21101 -m31, while the s390x targets default to -m64.
21102
21103 -mzarch
21104 -mesa
21105 When -mzarch is specified, generate code using the instructions
21106 available on z/Architecture. When -mesa is specified, generate
21107 code using the instructions available on ESA/390. Note that -mesa
21108 is not possible with -m64. When generating code compliant to the
21109 GNU/Linux for S/390 ABI, the default is -mesa. When generating
21110 code compliant to the GNU/Linux for zSeries ABI, the default is
21111 -mzarch.
21112
21113 -mhtm
21114 -mno-htm
21115 The -mhtm option enables a set of builtins making use of
21116 instructions available with the transactional execution facility
21117 introduced with the IBM zEnterprise EC12 machine generation S/390
21118 System z Built-in Functions. -mhtm is enabled by default when
21119 using -march=zEC12.
21120
21121 -mvx
21122 -mno-vx
21123 When -mvx is specified, generate code using the instructions
21124 available with the vector extension facility introduced with the
21125 IBM z13 machine generation. This option changes the ABI for some
21126 vector type values with regard to alignment and calling
21127 conventions. In case vector type values are being used in an ABI-
21128 relevant context a GAS .gnu_attribute command will be added to mark
21129 the resulting binary with the ABI used. -mvx is enabled by default
21130 when using -march=z13.
21131
21132 -mzvector
21133 -mno-zvector
21134 The -mzvector option enables vector language extensions and
21135 builtins using instructions available with the vector extension
21136 facility introduced with the IBM z13 machine generation. This
21137 option adds support for vector to be used as a keyword to define
21138 vector type variables and arguments. vector is only available when
21139 GNU extensions are enabled. It will not be expanded when
21140 requesting strict standard compliance e.g. with -std=c99. In
21141 addition to the GCC low-level builtins -mzvector enables a set of
21142 builtins added for compatibility with AltiVec-style implementations
21143 like Power and Cell. In order to make use of these builtins the
21144 header file vecintrin.h needs to be included. -mzvector is
21145 disabled by default.
21146
21147 -mmvcle
21148 -mno-mvcle
21149 Generate (or do not generate) code using the "mvcle" instruction to
21150 perform block moves. When -mno-mvcle is specified, use a "mvc"
21151 loop instead. This is the default unless optimizing for size.
21152
21153 -mdebug
21154 -mno-debug
21155 Print (or do not print) additional debug information when
21156 compiling. The default is to not print debug information.
21157
21158 -march=cpu-type
21159 Generate code that runs on cpu-type, which is the name of a system
21160 representing a certain processor type. Possible values for cpu-
21161 type are z900/arch5, z990/arch6, z9-109, z9-ec/arch7, z10/arch8,
21162 z196/arch9, zEC12, z13/arch11, and native.
21163
21164 The default is -march=z900. g5/arch3 and g6 are deprecated and
21165 will be removed with future releases.
21166
21167 Specifying native as cpu type can be used to select the best
21168 architecture option for the host processor. -march=native has no
21169 effect if GCC does not recognize the processor.
21170
21171 -mtune=cpu-type
21172 Tune to cpu-type everything applicable about the generated code,
21173 except for the ABI and the set of available instructions. The list
21174 of cpu-type values is the same as for -march. The default is the
21175 value used for -march.
21176
21177 -mtpf-trace
21178 -mno-tpf-trace
21179 Generate code that adds (does not add) in TPF OS specific branches
21180 to trace routines in the operating system. This option is off by
21181 default, even when compiling for the TPF OS.
21182
21183 -mfused-madd
21184 -mno-fused-madd
21185 Generate code that uses (does not use) the floating-point multiply
21186 and accumulate instructions. These instructions are generated by
21187 default if hardware floating point is used.
21188
21189 -mwarn-framesize=framesize
21190 Emit a warning if the current function exceeds the given frame
21191 size. Because this is a compile-time check it doesn't need to be a
21192 real problem when the program runs. It is intended to identify
21193 functions that most probably cause a stack overflow. It is useful
21194 to be used in an environment with limited stack size e.g. the linux
21195 kernel.
21196
21197 -mwarn-dynamicstack
21198 Emit a warning if the function calls "alloca" or uses dynamically-
21199 sized arrays. This is generally a bad idea with a limited stack
21200 size.
21201
21202 -mstack-guard=stack-guard
21203 -mstack-size=stack-size
21204 If these options are provided the S/390 back end emits additional
21205 instructions in the function prologue that trigger a trap if the
21206 stack size is stack-guard bytes above the stack-size (remember that
21207 the stack on S/390 grows downward). If the stack-guard option is
21208 omitted the smallest power of 2 larger than the frame size of the
21209 compiled function is chosen. These options are intended to be used
21210 to help debugging stack overflow problems. The additionally
21211 emitted code causes only little overhead and hence can also be used
21212 in production-like systems without greater performance degradation.
21213 The given values have to be exact powers of 2 and stack-size has to
21214 be greater than stack-guard without exceeding 64k. In order to be
21215 efficient the extra code makes the assumption that the stack starts
21216 at an address aligned to the value given by stack-size. The stack-
21217 guard option can only be used in conjunction with stack-size.
21218
21219 -mhotpatch=pre-halfwords,post-halfwords
21220 If the hotpatch option is enabled, a "hot-patching" function
21221 prologue is generated for all functions in the compilation unit.
21222 The funtion label is prepended with the given number of two-byte
21223 NOP instructions (pre-halfwords, maximum 1000000). After the
21224 label, 2 * post-halfwords bytes are appended, using the largest NOP
21225 like instructions the architecture allows (maximum 1000000).
21226
21227 If both arguments are zero, hotpatching is disabled.
21228
21229 This option can be overridden for individual functions with the
21230 "hotpatch" attribute.
21231
21232 Score Options
21233
21234 These options are defined for Score implementations:
21235
21236 -meb
21237 Compile code for big-endian mode. This is the default.
21238
21239 -mel
21240 Compile code for little-endian mode.
21241
21242 -mnhwloop
21243 Disable generation of "bcnz" instructions.
21244
21245 -muls
21246 Enable generation of unaligned load and store instructions.
21247
21248 -mmac
21249 Enable the use of multiply-accumulate instructions. Disabled by
21250 default.
21251
21252 -mscore5
21253 Specify the SCORE5 as the target architecture.
21254
21255 -mscore5u
21256 Specify the SCORE5U of the target architecture.
21257
21258 -mscore7
21259 Specify the SCORE7 as the target architecture. This is the default.
21260
21261 -mscore7d
21262 Specify the SCORE7D as the target architecture.
21263
21264 SH Options
21265
21266 These -m options are defined for the SH implementations:
21267
21268 -m1 Generate code for the SH1.
21269
21270 -m2 Generate code for the SH2.
21271
21272 -m2e
21273 Generate code for the SH2e.
21274
21275 -m2a-nofpu
21276 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a
21277 way that the floating-point unit is not used.
21278
21279 -m2a-single-only
21280 Generate code for the SH2a-FPU, in such a way that no double-
21281 precision floating-point operations are used.
21282
21283 -m2a-single
21284 Generate code for the SH2a-FPU assuming the floating-point unit is
21285 in single-precision mode by default.
21286
21287 -m2a
21288 Generate code for the SH2a-FPU assuming the floating-point unit is
21289 in double-precision mode by default.
21290
21291 -m3 Generate code for the SH3.
21292
21293 -m3e
21294 Generate code for the SH3e.
21295
21296 -m4-nofpu
21297 Generate code for the SH4 without a floating-point unit.
21298
21299 -m4-single-only
21300 Generate code for the SH4 with a floating-point unit that only
21301 supports single-precision arithmetic.
21302
21303 -m4-single
21304 Generate code for the SH4 assuming the floating-point unit is in
21305 single-precision mode by default.
21306
21307 -m4 Generate code for the SH4.
21308
21309 -m4-100
21310 Generate code for SH4-100.
21311
21312 -m4-100-nofpu
21313 Generate code for SH4-100 in such a way that the floating-point
21314 unit is not used.
21315
21316 -m4-100-single
21317 Generate code for SH4-100 assuming the floating-point unit is in
21318 single-precision mode by default.
21319
21320 -m4-100-single-only
21321 Generate code for SH4-100 in such a way that no double-precision
21322 floating-point operations are used.
21323
21324 -m4-200
21325 Generate code for SH4-200.
21326
21327 -m4-200-nofpu
21328 Generate code for SH4-200 without in such a way that the floating-
21329 point unit is not used.
21330
21331 -m4-200-single
21332 Generate code for SH4-200 assuming the floating-point unit is in
21333 single-precision mode by default.
21334
21335 -m4-200-single-only
21336 Generate code for SH4-200 in such a way that no double-precision
21337 floating-point operations are used.
21338
21339 -m4-300
21340 Generate code for SH4-300.
21341
21342 -m4-300-nofpu
21343 Generate code for SH4-300 without in such a way that the floating-
21344 point unit is not used.
21345
21346 -m4-300-single
21347 Generate code for SH4-300 in such a way that no double-precision
21348 floating-point operations are used.
21349
21350 -m4-300-single-only
21351 Generate code for SH4-300 in such a way that no double-precision
21352 floating-point operations are used.
21353
21354 -m4-340
21355 Generate code for SH4-340 (no MMU, no FPU).
21356
21357 -m4-500
21358 Generate code for SH4-500 (no FPU). Passes -isa=sh4-nofpu to the
21359 assembler.
21360
21361 -m4a-nofpu
21362 Generate code for the SH4al-dsp, or for a SH4a in such a way that
21363 the floating-point unit is not used.
21364
21365 -m4a-single-only
21366 Generate code for the SH4a, in such a way that no double-precision
21367 floating-point operations are used.
21368
21369 -m4a-single
21370 Generate code for the SH4a assuming the floating-point unit is in
21371 single-precision mode by default.
21372
21373 -m4a
21374 Generate code for the SH4a.
21375
21376 -m4al
21377 Same as -m4a-nofpu, except that it implicitly passes -dsp to the
21378 assembler. GCC doesn't generate any DSP instructions at the
21379 moment.
21380
21381 -mb Compile code for the processor in big-endian mode.
21382
21383 -ml Compile code for the processor in little-endian mode.
21384
21385 -mdalign
21386 Align doubles at 64-bit boundaries. Note that this changes the
21387 calling conventions, and thus some functions from the standard C
21388 library do not work unless you recompile it first with -mdalign.
21389
21390 -mrelax
21391 Shorten some address references at link time, when possible; uses
21392 the linker option -relax.
21393
21394 -mbigtable
21395 Use 32-bit offsets in "switch" tables. The default is to use
21396 16-bit offsets.
21397
21398 -mbitops
21399 Enable the use of bit manipulation instructions on SH2A.
21400
21401 -mfmovd
21402 Enable the use of the instruction "fmovd". Check -mdalign for
21403 alignment constraints.
21404
21405 -mrenesas
21406 Comply with the calling conventions defined by Renesas.
21407
21408 -mno-renesas
21409 Comply with the calling conventions defined for GCC before the
21410 Renesas conventions were available. This option is the default for
21411 all targets of the SH toolchain.
21412
21413 -mnomacsave
21414 Mark the "MAC" register as call-clobbered, even if -mrenesas is
21415 given.
21416
21417 -mieee
21418 -mno-ieee
21419 Control the IEEE compliance of floating-point comparisons, which
21420 affects the handling of cases where the result of a comparison is
21421 unordered. By default -mieee is implicitly enabled. If
21422 -ffinite-math-only is enabled -mno-ieee is implicitly set, which
21423 results in faster floating-point greater-equal and less-equal
21424 comparisons. The implicit settings can be overridden by specifying
21425 either -mieee or -mno-ieee.
21426
21427 -minline-ic_invalidate
21428 Inline code to invalidate instruction cache entries after setting
21429 up nested function trampolines. This option has no effect if
21430 -musermode is in effect and the selected code generation option
21431 (e.g. -m4) does not allow the use of the "icbi" instruction. If
21432 the selected code generation option does not allow the use of the
21433 "icbi" instruction, and -musermode is not in effect, the inlined
21434 code manipulates the instruction cache address array directly with
21435 an associative write. This not only requires privileged mode at
21436 run time, but it also fails if the cache line had been mapped via
21437 the TLB and has become unmapped.
21438
21439 -misize
21440 Dump instruction size and location in the assembly code.
21441
21442 -mpadstruct
21443 This option is deprecated. It pads structures to multiple of 4
21444 bytes, which is incompatible with the SH ABI.
21445
21446 -matomic-model=model
21447 Sets the model of atomic operations and additional parameters as a
21448 comma separated list. For details on the atomic built-in functions
21449 see __atomic Builtins. The following models and parameters are
21450 supported:
21451
21452 none
21453 Disable compiler generated atomic sequences and emit library
21454 calls for atomic operations. This is the default if the target
21455 is not "sh*-*-linux*".
21456
21457 soft-gusa
21458 Generate GNU/Linux compatible gUSA software atomic sequences
21459 for the atomic built-in functions. The generated atomic
21460 sequences require additional support from the
21461 interrupt/exception handling code of the system and are only
21462 suitable for SH3* and SH4* single-core systems. This option is
21463 enabled by default when the target is "sh*-*-linux*" and SH3*
21464 or SH4*. When the target is SH4A, this option also partially
21465 utilizes the hardware atomic instructions "movli.l" and
21466 "movco.l" to create more efficient code, unless strict is
21467 specified.
21468
21469 soft-tcb
21470 Generate software atomic sequences that use a variable in the
21471 thread control block. This is a variation of the gUSA
21472 sequences which can also be used on SH1* and SH2* targets. The
21473 generated atomic sequences require additional support from the
21474 interrupt/exception handling code of the system and are only
21475 suitable for single-core systems. When using this model, the
21476 gbr-offset= parameter has to be specified as well.
21477
21478 soft-imask
21479 Generate software atomic sequences that temporarily disable
21480 interrupts by setting "SR.IMASK = 1111". This model works only
21481 when the program runs in privileged mode and is only suitable
21482 for single-core systems. Additional support from the
21483 interrupt/exception handling code of the system is not
21484 required. This model is enabled by default when the target is
21485 "sh*-*-linux*" and SH1* or SH2*.
21486
21487 hard-llcs
21488 Generate hardware atomic sequences using the "movli.l" and
21489 "movco.l" instructions only. This is only available on SH4A
21490 and is suitable for multi-core systems. Since the hardware
21491 instructions support only 32 bit atomic variables access to 8
21492 or 16 bit variables is emulated with 32 bit accesses. Code
21493 compiled with this option is also compatible with other
21494 software atomic model interrupt/exception handling systems if
21495 executed on an SH4A system. Additional support from the
21496 interrupt/exception handling code of the system is not required
21497 for this model.
21498
21499 gbr-offset=
21500 This parameter specifies the offset in bytes of the variable in
21501 the thread control block structure that should be used by the
21502 generated atomic sequences when the soft-tcb model has been
21503 selected. For other models this parameter is ignored. The
21504 specified value must be an integer multiple of four and in the
21505 range 0-1020.
21506
21507 strict
21508 This parameter prevents mixed usage of multiple atomic models,
21509 even if they are compatible, and makes the compiler generate
21510 atomic sequences of the specified model only.
21511
21512 -mtas
21513 Generate the "tas.b" opcode for "__atomic_test_and_set". Notice
21514 that depending on the particular hardware and software
21515 configuration this can degrade overall performance due to the
21516 operand cache line flushes that are implied by the "tas.b"
21517 instruction. On multi-core SH4A processors the "tas.b" instruction
21518 must be used with caution since it can result in data corruption
21519 for certain cache configurations.
21520
21521 -mprefergot
21522 When generating position-independent code, emit function calls
21523 using the Global Offset Table instead of the Procedure Linkage
21524 Table.
21525
21526 -musermode
21527 -mno-usermode
21528 Don't allow (allow) the compiler generating privileged mode code.
21529 Specifying -musermode also implies -mno-inline-ic_invalidate if the
21530 inlined code would not work in user mode. -musermode is the
21531 default when the target is "sh*-*-linux*". If the target is SH1*
21532 or SH2* -musermode has no effect, since there is no user mode.
21533
21534 -multcost=number
21535 Set the cost to assume for a multiply insn.
21536
21537 -mdiv=strategy
21538 Set the division strategy to be used for integer division
21539 operations. strategy can be one of:
21540
21541 call-div1
21542 Calls a library function that uses the single-step division
21543 instruction "div1" to perform the operation. Division by zero
21544 calculates an unspecified result and does not trap. This is
21545 the default except for SH4, SH2A and SHcompact.
21546
21547 call-fp
21548 Calls a library function that performs the operation in double
21549 precision floating point. Division by zero causes a floating-
21550 point exception. This is the default for SHcompact with FPU.
21551 Specifying this for targets that do not have a double precision
21552 FPU defaults to "call-div1".
21553
21554 call-table
21555 Calls a library function that uses a lookup table for small
21556 divisors and the "div1" instruction with case distinction for
21557 larger divisors. Division by zero calculates an unspecified
21558 result and does not trap. This is the default for SH4.
21559 Specifying this for targets that do not have dynamic shift
21560 instructions defaults to "call-div1".
21561
21562 When a division strategy has not been specified the default
21563 strategy is selected based on the current target. For SH2A the
21564 default strategy is to use the "divs" and "divu" instructions
21565 instead of library function calls.
21566
21567 -maccumulate-outgoing-args
21568 Reserve space once for outgoing arguments in the function prologue
21569 rather than around each call. Generally beneficial for performance
21570 and size. Also needed for unwinding to avoid changing the stack
21571 frame around conditional code.
21572
21573 -mdivsi3_libfunc=name
21574 Set the name of the library function used for 32-bit signed
21575 division to name. This only affects the name used in the call
21576 division strategies, and the compiler still expects the same sets
21577 of input/output/clobbered registers as if this option were not
21578 present.
21579
21580 -mfixed-range=register-range
21581 Generate code treating the given register range as fixed registers.
21582 A fixed register is one that the register allocator can not use.
21583 This is useful when compiling kernel code. A register range is
21584 specified as two registers separated by a dash. Multiple register
21585 ranges can be specified separated by a comma.
21586
21587 -mbranch-cost=num
21588 Assume num to be the cost for a branch instruction. Higher numbers
21589 make the compiler try to generate more branch-free code if
21590 possible. If not specified the value is selected depending on the
21591 processor type that is being compiled for.
21592
21593 -mzdcbranch
21594 -mno-zdcbranch
21595 Assume (do not assume) that zero displacement conditional branch
21596 instructions "bt" and "bf" are fast. If -mzdcbranch is specified,
21597 the compiler prefers zero displacement branch code sequences. This
21598 is enabled by default when generating code for SH4 and SH4A. It
21599 can be explicitly disabled by specifying -mno-zdcbranch.
21600
21601 -mcbranch-force-delay-slot
21602 Force the usage of delay slots for conditional branches, which
21603 stuffs the delay slot with a "nop" if a suitable instruction cannot
21604 be found. By default this option is disabled. It can be enabled
21605 to work around hardware bugs as found in the original SH7055.
21606
21607 -mfused-madd
21608 -mno-fused-madd
21609 Generate code that uses (does not use) the floating-point multiply
21610 and accumulate instructions. These instructions are generated by
21611 default if hardware floating point is used. The machine-dependent
21612 -mfused-madd option is now mapped to the machine-independent
21613 -ffp-contract=fast option, and -mno-fused-madd is mapped to
21614 -ffp-contract=off.
21615
21616 -mfsca
21617 -mno-fsca
21618 Allow or disallow the compiler to emit the "fsca" instruction for
21619 sine and cosine approximations. The option -mfsca must be used in
21620 combination with -funsafe-math-optimizations. It is enabled by
21621 default when generating code for SH4A. Using -mno-fsca disables
21622 sine and cosine approximations even if -funsafe-math-optimizations
21623 is in effect.
21624
21625 -mfsrra
21626 -mno-fsrra
21627 Allow or disallow the compiler to emit the "fsrra" instruction for
21628 reciprocal square root approximations. The option -mfsrra must be
21629 used in combination with -funsafe-math-optimizations and
21630 -ffinite-math-only. It is enabled by default when generating code
21631 for SH4A. Using -mno-fsrra disables reciprocal square root
21632 approximations even if -funsafe-math-optimizations and
21633 -ffinite-math-only are in effect.
21634
21635 -mpretend-cmove
21636 Prefer zero-displacement conditional branches for conditional move
21637 instruction patterns. This can result in faster code on the SH4
21638 processor.
21639
21640 -mfdpic
21641 Generate code using the FDPIC ABI.
21642
21643 Solaris 2 Options
21644
21645 These -m options are supported on Solaris 2:
21646
21647 -mclear-hwcap
21648 -mclear-hwcap tells the compiler to remove the hardware
21649 capabilities generated by the Solaris assembler. This is only
21650 necessary when object files use ISA extensions not supported by the
21651 current machine, but check at runtime whether or not to use them.
21652
21653 -mimpure-text
21654 -mimpure-text, used in addition to -shared, tells the compiler to
21655 not pass -z text to the linker when linking a shared object. Using
21656 this option, you can link position-dependent code into a shared
21657 object.
21658
21659 -mimpure-text suppresses the "relocations remain against
21660 allocatable but non-writable sections" linker error message.
21661 However, the necessary relocations trigger copy-on-write, and the
21662 shared object is not actually shared across processes. Instead of
21663 using -mimpure-text, you should compile all source code with -fpic
21664 or -fPIC.
21665
21666 These switches are supported in addition to the above on Solaris 2:
21667
21668 -pthreads
21669 This is a synonym for -pthread.
21670
21671 SPARC Options
21672
21673 These -m options are supported on the SPARC:
21674
21675 -mno-app-regs
21676 -mapp-regs
21677 Specify -mapp-regs to generate output using the global registers 2
21678 through 4, which the SPARC SVR4 ABI reserves for applications.
21679 Like the global register 1, each global register 2 through 4 is
21680 then treated as an allocable register that is clobbered by function
21681 calls. This is the default.
21682
21683 To be fully SVR4 ABI-compliant at the cost of some performance
21684 loss, specify -mno-app-regs. You should compile libraries and
21685 system software with this option.
21686
21687 -mflat
21688 -mno-flat
21689 With -mflat, the compiler does not generate save/restore
21690 instructions and uses a "flat" or single register window model.
21691 This model is compatible with the regular register window model.
21692 The local registers and the input registers (0--5) are still
21693 treated as "call-saved" registers and are saved on the stack as
21694 needed.
21695
21696 With -mno-flat (the default), the compiler generates save/restore
21697 instructions (except for leaf functions). This is the normal
21698 operating mode.
21699
21700 -mfpu
21701 -mhard-float
21702 Generate output containing floating-point instructions. This is
21703 the default.
21704
21705 -mno-fpu
21706 -msoft-float
21707 Generate output containing library calls for floating point.
21708 Warning: the requisite libraries are not available for all SPARC
21709 targets. Normally the facilities of the machine's usual C compiler
21710 are used, but this cannot be done directly in cross-compilation.
21711 You must make your own arrangements to provide suitable library
21712 functions for cross-compilation. The embedded targets sparc-*-aout
21713 and sparclite-*-* do provide software floating-point support.
21714
21715 -msoft-float changes the calling convention in the output file;
21716 therefore, it is only useful if you compile all of a program with
21717 this option. In particular, you need to compile libgcc.a, the
21718 library that comes with GCC, with -msoft-float in order for this to
21719 work.
21720
21721 -mhard-quad-float
21722 Generate output containing quad-word (long double) floating-point
21723 instructions.
21724
21725 -msoft-quad-float
21726 Generate output containing library calls for quad-word (long
21727 double) floating-point instructions. The functions called are
21728 those specified in the SPARC ABI. This is the default.
21729
21730 As of this writing, there are no SPARC implementations that have
21731 hardware support for the quad-word floating-point instructions.
21732 They all invoke a trap handler for one of these instructions, and
21733 then the trap handler emulates the effect of the instruction.
21734 Because of the trap handler overhead, this is much slower than
21735 calling the ABI library routines. Thus the -msoft-quad-float
21736 option is the default.
21737
21738 -mno-unaligned-doubles
21739 -munaligned-doubles
21740 Assume that doubles have 8-byte alignment. This is the default.
21741
21742 With -munaligned-doubles, GCC assumes that doubles have 8-byte
21743 alignment only if they are contained in another type, or if they
21744 have an absolute address. Otherwise, it assumes they have 4-byte
21745 alignment. Specifying this option avoids some rare compatibility
21746 problems with code generated by other compilers. It is not the
21747 default because it results in a performance loss, especially for
21748 floating-point code.
21749
21750 -muser-mode
21751 -mno-user-mode
21752 Do not generate code that can only run in supervisor mode. This is
21753 relevant only for the "casa" instruction emitted for the LEON3
21754 processor. This is the default.
21755
21756 -mfaster-structs
21757 -mno-faster-structs
21758 With -mfaster-structs, the compiler assumes that structures should
21759 have 8-byte alignment. This enables the use of pairs of "ldd" and
21760 "std" instructions for copies in structure assignment, in place of
21761 twice as many "ld" and "st" pairs. However, the use of this
21762 changed alignment directly violates the SPARC ABI. Thus, it's
21763 intended only for use on targets where the developer acknowledges
21764 that their resulting code is not directly in line with the rules of
21765 the ABI.
21766
21767 -mstd-struct-return
21768 -mno-std-struct-return
21769 With -mstd-struct-return, the compiler generates checking code in
21770 functions returning structures or unions to detect size mismatches
21771 between the two sides of function calls, as per the 32-bit ABI.
21772
21773 The default is -mno-std-struct-return. This option has no effect
21774 in 64-bit mode.
21775
21776 -mlra
21777 -mno-lra
21778 Enable Local Register Allocation. This is the default for SPARC
21779 since GCC 7 so -mno-lra needs to be passed to get old Reload.
21780
21781 -mcpu=cpu_type
21782 Set the instruction set, register set, and instruction scheduling
21783 parameters for machine type cpu_type. Supported values for
21784 cpu_type are v7, cypress, v8, supersparc, hypersparc, leon, leon3,
21785 leon3v7, sparclite, f930, f934, sparclite86x, sparclet, tsc701, v9,
21786 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4,
21787 niagara7 and m8.
21788
21789 Native Solaris and GNU/Linux toolchains also support the value
21790 native, which selects the best architecture option for the host
21791 processor. -mcpu=native has no effect if GCC does not recognize
21792 the processor.
21793
21794 Default instruction scheduling parameters are used for values that
21795 select an architecture and not an implementation. These are v7,
21796 v8, sparclite, sparclet, v9.
21797
21798 Here is a list of each supported architecture and their supported
21799 implementations.
21800
21801 v7 cypress, leon3v7
21802
21803 v8 supersparc, hypersparc, leon, leon3
21804
21805 sparclite
21806 f930, f934, sparclite86x
21807
21808 sparclet
21809 tsc701
21810
21811 v9 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4,
21812 niagara7, m8
21813
21814 By default (unless configured otherwise), GCC generates code for
21815 the V7 variant of the SPARC architecture. With -mcpu=cypress, the
21816 compiler additionally optimizes it for the Cypress CY7C602 chip, as
21817 used in the SPARCStation/SPARCServer 3xx series. This is also
21818 appropriate for the older SPARCStation 1, 2, IPX etc.
21819
21820 With -mcpu=v8, GCC generates code for the V8 variant of the SPARC
21821 architecture. The only difference from V7 code is that the
21822 compiler emits the integer multiply and integer divide instructions
21823 which exist in SPARC-V8 but not in SPARC-V7. With
21824 -mcpu=supersparc, the compiler additionally optimizes it for the
21825 SuperSPARC chip, as used in the SPARCStation 10, 1000 and 2000
21826 series.
21827
21828 With -mcpu=sparclite, GCC generates code for the SPARClite variant
21829 of the SPARC architecture. This adds the integer multiply, integer
21830 divide step and scan ("ffs") instructions which exist in SPARClite
21831 but not in SPARC-V7. With -mcpu=f930, the compiler additionally
21832 optimizes it for the Fujitsu MB86930 chip, which is the original
21833 SPARClite, with no FPU. With -mcpu=f934, the compiler additionally
21834 optimizes it for the Fujitsu MB86934 chip, which is the more recent
21835 SPARClite with FPU.
21836
21837 With -mcpu=sparclet, GCC generates code for the SPARClet variant of
21838 the SPARC architecture. This adds the integer multiply,
21839 multiply/accumulate, integer divide step and scan ("ffs")
21840 instructions which exist in SPARClet but not in SPARC-V7. With
21841 -mcpu=tsc701, the compiler additionally optimizes it for the TEMIC
21842 SPARClet chip.
21843
21844 With -mcpu=v9, GCC generates code for the V9 variant of the SPARC
21845 architecture. This adds 64-bit integer and floating-point move
21846 instructions, 3 additional floating-point condition code registers
21847 and conditional move instructions. With -mcpu=ultrasparc, the
21848 compiler additionally optimizes it for the Sun UltraSPARC I/II/IIi
21849 chips. With -mcpu=ultrasparc3, the compiler additionally optimizes
21850 it for the Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips. With
21851 -mcpu=niagara, the compiler additionally optimizes it for Sun
21852 UltraSPARC T1 chips. With -mcpu=niagara2, the compiler
21853 additionally optimizes it for Sun UltraSPARC T2 chips. With
21854 -mcpu=niagara3, the compiler additionally optimizes it for Sun
21855 UltraSPARC T3 chips. With -mcpu=niagara4, the compiler
21856 additionally optimizes it for Sun UltraSPARC T4 chips. With
21857 -mcpu=niagara7, the compiler additionally optimizes it for Oracle
21858 SPARC M7 chips. With -mcpu=m8, the compiler additionally optimizes
21859 it for Oracle M8 chips.
21860
21861 -mtune=cpu_type
21862 Set the instruction scheduling parameters for machine type
21863 cpu_type, but do not set the instruction set or register set that
21864 the option -mcpu=cpu_type does.
21865
21866 The same values for -mcpu=cpu_type can be used for -mtune=cpu_type,
21867 but the only useful values are those that select a particular CPU
21868 implementation. Those are cypress, supersparc, hypersparc, leon,
21869 leon3, leon3v7, f930, f934, sparclite86x, tsc701, ultrasparc,
21870 ultrasparc3, niagara, niagara2, niagara3, niagara4, niagara7 and
21871 m8. With native Solaris and GNU/Linux toolchains, native can also
21872 be used.
21873
21874 -mv8plus
21875 -mno-v8plus
21876 With -mv8plus, GCC generates code for the SPARC-V8+ ABI. The
21877 difference from the V8 ABI is that the global and out registers are
21878 considered 64 bits wide. This is enabled by default on Solaris in
21879 32-bit mode for all SPARC-V9 processors.
21880
21881 -mvis
21882 -mno-vis
21883 With -mvis, GCC generates code that takes advantage of the
21884 UltraSPARC Visual Instruction Set extensions. The default is
21885 -mno-vis.
21886
21887 -mvis2
21888 -mno-vis2
21889 With -mvis2, GCC generates code that takes advantage of version 2.0
21890 of the UltraSPARC Visual Instruction Set extensions. The default
21891 is -mvis2 when targeting a cpu that supports such instructions,
21892 such as UltraSPARC-III and later. Setting -mvis2 also sets -mvis.
21893
21894 -mvis3
21895 -mno-vis3
21896 With -mvis3, GCC generates code that takes advantage of version 3.0
21897 of the UltraSPARC Visual Instruction Set extensions. The default
21898 is -mvis3 when targeting a cpu that supports such instructions,
21899 such as niagara-3 and later. Setting -mvis3 also sets -mvis2 and
21900 -mvis.
21901
21902 -mvis4
21903 -mno-vis4
21904 With -mvis4, GCC generates code that takes advantage of version 4.0
21905 of the UltraSPARC Visual Instruction Set extensions. The default
21906 is -mvis4 when targeting a cpu that supports such instructions,
21907 such as niagara-7 and later. Setting -mvis4 also sets -mvis3,
21908 -mvis2 and -mvis.
21909
21910 -mvis4b
21911 -mno-vis4b
21912 With -mvis4b, GCC generates code that takes advantage of version
21913 4.0 of the UltraSPARC Visual Instruction Set extensions, plus the
21914 additional VIS instructions introduced in the Oracle SPARC
21915 Architecture 2017. The default is -mvis4b when targeting a cpu
21916 that supports such instructions, such as m8 and later. Setting
21917 -mvis4b also sets -mvis4, -mvis3, -mvis2 and -mvis.
21918
21919 -mcbcond
21920 -mno-cbcond
21921 With -mcbcond, GCC generates code that takes advantage of the
21922 UltraSPARC Compare-and-Branch-on-Condition instructions. The
21923 default is -mcbcond when targeting a CPU that supports such
21924 instructions, such as Niagara-4 and later.
21925
21926 -mfmaf
21927 -mno-fmaf
21928 With -mfmaf, GCC generates code that takes advantage of the
21929 UltraSPARC Fused Multiply-Add Floating-point instructions. The
21930 default is -mfmaf when targeting a CPU that supports such
21931 instructions, such as Niagara-3 and later.
21932
21933 -mfsmuld
21934 -mno-fsmuld
21935 With -mfsmuld, GCC generates code that takes advantage of the
21936 Floating-point Multiply Single to Double (FsMULd) instruction. The
21937 default is -mfsmuld when targeting a CPU supporting the
21938 architecture versions V8 or V9 with FPU except -mcpu=leon.
21939
21940 -mpopc
21941 -mno-popc
21942 With -mpopc, GCC generates code that takes advantage of the
21943 UltraSPARC Population Count instruction. The default is -mpopc
21944 when targeting a CPU that supports such an instruction, such as
21945 Niagara-2 and later.
21946
21947 -msubxc
21948 -mno-subxc
21949 With -msubxc, GCC generates code that takes advantage of the
21950 UltraSPARC Subtract-Extended-with-Carry instruction. The default
21951 is -msubxc when targeting a CPU that supports such an instruction,
21952 such as Niagara-7 and later.
21953
21954 -mfix-at697f
21955 Enable the documented workaround for the single erratum of the
21956 Atmel AT697F processor (which corresponds to erratum #13 of the
21957 AT697E processor).
21958
21959 -mfix-ut699
21960 Enable the documented workarounds for the floating-point errata and
21961 the data cache nullify errata of the UT699 processor.
21962
21963 -mfix-ut700
21964 Enable the documented workaround for the back-to-back store errata
21965 of the UT699E/UT700 processor.
21966
21967 -mfix-gr712rc
21968 Enable the documented workaround for the back-to-back store errata
21969 of the GR712RC processor.
21970
21971 These -m options are supported in addition to the above on SPARC-V9
21972 processors in 64-bit environments:
21973
21974 -m32
21975 -m64
21976 Generate code for a 32-bit or 64-bit environment. The 32-bit
21977 environment sets int, long and pointer to 32 bits. The 64-bit
21978 environment sets int to 32 bits and long and pointer to 64 bits.
21979
21980 -mcmodel=which
21981 Set the code model to one of
21982
21983 medlow
21984 The Medium/Low code model: 64-bit addresses, programs must be
21985 linked in the low 32 bits of memory. Programs can be
21986 statically or dynamically linked.
21987
21988 medmid
21989 The Medium/Middle code model: 64-bit addresses, programs must
21990 be linked in the low 44 bits of memory, the text and data
21991 segments must be less than 2GB in size and the data segment
21992 must be located within 2GB of the text segment.
21993
21994 medany
21995 The Medium/Anywhere code model: 64-bit addresses, programs may
21996 be linked anywhere in memory, the text and data segments must
21997 be less than 2GB in size and the data segment must be located
21998 within 2GB of the text segment.
21999
22000 embmedany
22001 The Medium/Anywhere code model for embedded systems: 64-bit
22002 addresses, the text and data segments must be less than 2GB in
22003 size, both starting anywhere in memory (determined at link
22004 time). The global register %g4 points to the base of the data
22005 segment. Programs are statically linked and PIC is not
22006 supported.
22007
22008 -mmemory-model=mem-model
22009 Set the memory model in force on the processor to one of
22010
22011 default
22012 The default memory model for the processor and operating
22013 system.
22014
22015 rmo Relaxed Memory Order
22016
22017 pso Partial Store Order
22018
22019 tso Total Store Order
22020
22021 sc Sequential Consistency
22022
22023 These memory models are formally defined in Appendix D of the
22024 SPARC-V9 architecture manual, as set in the processor's "PSTATE.MM"
22025 field.
22026
22027 -mstack-bias
22028 -mno-stack-bias
22029 With -mstack-bias, GCC assumes that the stack pointer, and frame
22030 pointer if present, are offset by -2047 which must be added back
22031 when making stack frame references. This is the default in 64-bit
22032 mode. Otherwise, assume no such offset is present.
22033
22034 SPU Options
22035
22036 These -m options are supported on the SPU:
22037
22038 -mwarn-reloc
22039 -merror-reloc
22040 The loader for SPU does not handle dynamic relocations. By
22041 default, GCC gives an error when it generates code that requires a
22042 dynamic relocation. -mno-error-reloc disables the error,
22043 -mwarn-reloc generates a warning instead.
22044
22045 -msafe-dma
22046 -munsafe-dma
22047 Instructions that initiate or test completion of DMA must not be
22048 reordered with respect to loads and stores of the memory that is
22049 being accessed. With -munsafe-dma you must use the "volatile"
22050 keyword to protect memory accesses, but that can lead to
22051 inefficient code in places where the memory is known to not change.
22052 Rather than mark the memory as volatile, you can use -msafe-dma to
22053 tell the compiler to treat the DMA instructions as potentially
22054 affecting all memory.
22055
22056 -mbranch-hints
22057 By default, GCC generates a branch hint instruction to avoid
22058 pipeline stalls for always-taken or probably-taken branches. A
22059 hint is not generated closer than 8 instructions away from its
22060 branch. There is little reason to disable them, except for
22061 debugging purposes, or to make an object a little bit smaller.
22062
22063 -msmall-mem
22064 -mlarge-mem
22065 By default, GCC generates code assuming that addresses are never
22066 larger than 18 bits. With -mlarge-mem code is generated that
22067 assumes a full 32-bit address.
22068
22069 -mstdmain
22070 By default, GCC links against startup code that assumes the SPU-
22071 style main function interface (which has an unconventional
22072 parameter list). With -mstdmain, GCC links your program against
22073 startup code that assumes a C99-style interface to "main",
22074 including a local copy of "argv" strings.
22075
22076 -mfixed-range=register-range
22077 Generate code treating the given register range as fixed registers.
22078 A fixed register is one that the register allocator cannot use.
22079 This is useful when compiling kernel code. A register range is
22080 specified as two registers separated by a dash. Multiple register
22081 ranges can be specified separated by a comma.
22082
22083 -mea32
22084 -mea64
22085 Compile code assuming that pointers to the PPU address space
22086 accessed via the "__ea" named address space qualifier are either 32
22087 or 64 bits wide. The default is 32 bits. As this is an ABI-
22088 changing option, all object code in an executable must be compiled
22089 with the same setting.
22090
22091 -maddress-space-conversion
22092 -mno-address-space-conversion
22093 Allow/disallow treating the "__ea" address space as superset of the
22094 generic address space. This enables explicit type casts between
22095 "__ea" and generic pointer as well as implicit conversions of
22096 generic pointers to "__ea" pointers. The default is to allow
22097 address space pointer conversions.
22098
22099 -mcache-size=cache-size
22100 This option controls the version of libgcc that the compiler links
22101 to an executable and selects a software-managed cache for accessing
22102 variables in the "__ea" address space with a particular cache size.
22103 Possible options for cache-size are 8, 16, 32, 64 and 128. The
22104 default cache size is 64KB.
22105
22106 -matomic-updates
22107 -mno-atomic-updates
22108 This option controls the version of libgcc that the compiler links
22109 to an executable and selects whether atomic updates to the
22110 software-managed cache of PPU-side variables are used. If you use
22111 atomic updates, changes to a PPU variable from SPU code using the
22112 "__ea" named address space qualifier do not interfere with changes
22113 to other PPU variables residing in the same cache line from PPU
22114 code. If you do not use atomic updates, such interference may
22115 occur; however, writing back cache lines is more efficient. The
22116 default behavior is to use atomic updates.
22117
22118 -mdual-nops
22119 -mdual-nops=n
22120 By default, GCC inserts NOPs to increase dual issue when it expects
22121 it to increase performance. n can be a value from 0 to 10. A
22122 smaller n inserts fewer NOPs. 10 is the default, 0 is the same as
22123 -mno-dual-nops. Disabled with -Os.
22124
22125 -mhint-max-nops=n
22126 Maximum number of NOPs to insert for a branch hint. A branch hint
22127 must be at least 8 instructions away from the branch it is
22128 affecting. GCC inserts up to n NOPs to enforce this, otherwise it
22129 does not generate the branch hint.
22130
22131 -mhint-max-distance=n
22132 The encoding of the branch hint instruction limits the hint to be
22133 within 256 instructions of the branch it is affecting. By default,
22134 GCC makes sure it is within 125.
22135
22136 -msafe-hints
22137 Work around a hardware bug that causes the SPU to stall
22138 indefinitely. By default, GCC inserts the "hbrp" instruction to
22139 make sure this stall won't happen.
22140
22141 Options for System V
22142
22143 These additional options are available on System V Release 4 for
22144 compatibility with other compilers on those systems:
22145
22146 -G Create a shared object. It is recommended that -symbolic or
22147 -shared be used instead.
22148
22149 -Qy Identify the versions of each tool used by the compiler, in a
22150 ".ident" assembler directive in the output.
22151
22152 -Qn Refrain from adding ".ident" directives to the output file (this is
22153 the default).
22154
22155 -YP,dirs
22156 Search the directories dirs, and no others, for libraries specified
22157 with -l.
22158
22159 -Ym,dir
22160 Look in the directory dir to find the M4 preprocessor. The
22161 assembler uses this option.
22162
22163 TILE-Gx Options
22164
22165 These -m options are supported on the TILE-Gx:
22166
22167 -mcmodel=small
22168 Generate code for the small model. The distance for direct calls
22169 is limited to 500M in either direction. PC-relative addresses are
22170 32 bits. Absolute addresses support the full address range.
22171
22172 -mcmodel=large
22173 Generate code for the large model. There is no limitation on call
22174 distance, pc-relative addresses, or absolute addresses.
22175
22176 -mcpu=name
22177 Selects the type of CPU to be targeted. Currently the only
22178 supported type is tilegx.
22179
22180 -m32
22181 -m64
22182 Generate code for a 32-bit or 64-bit environment. The 32-bit
22183 environment sets int, long, and pointer to 32 bits. The 64-bit
22184 environment sets int to 32 bits and long and pointer to 64 bits.
22185
22186 -mbig-endian
22187 -mlittle-endian
22188 Generate code in big/little endian mode, respectively.
22189
22190 TILEPro Options
22191
22192 These -m options are supported on the TILEPro:
22193
22194 -mcpu=name
22195 Selects the type of CPU to be targeted. Currently the only
22196 supported type is tilepro.
22197
22198 -m32
22199 Generate code for a 32-bit environment, which sets int, long, and
22200 pointer to 32 bits. This is the only supported behavior so the
22201 flag is essentially ignored.
22202
22203 V850 Options
22204
22205 These -m options are defined for V850 implementations:
22206
22207 -mlong-calls
22208 -mno-long-calls
22209 Treat all calls as being far away (near). If calls are assumed to
22210 be far away, the compiler always loads the function's address into
22211 a register, and calls indirect through the pointer.
22212
22213 -mno-ep
22214 -mep
22215 Do not optimize (do optimize) basic blocks that use the same index
22216 pointer 4 or more times to copy pointer into the "ep" register, and
22217 use the shorter "sld" and "sst" instructions. The -mep option is
22218 on by default if you optimize.
22219
22220 -mno-prolog-function
22221 -mprolog-function
22222 Do not use (do use) external functions to save and restore
22223 registers at the prologue and epilogue of a function. The external
22224 functions are slower, but use less code space if more than one
22225 function saves the same number of registers. The -mprolog-function
22226 option is on by default if you optimize.
22227
22228 -mspace
22229 Try to make the code as small as possible. At present, this just
22230 turns on the -mep and -mprolog-function options.
22231
22232 -mtda=n
22233 Put static or global variables whose size is n bytes or less into
22234 the tiny data area that register "ep" points to. The tiny data
22235 area can hold up to 256 bytes in total (128 bytes for byte
22236 references).
22237
22238 -msda=n
22239 Put static or global variables whose size is n bytes or less into
22240 the small data area that register "gp" points to. The small data
22241 area can hold up to 64 kilobytes.
22242
22243 -mzda=n
22244 Put static or global variables whose size is n bytes or less into
22245 the first 32 kilobytes of memory.
22246
22247 -mv850
22248 Specify that the target processor is the V850.
22249
22250 -mv850e3v5
22251 Specify that the target processor is the V850E3V5. The
22252 preprocessor constant "__v850e3v5__" is defined if this option is
22253 used.
22254
22255 -mv850e2v4
22256 Specify that the target processor is the V850E3V5. This is an
22257 alias for the -mv850e3v5 option.
22258
22259 -mv850e2v3
22260 Specify that the target processor is the V850E2V3. The
22261 preprocessor constant "__v850e2v3__" is defined if this option is
22262 used.
22263
22264 -mv850e2
22265 Specify that the target processor is the V850E2. The preprocessor
22266 constant "__v850e2__" is defined if this option is used.
22267
22268 -mv850e1
22269 Specify that the target processor is the V850E1. The preprocessor
22270 constants "__v850e1__" and "__v850e__" are defined if this option
22271 is used.
22272
22273 -mv850es
22274 Specify that the target processor is the V850ES. This is an alias
22275 for the -mv850e1 option.
22276
22277 -mv850e
22278 Specify that the target processor is the V850E. The preprocessor
22279 constant "__v850e__" is defined if this option is used.
22280
22281 If neither -mv850 nor -mv850e nor -mv850e1 nor -mv850e2 nor
22282 -mv850e2v3 nor -mv850e3v5 are defined then a default target
22283 processor is chosen and the relevant __v850*__ preprocessor
22284 constant is defined.
22285
22286 The preprocessor constants "__v850" and "__v851__" are always
22287 defined, regardless of which processor variant is the target.
22288
22289 -mdisable-callt
22290 -mno-disable-callt
22291 This option suppresses generation of the "CALLT" instruction for
22292 the v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the
22293 v850 architecture.
22294
22295 This option is enabled by default when the RH850 ABI is in use (see
22296 -mrh850-abi), and disabled by default when the GCC ABI is in use.
22297 If "CALLT" instructions are being generated then the C preprocessor
22298 symbol "__V850_CALLT__" is defined.
22299
22300 -mrelax
22301 -mno-relax
22302 Pass on (or do not pass on) the -mrelax command-line option to the
22303 assembler.
22304
22305 -mlong-jumps
22306 -mno-long-jumps
22307 Disable (or re-enable) the generation of PC-relative jump
22308 instructions.
22309
22310 -msoft-float
22311 -mhard-float
22312 Disable (or re-enable) the generation of hardware floating point
22313 instructions. This option is only significant when the target
22314 architecture is V850E2V3 or higher. If hardware floating point
22315 instructions are being generated then the C preprocessor symbol
22316 "__FPU_OK__" is defined, otherwise the symbol "__NO_FPU__" is
22317 defined.
22318
22319 -mloop
22320 Enables the use of the e3v5 LOOP instruction. The use of this
22321 instruction is not enabled by default when the e3v5 architecture is
22322 selected because its use is still experimental.
22323
22324 -mrh850-abi
22325 -mghs
22326 Enables support for the RH850 version of the V850 ABI. This is the
22327 default. With this version of the ABI the following rules apply:
22328
22329 * Integer sized structures and unions are returned via a memory
22330 pointer rather than a register.
22331
22332 * Large structures and unions (more than 8 bytes in size) are
22333 passed by value.
22334
22335 * Functions are aligned to 16-bit boundaries.
22336
22337 * The -m8byte-align command-line option is supported.
22338
22339 * The -mdisable-callt command-line option is enabled by default.
22340 The -mno-disable-callt command-line option is not supported.
22341
22342 When this version of the ABI is enabled the C preprocessor symbol
22343 "__V850_RH850_ABI__" is defined.
22344
22345 -mgcc-abi
22346 Enables support for the old GCC version of the V850 ABI. With this
22347 version of the ABI the following rules apply:
22348
22349 * Integer sized structures and unions are returned in register
22350 "r10".
22351
22352 * Large structures and unions (more than 8 bytes in size) are
22353 passed by reference.
22354
22355 * Functions are aligned to 32-bit boundaries, unless optimizing
22356 for size.
22357
22358 * The -m8byte-align command-line option is not supported.
22359
22360 * The -mdisable-callt command-line option is supported but not
22361 enabled by default.
22362
22363 When this version of the ABI is enabled the C preprocessor symbol
22364 "__V850_GCC_ABI__" is defined.
22365
22366 -m8byte-align
22367 -mno-8byte-align
22368 Enables support for "double" and "long long" types to be aligned on
22369 8-byte boundaries. The default is to restrict the alignment of all
22370 objects to at most 4-bytes. When -m8byte-align is in effect the C
22371 preprocessor symbol "__V850_8BYTE_ALIGN__" is defined.
22372
22373 -mbig-switch
22374 Generate code suitable for big switch tables. Use this option only
22375 if the assembler/linker complain about out of range branches within
22376 a switch table.
22377
22378 -mapp-regs
22379 This option causes r2 and r5 to be used in the code generated by
22380 the compiler. This setting is the default.
22381
22382 -mno-app-regs
22383 This option causes r2 and r5 to be treated as fixed registers.
22384
22385 VAX Options
22386
22387 These -m options are defined for the VAX:
22388
22389 -munix
22390 Do not output certain jump instructions ("aobleq" and so on) that
22391 the Unix assembler for the VAX cannot handle across long ranges.
22392
22393 -mgnu
22394 Do output those jump instructions, on the assumption that the GNU
22395 assembler is being used.
22396
22397 -mg Output code for G-format floating-point numbers instead of
22398 D-format.
22399
22400 Visium Options
22401
22402 -mdebug
22403 A program which performs file I/O and is destined to run on an MCM
22404 target should be linked with this option. It causes the libraries
22405 libc.a and libdebug.a to be linked. The program should be run on
22406 the target under the control of the GDB remote debugging stub.
22407
22408 -msim
22409 A program which performs file I/O and is destined to run on the
22410 simulator should be linked with option. This causes libraries
22411 libc.a and libsim.a to be linked.
22412
22413 -mfpu
22414 -mhard-float
22415 Generate code containing floating-point instructions. This is the
22416 default.
22417
22418 -mno-fpu
22419 -msoft-float
22420 Generate code containing library calls for floating-point.
22421
22422 -msoft-float changes the calling convention in the output file;
22423 therefore, it is only useful if you compile all of a program with
22424 this option. In particular, you need to compile libgcc.a, the
22425 library that comes with GCC, with -msoft-float in order for this to
22426 work.
22427
22428 -mcpu=cpu_type
22429 Set the instruction set, register set, and instruction scheduling
22430 parameters for machine type cpu_type. Supported values for
22431 cpu_type are mcm, gr5 and gr6.
22432
22433 mcm is a synonym of gr5 present for backward compatibility.
22434
22435 By default (unless configured otherwise), GCC generates code for
22436 the GR5 variant of the Visium architecture.
22437
22438 With -mcpu=gr6, GCC generates code for the GR6 variant of the
22439 Visium architecture. The only difference from GR5 code is that the
22440 compiler will generate block move instructions.
22441
22442 -mtune=cpu_type
22443 Set the instruction scheduling parameters for machine type
22444 cpu_type, but do not set the instruction set or register set that
22445 the option -mcpu=cpu_type would.
22446
22447 -msv-mode
22448 Generate code for the supervisor mode, where there are no
22449 restrictions on the access to general registers. This is the
22450 default.
22451
22452 -muser-mode
22453 Generate code for the user mode, where the access to some general
22454 registers is forbidden: on the GR5, registers r24 to r31 cannot be
22455 accessed in this mode; on the GR6, only registers r29 to r31 are
22456 affected.
22457
22458 VMS Options
22459
22460 These -m options are defined for the VMS implementations:
22461
22462 -mvms-return-codes
22463 Return VMS condition codes from "main". The default is to return
22464 POSIX-style condition (e.g. error) codes.
22465
22466 -mdebug-main=prefix
22467 Flag the first routine whose name starts with prefix as the main
22468 routine for the debugger.
22469
22470 -mmalloc64
22471 Default to 64-bit memory allocation routines.
22472
22473 -mpointer-size=size
22474 Set the default size of pointers. Possible options for size are 32
22475 or short for 32 bit pointers, 64 or long for 64 bit pointers, and
22476 no for supporting only 32 bit pointers. The later option disables
22477 "pragma pointer_size".
22478
22479 VxWorks Options
22480
22481 The options in this section are defined for all VxWorks targets.
22482 Options specific to the target hardware are listed with the other
22483 options for that target.
22484
22485 -mrtp
22486 GCC can generate code for both VxWorks kernels and real time
22487 processes (RTPs). This option switches from the former to the
22488 latter. It also defines the preprocessor macro "__RTP__".
22489
22490 -non-static
22491 Link an RTP executable against shared libraries rather than static
22492 libraries. The options -static and -shared can also be used for
22493 RTPs; -static is the default.
22494
22495 -Bstatic
22496 -Bdynamic
22497 These options are passed down to the linker. They are defined for
22498 compatibility with Diab.
22499
22500 -Xbind-lazy
22501 Enable lazy binding of function calls. This option is equivalent
22502 to -Wl,-z,now and is defined for compatibility with Diab.
22503
22504 -Xbind-now
22505 Disable lazy binding of function calls. This option is the default
22506 and is defined for compatibility with Diab.
22507
22508 x86 Options
22509
22510 These -m options are defined for the x86 family of computers.
22511
22512 -march=cpu-type
22513 Generate instructions for the machine type cpu-type. In contrast
22514 to -mtune=cpu-type, which merely tunes the generated code for the
22515 specified cpu-type, -march=cpu-type allows GCC to generate code
22516 that may not run at all on processors other than the one indicated.
22517 Specifying -march=cpu-type implies -mtune=cpu-type.
22518
22519 The choices for cpu-type are:
22520
22521 native
22522 This selects the CPU to generate code for at compilation time
22523 by determining the processor type of the compiling machine.
22524 Using -march=native enables all instruction subsets supported
22525 by the local machine (hence the result might not run on
22526 different machines). Using -mtune=native produces code
22527 optimized for the local machine under the constraints of the
22528 selected instruction set.
22529
22530 x86-64
22531 A generic CPU with 64-bit extensions.
22532
22533 i386
22534 Original Intel i386 CPU.
22535
22536 i486
22537 Intel i486 CPU. (No scheduling is implemented for this chip.)
22538
22539 i586
22540 pentium
22541 Intel Pentium CPU with no MMX support.
22542
22543 lakemont
22544 Intel Lakemont MCU, based on Intel Pentium CPU.
22545
22546 pentium-mmx
22547 Intel Pentium MMX CPU, based on Pentium core with MMX
22548 instruction set support.
22549
22550 pentiumpro
22551 Intel Pentium Pro CPU.
22552
22553 i686
22554 When used with -march, the Pentium Pro instruction set is used,
22555 so the code runs on all i686 family chips. When used with
22556 -mtune, it has the same meaning as generic.
22557
22558 pentium2
22559 Intel Pentium II CPU, based on Pentium Pro core with MMX
22560 instruction set support.
22561
22562 pentium3
22563 pentium3m
22564 Intel Pentium III CPU, based on Pentium Pro core with MMX and
22565 SSE instruction set support.
22566
22567 pentium-m
22568 Intel Pentium M; low-power version of Intel Pentium III CPU
22569 with MMX, SSE and SSE2 instruction set support. Used by
22570 Centrino notebooks.
22571
22572 pentium4
22573 pentium4m
22574 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set
22575 support.
22576
22577 prescott
22578 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and
22579 SSE3 instruction set support.
22580
22581 nocona
22582 Improved version of Intel Pentium 4 CPU with 64-bit extensions,
22583 MMX, SSE, SSE2 and SSE3 instruction set support.
22584
22585 core2
22586 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3
22587 and SSSE3 instruction set support.
22588
22589 nehalem
22590 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3,
22591 SSSE3, SSE4.1, SSE4.2 and POPCNT instruction set support.
22592
22593 westmere
22594 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2,
22595 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction
22596 set support.
22597
22598 sandybridge
22599 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2,
22600 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL
22601 instruction set support.
22602
22603 ivybridge
22604 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2,
22605 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL,
22606 FSGSBASE, RDRND and F16C instruction set support.
22607
22608 haswell
22609 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE,
22610 SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES,
22611 PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2 and F16C instruction
22612 set support.
22613
22614 broadwell
22615 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE,
22616 SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES,
22617 PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX and
22618 PREFETCHW instruction set support.
22619
22620 skylake
22621 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE,
22622 SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES,
22623 PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX,
22624 PREFETCHW, CLFLUSHOPT, XSAVEC and XSAVES instruction set
22625 support.
22626
22627 bonnell
22628 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE,
22629 SSE2, SSE3 and SSSE3 instruction set support.
22630
22631 silvermont
22632 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE,
22633 SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and
22634 RDRND instruction set support.
22635
22636 knl Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX,
22637 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES,
22638 PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX,
22639 PREFETCHW, AVX512F, AVX512PF, AVX512ER and AVX512CD instruction
22640 set support.
22641
22642 knm Intel Knights Mill CPU with 64-bit extensions, MOVBE, MMX, SSE,
22643 SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES,
22644 PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX,
22645 PREFETCHW, AVX512F, AVX512PF, AVX512ER, AVX512CD, AVX5124VNNIW,
22646 AVX5124FMAPS and AVX512VPOPCNTDQ instruction set support.
22647
22648 skylake-avx512
22649 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX,
22650 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2,
22651 AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED,
22652 ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, CLWB,
22653 AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set
22654 support.
22655
22656 cannonlake
22657 Intel Cannonlake Server CPU with 64-bit extensions, MOVBE, MMX,
22658 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2,
22659 AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED,
22660 ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, AVX512VL,
22661 AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI, AVX512IFMA, SHA and
22662 UMIP instruction set support.
22663
22664 icelake-client
22665 Intel Icelake Client CPU with 64-bit extensions, MOVBE, MMX,
22666 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2,
22667 AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED,
22668 ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, AVX512VL,
22669 AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI, AVX512IFMA, SHA,
22670 CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
22671 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES instruction set
22672 support.
22673
22674 icelake-server
22675 Intel Icelake Server CPU with 64-bit extensions, MOVBE, MMX,
22676 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2,
22677 AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED,
22678 ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, AVX512VL,
22679 AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI, AVX512IFMA, SHA,
22680 CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ,
22681 AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES, PCONFIG and
22682 WBNOINVD instruction set support.
22683
22684 k6 AMD K6 CPU with MMX instruction set support.
22685
22686 k6-2
22687 k6-3
22688 Improved versions of AMD K6 CPU with MMX and 3DNow! instruction
22689 set support.
22690
22691 athlon
22692 athlon-tbird
22693 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow! and SSE
22694 prefetch instructions support.
22695
22696 athlon-4
22697 athlon-xp
22698 athlon-mp
22699 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow! and
22700 full SSE instruction set support.
22701
22702 k8
22703 opteron
22704 athlon64
22705 athlon-fx
22706 Processors based on the AMD K8 core with x86-64 instruction set
22707 support, including the AMD Opteron, Athlon 64, and Athlon 64 FX
22708 processors. (This supersets MMX, SSE, SSE2, 3DNow!, enhanced
22709 3DNow! and 64-bit instruction set extensions.)
22710
22711 k8-sse3
22712 opteron-sse3
22713 athlon64-sse3
22714 Improved versions of AMD K8 cores with SSE3 instruction set
22715 support.
22716
22717 amdfam10
22718 barcelona
22719 CPUs based on AMD Family 10h cores with x86-64 instruction set
22720 support. (This supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!,
22721 enhanced 3DNow!, ABM and 64-bit instruction set extensions.)
22722
22723 bdver1
22724 CPUs based on AMD Family 15h cores with x86-64 instruction set
22725 support. (This supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL,
22726 CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM
22727 and 64-bit instruction set extensions.)
22728
22729 bdver2
22730 AMD Family 15h core based CPUs with x86-64 instruction set
22731 support. (This supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP,
22732 LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
22733 SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
22734
22735 bdver3
22736 AMD Family 15h core based CPUs with x86-64 instruction set
22737 support. (This supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE,
22738 AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
22739 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set
22740 extensions.
22741
22742 bdver4
22743 AMD Family 15h core based CPUs with x86-64 instruction set
22744 support. (This supersets BMI, BMI2, TBM, F16C, FMA, FMA4,
22745 FSGSBASE, AVX, AVX2, XOP, LWP, AES, PCL_MUL, CX16, MOVBE, MMX,
22746 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit
22747 instruction set extensions.
22748
22749 znver1
22750 AMD Family 17h core based CPUs with x86-64 instruction set
22751 support. (This supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX,
22752 AVX2, ADCX, RDSEED, MWAITX, SHA, CLZERO, AES, PCL_MUL, CX16,
22753 MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM,
22754 XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit instruction set
22755 extensions.
22756
22757 btver1
22758 CPUs based on AMD Family 14h cores with x86-64 instruction set
22759 support. (This supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A,
22760 CX16, ABM and 64-bit instruction set extensions.)
22761
22762 btver2
22763 CPUs based on AMD Family 16h cores with x86-64 instruction set
22764 support. This includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES,
22765 SSE4.2, SSE4.1, CX16, ABM, SSE4A, SSSE3, SSE3, SSE2, SSE, MMX
22766 and 64-bit instruction set extensions.
22767
22768 winchip-c6
22769 IDT WinChip C6 CPU, dealt in same way as i486 with additional
22770 MMX instruction set support.
22771
22772 winchip2
22773 IDT WinChip 2 CPU, dealt in same way as i486 with additional
22774 MMX and 3DNow! instruction set support.
22775
22776 c3 VIA C3 CPU with MMX and 3DNow! instruction set support. (No
22777 scheduling is implemented for this chip.)
22778
22779 c3-2
22780 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set
22781 support. (No scheduling is implemented for this chip.)
22782
22783 c7 VIA C7 (Esther) CPU with MMX, SSE, SSE2 and SSE3 instruction
22784 set support. (No scheduling is implemented for this chip.)
22785
22786 samuel-2
22787 VIA Eden Samuel 2 CPU with MMX and 3DNow! instruction set
22788 support. (No scheduling is implemented for this chip.)
22789
22790 nehemiah
22791 VIA Eden Nehemiah CPU with MMX and SSE instruction set support.
22792 (No scheduling is implemented for this chip.)
22793
22794 esther
22795 VIA Eden Esther CPU with MMX, SSE, SSE2 and SSE3 instruction
22796 set support. (No scheduling is implemented for this chip.)
22797
22798 eden-x2
22799 VIA Eden X2 CPU with x86-64, MMX, SSE, SSE2 and SSE3
22800 instruction set support. (No scheduling is implemented for
22801 this chip.)
22802
22803 eden-x4
22804 VIA Eden X4 CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3,
22805 SSE4.1, SSE4.2, AVX and AVX2 instruction set support. (No
22806 scheduling is implemented for this chip.)
22807
22808 nano
22809 Generic VIA Nano CPU with x86-64, MMX, SSE, SSE2, SSE3 and
22810 SSSE3 instruction set support. (No scheduling is implemented
22811 for this chip.)
22812
22813 nano-1000
22814 VIA Nano 1xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
22815 instruction set support. (No scheduling is implemented for
22816 this chip.)
22817
22818 nano-2000
22819 VIA Nano 2xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
22820 instruction set support. (No scheduling is implemented for
22821 this chip.)
22822
22823 nano-3000
22824 VIA Nano 3xxx CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and
22825 SSE4.1 instruction set support. (No scheduling is implemented
22826 for this chip.)
22827
22828 nano-x2
22829 VIA Nano Dual Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3
22830 and SSE4.1 instruction set support. (No scheduling is
22831 implemented for this chip.)
22832
22833 nano-x4
22834 VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3
22835 and SSE4.1 instruction set support. (No scheduling is
22836 implemented for this chip.)
22837
22838 geode
22839 AMD Geode embedded processor with MMX and 3DNow! instruction
22840 set support.
22841
22842 -mtune=cpu-type
22843 Tune to cpu-type everything applicable about the generated code,
22844 except for the ABI and the set of available instructions. While
22845 picking a specific cpu-type schedules things appropriately for that
22846 particular chip, the compiler does not generate any code that
22847 cannot run on the default machine type unless you use a -march=cpu-
22848 type option. For example, if GCC is configured for
22849 i686-pc-linux-gnu then -mtune=pentium4 generates code that is tuned
22850 for Pentium 4 but still runs on i686 machines.
22851
22852 The choices for cpu-type are the same as for -march. In addition,
22853 -mtune supports 2 extra choices for cpu-type:
22854
22855 generic
22856 Produce code optimized for the most common IA32/AMD64/EM64T
22857 processors. If you know the CPU on which your code will run,
22858 then you should use the corresponding -mtune or -march option
22859 instead of -mtune=generic. But, if you do not know exactly
22860 what CPU users of your application will have, then you should
22861 use this option.
22862
22863 As new processors are deployed in the marketplace, the behavior
22864 of this option will change. Therefore, if you upgrade to a
22865 newer version of GCC, code generation controlled by this option
22866 will change to reflect the processors that are most common at
22867 the time that version of GCC is released.
22868
22869 There is no -march=generic option because -march indicates the
22870 instruction set the compiler can use, and there is no generic
22871 instruction set applicable to all processors. In contrast,
22872 -mtune indicates the processor (or, in this case, collection of
22873 processors) for which the code is optimized.
22874
22875 intel
22876 Produce code optimized for the most current Intel processors,
22877 which are Haswell and Silvermont for this version of GCC. If
22878 you know the CPU on which your code will run, then you should
22879 use the corresponding -mtune or -march option instead of
22880 -mtune=intel. But, if you want your application performs
22881 better on both Haswell and Silvermont, then you should use this
22882 option.
22883
22884 As new Intel processors are deployed in the marketplace, the
22885 behavior of this option will change. Therefore, if you upgrade
22886 to a newer version of GCC, code generation controlled by this
22887 option will change to reflect the most current Intel processors
22888 at the time that version of GCC is released.
22889
22890 There is no -march=intel option because -march indicates the
22891 instruction set the compiler can use, and there is no common
22892 instruction set applicable to all processors. In contrast,
22893 -mtune indicates the processor (or, in this case, collection of
22894 processors) for which the code is optimized.
22895
22896 -mcpu=cpu-type
22897 A deprecated synonym for -mtune.
22898
22899 -mfpmath=unit
22900 Generate floating-point arithmetic for selected unit unit. The
22901 choices for unit are:
22902
22903 387 Use the standard 387 floating-point coprocessor present on the
22904 majority of chips and emulated otherwise. Code compiled with
22905 this option runs almost everywhere. The temporary results are
22906 computed in 80-bit precision instead of the precision specified
22907 by the type, resulting in slightly different results compared
22908 to most of other chips. See -ffloat-store for more detailed
22909 description.
22910
22911 This is the default choice for non-Darwin x86-32 targets.
22912
22913 sse Use scalar floating-point instructions present in the SSE
22914 instruction set. This instruction set is supported by Pentium
22915 III and newer chips, and in the AMD line by Athlon-4, Athlon XP
22916 and Athlon MP chips. The earlier version of the SSE
22917 instruction set supports only single-precision arithmetic, thus
22918 the double and extended-precision arithmetic are still done
22919 using 387. A later version, present only in Pentium 4 and AMD
22920 x86-64 chips, supports double-precision arithmetic too.
22921
22922 For the x86-32 compiler, you must use -march=cpu-type, -msse or
22923 -msse2 switches to enable SSE extensions and make this option
22924 effective. For the x86-64 compiler, these extensions are
22925 enabled by default.
22926
22927 The resulting code should be considerably faster in the
22928 majority of cases and avoid the numerical instability problems
22929 of 387 code, but may break some existing code that expects
22930 temporaries to be 80 bits.
22931
22932 This is the default choice for the x86-64 compiler, Darwin
22933 x86-32 targets, and the default choice for x86-32 targets with
22934 the SSE2 instruction set when -ffast-math is enabled.
22935
22936 sse,387
22937 sse+387
22938 both
22939 Attempt to utilize both instruction sets at once. This
22940 effectively doubles the amount of available registers, and on
22941 chips with separate execution units for 387 and SSE the
22942 execution resources too. Use this option with care, as it is
22943 still experimental, because the GCC register allocator does not
22944 model separate functional units well, resulting in unstable
22945 performance.
22946
22947 -masm=dialect
22948 Output assembly instructions using selected dialect. Also affects
22949 which dialect is used for basic "asm" and extended "asm". Supported
22950 choices (in dialect order) are att or intel. The default is att.
22951 Darwin does not support intel.
22952
22953 -mieee-fp
22954 -mno-ieee-fp
22955 Control whether or not the compiler uses IEEE floating-point
22956 comparisons. These correctly handle the case where the result of a
22957 comparison is unordered.
22958
22959 -m80387
22960 -mhard-float
22961 Generate output containing 80387 instructions for floating point.
22962
22963 -mno-80387
22964 -msoft-float
22965 Generate output containing library calls for floating point.
22966
22967 Warning: the requisite libraries are not part of GCC. Normally the
22968 facilities of the machine's usual C compiler are used, but this
22969 cannot be done directly in cross-compilation. You must make your
22970 own arrangements to provide suitable library functions for cross-
22971 compilation.
22972
22973 On machines where a function returns floating-point results in the
22974 80387 register stack, some floating-point opcodes may be emitted
22975 even if -msoft-float is used.
22976
22977 -mno-fp-ret-in-387
22978 Do not use the FPU registers for return values of functions.
22979
22980 The usual calling convention has functions return values of types
22981 "float" and "double" in an FPU register, even if there is no FPU.
22982 The idea is that the operating system should emulate an FPU.
22983
22984 The option -mno-fp-ret-in-387 causes such values to be returned in
22985 ordinary CPU registers instead.
22986
22987 -mno-fancy-math-387
22988 Some 387 emulators do not support the "sin", "cos" and "sqrt"
22989 instructions for the 387. Specify this option to avoid generating
22990 those instructions. This option is the default on OpenBSD and
22991 NetBSD. This option is overridden when -march indicates that the
22992 target CPU always has an FPU and so the instruction does not need
22993 emulation. These instructions are not generated unless you also
22994 use the -funsafe-math-optimizations switch.
22995
22996 -malign-double
22997 -mno-align-double
22998 Control whether GCC aligns "double", "long double", and "long long"
22999 variables on a two-word boundary or a one-word boundary. Aligning
23000 "double" variables on a two-word boundary produces code that runs
23001 somewhat faster on a Pentium at the expense of more memory.
23002
23003 On x86-64, -malign-double is enabled by default.
23004
23005 Warning: if you use the -malign-double switch, structures
23006 containing the above types are aligned differently than the
23007 published application binary interface specifications for the
23008 x86-32 and are not binary compatible with structures in code
23009 compiled without that switch.
23010
23011 -m96bit-long-double
23012 -m128bit-long-double
23013 These switches control the size of "long double" type. The x86-32
23014 application binary interface specifies the size to be 96 bits, so
23015 -m96bit-long-double is the default in 32-bit mode.
23016
23017 Modern architectures (Pentium and newer) prefer "long double" to be
23018 aligned to an 8- or 16-byte boundary. In arrays or structures
23019 conforming to the ABI, this is not possible. So specifying
23020 -m128bit-long-double aligns "long double" to a 16-byte boundary by
23021 padding the "long double" with an additional 32-bit zero.
23022
23023 In the x86-64 compiler, -m128bit-long-double is the default choice
23024 as its ABI specifies that "long double" is aligned on 16-byte
23025 boundary.
23026
23027 Notice that neither of these options enable any extra precision
23028 over the x87 standard of 80 bits for a "long double".
23029
23030 Warning: if you override the default value for your target ABI,
23031 this changes the size of structures and arrays containing "long
23032 double" variables, as well as modifying the function calling
23033 convention for functions taking "long double". Hence they are not
23034 binary-compatible with code compiled without that switch.
23035
23036 -mlong-double-64
23037 -mlong-double-80
23038 -mlong-double-128
23039 These switches control the size of "long double" type. A size of 64
23040 bits makes the "long double" type equivalent to the "double" type.
23041 This is the default for 32-bit Bionic C library. A size of 128
23042 bits makes the "long double" type equivalent to the "__float128"
23043 type. This is the default for 64-bit Bionic C library.
23044
23045 Warning: if you override the default value for your target ABI,
23046 this changes the size of structures and arrays containing "long
23047 double" variables, as well as modifying the function calling
23048 convention for functions taking "long double". Hence they are not
23049 binary-compatible with code compiled without that switch.
23050
23051 -malign-data=type
23052 Control how GCC aligns variables. Supported values for type are
23053 compat uses increased alignment value compatible uses GCC 4.8 and
23054 earlier, abi uses alignment value as specified by the psABI, and
23055 cacheline uses increased alignment value to match the cache line
23056 size. compat is the default.
23057
23058 -mlarge-data-threshold=threshold
23059 When -mcmodel=medium is specified, data objects larger than
23060 threshold are placed in the large data section. This value must be
23061 the same across all objects linked into the binary, and defaults to
23062 65535.
23063
23064 -mrtd
23065 Use a different function-calling convention, in which functions
23066 that take a fixed number of arguments return with the "ret num"
23067 instruction, which pops their arguments while returning. This
23068 saves one instruction in the caller since there is no need to pop
23069 the arguments there.
23070
23071 You can specify that an individual function is called with this
23072 calling sequence with the function attribute "stdcall". You can
23073 also override the -mrtd option by using the function attribute
23074 "cdecl".
23075
23076 Warning: this calling convention is incompatible with the one
23077 normally used on Unix, so you cannot use it if you need to call
23078 libraries compiled with the Unix compiler.
23079
23080 Also, you must provide function prototypes for all functions that
23081 take variable numbers of arguments (including "printf"); otherwise
23082 incorrect code is generated for calls to those functions.
23083
23084 In addition, seriously incorrect code results if you call a
23085 function with too many arguments. (Normally, extra arguments are
23086 harmlessly ignored.)
23087
23088 -mregparm=num
23089 Control how many registers are used to pass integer arguments. By
23090 default, no registers are used to pass arguments, and at most 3
23091 registers can be used. You can control this behavior for a
23092 specific function by using the function attribute "regparm".
23093
23094 Warning: if you use this switch, and num is nonzero, then you must
23095 build all modules with the same value, including any libraries.
23096 This includes the system libraries and startup modules.
23097
23098 -msseregparm
23099 Use SSE register passing conventions for float and double arguments
23100 and return values. You can control this behavior for a specific
23101 function by using the function attribute "sseregparm".
23102
23103 Warning: if you use this switch then you must build all modules
23104 with the same value, including any libraries. This includes the
23105 system libraries and startup modules.
23106
23107 -mvect8-ret-in-mem
23108 Return 8-byte vectors in memory instead of MMX registers. This is
23109 the default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of
23110 the Sun Studio compilers until version 12. Later compiler versions
23111 (starting with Studio 12 Update@tie{}1) follow the ABI used by
23112 other x86 targets, which is the default on Solaris@tie{}10 and
23113 later. Only use this option if you need to remain compatible with
23114 existing code produced by those previous compiler versions or older
23115 versions of GCC.
23116
23117 -mpc32
23118 -mpc64
23119 -mpc80
23120 Set 80387 floating-point precision to 32, 64 or 80 bits. When
23121 -mpc32 is specified, the significands of results of floating-point
23122 operations are rounded to 24 bits (single precision); -mpc64 rounds
23123 the significands of results of floating-point operations to 53 bits
23124 (double precision) and -mpc80 rounds the significands of results of
23125 floating-point operations to 64 bits (extended double precision),
23126 which is the default. When this option is used, floating-point
23127 operations in higher precisions are not available to the programmer
23128 without setting the FPU control word explicitly.
23129
23130 Setting the rounding of floating-point operations to less than the
23131 default 80 bits can speed some programs by 2% or more. Note that
23132 some mathematical libraries assume that extended-precision (80-bit)
23133 floating-point operations are enabled by default; routines in such
23134 libraries could suffer significant loss of accuracy, typically
23135 through so-called "catastrophic cancellation", when this option is
23136 used to set the precision to less than extended precision.
23137
23138 -mstackrealign
23139 Realign the stack at entry. On the x86, the -mstackrealign option
23140 generates an alternate prologue and epilogue that realigns the run-
23141 time stack if necessary. This supports mixing legacy codes that
23142 keep 4-byte stack alignment with modern codes that keep 16-byte
23143 stack alignment for SSE compatibility. See also the attribute
23144 "force_align_arg_pointer", applicable to individual functions.
23145
23146 -mpreferred-stack-boundary=num
23147 Attempt to keep the stack boundary aligned to a 2 raised to num
23148 byte boundary. If -mpreferred-stack-boundary is not specified, the
23149 default is 4 (16 bytes or 128 bits).
23150
23151 Warning: When generating code for the x86-64 architecture with SSE
23152 extensions disabled, -mpreferred-stack-boundary=3 can be used to
23153 keep the stack boundary aligned to 8 byte boundary. Since x86-64
23154 ABI require 16 byte stack alignment, this is ABI incompatible and
23155 intended to be used in controlled environment where stack space is
23156 important limitation. This option leads to wrong code when
23157 functions compiled with 16 byte stack alignment (such as functions
23158 from a standard library) are called with misaligned stack. In this
23159 case, SSE instructions may lead to misaligned memory access traps.
23160 In addition, variable arguments are handled incorrectly for 16 byte
23161 aligned objects (including x87 long double and __int128), leading
23162 to wrong results. You must build all modules with
23163 -mpreferred-stack-boundary=3, including any libraries. This
23164 includes the system libraries and startup modules.
23165
23166 -mincoming-stack-boundary=num
23167 Assume the incoming stack is aligned to a 2 raised to num byte
23168 boundary. If -mincoming-stack-boundary is not specified, the one
23169 specified by -mpreferred-stack-boundary is used.
23170
23171 On Pentium and Pentium Pro, "double" and "long double" values
23172 should be aligned to an 8-byte boundary (see -malign-double) or
23173 suffer significant run time performance penalties. On Pentium III,
23174 the Streaming SIMD Extension (SSE) data type "__m128" may not work
23175 properly if it is not 16-byte aligned.
23176
23177 To ensure proper alignment of this values on the stack, the stack
23178 boundary must be as aligned as that required by any value stored on
23179 the stack. Further, every function must be generated such that it
23180 keeps the stack aligned. Thus calling a function compiled with a
23181 higher preferred stack boundary from a function compiled with a
23182 lower preferred stack boundary most likely misaligns the stack. It
23183 is recommended that libraries that use callbacks always use the
23184 default setting.
23185
23186 This extra alignment does consume extra stack space, and generally
23187 increases code size. Code that is sensitive to stack space usage,
23188 such as embedded systems and operating system kernels, may want to
23189 reduce the preferred alignment to -mpreferred-stack-boundary=2.
23190
23191 -mmmx
23192 -msse
23193 -msse2
23194 -msse3
23195 -mssse3
23196 -msse4
23197 -msse4a
23198 -msse4.1
23199 -msse4.2
23200 -mavx
23201 -mavx2
23202 -mavx512f
23203 -mavx512pf
23204 -mavx512er
23205 -mavx512cd
23206 -mavx512vl
23207 -mavx512bw
23208 -mavx512dq
23209 -mavx512ifma
23210 -mavx512vbmi
23211 -msha
23212 -maes
23213 -mpclmul
23214 -mclflushopt
23215 -mfsgsbase
23216 -mrdrnd
23217 -mf16c
23218 -mfma
23219 -mpconfig
23220 -mwbnoinvd
23221 -mfma4
23222 -mprefetchwt1
23223 -mxop
23224 -mlwp
23225 -m3dnow
23226 -m3dnowa
23227 -mpopcnt
23228 -mabm
23229 -mbmi
23230 -mbmi2
23231 -mlzcnt
23232 -mfxsr
23233 -mxsave
23234 -mxsaveopt
23235 -mxsavec
23236 -mxsaves
23237 -mrtm
23238 -mtbm
23239 -mmpx
23240 -mmwaitx
23241 -mclzero
23242 -mpku
23243 -mavx512vbmi2
23244 -mgfni
23245 -mvaes
23246 -mvpclmulqdq
23247 -mavx512bitalg
23248 -mmovdiri
23249 -mmovdir64b
23250 -mavx512vpopcntdq
23251 These switches enable the use of instructions in the MMX, SSE,
23252 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER,
23253 AVX512CD, SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A,
23254 FMA4, XOP, LWP, ABM, AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA,
23255 AVX512VBMI, BMI, BMI2, VAES, FXSR, XSAVE, XSAVEOPT, LZCNT, RTM,
23256 MPX, MWAITX, PKU, IBT, SHSTK, AVX512VBMI2, GFNI, VPCLMULQDQ,
23257 AVX512BITALG, MOVDIRI, MOVDIR64B, AVX512VPOPCNTDQ3DNow! or enhanced
23258 3DNow! extended instruction sets. Each has a corresponding -mno-
23259 option to disable use of these instructions.
23260
23261 These extensions are also available as built-in functions: see x86
23262 Built-in Functions, for details of the functions enabled and
23263 disabled by these switches.
23264
23265 To generate SSE/SSE2 instructions automatically from floating-point
23266 code (as opposed to 387 instructions), see -mfpmath=sse.
23267
23268 GCC depresses SSEx instructions when -mavx is used. Instead, it
23269 generates new AVX instructions or AVX equivalence for all SSEx
23270 instructions when needed.
23271
23272 These options enable GCC to use these extended instructions in
23273 generated code, even without -mfpmath=sse. Applications that
23274 perform run-time CPU detection must compile separate files for each
23275 supported architecture, using the appropriate flags. In
23276 particular, the file containing the CPU detection code should be
23277 compiled without these options.
23278
23279 -mdump-tune-features
23280 This option instructs GCC to dump the names of the x86 performance
23281 tuning features and default settings. The names can be used in
23282 -mtune-ctrl=feature-list.
23283
23284 -mtune-ctrl=feature-list
23285 This option is used to do fine grain control of x86 code generation
23286 features. feature-list is a comma separated list of feature names.
23287 See also -mdump-tune-features. When specified, the feature is
23288 turned on if it is not preceded with ^, otherwise, it is turned
23289 off. -mtune-ctrl=feature-list is intended to be used by GCC
23290 developers. Using it may lead to code paths not covered by testing
23291 and can potentially result in compiler ICEs or runtime errors.
23292
23293 -mno-default
23294 This option instructs GCC to turn off all tunable features. See
23295 also -mtune-ctrl=feature-list and -mdump-tune-features.
23296
23297 -mcld
23298 This option instructs GCC to emit a "cld" instruction in the
23299 prologue of functions that use string instructions. String
23300 instructions depend on the DF flag to select between autoincrement
23301 or autodecrement mode. While the ABI specifies the DF flag to be
23302 cleared on function entry, some operating systems violate this
23303 specification by not clearing the DF flag in their exception
23304 dispatchers. The exception handler can be invoked with the DF flag
23305 set, which leads to wrong direction mode when string instructions
23306 are used. This option can be enabled by default on 32-bit x86
23307 targets by configuring GCC with the --enable-cld configure option.
23308 Generation of "cld" instructions can be suppressed with the
23309 -mno-cld compiler option in this case.
23310
23311 -mvzeroupper
23312 This option instructs GCC to emit a "vzeroupper" instruction before
23313 a transfer of control flow out of the function to minimize the AVX
23314 to SSE transition penalty as well as remove unnecessary "zeroupper"
23315 intrinsics.
23316
23317 -mprefer-avx128
23318 This option instructs GCC to use 128-bit AVX instructions instead
23319 of 256-bit AVX instructions in the auto-vectorizer.
23320
23321 -mprefer-vector-width=opt
23322 This option instructs GCC to use opt-bit vector width in
23323 instructions instead of default on the selected platform.
23324
23325 none
23326 No extra limitations applied to GCC other than defined by the
23327 selected platform.
23328
23329 128 Prefer 128-bit vector width for instructions.
23330
23331 256 Prefer 256-bit vector width for instructions.
23332
23333 512 Prefer 512-bit vector width for instructions.
23334
23335 -mcx16
23336 This option enables GCC to generate "CMPXCHG16B" instructions in
23337 64-bit code to implement compare-and-exchange operations on 16-byte
23338 aligned 128-bit objects. This is useful for atomic updates of data
23339 structures exceeding one machine word in size. The compiler uses
23340 this instruction to implement __sync Builtins. However, for
23341 __atomic Builtins operating on 128-bit integers, a library call is
23342 always used.
23343
23344 -msahf
23345 This option enables generation of "SAHF" instructions in 64-bit
23346 code. Early Intel Pentium 4 CPUs with Intel 64 support, prior to
23347 the introduction of Pentium 4 G1 step in December 2005, lacked the
23348 "LAHF" and "SAHF" instructions which are supported by AMD64. These
23349 are load and store instructions, respectively, for certain status
23350 flags. In 64-bit mode, the "SAHF" instruction is used to optimize
23351 "fmod", "drem", and "remainder" built-in functions; see Other
23352 Builtins for details.
23353
23354 -mmovbe
23355 This option enables use of the "movbe" instruction to implement
23356 "__builtin_bswap32" and "__builtin_bswap64".
23357
23358 -mshstk
23359 The -mshstk option enables shadow stack built-in functions from x86
23360 Control-flow Enforcement Technology (CET).
23361
23362 -mcrc32
23363 This option enables built-in functions "__builtin_ia32_crc32qi",
23364 "__builtin_ia32_crc32hi", "__builtin_ia32_crc32si" and
23365 "__builtin_ia32_crc32di" to generate the "crc32" machine
23366 instruction.
23367
23368 -mrecip
23369 This option enables use of "RCPSS" and "RSQRTSS" instructions (and
23370 their vectorized variants "RCPPS" and "RSQRTPS") with an additional
23371 Newton-Raphson step to increase precision instead of "DIVSS" and
23372 "SQRTSS" (and their vectorized variants) for single-precision
23373 floating-point arguments. These instructions are generated only
23374 when -funsafe-math-optimizations is enabled together with
23375 -ffinite-math-only and -fno-trapping-math. Note that while the
23376 throughput of the sequence is higher than the throughput of the
23377 non-reciprocal instruction, the precision of the sequence can be
23378 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals
23379 0.99999994).
23380
23381 Note that GCC implements "1.0f/sqrtf(x)" in terms of "RSQRTSS" (or
23382 "RSQRTPS") already with -ffast-math (or the above option
23383 combination), and doesn't need -mrecip.
23384
23385 Also note that GCC emits the above sequence with additional Newton-
23386 Raphson step for vectorized single-float division and vectorized
23387 "sqrtf(x)" already with -ffast-math (or the above option
23388 combination), and doesn't need -mrecip.
23389
23390 -mrecip=opt
23391 This option controls which reciprocal estimate instructions may be
23392 used. opt is a comma-separated list of options, which may be
23393 preceded by a ! to invert the option:
23394
23395 all Enable all estimate instructions.
23396
23397 default
23398 Enable the default instructions, equivalent to -mrecip.
23399
23400 none
23401 Disable all estimate instructions, equivalent to -mno-recip.
23402
23403 div Enable the approximation for scalar division.
23404
23405 vec-div
23406 Enable the approximation for vectorized division.
23407
23408 sqrt
23409 Enable the approximation for scalar square root.
23410
23411 vec-sqrt
23412 Enable the approximation for vectorized square root.
23413
23414 So, for example, -mrecip=all,!sqrt enables all of the reciprocal
23415 approximations, except for square root.
23416
23417 -mveclibabi=type
23418 Specifies the ABI type to use for vectorizing intrinsics using an
23419 external library. Supported values for type are svml for the Intel
23420 short vector math library and acml for the AMD math core library.
23421 To use this option, both -ftree-vectorize and
23422 -funsafe-math-optimizations have to be enabled, and an SVML or ACML
23423 ABI-compatible library must be specified at link time.
23424
23425 GCC currently emits calls to "vmldExp2", "vmldLn2", "vmldLog102",
23426 "vmldLog102", "vmldPow2", "vmldTanh2", "vmldTan2", "vmldAtan2",
23427 "vmldAtanh2", "vmldCbrt2", "vmldSinh2", "vmldSin2", "vmldAsinh2",
23428 "vmldAsin2", "vmldCosh2", "vmldCos2", "vmldAcosh2", "vmldAcos2",
23429 "vmlsExp4", "vmlsLn4", "vmlsLog104", "vmlsLog104", "vmlsPow4",
23430 "vmlsTanh4", "vmlsTan4", "vmlsAtan4", "vmlsAtanh4", "vmlsCbrt4",
23431 "vmlsSinh4", "vmlsSin4", "vmlsAsinh4", "vmlsAsin4", "vmlsCosh4",
23432 "vmlsCos4", "vmlsAcosh4" and "vmlsAcos4" for corresponding function
23433 type when -mveclibabi=svml is used, and "__vrd2_sin", "__vrd2_cos",
23434 "__vrd2_exp", "__vrd2_log", "__vrd2_log2", "__vrd2_log10",
23435 "__vrs4_sinf", "__vrs4_cosf", "__vrs4_expf", "__vrs4_logf",
23436 "__vrs4_log2f", "__vrs4_log10f" and "__vrs4_powf" for the
23437 corresponding function type when -mveclibabi=acml is used.
23438
23439 -mabi=name
23440 Generate code for the specified calling convention. Permissible
23441 values are sysv for the ABI used on GNU/Linux and other systems,
23442 and ms for the Microsoft ABI. The default is to use the Microsoft
23443 ABI when targeting Microsoft Windows and the SysV ABI on all other
23444 systems. You can control this behavior for specific functions by
23445 using the function attributes "ms_abi" and "sysv_abi".
23446
23447 -mforce-indirect-call
23448 Force all calls to functions to be indirect. This is useful when
23449 using Intel Processor Trace where it generates more precise timing
23450 information for function calls.
23451
23452 -mcall-ms2sysv-xlogues
23453 Due to differences in 64-bit ABIs, any Microsoft ABI function that
23454 calls a System V ABI function must consider RSI, RDI and XMM6-15 as
23455 clobbered. By default, the code for saving and restoring these
23456 registers is emitted inline, resulting in fairly lengthy prologues
23457 and epilogues. Using -mcall-ms2sysv-xlogues emits prologues and
23458 epilogues that use stubs in the static portion of libgcc to perform
23459 these saves and restores, thus reducing function size at the cost
23460 of a few extra instructions.
23461
23462 -mtls-dialect=type
23463 Generate code to access thread-local storage using the gnu or gnu2
23464 conventions. gnu is the conservative default; gnu2 is more
23465 efficient, but it may add compile- and run-time requirements that
23466 cannot be satisfied on all systems.
23467
23468 -mpush-args
23469 -mno-push-args
23470 Use PUSH operations to store outgoing parameters. This method is
23471 shorter and usually equally fast as method using SUB/MOV operations
23472 and is enabled by default. In some cases disabling it may improve
23473 performance because of improved scheduling and reduced
23474 dependencies.
23475
23476 -maccumulate-outgoing-args
23477 If enabled, the maximum amount of space required for outgoing
23478 arguments is computed in the function prologue. This is faster on
23479 most modern CPUs because of reduced dependencies, improved
23480 scheduling and reduced stack usage when the preferred stack
23481 boundary is not equal to 2. The drawback is a notable increase in
23482 code size. This switch implies -mno-push-args.
23483
23484 -mthreads
23485 Support thread-safe exception handling on MinGW. Programs that
23486 rely on thread-safe exception handling must compile and link all
23487 code with the -mthreads option. When compiling, -mthreads defines
23488 -D_MT; when linking, it links in a special thread helper library
23489 -lmingwthrd which cleans up per-thread exception-handling data.
23490
23491 -mms-bitfields
23492 -mno-ms-bitfields
23493 Enable/disable bit-field layout compatible with the native
23494 Microsoft Windows compiler.
23495
23496 If "packed" is used on a structure, or if bit-fields are used, it
23497 may be that the Microsoft ABI lays out the structure differently
23498 than the way GCC normally does. Particularly when moving packed
23499 data between functions compiled with GCC and the native Microsoft
23500 compiler (either via function call or as data in a file), it may be
23501 necessary to access either format.
23502
23503 This option is enabled by default for Microsoft Windows targets.
23504 This behavior can also be controlled locally by use of variable or
23505 type attributes. For more information, see x86 Variable Attributes
23506 and x86 Type Attributes.
23507
23508 The Microsoft structure layout algorithm is fairly simple with the
23509 exception of the bit-field packing. The padding and alignment of
23510 members of structures and whether a bit-field can straddle a
23511 storage-unit boundary are determine by these rules:
23512
23513 1. Structure members are stored sequentially in the order in which
23514 they are
23515 declared: the first member has the lowest memory address and
23516 the last member the highest.
23517
23518 2. Every data object has an alignment requirement. The alignment
23519 requirement
23520 for all data except structures, unions, and arrays is either
23521 the size of the object or the current packing size (specified
23522 with either the "aligned" attribute or the "pack" pragma),
23523 whichever is less. For structures, unions, and arrays, the
23524 alignment requirement is the largest alignment requirement of
23525 its members. Every object is allocated an offset so that:
23526
23527 offset % alignment_requirement == 0
23528
23529 3. Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte
23530 allocation
23531 unit if the integral types are the same size and if the next
23532 bit-field fits into the current allocation unit without
23533 crossing the boundary imposed by the common alignment
23534 requirements of the bit-fields.
23535
23536 MSVC interprets zero-length bit-fields in the following ways:
23537
23538 1. If a zero-length bit-field is inserted between two bit-fields
23539 that
23540 are normally coalesced, the bit-fields are not coalesced.
23541
23542 For example:
23543
23544 struct
23545 {
23546 unsigned long bf_1 : 12;
23547 unsigned long : 0;
23548 unsigned long bf_2 : 12;
23549 } t1;
23550
23551 The size of "t1" is 8 bytes with the zero-length bit-field. If
23552 the zero-length bit-field were removed, "t1"'s size would be 4
23553 bytes.
23554
23555 2. If a zero-length bit-field is inserted after a bit-field, "foo",
23556 and the
23557 alignment of the zero-length bit-field is greater than the
23558 member that follows it, "bar", "bar" is aligned as the type of
23559 the zero-length bit-field.
23560
23561 For example:
23562
23563 struct
23564 {
23565 char foo : 4;
23566 short : 0;
23567 char bar;
23568 } t2;
23569
23570 struct
23571 {
23572 char foo : 4;
23573 short : 0;
23574 double bar;
23575 } t3;
23576
23577 For "t2", "bar" is placed at offset 2, rather than offset 1.
23578 Accordingly, the size of "t2" is 4. For "t3", the zero-length
23579 bit-field does not affect the alignment of "bar" or, as a
23580 result, the size of the structure.
23581
23582 Taking this into account, it is important to note the
23583 following:
23584
23585 1. If a zero-length bit-field follows a normal bit-field, the
23586 type of the
23587 zero-length bit-field may affect the alignment of the
23588 structure as whole. For example, "t2" has a size of 4
23589 bytes, since the zero-length bit-field follows a normal
23590 bit-field, and is of type short.
23591
23592 2. Even if a zero-length bit-field is not followed by a normal
23593 bit-field, it may
23594 still affect the alignment of the structure:
23595
23596 struct
23597 {
23598 char foo : 6;
23599 long : 0;
23600 } t4;
23601
23602 Here, "t4" takes up 4 bytes.
23603
23604 3. Zero-length bit-fields following non-bit-field members are
23605 ignored:
23606 struct
23607 {
23608 char foo;
23609 long : 0;
23610 char bar;
23611 } t5;
23612
23613 Here, "t5" takes up 2 bytes.
23614
23615 -mno-align-stringops
23616 Do not align the destination of inlined string operations. This
23617 switch reduces code size and improves performance in case the
23618 destination is already aligned, but GCC doesn't know about it.
23619
23620 -minline-all-stringops
23621 By default GCC inlines string operations only when the destination
23622 is known to be aligned to least a 4-byte boundary. This enables
23623 more inlining and increases code size, but may improve performance
23624 of code that depends on fast "memcpy", "strlen", and "memset" for
23625 short lengths.
23626
23627 -minline-stringops-dynamically
23628 For string operations of unknown size, use run-time checks with
23629 inline code for small blocks and a library call for large blocks.
23630
23631 -mstringop-strategy=alg
23632 Override the internal decision heuristic for the particular
23633 algorithm to use for inlining string operations. The allowed
23634 values for alg are:
23635
23636 rep_byte
23637 rep_4byte
23638 rep_8byte
23639 Expand using i386 "rep" prefix of the specified size.
23640
23641 byte_loop
23642 loop
23643 unrolled_loop
23644 Expand into an inline loop.
23645
23646 libcall
23647 Always use a library call.
23648
23649 -mmemcpy-strategy=strategy
23650 Override the internal decision heuristic to decide if
23651 "__builtin_memcpy" should be inlined and what inline algorithm to
23652 use when the expected size of the copy operation is known. strategy
23653 is a comma-separated list of alg:max_size:dest_align triplets. alg
23654 is specified in -mstringop-strategy, max_size specifies the max
23655 byte size with which inline algorithm alg is allowed. For the last
23656 triplet, the max_size must be "-1". The max_size of the triplets in
23657 the list must be specified in increasing order. The minimal byte
23658 size for alg is 0 for the first triplet and "max_size + 1" of the
23659 preceding range.
23660
23661 -mmemset-strategy=strategy
23662 The option is similar to -mmemcpy-strategy= except that it is to
23663 control "__builtin_memset" expansion.
23664
23665 -momit-leaf-frame-pointer
23666 Don't keep the frame pointer in a register for leaf functions.
23667 This avoids the instructions to save, set up, and restore frame
23668 pointers and makes an extra register available in leaf functions.
23669 The option -fomit-leaf-frame-pointer removes the frame pointer for
23670 leaf functions, which might make debugging harder.
23671
23672 -mtls-direct-seg-refs
23673 -mno-tls-direct-seg-refs
23674 Controls whether TLS variables may be accessed with offsets from
23675 the TLS segment register (%gs for 32-bit, %fs for 64-bit), or
23676 whether the thread base pointer must be added. Whether or not this
23677 is valid depends on the operating system, and whether it maps the
23678 segment to cover the entire TLS area.
23679
23680 For systems that use the GNU C Library, the default is on.
23681
23682 -msse2avx
23683 -mno-sse2avx
23684 Specify that the assembler should encode SSE instructions with VEX
23685 prefix. The option -mavx turns this on by default.
23686
23687 -mfentry
23688 -mno-fentry
23689 If profiling is active (-pg), put the profiling counter call before
23690 the prologue. Note: On x86 architectures the attribute
23691 "ms_hook_prologue" isn't possible at the moment for -mfentry and
23692 -pg.
23693
23694 -mrecord-mcount
23695 -mno-record-mcount
23696 If profiling is active (-pg), generate a __mcount_loc section that
23697 contains pointers to each profiling call. This is useful for
23698 automatically patching and out calls.
23699
23700 -mnop-mcount
23701 -mno-nop-mcount
23702 If profiling is active (-pg), generate the calls to the profiling
23703 functions as NOPs. This is useful when they should be patched in
23704 later dynamically. This is likely only useful together with
23705 -mrecord-mcount.
23706
23707 -mskip-rax-setup
23708 -mno-skip-rax-setup
23709 When generating code for the x86-64 architecture with SSE
23710 extensions disabled, -mskip-rax-setup can be used to skip setting
23711 up RAX register when there are no variable arguments passed in
23712 vector registers.
23713
23714 Warning: Since RAX register is used to avoid unnecessarily saving
23715 vector registers on stack when passing variable arguments, the
23716 impacts of this option are callees may waste some stack space,
23717 misbehave or jump to a random location. GCC 4.4 or newer don't
23718 have those issues, regardless the RAX register value.
23719
23720 -m8bit-idiv
23721 -mno-8bit-idiv
23722 On some processors, like Intel Atom, 8-bit unsigned integer divide
23723 is much faster than 32-bit/64-bit integer divide. This option
23724 generates a run-time check. If both dividend and divisor are
23725 within range of 0 to 255, 8-bit unsigned integer divide is used
23726 instead of 32-bit/64-bit integer divide.
23727
23728 -mavx256-split-unaligned-load
23729 -mavx256-split-unaligned-store
23730 Split 32-byte AVX unaligned load and store.
23731
23732 -mstack-protector-guard=guard
23733 -mstack-protector-guard-reg=reg
23734 -mstack-protector-guard-offset=offset
23735 Generate stack protection code using canary at guard. Supported
23736 locations are global for global canary or tls for per-thread canary
23737 in the TLS block (the default). This option has effect only when
23738 -fstack-protector or -fstack-protector-all is specified.
23739
23740 With the latter choice the options -mstack-protector-guard-reg=reg
23741 and -mstack-protector-guard-offset=offset furthermore specify which
23742 segment register (%fs or %gs) to use as base register for reading
23743 the canary, and from what offset from that base register. The
23744 default for those is as specified in the relevant ABI.
23745
23746 -mmitigate-rop
23747 Try to avoid generating code sequences that contain unintended
23748 return opcodes, to mitigate against certain forms of attack. At the
23749 moment, this option is limited in what it can do and should not be
23750 relied on to provide serious protection.
23751
23752 -mgeneral-regs-only
23753 Generate code that uses only the general-purpose registers. This
23754 prevents the compiler from using floating-point, vector, mask and
23755 bound registers.
23756
23757 -mindirect-branch=choice
23758 Convert indirect call and jump with choice. The default is keep,
23759 which keeps indirect call and jump unmodified. thunk converts
23760 indirect call and jump to call and return thunk. thunk-inline
23761 converts indirect call and jump to inlined call and return thunk.
23762 thunk-extern converts indirect call and jump to external call and
23763 return thunk provided in a separate object file. You can control
23764 this behavior for a specific function by using the function
23765 attribute "indirect_branch".
23766
23767 Note that -mcmodel=large is incompatible with
23768 -mindirect-branch=thunk and -mindirect-branch=thunk-extern since
23769 the thunk function may not be reachable in the large code model.
23770
23771 Note that -mindirect-branch=thunk-extern is incompatible with
23772 -fcf-protection=branch and -fcheck-pointer-bounds since the
23773 external thunk can not be modified to disable control-flow check.
23774
23775 -mfunction-return=choice
23776 Convert function return with choice. The default is keep, which
23777 keeps function return unmodified. thunk converts function return
23778 to call and return thunk. thunk-inline converts function return to
23779 inlined call and return thunk. thunk-extern converts function
23780 return to external call and return thunk provided in a separate
23781 object file. You can control this behavior for a specific function
23782 by using the function attribute "function_return".
23783
23784 Note that -mcmodel=large is incompatible with
23785 -mfunction-return=thunk and -mfunction-return=thunk-extern since
23786 the thunk function may not be reachable in the large code model.
23787
23788 -mindirect-branch-register
23789 Force indirect call and jump via register.
23790
23791 These -m switches are supported in addition to the above on x86-64
23792 processors in 64-bit environments.
23793
23794 -m32
23795 -m64
23796 -mx32
23797 -m16
23798 -miamcu
23799 Generate code for a 16-bit, 32-bit or 64-bit environment. The -m32
23800 option sets "int", "long", and pointer types to 32 bits, and
23801 generates code that runs on any i386 system.
23802
23803 The -m64 option sets "int" to 32 bits and "long" and pointer types
23804 to 64 bits, and generates code for the x86-64 architecture. For
23805 Darwin only the -m64 option also turns off the -fno-pic and
23806 -mdynamic-no-pic options.
23807
23808 The -mx32 option sets "int", "long", and pointer types to 32 bits,
23809 and generates code for the x86-64 architecture.
23810
23811 The -m16 option is the same as -m32, except for that it outputs the
23812 ".code16gcc" assembly directive at the beginning of the assembly
23813 output so that the binary can run in 16-bit mode.
23814
23815 The -miamcu option generates code which conforms to Intel MCU
23816 psABI. It requires the -m32 option to be turned on.
23817
23818 -mno-red-zone
23819 Do not use a so-called "red zone" for x86-64 code. The red zone is
23820 mandated by the x86-64 ABI; it is a 128-byte area beyond the
23821 location of the stack pointer that is not modified by signal or
23822 interrupt handlers and therefore can be used for temporary data
23823 without adjusting the stack pointer. The flag -mno-red-zone
23824 disables this red zone.
23825
23826 -mcmodel=small
23827 Generate code for the small code model: the program and its symbols
23828 must be linked in the lower 2 GB of the address space. Pointers
23829 are 64 bits. Programs can be statically or dynamically linked.
23830 This is the default code model.
23831
23832 -mcmodel=kernel
23833 Generate code for the kernel code model. The kernel runs in the
23834 negative 2 GB of the address space. This model has to be used for
23835 Linux kernel code.
23836
23837 -mcmodel=medium
23838 Generate code for the medium model: the program is linked in the
23839 lower 2 GB of the address space. Small symbols are also placed
23840 there. Symbols with sizes larger than -mlarge-data-threshold are
23841 put into large data or BSS sections and can be located above 2GB.
23842 Programs can be statically or dynamically linked.
23843
23844 -mcmodel=large
23845 Generate code for the large model. This model makes no assumptions
23846 about addresses and sizes of sections.
23847
23848 -maddress-mode=long
23849 Generate code for long address mode. This is only supported for
23850 64-bit and x32 environments. It is the default address mode for
23851 64-bit environments.
23852
23853 -maddress-mode=short
23854 Generate code for short address mode. This is only supported for
23855 32-bit and x32 environments. It is the default address mode for
23856 32-bit and x32 environments.
23857
23858 x86 Windows Options
23859
23860 These additional options are available for Microsoft Windows targets:
23861
23862 -mconsole
23863 This option specifies that a console application is to be
23864 generated, by instructing the linker to set the PE header subsystem
23865 type required for console applications. This option is available
23866 for Cygwin and MinGW targets and is enabled by default on those
23867 targets.
23868
23869 -mdll
23870 This option is available for Cygwin and MinGW targets. It
23871 specifies that a DLL---a dynamic link library---is to be generated,
23872 enabling the selection of the required runtime startup object and
23873 entry point.
23874
23875 -mnop-fun-dllimport
23876 This option is available for Cygwin and MinGW targets. It
23877 specifies that the "dllimport" attribute should be ignored.
23878
23879 -mthread
23880 This option is available for MinGW targets. It specifies that
23881 MinGW-specific thread support is to be used.
23882
23883 -municode
23884 This option is available for MinGW-w64 targets. It causes the
23885 "UNICODE" preprocessor macro to be predefined, and chooses Unicode-
23886 capable runtime startup code.
23887
23888 -mwin32
23889 This option is available for Cygwin and MinGW targets. It
23890 specifies that the typical Microsoft Windows predefined macros are
23891 to be set in the pre-processor, but does not influence the choice
23892 of runtime library/startup code.
23893
23894 -mwindows
23895 This option is available for Cygwin and MinGW targets. It
23896 specifies that a GUI application is to be generated by instructing
23897 the linker to set the PE header subsystem type appropriately.
23898
23899 -fno-set-stack-executable
23900 This option is available for MinGW targets. It specifies that the
23901 executable flag for the stack used by nested functions isn't set.
23902 This is necessary for binaries running in kernel mode of Microsoft
23903 Windows, as there the User32 API, which is used to set executable
23904 privileges, isn't available.
23905
23906 -fwritable-relocated-rdata
23907 This option is available for MinGW and Cygwin targets. It
23908 specifies that relocated-data in read-only section is put into the
23909 ".data" section. This is a necessary for older runtimes not
23910 supporting modification of ".rdata" sections for pseudo-relocation.
23911
23912 -mpe-aligned-commons
23913 This option is available for Cygwin and MinGW targets. It
23914 specifies that the GNU extension to the PE file format that permits
23915 the correct alignment of COMMON variables should be used when
23916 generating code. It is enabled by default if GCC detects that the
23917 target assembler found during configuration supports the feature.
23918
23919 See also under x86 Options for standard options.
23920
23921 Xstormy16 Options
23922
23923 These options are defined for Xstormy16:
23924
23925 -msim
23926 Choose startup files and linker script suitable for the simulator.
23927
23928 Xtensa Options
23929
23930 These options are supported for Xtensa targets:
23931
23932 -mconst16
23933 -mno-const16
23934 Enable or disable use of "CONST16" instructions for loading
23935 constant values. The "CONST16" instruction is currently not a
23936 standard option from Tensilica. When enabled, "CONST16"
23937 instructions are always used in place of the standard "L32R"
23938 instructions. The use of "CONST16" is enabled by default only if
23939 the "L32R" instruction is not available.
23940
23941 -mfused-madd
23942 -mno-fused-madd
23943 Enable or disable use of fused multiply/add and multiply/subtract
23944 instructions in the floating-point option. This has no effect if
23945 the floating-point option is not also enabled. Disabling fused
23946 multiply/add and multiply/subtract instructions forces the compiler
23947 to use separate instructions for the multiply and add/subtract
23948 operations. This may be desirable in some cases where strict IEEE
23949 754-compliant results are required: the fused multiply add/subtract
23950 instructions do not round the intermediate result, thereby
23951 producing results with more bits of precision than specified by the
23952 IEEE standard. Disabling fused multiply add/subtract instructions
23953 also ensures that the program output is not sensitive to the
23954 compiler's ability to combine multiply and add/subtract operations.
23955
23956 -mserialize-volatile
23957 -mno-serialize-volatile
23958 When this option is enabled, GCC inserts "MEMW" instructions before
23959 "volatile" memory references to guarantee sequential consistency.
23960 The default is -mserialize-volatile. Use -mno-serialize-volatile
23961 to omit the "MEMW" instructions.
23962
23963 -mforce-no-pic
23964 For targets, like GNU/Linux, where all user-mode Xtensa code must
23965 be position-independent code (PIC), this option disables PIC for
23966 compiling kernel code.
23967
23968 -mtext-section-literals
23969 -mno-text-section-literals
23970 These options control the treatment of literal pools. The default
23971 is -mno-text-section-literals, which places literals in a separate
23972 section in the output file. This allows the literal pool to be
23973 placed in a data RAM/ROM, and it also allows the linker to combine
23974 literal pools from separate object files to remove redundant
23975 literals and improve code size. With -mtext-section-literals, the
23976 literals are interspersed in the text section in order to keep them
23977 as close as possible to their references. This may be necessary
23978 for large assembly files. Literals for each function are placed
23979 right before that function.
23980
23981 -mauto-litpools
23982 -mno-auto-litpools
23983 These options control the treatment of literal pools. The default
23984 is -mno-auto-litpools, which places literals in a separate section
23985 in the output file unless -mtext-section-literals is used. With
23986 -mauto-litpools the literals are interspersed in the text section
23987 by the assembler. Compiler does not produce explicit ".literal"
23988 directives and loads literals into registers with "MOVI"
23989 instructions instead of "L32R" to let the assembler do relaxation
23990 and place literals as necessary. This option allows assembler to
23991 create several literal pools per function and assemble very big
23992 functions, which may not be possible with -mtext-section-literals.
23993
23994 -mtarget-align
23995 -mno-target-align
23996 When this option is enabled, GCC instructs the assembler to
23997 automatically align instructions to reduce branch penalties at the
23998 expense of some code density. The assembler attempts to widen
23999 density instructions to align branch targets and the instructions
24000 following call instructions. If there are not enough preceding
24001 safe density instructions to align a target, no widening is
24002 performed. The default is -mtarget-align. These options do not
24003 affect the treatment of auto-aligned instructions like "LOOP",
24004 which the assembler always aligns, either by widening density
24005 instructions or by inserting NOP instructions.
24006
24007 -mlongcalls
24008 -mno-longcalls
24009 When this option is enabled, GCC instructs the assembler to
24010 translate direct calls to indirect calls unless it can determine
24011 that the target of a direct call is in the range allowed by the
24012 call instruction. This translation typically occurs for calls to
24013 functions in other source files. Specifically, the assembler
24014 translates a direct "CALL" instruction into an "L32R" followed by a
24015 "CALLX" instruction. The default is -mno-longcalls. This option
24016 should be used in programs where the call target can potentially be
24017 out of range. This option is implemented in the assembler, not the
24018 compiler, so the assembly code generated by GCC still shows direct
24019 call instructions---look at the disassembled object code to see the
24020 actual instructions. Note that the assembler uses an indirect call
24021 for every cross-file call, not just those that really are out of
24022 range.
24023
24024 zSeries Options
24025
24026 These are listed under
24027
24029 This section describes several environment variables that affect how
24030 GCC operates. Some of them work by specifying directories or prefixes
24031 to use when searching for various kinds of files. Some are used to
24032 specify other aspects of the compilation environment.
24033
24034 Note that you can also specify places to search using options such as
24035 -B, -I and -L. These take precedence over places specified using
24036 environment variables, which in turn take precedence over those
24037 specified by the configuration of GCC.
24038
24039 LANG
24040 LC_CTYPE
24041 LC_MESSAGES
24042 LC_ALL
24043 These environment variables control the way that GCC uses
24044 localization information which allows GCC to work with different
24045 national conventions. GCC inspects the locale categories LC_CTYPE
24046 and LC_MESSAGES if it has been configured to do so. These locale
24047 categories can be set to any value supported by your installation.
24048 A typical value is en_GB.UTF-8 for English in the United Kingdom
24049 encoded in UTF-8.
24050
24051 The LC_CTYPE environment variable specifies character
24052 classification. GCC uses it to determine the character boundaries
24053 in a string; this is needed for some multibyte encodings that
24054 contain quote and escape characters that are otherwise interpreted
24055 as a string end or escape.
24056
24057 The LC_MESSAGES environment variable specifies the language to use
24058 in diagnostic messages.
24059
24060 If the LC_ALL environment variable is set, it overrides the value
24061 of LC_CTYPE and LC_MESSAGES; otherwise, LC_CTYPE and LC_MESSAGES
24062 default to the value of the LANG environment variable. If none of
24063 these variables are set, GCC defaults to traditional C English
24064 behavior.
24065
24066 TMPDIR
24067 If TMPDIR is set, it specifies the directory to use for temporary
24068 files. GCC uses temporary files to hold the output of one stage of
24069 compilation which is to be used as input to the next stage: for
24070 example, the output of the preprocessor, which is the input to the
24071 compiler proper.
24072
24073 GCC_COMPARE_DEBUG
24074 Setting GCC_COMPARE_DEBUG is nearly equivalent to passing
24075 -fcompare-debug to the compiler driver. See the documentation of
24076 this option for more details.
24077
24078 GCC_EXEC_PREFIX
24079 If GCC_EXEC_PREFIX is set, it specifies a prefix to use in the
24080 names of the subprograms executed by the compiler. No slash is
24081 added when this prefix is combined with the name of a subprogram,
24082 but you can specify a prefix that ends with a slash if you wish.
24083
24084 If GCC_EXEC_PREFIX is not set, GCC attempts to figure out an
24085 appropriate prefix to use based on the pathname it is invoked with.
24086
24087 If GCC cannot find the subprogram using the specified prefix, it
24088 tries looking in the usual places for the subprogram.
24089
24090 The default value of GCC_EXEC_PREFIX is prefix/lib/gcc/ where
24091 prefix is the prefix to the installed compiler. In many cases
24092 prefix is the value of "prefix" when you ran the configure script.
24093
24094 Other prefixes specified with -B take precedence over this prefix.
24095
24096 This prefix is also used for finding files such as crt0.o that are
24097 used for linking.
24098
24099 In addition, the prefix is used in an unusual way in finding the
24100 directories to search for header files. For each of the standard
24101 directories whose name normally begins with /usr/local/lib/gcc
24102 (more precisely, with the value of GCC_INCLUDE_DIR), GCC tries
24103 replacing that beginning with the specified prefix to produce an
24104 alternate directory name. Thus, with -Bfoo/, GCC searches foo/bar
24105 just before it searches the standard directory /usr/local/lib/bar.
24106 If a standard directory begins with the configured prefix then the
24107 value of prefix is replaced by GCC_EXEC_PREFIX when looking for
24108 header files.
24109
24110 COMPILER_PATH
24111 The value of COMPILER_PATH is a colon-separated list of
24112 directories, much like PATH. GCC tries the directories thus
24113 specified when searching for subprograms, if it cannot find the
24114 subprograms using GCC_EXEC_PREFIX.
24115
24116 LIBRARY_PATH
24117 The value of LIBRARY_PATH is a colon-separated list of directories,
24118 much like PATH. When configured as a native compiler, GCC tries
24119 the directories thus specified when searching for special linker
24120 files, if it cannot find them using GCC_EXEC_PREFIX. Linking using
24121 GCC also uses these directories when searching for ordinary
24122 libraries for the -l option (but directories specified with -L come
24123 first).
24124
24125 LANG
24126 This variable is used to pass locale information to the compiler.
24127 One way in which this information is used is to determine the
24128 character set to be used when character literals, string literals
24129 and comments are parsed in C and C++. When the compiler is
24130 configured to allow multibyte characters, the following values for
24131 LANG are recognized:
24132
24133 C-JIS
24134 Recognize JIS characters.
24135
24136 C-SJIS
24137 Recognize SJIS characters.
24138
24139 C-EUCJP
24140 Recognize EUCJP characters.
24141
24142 If LANG is not defined, or if it has some other value, then the
24143 compiler uses "mblen" and "mbtowc" as defined by the default locale
24144 to recognize and translate multibyte characters.
24145
24146 Some additional environment variables affect the behavior of the
24147 preprocessor.
24148
24149 CPATH
24150 C_INCLUDE_PATH
24151 CPLUS_INCLUDE_PATH
24152 OBJC_INCLUDE_PATH
24153 Each variable's value is a list of directories separated by a
24154 special character, much like PATH, in which to look for header
24155 files. The special character, "PATH_SEPARATOR", is target-
24156 dependent and determined at GCC build time. For Microsoft Windows-
24157 based targets it is a semicolon, and for almost all other targets
24158 it is a colon.
24159
24160 CPATH specifies a list of directories to be searched as if
24161 specified with -I, but after any paths given with -I options on the
24162 command line. This environment variable is used regardless of
24163 which language is being preprocessed.
24164
24165 The remaining environment variables apply only when preprocessing
24166 the particular language indicated. Each specifies a list of
24167 directories to be searched as if specified with -isystem, but after
24168 any paths given with -isystem options on the command line.
24169
24170 In all these variables, an empty element instructs the compiler to
24171 search its current working directory. Empty elements can appear at
24172 the beginning or end of a path. For instance, if the value of
24173 CPATH is ":/special/include", that has the same effect as
24174 -I. -I/special/include.
24175
24176 DEPENDENCIES_OUTPUT
24177 If this variable is set, its value specifies how to output
24178 dependencies for Make based on the non-system header files
24179 processed by the compiler. System header files are ignored in the
24180 dependency output.
24181
24182 The value of DEPENDENCIES_OUTPUT can be just a file name, in which
24183 case the Make rules are written to that file, guessing the target
24184 name from the source file name. Or the value can have the form
24185 file target, in which case the rules are written to file file using
24186 target as the target name.
24187
24188 In other words, this environment variable is equivalent to
24189 combining the options -MM and -MF, with an optional -MT switch too.
24190
24191 SUNPRO_DEPENDENCIES
24192 This variable is the same as DEPENDENCIES_OUTPUT (see above),
24193 except that system header files are not ignored, so it implies -M
24194 rather than -MM. However, the dependence on the main input file is
24195 omitted.
24196
24197 SOURCE_DATE_EPOCH
24198 If this variable is set, its value specifies a UNIX timestamp to be
24199 used in replacement of the current date and time in the "__DATE__"
24200 and "__TIME__" macros, so that the embedded timestamps become
24201 reproducible.
24202
24203 The value of SOURCE_DATE_EPOCH must be a UNIX timestamp, defined as
24204 the number of seconds (excluding leap seconds) since 01 Jan 1970
24205 00:00:00 represented in ASCII; identical to the output of
24206 @command{date +%s} on GNU/Linux and other systems that support the
24207 %s extension in the "date" command.
24208
24209 The value should be a known timestamp such as the last modification
24210 time of the source or package and it should be set by the build
24211 process.
24212
24214 For instructions on reporting bugs, see
24215 <http://bugzilla.redhat.com/bugzilla/>.
24216
24218 1. On some systems, gcc -shared needs to build supplementary stub code
24219 for constructors to work. On multi-libbed systems, gcc -shared
24220 must select the correct support libraries to link against. Failing
24221 to supply the correct flags may lead to subtle defects. Supplying
24222 them in cases where they are not necessary is innocuous.
24223
24225 gpl(7), gfdl(7), fsf-funding(7), cpp(1), gcov(1), as(1), ld(1), gdb(1),
24226 dbx(1) and the Info entries for gcc, cpp, as, ld, binutils and gdb.
24227
24229 See the Info entry for gcc, or
24230 <http://gcc.gnu.org/onlinedocs/gcc/Contributors.html>, for contributors
24231 to GCC.
24232
24234 Copyright (c) 1988-2018 Free Software Foundation, Inc.
24235
24236 Permission is granted to copy, distribute and/or modify this document
24237 under the terms of the GNU Free Documentation License, Version 1.3 or
24238 any later version published by the Free Software Foundation; with the
24239 Invariant Sections being "GNU General Public License" and "Funding Free
24240 Software", the Front-Cover texts being (a) (see below), and with the
24241 Back-Cover Texts being (b) (see below). A copy of the license is
24242 included in the gfdl(7) man page.
24243
24244 (a) The FSF's Front-Cover Text is:
24245
24246 A GNU Manual
24247
24248 (b) The FSF's Back-Cover Text is:
24249
24250 You have freedom to copy and modify this GNU Manual, like GNU
24251 software. Copies published by the Free Software Foundation raise
24252 funds for GNU development.
24253
24254
24255
24256gcc-8 2018-06-26 GCC(1)