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 -fplugin=file -fplugin-arg-name=arg
68 -fdump-ada-spec[-slim] -fada-spec-parent=unit -fdump-go-spec=file
69
70 C Language Options
71 -ansi -std=standard -fgnu89-inline
72 -fpermitted-flt-eval-methods=standard -aux-info filename
73 -fallow-parameterless-variadic-functions -fno-asm -fno-builtin
74 -fno-builtin-function -fgimple -fhosted -ffreestanding -fopenacc
75 -fopenmp -fopenmp-simd -fms-extensions -fplan9-extensions
76 -fsso-struct=endianness -fallow-single-precision -fcond-mismatch
77 -flax-vector-conversions -fsigned-bitfields -fsigned-char
78 -funsigned-bitfields -funsigned-char
79
80 C++ Language Options
81 -fabi-version=n -fno-access-control -faligned-new=n
82 -fargs-in-order=n -fcheck-new -fconstexpr-depth=n
83 -fconstexpr-loop-limit=n -ffriend-injection -fno-elide-constructors
84 -fno-enforce-eh-specs -ffor-scope -fno-for-scope
85 -fno-gnu-keywords -fno-implicit-templates
86 -fno-implicit-inline-templates -fno-implement-inlines
87 -fms-extensions -fnew-inheriting-ctors -fnew-ttp-matching
88 -fno-nonansi-builtins -fnothrow-opt -fno-operator-names
89 -fno-optional-diags -fpermissive -fno-pretty-templates -frepo
90 -fno-rtti -fsized-deallocation -ftemplate-backtrace-limit=n
91 -ftemplate-depth=n -fno-threadsafe-statics -fuse-cxa-atexit
92 -fno-weak -nostdinc++ -fvisibility-inlines-hidden
93 -fvisibility-ms-compat -fext-numeric-literals -Wabi=n -Wabi-tag
94 -Wconversion-null -Wctor-dtor-privacy -Wdelete-non-virtual-dtor
95 -Wliteral-suffix -Wmultiple-inheritance -Wnamespaces -Wnarrowing
96 -Wnoexcept -Wnoexcept-type -Wnon-virtual-dtor -Wreorder
97 -Wregister -Weffc++ -Wstrict-null-sentinel -Wtemplates
98 -Wno-non-template-friend -Wold-style-cast -Woverloaded-virtual
99 -Wno-pmf-conversions -Wsign-promo -Wvirtual-inheritance
100
101 Objective-C and Objective-C++ Language Options
102 -fconstant-string-class=class-name -fgnu-runtime -fnext-runtime
103 -fno-nil-receivers -fobjc-abi-version=n -fobjc-call-cxx-cdtors
104 -fobjc-direct-dispatch -fobjc-exceptions -fobjc-gc -fobjc-nilcheck
105 -fobjc-std=objc1 -fno-local-ivars
106 -fivar-visibility=[public|protected|private|package]
107 -freplace-objc-classes -fzero-link -gen-decls -Wassign-intercept
108 -Wno-protocol -Wselector -Wstrict-selector-match
109 -Wundeclared-selector
110
111 Diagnostic Message Formatting Options
112 -fmessage-length=n -fdiagnostics-show-location=[once|every-line]
113 -fdiagnostics-color=[auto|never|always]
114 -fno-diagnostics-show-option -fno-diagnostics-show-caret
115 -fdiagnostics-parseable-fixits -fdiagnostics-generate-patch
116 -fno-show-column
117
118 Warning Options
119 -fsyntax-only -fmax-errors=n -Wpedantic -pedantic-errors -w
120 -Wextra -Wall -Waddress -Waggregate-return -Waligned-new
121 -Walloc-zero -Walloc-size-larger-than=n -Walloca
122 -Walloca-larger-than=n -Wno-aggressive-loop-optimizations
123 -Warray-bounds -Warray-bounds=n -Wno-attributes -Wbool-compare
124 -Wbool-operation -Wno-builtin-declaration-mismatch
125 -Wno-builtin-macro-redefined -Wc90-c99-compat -Wc99-c11-compat
126 -Wc++-compat -Wc++11-compat -Wc++14-compat -Wcast-align
127 -Wcast-qual -Wchar-subscripts -Wchkp -Wclobbered -Wcomment
128 -Wconditionally-supported -Wconversion -Wcoverage-mismatch
129 -Wno-cpp -Wdangling-else -Wdate-time -Wdelete-incomplete
130 -Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init
131 -Wdisabled-optimization -Wno-discarded-qualifiers
132 -Wno-discarded-array-qualifiers -Wno-div-by-zero
133 -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond
134 -Wempty-body -Wenum-compare -Wno-endif-labels
135 -Wexpansion-to-defined -Werror -Werror=* -Wfatal-errors
136 -Wfloat-equal -Wformat -Wformat=2 -Wno-format-contains-nul
137 -Wno-format-extra-args -Wformat-nonliteral -Wformat-overflow=n
138 -Wformat-security -Wformat-signedness -Wformat-truncation=n
139 -Wformat-y2k -Wframe-address -Wframe-larger-than=len
140 -Wno-free-nonheap-object -Wjump-misses-init -Wignored-qualifiers
141 -Wignored-attributes -Wincompatible-pointer-types -Wimplicit
142 -Wimplicit-fallthrough -Wimplicit-fallthrough=n
143 -Wimplicit-function-declaration -Wimplicit-int -Winit-self
144 -Winline -Wno-int-conversion -Wint-in-bool-context
145 -Wno-int-to-pointer-cast -Winvalid-memory-model
146 -Wno-invalid-offsetof -Winvalid-pch -Wlarger-than=len -Wlogical-op
147 -Wlogical-not-parentheses -Wlong-long -Wmain
148 -Wmaybe-uninitialized -Wmemset-elt-size -Wmemset-transposed-args
149 -Wmisleading-indentation -Wmissing-braces
150 -Wmissing-field-initializers -Wmissing-include-dirs -Wno-multichar
151 -Wnonnull -Wnonnull-compare -Wnormalized=[none|id|nfc|nfkc]
152 -Wnull-dereference -Wodr -Wno-overflow -Wopenmp-simd
153 -Woverride-init-side-effects -Woverlength-strings -Wpacked
154 -Wpacked-bitfield-compat -Wpadded -Wparentheses
155 -Wno-pedantic-ms-format -Wplacement-new -Wplacement-new=n
156 -Wpointer-arith -Wpointer-compare -Wno-pointer-to-int-cast
157 -Wno-pragmas -Wredundant-decls -Wrestrict -Wno-return-local-addr
158 -Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar
159 -Wshadow=global, -Wshadow=local, -Wshadow=compatible-local
160 -Wshift-overflow -Wshift-overflow=n -Wshift-count-negative
161 -Wshift-count-overflow -Wshift-negative-value -Wsign-compare
162 -Wsign-conversion -Wfloat-conversion -Wno-scalar-storage-order
163 -Wsizeof-pointer-memaccess -Wsizeof-array-argument
164 -Wstack-protector -Wstack-usage=len -Wstrict-aliasing
165 -Wstrict-aliasing=n -Wstrict-overflow -Wstrict-overflow=n
166 -Wstringop-overflow=n
167 -Wsuggest-attribute=[pure|const|noreturn|format]
168 -Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override
169 -Wmissing-format-attribute -Wsubobject-linkage -Wswitch
170 -Wswitch-bool -Wswitch-default -Wswitch-enum -Wswitch-unreachable
171 -Wsync-nand -Wsystem-headers -Wtautological-compare -Wtrampolines
172 -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized
173 -Wunknown-pragmas -Wunsafe-loop-optimizations
174 -Wunsuffixed-float-constants -Wunused -Wunused-function
175 -Wunused-label -Wunused-local-typedefs -Wunused-macros
176 -Wunused-parameter -Wno-unused-result -Wunused-value
177 -Wunused-variable -Wunused-const-variable
178 -Wunused-const-variable=n -Wunused-but-set-parameter
179 -Wunused-but-set-variable -Wuseless-cast -Wvariadic-macros
180 -Wvector-operation-performance -Wvla -Wvla-larger-than=n
181 -Wvolatile-register-var -Wwrite-strings
182 -Wzero-as-null-pointer-constant -Whsa
183
184 C and Objective-C-only Warning Options
185 -Wbad-function-cast -Wmissing-declarations
186 -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs
187 -Wold-style-declaration -Wold-style-definition -Wstrict-prototypes
188 -Wtraditional -Wtraditional-conversion
189 -Wdeclaration-after-statement -Wpointer-sign
190
191 Debugging Options
192 -g -glevel -gcoff -gdwarf -gdwarf-version -ggdb
193 -grecord-gcc-switches -gno-record-gcc-switches -gstabs -gstabs+
194 -gstrict-dwarf -gno-strict-dwarf -gcolumn-info -gno-column-info
195 -gvms -gxcoff -gxcoff+ -gz[=type] -fdebug-prefix-map=old=new
196 -fdebug-types-section -feliminate-dwarf2-dups
197 -fno-eliminate-unused-debug-types -femit-struct-debug-baseonly
198 -femit-struct-debug-reduced -femit-struct-debug-detailed[=spec-
199 list] -feliminate-unused-debug-symbols -femit-class-debug-always
200 -fno-merge-debug-strings -fno-dwarf2-cfi-asm -fvar-tracking
201 -fvar-tracking-assignments
202
203 Optimization Options
204 -faggressive-loop-optimizations -falign-functions[=n]
205 -falign-jumps[=n] -falign-labels[=n] -falign-loops[=n]
206 -fassociative-math -fauto-profile -fauto-profile[=path]
207 -fauto-inc-dec -fbranch-probabilities
208 -fbranch-target-load-optimize -fbranch-target-load-optimize2
209 -fbtr-bb-exclusive -fcaller-saves -fcombine-stack-adjustments
210 -fconserve-stack -fcompare-elim -fcprop-registers -fcrossjumping
211 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules
212 -fcx-limited-range -fdata-sections -fdce -fdelayed-branch
213 -fdelete-null-pointer-checks -fdevirtualize
214 -fdevirtualize-speculatively -fdevirtualize-at-ltrans -fdse
215 -fearly-inlining -fipa-sra -fexpensive-optimizations
216 -ffat-lto-objects -ffast-math -ffinite-math-only -ffloat-store
217 -fexcess-precision=style -fforward-propagate -ffp-contract=style
218 -ffunction-sections -fgcse -fgcse-after-reload -fgcse-las
219 -fgcse-lm -fgraphite-identity -fgcse-sm -fhoist-adjacent-loads
220 -fif-conversion -fif-conversion2 -findirect-inlining
221 -finline-functions -finline-functions-called-once
222 -finline-limit=n -finline-small-functions -fipa-cp -fipa-cp-clone
223 -fipa-bit-cp -fipa-vrp -fipa-pta -fipa-profile -fipa-pure-const
224 -fipa-reference -fipa-icf -fira-algorithm=algorithm
225 -fira-region=region -fira-hoist-pressure -fira-loop-pressure
226 -fno-ira-share-save-slots -fno-ira-share-spill-slots
227 -fisolate-erroneous-paths-dereference
228 -fisolate-erroneous-paths-attribute -fivopts
229 -fkeep-inline-functions -fkeep-static-functions
230 -fkeep-static-consts -flimit-function-alignment
231 -flive-range-shrinkage -floop-block -floop-interchange
232 -floop-strip-mine -floop-unroll-and-jam -floop-nest-optimize
233 -floop-parallelize-all -flra-remat -flto -flto-compression-level
234 -flto-partition=alg -fmerge-all-constants -fmerge-constants
235 -fmodulo-sched -fmodulo-sched-allow-regmoves
236 -fmove-loop-invariants -fno-branch-count-reg -fno-defer-pop
237 -fno-fp-int-builtin-inexact -fno-function-cse
238 -fno-guess-branch-probability -fno-inline -fno-math-errno
239 -fno-peephole -fno-peephole2 -fno-printf-return-value
240 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros
241 -fno-toplevel-reorder -fno-trapping-math
242 -fno-zero-initialized-in-bss -fomit-frame-pointer
243 -foptimize-sibling-calls -fpartial-inlining -fpeel-loops
244 -fpredictive-commoning -fprefetch-loop-arrays -fprofile-correction
245 -fprofile-use -fprofile-use=path -fprofile-values
246 -fprofile-reorder-functions -freciprocal-math -free
247 -frename-registers -freorder-blocks
248 -freorder-blocks-algorithm=algorithm -freorder-blocks-and-partition
249 -freorder-functions -frerun-cse-after-loop
250 -freschedule-modulo-scheduled-loops -frounding-math
251 -fsched2-use-superblocks -fsched-pressure -fsched-spec-load
252 -fsched-spec-load-dangerous -fsched-stalled-insns-dep[=n]
253 -fsched-stalled-insns[=n] -fsched-group-heuristic
254 -fsched-critical-path-heuristic -fsched-spec-insn-heuristic
255 -fsched-rank-heuristic -fsched-last-insn-heuristic
256 -fsched-dep-count-heuristic -fschedule-fusion -fschedule-insns
257 -fschedule-insns2 -fsection-anchors -fselective-scheduling
258 -fselective-scheduling2 -fsel-sched-pipelining
259 -fsel-sched-pipelining-outer-loops -fsemantic-interposition
260 -fshrink-wrap -fshrink-wrap-separate -fsignaling-nans
261 -fsingle-precision-constant -fsplit-ivs-in-unroller -fsplit-loops
262 -fsplit-paths -fsplit-wide-types -fssa-backprop -fssa-phiopt
263 -fstdarg-opt -fstore-merging -fstrict-aliasing -fstrict-overflow
264 -fthread-jumps -ftracer -ftree-bit-ccp -ftree-builtin-call-dce
265 -ftree-ccp -ftree-ch -ftree-coalesce-vars -ftree-copy-prop
266 -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop
267 -ftree-fre -fcode-hoisting -ftree-loop-if-convert -ftree-loop-im
268 -ftree-phiprop -ftree-loop-distribution
269 -ftree-loop-distribute-patterns -ftree-loop-ivcanon
270 -ftree-loop-linear -ftree-loop-optimize -ftree-loop-vectorize
271 -ftree-parallelize-loops=n -ftree-pre -ftree-partial-pre
272 -ftree-pta -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra
273 -ftree-switch-conversion -ftree-tail-merge -ftree-ter
274 -ftree-vectorize -ftree-vrp -funconstrained-commons
275 -funit-at-a-time -funroll-all-loops -funroll-loops
276 -funsafe-math-optimizations -funswitch-loops -fipa-ra
277 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb
278 -fwhole-program -fwpa -fuse-linker-plugin --param name=value -O
279 -O0 -O1 -O2 -O3 -Os -Ofast -Og
280
281 Program Instrumentation Options
282 -p -pg -fprofile-arcs --coverage -ftest-coverage
283 -fprofile-dir=path -fprofile-generate -fprofile-generate=path
284 -fsanitize=style -fsanitize-recover -fsanitize-recover=style
285 -fasan-shadow-offset=number -fsanitize-sections=s1,s2,...
286 -fsanitize-undefined-trap-on-error -fbounds-check
287 -fcheck-pointer-bounds -fchkp-check-incomplete-type
288 -fchkp-first-field-has-own-bounds -fchkp-narrow-bounds
289 -fchkp-narrow-to-innermost-array -fchkp-optimize
290 -fchkp-use-fast-string-functions -fchkp-use-nochk-string-functions
291 -fchkp-use-static-bounds -fchkp-use-static-const-bounds
292 -fchkp-treat-zero-dynamic-size-as-infinite -fchkp-check-read
293 -fchkp-check-read -fchkp-check-write -fchkp-store-bounds
294 -fchkp-instrument-calls -fchkp-instrument-marked-only
295 -fchkp-use-wrappers -fchkp-flexible-struct-trailing-arrays
296 -fstack-protector -fstack-protector-all -fstack-protector-strong
297 -fstack-protector-explicit -fstack-check
298 -fstack-limit-register=reg -fstack-limit-symbol=sym
299 -fno-stack-limit -fsplit-stack -fvtable-verify=[std|preinit|none]
300 -fvtv-counts -fvtv-debug -finstrument-functions
301 -finstrument-functions-exclude-function-list=sym,sym,...
302 -finstrument-functions-exclude-file-list=file,file,...
303
304 Preprocessor Options
305 -Aquestion=answer -A-question[=answer] -C -CC -Dmacro[=defn] -dD
306 -dI -dM -dN -dU -fdebug-cpp -fdirectives-only
307 -fdollars-in-identifiers -fexec-charset=charset
308 -fextended-identifiers -finput-charset=charset
309 -fno-canonical-system-headers -fpch-deps -fpch-preprocess
310 -fpreprocessed -ftabstop=width -ftrack-macro-expansion
311 -fwide-exec-charset=charset -fworking-directory -H -imacros file
312 -include file -M -MD -MF -MG -MM -MMD -MP -MQ -MT
313 -no-integrated-cpp -P -pthread -remap -traditional
314 -traditional-cpp -trigraphs -Umacro -undef -Wp,option
315 -Xpreprocessor option
316
317 Assembler Options
318 -Wa,option -Xassembler option
319
320 Linker Options
321 object-file-name -fuse-ld=linker -llibrary -nostartfiles
322 -nodefaultlibs -nostdlib -pie -pthread -rdynamic -s -static
323 -static-libgcc -static-libstdc++ -static-libasan -static-libtsan
324 -static-liblsan -static-libubsan -static-libmpx
325 -static-libmpxwrappers -shared -shared-libgcc -symbolic -T script
326 -Wl,option -Xlinker option -u symbol -z keyword
327
328 Directory Options
329 -Bprefix -Idir -I- -idirafter dir -imacros file -imultilib dir
330 -iplugindir=dir -iprefix file -iquote dir -isysroot dir -isystem
331 dir -iwithprefix dir -iwithprefixbefore dir -Ldir
332 -no-canonical-prefixes --no-sysroot-suffix -nostdinc -nostdinc++
333 --sysroot=dir
334
335 Code Generation Options
336 -fcall-saved-reg -fcall-used-reg -ffixed-reg -fexceptions
337 -fnon-call-exceptions -fdelete-dead-exceptions -funwind-tables
338 -fasynchronous-unwind-tables -fno-gnu-unique
339 -finhibit-size-directive -fno-common -fno-ident
340 -fpcc-struct-return -fpic -fPIC -fpie -fPIE -fno-plt
341 -fno-jump-tables -frecord-gcc-switches -freg-struct-return
342 -fshort-enums -fshort-wchar -fverbose-asm -fpack-struct[=n]
343 -fleading-underscore -ftls-model=model -fstack-reuse=reuse_level
344 -ftrampolines -ftrapv -fwrapv
345 -fvisibility=[default|internal|hidden|protected]
346 -fstrict-volatile-bitfields -fsync-libcalls
347
348 Developer Options
349 -dletters -dumpspecs -dumpmachine -dumpversion -dumpfullversion
350 -fchecking -fchecking=n -fdbg-cnt-list -fdbg-cnt=counter-value-
351 list -fdisable-ipa-pass_name -fdisable-rtl-pass_name
352 -fdisable-rtl-pass-name=range-list -fdisable-tree-pass_name
353 -fdisable-tree-pass-name=range-list -fdump-noaddr
354 -fdump-unnumbered -fdump-unnumbered-links
355 -fdump-translation-unit[-n] -fdump-class-hierarchy[-n]
356 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline -fdump-passes
357 -fdump-rtl-pass -fdump-rtl-pass=filename -fdump-statistics
358 -fdump-final-insns[=file] -fdump-tree-all -fdump-tree-switch
359 -fdump-tree-switch-options -fdump-tree-switch-options=filename
360 -fcompare-debug[=opts] -fcompare-debug-second -fenable-kind-pass
361 -fenable-kind-pass=range-list -fira-verbose=n -flto-report
362 -flto-report-wpa -fmem-report-wpa -fmem-report
363 -fpre-ipa-mem-report -fpost-ipa-mem-report -fopt-info
364 -fopt-info-options[=file] -fprofile-report -frandom-seed=string
365 -fsched-verbose=n -fsel-sched-verbose -fsel-sched-dump-cfg
366 -fsel-sched-pipelining-verbose -fstats -fstack-usage
367 -ftime-report -ftime-report-details
368 -fvar-tracking-assignments-toggle -gtoggle
369 -print-file-name=library -print-libgcc-file-name
370 -print-multi-directory -print-multi-lib -print-multi-os-directory
371 -print-prog-name=program -print-search-dirs -Q -print-sysroot
372 -print-sysroot-headers-suffix -save-temps -save-temps=cwd
373 -save-temps=obj -time[=file]
374
375 Machine-Dependent Options
376 AArch64 Options -mabi=name -mbig-endian -mlittle-endian
377 -mgeneral-regs-only -mcmodel=tiny -mcmodel=small -mcmodel=large
378 -mstrict-align -momit-leaf-frame-pointer
379 -mno-omit-leaf-frame-pointer -mtls-dialect=desc
380 -mtls-dialect=traditional -mtls-size=size -mfix-cortex-a53-835769
381 -mno-fix-cortex-a53-835769 -mfix-cortex-a53-843419
382 -mno-fix-cortex-a53-843419 -mlow-precision-recip-sqrt
383 -mno-low-precision-recip-sqrt -mlow-precision-sqrt
384 -mno-low-precision-sqrt -mlow-precision-div -mno-low-precision-div
385 -march=name -mcpu=name -mtune=name
386
387 Adapteva Epiphany Options -mhalf-reg-file -mprefer-short-insn-regs
388 -mbranch-cost=num -mcmove -mnops=num -msoft-cmpsf -msplit-lohi
389 -mpost-inc -mpost-modify -mstack-offset=num -mround-nearest
390 -mlong-calls -mshort-calls -msmall16 -mfp-mode=mode
391 -mvect-double -max-vect-align=num -msplit-vecmove-early
392 -m1reg-reg
393
394 ARC Options -mbarrel-shifter -mcpu=cpu -mA6 -mARC600 -mA7
395 -mARC700 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr -mea
396 -mno-mpy -mmul32x16 -mmul64 -matomic -mnorm -mspfp
397 -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap -mcrc
398 -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape
399 -mtelephony -mxy -misize -mannotate-align -marclinux
400 -marclinux_prof -mlong-calls -mmedium-calls -msdata
401 -mvolatile-cache -mtp-regno=regno -malign-call -mauto-modify-reg
402 -mbbit-peephole -mno-brcc -mcase-vector-pcrel -mcompact-casesi
403 -mno-cond-exec -mearly-cbranchsi -mexpand-adddi -mindexed-loads
404 -mlra -mlra-priority-none -mlra-priority-compact mlra-priority-
405 noncompact -mno-millicode -mmixed-code -mq-class -mRcq -mRcw
406 -msize-level=level -mtune=cpu -mmultcost=num
407 -munalign-prob-threshold=probability -mmpy-option=multo -mdiv-rem
408 -mcode-density -mll64 -mfpu=fpu
409
410 ARM Options -mapcs-frame -mno-apcs-frame -mabi=name
411 -mapcs-stack-check -mno-apcs-stack-check -mapcs-reentrant
412 -mno-apcs-reentrant -msched-prolog -mno-sched-prolog
413 -mlittle-endian -mbig-endian -mfloat-abi=name -mfp16-format=name
414 -mthumb-interwork -mno-thumb-interwork -mcpu=name -march=name
415 -mfpu=name -mtune=name -mprint-tune-info
416 -mstructure-size-boundary=n -mabort-on-noreturn -mlong-calls
417 -mno-long-calls -msingle-pic-base -mno-single-pic-base
418 -mpic-register=reg -mnop-fun-dllimport -mpoke-function-name -mthumb
419 -marm -mtpcs-frame -mtpcs-leaf-frame -mcaller-super-interworking
420 -mcallee-super-interworking -mtp=name -mtls-dialect=dialect
421 -mword-relocations -mfix-cortex-m3-ldrd -munaligned-access
422 -mneon-for-64bits -mslow-flash-data -masm-syntax-unified
423 -mrestrict-it -mpure-code -mcmse
424
425 AVR Options -mmcu=mcu -mabsdata -maccumulate-args
426 -mbranch-cost=cost -mcall-prologues -mint8 -mn_flash=size
427 -mno-interrupts -mrelax -mrmw -mstrict-X -mtiny-stack
428 -mfract-convert-truncate -nodevicelib -Waddr-space-convert
429 -Wmisspelled-isr
430
431 Blackfin Options -mcpu=cpu[-sirevision] -msim
432 -momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer
433 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly
434 -mno-csync-anomaly -mlow-64k -mno-low64k -mstack-check-l1
435 -mid-shared-library -mno-id-shared-library -mshared-library-id=n
436 -mleaf-id-shared-library -mno-leaf-id-shared-library -msep-data
437 -mno-sep-data -mlong-calls -mno-long-calls -mfast-fp
438 -minline-plt -mmulticore -mcorea -mcoreb -msdram -micplb
439
440 C6X Options -mbig-endian -mlittle-endian -march=cpu -msim
441 -msdata=sdata-type
442
443 CRIS Options -mcpu=cpu -march=cpu -mtune=cpu -mmax-stack-frame=n
444 -melinux-stacksize=n -metrax4 -metrax100 -mpdebug -mcc-init
445 -mno-side-effects -mstack-align -mdata-align -mconst-align
446 -m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt
447 -melf -maout -melinux -mlinux -sim -sim2 -mmul-bug-workaround
448 -mno-mul-bug-workaround
449
450 CR16 Options -mmac -mcr16cplus -mcr16c -msim -mint32 -mbit-ops
451 -mdata-model=model
452
453 Darwin Options -all_load -allowable_client -arch
454 -arch_errors_fatal -arch_only -bind_at_load -bundle
455 -bundle_loader -client_name -compatibility_version
456 -current_version -dead_strip -dependency-file -dylib_file
457 -dylinker_install_name -dynamic -dynamiclib
458 -exported_symbols_list -filelist -flat_namespace
459 -force_cpusubtype_ALL -force_flat_namespace
460 -headerpad_max_install_names -iframework -image_base -init
461 -install_name -keep_private_externs -multi_module
462 -multiply_defined -multiply_defined_unused -noall_load
463 -no_dead_strip_inits_and_terms -nofixprebinding -nomultidefs
464 -noprebind -noseglinkedit -pagezero_size -prebind
465 -prebind_all_twolevel_modules -private_bundle -read_only_relocs
466 -sectalign -sectobjectsymbols -whyload -seg1addr -sectcreate
467 -sectobjectsymbols -sectorder -segaddr -segs_read_only_addr
468 -segs_read_write_addr -seg_addr_table -seg_addr_table_filename
469 -seglinkedit -segprot -segs_read_only_addr -segs_read_write_addr
470 -single_module -static -sub_library -sub_umbrella
471 -twolevel_namespace -umbrella -undefined -unexported_symbols_list
472 -weak_reference_mismatches -whatsloaded -F -gused -gfull
473 -mmacosx-version-min=version -mkernel -mone-byte-bool
474
475 DEC Alpha Options -mno-fp-regs -msoft-float -mieee
476 -mieee-with-inexact -mieee-conformant -mfp-trap-mode=mode
477 -mfp-rounding-mode=mode -mtrap-precision=mode -mbuild-constants
478 -mcpu=cpu-type -mtune=cpu-type -mbwx -mmax -mfix -mcix
479 -mfloat-vax -mfloat-ieee -mexplicit-relocs -msmall-data
480 -mlarge-data -msmall-text -mlarge-text -mmemory-latency=time
481
482 FR30 Options -msmall-model -mno-lsim
483
484 FT32 Options -msim -mlra -mnodiv
485
486 FRV Options -mgpr-32 -mgpr-64 -mfpr-32 -mfpr-64 -mhard-float
487 -msoft-float -malloc-cc -mfixed-cc -mdword -mno-dword -mdouble
488 -mno-double -mmedia -mno-media -mmuladd -mno-muladd -mfdpic
489 -minline-plt -mgprel-ro -multilib-library-pic -mlinked-fp
490 -mlong-calls -malign-labels -mlibrary-pic -macc-4 -macc-8 -mpack
491 -mno-pack -mno-eflags -mcond-move -mno-cond-move
492 -moptimize-membar -mno-optimize-membar -mscc -mno-scc
493 -mcond-exec -mno-cond-exec -mvliw-branch -mno-vliw-branch
494 -mmulti-cond-exec -mno-multi-cond-exec -mnested-cond-exec
495 -mno-nested-cond-exec -mtomcat-stats -mTLS -mtls -mcpu=cpu
496
497 GNU/Linux Options -mglibc -muclibc -mmusl -mbionic -mandroid
498 -tno-android-cc -tno-android-ld
499
500 H8/300 Options -mrelax -mh -ms -mn -mexr -mno-exr -mint32
501 -malign-300
502
503 HPPA Options -march=architecture-type -mcaller-copies
504 -mdisable-fpregs -mdisable-indexing -mfast-indirect-calls -mgas
505 -mgnu-ld -mhp-ld -mfixed-range=register-range -mjump-in-delay
506 -mlinker-opt -mlong-calls -mlong-load-store -mno-disable-fpregs
507 -mno-disable-indexing -mno-fast-indirect-calls -mno-gas
508 -mno-jump-in-delay -mno-long-load-store -mno-portable-runtime
509 -mno-soft-float -mno-space-regs -msoft-float -mpa-risc-1-0
510 -mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime -mschedule=cpu-
511 type -mspace-regs -msio -mwsio -munix=unix-std -nolibdld
512 -static -threads
513
514 IA-64 Options -mbig-endian -mlittle-endian -mgnu-as -mgnu-ld
515 -mno-pic -mvolatile-asm-stop -mregister-names -msdata -mno-sdata
516 -mconstant-gp -mauto-pic -mfused-madd
517 -minline-float-divide-min-latency
518 -minline-float-divide-max-throughput -mno-inline-float-divide
519 -minline-int-divide-min-latency -minline-int-divide-max-throughput
520 -mno-inline-int-divide -minline-sqrt-min-latency
521 -minline-sqrt-max-throughput -mno-inline-sqrt -mdwarf2-asm
522 -mearly-stop-bits -mfixed-range=register-range -mtls-size=tls-size
523 -mtune=cpu-type -milp32 -mlp64 -msched-br-data-spec
524 -msched-ar-data-spec -msched-control-spec -msched-br-in-data-spec
525 -msched-ar-in-data-spec -msched-in-control-spec -msched-spec-ldc
526 -msched-spec-control-ldc -msched-prefer-non-data-spec-insns
527 -msched-prefer-non-control-spec-insns
528 -msched-stop-bits-after-every-cycle
529 -msched-count-spec-in-critical-path
530 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost
531 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=max-
532 insns
533
534 LM32 Options -mbarrel-shift-enabled -mdivide-enabled
535 -mmultiply-enabled -msign-extend-enabled -muser-enabled
536
537 M32R/D Options -m32r2 -m32rx -m32r -mdebug -malign-loops
538 -mno-align-loops -missue-rate=number -mbranch-cost=number
539 -mmodel=code-size-model-type -msdata=sdata-type -mno-flush-func
540 -mflush-func=name -mno-flush-trap -mflush-trap=number -G num
541
542 M32C Options -mcpu=cpu -msim -memregs=number
543
544 M680x0 Options -march=arch -mcpu=cpu -mtune=tune -m68000 -m68020
545 -m68020-40 -m68020-60 -m68030 -m68040 -m68060 -mcpu32 -m5200
546 -m5206e -m528x -m5307 -m5407 -mcfv4e -mbitfield -mno-bitfield
547 -mc68000 -mc68020 -mnobitfield -mrtd -mno-rtd -mdiv -mno-div
548 -mshort -mno-short -mhard-float -m68881 -msoft-float -mpcrel
549 -malign-int -mstrict-align -msep-data -mno-sep-data
550 -mshared-library-id=n -mid-shared-library -mno-id-shared-library
551 -mxgot -mno-xgot -mlong-jump-table-offsets
552
553 MCore Options -mhardlit -mno-hardlit -mdiv -mno-div
554 -mrelax-immediates -mno-relax-immediates -mwide-bitfields
555 -mno-wide-bitfields -m4byte-functions -mno-4byte-functions
556 -mcallgraph-data -mno-callgraph-data -mslow-bytes -mno-slow-bytes
557 -mno-lsim -mlittle-endian -mbig-endian -m210 -m340
558 -mstack-increment
559
560 MeP Options -mabsdiff -mall-opts -maverage -mbased=n -mbitops
561 -mc=n -mclip -mconfig=name -mcop -mcop32 -mcop64 -mivc2 -mdc
562 -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax
563 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim
564 -msimnovec -mtf -mtiny=n
565
566 MicroBlaze Options -msoft-float -mhard-float -msmall-divides
567 -mcpu=cpu -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift
568 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss
569 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt
570 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-app-model
571
572 MIPS Options -EL -EB -march=arch -mtune=arch -mips1 -mips2
573 -mips3 -mips4 -mips32 -mips32r2 -mips32r3 -mips32r5 -mips32r6
574 -mips64 -mips64r2 -mips64r3 -mips64r5 -mips64r6 -mips16
575 -mno-mips16 -mflip-mips16 -minterlink-compressed
576 -mno-interlink-compressed -minterlink-mips16 -mno-interlink-mips16
577 -mabi=abi -mabicalls -mno-abicalls -mshared -mno-shared -mplt
578 -mno-plt -mxgot -mno-xgot -mgp32 -mgp64 -mfp32 -mfpxx -mfp64
579 -mhard-float -msoft-float -mno-float -msingle-float
580 -mdouble-float -modd-spreg -mno-odd-spreg -mabs=mode
581 -mnan=encoding -mdsp -mno-dsp -mdspr2 -mno-dspr2 -mmcu
582 -mmno-mcu -meva -mno-eva -mvirt -mno-virt -mxpa -mno-xpa
583 -mmicromips -mno-micromips -mmsa -mno-msa -mfpu=fpu-type
584 -msmartmips -mno-smartmips -mpaired-single -mno-paired-single
585 -mdmx -mno-mdmx -mips3d -mno-mips3d -mmt -mno-mt -mllsc
586 -mno-llsc -mlong64 -mlong32 -msym32 -mno-sym32 -Gnum
587 -mlocal-sdata -mno-local-sdata -mextern-sdata -mno-extern-sdata
588 -mgpopt -mno-gopt -membedded-data -mno-embedded-data
589 -muninit-const-in-rodata -mno-uninit-const-in-rodata
590 -mcode-readable=setting -msplit-addresses -mno-split-addresses
591 -mexplicit-relocs -mno-explicit-relocs -mcheck-zero-division
592 -mno-check-zero-division -mdivide-traps -mdivide-breaks
593 -mload-store-pairs -mno-load-store-pairs -mmemcpy -mno-memcpy
594 -mlong-calls -mno-long-calls -mmad -mno-mad -mimadd -mno-imadd
595 -mfused-madd -mno-fused-madd -nocpp -mfix-24k -mno-fix-24k
596 -mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400
597 -mfix-r10000 -mno-fix-r10000 -mfix-rm7000 -mno-fix-rm7000
598 -mfix-vr4120 -mno-fix-vr4120 -mfix-vr4130 -mno-fix-vr4130
599 -mfix-sb1 -mno-fix-sb1 -mflush-func=func -mno-flush-func
600 -mbranch-cost=num -mbranch-likely -mno-branch-likely
601 -mcompact-branches=policy -mfp-exceptions -mno-fp-exceptions
602 -mvr4130-align -mno-vr4130-align -msynci -mno-synci -mlxc1-sxc1
603 -mno-lxc1-sxc1 -mmadd4 -mno-madd4 -mrelax-pic-calls
604 -mno-relax-pic-calls -mmcount-ra-address -mframe-header-opt
605 -mno-frame-header-opt
606
607 MMIX Options -mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon
608 -mabi=gnu -mabi=mmixware -mzero-extend -mknuthdiv
609 -mtoplevel-symbols -melf -mbranch-predict -mno-branch-predict
610 -mbase-addresses -mno-base-addresses -msingle-exit
611 -mno-single-exit
612
613 MN10300 Options -mmult-bug -mno-mult-bug -mno-am33 -mam33
614 -mam33-2 -mam34 -mtune=cpu-type -mreturn-pointer-on-d0 -mno-crt0
615 -mrelax -mliw -msetlb
616
617 Moxie Options -meb -mel -mmul.x -mno-crt0
618
619 MSP430 Options -msim -masm-hex -mmcu= -mcpu= -mlarge -msmall
620 -mrelax -mwarn-mcu -mcode-region= -mdata-region= -msilicon-errata=
621 -msilicon-errata-warn= -mhwmult= -minrt
622
623 NDS32 Options -mbig-endian -mlittle-endian -mreduced-regs
624 -mfull-regs -mcmov -mno-cmov -mperf-ext -mno-perf-ext -mv3push
625 -mno-v3push -m16bit -mno-16bit -misr-vector-size=num
626 -mcache-block-size=num -march=arch -mcmodel=code-model -mctor-dtor
627 -mrelax
628
629 Nios II Options -G num -mgpopt=option -mgpopt -mno-gpopt -mel
630 -meb -mno-bypass-cache -mbypass-cache -mno-cache-volatile
631 -mcache-volatile -mno-fast-sw-div -mfast-sw-div -mhw-mul
632 -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div
633 -mcustom-insn=N -mno-custom-insn -mcustom-fpu-cfg=name -mhal
634 -msmallc -msys-crt0=name -msys-lib=name -march=arch -mbmx
635 -mno-bmx -mcdx -mno-cdx
636
637 Nvidia PTX Options -m32 -m64 -mmainkernel -moptimize
638
639 PDP-11 Options -mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45
640 -m10 -mbcopy -mbcopy-builtin -mint32 -mno-int16 -mint16
641 -mno-int32 -mfloat32 -mno-float64 -mfloat64 -mno-float32
642 -mabshi -mno-abshi -mbranch-expensive -mbranch-cheap -munix-asm
643 -mdec-asm
644
645 picoChip Options -mae=ae_type -mvliw-lookahead=N
646 -msymbol-as-address -mno-inefficient-warnings
647
648 PowerPC Options See RS/6000 and PowerPC Options.
649
650 RISC-V Options -mbranch-cost=N-instruction -mplt -mno-plt
651 -mabi=ABI-string -mfdiv -mno-fdiv -mdiv -mno-div -march=ISA-
652 string -mtune=processor-string -msmall-data-limit=N-bytes
653 -msave-restore -mno-save-restore -mstrict-align -mno-strict-align
654 -mcmodel=medlow -mcmodel=medany -mexplicit-relocs
655 -mno-explicit-relocs
656
657 RL78 Options -msim -mmul=none -mmul=g13 -mmul=g14 -mallregs
658 -mcpu=g10 -mcpu=g13 -mcpu=g14 -mg10 -mg13 -mg14
659 -m64bit-doubles -m32bit-doubles -msave-mduc-in-interrupts
660
661 RS/6000 and PowerPC Options -mcpu=cpu-type -mtune=cpu-type
662 -mcmodel=code-model -mpowerpc64 -maltivec -mno-altivec
663 -mpowerpc-gpopt -mno-powerpc-gpopt -mpowerpc-gfxopt
664 -mno-powerpc-gfxopt -mmfcrf -mno-mfcrf -mpopcntb -mno-popcntb
665 -mpopcntd -mno-popcntd -mfprnd -mno-fprnd -mcmpb -mno-cmpb
666 -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp -mfull-toc
667 -mminimal-toc -mno-fp-in-toc -mno-sum-in-toc -m64 -m32
668 -mxl-compat -mno-xl-compat -mpe -malign-power -malign-natural
669 -msoft-float -mhard-float -mmultiple -mno-multiple
670 -msingle-float -mdouble-float -msimple-fpu -mstring -mno-string
671 -mupdate -mno-update -mavoid-indexed-addresses
672 -mno-avoid-indexed-addresses -mfused-madd -mno-fused-madd
673 -mbit-align -mno-bit-align -mstrict-align -mno-strict-align
674 -mrelocatable -mno-relocatable -mrelocatable-lib
675 -mno-relocatable-lib -mtoc -mno-toc -mlittle -mlittle-endian
676 -mbig -mbig-endian -mdynamic-no-pic -maltivec -mswdiv
677 -msingle-pic-base -mprioritize-restricted-insns=priority
678 -msched-costly-dep=dependence_type -minsert-sched-nops=scheme
679 -mcall-sysv -mcall-netbsd -maix-struct-return
680 -msvr4-struct-return -mabi=abi-type -msecure-plt -mbss-plt
681 -mblock-move-inline-limit=num -misel -mno-isel -misel=yes
682 -misel=no -mspe -mno-spe -mspe=yes -mspe=no -mpaired
683 -mgen-cell-microcode -mwarn-cell-microcode -mvrsave -mno-vrsave
684 -mmulhw -mno-mulhw -mdlmzb -mno-dlmzb -mfloat-gprs=yes
685 -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double
686 -mprototype -mno-prototype -msim -mmvme -mads -myellowknife
687 -memb -msdata -msdata=opt -mreadonly-in-sdata -mvxworks -G num
688 -mrecip -mrecip=opt -mno-recip -mrecip-precision
689 -mno-recip-precision -mveclibabi=type -mfriz -mno-friz
690 -mpointers-to-nested-functions -mno-pointers-to-nested-functions
691 -msave-toc-indirect -mno-save-toc-indirect -mpower8-fusion
692 -mno-mpower8-fusion -mpower8-vector -mno-power8-vector -mcrypto
693 -mno-crypto -mhtm -mno-htm -mdirect-move -mno-direct-move
694 -mquad-memory -mno-quad-memory -mquad-memory-atomic
695 -mno-quad-memory-atomic -mcompat-align-parm -mno-compat-align-parm
696 -mupper-regs-df -mno-upper-regs-df -mupper-regs-sf
697 -mno-upper-regs-sf -mupper-regs-di -mno-upper-regs-di -mupper-regs
698 -mno-upper-regs -mfloat128 -mno-float128 -mfloat128-hardware
699 -mno-float128-hardware -mgnu-attribute -mno-gnu-attribute
700 -mstack-protector-guard=guard -mstack-protector-guard-reg=reg
701 -mstack-protector-guard-offset=offset -mlra -mno-lra
702
703 RX Options -m64bit-doubles -m32bit-doubles -fpu -nofpu -mcpu=
704 -mbig-endian-data -mlittle-endian-data -msmall-data -msim
705 -mno-sim -mas100-syntax -mno-as100-syntax -mrelax
706 -mmax-constant-size= -mint-register= -mpid -mallow-string-insns
707 -mno-allow-string-insns -mjsr -mno-warn-multiple-fast-interrupts
708 -msave-acc-in-interrupts
709
710 S/390 and zSeries Options -mtune=cpu-type -march=cpu-type
711 -mhard-float -msoft-float -mhard-dfp -mno-hard-dfp
712 -mlong-double-64 -mlong-double-128 -mbackchain -mno-backchain
713 -mpacked-stack -mno-packed-stack -msmall-exec -mno-small-exec
714 -mmvcle -mno-mvcle -m64 -m31 -mdebug -mno-debug -mesa -mzarch
715 -mhtm -mvx -mzvector -mtpf-trace -mno-tpf-trace -mfused-madd
716 -mno-fused-madd -mwarn-framesize -mwarn-dynamicstack -mstack-size
717 -mstack-guard -mhotpatch=halfwords,halfwords
718
719 Score Options -meb -mel -mnhwloop -muls -mmac -mscore5 -mscore5u
720 -mscore7 -mscore7d
721
722 SH Options -m1 -m2 -m2e -m2a-nofpu -m2a-single-only -m2a-single
723 -m2a -m3 -m3e -m4-nofpu -m4-single-only -m4-single -m4
724 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al -mb -ml
725 -mdalign -mrelax -mbigtable -mfmovd -mrenesas -mno-renesas
726 -mnomacsave -mieee -mno-ieee -mbitops -misize
727 -minline-ic_invalidate -mpadstruct -mprefergot -musermode
728 -multcost=number -mdiv=strategy -mdivsi3_libfunc=name
729 -mfixed-range=register-range -maccumulate-outgoing-args
730 -matomic-model=atomic-model -mbranch-cost=num -mzdcbranch
731 -mno-zdcbranch -mcbranch-force-delay-slot -mfused-madd
732 -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra
733 -mpretend-cmove -mtas
734
735 Solaris 2 Options -mclear-hwcap -mno-clear-hwcap -mimpure-text
736 -mno-impure-text -pthreads
737
738 SPARC Options -mcpu=cpu-type -mtune=cpu-type -mcmodel=code-model
739 -mmemory-model=mem-model -m32 -m64 -mapp-regs -mno-app-regs
740 -mfaster-structs -mno-faster-structs -mflat -mno-flat -mfpu
741 -mno-fpu -mhard-float -msoft-float -mhard-quad-float
742 -msoft-quad-float -mstack-bias -mno-stack-bias -mstd-struct-return
743 -mno-std-struct-return -munaligned-doubles -mno-unaligned-doubles
744 -muser-mode -mno-user-mode -mv8plus -mno-v8plus -mvis -mno-vis
745 -mvis2 -mno-vis2 -mvis3 -mno-vis3 -mvis4 -mno-vis4 -mvis4b
746 -mno-vis4b -mcbcond -mno-cbcond -mfmaf -mno-fmaf -mfsmuld
747 -mno-fsmuld -mpopc -mno-popc -msubxc -mno-subxc -mfix-at697f
748 -mfix-ut699 -mfix-ut700 -mfix-gr712rc -mlra -mno-lra
749
750 SPU Options -mwarn-reloc -merror-reloc -msafe-dma -munsafe-dma
751 -mbranch-hints -msmall-mem -mlarge-mem -mstdmain
752 -mfixed-range=register-range -mea32 -mea64
753 -maddress-space-conversion -mno-address-space-conversion
754 -mcache-size=cache-size -matomic-updates -mno-atomic-updates
755
756 System V Options -Qy -Qn -YP,paths -Ym,dir
757
758 TILE-Gx Options -mcpu=CPU -m32 -m64 -mbig-endian
759 -mlittle-endian -mcmodel=code-model
760
761 TILEPro Options -mcpu=cpu -m32
762
763 V850 Options -mlong-calls -mno-long-calls -mep -mno-ep
764 -mprolog-function -mno-prolog-function -mspace -mtda=n -msda=n
765 -mzda=n -mapp-regs -mno-app-regs -mdisable-callt
766 -mno-disable-callt -mv850e2v3 -mv850e2 -mv850e1 -mv850es -mv850e
767 -mv850 -mv850e3v5 -mloop -mrelax -mlong-jumps -msoft-float
768 -mhard-float -mgcc-abi -mrh850-abi -mbig-switch
769
770 VAX Options -mg -mgnu -munix
771
772 Visium Options -mdebug -msim -mfpu -mno-fpu -mhard-float
773 -msoft-float -mcpu=cpu-type -mtune=cpu-type -msv-mode
774 -muser-mode
775
776 VMS Options -mvms-return-codes -mdebug-main=prefix -mmalloc64
777 -mpointer-size=size
778
779 VxWorks Options -mrtp -non-static -Bstatic -Bdynamic -Xbind-lazy
780 -Xbind-now
781
782 x86 Options -mtune=cpu-type -march=cpu-type -mtune-ctrl=feature-
783 list -mdump-tune-features -mno-default -mfpmath=unit
784 -masm=dialect -mno-fancy-math-387 -mno-fp-ret-in-387 -m80387
785 -mhard-float -msoft-float -mno-wide-multiply -mrtd
786 -malign-double -mpreferred-stack-boundary=num
787 -mincoming-stack-boundary=num -mcld -mcx16 -msahf -mmovbe
788 -mcrc32 -mrecip -mrecip=opt -mvzeroupper -mprefer-avx128 -mmmx
789 -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx
790 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -mavx512vl
791 -mavx512bw -mavx512dq -mavx512ifma -mavx512vbmi -msha -maes
792 -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma -mprefetchwt1
793 -mclflushopt -mxsavec -mxsaves -msse4a -m3dnow -m3dnowa
794 -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt -mbmi2
795 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mmpx -mmwaitx -mclzero
796 -mpku -mthreads -mms-bitfields -mno-align-stringops
797 -minline-all-stringops -minline-stringops-dynamically
798 -mstringop-strategy=alg -mmemcpy-strategy=strategy
799 -mmemset-strategy=strategy -mpush-args -maccumulate-outgoing-args
800 -m128bit-long-double -m96bit-long-double -mlong-double-64
801 -mlong-double-80 -mlong-double-128 -mregparm=num -msseregparm
802 -mveclibabi=type -mvect8-ret-in-mem -mpc32 -mpc64 -mpc80
803 -mstackrealign -momit-leaf-frame-pointer -mno-red-zone
804 -mno-tls-direct-seg-refs -mcmodel=code-model -mabi=name
805 -maddress-mode=mode -m32 -m64 -mx32 -m16 -miamcu
806 -mlarge-data-threshold=num -msse2avx -mfentry -mrecord-mcount
807 -mnop-mcount -m8bit-idiv -mavx256-split-unaligned-load
808 -mavx256-split-unaligned-store -malign-data=type
809 -mstack-protector-guard=guard -mmitigate-rop -mgeneral-regs-only
810 -mindirect-branch=choice -mfunction-return=choice
811 -mindirect-branch-register
812
813 x86 Windows Options -mconsole -mcygwin -mno-cygwin -mdll
814 -mnop-fun-dllimport -mthread -municode -mwin32 -mwindows
815 -fno-set-stack-executable
816
817 Xstormy16 Options -msim
818
819 Xtensa Options -mconst16 -mno-const16 -mfused-madd
820 -mno-fused-madd -mforce-no-pic -mserialize-volatile
821 -mno-serialize-volatile -mtext-section-literals
822 -mno-text-section-literals -mauto-litpools -mno-auto-litpools
823 -mtarget-align -mno-target-align -mlongcalls -mno-longcalls
824
825 zSeries Options See S/390 and zSeries Options.
826
827 Options Controlling the Kind of Output
828 Compilation can involve up to four stages: preprocessing, compilation
829 proper, assembly and linking, always in that order. GCC is capable of
830 preprocessing and compiling several files either into several assembler
831 input files, or into one assembler input file; then each assembler
832 input file produces an object file, and linking combines all the object
833 files (those newly compiled, and those specified as input) into an
834 executable file.
835
836 For any given input file, the file name suffix determines what kind of
837 compilation is done:
838
839 file.c
840 C source code that must be preprocessed.
841
842 file.i
843 C source code that should not be preprocessed.
844
845 file.ii
846 C++ source code that should not be preprocessed.
847
848 file.m
849 Objective-C source code. Note that you must link with the libobjc
850 library to make an Objective-C program work.
851
852 file.mi
853 Objective-C source code that should not be preprocessed.
854
855 file.mm
856 file.M
857 Objective-C++ source code. Note that you must link with the
858 libobjc library to make an Objective-C++ program work. Note that
859 .M refers to a literal capital M.
860
861 file.mii
862 Objective-C++ source code that should not be preprocessed.
863
864 file.h
865 C, C++, Objective-C or Objective-C++ header file to be turned into
866 a precompiled header (default), or C, C++ header file to be turned
867 into an Ada spec (via the -fdump-ada-spec switch).
868
869 file.cc
870 file.cp
871 file.cxx
872 file.cpp
873 file.CPP
874 file.c++
875 file.C
876 C++ source code that must be preprocessed. Note that in .cxx, the
877 last two letters must both be literally x. Likewise, .C refers to
878 a literal capital C.
879
880 file.mm
881 file.M
882 Objective-C++ source code that must be preprocessed.
883
884 file.mii
885 Objective-C++ source code that should not be preprocessed.
886
887 file.hh
888 file.H
889 file.hp
890 file.hxx
891 file.hpp
892 file.HPP
893 file.h++
894 file.tcc
895 C++ header file to be turned into a precompiled header or Ada spec.
896
897 file.f
898 file.for
899 file.ftn
900 Fixed form Fortran source code that should not be preprocessed.
901
902 file.F
903 file.FOR
904 file.fpp
905 file.FPP
906 file.FTN
907 Fixed form Fortran source code that must be preprocessed (with the
908 traditional preprocessor).
909
910 file.f90
911 file.f95
912 file.f03
913 file.f08
914 Free form Fortran source code that should not be preprocessed.
915
916 file.F90
917 file.F95
918 file.F03
919 file.F08
920 Free form Fortran source code that must be preprocessed (with the
921 traditional preprocessor).
922
923 file.go
924 Go source code.
925
926 file.brig
927 BRIG files (binary representation of HSAIL).
928
929 file.ads
930 Ada source code file that contains a library unit declaration (a
931 declaration of a package, subprogram, or generic, or a generic
932 instantiation), or a library unit renaming declaration (a package,
933 generic, or subprogram renaming declaration). Such files are also
934 called specs.
935
936 file.adb
937 Ada source code file containing a library unit body (a subprogram
938 or package body). Such files are also called bodies.
939
940 file.s
941 Assembler code.
942
943 file.S
944 file.sx
945 Assembler code that must be preprocessed.
946
947 other
948 An object file to be fed straight into linking. Any file name with
949 no recognized suffix is treated this way.
950
951 You can specify the input language explicitly with the -x option:
952
953 -x language
954 Specify explicitly the language for the following input files
955 (rather than letting the compiler choose a default based on the
956 file name suffix). This option applies to all following input
957 files until the next -x option. Possible values for language are:
958
959 c c-header cpp-output
960 c++ c++-header c++-cpp-output
961 objective-c objective-c-header objective-c-cpp-output
962 objective-c++ objective-c++-header objective-c++-cpp-output
963 assembler assembler-with-cpp
964 ada
965 f77 f77-cpp-input f95 f95-cpp-input
966 go
967 brig
968
969 -x none
970 Turn off any specification of a language, so that subsequent files
971 are handled according to their file name suffixes (as they are if
972 -x has not been used at all).
973
974 If you only want some of the stages of compilation, you can use -x (or
975 filename suffixes) to tell gcc where to start, and one of the options
976 -c, -S, or -E to say where gcc is to stop. Note that some combinations
977 (for example, -x cpp-output -E) instruct gcc to do nothing at all.
978
979 -c Compile or assemble the source files, but do not link. The linking
980 stage simply is not done. The ultimate output is in the form of an
981 object file for each source file.
982
983 By default, the object file name for a source file is made by
984 replacing the suffix .c, .i, .s, etc., with .o.
985
986 Unrecognized input files, not requiring compilation or assembly,
987 are ignored.
988
989 -S Stop after the stage of compilation proper; do not assemble. The
990 output is in the form of an assembler code file for each non-
991 assembler input file specified.
992
993 By default, the assembler file name for a source file is made by
994 replacing the suffix .c, .i, etc., with .s.
995
996 Input files that don't require compilation are ignored.
997
998 -E Stop after the preprocessing stage; do not run the compiler proper.
999 The output is in the form of preprocessed source code, which is
1000 sent to the standard output.
1001
1002 Input files that don't require preprocessing are ignored.
1003
1004 -o file
1005 Place output in file file. This applies to whatever sort of output
1006 is being produced, whether it be an executable file, an object
1007 file, an assembler file or preprocessed C code.
1008
1009 If -o is not specified, the default is to put an executable file in
1010 a.out, the object file for source.suffix in source.o, its assembler
1011 file in source.s, a precompiled header file in source.suffix.gch,
1012 and all preprocessed C source on standard output.
1013
1014 -v Print (on standard error output) the commands executed to run the
1015 stages of compilation. Also print the version number of the
1016 compiler driver program and of the preprocessor and the compiler
1017 proper.
1018
1019 -###
1020 Like -v except the commands are not executed and arguments are
1021 quoted unless they contain only alphanumeric characters or "./-_".
1022 This is useful for shell scripts to capture the driver-generated
1023 command lines.
1024
1025 --help
1026 Print (on the standard output) a description of the command-line
1027 options understood by gcc. If the -v option is also specified then
1028 --help is also passed on to the various processes invoked by gcc,
1029 so that they can display the command-line options they accept. If
1030 the -Wextra option has also been specified (prior to the --help
1031 option), then command-line options that have no documentation
1032 associated with them are also displayed.
1033
1034 --target-help
1035 Print (on the standard output) a description of target-specific
1036 command-line options for each tool. For some targets extra target-
1037 specific information may also be printed.
1038
1039 --help={class|[^]qualifier}[,...]
1040 Print (on the standard output) a description of the command-line
1041 options understood by the compiler that fit into all specified
1042 classes and qualifiers. These are the supported classes:
1043
1044 optimizers
1045 Display all of the optimization options supported by the
1046 compiler.
1047
1048 warnings
1049 Display all of the options controlling warning messages
1050 produced by the compiler.
1051
1052 target
1053 Display target-specific options. Unlike the --target-help
1054 option however, target-specific options of the linker and
1055 assembler are not displayed. This is because those tools do
1056 not currently support the extended --help= syntax.
1057
1058 params
1059 Display the values recognized by the --param option.
1060
1061 language
1062 Display the options supported for language, where language is
1063 the name of one of the languages supported in this version of
1064 GCC.
1065
1066 common
1067 Display the options that are common to all languages.
1068
1069 These are the supported qualifiers:
1070
1071 undocumented
1072 Display only those options that are undocumented.
1073
1074 joined
1075 Display options taking an argument that appears after an equal
1076 sign in the same continuous piece of text, such as:
1077 --help=target.
1078
1079 separate
1080 Display options taking an argument that appears as a separate
1081 word following the original option, such as: -o output-file.
1082
1083 Thus for example to display all the undocumented target-specific
1084 switches supported by the compiler, use:
1085
1086 --help=target,undocumented
1087
1088 The sense of a qualifier can be inverted by prefixing it with the ^
1089 character, so for example to display all binary warning options
1090 (i.e., ones that are either on or off and that do not take an
1091 argument) that have a description, use:
1092
1093 --help=warnings,^joined,^undocumented
1094
1095 The argument to --help= should not consist solely of inverted
1096 qualifiers.
1097
1098 Combining several classes is possible, although this usually
1099 restricts the output so much that there is nothing to display. One
1100 case where it does work, however, is when one of the classes is
1101 target. For example, to display all the target-specific
1102 optimization options, use:
1103
1104 --help=target,optimizers
1105
1106 The --help= option can be repeated on the command line. Each
1107 successive use displays its requested class of options, skipping
1108 those that have already been displayed.
1109
1110 If the -Q option appears on the command line before the --help=
1111 option, then the descriptive text displayed by --help= is changed.
1112 Instead of describing the displayed options, an indication is given
1113 as to whether the option is enabled, disabled or set to a specific
1114 value (assuming that the compiler knows this at the point where the
1115 --help= option is used).
1116
1117 Here is a truncated example from the ARM port of gcc:
1118
1119 % gcc -Q -mabi=2 --help=target -c
1120 The following options are target specific:
1121 -mabi= 2
1122 -mabort-on-noreturn [disabled]
1123 -mapcs [disabled]
1124
1125 The output is sensitive to the effects of previous command-line
1126 options, so for example it is possible to find out which
1127 optimizations are enabled at -O2 by using:
1128
1129 -Q -O2 --help=optimizers
1130
1131 Alternatively you can discover which binary optimizations are
1132 enabled by -O3 by using:
1133
1134 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1135 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1136 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1137
1138 --version
1139 Display the version number and copyrights of the invoked GCC.
1140
1141 -pass-exit-codes
1142 Normally the gcc program exits with the code of 1 if any phase of
1143 the compiler returns a non-success return code. If you specify
1144 -pass-exit-codes, the gcc program instead returns with the
1145 numerically highest error produced by any phase returning an error
1146 indication. The C, C++, and Fortran front ends return 4 if an
1147 internal compiler error is encountered.
1148
1149 -pipe
1150 Use pipes rather than temporary files for communication between the
1151 various stages of compilation. This fails to work on some systems
1152 where the assembler is unable to read from a pipe; but the GNU
1153 assembler has no trouble.
1154
1155 -specs=file
1156 Process file after the compiler reads in the standard specs file,
1157 in order to override the defaults which the gcc driver program uses
1158 when determining what switches to pass to cc1, cc1plus, as, ld,
1159 etc. More than one -specs=file can be specified on the command
1160 line, and they are processed in order, from left to right.
1161
1162 -wrapper
1163 Invoke all subcommands under a wrapper program. The name of the
1164 wrapper program and its parameters are passed as a comma separated
1165 list.
1166
1167 gcc -c t.c -wrapper gdb,--args
1168
1169 This invokes all subprograms of gcc under gdb --args, thus the
1170 invocation of cc1 is gdb --args cc1 ....
1171
1172 -fplugin=name.so
1173 Load the plugin code in file name.so, assumed to be a shared object
1174 to be dlopen'd by the compiler. The base name of the shared object
1175 file is used to identify the plugin for the purposes of argument
1176 parsing (See -fplugin-arg-name-key=value below). Each plugin
1177 should define the callback functions specified in the Plugins API.
1178
1179 -fplugin-arg-name-key=value
1180 Define an argument called key with a value of value for the plugin
1181 called name.
1182
1183 -fdump-ada-spec[-slim]
1184 For C and C++ source and include files, generate corresponding Ada
1185 specs.
1186
1187 -fada-spec-parent=unit
1188 In conjunction with -fdump-ada-spec[-slim] above, generate Ada
1189 specs as child units of parent unit.
1190
1191 -fdump-go-spec=file
1192 For input files in any language, generate corresponding Go
1193 declarations in file. This generates Go "const", "type", "var",
1194 and "func" declarations which may be a useful way to start writing
1195 a Go interface to code written in some other language.
1196
1197 @file
1198 Read command-line options from file. The options read are inserted
1199 in place of the original @file option. If file does not exist, or
1200 cannot be read, then the option will be treated literally, and not
1201 removed.
1202
1203 Options in file are separated by whitespace. A whitespace
1204 character may be included in an option by surrounding the entire
1205 option in either single or double quotes. Any character (including
1206 a backslash) may be included by prefixing the character to be
1207 included with a backslash. The file may itself contain additional
1208 @file options; any such options will be processed recursively.
1209
1210 Compiling C++ Programs
1211 C++ source files conventionally use one of the suffixes .C, .cc, .cpp,
1212 .CPP, .c++, .cp, or .cxx; C++ header files often use .hh, .hpp, .H, or
1213 (for shared template code) .tcc; and preprocessed C++ files use the
1214 suffix .ii. GCC recognizes files with these names and compiles them as
1215 C++ programs even if you call the compiler the same way as for
1216 compiling C programs (usually with the name gcc).
1217
1218 However, the use of gcc does not add the C++ library. g++ is a program
1219 that calls GCC and automatically specifies linking against the C++
1220 library. It treats .c, .h and .i files as C++ source files instead of
1221 C source files unless -x is used. This program is also useful when
1222 precompiling a C header file with a .h extension for use in C++
1223 compilations. On many systems, g++ is also installed with the name
1224 c++.
1225
1226 When you compile C++ programs, you may specify many of the same
1227 command-line options that you use for compiling programs in any
1228 language; or command-line options meaningful for C and related
1229 languages; or options that are meaningful only for C++ programs.
1230
1231 Options Controlling C Dialect
1232 The following options control the dialect of C (or languages derived
1233 from C, such as C++, Objective-C and Objective-C++) that the compiler
1234 accepts:
1235
1236 -ansi
1237 In C mode, this is equivalent to -std=c90. In C++ mode, it is
1238 equivalent to -std=c++98.
1239
1240 This turns off certain features of GCC that are incompatible with
1241 ISO C90 (when compiling C code), or of standard C++ (when compiling
1242 C++ code), such as the "asm" and "typeof" keywords, and predefined
1243 macros such as "unix" and "vax" that identify the type of system
1244 you are using. It also enables the undesirable and rarely used ISO
1245 trigraph feature. For the C compiler, it disables recognition of
1246 C++ style // comments as well as the "inline" keyword.
1247
1248 The alternate keywords "__asm__", "__extension__", "__inline__" and
1249 "__typeof__" continue to work despite -ansi. You would not want to
1250 use them in an ISO C program, of course, but it is useful to put
1251 them in header files that might be included in compilations done
1252 with -ansi. Alternate predefined macros such as "__unix__" and
1253 "__vax__" are also available, with or without -ansi.
1254
1255 The -ansi option does not cause non-ISO programs to be rejected
1256 gratuitously. For that, -Wpedantic is required in addition to
1257 -ansi.
1258
1259 The macro "__STRICT_ANSI__" is predefined when the -ansi option is
1260 used. Some header files may notice this macro and refrain from
1261 declaring certain functions or defining certain macros that the ISO
1262 standard doesn't call for; this is to avoid interfering with any
1263 programs that might use these names for other things.
1264
1265 Functions that are normally built in but do not have semantics
1266 defined by ISO C (such as "alloca" and "ffs") are not built-in
1267 functions when -ansi is used.
1268
1269 -std=
1270 Determine the language standard. This option is currently only
1271 supported when compiling C or C++.
1272
1273 The compiler can accept several base standards, such as c90 or
1274 c++98, and GNU dialects of those standards, such as gnu90 or
1275 gnu++98. When a base standard is specified, the compiler accepts
1276 all programs following that standard plus those using GNU
1277 extensions that do not contradict it. For example, -std=c90 turns
1278 off certain features of GCC that are incompatible with ISO C90,
1279 such as the "asm" and "typeof" keywords, but not other GNU
1280 extensions that do not have a meaning in ISO C90, such as omitting
1281 the middle term of a "?:" expression. On the other hand, when a GNU
1282 dialect of a standard is specified, all features supported by the
1283 compiler are enabled, even when those features change the meaning
1284 of the base standard. As a result, some strict-conforming programs
1285 may be rejected. The particular standard is used by -Wpedantic to
1286 identify which features are GNU extensions given that version of
1287 the standard. For example -std=gnu90 -Wpedantic warns about C++
1288 style // comments, while -std=gnu99 -Wpedantic does not.
1289
1290 A value for this option must be provided; possible values are
1291
1292 c90
1293 c89
1294 iso9899:1990
1295 Support all ISO C90 programs (certain GNU extensions that
1296 conflict with ISO C90 are disabled). Same as -ansi for C code.
1297
1298 iso9899:199409
1299 ISO C90 as modified in amendment 1.
1300
1301 c99
1302 c9x
1303 iso9899:1999
1304 iso9899:199x
1305 ISO C99. This standard is substantially completely supported,
1306 modulo bugs and floating-point issues (mainly but not entirely
1307 relating to optional C99 features from Annexes F and G). See
1308 <http://gcc.gnu.org/c99status.html> for more information. The
1309 names c9x and iso9899:199x are deprecated.
1310
1311 c11
1312 c1x
1313 iso9899:2011
1314 ISO C11, the 2011 revision of the ISO C standard. This
1315 standard is substantially completely supported, modulo bugs,
1316 floating-point issues (mainly but not entirely relating to
1317 optional C11 features from Annexes F and G) and the optional
1318 Annexes K (Bounds-checking interfaces) and L (Analyzability).
1319 The name c1x is deprecated.
1320
1321 gnu90
1322 gnu89
1323 GNU dialect of ISO C90 (including some C99 features).
1324
1325 gnu99
1326 gnu9x
1327 GNU dialect of ISO C99. The name gnu9x is deprecated.
1328
1329 gnu11
1330 gnu1x
1331 GNU dialect of ISO C11. This is the default for C code. The
1332 name gnu1x is deprecated.
1333
1334 c++98
1335 c++03
1336 The 1998 ISO C++ standard plus the 2003 technical corrigendum
1337 and some additional defect reports. Same as -ansi for C++ code.
1338
1339 gnu++98
1340 gnu++03
1341 GNU dialect of -std=c++98.
1342
1343 c++11
1344 c++0x
1345 The 2011 ISO C++ standard plus amendments. The name c++0x is
1346 deprecated.
1347
1348 gnu++11
1349 gnu++0x
1350 GNU dialect of -std=c++11. The name gnu++0x is deprecated.
1351
1352 c++14
1353 c++1y
1354 The 2014 ISO C++ standard plus amendments. The name c++1y is
1355 deprecated.
1356
1357 gnu++14
1358 gnu++1y
1359 GNU dialect of -std=c++14. This is the default for C++ code.
1360 The name gnu++1y is deprecated.
1361
1362 c++1z
1363 The next revision of the ISO C++ standard, tentatively planned
1364 for 2017. Support is highly experimental, and will almost
1365 certainly change in incompatible ways in future releases.
1366
1367 gnu++1z
1368 GNU dialect of -std=c++1z. Support is highly experimental, and
1369 will almost certainly change in incompatible ways in future
1370 releases.
1371
1372 -fgnu89-inline
1373 The option -fgnu89-inline tells GCC to use the traditional GNU
1374 semantics for "inline" functions when in C99 mode.
1375
1376 Using this option is roughly equivalent to adding the "gnu_inline"
1377 function attribute to all inline functions.
1378
1379 The option -fno-gnu89-inline explicitly tells GCC to use the C99
1380 semantics for "inline" when in C99 or gnu99 mode (i.e., it
1381 specifies the default behavior). This option is not supported in
1382 -std=c90 or -std=gnu90 mode.
1383
1384 The preprocessor macros "__GNUC_GNU_INLINE__" and
1385 "__GNUC_STDC_INLINE__" may be used to check which semantics are in
1386 effect for "inline" functions.
1387
1388 -fpermitted-flt-eval-methods=style
1389 ISO/IEC TS 18661-3 defines new permissible values for
1390 "FLT_EVAL_METHOD" that indicate that operations and constants with
1391 a semantic type that is an interchange or extended format should be
1392 evaluated to the precision and range of that type. These new
1393 values are a superset of those permitted under C99/C11, which does
1394 not specify the meaning of other positive values of
1395 "FLT_EVAL_METHOD". As such, code conforming to C11 may not have
1396 been written expecting the possibility of the new values.
1397
1398 -fpermitted-flt-eval-methods specifies whether the compiler should
1399 allow only the values of "FLT_EVAL_METHOD" specified in C99/C11, or
1400 the extended set of values specified in ISO/IEC TS 18661-3.
1401
1402 style is either "c11" or "ts-18661-3" as appropriate.
1403
1404 The default when in a standards compliant mode (-std=c11 or
1405 similar) is -fpermitted-flt-eval-methods=c11. The default when in
1406 a GNU dialect (-std=gnu11 or similar) is
1407 -fpermitted-flt-eval-methods=ts-18661-3.
1408
1409 -aux-info filename
1410 Output to the given filename prototyped declarations for all
1411 functions declared and/or defined in a translation unit, including
1412 those in header files. This option is silently ignored in any
1413 language other than C.
1414
1415 Besides declarations, the file indicates, in comments, the origin
1416 of each declaration (source file and line), whether the declaration
1417 was implicit, prototyped or unprototyped (I, N for new or O for
1418 old, respectively, in the first character after the line number and
1419 the colon), and whether it came from a declaration or a definition
1420 (C or F, respectively, in the following character). In the case of
1421 function definitions, a K&R-style list of arguments followed by
1422 their declarations is also provided, inside comments, after the
1423 declaration.
1424
1425 -fallow-parameterless-variadic-functions
1426 Accept variadic functions without named parameters.
1427
1428 Although it is possible to define such a function, this is not very
1429 useful as it is not possible to read the arguments. This is only
1430 supported for C as this construct is allowed by C++.
1431
1432 -fno-asm
1433 Do not recognize "asm", "inline" or "typeof" as a keyword, so that
1434 code can use these words as identifiers. You can use the keywords
1435 "__asm__", "__inline__" and "__typeof__" instead. -ansi implies
1436 -fno-asm.
1437
1438 In C++, this switch only affects the "typeof" keyword, since "asm"
1439 and "inline" are standard keywords. You may want to use the
1440 -fno-gnu-keywords flag instead, which has the same effect. In C99
1441 mode (-std=c99 or -std=gnu99), this switch only affects the "asm"
1442 and "typeof" keywords, since "inline" is a standard keyword in ISO
1443 C99.
1444
1445 -fno-builtin
1446 -fno-builtin-function
1447 Don't recognize built-in functions that do not begin with
1448 __builtin_ as prefix.
1449
1450 GCC normally generates special code to handle certain built-in
1451 functions more efficiently; for instance, calls to "alloca" may
1452 become single instructions which adjust the stack directly, and
1453 calls to "memcpy" may become inline copy loops. The resulting code
1454 is often both smaller and faster, but since the function calls no
1455 longer appear as such, you cannot set a breakpoint on those calls,
1456 nor can you change the behavior of the functions by linking with a
1457 different library. In addition, when a function is recognized as a
1458 built-in function, GCC may use information about that function to
1459 warn about problems with calls to that function, or to generate
1460 more efficient code, even if the resulting code still contains
1461 calls to that function. For example, warnings are given with
1462 -Wformat for bad calls to "printf" when "printf" is built in and
1463 "strlen" is known not to modify global memory.
1464
1465 With the -fno-builtin-function option only the built-in function
1466 function is disabled. function must not begin with __builtin_. If
1467 a function is named that is not built-in in this version of GCC,
1468 this option is ignored. There is no corresponding
1469 -fbuiltin-function option; if you wish to enable built-in functions
1470 selectively when using -fno-builtin or -ffreestanding, you may
1471 define macros such as:
1472
1473 #define abs(n) __builtin_abs ((n))
1474 #define strcpy(d, s) __builtin_strcpy ((d), (s))
1475
1476 -fgimple
1477 Enable parsing of function definitions marked with "__GIMPLE".
1478 This is an experimental feature that allows unit testing of GIMPLE
1479 passes.
1480
1481 -fhosted
1482 Assert that compilation targets a hosted environment. This implies
1483 -fbuiltin. A hosted environment is one in which the entire
1484 standard library is available, and in which "main" has a return
1485 type of "int". Examples are nearly everything except a kernel.
1486 This is equivalent to -fno-freestanding.
1487
1488 -ffreestanding
1489 Assert that compilation targets a freestanding environment. This
1490 implies -fno-builtin. A freestanding environment is one in which
1491 the standard library may not exist, and program startup may not
1492 necessarily be at "main". The most obvious example is an OS
1493 kernel. This is equivalent to -fno-hosted.
1494
1495 -fopenacc
1496 Enable handling of OpenACC directives "#pragma acc" in C/C++ and
1497 "!$acc" in Fortran. When -fopenacc is specified, the compiler
1498 generates accelerated code according to the OpenACC Application
1499 Programming Interface v2.0 <http://www.openacc.org/>. This option
1500 implies -pthread, and thus is only supported on targets that have
1501 support for -pthread.
1502
1503 -fopenacc-dim=geom
1504 Specify default compute dimensions for parallel offload regions
1505 that do not explicitly specify. The geom value is a triple of
1506 ':'-separated sizes, in order 'gang', 'worker' and, 'vector'. A
1507 size can be omitted, to use a target-specific default value.
1508
1509 -fopenmp
1510 Enable handling of OpenMP directives "#pragma omp" in C/C++ and
1511 "!$omp" in Fortran. When -fopenmp is specified, the compiler
1512 generates parallel code according to the OpenMP Application Program
1513 Interface v4.5 <http://www.openmp.org/>. This option implies
1514 -pthread, and thus is only supported on targets that have support
1515 for -pthread. -fopenmp implies -fopenmp-simd.
1516
1517 -fopenmp-simd
1518 Enable handling of OpenMP's SIMD directives with "#pragma omp" in
1519 C/C++ and "!$omp" in Fortran. Other OpenMP directives are ignored.
1520
1521 -fcilkplus
1522 Enable the usage of Cilk Plus language extension features for
1523 C/C++. When the option -fcilkplus is specified, enable the usage
1524 of the Cilk Plus Language extension features for C/C++. The
1525 present implementation follows ABI version 1.2. This is an
1526 experimental feature that is only partially complete, and whose
1527 interface may change in future versions of GCC as the official
1528 specification changes. Currently, all features but "_Cilk_for"
1529 have been implemented.
1530
1531 -fgnu-tm
1532 When the option -fgnu-tm is specified, the compiler generates code
1533 for the Linux variant of Intel's current Transactional Memory ABI
1534 specification document (Revision 1.1, May 6 2009). This is an
1535 experimental feature whose interface may change in future versions
1536 of GCC, as the official specification changes. Please note that
1537 not all architectures are supported for this feature.
1538
1539 For more information on GCC's support for transactional memory,
1540
1541 Note that the transactional memory feature is not supported with
1542 non-call exceptions (-fnon-call-exceptions).
1543
1544 -fms-extensions
1545 Accept some non-standard constructs used in Microsoft header files.
1546
1547 In C++ code, this allows member names in structures to be similar
1548 to previous types declarations.
1549
1550 typedef int UOW;
1551 struct ABC {
1552 UOW UOW;
1553 };
1554
1555 Some cases of unnamed fields in structures and unions are only
1556 accepted with this option.
1557
1558 Note that this option is off for all targets but x86 targets using
1559 ms-abi.
1560
1561 -fplan9-extensions
1562 Accept some non-standard constructs used in Plan 9 code.
1563
1564 This enables -fms-extensions, permits passing pointers to
1565 structures with anonymous fields to functions that expect pointers
1566 to elements of the type of the field, and permits referring to
1567 anonymous fields declared using a typedef. This is only
1568 supported for C, not C++.
1569
1570 -fcond-mismatch
1571 Allow conditional expressions with mismatched types in the second
1572 and third arguments. The value of such an expression is void.
1573 This option is not supported for C++.
1574
1575 -flax-vector-conversions
1576 Allow implicit conversions between vectors with differing numbers
1577 of elements and/or incompatible element types. This option should
1578 not be used for new code.
1579
1580 -funsigned-char
1581 Let the type "char" be unsigned, like "unsigned char".
1582
1583 Each kind of machine has a default for what "char" should be. It
1584 is either like "unsigned char" by default or like "signed char" by
1585 default.
1586
1587 Ideally, a portable program should always use "signed char" or
1588 "unsigned char" when it depends on the signedness of an object.
1589 But many programs have been written to use plain "char" and expect
1590 it to be signed, or expect it to be unsigned, depending on the
1591 machines they were written for. This option, and its inverse, let
1592 you make such a program work with the opposite default.
1593
1594 The type "char" is always a distinct type from each of "signed
1595 char" or "unsigned char", even though its behavior is always just
1596 like one of those two.
1597
1598 -fsigned-char
1599 Let the type "char" be signed, like "signed char".
1600
1601 Note that this is equivalent to -fno-unsigned-char, which is the
1602 negative form of -funsigned-char. Likewise, the option
1603 -fno-signed-char is equivalent to -funsigned-char.
1604
1605 -fsigned-bitfields
1606 -funsigned-bitfields
1607 -fno-signed-bitfields
1608 -fno-unsigned-bitfields
1609 These options control whether a bit-field is signed or unsigned,
1610 when the declaration does not use either "signed" or "unsigned".
1611 By default, such a bit-field is signed, because this is consistent:
1612 the basic integer types such as "int" are signed types.
1613
1614 -fsso-struct=endianness
1615 Set the default scalar storage order of structures and unions to
1616 the specified endianness. The accepted values are big-endian,
1617 little-endian and native for the native endianness of the target
1618 (the default). This option is not supported for C++.
1619
1620 Warning: the -fsso-struct switch causes GCC to generate code that
1621 is not binary compatible with code generated without it if the
1622 specified endianness is not the native endianness of the target.
1623
1624 Options Controlling C++ Dialect
1625 This section describes the command-line options that are only
1626 meaningful for C++ programs. You can also use most of the GNU compiler
1627 options regardless of what language your program is in. For example,
1628 you might compile a file firstClass.C like this:
1629
1630 g++ -g -fstrict-enums -O -c firstClass.C
1631
1632 In this example, only -fstrict-enums is an option meant only for C++
1633 programs; you can use the other options with any language supported by
1634 GCC.
1635
1636 Some options for compiling C programs, such as -std, are also relevant
1637 for C++ programs.
1638
1639 Here is a list of options that are only for compiling C++ programs:
1640
1641 -fabi-version=n
1642 Use version n of the C++ ABI. The default is version 0.
1643
1644 Version 0 refers to the version conforming most closely to the C++
1645 ABI specification. Therefore, the ABI obtained using version 0
1646 will change in different versions of G++ as ABI bugs are fixed.
1647
1648 Version 1 is the version of the C++ ABI that first appeared in G++
1649 3.2.
1650
1651 Version 2 is the version of the C++ ABI that first appeared in G++
1652 3.4, and was the default through G++ 4.9.
1653
1654 Version 3 corrects an error in mangling a constant address as a
1655 template argument.
1656
1657 Version 4, which first appeared in G++ 4.5, implements a standard
1658 mangling for vector types.
1659
1660 Version 5, which first appeared in G++ 4.6, corrects the mangling
1661 of attribute const/volatile on function pointer types, decltype of
1662 a plain decl, and use of a function parameter in the declaration of
1663 another parameter.
1664
1665 Version 6, which first appeared in G++ 4.7, corrects the promotion
1666 behavior of C++11 scoped enums and the mangling of template
1667 argument packs, const/static_cast, prefix ++ and --, and a class
1668 scope function used as a template argument.
1669
1670 Version 7, which first appeared in G++ 4.8, that treats nullptr_t
1671 as a builtin type and corrects the mangling of lambdas in default
1672 argument scope.
1673
1674 Version 8, which first appeared in G++ 4.9, corrects the
1675 substitution behavior of function types with function-cv-
1676 qualifiers.
1677
1678 Version 9, which first appeared in G++ 5.2, corrects the alignment
1679 of "nullptr_t".
1680
1681 Version 10, which first appeared in G++ 6.1, adds mangling of
1682 attributes that affect type identity, such as ia32 calling
1683 convention attributes (e.g. stdcall).
1684
1685 Version 11, which first appeared in G++ 7, corrects the mangling of
1686 sizeof... expressions and operator names. For multiple entities
1687 with the same name within a function, that are declared in
1688 different scopes, the mangling now changes starting with the
1689 twelfth occurrence. It also implies -fnew-inheriting-ctors.
1690
1691 See also -Wabi.
1692
1693 -fabi-compat-version=n
1694 On targets that support strong aliases, G++ works around mangling
1695 changes by creating an alias with the correct mangled name when
1696 defining a symbol with an incorrect mangled name. This switch
1697 specifies which ABI version to use for the alias.
1698
1699 With -fabi-version=0 (the default), this defaults to 8 (GCC 5
1700 compatibility). If another ABI version is explicitly selected,
1701 this defaults to 0. For compatibility with GCC versions 3.2
1702 through 4.9, use -fabi-compat-version=2.
1703
1704 If this option is not provided but -Wabi=n is, that version is used
1705 for compatibility aliases. If this option is provided along with
1706 -Wabi (without the version), the version from this option is used
1707 for the warning.
1708
1709 -fno-access-control
1710 Turn off all access checking. This switch is mainly useful for
1711 working around bugs in the access control code.
1712
1713 -faligned-new
1714 Enable support for C++17 "new" of types that require more alignment
1715 than "void* ::operator new(std::size_t)" provides. A numeric
1716 argument such as "-faligned-new=32" can be used to specify how much
1717 alignment (in bytes) is provided by that function, but few users
1718 will need to override the default of "alignof(std::max_align_t)".
1719
1720 -fcheck-new
1721 Check that the pointer returned by "operator new" is non-null
1722 before attempting to modify the storage allocated. This check is
1723 normally unnecessary because the C++ standard specifies that
1724 "operator new" only returns 0 if it is declared "throw()", in which
1725 case the compiler always checks the return value even without this
1726 option. In all other cases, when "operator new" has a non-empty
1727 exception specification, memory exhaustion is signalled by throwing
1728 "std::bad_alloc". See also new (nothrow).
1729
1730 -fconcepts
1731 Enable support for the C++ Extensions for Concepts Technical
1732 Specification, ISO 19217 (2015), which allows code like
1733
1734 template <class T> concept bool Addable = requires (T t) { t + t; };
1735 template <Addable T> T add (T a, T b) { return a + b; }
1736
1737 -fconstexpr-depth=n
1738 Set the maximum nested evaluation depth for C++11 constexpr
1739 functions to n. A limit is needed to detect endless recursion
1740 during constant expression evaluation. The minimum specified by
1741 the standard is 512.
1742
1743 -fconstexpr-loop-limit=n
1744 Set the maximum number of iterations for a loop in C++14 constexpr
1745 functions to n. A limit is needed to detect infinite loops during
1746 constant expression evaluation. The default is 262144 (1<<18).
1747
1748 -fdeduce-init-list
1749 Enable deduction of a template type parameter as
1750 "std::initializer_list" from a brace-enclosed initializer list,
1751 i.e.
1752
1753 template <class T> auto forward(T t) -> decltype (realfn (t))
1754 {
1755 return realfn (t);
1756 }
1757
1758 void f()
1759 {
1760 forward({1,2}); // call forward<std::initializer_list<int>>
1761 }
1762
1763 This deduction was implemented as a possible extension to the
1764 originally proposed semantics for the C++11 standard, but was not
1765 part of the final standard, so it is disabled by default. This
1766 option is deprecated, and may be removed in a future version of
1767 G++.
1768
1769 -ffriend-injection
1770 Inject friend functions into the enclosing namespace, so that they
1771 are visible outside the scope of the class in which they are
1772 declared. Friend functions were documented to work this way in the
1773 old Annotated C++ Reference Manual. However, in ISO C++ a friend
1774 function that is not declared in an enclosing scope can only be
1775 found using argument dependent lookup. GCC defaults to the
1776 standard behavior.
1777
1778 This option is for compatibility, and may be removed in a future
1779 release of G++.
1780
1781 -fno-elide-constructors
1782 The C++ standard allows an implementation to omit creating a
1783 temporary that is only used to initialize another object of the
1784 same type. Specifying this option disables that optimization, and
1785 forces G++ to call the copy constructor in all cases. This option
1786 also causes G++ to call trivial member functions which otherwise
1787 would be expanded inline.
1788
1789 In C++17, the compiler is required to omit these temporaries, but
1790 this option still affects trivial member functions.
1791
1792 -fno-enforce-eh-specs
1793 Don't generate code to check for violation of exception
1794 specifications at run time. This option violates the C++ standard,
1795 but may be useful for reducing code size in production builds, much
1796 like defining "NDEBUG". This does not give user code permission to
1797 throw exceptions in violation of the exception specifications; the
1798 compiler still optimizes based on the specifications, so throwing
1799 an unexpected exception results in undefined behavior at run time.
1800
1801 -fextern-tls-init
1802 -fno-extern-tls-init
1803 The C++11 and OpenMP standards allow "thread_local" and
1804 "threadprivate" variables to have dynamic (runtime) initialization.
1805 To support this, any use of such a variable goes through a wrapper
1806 function that performs any necessary initialization. When the use
1807 and definition of the variable are in the same translation unit,
1808 this overhead can be optimized away, but when the use is in a
1809 different translation unit there is significant overhead even if
1810 the variable doesn't actually need dynamic initialization. If the
1811 programmer can be sure that no use of the variable in a non-
1812 defining TU needs to trigger dynamic initialization (either because
1813 the variable is statically initialized, or a use of the variable in
1814 the defining TU will be executed before any uses in another TU),
1815 they can avoid this overhead with the -fno-extern-tls-init option.
1816
1817 On targets that support symbol aliases, the default is
1818 -fextern-tls-init. On targets that do not support symbol aliases,
1819 the default is -fno-extern-tls-init.
1820
1821 -ffor-scope
1822 -fno-for-scope
1823 If -ffor-scope is specified, the scope of variables declared in a
1824 for-init-statement is limited to the "for" loop itself, as
1825 specified by the C++ standard. If -fno-for-scope is specified, the
1826 scope of variables declared in a for-init-statement extends to the
1827 end of the enclosing scope, as was the case in old versions of G++,
1828 and other (traditional) implementations of C++.
1829
1830 If neither flag is given, the default is to follow the standard,
1831 but to allow and give a warning for old-style code that would
1832 otherwise be invalid, or have different behavior.
1833
1834 -fno-gnu-keywords
1835 Do not recognize "typeof" as a keyword, so that code can use this
1836 word as an identifier. You can use the keyword "__typeof__"
1837 instead. This option is implied by the strict ISO C++ dialects:
1838 -ansi, -std=c++98, -std=c++11, etc.
1839
1840 -fno-implicit-templates
1841 Never emit code for non-inline templates that are instantiated
1842 implicitly (i.e. by use); only emit code for explicit
1843 instantiations.
1844
1845 -fno-implicit-inline-templates
1846 Don't emit code for implicit instantiations of inline templates,
1847 either. The default is to handle inlines differently so that
1848 compiles with and without optimization need the same set of
1849 explicit instantiations.
1850
1851 -fno-implement-inlines
1852 To save space, do not emit out-of-line copies of inline functions
1853 controlled by "#pragma implementation". This causes linker errors
1854 if these functions are not inlined everywhere they are called.
1855
1856 -fms-extensions
1857 Disable Wpedantic warnings about constructs used in MFC, such as
1858 implicit int and getting a pointer to member function via non-
1859 standard syntax.
1860
1861 -fnew-inheriting-ctors
1862 Enable the P0136 adjustment to the semantics of C++11 constructor
1863 inheritance. This is part of C++17 but also considered to be a
1864 Defect Report against C++11 and C++14. This flag is enabled by
1865 default unless -fabi-version=10 or lower is specified.
1866
1867 -fnew-ttp-matching
1868 Enable the P0522 resolution to Core issue 150, template template
1869 parameters and default arguments: this allows a template with
1870 default template arguments as an argument for a template template
1871 parameter with fewer template parameters. This flag is enabled by
1872 default for -std=c++1z.
1873
1874 -fno-nonansi-builtins
1875 Disable built-in declarations of functions that are not mandated by
1876 ANSI/ISO C. These include "ffs", "alloca", "_exit", "index",
1877 "bzero", "conjf", and other related functions.
1878
1879 -fnothrow-opt
1880 Treat a "throw()" exception specification as if it were a
1881 "noexcept" specification to reduce or eliminate the text size
1882 overhead relative to a function with no exception specification.
1883 If the function has local variables of types with non-trivial
1884 destructors, the exception specification actually makes the
1885 function smaller because the EH cleanups for those variables can be
1886 optimized away. The semantic effect is that an exception thrown
1887 out of a function with such an exception specification results in a
1888 call to "terminate" rather than "unexpected".
1889
1890 -fno-operator-names
1891 Do not treat the operator name keywords "and", "bitand", "bitor",
1892 "compl", "not", "or" and "xor" as synonyms as keywords.
1893
1894 -fno-optional-diags
1895 Disable diagnostics that the standard says a compiler does not need
1896 to issue. Currently, the only such diagnostic issued by G++ is the
1897 one for a name having multiple meanings within a class.
1898
1899 -fpermissive
1900 Downgrade some diagnostics about nonconformant code from errors to
1901 warnings. Thus, using -fpermissive allows some nonconforming code
1902 to compile.
1903
1904 -fno-pretty-templates
1905 When an error message refers to a specialization of a function
1906 template, the compiler normally prints the signature of the
1907 template followed by the template arguments and any typedefs or
1908 typenames in the signature (e.g. "void f(T) [with T = int]" rather
1909 than "void f(int)") so that it's clear which template is involved.
1910 When an error message refers to a specialization of a class
1911 template, the compiler omits any template arguments that match the
1912 default template arguments for that template. If either of these
1913 behaviors make it harder to understand the error message rather
1914 than easier, you can use -fno-pretty-templates to disable them.
1915
1916 -frepo
1917 Enable automatic template instantiation at link time. This option
1918 also implies -fno-implicit-templates.
1919
1920 -fno-rtti
1921 Disable generation of information about every class with virtual
1922 functions for use by the C++ run-time type identification features
1923 ("dynamic_cast" and "typeid"). If you don't use those parts of the
1924 language, you can save some space by using this flag. Note that
1925 exception handling uses the same information, but G++ generates it
1926 as needed. The "dynamic_cast" operator can still be used for casts
1927 that do not require run-time type information, i.e. casts to "void
1928 *" or to unambiguous base classes.
1929
1930 -fsized-deallocation
1931 Enable the built-in global declarations
1932
1933 void operator delete (void *, std::size_t) noexcept;
1934 void operator delete[] (void *, std::size_t) noexcept;
1935
1936 as introduced in C++14. This is useful for user-defined
1937 replacement deallocation functions that, for example, use the size
1938 of the object to make deallocation faster. Enabled by default
1939 under -std=c++14 and above. The flag -Wsized-deallocation warns
1940 about places that might want to add a definition.
1941
1942 -fstrict-enums
1943 Allow the compiler to optimize using the assumption that a value of
1944 enumerated type can only be one of the values of the enumeration
1945 (as defined in the C++ standard; basically, a value that can be
1946 represented in the minimum number of bits needed to represent all
1947 the enumerators). This assumption may not be valid if the program
1948 uses a cast to convert an arbitrary integer value to the enumerated
1949 type.
1950
1951 -fstrong-eval-order
1952 Evaluate member access, array subscripting, and shift expressions
1953 in left-to-right order, and evaluate assignment in right-to-left
1954 order, as adopted for C++17. Enabled by default with -std=c++1z.
1955 -fstrong-eval-order=some enables just the ordering of member access
1956 and shift expressions, and is the default without -std=c++1z.
1957
1958 -ftemplate-backtrace-limit=n
1959 Set the maximum number of template instantiation notes for a single
1960 warning or error to n. The default value is 10.
1961
1962 -ftemplate-depth=n
1963 Set the maximum instantiation depth for template classes to n. A
1964 limit on the template instantiation depth is needed to detect
1965 endless recursions during template class instantiation. ANSI/ISO
1966 C++ conforming programs must not rely on a maximum depth greater
1967 than 17 (changed to 1024 in C++11). The default value is 900, as
1968 the compiler can run out of stack space before hitting 1024 in some
1969 situations.
1970
1971 -fno-threadsafe-statics
1972 Do not emit the extra code to use the routines specified in the C++
1973 ABI for thread-safe initialization of local statics. You can use
1974 this option to reduce code size slightly in code that doesn't need
1975 to be thread-safe.
1976
1977 -fuse-cxa-atexit
1978 Register destructors for objects with static storage duration with
1979 the "__cxa_atexit" function rather than the "atexit" function.
1980 This option is required for fully standards-compliant handling of
1981 static destructors, but only works if your C library supports
1982 "__cxa_atexit".
1983
1984 -fno-use-cxa-get-exception-ptr
1985 Don't use the "__cxa_get_exception_ptr" runtime routine. This
1986 causes "std::uncaught_exception" to be incorrect, but is necessary
1987 if the runtime routine is not available.
1988
1989 -fvisibility-inlines-hidden
1990 This switch declares that the user does not attempt to compare
1991 pointers to inline functions or methods where the addresses of the
1992 two functions are taken in different shared objects.
1993
1994 The effect of this is that GCC may, effectively, mark inline
1995 methods with "__attribute__ ((visibility ("hidden")))" so that they
1996 do not appear in the export table of a DSO and do not require a PLT
1997 indirection when used within the DSO. Enabling this option can
1998 have a dramatic effect on load and link times of a DSO as it
1999 massively reduces the size of the dynamic export table when the
2000 library makes heavy use of templates.
2001
2002 The behavior of this switch is not quite the same as marking the
2003 methods as hidden directly, because it does not affect static
2004 variables local to the function or cause the compiler to deduce
2005 that the function is defined in only one shared object.
2006
2007 You may mark a method as having a visibility explicitly to negate
2008 the effect of the switch for that method. For example, if you do
2009 want to compare pointers to a particular inline method, you might
2010 mark it as having default visibility. Marking the enclosing class
2011 with explicit visibility has no effect.
2012
2013 Explicitly instantiated inline methods are unaffected by this
2014 option as their linkage might otherwise cross a shared library
2015 boundary.
2016
2017 -fvisibility-ms-compat
2018 This flag attempts to use visibility settings to make GCC's C++
2019 linkage model compatible with that of Microsoft Visual Studio.
2020
2021 The flag makes these changes to GCC's linkage model:
2022
2023 1. It sets the default visibility to "hidden", like
2024 -fvisibility=hidden.
2025
2026 2. Types, but not their members, are not hidden by default.
2027
2028 3. The One Definition Rule is relaxed for types without explicit
2029 visibility specifications that are defined in more than one
2030 shared object: those declarations are permitted if they are
2031 permitted when this option is not used.
2032
2033 In new code it is better to use -fvisibility=hidden and export
2034 those classes that are intended to be externally visible.
2035 Unfortunately it is possible for code to rely, perhaps
2036 accidentally, on the Visual Studio behavior.
2037
2038 Among the consequences of these changes are that static data
2039 members of the same type with the same name but defined in
2040 different shared objects are different, so changing one does not
2041 change the other; and that pointers to function members defined in
2042 different shared objects may not compare equal. When this flag is
2043 given, it is a violation of the ODR to define types with the same
2044 name differently.
2045
2046 -fno-weak
2047 Do not use weak symbol support, even if it is provided by the
2048 linker. By default, G++ uses weak symbols if they are available.
2049 This option exists only for testing, and should not be used by end-
2050 users; it results in inferior code and has no benefits. This
2051 option may be removed in a future release of G++.
2052
2053 -nostdinc++
2054 Do not search for header files in the standard directories specific
2055 to C++, but do still search the other standard directories. (This
2056 option is used when building the C++ library.)
2057
2058 In addition, these optimization, warning, and code generation options
2059 have meanings only for C++ programs:
2060
2061 -Wabi (C, Objective-C, C++ and Objective-C++ only)
2062 Warn when G++ it generates code that is probably not compatible
2063 with the vendor-neutral C++ ABI. Since G++ now defaults to
2064 updating the ABI with each major release, normally -Wabi will warn
2065 only if there is a check added later in a release series for an ABI
2066 issue discovered since the initial release. -Wabi will warn about
2067 more things if an older ABI version is selected (with
2068 -fabi-version=n).
2069
2070 -Wabi can also be used with an explicit version number to warn
2071 about compatibility with a particular -fabi-version level, e.g.
2072 -Wabi=2 to warn about changes relative to -fabi-version=2.
2073
2074 If an explicit version number is provided and -fabi-compat-version
2075 is not specified, the version number from this option is used for
2076 compatibility aliases. If no explicit version number is provided
2077 with this option, but -fabi-compat-version is specified, that
2078 version number is used for ABI warnings.
2079
2080 Although an effort has been made to warn about all such cases,
2081 there are probably some cases that are not warned about, even
2082 though G++ is generating incompatible code. There may also be
2083 cases where warnings are emitted even though the code that is
2084 generated is compatible.
2085
2086 You should rewrite your code to avoid these warnings if you are
2087 concerned about the fact that code generated by G++ may not be
2088 binary compatible with code generated by other compilers.
2089
2090 Known incompatibilities in -fabi-version=2 (which was the default
2091 from GCC 3.4 to 4.9) include:
2092
2093 * A template with a non-type template parameter of reference type
2094 was mangled incorrectly:
2095
2096 extern int N;
2097 template <int &> struct S {};
2098 void n (S<N>) {2}
2099
2100 This was fixed in -fabi-version=3.
2101
2102 * SIMD vector types declared using "__attribute ((vector_size))"
2103 were mangled in a non-standard way that does not allow for
2104 overloading of functions taking vectors of different sizes.
2105
2106 The mangling was changed in -fabi-version=4.
2107
2108 * "__attribute ((const))" and "noreturn" were mangled as type
2109 qualifiers, and "decltype" of a plain declaration was folded
2110 away.
2111
2112 These mangling issues were fixed in -fabi-version=5.
2113
2114 * Scoped enumerators passed as arguments to a variadic function
2115 are promoted like unscoped enumerators, causing "va_arg" to
2116 complain. On most targets this does not actually affect the
2117 parameter passing ABI, as there is no way to pass an argument
2118 smaller than "int".
2119
2120 Also, the ABI changed the mangling of template argument packs,
2121 "const_cast", "static_cast", prefix increment/decrement, and a
2122 class scope function used as a template argument.
2123
2124 These issues were corrected in -fabi-version=6.
2125
2126 * Lambdas in default argument scope were mangled incorrectly, and
2127 the ABI changed the mangling of "nullptr_t".
2128
2129 These issues were corrected in -fabi-version=7.
2130
2131 * When mangling a function type with function-cv-qualifiers, the
2132 un-qualified function type was incorrectly treated as a
2133 substitution candidate.
2134
2135 This was fixed in -fabi-version=8, the default for GCC 5.1.
2136
2137 * "decltype(nullptr)" incorrectly had an alignment of 1, leading
2138 to unaligned accesses. Note that this did not affect the ABI
2139 of a function with a "nullptr_t" parameter, as parameters have
2140 a minimum alignment.
2141
2142 This was fixed in -fabi-version=9, the default for GCC 5.2.
2143
2144 * Target-specific attributes that affect the identity of a type,
2145 such as ia32 calling conventions on a function type (stdcall,
2146 regparm, etc.), did not affect the mangled name, leading to
2147 name collisions when function pointers were used as template
2148 arguments.
2149
2150 This was fixed in -fabi-version=10, the default for GCC 6.1.
2151
2152 It also warns about psABI-related changes. The known psABI changes
2153 at this point include:
2154
2155 * For SysV/x86-64, unions with "long double" members are passed
2156 in memory as specified in psABI. For example:
2157
2158 union U {
2159 long double ld;
2160 int i;
2161 };
2162
2163 "union U" is always passed in memory.
2164
2165 -Wabi-tag (C++ and Objective-C++ only)
2166 Warn when a type with an ABI tag is used in a context that does not
2167 have that ABI tag. See C++ Attributes for more information about
2168 ABI tags.
2169
2170 -Wctor-dtor-privacy (C++ and Objective-C++ only)
2171 Warn when a class seems unusable because all the constructors or
2172 destructors in that class are private, and it has neither friends
2173 nor public static member functions. Also warn if there are no non-
2174 private methods, and there's at least one private member function
2175 that isn't a constructor or destructor.
2176
2177 -Wdelete-non-virtual-dtor (C++ and Objective-C++ only)
2178 Warn when "delete" is used to destroy an instance of a class that
2179 has virtual functions and non-virtual destructor. It is unsafe to
2180 delete an instance of a derived class through a pointer to a base
2181 class if the base class does not have a virtual destructor. This
2182 warning is enabled by -Wall.
2183
2184 -Wliteral-suffix (C++ and Objective-C++ only)
2185 Warn when a string or character literal is followed by a ud-suffix
2186 which does not begin with an underscore. As a conforming
2187 extension, GCC treats such suffixes as separate preprocessing
2188 tokens in order to maintain backwards compatibility with code that
2189 uses formatting macros from "<inttypes.h>". For example:
2190
2191 #define __STDC_FORMAT_MACROS
2192 #include <inttypes.h>
2193 #include <stdio.h>
2194
2195 int main() {
2196 int64_t i64 = 123;
2197 printf("My int64: %" PRId64"\n", i64);
2198 }
2199
2200 In this case, "PRId64" is treated as a separate preprocessing
2201 token.
2202
2203 Additionally, warn when a user-defined literal operator is declared
2204 with a literal suffix identifier that doesn't begin with an
2205 underscore. Literal suffix identifiers that don't begin with an
2206 underscore are reserved for future standardization.
2207
2208 This warning is enabled by default.
2209
2210 -Wlto-type-mismatch
2211 During the link-time optimization warn about type mismatches in
2212 global declarations from different compilation units. Requires
2213 -flto to be enabled. Enabled by default.
2214
2215 -Wno-narrowing (C++ and Objective-C++ only)
2216 For C++11 and later standards, narrowing conversions are diagnosed
2217 by default, as required by the standard. A narrowing conversion
2218 from a constant produces an error, and a narrowing conversion from
2219 a non-constant produces a warning, but -Wno-narrowing suppresses
2220 the diagnostic. Note that this does not affect the meaning of
2221 well-formed code; narrowing conversions are still considered ill-
2222 formed in SFINAE contexts.
2223
2224 With -Wnarrowing in C++98, warn when a narrowing conversion
2225 prohibited by C++11 occurs within { }, e.g.
2226
2227 int i = { 2.2 }; // error: narrowing from double to int
2228
2229 This flag is included in -Wall and -Wc++11-compat.
2230
2231 -Wnoexcept (C++ and Objective-C++ only)
2232 Warn when a noexcept-expression evaluates to false because of a
2233 call to a function that does not have a non-throwing exception
2234 specification (i.e. "throw()" or "noexcept") but is known by the
2235 compiler to never throw an exception.
2236
2237 -Wnoexcept-type (C++ and Objective-C++ only)
2238 Warn if the C++1z feature making "noexcept" part of a function type
2239 changes the mangled name of a symbol relative to C++14. Enabled by
2240 -Wabi and -Wc++1z-compat.
2241
2242 template <class T> void f(T t) { t(); };
2243 void g() noexcept;
2244 void h() { f(g); } // in C++14 calls f<void(*)()>, in C++1z calls f<void(*)()noexcept>
2245
2246 -Wnon-virtual-dtor (C++ and Objective-C++ only)
2247 Warn when a class has virtual functions and an accessible non-
2248 virtual destructor itself or in an accessible polymorphic base
2249 class, in which case it is possible but unsafe to delete an
2250 instance of a derived class through a pointer to the class itself
2251 or base class. This warning is automatically enabled if -Weffc++
2252 is specified.
2253
2254 -Wregister (C++ and Objective-C++ only)
2255 Warn on uses of the "register" storage class specifier, except when
2256 it is part of the GNU Explicit Register Variables extension. The
2257 use of the "register" keyword as storage class specifier has been
2258 deprecated in C++11 and removed in C++17. Enabled by default with
2259 -std=c++1z.
2260
2261 -Wreorder (C++ and Objective-C++ only)
2262 Warn when the order of member initializers given in the code does
2263 not match the order in which they must be executed. For instance:
2264
2265 struct A {
2266 int i;
2267 int j;
2268 A(): j (0), i (1) { }
2269 };
2270
2271 The compiler rearranges the member initializers for "i" and "j" to
2272 match the declaration order of the members, emitting a warning to
2273 that effect. This warning is enabled by -Wall.
2274
2275 -fext-numeric-literals (C++ and Objective-C++ only)
2276 Accept imaginary, fixed-point, or machine-defined literal number
2277 suffixes as GNU extensions. When this option is turned off these
2278 suffixes are treated as C++11 user-defined literal numeric
2279 suffixes. This is on by default for all pre-C++11 dialects and all
2280 GNU dialects: -std=c++98, -std=gnu++98, -std=gnu++11, -std=gnu++14.
2281 This option is off by default for ISO C++11 onwards (-std=c++11,
2282 ...).
2283
2284 The following -W... options are not affected by -Wall.
2285
2286 -Weffc++ (C++ and Objective-C++ only)
2287 Warn about violations of the following style guidelines from Scott
2288 Meyers' Effective C++ series of books:
2289
2290 * Define a copy constructor and an assignment operator for
2291 classes with dynamically-allocated memory.
2292
2293 * Prefer initialization to assignment in constructors.
2294
2295 * Have "operator=" return a reference to *this.
2296
2297 * Don't try to return a reference when you must return an object.
2298
2299 * Distinguish between prefix and postfix forms of increment and
2300 decrement operators.
2301
2302 * Never overload "&&", "||", or ",".
2303
2304 This option also enables -Wnon-virtual-dtor, which is also one of
2305 the effective C++ recommendations. However, the check is extended
2306 to warn about the lack of virtual destructor in accessible non-
2307 polymorphic bases classes too.
2308
2309 When selecting this option, be aware that the standard library
2310 headers do not obey all of these guidelines; use grep -v to filter
2311 out those warnings.
2312
2313 -Wstrict-null-sentinel (C++ and Objective-C++ only)
2314 Warn about the use of an uncasted "NULL" as sentinel. When
2315 compiling only with GCC this is a valid sentinel, as "NULL" is
2316 defined to "__null". Although it is a null pointer constant rather
2317 than a null pointer, it is guaranteed to be of the same size as a
2318 pointer. But this use is not portable across different compilers.
2319
2320 -Wno-non-template-friend (C++ and Objective-C++ only)
2321 Disable warnings when non-template friend functions are declared
2322 within a template. In very old versions of GCC that predate
2323 implementation of the ISO standard, declarations such as friend int
2324 foo(int), where the name of the friend is an unqualified-id, could
2325 be interpreted as a particular specialization of a template
2326 function; the warning exists to diagnose compatibility problems,
2327 and is enabled by default.
2328
2329 -Wold-style-cast (C++ and Objective-C++ only)
2330 Warn if an old-style (C-style) cast to a non-void type is used
2331 within a C++ program. The new-style casts ("dynamic_cast",
2332 "static_cast", "reinterpret_cast", and "const_cast") are less
2333 vulnerable to unintended effects and much easier to search for.
2334
2335 -Woverloaded-virtual (C++ and Objective-C++ only)
2336 Warn when a function declaration hides virtual functions from a
2337 base class. For example, in:
2338
2339 struct A {
2340 virtual void f();
2341 };
2342
2343 struct B: public A {
2344 void f(int);
2345 };
2346
2347 the "A" class version of "f" is hidden in "B", and code like:
2348
2349 B* b;
2350 b->f();
2351
2352 fails to compile.
2353
2354 -Wno-pmf-conversions (C++ and Objective-C++ only)
2355 Disable the diagnostic for converting a bound pointer to member
2356 function to a plain pointer.
2357
2358 -Wsign-promo (C++ and Objective-C++ only)
2359 Warn when overload resolution chooses a promotion from unsigned or
2360 enumerated type to a signed type, over a conversion to an unsigned
2361 type of the same size. Previous versions of G++ tried to preserve
2362 unsignedness, but the standard mandates the current behavior.
2363
2364 -Wtemplates (C++ and Objective-C++ only)
2365 Warn when a primary template declaration is encountered. Some
2366 coding rules disallow templates, and this may be used to enforce
2367 that rule. The warning is inactive inside a system header file,
2368 such as the STL, so one can still use the STL. One may also
2369 instantiate or specialize templates.
2370
2371 -Wmultiple-inheritance (C++ and Objective-C++ only)
2372 Warn when a class is defined with multiple direct base classes.
2373 Some coding rules disallow multiple inheritance, and this may be
2374 used to enforce that rule. The warning is inactive inside a system
2375 header file, such as the STL, so one can still use the STL. One
2376 may also define classes that indirectly use multiple inheritance.
2377
2378 -Wvirtual-inheritance
2379 Warn when a class is defined with a virtual direct base class.
2380 Some coding rules disallow multiple inheritance, and this may be
2381 used to enforce that rule. The warning is inactive inside a system
2382 header file, such as the STL, so one can still use the STL. One
2383 may also define classes that indirectly use virtual inheritance.
2384
2385 -Wnamespaces
2386 Warn when a namespace definition is opened. Some coding rules
2387 disallow namespaces, and this may be used to enforce that rule.
2388 The warning is inactive inside a system header file, such as the
2389 STL, so one can still use the STL. One may also use using
2390 directives and qualified names.
2391
2392 -Wno-terminate (C++ and Objective-C++ only)
2393 Disable the warning about a throw-expression that will immediately
2394 result in a call to "terminate".
2395
2396 Options Controlling Objective-C and Objective-C++ Dialects
2397 (NOTE: This manual does not describe the Objective-C and Objective-C++
2398 languages themselves.
2399
2400 This section describes the command-line options that are only
2401 meaningful for Objective-C and Objective-C++ programs. You can also
2402 use most of the language-independent GNU compiler options. For
2403 example, you might compile a file some_class.m like this:
2404
2405 gcc -g -fgnu-runtime -O -c some_class.m
2406
2407 In this example, -fgnu-runtime is an option meant only for Objective-C
2408 and Objective-C++ programs; you can use the other options with any
2409 language supported by GCC.
2410
2411 Note that since Objective-C is an extension of the C language,
2412 Objective-C compilations may also use options specific to the C front-
2413 end (e.g., -Wtraditional). Similarly, Objective-C++ compilations may
2414 use C++-specific options (e.g., -Wabi).
2415
2416 Here is a list of options that are only for compiling Objective-C and
2417 Objective-C++ programs:
2418
2419 -fconstant-string-class=class-name
2420 Use class-name as the name of the class to instantiate for each
2421 literal string specified with the syntax "@"..."". The default
2422 class name is "NXConstantString" if the GNU runtime is being used,
2423 and "NSConstantString" if the NeXT runtime is being used (see
2424 below). The -fconstant-cfstrings option, if also present,
2425 overrides the -fconstant-string-class setting and cause "@"...""
2426 literals to be laid out as constant CoreFoundation strings.
2427
2428 -fgnu-runtime
2429 Generate object code compatible with the standard GNU Objective-C
2430 runtime. This is the default for most types of systems.
2431
2432 -fnext-runtime
2433 Generate output compatible with the NeXT runtime. This is the
2434 default for NeXT-based systems, including Darwin and Mac OS X. The
2435 macro "__NEXT_RUNTIME__" is predefined if (and only if) this option
2436 is used.
2437
2438 -fno-nil-receivers
2439 Assume that all Objective-C message dispatches ("[receiver
2440 message:arg]") in this translation unit ensure that the receiver is
2441 not "nil". This allows for more efficient entry points in the
2442 runtime to be used. This option is only available in conjunction
2443 with the NeXT runtime and ABI version 0 or 1.
2444
2445 -fobjc-abi-version=n
2446 Use version n of the Objective-C ABI for the selected runtime.
2447 This option is currently supported only for the NeXT runtime. In
2448 that case, Version 0 is the traditional (32-bit) ABI without
2449 support for properties and other Objective-C 2.0 additions.
2450 Version 1 is the traditional (32-bit) ABI with support for
2451 properties and other Objective-C 2.0 additions. Version 2 is the
2452 modern (64-bit) ABI. If nothing is specified, the default is
2453 Version 0 on 32-bit target machines, and Version 2 on 64-bit target
2454 machines.
2455
2456 -fobjc-call-cxx-cdtors
2457 For each Objective-C class, check if any of its instance variables
2458 is a C++ object with a non-trivial default constructor. If so,
2459 synthesize a special "- (id) .cxx_construct" instance method which
2460 runs non-trivial default constructors on any such instance
2461 variables, in order, and then return "self". Similarly, check if
2462 any instance variable is a C++ object with a non-trivial
2463 destructor, and if so, synthesize a special "- (void)
2464 .cxx_destruct" method which runs all such default destructors, in
2465 reverse order.
2466
2467 The "- (id) .cxx_construct" and "- (void) .cxx_destruct" methods
2468 thusly generated only operate on instance variables declared in the
2469 current Objective-C class, and not those inherited from
2470 superclasses. It is the responsibility of the Objective-C runtime
2471 to invoke all such methods in an object's inheritance hierarchy.
2472 The "- (id) .cxx_construct" methods are invoked by the runtime
2473 immediately after a new object instance is allocated; the "- (void)
2474 .cxx_destruct" methods are invoked immediately before the runtime
2475 deallocates an object instance.
2476
2477 As of this writing, only the NeXT runtime on Mac OS X 10.4 and
2478 later has support for invoking the "- (id) .cxx_construct" and "-
2479 (void) .cxx_destruct" methods.
2480
2481 -fobjc-direct-dispatch
2482 Allow fast jumps to the message dispatcher. On Darwin this is
2483 accomplished via the comm page.
2484
2485 -fobjc-exceptions
2486 Enable syntactic support for structured exception handling in
2487 Objective-C, similar to what is offered by C++. This option is
2488 required to use the Objective-C keywords @try, @throw, @catch,
2489 @finally and @synchronized. This option is available with both the
2490 GNU runtime and the NeXT runtime (but not available in conjunction
2491 with the NeXT runtime on Mac OS X 10.2 and earlier).
2492
2493 -fobjc-gc
2494 Enable garbage collection (GC) in Objective-C and Objective-C++
2495 programs. This option is only available with the NeXT runtime; the
2496 GNU runtime has a different garbage collection implementation that
2497 does not require special compiler flags.
2498
2499 -fobjc-nilcheck
2500 For the NeXT runtime with version 2 of the ABI, check for a nil
2501 receiver in method invocations before doing the actual method call.
2502 This is the default and can be disabled using -fno-objc-nilcheck.
2503 Class methods and super calls are never checked for nil in this way
2504 no matter what this flag is set to. Currently this flag does
2505 nothing when the GNU runtime, or an older version of the NeXT
2506 runtime ABI, is used.
2507
2508 -fobjc-std=objc1
2509 Conform to the language syntax of Objective-C 1.0, the language
2510 recognized by GCC 4.0. This only affects the Objective-C additions
2511 to the C/C++ language; it does not affect conformance to C/C++
2512 standards, which is controlled by the separate C/C++ dialect option
2513 flags. When this option is used with the Objective-C or
2514 Objective-C++ compiler, any Objective-C syntax that is not
2515 recognized by GCC 4.0 is rejected. This is useful if you need to
2516 make sure that your Objective-C code can be compiled with older
2517 versions of GCC.
2518
2519 -freplace-objc-classes
2520 Emit a special marker instructing ld(1) not to statically link in
2521 the resulting object file, and allow dyld(1) to load it in at run
2522 time instead. This is used in conjunction with the Fix-and-
2523 Continue debugging mode, where the object file in question may be
2524 recompiled and dynamically reloaded in the course of program
2525 execution, without the need to restart the program itself.
2526 Currently, Fix-and-Continue functionality is only available in
2527 conjunction with the NeXT runtime on Mac OS X 10.3 and later.
2528
2529 -fzero-link
2530 When compiling for the NeXT runtime, the compiler ordinarily
2531 replaces calls to "objc_getClass("...")" (when the name of the
2532 class is known at compile time) with static class references that
2533 get initialized at load time, which improves run-time performance.
2534 Specifying the -fzero-link flag suppresses this behavior and causes
2535 calls to "objc_getClass("...")" to be retained. This is useful in
2536 Zero-Link debugging mode, since it allows for individual class
2537 implementations to be modified during program execution. The GNU
2538 runtime currently always retains calls to "objc_get_class("...")"
2539 regardless of command-line options.
2540
2541 -fno-local-ivars
2542 By default instance variables in Objective-C can be accessed as if
2543 they were local variables from within the methods of the class
2544 they're declared in. This can lead to shadowing between instance
2545 variables and other variables declared either locally inside a
2546 class method or globally with the same name. Specifying the
2547 -fno-local-ivars flag disables this behavior thus avoiding variable
2548 shadowing issues.
2549
2550 -fivar-visibility=[public|protected|private|package]
2551 Set the default instance variable visibility to the specified
2552 option so that instance variables declared outside the scope of any
2553 access modifier directives default to the specified visibility.
2554
2555 -gen-decls
2556 Dump interface declarations for all classes seen in the source file
2557 to a file named sourcename.decl.
2558
2559 -Wassign-intercept (Objective-C and Objective-C++ only)
2560 Warn whenever an Objective-C assignment is being intercepted by the
2561 garbage collector.
2562
2563 -Wno-protocol (Objective-C and Objective-C++ only)
2564 If a class is declared to implement a protocol, a warning is issued
2565 for every method in the protocol that is not implemented by the
2566 class. The default behavior is to issue a warning for every method
2567 not explicitly implemented in the class, even if a method
2568 implementation is inherited from the superclass. If you use the
2569 -Wno-protocol option, then methods inherited from the superclass
2570 are considered to be implemented, and no warning is issued for
2571 them.
2572
2573 -Wselector (Objective-C and Objective-C++ only)
2574 Warn if multiple methods of different types for the same selector
2575 are found during compilation. The check is performed on the list
2576 of methods in the final stage of compilation. Additionally, a
2577 check is performed for each selector appearing in a
2578 "@selector(...)" expression, and a corresponding method for that
2579 selector has been found during compilation. Because these checks
2580 scan the method table only at the end of compilation, these
2581 warnings are not produced if the final stage of compilation is not
2582 reached, for example because an error is found during compilation,
2583 or because the -fsyntax-only option is being used.
2584
2585 -Wstrict-selector-match (Objective-C and Objective-C++ only)
2586 Warn if multiple methods with differing argument and/or return
2587 types are found for a given selector when attempting to send a
2588 message using this selector to a receiver of type "id" or "Class".
2589 When this flag is off (which is the default behavior), the compiler
2590 omits such warnings if any differences found are confined to types
2591 that share the same size and alignment.
2592
2593 -Wundeclared-selector (Objective-C and Objective-C++ only)
2594 Warn if a "@selector(...)" expression referring to an undeclared
2595 selector is found. A selector is considered undeclared if no
2596 method with that name has been declared before the "@selector(...)"
2597 expression, either explicitly in an @interface or @protocol
2598 declaration, or implicitly in an @implementation section. This
2599 option always performs its checks as soon as a "@selector(...)"
2600 expression is found, while -Wselector only performs its checks in
2601 the final stage of compilation. This also enforces the coding
2602 style convention that methods and selectors must be declared before
2603 being used.
2604
2605 -print-objc-runtime-info
2606 Generate C header describing the largest structure that is passed
2607 by value, if any.
2608
2609 Options to Control Diagnostic Messages Formatting
2610 Traditionally, diagnostic messages have been formatted irrespective of
2611 the output device's aspect (e.g. its width, ...). You can use the
2612 options described below to control the formatting algorithm for
2613 diagnostic messages, e.g. how many characters per line, how often
2614 source location information should be reported. Note that some
2615 language front ends may not honor these options.
2616
2617 -fmessage-length=n
2618 Try to format error messages so that they fit on lines of about n
2619 characters. If n is zero, then no line-wrapping is done; each
2620 error message appears on a single line. This is the default for
2621 all front ends.
2622
2623 -fdiagnostics-show-location=once
2624 Only meaningful in line-wrapping mode. Instructs the diagnostic
2625 messages reporter to emit source location information once; that
2626 is, in case the message is too long to fit on a single physical
2627 line and has to be wrapped, the source location won't be emitted
2628 (as prefix) again, over and over, in subsequent continuation lines.
2629 This is the default behavior.
2630
2631 -fdiagnostics-show-location=every-line
2632 Only meaningful in line-wrapping mode. Instructs the diagnostic
2633 messages reporter to emit the same source location information (as
2634 prefix) for physical lines that result from the process of breaking
2635 a message which is too long to fit on a single line.
2636
2637 -fdiagnostics-color[=WHEN]
2638 -fno-diagnostics-color
2639 Use color in diagnostics. WHEN is never, always, or auto. The
2640 default depends on how the compiler has been configured, it can be
2641 any of the above WHEN options or also never if GCC_COLORS
2642 environment variable isn't present in the environment, and auto
2643 otherwise. auto means to use color only when the standard error is
2644 a terminal. The forms -fdiagnostics-color and
2645 -fno-diagnostics-color are aliases for -fdiagnostics-color=always
2646 and -fdiagnostics-color=never, respectively.
2647
2648 The colors are defined by the environment variable GCC_COLORS. Its
2649 value is a colon-separated list of capabilities and Select Graphic
2650 Rendition (SGR) substrings. SGR commands are interpreted by the
2651 terminal or terminal emulator. (See the section in the
2652 documentation of your text terminal for permitted values and their
2653 meanings as character attributes.) These substring values are
2654 integers in decimal representation and can be concatenated with
2655 semicolons. Common values to concatenate include 1 for bold, 4 for
2656 underline, 5 for blink, 7 for inverse, 39 for default foreground
2657 color, 30 to 37 for foreground colors, 90 to 97 for 16-color mode
2658 foreground colors, 38;5;0 to 38;5;255 for 88-color and 256-color
2659 modes foreground colors, 49 for default background color, 40 to 47
2660 for background colors, 100 to 107 for 16-color mode background
2661 colors, and 48;5;0 to 48;5;255 for 88-color and 256-color modes
2662 background colors.
2663
2664 The default GCC_COLORS is
2665
2666 error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:\
2667 quote=01:fixit-insert=32:fixit-delete=31:\
2668 diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32
2669
2670 where 01;31 is bold red, 01;35 is bold magenta, 01;36 is bold cyan,
2671 32 is green, 34 is blue, 01 is bold, and 31 is red. Setting
2672 GCC_COLORS to the empty string disables colors. Supported
2673 capabilities are as follows.
2674
2675 "error="
2676 SGR substring for error: markers.
2677
2678 "warning="
2679 SGR substring for warning: markers.
2680
2681 "note="
2682 SGR substring for note: markers.
2683
2684 "range1="
2685 SGR substring for first additional range.
2686
2687 "range2="
2688 SGR substring for second additional range.
2689
2690 "locus="
2691 SGR substring for location information, file:line or
2692 file:line:column etc.
2693
2694 "quote="
2695 SGR substring for information printed within quotes.
2696
2697 "fixit-insert="
2698 SGR substring for fix-it hints suggesting text to be inserted
2699 or replaced.
2700
2701 "fixit-delete="
2702 SGR substring for fix-it hints suggesting text to be deleted.
2703
2704 "diff-filename="
2705 SGR substring for filename headers within generated patches.
2706
2707 "diff-hunk="
2708 SGR substring for the starts of hunks within generated patches.
2709
2710 "diff-delete="
2711 SGR substring for deleted lines within generated patches.
2712
2713 "diff-insert="
2714 SGR substring for inserted lines within generated patches.
2715
2716 -fno-diagnostics-show-option
2717 By default, each diagnostic emitted includes text indicating the
2718 command-line option that directly controls the diagnostic (if such
2719 an option is known to the diagnostic machinery). Specifying the
2720 -fno-diagnostics-show-option flag suppresses that behavior.
2721
2722 -fno-diagnostics-show-caret
2723 By default, each diagnostic emitted includes the original source
2724 line and a caret ^ indicating the column. This option suppresses
2725 this information. The source line is truncated to n characters, if
2726 the -fmessage-length=n option is given. When the output is done to
2727 the terminal, the width is limited to the width given by the
2728 COLUMNS environment variable or, if not set, to the terminal width.
2729
2730 -fdiagnostics-parseable-fixits
2731 Emit fix-it hints in a machine-parseable format, suitable for
2732 consumption by IDEs. For each fix-it, a line will be printed after
2733 the relevant diagnostic, starting with the string "fix-it:". For
2734 example:
2735
2736 fix-it:"test.c":{45:3-45:21}:"gtk_widget_show_all"
2737
2738 The location is expressed as a half-open range, expressed as a
2739 count of bytes, starting at byte 1 for the initial column. In the
2740 above example, bytes 3 through 20 of line 45 of "test.c" are to be
2741 replaced with the given string:
2742
2743 00000000011111111112222222222
2744 12345678901234567890123456789
2745 gtk_widget_showall (dlg);
2746 ^^^^^^^^^^^^^^^^^^
2747 gtk_widget_show_all
2748
2749 The filename and replacement string escape backslash as "\\", tab
2750 as "\t", newline as "\n", double quotes as "\"", non-printable
2751 characters as octal (e.g. vertical tab as "\013").
2752
2753 An empty replacement string indicates that the given range is to be
2754 removed. An empty range (e.g. "45:3-45:3") indicates that the
2755 string is to be inserted at the given position.
2756
2757 -fdiagnostics-generate-patch
2758 Print fix-it hints to stderr in unified diff format, after any
2759 diagnostics are printed. For example:
2760
2761 --- test.c
2762 +++ test.c
2763 @ -42,5 +42,5 @
2764
2765 void show_cb(GtkDialog *dlg)
2766 {
2767 - gtk_widget_showall(dlg);
2768 + gtk_widget_show_all(dlg);
2769 }
2770
2771 The diff may or may not be colorized, following the same rules as
2772 for diagnostics (see -fdiagnostics-color).
2773
2774 -fno-show-column
2775 Do not print column numbers in diagnostics. This may be necessary
2776 if diagnostics are being scanned by a program that does not
2777 understand the column numbers, such as dejagnu.
2778
2779 Options to Request or Suppress Warnings
2780 Warnings are diagnostic messages that report constructions that are not
2781 inherently erroneous but that are risky or suggest there may have been
2782 an error.
2783
2784 The following language-independent options do not enable specific
2785 warnings but control the kinds of diagnostics produced by GCC.
2786
2787 -fsyntax-only
2788 Check the code for syntax errors, but don't do anything beyond
2789 that.
2790
2791 -fmax-errors=n
2792 Limits the maximum number of error messages to n, at which point
2793 GCC bails out rather than attempting to continue processing the
2794 source code. If n is 0 (the default), there is no limit on the
2795 number of error messages produced. If -Wfatal-errors is also
2796 specified, then -Wfatal-errors takes precedence over this option.
2797
2798 -w Inhibit all warning messages.
2799
2800 -Werror
2801 Make all warnings into errors.
2802
2803 -Werror=
2804 Make the specified warning into an error. The specifier for a
2805 warning is appended; for example -Werror=switch turns the warnings
2806 controlled by -Wswitch into errors. This switch takes a negative
2807 form, to be used to negate -Werror for specific warnings; for
2808 example -Wno-error=switch makes -Wswitch warnings not be errors,
2809 even when -Werror is in effect.
2810
2811 The warning message for each controllable warning includes the
2812 option that controls the warning. That option can then be used
2813 with -Werror= and -Wno-error= as described above. (Printing of the
2814 option in the warning message can be disabled using the
2815 -fno-diagnostics-show-option flag.)
2816
2817 Note that specifying -Werror=foo automatically implies -Wfoo.
2818 However, -Wno-error=foo does not imply anything.
2819
2820 -Wfatal-errors
2821 This option causes the compiler to abort compilation on the first
2822 error occurred rather than trying to keep going and printing
2823 further error messages.
2824
2825 You can request many specific warnings with options beginning with -W,
2826 for example -Wimplicit to request warnings on implicit declarations.
2827 Each of these specific warning options also has a negative form
2828 beginning -Wno- to turn off warnings; for example, -Wno-implicit. This
2829 manual lists only one of the two forms, whichever is not the default.
2830 For further language-specific options also refer to C++ Dialect Options
2831 and Objective-C and Objective-C++ Dialect Options.
2832
2833 Some options, such as -Wall and -Wextra, turn on other options, such as
2834 -Wunused, which may turn on further options, such as -Wunused-value.
2835 The combined effect of positive and negative forms is that more
2836 specific options have priority over less specific ones, independently
2837 of their position in the command-line. For options of the same
2838 specificity, the last one takes effect. Options enabled or disabled via
2839 pragmas take effect as if they appeared at the end of the command-line.
2840
2841 When an unrecognized warning option is requested (e.g.,
2842 -Wunknown-warning), GCC emits a diagnostic stating that the option is
2843 not recognized. However, if the -Wno- form is used, the behavior is
2844 slightly different: no diagnostic is produced for -Wno-unknown-warning
2845 unless other diagnostics are being produced. This allows the use of
2846 new -Wno- options with old compilers, but if something goes wrong, the
2847 compiler warns that an unrecognized option is present.
2848
2849 -Wpedantic
2850 -pedantic
2851 Issue all the warnings demanded by strict ISO C and ISO C++; reject
2852 all programs that use forbidden extensions, and some other programs
2853 that do not follow ISO C and ISO C++. For ISO C, follows the
2854 version of the ISO C standard specified by any -std option used.
2855
2856 Valid ISO C and ISO C++ programs should compile properly with or
2857 without this option (though a rare few require -ansi or a -std
2858 option specifying the required version of ISO C). However, without
2859 this option, certain GNU extensions and traditional C and C++
2860 features are supported as well. With this option, they are
2861 rejected.
2862
2863 -Wpedantic does not cause warning messages for use of the alternate
2864 keywords whose names begin and end with __. Pedantic warnings are
2865 also disabled in the expression that follows "__extension__".
2866 However, only system header files should use these escape routes;
2867 application programs should avoid them.
2868
2869 Some users try to use -Wpedantic to check programs for strict ISO C
2870 conformance. They soon find that it does not do quite what they
2871 want: it finds some non-ISO practices, but not all---only those for
2872 which ISO C requires a diagnostic, and some others for which
2873 diagnostics have been added.
2874
2875 A feature to report any failure to conform to ISO C might be useful
2876 in some instances, but would require considerable additional work
2877 and would be quite different from -Wpedantic. We don't have plans
2878 to support such a feature in the near future.
2879
2880 Where the standard specified with -std represents a GNU extended
2881 dialect of C, such as gnu90 or gnu99, there is a corresponding base
2882 standard, the version of ISO C on which the GNU extended dialect is
2883 based. Warnings from -Wpedantic are given where they are required
2884 by the base standard. (It does not make sense for such warnings to
2885 be given only for features not in the specified GNU C dialect,
2886 since by definition the GNU dialects of C include all features the
2887 compiler supports with the given option, and there would be nothing
2888 to warn about.)
2889
2890 -pedantic-errors
2891 Give an error whenever the base standard (see -Wpedantic) requires
2892 a diagnostic, in some cases where there is undefined behavior at
2893 compile-time and in some other cases that do not prevent
2894 compilation of programs that are valid according to the standard.
2895 This is not equivalent to -Werror=pedantic, since there are errors
2896 enabled by this option and not enabled by the latter and vice
2897 versa.
2898
2899 -Wall
2900 This enables all the warnings about constructions that some users
2901 consider questionable, and that are easy to avoid (or modify to
2902 prevent the warning), even in conjunction with macros. This also
2903 enables some language-specific warnings described in C++ Dialect
2904 Options and Objective-C and Objective-C++ Dialect Options.
2905
2906 -Wall turns on the following warning flags:
2907
2908 -Waddress -Warray-bounds=1 (only with -O2) -Wbool-compare
2909 -Wbool-operation -Wc++11-compat -Wc++14-compat -Wchar-subscripts
2910 -Wcomment -Wduplicate-decl-specifier (C and Objective-C only)
2911 -Wenum-compare (in C/ObjC; this is on by default in C++) -Wformat
2912 -Wint-in-bool-context -Wimplicit (C and Objective-C only)
2913 -Wimplicit-int (C and Objective-C only)
2914 -Wimplicit-function-declaration (C and Objective-C only)
2915 -Winit-self (only for C++) -Wlogical-not-parentheses -Wmain (only
2916 for C/ObjC and unless -ffreestanding) -Wmaybe-uninitialized
2917 -Wmemset-elt-size -Wmemset-transposed-args -Wmisleading-indentation
2918 (only for C/C++) -Wmissing-braces (only for C/ObjC) -Wnarrowing
2919 (only for C++) -Wnonnull -Wnonnull-compare -Wopenmp-simd
2920 -Wparentheses -Wpointer-sign -Wreorder -Wreturn-type
2921 -Wsequence-point -Wsign-compare (only in C++)
2922 -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-overflow=1
2923 -Wswitch -Wtautological-compare -Wtrigraphs -Wuninitialized
2924 -Wunknown-pragmas -Wunused-function -Wunused-label -Wunused-value
2925 -Wunused-variable -Wvolatile-register-var
2926
2927 Note that some warning flags are not implied by -Wall. Some of
2928 them warn about constructions that users generally do not consider
2929 questionable, but which occasionally you might wish to check for;
2930 others warn about constructions that are necessary or hard to avoid
2931 in some cases, and there is no simple way to modify the code to
2932 suppress the warning. Some of them are enabled by -Wextra but many
2933 of them must be enabled individually.
2934
2935 -Wextra
2936 This enables some extra warning flags that are not enabled by
2937 -Wall. (This option used to be called -W. The older name is still
2938 supported, but the newer name is more descriptive.)
2939
2940 -Wclobbered -Wempty-body -Wignored-qualifiers
2941 -Wimplicit-fallthrough=3 -Wmissing-field-initializers
2942 -Wmissing-parameter-type (C only) -Wold-style-declaration (C only)
2943 -Woverride-init -Wsign-compare (C only) -Wtype-limits
2944 -Wuninitialized -Wshift-negative-value (in C++03 and in C99 and
2945 newer) -Wunused-parameter (only with -Wunused or -Wall)
2946 -Wunused-but-set-parameter (only with -Wunused or -Wall)
2947
2948 The option -Wextra also prints warning messages for the following
2949 cases:
2950
2951 * A pointer is compared against integer zero with "<", "<=", ">",
2952 or ">=".
2953
2954 * (C++ only) An enumerator and a non-enumerator both appear in a
2955 conditional expression.
2956
2957 * (C++ only) Ambiguous virtual bases.
2958
2959 * (C++ only) Subscripting an array that has been declared
2960 "register".
2961
2962 * (C++ only) Taking the address of a variable that has been
2963 declared "register".
2964
2965 * (C++ only) A base class is not initialized in the copy
2966 constructor of a derived class.
2967
2968 -Wchar-subscripts
2969 Warn if an array subscript has type "char". This is a common cause
2970 of error, as programmers often forget that this type is signed on
2971 some machines. This warning is enabled by -Wall.
2972
2973 -Wchkp
2974 Warn about an invalid memory access that is found by Pointer Bounds
2975 Checker (-fcheck-pointer-bounds).
2976
2977 -Wno-coverage-mismatch
2978 Warn if feedback profiles do not match when using the -fprofile-use
2979 option. If a source file is changed between compiling with
2980 -fprofile-gen and with -fprofile-use, the files with the profile
2981 feedback can fail to match the source file and GCC cannot use the
2982 profile feedback information. By default, this warning is enabled
2983 and is treated as an error. -Wno-coverage-mismatch can be used to
2984 disable the warning or -Wno-error=coverage-mismatch can be used to
2985 disable the error. Disabling the error for this warning can result
2986 in poorly optimized code and is useful only in the case of very
2987 minor changes such as bug fixes to an existing code-base.
2988 Completely disabling the warning is not recommended.
2989
2990 -Wno-cpp
2991 (C, Objective-C, C++, Objective-C++ and Fortran only)
2992
2993 Suppress warning messages emitted by "#warning" directives.
2994
2995 -Wdouble-promotion (C, C++, Objective-C and Objective-C++ only)
2996 Give a warning when a value of type "float" is implicitly promoted
2997 to "double". CPUs with a 32-bit "single-precision" floating-point
2998 unit implement "float" in hardware, but emulate "double" in
2999 software. On such a machine, doing computations using "double"
3000 values is much more expensive because of the overhead required for
3001 software emulation.
3002
3003 It is easy to accidentally do computations with "double" because
3004 floating-point literals are implicitly of type "double". For
3005 example, in:
3006
3007 float area(float radius)
3008 {
3009 return 3.14159 * radius * radius;
3010 }
3011
3012 the compiler performs the entire computation with "double" because
3013 the floating-point literal is a "double".
3014
3015 -Wduplicate-decl-specifier (C and Objective-C only)
3016 Warn if a declaration has duplicate "const", "volatile", "restrict"
3017 or "_Atomic" specifier. This warning is enabled by -Wall.
3018
3019 -Wformat
3020 -Wformat=n
3021 Check calls to "printf" and "scanf", etc., to make sure that the
3022 arguments supplied have types appropriate to the format string
3023 specified, and that the conversions specified in the format string
3024 make sense. This includes standard functions, and others specified
3025 by format attributes, in the "printf", "scanf", "strftime" and
3026 "strfmon" (an X/Open extension, not in the C standard) families (or
3027 other target-specific families). Which functions are checked
3028 without format attributes having been specified depends on the
3029 standard version selected, and such checks of functions without the
3030 attribute specified are disabled by -ffreestanding or -fno-builtin.
3031
3032 The formats are checked against the format features supported by
3033 GNU libc version 2.2. These include all ISO C90 and C99 features,
3034 as well as features from the Single Unix Specification and some BSD
3035 and GNU extensions. Other library implementations may not support
3036 all these features; GCC does not support warning about features
3037 that go beyond a particular library's limitations. However, if
3038 -Wpedantic is used with -Wformat, warnings are given about format
3039 features not in the selected standard version (but not for
3040 "strfmon" formats, since those are not in any version of the C
3041 standard).
3042
3043 -Wformat=1
3044 -Wformat
3045 Option -Wformat is equivalent to -Wformat=1, and -Wno-format is
3046 equivalent to -Wformat=0. Since -Wformat also checks for null
3047 format arguments for several functions, -Wformat also implies
3048 -Wnonnull. Some aspects of this level of format checking can
3049 be disabled by the options: -Wno-format-contains-nul,
3050 -Wno-format-extra-args, and -Wno-format-zero-length. -Wformat
3051 is enabled by -Wall.
3052
3053 -Wno-format-contains-nul
3054 If -Wformat is specified, do not warn about format strings that
3055 contain NUL bytes.
3056
3057 -Wno-format-extra-args
3058 If -Wformat is specified, do not warn about excess arguments to
3059 a "printf" or "scanf" format function. The C standard
3060 specifies that such arguments are ignored.
3061
3062 Where the unused arguments lie between used arguments that are
3063 specified with $ operand number specifications, normally
3064 warnings are still given, since the implementation could not
3065 know what type to pass to "va_arg" to skip the unused
3066 arguments. However, in the case of "scanf" formats, this
3067 option suppresses the warning if the unused arguments are all
3068 pointers, since the Single Unix Specification says that such
3069 unused arguments are allowed.
3070
3071 -Wformat-overflow
3072 -Wformat-overflow=level
3073 Warn about calls to formatted input/output functions such as
3074 "sprintf" and "vsprintf" that might overflow the destination
3075 buffer. When the exact number of bytes written by a format
3076 directive cannot be determined at compile-time it is estimated
3077 based on heuristics that depend on the level argument and on
3078 optimization. While enabling optimization will in most cases
3079 improve the accuracy of the warning, it may also result in
3080 false positives.
3081
3082 -Wformat-overflow
3083 -Wformat-overflow=1
3084 Level 1 of -Wformat-overflow enabled by -Wformat employs a
3085 conservative approach that warns only about calls that most
3086 likely overflow the buffer. At this level, numeric
3087 arguments to format directives with unknown values are
3088 assumed to have the value of one, and strings of unknown
3089 length to be empty. Numeric arguments that are known to be
3090 bounded to a subrange of their type, or string arguments
3091 whose output is bounded either by their directive's
3092 precision or by a finite set of string literals, are
3093 assumed to take on the value within the range that results
3094 in the most bytes on output. For example, the call to
3095 "sprintf" below is diagnosed because even with both a and b
3096 equal to zero, the terminating NUL character ('\0')
3097 appended by the function to the destination buffer will be
3098 written past its end. Increasing the size of the buffer by
3099 a single byte is sufficient to avoid the warning, though it
3100 may not be sufficient to avoid the overflow.
3101
3102 void f (int a, int b)
3103 {
3104 char buf [12];
3105 sprintf (buf, "a = %i, b = %i\n", a, b);
3106 }
3107
3108 -Wformat-overflow=2
3109 Level 2 warns also about calls that might overflow the
3110 destination buffer given an argument of sufficient length
3111 or magnitude. At level 2, unknown numeric arguments are
3112 assumed to have the minimum representable value for signed
3113 types with a precision greater than 1, and the maximum
3114 representable value otherwise. Unknown string arguments
3115 whose length cannot be assumed to be bounded either by the
3116 directive's precision, or by a finite set of string
3117 literals they may evaluate to, or the character array they
3118 may point to, are assumed to be 1 character long.
3119
3120 At level 2, the call in the example above is again
3121 diagnosed, but this time because with a equal to a 32-bit
3122 "INT_MIN" the first %i directive will write some of its
3123 digits beyond the end of the destination buffer. To make
3124 the call safe regardless of the values of the two
3125 variables, the size of the destination buffer must be
3126 increased to at least 34 bytes. GCC includes the minimum
3127 size of the buffer in an informational note following the
3128 warning.
3129
3130 An alternative to increasing the size of the destination
3131 buffer is to constrain the range of formatted values. The
3132 maximum length of string arguments can be bounded by
3133 specifying the precision in the format directive. When
3134 numeric arguments of format directives can be assumed to be
3135 bounded by less than the precision of their type, choosing
3136 an appropriate length modifier to the format specifier will
3137 reduce the required buffer size. For example, if a and b
3138 in the example above can be assumed to be within the
3139 precision of the "short int" type then using either the %hi
3140 format directive or casting the argument to "short" reduces
3141 the maximum required size of the buffer to 24 bytes.
3142
3143 void f (int a, int b)
3144 {
3145 char buf [23];
3146 sprintf (buf, "a = %hi, b = %i\n", a, (short)b);
3147 }
3148
3149 -Wno-format-zero-length
3150 If -Wformat is specified, do not warn about zero-length
3151 formats. The C standard specifies that zero-length formats are
3152 allowed.
3153
3154 -Wformat=2
3155 Enable -Wformat plus additional format checks. Currently
3156 equivalent to -Wformat -Wformat-nonliteral -Wformat-security
3157 -Wformat-y2k.
3158
3159 -Wformat-nonliteral
3160 If -Wformat is specified, also warn if the format string is not
3161 a string literal and so cannot be checked, unless the format
3162 function takes its format arguments as a "va_list".
3163
3164 -Wformat-security
3165 If -Wformat is specified, also warn about uses of format
3166 functions that represent possible security problems. At
3167 present, this warns about calls to "printf" and "scanf"
3168 functions where the format string is not a string literal and
3169 there are no format arguments, as in "printf (foo);". This may
3170 be a security hole if the format string came from untrusted
3171 input and contains %n. (This is currently a subset of what
3172 -Wformat-nonliteral warns about, but in future warnings may be
3173 added to -Wformat-security that are not included in
3174 -Wformat-nonliteral.)
3175
3176 -Wformat-signedness
3177 If -Wformat is specified, also warn if the format string
3178 requires an unsigned argument and the argument is signed and
3179 vice versa.
3180
3181 -Wformat-truncation
3182 -Wformat-truncation=level
3183 Warn about calls to formatted input/output functions such as
3184 "snprintf" and "vsnprintf" that might result in output
3185 truncation. When the exact number of bytes written by a format
3186 directive cannot be determined at compile-time it is estimated
3187 based on heuristics that depend on the level argument and on
3188 optimization. While enabling optimization will in most cases
3189 improve the accuracy of the warning, it may also result in
3190 false positives. Except as noted otherwise, the option uses
3191 the same logic -Wformat-overflow.
3192
3193 -Wformat-truncation
3194 -Wformat-truncation=1
3195 Level 1 of -Wformat-truncation enabled by -Wformat employs
3196 a conservative approach that warns only about calls to
3197 bounded functions whose return value is unused and that
3198 will most likely result in output truncation.
3199
3200 -Wformat-truncation=2
3201 Level 2 warns also about calls to bounded functions whose
3202 return value is used and that might result in truncation
3203 given an argument of sufficient length or magnitude.
3204
3205 -Wformat-y2k
3206 If -Wformat is specified, also warn about "strftime" formats
3207 that may yield only a two-digit year.
3208
3209 -Wnonnull
3210 Warn about passing a null pointer for arguments marked as requiring
3211 a non-null value by the "nonnull" function attribute.
3212
3213 -Wnonnull is included in -Wall and -Wformat. It can be disabled
3214 with the -Wno-nonnull option.
3215
3216 -Wnonnull-compare
3217 Warn when comparing an argument marked with the "nonnull" function
3218 attribute against null inside the function.
3219
3220 -Wnonnull-compare is included in -Wall. It can be disabled with
3221 the -Wno-nonnull-compare option.
3222
3223 -Wnull-dereference
3224 Warn if the compiler detects paths that trigger erroneous or
3225 undefined behavior due to dereferencing a null pointer. This
3226 option is only active when -fdelete-null-pointer-checks is active,
3227 which is enabled by optimizations in most targets. The precision
3228 of the warnings depends on the optimization options used.
3229
3230 -Winit-self (C, C++, Objective-C and Objective-C++ only)
3231 Warn about uninitialized variables that are initialized with
3232 themselves. Note this option can only be used with the
3233 -Wuninitialized option.
3234
3235 For example, GCC warns about "i" being uninitialized in the
3236 following snippet only when -Winit-self has been specified:
3237
3238 int f()
3239 {
3240 int i = i;
3241 return i;
3242 }
3243
3244 This warning is enabled by -Wall in C++.
3245
3246 -Wimplicit-int (C and Objective-C only)
3247 Warn when a declaration does not specify a type. This warning is
3248 enabled by -Wall.
3249
3250 -Wimplicit-function-declaration (C and Objective-C only)
3251 Give a warning whenever a function is used before being declared.
3252 In C99 mode (-std=c99 or -std=gnu99), this warning is enabled by
3253 default and it is made into an error by -pedantic-errors. This
3254 warning is also enabled by -Wall.
3255
3256 -Wimplicit (C and Objective-C only)
3257 Same as -Wimplicit-int and -Wimplicit-function-declaration. This
3258 warning is enabled by -Wall.
3259
3260 -Wimplicit-fallthrough
3261 -Wimplicit-fallthrough is the same as -Wimplicit-fallthrough=3 and
3262 -Wno-implicit-fallthrough is the same as -Wimplicit-fallthrough=0.
3263
3264 -Wimplicit-fallthrough=n
3265 Warn when a switch case falls through. For example:
3266
3267 switch (cond)
3268 {
3269 case 1:
3270 a = 1;
3271 break;
3272 case 2:
3273 a = 2;
3274 case 3:
3275 a = 3;
3276 break;
3277 }
3278
3279 This warning does not warn when the last statement of a case cannot
3280 fall through, e.g. when there is a return statement or a call to
3281 function declared with the noreturn attribute.
3282 -Wimplicit-fallthrough= also takes into account control flow
3283 statements, such as ifs, and only warns when appropriate. E.g.
3284
3285 switch (cond)
3286 {
3287 case 1:
3288 if (i > 3) {
3289 bar (5);
3290 break;
3291 } else if (i < 1) {
3292 bar (0);
3293 } else
3294 return;
3295 default:
3296 ...
3297 }
3298
3299 Since there are occasions where a switch case fall through is
3300 desirable, GCC provides an attribute, "__attribute__
3301 ((fallthrough))", that is to be used along with a null statement to
3302 suppress this warning that would normally occur:
3303
3304 switch (cond)
3305 {
3306 case 1:
3307 bar (0);
3308 __attribute__ ((fallthrough));
3309 default:
3310 ...
3311 }
3312
3313 C++17 provides a standard way to suppress the
3314 -Wimplicit-fallthrough warning using "[[fallthrough]];" instead of
3315 the GNU attribute. In C++11 or C++14 users can use
3316 "[[gnu::fallthrough]];", which is a GNU extension. Instead of the
3317 these attributes, it is also possible to add a fallthrough comment
3318 to silence the warning. The whole body of the C or C++ style
3319 comment should match the given regular expressions listed below.
3320 The option argument n specifies what kind of comments are accepted:
3321
3322 *<-Wimplicit-fallthrough=0 disables the warning altogether.>
3323 *<-Wimplicit-fallthrough=1 matches ".*" regular>
3324 expression, any comment is used as fallthrough comment.
3325
3326 *<-Wimplicit-fallthrough=2 case insensitively matches>
3327 ".*falls?[ \t-]*thr(ough|u).*" regular expression.
3328
3329 *<-Wimplicit-fallthrough=3 case sensitively matches one of the>
3330 following regular expressions:
3331
3332 *<"-fallthrough">
3333 *<"@fallthrough@">
3334 *<"lint -fallthrough[ \t]*">
3335 *<"[ \t.!]*(ELSE,? |INTENTIONAL(LY)? )?FALL(S |
3336 |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?">
3337 *<"[ \t.!]*(Else,? |Intentional(ly)? )?Fall((s |
3338 |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?">
3339 *<"[ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?fall(s |
3340 |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?">
3341 *<-Wimplicit-fallthrough=4 case sensitively matches one of the>
3342 following regular expressions:
3343
3344 *<"-fallthrough">
3345 *<"@fallthrough@">
3346 *<"lint -fallthrough[ \t]*">
3347 *<"[ \t]*FALLTHR(OUGH|U)[ \t]*">
3348 *<-Wimplicit-fallthrough=5 doesn't recognize any comments as>
3349 fallthrough comments, only attributes disable the warning.
3350
3351 The comment needs to be followed after optional whitespace and
3352 other comments by "case" or "default" keywords or by a user label
3353 that precedes some "case" or "default" label.
3354
3355 switch (cond)
3356 {
3357 case 1:
3358 bar (0);
3359 /* FALLTHRU */
3360 default:
3361 ...
3362 }
3363
3364 The -Wimplicit-fallthrough=3 warning is enabled by -Wextra.
3365
3366 -Wignored-qualifiers (C and C++ only)
3367 Warn if the return type of a function has a type qualifier such as
3368 "const". For ISO C such a type qualifier has no effect, since the
3369 value returned by a function is not an lvalue. For C++, the
3370 warning is only emitted for scalar types or "void". ISO C
3371 prohibits qualified "void" return types on function definitions, so
3372 such return types always receive a warning even without this
3373 option.
3374
3375 This warning is also enabled by -Wextra.
3376
3377 -Wignored-attributes (C and C++ only)
3378 Warn when an attribute is ignored. This is different from the
3379 -Wattributes option in that it warns whenever the compiler decides
3380 to drop an attribute, not that the attribute is either unknown,
3381 used in a wrong place, etc. This warning is enabled by default.
3382
3383 -Wmain
3384 Warn if the type of "main" is suspicious. "main" should be a
3385 function with external linkage, returning int, taking either zero
3386 arguments, two, or three arguments of appropriate types. This
3387 warning is enabled by default in C++ and is enabled by either -Wall
3388 or -Wpedantic.
3389
3390 -Wmisleading-indentation (C and C++ only)
3391 Warn when the indentation of the code does not reflect the block
3392 structure. Specifically, a warning is issued for "if", "else",
3393 "while", and "for" clauses with a guarded statement that does not
3394 use braces, followed by an unguarded statement with the same
3395 indentation.
3396
3397 In the following example, the call to "bar" is misleadingly
3398 indented as if it were guarded by the "if" conditional.
3399
3400 if (some_condition ())
3401 foo ();
3402 bar (); /* Gotcha: this is not guarded by the "if". */
3403
3404 In the case of mixed tabs and spaces, the warning uses the
3405 -ftabstop= option to determine if the statements line up
3406 (defaulting to 8).
3407
3408 The warning is not issued for code involving multiline preprocessor
3409 logic such as the following example.
3410
3411 if (flagA)
3412 foo (0);
3413 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
3414 if (flagB)
3415 #endif
3416 foo (1);
3417
3418 The warning is not issued after a "#line" directive, since this
3419 typically indicates autogenerated code, and no assumptions can be
3420 made about the layout of the file that the directive references.
3421
3422 This warning is enabled by -Wall in C and C++.
3423
3424 -Wmissing-braces
3425 Warn if an aggregate or union initializer is not fully bracketed.
3426 In the following example, the initializer for "a" is not fully
3427 bracketed, but that for "b" is fully bracketed. This warning is
3428 enabled by -Wall in C.
3429
3430 int a[2][2] = { 0, 1, 2, 3 };
3431 int b[2][2] = { { 0, 1 }, { 2, 3 } };
3432
3433 This warning is enabled by -Wall.
3434
3435 -Wmissing-include-dirs (C, C++, Objective-C and Objective-C++ only)
3436 Warn if a user-supplied include directory does not exist.
3437
3438 -Wparentheses
3439 Warn if parentheses are omitted in certain contexts, such as when
3440 there is an assignment in a context where a truth value is
3441 expected, or when operators are nested whose precedence people
3442 often get confused about.
3443
3444 Also warn if a comparison like "x<=y<=z" appears; this is
3445 equivalent to "(x<=y ? 1 : 0) <= z", which is a different
3446 interpretation from that of ordinary mathematical notation.
3447
3448 Also warn for dangerous uses of the GNU extension to "?:" with
3449 omitted middle operand. When the condition in the "?": operator is
3450 a boolean expression, the omitted value is always 1. Often
3451 programmers expect it to be a value computed inside the conditional
3452 expression instead.
3453
3454 This warning is enabled by -Wall.
3455
3456 -Wsequence-point
3457 Warn about code that may have undefined semantics because of
3458 violations of sequence point rules in the C and C++ standards.
3459
3460 The C and C++ standards define the order in which expressions in a
3461 C/C++ program are evaluated in terms of sequence points, which
3462 represent a partial ordering between the execution of parts of the
3463 program: those executed before the sequence point, and those
3464 executed after it. These occur after the evaluation of a full
3465 expression (one which is not part of a larger expression), after
3466 the evaluation of the first operand of a "&&", "||", "? :" or ","
3467 (comma) operator, before a function is called (but after the
3468 evaluation of its arguments and the expression denoting the called
3469 function), and in certain other places. Other than as expressed by
3470 the sequence point rules, the order of evaluation of subexpressions
3471 of an expression is not specified. All these rules describe only a
3472 partial order rather than a total order, since, for example, if two
3473 functions are called within one expression with no sequence point
3474 between them, the order in which the functions are called is not
3475 specified. However, the standards committee have ruled that
3476 function calls do not overlap.
3477
3478 It is not specified when between sequence points modifications to
3479 the values of objects take effect. Programs whose behavior depends
3480 on this have undefined behavior; the C and C++ standards specify
3481 that "Between the previous and next sequence point an object shall
3482 have its stored value modified at most once by the evaluation of an
3483 expression. Furthermore, the prior value shall be read only to
3484 determine the value to be stored.". If a program breaks these
3485 rules, the results on any particular implementation are entirely
3486 unpredictable.
3487
3488 Examples of code with undefined behavior are "a = a++;", "a[n] =
3489 b[n++]" and "a[i++] = i;". Some more complicated cases are not
3490 diagnosed by this option, and it may give an occasional false
3491 positive result, but in general it has been found fairly effective
3492 at detecting this sort of problem in programs.
3493
3494 The C++17 standard will define the order of evaluation of operands
3495 in more cases: in particular it requires that the right-hand side
3496 of an assignment be evaluated before the left-hand side, so the
3497 above examples are no longer undefined. But this warning will
3498 still warn about them, to help people avoid writing code that is
3499 undefined in C and earlier revisions of C++.
3500
3501 The standard is worded confusingly, therefore there is some debate
3502 over the precise meaning of the sequence point rules in subtle
3503 cases. Links to discussions of the problem, including proposed
3504 formal definitions, may be found on the GCC readings page, at
3505 <http://gcc.gnu.org/readings.html>.
3506
3507 This warning is enabled by -Wall for C and C++.
3508
3509 -Wno-return-local-addr
3510 Do not warn about returning a pointer (or in C++, a reference) to a
3511 variable that goes out of scope after the function returns.
3512
3513 -Wreturn-type
3514 Warn whenever a function is defined with a return type that
3515 defaults to "int". Also warn about any "return" statement with no
3516 return value in a function whose return type is not "void" (falling
3517 off the end of the function body is considered returning without a
3518 value).
3519
3520 For C only, warn about a "return" statement with an expression in a
3521 function whose return type is "void", unless the expression type is
3522 also "void". As a GNU extension, the latter case is accepted
3523 without a warning unless -Wpedantic is used.
3524
3525 For C++, a function without return type always produces a
3526 diagnostic message, even when -Wno-return-type is specified. The
3527 only exceptions are "main" and functions defined in system headers.
3528
3529 This warning is enabled by -Wall.
3530
3531 -Wshift-count-negative
3532 Warn if shift count is negative. This warning is enabled by
3533 default.
3534
3535 -Wshift-count-overflow
3536 Warn if shift count >= width of type. This warning is enabled by
3537 default.
3538
3539 -Wshift-negative-value
3540 Warn if left shifting a negative value. This warning is enabled by
3541 -Wextra in C99 and C++11 modes (and newer).
3542
3543 -Wshift-overflow
3544 -Wshift-overflow=n
3545 Warn about left shift overflows. This warning is enabled by
3546 default in C99 and C++11 modes (and newer).
3547
3548 -Wshift-overflow=1
3549 This is the warning level of -Wshift-overflow and is enabled by
3550 default in C99 and C++11 modes (and newer). This warning level
3551 does not warn about left-shifting 1 into the sign bit.
3552 (However, in C, such an overflow is still rejected in contexts
3553 where an integer constant expression is required.)
3554
3555 -Wshift-overflow=2
3556 This warning level also warns about left-shifting 1 into the
3557 sign bit, unless C++14 mode is active.
3558
3559 -Wswitch
3560 Warn whenever a "switch" statement has an index of enumerated type
3561 and lacks a "case" for one or more of the named codes of that
3562 enumeration. (The presence of a "default" label prevents this
3563 warning.) "case" labels outside the enumeration range also provoke
3564 warnings when this option is used (even if there is a "default"
3565 label). This warning is enabled by -Wall.
3566
3567 -Wswitch-default
3568 Warn whenever a "switch" statement does not have a "default" case.
3569
3570 -Wswitch-enum
3571 Warn whenever a "switch" statement has an index of enumerated type
3572 and lacks a "case" for one or more of the named codes of that
3573 enumeration. "case" labels outside the enumeration range also
3574 provoke warnings when this option is used. The only difference
3575 between -Wswitch and this option is that this option gives a
3576 warning about an omitted enumeration code even if there is a
3577 "default" label.
3578
3579 -Wswitch-bool
3580 Warn whenever a "switch" statement has an index of boolean type and
3581 the case values are outside the range of a boolean type. It is
3582 possible to suppress this warning by casting the controlling
3583 expression to a type other than "bool". For example:
3584
3585 switch ((int) (a == 4))
3586 {
3587 ...
3588 }
3589
3590 This warning is enabled by default for C and C++ programs.
3591
3592 -Wswitch-unreachable
3593 Warn whenever a "switch" statement contains statements between the
3594 controlling expression and the first case label, which will never
3595 be executed. For example:
3596
3597 switch (cond)
3598 {
3599 i = 15;
3600 ...
3601 case 5:
3602 ...
3603 }
3604
3605 -Wswitch-unreachable does not warn if the statement between the
3606 controlling expression and the first case label is just a
3607 declaration:
3608
3609 switch (cond)
3610 {
3611 int i;
3612 ...
3613 case 5:
3614 i = 5;
3615 ...
3616 }
3617
3618 This warning is enabled by default for C and C++ programs.
3619
3620 -Wsync-nand (C and C++ only)
3621 Warn when "__sync_fetch_and_nand" and "__sync_nand_and_fetch"
3622 built-in functions are used. These functions changed semantics in
3623 GCC 4.4.
3624
3625 -Wunused-but-set-parameter
3626 Warn whenever a function parameter is assigned to, but otherwise
3627 unused (aside from its declaration).
3628
3629 To suppress this warning use the "unused" attribute.
3630
3631 This warning is also enabled by -Wunused together with -Wextra.
3632
3633 -Wunused-but-set-variable
3634 Warn whenever a local variable is assigned to, but otherwise unused
3635 (aside from its declaration). This warning is enabled by -Wall.
3636
3637 To suppress this warning use the "unused" attribute.
3638
3639 This warning is also enabled by -Wunused, which is enabled by
3640 -Wall.
3641
3642 -Wunused-function
3643 Warn whenever a static function is declared but not defined or a
3644 non-inline static function is unused. This warning is enabled by
3645 -Wall.
3646
3647 -Wunused-label
3648 Warn whenever a label is declared but not used. This warning is
3649 enabled by -Wall.
3650
3651 To suppress this warning use the "unused" attribute.
3652
3653 -Wunused-local-typedefs (C, Objective-C, C++ and Objective-C++ only)
3654 Warn when a typedef locally defined in a function is not used.
3655 This warning is enabled by -Wall.
3656
3657 -Wunused-parameter
3658 Warn whenever a function parameter is unused aside from its
3659 declaration.
3660
3661 To suppress this warning use the "unused" attribute.
3662
3663 -Wno-unused-result
3664 Do not warn if a caller of a function marked with attribute
3665 "warn_unused_result" does not use its return value. The default is
3666 -Wunused-result.
3667
3668 -Wunused-variable
3669 Warn whenever a local or static variable is unused aside from its
3670 declaration. This option implies -Wunused-const-variable=1 for C,
3671 but not for C++. This warning is enabled by -Wall.
3672
3673 To suppress this warning use the "unused" attribute.
3674
3675 -Wunused-const-variable
3676 -Wunused-const-variable=n
3677 Warn whenever a constant static variable is unused aside from its
3678 declaration. -Wunused-const-variable=1 is enabled by
3679 -Wunused-variable for C, but not for C++. In C this declares
3680 variable storage, but in C++ this is not an error since const
3681 variables take the place of "#define"s.
3682
3683 To suppress this warning use the "unused" attribute.
3684
3685 -Wunused-const-variable=1
3686 This is the warning level that is enabled by -Wunused-variable
3687 for C. It warns only about unused static const variables
3688 defined in the main compilation unit, but not about static
3689 const variables declared in any header included.
3690
3691 -Wunused-const-variable=2
3692 This warning level also warns for unused constant static
3693 variables in headers (excluding system headers). This is the
3694 warning level of -Wunused-const-variable and must be explicitly
3695 requested since in C++ this isn't an error and in C it might be
3696 harder to clean up all headers included.
3697
3698 -Wunused-value
3699 Warn whenever a statement computes a result that is explicitly not
3700 used. To suppress this warning cast the unused expression to
3701 "void". This includes an expression-statement or the left-hand side
3702 of a comma expression that contains no side effects. For example,
3703 an expression such as "x[i,j]" causes a warning, while
3704 "x[(void)i,j]" does not.
3705
3706 This warning is enabled by -Wall.
3707
3708 -Wunused
3709 All the above -Wunused options combined.
3710
3711 In order to get a warning about an unused function parameter, you
3712 must either specify -Wextra -Wunused (note that -Wall implies
3713 -Wunused), or separately specify -Wunused-parameter.
3714
3715 -Wuninitialized
3716 Warn if an automatic variable is used without first being
3717 initialized or if a variable may be clobbered by a "setjmp" call.
3718 In C++, warn if a non-static reference or non-static "const" member
3719 appears in a class without constructors.
3720
3721 If you want to warn about code that uses the uninitialized value of
3722 the variable in its own initializer, use the -Winit-self option.
3723
3724 These warnings occur for individual uninitialized or clobbered
3725 elements of structure, union or array variables as well as for
3726 variables that are uninitialized or clobbered as a whole. They do
3727 not occur for variables or elements declared "volatile". Because
3728 these warnings depend on optimization, the exact variables or
3729 elements for which there are warnings depends on the precise
3730 optimization options and version of GCC used.
3731
3732 Note that there may be no warning about a variable that is used
3733 only to compute a value that itself is never used, because such
3734 computations may be deleted by data flow analysis before the
3735 warnings are printed.
3736
3737 -Winvalid-memory-model
3738 Warn for invocations of __atomic Builtins, __sync Builtins, and the
3739 C11 atomic generic functions with a memory consistency argument
3740 that is either invalid for the operation or outside the range of
3741 values of the "memory_order" enumeration. For example, since the
3742 "__atomic_store" and "__atomic_store_n" built-ins are only defined
3743 for the relaxed, release, and sequentially consistent memory orders
3744 the following code is diagnosed:
3745
3746 void store (int *i)
3747 {
3748 __atomic_store_n (i, 0, memory_order_consume);
3749 }
3750
3751 -Winvalid-memory-model is enabled by default.
3752
3753 -Wmaybe-uninitialized
3754 For an automatic variable, if there exists a path from the function
3755 entry to a use of the variable that is initialized, but there exist
3756 some other paths for which the variable is not initialized, the
3757 compiler emits a warning if it cannot prove the uninitialized paths
3758 are not executed at run time. These warnings are made optional
3759 because GCC is not smart enough to see all the reasons why the code
3760 might be correct in spite of appearing to have an error. Here is
3761 one example of how this can happen:
3762
3763 {
3764 int x;
3765 switch (y)
3766 {
3767 case 1: x = 1;
3768 break;
3769 case 2: x = 4;
3770 break;
3771 case 3: x = 5;
3772 }
3773 foo (x);
3774 }
3775
3776 If the value of "y" is always 1, 2 or 3, then "x" is always
3777 initialized, but GCC doesn't know this. To suppress the warning,
3778 you need to provide a default case with assert(0) or similar code.
3779
3780 This option also warns when a non-volatile automatic variable might
3781 be changed by a call to "longjmp". These warnings as well are
3782 possible only in optimizing compilation.
3783
3784 The compiler sees only the calls to "setjmp". It cannot know where
3785 "longjmp" will be called; in fact, a signal handler could call it
3786 at any point in the code. As a result, you may get a warning even
3787 when there is in fact no problem because "longjmp" cannot in fact
3788 be called at the place that would cause a problem.
3789
3790 Some spurious warnings can be avoided if you declare all the
3791 functions you use that never return as "noreturn".
3792
3793 This warning is enabled by -Wall or -Wextra.
3794
3795 -Wunknown-pragmas
3796 Warn when a "#pragma" directive is encountered that is not
3797 understood by GCC. If this command-line option is used, warnings
3798 are even issued for unknown pragmas in system header files. This
3799 is not the case if the warnings are only enabled by the -Wall
3800 command-line option.
3801
3802 -Wno-pragmas
3803 Do not warn about misuses of pragmas, such as incorrect parameters,
3804 invalid syntax, or conflicts between pragmas. See also
3805 -Wunknown-pragmas.
3806
3807 -Wstrict-aliasing
3808 This option is only active when -fstrict-aliasing is active. It
3809 warns about code that might break the strict aliasing rules that
3810 the compiler is using for optimization. The warning does not catch
3811 all cases, but does attempt to catch the more common pitfalls. It
3812 is included in -Wall. It is equivalent to -Wstrict-aliasing=3
3813
3814 -Wstrict-aliasing=n
3815 This option is only active when -fstrict-aliasing is active. It
3816 warns about code that might break the strict aliasing rules that
3817 the compiler is using for optimization. Higher levels correspond
3818 to higher accuracy (fewer false positives). Higher levels also
3819 correspond to more effort, similar to the way -O works.
3820 -Wstrict-aliasing is equivalent to -Wstrict-aliasing=3.
3821
3822 Level 1: Most aggressive, quick, least accurate. Possibly useful
3823 when higher levels do not warn but -fstrict-aliasing still breaks
3824 the code, as it has very few false negatives. However, it has many
3825 false positives. Warns for all pointer conversions between
3826 possibly incompatible types, even if never dereferenced. Runs in
3827 the front end only.
3828
3829 Level 2: Aggressive, quick, not too precise. May still have many
3830 false positives (not as many as level 1 though), and few false
3831 negatives (but possibly more than level 1). Unlike level 1, it
3832 only warns when an address is taken. Warns about incomplete types.
3833 Runs in the front end only.
3834
3835 Level 3 (default for -Wstrict-aliasing): Should have very few false
3836 positives and few false negatives. Slightly slower than levels 1
3837 or 2 when optimization is enabled. Takes care of the common
3838 pun+dereference pattern in the front end: "*(int*)&some_float". If
3839 optimization is enabled, it also runs in the back end, where it
3840 deals with multiple statement cases using flow-sensitive points-to
3841 information. Only warns when the converted pointer is
3842 dereferenced. Does not warn about incomplete types.
3843
3844 -Wstrict-overflow
3845 -Wstrict-overflow=n
3846 This option is only active when -fstrict-overflow is active. It
3847 warns about cases where the compiler optimizes based on the
3848 assumption that signed overflow does not occur. Note that it does
3849 not warn about all cases where the code might overflow: it only
3850 warns about cases where the compiler implements some optimization.
3851 Thus this warning depends on the optimization level.
3852
3853 An optimization that assumes that signed overflow does not occur is
3854 perfectly safe if the values of the variables involved are such
3855 that overflow never does, in fact, occur. Therefore this warning
3856 can easily give a false positive: a warning about code that is not
3857 actually a problem. To help focus on important issues, several
3858 warning levels are defined. No warnings are issued for the use of
3859 undefined signed overflow when estimating how many iterations a
3860 loop requires, in particular when determining whether a loop will
3861 be executed at all.
3862
3863 -Wstrict-overflow=1
3864 Warn about cases that are both questionable and easy to avoid.
3865 For example, with -fstrict-overflow, the compiler simplifies
3866 "x + 1 > x" to 1. This level of -Wstrict-overflow is enabled
3867 by -Wall; higher levels are not, and must be explicitly
3868 requested.
3869
3870 -Wstrict-overflow=2
3871 Also warn about other cases where a comparison is simplified to
3872 a constant. For example: "abs (x) >= 0". This can only be
3873 simplified when -fstrict-overflow is in effect, because "abs
3874 (INT_MIN)" overflows to "INT_MIN", which is less than zero.
3875 -Wstrict-overflow (with no level) is the same as
3876 -Wstrict-overflow=2.
3877
3878 -Wstrict-overflow=3
3879 Also warn about other cases where a comparison is simplified.
3880 For example: "x + 1 > 1" is simplified to "x > 0".
3881
3882 -Wstrict-overflow=4
3883 Also warn about other simplifications not covered by the above
3884 cases. For example: "(x * 10) / 5" is simplified to "x * 2".
3885
3886 -Wstrict-overflow=5
3887 Also warn about cases where the compiler reduces the magnitude
3888 of a constant involved in a comparison. For example: "x + 2 >
3889 y" is simplified to "x + 1 >= y". This is reported only at the
3890 highest warning level because this simplification applies to
3891 many comparisons, so this warning level gives a very large
3892 number of false positives.
3893
3894 -Wstringop-overflow
3895 -Wstringop-overflow=type
3896 Warn for calls to string manipulation functions such as "memcpy"
3897 and "strcpy" that are determined to overflow the destination
3898 buffer. The optional argument is one greater than the type of
3899 Object Size Checking to perform to determine the size of the
3900 destination. The argument is meaningful only for functions that
3901 operate on character arrays but not for raw memory functions like
3902 "memcpy" which always make use of Object Size type-0. The option
3903 also warns for calls that specify a size in excess of the largest
3904 possible object or at most "SIZE_MAX / 2" bytes. The option
3905 produces the best results with optimization enabled but can detect
3906 a small subset of simple buffer overflows even without optimization
3907 in calls to the GCC built-in functions like "__builtin_memcpy" that
3908 correspond to the standard functions. In any case, the option
3909 warns about just a subset of buffer overflows detected by the
3910 corresponding overflow checking built-ins. For example, the option
3911 will issue a warning for the "strcpy" call below because it copies
3912 at least 5 characters (the string "blue" including the terminating
3913 NUL) into the buffer of size 4.
3914
3915 enum Color { blue, purple, yellow };
3916 const char* f (enum Color clr)
3917 {
3918 static char buf [4];
3919 const char *str;
3920 switch (clr)
3921 {
3922 case blue: str = "blue"; break;
3923 case purple: str = "purple"; break;
3924 case yellow: str = "yellow"; break;
3925 }
3926
3927 return strcpy (buf, str); // warning here
3928 }
3929
3930 Option -Wstringop-overflow=2 is enabled by default.
3931
3932 -Wstringop-overflow
3933 -Wstringop-overflow=1
3934 The -Wstringop-overflow=1 option uses type-zero Object Size
3935 Checking to determine the sizes of destination objects. This
3936 is the default setting of the option. At this setting the
3937 option will not warn for writes past the end of subobjects of
3938 larger objects accessed by pointers unless the size of the
3939 largest surrounding object is known. When the destination may
3940 be one of several objects it is assumed to be the largest one
3941 of them. On Linux systems, when optimization is enabled at
3942 this setting the option warns for the same code as when the
3943 "_FORTIFY_SOURCE" macro is defined to a non-zero value.
3944
3945 -Wstringop-overflow=2
3946 The -Wstringop-overflow=2 option uses type-one Object Size
3947 Checking to determine the sizes of destination objects. At
3948 this setting the option will warn about overflows when writing
3949 to members of the largest complete objects whose exact size is
3950 known. It will, however, not warn for excessive writes to the
3951 same members of unknown objects referenced by pointers since
3952 they may point to arrays containing unknown numbers of
3953 elements.
3954
3955 -Wstringop-overflow=3
3956 The -Wstringop-overflow=3 option uses type-two Object Size
3957 Checking to determine the sizes of destination objects. At
3958 this setting the option warns about overflowing the smallest
3959 object or data member. This is the most restrictive setting of
3960 the option that may result in warnings for safe code.
3961
3962 -Wstringop-overflow=4
3963 The -Wstringop-overflow=4 option uses type-three Object Size
3964 Checking to determine the sizes of destination objects. At
3965 this setting the option will warn about overflowing any data
3966 members, and when the destination is one of several objects it
3967 uses the size of the largest of them to decide whether to issue
3968 a warning. Similarly to -Wstringop-overflow=3 this setting of
3969 the option may result in warnings for benign code.
3970
3971 -Wsuggest-attribute=[pure|const|noreturn|format]
3972 Warn for cases where adding an attribute may be beneficial. The
3973 attributes currently supported are listed below.
3974
3975 -Wsuggest-attribute=pure
3976 -Wsuggest-attribute=const
3977 -Wsuggest-attribute=noreturn
3978 Warn about functions that might be candidates for attributes
3979 "pure", "const" or "noreturn". The compiler only warns for
3980 functions visible in other compilation units or (in the case of
3981 "pure" and "const") if it cannot prove that the function
3982 returns normally. A function returns normally if it doesn't
3983 contain an infinite loop or return abnormally by throwing,
3984 calling "abort" or trapping. This analysis requires option
3985 -fipa-pure-const, which is enabled by default at -O and higher.
3986 Higher optimization levels improve the accuracy of the
3987 analysis.
3988
3989 -Wsuggest-attribute=format
3990 -Wmissing-format-attribute
3991 Warn about function pointers that might be candidates for
3992 "format" attributes. Note these are only possible candidates,
3993 not absolute ones. GCC guesses that function pointers with
3994 "format" attributes that are used in assignment,
3995 initialization, parameter passing or return statements should
3996 have a corresponding "format" attribute in the resulting type.
3997 I.e. the left-hand side of the assignment or initialization,
3998 the type of the parameter variable, or the return type of the
3999 containing function respectively should also have a "format"
4000 attribute to avoid the warning.
4001
4002 GCC also warns about function definitions that might be
4003 candidates for "format" attributes. Again, these are only
4004 possible candidates. GCC guesses that "format" attributes
4005 might be appropriate for any function that calls a function
4006 like "vprintf" or "vscanf", but this might not always be the
4007 case, and some functions for which "format" attributes are
4008 appropriate may not be detected.
4009
4010 -Wsuggest-final-types
4011 Warn about types with virtual methods where code quality would be
4012 improved if the type were declared with the C++11 "final"
4013 specifier, or, if possible, declared in an anonymous namespace.
4014 This allows GCC to more aggressively devirtualize the polymorphic
4015 calls. This warning is more effective with link time optimization,
4016 where the information about the class hierarchy graph is more
4017 complete.
4018
4019 -Wsuggest-final-methods
4020 Warn about virtual methods where code quality would be improved if
4021 the method were declared with the C++11 "final" specifier, or, if
4022 possible, its type were declared in an anonymous namespace or with
4023 the "final" specifier. This warning is more effective with link-
4024 time optimization, where the information about the class hierarchy
4025 graph is more complete. It is recommended to first consider
4026 suggestions of -Wsuggest-final-types and then rebuild with new
4027 annotations.
4028
4029 -Wsuggest-override
4030 Warn about overriding virtual functions that are not marked with
4031 the override keyword.
4032
4033 -Walloc-zero
4034 Warn about calls to allocation functions decorated with attribute
4035 "alloc_size" that specify zero bytes, including those to the built-
4036 in forms of the functions "aligned_alloc", "alloca", "calloc",
4037 "malloc", and "realloc". Because the behavior of these functions
4038 when called with a zero size differs among implementations (and in
4039 the case of "realloc" has been deprecated) relying on it may result
4040 in subtle portability bugs and should be avoided.
4041
4042 -Walloc-size-larger-than=n
4043 Warn about calls to functions decorated with attribute "alloc_size"
4044 that attempt to allocate objects larger than the specified number
4045 of bytes, or where the result of the size computation in an integer
4046 type with infinite precision would exceed "SIZE_MAX / 2". The
4047 option argument n may end in one of the standard suffixes
4048 designating a multiple of bytes such as "kB" and "KiB" for kilobyte
4049 and kibibyte, respectively, "MB" and "MiB" for megabyte and
4050 mebibyte, and so on. -Walloc-size-larger-than=PTRDIFF_MAX is
4051 enabled by default. Warnings controlled by the option can be
4052 disabled by specifying n of SIZE_MAX or more.
4053
4054 -Walloca
4055 This option warns on all uses of "alloca" in the source.
4056
4057 -Walloca-larger-than=n
4058 This option warns on calls to "alloca" that are not bounded by a
4059 controlling predicate limiting its argument of integer type to at
4060 most n bytes, or calls to "alloca" where the bound is unknown.
4061 Arguments of non-integer types are considered unbounded even if
4062 they appear to be constrained to the expected range.
4063
4064 For example, a bounded case of "alloca" could be:
4065
4066 void func (size_t n)
4067 {
4068 void *p;
4069 if (n <= 1000)
4070 p = alloca (n);
4071 else
4072 p = malloc (n);
4073 f (p);
4074 }
4075
4076 In the above example, passing "-Walloca-larger-than=1000" would not
4077 issue a warning because the call to "alloca" is known to be at most
4078 1000 bytes. However, if "-Walloca-larger-than=500" were passed,
4079 the compiler would emit a warning.
4080
4081 Unbounded uses, on the other hand, are uses of "alloca" with no
4082 controlling predicate constraining its integer argument. For
4083 example:
4084
4085 void func ()
4086 {
4087 void *p = alloca (n);
4088 f (p);
4089 }
4090
4091 If "-Walloca-larger-than=500" were passed, the above would trigger
4092 a warning, but this time because of the lack of bounds checking.
4093
4094 Note, that even seemingly correct code involving signed integers
4095 could cause a warning:
4096
4097 void func (signed int n)
4098 {
4099 if (n < 500)
4100 {
4101 p = alloca (n);
4102 f (p);
4103 }
4104 }
4105
4106 In the above example, n could be negative, causing a larger than
4107 expected argument to be implicitly cast into the "alloca" call.
4108
4109 This option also warns when "alloca" is used in a loop.
4110
4111 This warning is not enabled by -Wall, and is only active when
4112 -ftree-vrp is active (default for -O2 and above).
4113
4114 See also -Wvla-larger-than=n.
4115
4116 -Warray-bounds
4117 -Warray-bounds=n
4118 This option is only active when -ftree-vrp is active (default for
4119 -O2 and above). It warns about subscripts to arrays that are always
4120 out of bounds. This warning is enabled by -Wall.
4121
4122 -Warray-bounds=1
4123 This is the warning level of -Warray-bounds and is enabled by
4124 -Wall; higher levels are not, and must be explicitly requested.
4125
4126 -Warray-bounds=2
4127 This warning level also warns about out of bounds access for
4128 arrays at the end of a struct and for arrays accessed through
4129 pointers. This warning level may give a larger number of false
4130 positives and is deactivated by default.
4131
4132 -Wbool-compare
4133 Warn about boolean expression compared with an integer value
4134 different from "true"/"false". For instance, the following
4135 comparison is always false:
4136
4137 int n = 5;
4138 ...
4139 if ((n > 1) == 2) { ... }
4140
4141 This warning is enabled by -Wall.
4142
4143 -Wbool-operation
4144 Warn about suspicious operations on expressions of a boolean type.
4145 For instance, bitwise negation of a boolean is very likely a bug in
4146 the program. For C, this warning also warns about incrementing or
4147 decrementing a boolean, which rarely makes sense. (In C++,
4148 decrementing a boolean is always invalid. Incrementing a boolean
4149 is invalid in C++1z, and deprecated otherwise.)
4150
4151 This warning is enabled by -Wall.
4152
4153 -Wduplicated-branches
4154 Warn when an if-else has identical branches. This warning detects
4155 cases like
4156
4157 if (p != NULL)
4158 return 0;
4159 else
4160 return 0;
4161
4162 It doesn't warn when both branches contain just a null statement.
4163 This warning also warn for conditional operators:
4164
4165 int i = x ? *p : *p;
4166
4167 -Wduplicated-cond
4168 Warn about duplicated conditions in an if-else-if chain. For
4169 instance, warn for the following code:
4170
4171 if (p->q != NULL) { ... }
4172 else if (p->q != NULL) { ... }
4173
4174 -Wframe-address
4175 Warn when the __builtin_frame_address or __builtin_return_address
4176 is called with an argument greater than 0. Such calls may return
4177 indeterminate values or crash the program. The warning is included
4178 in -Wall.
4179
4180 -Wno-discarded-qualifiers (C and Objective-C only)
4181 Do not warn if type qualifiers on pointers are being discarded.
4182 Typically, the compiler warns if a "const char *" variable is
4183 passed to a function that takes a "char *" parameter. This option
4184 can be used to suppress such a warning.
4185
4186 -Wno-discarded-array-qualifiers (C and Objective-C only)
4187 Do not warn if type qualifiers on arrays which are pointer targets
4188 are being discarded. Typically, the compiler warns if a "const int
4189 (*)[]" variable is passed to a function that takes a "int (*)[]"
4190 parameter. This option can be used to suppress such a warning.
4191
4192 -Wno-incompatible-pointer-types (C and Objective-C only)
4193 Do not warn when there is a conversion between pointers that have
4194 incompatible types. This warning is for cases not covered by
4195 -Wno-pointer-sign, which warns for pointer argument passing or
4196 assignment with different signedness.
4197
4198 -Wno-int-conversion (C and Objective-C only)
4199 Do not warn about incompatible integer to pointer and pointer to
4200 integer conversions. This warning is about implicit conversions;
4201 for explicit conversions the warnings -Wno-int-to-pointer-cast and
4202 -Wno-pointer-to-int-cast may be used.
4203
4204 -Wno-div-by-zero
4205 Do not warn about compile-time integer division by zero. Floating-
4206 point division by zero is not warned about, as it can be a
4207 legitimate way of obtaining infinities and NaNs.
4208
4209 -Wsystem-headers
4210 Print warning messages for constructs found in system header files.
4211 Warnings from system headers are normally suppressed, on the
4212 assumption that they usually do not indicate real problems and
4213 would only make the compiler output harder to read. Using this
4214 command-line option tells GCC to emit warnings from system headers
4215 as if they occurred in user code. However, note that using -Wall
4216 in conjunction with this option does not warn about unknown pragmas
4217 in system headers---for that, -Wunknown-pragmas must also be used.
4218
4219 -Wtautological-compare
4220 Warn if a self-comparison always evaluates to true or false. This
4221 warning detects various mistakes such as:
4222
4223 int i = 1;
4224 ...
4225 if (i > i) { ... }
4226
4227 This warning is enabled by -Wall.
4228
4229 -Wtrampolines
4230 Warn about trampolines generated for pointers to nested functions.
4231 A trampoline is a small piece of data or code that is created at
4232 run time on the stack when the address of a nested function is
4233 taken, and is used to call the nested function indirectly. For
4234 some targets, it is made up of data only and thus requires no
4235 special treatment. But, for most targets, it is made up of code
4236 and thus requires the stack to be made executable in order for the
4237 program to work properly.
4238
4239 -Wfloat-equal
4240 Warn if floating-point values are used in equality comparisons.
4241
4242 The idea behind this is that sometimes it is convenient (for the
4243 programmer) to consider floating-point values as approximations to
4244 infinitely precise real numbers. If you are doing this, then you
4245 need to compute (by analyzing the code, or in some other way) the
4246 maximum or likely maximum error that the computation introduces,
4247 and allow for it when performing comparisons (and when producing
4248 output, but that's a different problem). In particular, instead of
4249 testing for equality, you should check to see whether the two
4250 values have ranges that overlap; and this is done with the
4251 relational operators, so equality comparisons are probably
4252 mistaken.
4253
4254 -Wtraditional (C and Objective-C only)
4255 Warn about certain constructs that behave differently in
4256 traditional and ISO C. Also warn about ISO C constructs that have
4257 no traditional C equivalent, and/or problematic constructs that
4258 should be avoided.
4259
4260 * Macro parameters that appear within string literals in the
4261 macro body. In traditional C macro replacement takes place
4262 within string literals, but in ISO C it does not.
4263
4264 * In traditional C, some preprocessor directives did not exist.
4265 Traditional preprocessors only considered a line to be a
4266 directive if the # appeared in column 1 on the line. Therefore
4267 -Wtraditional warns about directives that traditional C
4268 understands but ignores because the # does not appear as the
4269 first character on the line. It also suggests you hide
4270 directives like "#pragma" not understood by traditional C by
4271 indenting them. Some traditional implementations do not
4272 recognize "#elif", so this option suggests avoiding it
4273 altogether.
4274
4275 * A function-like macro that appears without arguments.
4276
4277 * The unary plus operator.
4278
4279 * The U integer constant suffix, or the F or L floating-point
4280 constant suffixes. (Traditional C does support the L suffix on
4281 integer constants.) Note, these suffixes appear in macros
4282 defined in the system headers of most modern systems, e.g. the
4283 _MIN/_MAX macros in "<limits.h>". Use of these macros in user
4284 code might normally lead to spurious warnings, however GCC's
4285 integrated preprocessor has enough context to avoid warning in
4286 these cases.
4287
4288 * A function declared external in one block and then used after
4289 the end of the block.
4290
4291 * A "switch" statement has an operand of type "long".
4292
4293 * A non-"static" function declaration follows a "static" one.
4294 This construct is not accepted by some traditional C compilers.
4295
4296 * The ISO type of an integer constant has a different width or
4297 signedness from its traditional type. This warning is only
4298 issued if the base of the constant is ten. I.e. hexadecimal or
4299 octal values, which typically represent bit patterns, are not
4300 warned about.
4301
4302 * Usage of ISO string concatenation is detected.
4303
4304 * Initialization of automatic aggregates.
4305
4306 * Identifier conflicts with labels. Traditional C lacks a
4307 separate namespace for labels.
4308
4309 * Initialization of unions. If the initializer is zero, the
4310 warning is omitted. This is done under the assumption that the
4311 zero initializer in user code appears conditioned on e.g.
4312 "__STDC__" to avoid missing initializer warnings and relies on
4313 default initialization to zero in the traditional C case.
4314
4315 * Conversions by prototypes between fixed/floating-point values
4316 and vice versa. The absence of these prototypes when compiling
4317 with traditional C causes serious problems. This is a subset
4318 of the possible conversion warnings; for the full set use
4319 -Wtraditional-conversion.
4320
4321 * Use of ISO C style function definitions. This warning
4322 intentionally is not issued for prototype declarations or
4323 variadic functions because these ISO C features appear in your
4324 code when using libiberty's traditional C compatibility macros,
4325 "PARAMS" and "VPARAMS". This warning is also bypassed for
4326 nested functions because that feature is already a GCC
4327 extension and thus not relevant to traditional C compatibility.
4328
4329 -Wtraditional-conversion (C and Objective-C only)
4330 Warn if a prototype causes a type conversion that is different from
4331 what would happen to the same argument in the absence of a
4332 prototype. This includes conversions of fixed point to floating
4333 and vice versa, and conversions changing the width or signedness of
4334 a fixed-point argument except when the same as the default
4335 promotion.
4336
4337 -Wdeclaration-after-statement (C and Objective-C only)
4338 Warn when a declaration is found after a statement in a block.
4339 This construct, known from C++, was introduced with ISO C99 and is
4340 by default allowed in GCC. It is not supported by ISO C90.
4341
4342 -Wshadow
4343 Warn whenever a local variable or type declaration shadows another
4344 variable, parameter, type, class member (in C++), or instance
4345 variable (in Objective-C) or whenever a built-in function is
4346 shadowed. Note that in C++, the compiler warns if a local variable
4347 shadows an explicit typedef, but not if it shadows a
4348 struct/class/enum. Same as -Wshadow=global.
4349
4350 -Wno-shadow-ivar (Objective-C only)
4351 Do not warn whenever a local variable shadows an instance variable
4352 in an Objective-C method.
4353
4354 -Wshadow=global
4355 The default for -Wshadow. Warns for any (global) shadowing.
4356
4357 -Wshadow=local
4358 Warn when a local variable shadows another local variable or
4359 parameter. This warning is enabled by -Wshadow=global.
4360
4361 -Wshadow=compatible-local
4362 Warn when a local variable shadows another local variable or
4363 parameter whose type is compatible with that of the shadowing
4364 variable. In C++, type compatibility here means the type of the
4365 shadowing variable can be converted to that of the shadowed
4366 variable. The creation of this flag (in addition to -Wshadow=local)
4367 is based on the idea that when a local variable shadows another one
4368 of incompatible type, it is most likely intentional, not a bug or
4369 typo, as shown in the following example:
4370
4371 for (SomeIterator i = SomeObj.begin(); i != SomeObj.end(); ++i)
4372 {
4373 for (int i = 0; i < N; ++i)
4374 {
4375 ...
4376 }
4377 ...
4378 }
4379
4380 Since the two variable "i" in the example above have incompatible
4381 types, enabling only -Wshadow=compatible-local will not emit a
4382 warning. Because their types are incompatible, if a programmer
4383 accidentally uses one in place of the other, type checking will
4384 catch that and emit an error or warning. So not warning (about
4385 shadowing) in this case will not lead to undetected bugs. Use of
4386 this flag instead of -Wshadow=local can possibly reduce the number
4387 of warnings triggered by intentional shadowing.
4388
4389 This warning is enabled by -Wshadow=local.
4390
4391 -Wlarger-than=len
4392 Warn whenever an object of larger than len bytes is defined.
4393
4394 -Wframe-larger-than=len
4395 Warn if the size of a function frame is larger than len bytes. The
4396 computation done to determine the stack frame size is approximate
4397 and not conservative. The actual requirements may be somewhat
4398 greater than len even if you do not get a warning. In addition,
4399 any space allocated via "alloca", variable-length arrays, or
4400 related constructs is not included by the compiler when determining
4401 whether or not to issue a warning.
4402
4403 -Wno-free-nonheap-object
4404 Do not warn when attempting to free an object that was not
4405 allocated on the heap.
4406
4407 -Wstack-usage=len
4408 Warn if the stack usage of a function might be larger than len
4409 bytes. The computation done to determine the stack usage is
4410 conservative. Any space allocated via "alloca", variable-length
4411 arrays, or related constructs is included by the compiler when
4412 determining whether or not to issue a warning.
4413
4414 The message is in keeping with the output of -fstack-usage.
4415
4416 * If the stack usage is fully static but exceeds the specified
4417 amount, it's:
4418
4419 warning: stack usage is 1120 bytes
4420
4421 * If the stack usage is (partly) dynamic but bounded, it's:
4422
4423 warning: stack usage might be 1648 bytes
4424
4425 * If the stack usage is (partly) dynamic and not bounded, it's:
4426
4427 warning: stack usage might be unbounded
4428
4429 -Wunsafe-loop-optimizations
4430 Warn if the loop cannot be optimized because the compiler cannot
4431 assume anything on the bounds of the loop indices. With
4432 -funsafe-loop-optimizations warn if the compiler makes such
4433 assumptions.
4434
4435 -Wno-pedantic-ms-format (MinGW targets only)
4436 When used in combination with -Wformat and -pedantic without GNU
4437 extensions, this option disables the warnings about non-ISO
4438 "printf" / "scanf" format width specifiers "I32", "I64", and "I"
4439 used on Windows targets, which depend on the MS runtime.
4440
4441 -Waligned-new
4442 Warn about a new-expression of a type that requires greater
4443 alignment than the "alignof(std::max_align_t)" but uses an
4444 allocation function without an explicit alignment parameter. This
4445 option is enabled by -Wall.
4446
4447 Normally this only warns about global allocation functions, but
4448 -Waligned-new=all also warns about class member allocation
4449 functions.
4450
4451 -Wplacement-new
4452 -Wplacement-new=n
4453 Warn about placement new expressions with undefined behavior, such
4454 as constructing an object in a buffer that is smaller than the type
4455 of the object. For example, the placement new expression below is
4456 diagnosed because it attempts to construct an array of 64 integers
4457 in a buffer only 64 bytes large.
4458
4459 char buf [64];
4460 new (buf) int[64];
4461
4462 This warning is enabled by default.
4463
4464 -Wplacement-new=1
4465 This is the default warning level of -Wplacement-new. At this
4466 level the warning is not issued for some strictly undefined
4467 constructs that GCC allows as extensions for compatibility with
4468 legacy code. For example, the following "new" expression is
4469 not diagnosed at this level even though it has undefined
4470 behavior according to the C++ standard because it writes past
4471 the end of the one-element array.
4472
4473 struct S { int n, a[1]; };
4474 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
4475 new (s->a)int [32]();
4476
4477 -Wplacement-new=2
4478 At this level, in addition to diagnosing all the same
4479 constructs as at level 1, a diagnostic is also issued for
4480 placement new expressions that construct an object in the last
4481 member of structure whose type is an array of a single element
4482 and whose size is less than the size of the object being
4483 constructed. While the previous example would be diagnosed,
4484 the following construct makes use of the flexible member array
4485 extension to avoid the warning at level 2.
4486
4487 struct S { int n, a[]; };
4488 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
4489 new (s->a)int [32]();
4490
4491 -Wpointer-arith
4492 Warn about anything that depends on the "size of" a function type
4493 or of "void". GNU C assigns these types a size of 1, for
4494 convenience in calculations with "void *" pointers and pointers to
4495 functions. In C++, warn also when an arithmetic operation involves
4496 "NULL". This warning is also enabled by -Wpedantic.
4497
4498 -Wpointer-compare
4499 Warn if a pointer is compared with a zero character constant. This
4500 usually means that the pointer was meant to be dereferenced. For
4501 example:
4502
4503 const char *p = foo ();
4504 if (p == '\0')
4505 return 42;
4506
4507 Note that the code above is invalid in C++11.
4508
4509 This warning is enabled by default.
4510
4511 -Wtype-limits
4512 Warn if a comparison is always true or always false due to the
4513 limited range of the data type, but do not warn for constant
4514 expressions. For example, warn if an unsigned variable is compared
4515 against zero with "<" or ">=". This warning is also enabled by
4516 -Wextra.
4517
4518 -Wcomment
4519 -Wcomments
4520 Warn whenever a comment-start sequence /* appears in a /* comment,
4521 or whenever a backslash-newline appears in a // comment. This
4522 warning is enabled by -Wall.
4523
4524 -Wtrigraphs
4525 Warn if any trigraphs are encountered that might change the meaning
4526 of the program. Trigraphs within comments are not warned about,
4527 except those that would form escaped newlines.
4528
4529 This option is implied by -Wall. If -Wall is not given, this
4530 option is still enabled unless trigraphs are enabled. To get
4531 trigraph conversion without warnings, but get the other -Wall
4532 warnings, use -trigraphs -Wall -Wno-trigraphs.
4533
4534 -Wundef
4535 Warn if an undefined identifier is evaluated in an "#if" directive.
4536 Such identifiers are replaced with zero.
4537
4538 -Wexpansion-to-defined
4539 Warn whenever defined is encountered in the expansion of a macro
4540 (including the case where the macro is expanded by an #if
4541 directive). Such usage is not portable. This warning is also
4542 enabled by -Wpedantic and -Wextra.
4543
4544 -Wunused-macros
4545 Warn about macros defined in the main file that are unused. A
4546 macro is used if it is expanded or tested for existence at least
4547 once. The preprocessor also warns if the macro has not been used
4548 at the time it is redefined or undefined.
4549
4550 Built-in macros, macros defined on the command line, and macros
4551 defined in include files are not warned about.
4552
4553 Note: If a macro is actually used, but only used in skipped
4554 conditional blocks, then the preprocessor reports it as unused. To
4555 avoid the warning in such a case, you might improve the scope of
4556 the macro's definition by, for example, moving it into the first
4557 skipped block. Alternatively, you could provide a dummy use with
4558 something like:
4559
4560 #if defined the_macro_causing_the_warning
4561 #endif
4562
4563 -Wno-endif-labels
4564 Do not warn whenever an "#else" or an "#endif" are followed by
4565 text. This sometimes happens in older programs with code of the
4566 form
4567
4568 #if FOO
4569 ...
4570 #else FOO
4571 ...
4572 #endif FOO
4573
4574 The second and third "FOO" should be in comments. This warning is
4575 on by default.
4576
4577 -Wbad-function-cast (C and Objective-C only)
4578 Warn when a function call is cast to a non-matching type. For
4579 example, warn if a call to a function returning an integer type is
4580 cast to a pointer type.
4581
4582 -Wc90-c99-compat (C and Objective-C only)
4583 Warn about features not present in ISO C90, but present in ISO C99.
4584 For instance, warn about use of variable length arrays, "long long"
4585 type, "bool" type, compound literals, designated initializers, and
4586 so on. This option is independent of the standards mode. Warnings
4587 are disabled in the expression that follows "__extension__".
4588
4589 -Wc99-c11-compat (C and Objective-C only)
4590 Warn about features not present in ISO C99, but present in ISO C11.
4591 For instance, warn about use of anonymous structures and unions,
4592 "_Atomic" type qualifier, "_Thread_local" storage-class specifier,
4593 "_Alignas" specifier, "Alignof" operator, "_Generic" keyword, and
4594 so on. This option is independent of the standards mode. Warnings
4595 are disabled in the expression that follows "__extension__".
4596
4597 -Wc++-compat (C and Objective-C only)
4598 Warn about ISO C constructs that are outside of the common subset
4599 of ISO C and ISO C++, e.g. request for implicit conversion from
4600 "void *" to a pointer to non-"void" type.
4601
4602 -Wc++11-compat (C++ and Objective-C++ only)
4603 Warn about C++ constructs whose meaning differs between ISO C++
4604 1998 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are
4605 keywords in ISO C++ 2011. This warning turns on -Wnarrowing and is
4606 enabled by -Wall.
4607
4608 -Wc++14-compat (C++ and Objective-C++ only)
4609 Warn about C++ constructs whose meaning differs between ISO C++
4610 2011 and ISO C++ 2014. This warning is enabled by -Wall.
4611
4612 -Wc++1z-compat (C++ and Objective-C++ only)
4613 Warn about C++ constructs whose meaning differs between ISO C++
4614 2014 and the forthoming ISO C++ 2017(?). This warning is enabled
4615 by -Wall.
4616
4617 -Wcast-qual
4618 Warn whenever a pointer is cast so as to remove a type qualifier
4619 from the target type. For example, warn if a "const char *" is
4620 cast to an ordinary "char *".
4621
4622 Also warn when making a cast that introduces a type qualifier in an
4623 unsafe way. For example, casting "char **" to "const char **" is
4624 unsafe, as in this example:
4625
4626 /* p is char ** value. */
4627 const char **q = (const char **) p;
4628 /* Assignment of readonly string to const char * is OK. */
4629 *q = "string";
4630 /* Now char** pointer points to read-only memory. */
4631 **p = 'b';
4632
4633 -Wcast-align
4634 Warn whenever a pointer is cast such that the required alignment of
4635 the target is increased. For example, warn if a "char *" is cast
4636 to an "int *" on machines where integers can only be accessed at
4637 two- or four-byte boundaries.
4638
4639 -Wwrite-strings
4640 When compiling C, give string constants the type "const
4641 char[length]" so that copying the address of one into a non-"const"
4642 "char *" pointer produces a warning. These warnings help you find
4643 at compile time code that can try to write into a string constant,
4644 but only if you have been very careful about using "const" in
4645 declarations and prototypes. Otherwise, it is just a nuisance.
4646 This is why we did not make -Wall request these warnings.
4647
4648 When compiling C++, warn about the deprecated conversion from
4649 string literals to "char *". This warning is enabled by default
4650 for C++ programs.
4651
4652 -Wclobbered
4653 Warn for variables that might be changed by "longjmp" or "vfork".
4654 This warning is also enabled by -Wextra.
4655
4656 -Wconditionally-supported (C++ and Objective-C++ only)
4657 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4658
4659 -Wconversion
4660 Warn for implicit conversions that may alter a value. This includes
4661 conversions between real and integer, like "abs (x)" when "x" is
4662 "double"; conversions between signed and unsigned, like "unsigned
4663 ui = -1"; and conversions to smaller types, like "sqrtf (M_PI)". Do
4664 not warn for explicit casts like "abs ((int) x)" and "ui =
4665 (unsigned) -1", or if the value is not changed by the conversion
4666 like in "abs (2.0)". Warnings about conversions between signed and
4667 unsigned integers can be disabled by using -Wno-sign-conversion.
4668
4669 For C++, also warn for confusing overload resolution for user-
4670 defined conversions; and conversions that never use a type
4671 conversion operator: conversions to "void", the same type, a base
4672 class or a reference to them. Warnings about conversions between
4673 signed and unsigned integers are disabled by default in C++ unless
4674 -Wsign-conversion is explicitly enabled.
4675
4676 -Wno-conversion-null (C++ and Objective-C++ only)
4677 Do not warn for conversions between "NULL" and non-pointer types.
4678 -Wconversion-null is enabled by default.
4679
4680 -Wzero-as-null-pointer-constant (C++ and Objective-C++ only)
4681 Warn when a literal 0 is used as null pointer constant. This can
4682 be useful to facilitate the conversion to "nullptr" in C++11.
4683
4684 -Wsubobject-linkage (C++ and Objective-C++ only)
4685 Warn if a class type has a base or a field whose type uses the
4686 anonymous namespace or depends on a type with no linkage. If a
4687 type A depends on a type B with no or internal linkage, defining it
4688 in multiple translation units would be an ODR violation because the
4689 meaning of B is different in each translation unit. If A only
4690 appears in a single translation unit, the best way to silence the
4691 warning is to give it internal linkage by putting it in an
4692 anonymous namespace as well. The compiler doesn't give this
4693 warning for types defined in the main .C file, as those are
4694 unlikely to have multiple definitions. -Wsubobject-linkage is
4695 enabled by default.
4696
4697 -Wdangling-else
4698 Warn about constructions where there may be confusion to which "if"
4699 statement an "else" branch belongs. Here is an example of such a
4700 case:
4701
4702 {
4703 if (a)
4704 if (b)
4705 foo ();
4706 else
4707 bar ();
4708 }
4709
4710 In C/C++, every "else" branch belongs to the innermost possible
4711 "if" statement, which in this example is "if (b)". This is often
4712 not what the programmer expected, as illustrated in the above
4713 example by indentation the programmer chose. When there is the
4714 potential for this confusion, GCC issues a warning when this flag
4715 is specified. To eliminate the warning, add explicit braces around
4716 the innermost "if" statement so there is no way the "else" can
4717 belong to the enclosing "if". The resulting code looks like this:
4718
4719 {
4720 if (a)
4721 {
4722 if (b)
4723 foo ();
4724 else
4725 bar ();
4726 }
4727 }
4728
4729 This warning is enabled by -Wparentheses.
4730
4731 -Wdate-time
4732 Warn when macros "__TIME__", "__DATE__" or "__TIMESTAMP__" are
4733 encountered as they might prevent bit-wise-identical reproducible
4734 compilations.
4735
4736 -Wdelete-incomplete (C++ and Objective-C++ only)
4737 Warn when deleting a pointer to incomplete type, which may cause
4738 undefined behavior at runtime. This warning is enabled by default.
4739
4740 -Wuseless-cast (C++ and Objective-C++ only)
4741 Warn when an expression is casted to its own type.
4742
4743 -Wempty-body
4744 Warn if an empty body occurs in an "if", "else" or "do while"
4745 statement. This warning is also enabled by -Wextra.
4746
4747 -Wenum-compare
4748 Warn about a comparison between values of different enumerated
4749 types. In C++ enumerated type mismatches in conditional
4750 expressions are also diagnosed and the warning is enabled by
4751 default. In C this warning is enabled by -Wall.
4752
4753 -Wjump-misses-init (C, Objective-C only)
4754 Warn if a "goto" statement or a "switch" statement jumps forward
4755 across the initialization of a variable, or jumps backward to a
4756 label after the variable has been initialized. This only warns
4757 about variables that are initialized when they are declared. This
4758 warning is only supported for C and Objective-C; in C++ this sort
4759 of branch is an error in any case.
4760
4761 -Wjump-misses-init is included in -Wc++-compat. It can be disabled
4762 with the -Wno-jump-misses-init option.
4763
4764 -Wsign-compare
4765 Warn when a comparison between signed and unsigned values could
4766 produce an incorrect result when the signed value is converted to
4767 unsigned. In C++, this warning is also enabled by -Wall. In C, it
4768 is also enabled by -Wextra.
4769
4770 -Wsign-conversion
4771 Warn for implicit conversions that may change the sign of an
4772 integer value, like assigning a signed integer expression to an
4773 unsigned integer variable. An explicit cast silences the warning.
4774 In C, this option is enabled also by -Wconversion.
4775
4776 -Wfloat-conversion
4777 Warn for implicit conversions that reduce the precision of a real
4778 value. This includes conversions from real to integer, and from
4779 higher precision real to lower precision real values. This option
4780 is also enabled by -Wconversion.
4781
4782 -Wno-scalar-storage-order
4783 Do not warn on suspicious constructs involving reverse scalar
4784 storage order.
4785
4786 -Wsized-deallocation (C++ and Objective-C++ only)
4787 Warn about a definition of an unsized deallocation function
4788
4789 void operator delete (void *) noexcept;
4790 void operator delete[] (void *) noexcept;
4791
4792 without a definition of the corresponding sized deallocation
4793 function
4794
4795 void operator delete (void *, std::size_t) noexcept;
4796 void operator delete[] (void *, std::size_t) noexcept;
4797
4798 or vice versa. Enabled by -Wextra along with -fsized-deallocation.
4799
4800 -Wsizeof-pointer-memaccess
4801 Warn for suspicious length parameters to certain string and memory
4802 built-in functions if the argument uses "sizeof". This warning
4803 warns e.g. about "memset (ptr, 0, sizeof (ptr));" if "ptr" is not
4804 an array, but a pointer, and suggests a possible fix, or about
4805 "memcpy (&foo, ptr, sizeof (&foo));". This warning is enabled by
4806 -Wall.
4807
4808 -Wsizeof-array-argument
4809 Warn when the "sizeof" operator is applied to a parameter that is
4810 declared as an array in a function definition. This warning is
4811 enabled by default for C and C++ programs.
4812
4813 -Wmemset-elt-size
4814 Warn for suspicious calls to the "memset" built-in function, if the
4815 first argument references an array, and the third argument is a
4816 number equal to the number of elements, but not equal to the size
4817 of the array in memory. This indicates that the user has omitted a
4818 multiplication by the element size. This warning is enabled by
4819 -Wall.
4820
4821 -Wmemset-transposed-args
4822 Warn for suspicious calls to the "memset" built-in function, if the
4823 second argument is not zero and the third argument is zero. This
4824 warns e.g.@ about "memset (buf, sizeof buf, 0)" where most probably
4825 "memset (buf, 0, sizeof buf)" was meant instead. The diagnostics
4826 is only emitted if the third argument is literal zero. If it is
4827 some expression that is folded to zero, a cast of zero to some
4828 type, etc., it is far less likely that the user has mistakenly
4829 exchanged the arguments and no warning is emitted. This warning is
4830 enabled by -Wall.
4831
4832 -Waddress
4833 Warn about suspicious uses of memory addresses. These include using
4834 the address of a function in a conditional expression, such as
4835 "void func(void); if (func)", and comparisons against the memory
4836 address of a string literal, such as "if (x == "abc")". Such uses
4837 typically indicate a programmer error: the address of a function
4838 always evaluates to true, so their use in a conditional usually
4839 indicate that the programmer forgot the parentheses in a function
4840 call; and comparisons against string literals result in unspecified
4841 behavior and are not portable in C, so they usually indicate that
4842 the programmer intended to use "strcmp". This warning is enabled
4843 by -Wall.
4844
4845 -Wlogical-op
4846 Warn about suspicious uses of logical operators in expressions.
4847 This includes using logical operators in contexts where a bit-wise
4848 operator is likely to be expected. Also warns when the operands of
4849 a logical operator are the same:
4850
4851 extern int a;
4852 if (a < 0 && a < 0) { ... }
4853
4854 -Wlogical-not-parentheses
4855 Warn about logical not used on the left hand side operand of a
4856 comparison. This option does not warn if the right operand is
4857 considered to be a boolean expression. Its purpose is to detect
4858 suspicious code like the following:
4859
4860 int a;
4861 ...
4862 if (!a > 1) { ... }
4863
4864 It is possible to suppress the warning by wrapping the LHS into
4865 parentheses:
4866
4867 if ((!a) > 1) { ... }
4868
4869 This warning is enabled by -Wall.
4870
4871 -Waggregate-return
4872 Warn if any functions that return structures or unions are defined
4873 or called. (In languages where you can return an array, this also
4874 elicits a warning.)
4875
4876 -Wno-aggressive-loop-optimizations
4877 Warn if in a loop with constant number of iterations the compiler
4878 detects undefined behavior in some statement during one or more of
4879 the iterations.
4880
4881 -Wno-attributes
4882 Do not warn if an unexpected "__attribute__" is used, such as
4883 unrecognized attributes, function attributes applied to variables,
4884 etc. This does not stop errors for incorrect use of supported
4885 attributes.
4886
4887 -Wno-builtin-declaration-mismatch
4888 Warn if a built-in function is declared with the wrong signature.
4889 This warning is enabled by default.
4890
4891 -Wno-builtin-macro-redefined
4892 Do not warn if certain built-in macros are redefined. This
4893 suppresses warnings for redefinition of "__TIMESTAMP__",
4894 "__TIME__", "__DATE__", "__FILE__", and "__BASE_FILE__".
4895
4896 -Wstrict-prototypes (C and Objective-C only)
4897 Warn if a function is declared or defined without specifying the
4898 argument types. (An old-style function definition is permitted
4899 without a warning if preceded by a declaration that specifies the
4900 argument types.)
4901
4902 -Wold-style-declaration (C and Objective-C only)
4903 Warn for obsolescent usages, according to the C Standard, in a
4904 declaration. For example, warn if storage-class specifiers like
4905 "static" are not the first things in a declaration. This warning
4906 is also enabled by -Wextra.
4907
4908 -Wold-style-definition (C and Objective-C only)
4909 Warn if an old-style function definition is used. A warning is
4910 given even if there is a previous prototype.
4911
4912 -Wmissing-parameter-type (C and Objective-C only)
4913 A function parameter is declared without a type specifier in
4914 K&R-style functions:
4915
4916 void foo(bar) { }
4917
4918 This warning is also enabled by -Wextra.
4919
4920 -Wmissing-prototypes (C and Objective-C only)
4921 Warn if a global function is defined without a previous prototype
4922 declaration. This warning is issued even if the definition itself
4923 provides a prototype. Use this option to detect global functions
4924 that do not have a matching prototype declaration in a header file.
4925 This option is not valid for C++ because all function declarations
4926 provide prototypes and a non-matching declaration declares an
4927 overload rather than conflict with an earlier declaration. Use
4928 -Wmissing-declarations to detect missing declarations in C++.
4929
4930 -Wmissing-declarations
4931 Warn if a global function is defined without a previous
4932 declaration. Do so even if the definition itself provides a
4933 prototype. Use this option to detect global functions that are not
4934 declared in header files. In C, no warnings are issued for
4935 functions with previous non-prototype declarations; use
4936 -Wmissing-prototypes to detect missing prototypes. In C++, no
4937 warnings are issued for function templates, or for inline
4938 functions, or for functions in anonymous namespaces.
4939
4940 -Wmissing-field-initializers
4941 Warn if a structure's initializer has some fields missing. For
4942 example, the following code causes such a warning, because "x.h" is
4943 implicitly zero:
4944
4945 struct s { int f, g, h; };
4946 struct s x = { 3, 4 };
4947
4948 This option does not warn about designated initializers, so the
4949 following modification does not trigger a warning:
4950
4951 struct s { int f, g, h; };
4952 struct s x = { .f = 3, .g = 4 };
4953
4954 In C++ this option does not warn either about the empty { }
4955 initializer, for example:
4956
4957 struct s { int f, g, h; };
4958 s x = { };
4959
4960 This warning is included in -Wextra. To get other -Wextra warnings
4961 without this one, use -Wextra -Wno-missing-field-initializers.
4962
4963 -Wno-multichar
4964 Do not warn if a multicharacter constant ('FOOF') is used. Usually
4965 they indicate a typo in the user's code, as they have
4966 implementation-defined values, and should not be used in portable
4967 code.
4968
4969 -Wnormalized=[none|id|nfc|nfkc]
4970 In ISO C and ISO C++, two identifiers are different if they are
4971 different sequences of characters. However, sometimes when
4972 characters outside the basic ASCII character set are used, you can
4973 have two different character sequences that look the same. To
4974 avoid confusion, the ISO 10646 standard sets out some normalization
4975 rules which when applied ensure that two sequences that look the
4976 same are turned into the same sequence. GCC can warn you if you
4977 are using identifiers that have not been normalized; this option
4978 controls that warning.
4979
4980 There are four levels of warning supported by GCC. The default is
4981 -Wnormalized=nfc, which warns about any identifier that is not in
4982 the ISO 10646 "C" normalized form, NFC. NFC is the recommended
4983 form for most uses. It is equivalent to -Wnormalized.
4984
4985 Unfortunately, there are some characters allowed in identifiers by
4986 ISO C and ISO C++ that, when turned into NFC, are not allowed in
4987 identifiers. That is, there's no way to use these symbols in
4988 portable ISO C or C++ and have all your identifiers in NFC.
4989 -Wnormalized=id suppresses the warning for these characters. It is
4990 hoped that future versions of the standards involved will correct
4991 this, which is why this option is not the default.
4992
4993 You can switch the warning off for all characters by writing
4994 -Wnormalized=none or -Wno-normalized. You should only do this if
4995 you are using some other normalization scheme (like "D"), because
4996 otherwise you can easily create bugs that are literally impossible
4997 to see.
4998
4999 Some characters in ISO 10646 have distinct meanings but look
5000 identical in some fonts or display methodologies, especially once
5001 formatting has been applied. For instance "\u207F", "SUPERSCRIPT
5002 LATIN SMALL LETTER N", displays just like a regular "n" that has
5003 been placed in a superscript. ISO 10646 defines the NFKC
5004 normalization scheme to convert all these into a standard form as
5005 well, and GCC warns if your code is not in NFKC if you use
5006 -Wnormalized=nfkc. This warning is comparable to warning about
5007 every identifier that contains the letter O because it might be
5008 confused with the digit 0, and so is not the default, but may be
5009 useful as a local coding convention if the programming environment
5010 cannot be fixed to display these characters distinctly.
5011
5012 -Wno-deprecated
5013 Do not warn about usage of deprecated features.
5014
5015 -Wno-deprecated-declarations
5016 Do not warn about uses of functions, variables, and types marked as
5017 deprecated by using the "deprecated" attribute.
5018
5019 -Wno-overflow
5020 Do not warn about compile-time overflow in constant expressions.
5021
5022 -Wno-odr
5023 Warn about One Definition Rule violations during link-time
5024 optimization. Requires -flto-odr-type-merging to be enabled.
5025 Enabled by default.
5026
5027 -Wopenmp-simd
5028 Warn if the vectorizer cost model overrides the OpenMP or the Cilk
5029 Plus simd directive set by user. The -fsimd-cost-model=unlimited
5030 option can be used to relax the cost model.
5031
5032 -Woverride-init (C and Objective-C only)
5033 Warn if an initialized field without side effects is overridden
5034 when using designated initializers.
5035
5036 This warning is included in -Wextra. To get other -Wextra warnings
5037 without this one, use -Wextra -Wno-override-init.
5038
5039 -Woverride-init-side-effects (C and Objective-C only)
5040 Warn if an initialized field with side effects is overridden when
5041 using designated initializers. This warning is enabled by default.
5042
5043 -Wpacked
5044 Warn if a structure is given the packed attribute, but the packed
5045 attribute has no effect on the layout or size of the structure.
5046 Such structures may be mis-aligned for little benefit. For
5047 instance, in this code, the variable "f.x" in "struct bar" is
5048 misaligned even though "struct bar" does not itself have the packed
5049 attribute:
5050
5051 struct foo {
5052 int x;
5053 char a, b, c, d;
5054 } __attribute__((packed));
5055 struct bar {
5056 char z;
5057 struct foo f;
5058 };
5059
5060 -Wpacked-bitfield-compat
5061 The 4.1, 4.2 and 4.3 series of GCC ignore the "packed" attribute on
5062 bit-fields of type "char". This has been fixed in GCC 4.4 but the
5063 change can lead to differences in the structure layout. GCC
5064 informs you when the offset of such a field has changed in GCC 4.4.
5065 For example there is no longer a 4-bit padding between field "a"
5066 and "b" in this structure:
5067
5068 struct foo
5069 {
5070 char a:4;
5071 char b:8;
5072 } __attribute__ ((packed));
5073
5074 This warning is enabled by default. Use
5075 -Wno-packed-bitfield-compat to disable this warning.
5076
5077 -Wpadded
5078 Warn if padding is included in a structure, either to align an
5079 element of the structure or to align the whole structure.
5080 Sometimes when this happens it is possible to rearrange the fields
5081 of the structure to reduce the padding and so make the structure
5082 smaller.
5083
5084 -Wredundant-decls
5085 Warn if anything is declared more than once in the same scope, even
5086 in cases where multiple declaration is valid and changes nothing.
5087
5088 -Wrestrict
5089 Warn when an argument passed to a restrict-qualified parameter
5090 aliases with another argument.
5091
5092 -Wnested-externs (C and Objective-C only)
5093 Warn if an "extern" declaration is encountered within a function.
5094
5095 -Wno-inherited-variadic-ctor
5096 Suppress warnings about use of C++11 inheriting constructors when
5097 the base class inherited from has a C variadic constructor; the
5098 warning is on by default because the ellipsis is not inherited.
5099
5100 -Winline
5101 Warn if a function that is declared as inline cannot be inlined.
5102 Even with this option, the compiler does not warn about failures to
5103 inline functions declared in system headers.
5104
5105 The compiler uses a variety of heuristics to determine whether or
5106 not to inline a function. For example, the compiler takes into
5107 account the size of the function being inlined and the amount of
5108 inlining that has already been done in the current function.
5109 Therefore, seemingly insignificant changes in the source program
5110 can cause the warnings produced by -Winline to appear or disappear.
5111
5112 -Wno-invalid-offsetof (C++ and Objective-C++ only)
5113 Suppress warnings from applying the "offsetof" macro to a non-POD
5114 type. According to the 2014 ISO C++ standard, applying "offsetof"
5115 to a non-standard-layout type is undefined. In existing C++
5116 implementations, however, "offsetof" typically gives meaningful
5117 results. This flag is for users who are aware that they are
5118 writing nonportable code and who have deliberately chosen to ignore
5119 the warning about it.
5120
5121 The restrictions on "offsetof" may be relaxed in a future version
5122 of the C++ standard.
5123
5124 -Wint-in-bool-context
5125 Warn for suspicious use of integer values where boolean values are
5126 expected, such as conditional expressions (?:) using non-boolean
5127 integer constants in boolean context, like "if (a <= b ? 2 : 3)".
5128 Or left shifting of signed integers in boolean context, like "for
5129 (a = 0; 1 << a; a++);". Likewise for all kinds of multiplications
5130 regardless of the data type. This warning is enabled by -Wall.
5131
5132 -Wno-int-to-pointer-cast
5133 Suppress warnings from casts to pointer type of an integer of a
5134 different size. In C++, casting to a pointer type of smaller size
5135 is an error. Wint-to-pointer-cast is enabled by default.
5136
5137 -Wno-pointer-to-int-cast (C and Objective-C only)
5138 Suppress warnings from casts from a pointer to an integer type of a
5139 different size.
5140
5141 -Winvalid-pch
5142 Warn if a precompiled header is found in the search path but cannot
5143 be used.
5144
5145 -Wlong-long
5146 Warn if "long long" type is used. This is enabled by either
5147 -Wpedantic or -Wtraditional in ISO C90 and C++98 modes. To inhibit
5148 the warning messages, use -Wno-long-long.
5149
5150 -Wvariadic-macros
5151 Warn if variadic macros are used in ISO C90 mode, or if the GNU
5152 alternate syntax is used in ISO C99 mode. This is enabled by
5153 either -Wpedantic or -Wtraditional. To inhibit the warning
5154 messages, use -Wno-variadic-macros.
5155
5156 -Wvarargs
5157 Warn upon questionable usage of the macros used to handle variable
5158 arguments like "va_start". This is default. To inhibit the
5159 warning messages, use -Wno-varargs.
5160
5161 -Wvector-operation-performance
5162 Warn if vector operation is not implemented via SIMD capabilities
5163 of the architecture. Mainly useful for the performance tuning.
5164 Vector operation can be implemented "piecewise", which means that
5165 the scalar operation is performed on every vector element; "in
5166 parallel", which means that the vector operation is implemented
5167 using scalars of wider type, which normally is more performance
5168 efficient; and "as a single scalar", which means that vector fits
5169 into a scalar type.
5170
5171 -Wno-virtual-move-assign
5172 Suppress warnings about inheriting from a virtual base with a non-
5173 trivial C++11 move assignment operator. This is dangerous because
5174 if the virtual base is reachable along more than one path, it is
5175 moved multiple times, which can mean both objects end up in the
5176 moved-from state. If the move assignment operator is written to
5177 avoid moving from a moved-from object, this warning can be
5178 disabled.
5179
5180 -Wvla
5181 Warn if a variable-length array is used in the code. -Wno-vla
5182 prevents the -Wpedantic warning of the variable-length array.
5183
5184 -Wvla-larger-than=n
5185 If this option is used, the compiler will warn on uses of variable-
5186 length arrays where the size is either unbounded, or bounded by an
5187 argument that can be larger than n bytes. This is similar to how
5188 -Walloca-larger-than=n works, but with variable-length arrays.
5189
5190 Note that GCC may optimize small variable-length arrays of a known
5191 value into plain arrays, so this warning may not get triggered for
5192 such arrays.
5193
5194 This warning is not enabled by -Wall, and is only active when
5195 -ftree-vrp is active (default for -O2 and above).
5196
5197 See also -Walloca-larger-than=n.
5198
5199 -Wvolatile-register-var
5200 Warn if a register variable is declared volatile. The volatile
5201 modifier does not inhibit all optimizations that may eliminate
5202 reads and/or writes to register variables. This warning is enabled
5203 by -Wall.
5204
5205 -Wdisabled-optimization
5206 Warn if a requested optimization pass is disabled. This warning
5207 does not generally indicate that there is anything wrong with your
5208 code; it merely indicates that GCC's optimizers are unable to
5209 handle the code effectively. Often, the problem is that your code
5210 is too big or too complex; GCC refuses to optimize programs when
5211 the optimization itself is likely to take inordinate amounts of
5212 time.
5213
5214 -Wpointer-sign (C and Objective-C only)
5215 Warn for pointer argument passing or assignment with different
5216 signedness. This option is only supported for C and Objective-C.
5217 It is implied by -Wall and by -Wpedantic, which can be disabled
5218 with -Wno-pointer-sign.
5219
5220 -Wstack-protector
5221 This option is only active when -fstack-protector is active. It
5222 warns about functions that are not protected against stack
5223 smashing.
5224
5225 -Woverlength-strings
5226 Warn about string constants that are longer than the "minimum
5227 maximum" length specified in the C standard. Modern compilers
5228 generally allow string constants that are much longer than the
5229 standard's minimum limit, but very portable programs should avoid
5230 using longer strings.
5231
5232 The limit applies after string constant concatenation, and does not
5233 count the trailing NUL. In C90, the limit was 509 characters; in
5234 C99, it was raised to 4095. C++98 does not specify a normative
5235 minimum maximum, so we do not diagnose overlength strings in C++.
5236
5237 This option is implied by -Wpedantic, and can be disabled with
5238 -Wno-overlength-strings.
5239
5240 -Wunsuffixed-float-constants (C and Objective-C only)
5241 Issue a warning for any floating constant that does not have a
5242 suffix. When used together with -Wsystem-headers it warns about
5243 such constants in system header files. This can be useful when
5244 preparing code to use with the "FLOAT_CONST_DECIMAL64" pragma from
5245 the decimal floating-point extension to C99.
5246
5247 -Wno-designated-init (C and Objective-C only)
5248 Suppress warnings when a positional initializer is used to
5249 initialize a structure that has been marked with the
5250 "designated_init" attribute.
5251
5252 -Whsa
5253 Issue a warning when HSAIL cannot be emitted for the compiled
5254 function or OpenMP construct.
5255
5256 Options for Debugging Your Program
5257 To tell GCC to emit extra information for use by a debugger, in almost
5258 all cases you need only to add -g to your other options.
5259
5260 GCC allows you to use -g with -O. The shortcuts taken by optimized
5261 code may occasionally be surprising: some variables you declared may
5262 not exist at all; flow of control may briefly move where you did not
5263 expect it; some statements may not be executed because they compute
5264 constant results or their values are already at hand; some statements
5265 may execute in different places because they have been moved out of
5266 loops. Nevertheless it is possible to debug optimized output. This
5267 makes it reasonable to use the optimizer for programs that might have
5268 bugs.
5269
5270 If you are not using some other optimization option, consider using -Og
5271 with -g. With no -O option at all, some compiler passes that collect
5272 information useful for debugging do not run at all, so that -Og may
5273 result in a better debugging experience.
5274
5275 -g Produce debugging information in the operating system's native
5276 format (stabs, COFF, XCOFF, or DWARF). GDB can work with this
5277 debugging information.
5278
5279 On most systems that use stabs format, -g enables use of extra
5280 debugging information that only GDB can use; this extra information
5281 makes debugging work better in GDB but probably makes other
5282 debuggers crash or refuse to read the program. If you want to
5283 control for certain whether to generate the extra information, use
5284 -gstabs+, -gstabs, -gxcoff+, -gxcoff, or -gvms (see below).
5285
5286 -ggdb
5287 Produce debugging information for use by GDB. This means to use
5288 the most expressive format available (DWARF, stabs, or the native
5289 format if neither of those are supported), including GDB extensions
5290 if at all possible.
5291
5292 -gdwarf
5293 -gdwarf-version
5294 Produce debugging information in DWARF format (if that is
5295 supported). The value of version may be either 2, 3, 4 or 5; the
5296 default version for most targets is 4. DWARF Version 5 is only
5297 experimental.
5298
5299 Note that with DWARF Version 2, some ports require and always use
5300 some non-conflicting DWARF 3 extensions in the unwind tables.
5301
5302 Version 4 may require GDB 7.0 and -fvar-tracking-assignments for
5303 maximum benefit.
5304
5305 GCC no longer supports DWARF Version 1, which is substantially
5306 different than Version 2 and later. For historical reasons, some
5307 other DWARF-related options (including -feliminate-dwarf2-dups and
5308 -fno-dwarf2-cfi-asm) retain a reference to DWARF Version 2 in their
5309 names, but apply to all currently-supported versions of DWARF.
5310
5311 -gstabs
5312 Produce debugging information in stabs format (if that is
5313 supported), without GDB extensions. This is the format used by DBX
5314 on most BSD systems. On MIPS, Alpha and System V Release 4 systems
5315 this option produces stabs debugging output that is not understood
5316 by DBX or SDB. On System V Release 4 systems this option requires
5317 the GNU assembler.
5318
5319 -gstabs+
5320 Produce debugging information in stabs format (if that is
5321 supported), using GNU extensions understood only by the GNU
5322 debugger (GDB). The use of these extensions is likely to make
5323 other debuggers crash or refuse to read the program.
5324
5325 -gcoff
5326 Produce debugging information in COFF format (if that is
5327 supported). This is the format used by SDB on most System V
5328 systems prior to System V Release 4.
5329
5330 -gxcoff
5331 Produce debugging information in XCOFF format (if that is
5332 supported). This is the format used by the DBX debugger on IBM
5333 RS/6000 systems.
5334
5335 -gxcoff+
5336 Produce debugging information in XCOFF format (if that is
5337 supported), using GNU extensions understood only by the GNU
5338 debugger (GDB). The use of these extensions is likely to make
5339 other debuggers crash or refuse to read the program, and may cause
5340 assemblers other than the GNU assembler (GAS) to fail with an
5341 error.
5342
5343 -gvms
5344 Produce debugging information in Alpha/VMS debug format (if that is
5345 supported). This is the format used by DEBUG on Alpha/VMS systems.
5346
5347 -glevel
5348 -ggdblevel
5349 -gstabslevel
5350 -gcofflevel
5351 -gxcofflevel
5352 -gvmslevel
5353 Request debugging information and also use level to specify how
5354 much information. The default level is 2.
5355
5356 Level 0 produces no debug information at all. Thus, -g0 negates
5357 -g.
5358
5359 Level 1 produces minimal information, enough for making backtraces
5360 in parts of the program that you don't plan to debug. This
5361 includes descriptions of functions and external variables, and line
5362 number tables, but no information about local variables.
5363
5364 Level 3 includes extra information, such as all the macro
5365 definitions present in the program. Some debuggers support macro
5366 expansion when you use -g3.
5367
5368 -gdwarf does not accept a concatenated debug level, to avoid
5369 confusion with -gdwarf-level. Instead use an additional -glevel
5370 option to change the debug level for DWARF.
5371
5372 -feliminate-unused-debug-symbols
5373 Produce debugging information in stabs format (if that is
5374 supported), for only symbols that are actually used.
5375
5376 -femit-class-debug-always
5377 Instead of emitting debugging information for a C++ class in only
5378 one object file, emit it in all object files using the class. This
5379 option should be used only with debuggers that are unable to handle
5380 the way GCC normally emits debugging information for classes
5381 because using this option increases the size of debugging
5382 information by as much as a factor of two.
5383
5384 -fno-merge-debug-strings
5385 Direct the linker to not merge together strings in the debugging
5386 information that are identical in different object files. Merging
5387 is not supported by all assemblers or linkers. Merging decreases
5388 the size of the debug information in the output file at the cost of
5389 increasing link processing time. Merging is enabled by default.
5390
5391 -fdebug-prefix-map=old=new
5392 When compiling files in directory old, record debugging information
5393 describing them as in new instead.
5394
5395 -fvar-tracking
5396 Run variable tracking pass. It computes where variables are stored
5397 at each position in code. Better debugging information is then
5398 generated (if the debugging information format supports this
5399 information).
5400
5401 It is enabled by default when compiling with optimization (-Os, -O,
5402 -O2, ...), debugging information (-g) and the debug info format
5403 supports it.
5404
5405 -fvar-tracking-assignments
5406 Annotate assignments to user variables early in the compilation and
5407 attempt to carry the annotations over throughout the compilation
5408 all the way to the end, in an attempt to improve debug information
5409 while optimizing. Use of -gdwarf-4 is recommended along with it.
5410
5411 It can be enabled even if var-tracking is disabled, in which case
5412 annotations are created and maintained, but discarded at the end.
5413 By default, this flag is enabled together with -fvar-tracking,
5414 except when selective scheduling is enabled.
5415
5416 -gsplit-dwarf
5417 Separate as much DWARF debugging information as possible into a
5418 separate output file with the extension .dwo. This option allows
5419 the build system to avoid linking files with debug information. To
5420 be useful, this option requires a debugger capable of reading .dwo
5421 files.
5422
5423 -gpubnames
5424 Generate DWARF ".debug_pubnames" and ".debug_pubtypes" sections.
5425
5426 -ggnu-pubnames
5427 Generate ".debug_pubnames" and ".debug_pubtypes" sections in a
5428 format suitable for conversion into a GDB index. This option is
5429 only useful with a linker that can produce GDB index version 7.
5430
5431 -fdebug-types-section
5432 When using DWARF Version 4 or higher, type DIEs can be put into
5433 their own ".debug_types" section instead of making them part of the
5434 ".debug_info" section. It is more efficient to put them in a
5435 separate comdat sections since the linker can then remove
5436 duplicates. But not all DWARF consumers support ".debug_types"
5437 sections yet and on some objects ".debug_types" produces larger
5438 instead of smaller debugging information.
5439
5440 -grecord-gcc-switches
5441 -gno-record-gcc-switches
5442 This switch causes the command-line options used to invoke the
5443 compiler that may affect code generation to be appended to the
5444 DW_AT_producer attribute in DWARF debugging information. The
5445 options are concatenated with spaces separating them from each
5446 other and from the compiler version. It is enabled by default.
5447 See also -frecord-gcc-switches for another way of storing compiler
5448 options into the object file.
5449
5450 -gstrict-dwarf
5451 Disallow using extensions of later DWARF standard version than
5452 selected with -gdwarf-version. On most targets using non-
5453 conflicting DWARF extensions from later standard versions is
5454 allowed.
5455
5456 -gno-strict-dwarf
5457 Allow using extensions of later DWARF standard version than
5458 selected with -gdwarf-version.
5459
5460 -gcolumn-info
5461 -gno-column-info
5462 Emit location column information into DWARF debugging information,
5463 rather than just file and line. This option is disabled by
5464 default.
5465
5466 -gz[=type]
5467 Produce compressed debug sections in DWARF format, if that is
5468 supported. If type is not given, the default type depends on the
5469 capabilities of the assembler and linker used. type may be one of
5470 none (don't compress debug sections), zlib (use zlib compression in
5471 ELF gABI format), or zlib-gnu (use zlib compression in traditional
5472 GNU format). If the linker doesn't support writing compressed
5473 debug sections, the option is rejected. Otherwise, if the
5474 assembler does not support them, -gz is silently ignored when
5475 producing object files.
5476
5477 -feliminate-dwarf2-dups
5478 Compress DWARF debugging information by eliminating duplicated
5479 information about each symbol. This option only makes sense when
5480 generating DWARF debugging information.
5481
5482 -femit-struct-debug-baseonly
5483 Emit debug information for struct-like types only when the base
5484 name of the compilation source file matches the base name of file
5485 in which the struct is defined.
5486
5487 This option substantially reduces the size of debugging
5488 information, but at significant potential loss in type information
5489 to the debugger. See -femit-struct-debug-reduced for a less
5490 aggressive option. See -femit-struct-debug-detailed for more
5491 detailed control.
5492
5493 This option works only with DWARF debug output.
5494
5495 -femit-struct-debug-reduced
5496 Emit debug information for struct-like types only when the base
5497 name of the compilation source file matches the base name of file
5498 in which the type is defined, unless the struct is a template or
5499 defined in a system header.
5500
5501 This option significantly reduces the size of debugging
5502 information, with some potential loss in type information to the
5503 debugger. See -femit-struct-debug-baseonly for a more aggressive
5504 option. See -femit-struct-debug-detailed for more detailed
5505 control.
5506
5507 This option works only with DWARF debug output.
5508
5509 -femit-struct-debug-detailed[=spec-list]
5510 Specify the struct-like types for which the compiler generates
5511 debug information. The intent is to reduce duplicate struct debug
5512 information between different object files within the same program.
5513
5514 This option is a detailed version of -femit-struct-debug-reduced
5515 and -femit-struct-debug-baseonly, which serves for most needs.
5516
5517 A specification has the
5518 syntax[dir:|ind:][ord:|gen:](any|sys|base|none)
5519
5520 The optional first word limits the specification to structs that
5521 are used directly (dir:) or used indirectly (ind:). A struct type
5522 is used directly when it is the type of a variable, member.
5523 Indirect uses arise through pointers to structs. That is, when use
5524 of an incomplete struct is valid, the use is indirect. An example
5525 is struct one direct; struct two * indirect;.
5526
5527 The optional second word limits the specification to ordinary
5528 structs (ord:) or generic structs (gen:). Generic structs are a
5529 bit complicated to explain. For C++, these are non-explicit
5530 specializations of template classes, or non-template classes within
5531 the above. Other programming languages have generics, but
5532 -femit-struct-debug-detailed does not yet implement them.
5533
5534 The third word specifies the source files for those structs for
5535 which the compiler should emit debug information. The values none
5536 and any have the normal meaning. The value base means that the
5537 base of name of the file in which the type declaration appears must
5538 match the base of the name of the main compilation file. In
5539 practice, this means that when compiling foo.c, debug information
5540 is generated for types declared in that file and foo.h, but not
5541 other header files. The value sys means those types satisfying
5542 base or declared in system or compiler headers.
5543
5544 You may need to experiment to determine the best settings for your
5545 application.
5546
5547 The default is -femit-struct-debug-detailed=all.
5548
5549 This option works only with DWARF debug output.
5550
5551 -fno-dwarf2-cfi-asm
5552 Emit DWARF unwind info as compiler generated ".eh_frame" section
5553 instead of using GAS ".cfi_*" directives.
5554
5555 -fno-eliminate-unused-debug-types
5556 Normally, when producing DWARF output, GCC avoids producing debug
5557 symbol output for types that are nowhere used in the source file
5558 being compiled. Sometimes it is useful to have GCC emit debugging
5559 information for all types declared in a compilation unit,
5560 regardless of whether or not they are actually used in that
5561 compilation unit, for example if, in the debugger, you want to cast
5562 a value to a type that is not actually used in your program (but is
5563 declared). More often, however, this results in a significant
5564 amount of wasted space.
5565
5566 Options That Control Optimization
5567 These options control various sorts of optimizations.
5568
5569 Without any optimization option, the compiler's goal is to reduce the
5570 cost of compilation and to make debugging produce the expected results.
5571 Statements are independent: if you stop the program with a breakpoint
5572 between statements, you can then assign a new value to any variable or
5573 change the program counter to any other statement in the function and
5574 get exactly the results you expect from the source code.
5575
5576 Turning on optimization flags makes the compiler attempt to improve the
5577 performance and/or code size at the expense of compilation time and
5578 possibly the ability to debug the program.
5579
5580 The compiler performs optimization based on the knowledge it has of the
5581 program. Compiling multiple files at once to a single output file mode
5582 allows the compiler to use information gained from all of the files
5583 when compiling each of them.
5584
5585 Not all optimizations are controlled directly by a flag. Only
5586 optimizations that have a flag are listed in this section.
5587
5588 Most optimizations are only enabled if an -O level is set on the
5589 command line. Otherwise they are disabled, even if individual
5590 optimization flags are specified.
5591
5592 Depending on the target and how GCC was configured, a slightly
5593 different set of optimizations may be enabled at each -O level than
5594 those listed here. You can invoke GCC with -Q --help=optimizers to
5595 find out the exact set of optimizations that are enabled at each level.
5596
5597 -O
5598 -O1 Optimize. Optimizing compilation takes somewhat more time, and a
5599 lot more memory for a large function.
5600
5601 With -O, the compiler tries to reduce code size and execution time,
5602 without performing any optimizations that take a great deal of
5603 compilation time.
5604
5605 -O turns on the following optimization flags:
5606
5607 -fauto-inc-dec -fbranch-count-reg -fcombine-stack-adjustments
5608 -fcompare-elim -fcprop-registers -fdce -fdefer-pop -fdelayed-branch
5609 -fdse -fforward-propagate -fguess-branch-probability
5610 -fif-conversion2 -fif-conversion -finline-functions-called-once
5611 -fipa-pure-const -fipa-profile -fipa-reference -fmerge-constants
5612 -fmove-loop-invariants -freorder-blocks -fshrink-wrap
5613 -fshrink-wrap-separate -fsplit-wide-types -fssa-backprop
5614 -fssa-phiopt -ftree-bit-ccp -ftree-ccp -ftree-ch
5615 -ftree-coalesce-vars -ftree-copy-prop -ftree-dce
5616 -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre
5617 -ftree-phiprop -ftree-sink -ftree-slsr -ftree-sra -ftree-pta
5618 -ftree-ter -funit-at-a-time
5619
5620 -O also turns on -fomit-frame-pointer on machines where doing so
5621 does not interfere with debugging.
5622
5623 -O2 Optimize even more. GCC performs nearly all supported
5624 optimizations that do not involve a space-speed tradeoff. As
5625 compared to -O, this option increases both compilation time and the
5626 performance of the generated code.
5627
5628 -O2 turns on all optimization flags specified by -O. It also turns
5629 on the following optimization flags: -fthread-jumps
5630 -falign-functions -falign-jumps -falign-loops -falign-labels
5631 -fcaller-saves -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks
5632 -fdelete-null-pointer-checks -fdevirtualize
5633 -fdevirtualize-speculatively -fexpensive-optimizations -fgcse
5634 -fgcse-lm -fhoist-adjacent-loads -finline-small-functions
5635 -findirect-inlining -fipa-cp -fipa-bit-cp -fipa-vrp -fipa-sra
5636 -fipa-icf -fisolate-erroneous-paths-dereference -flra-remat
5637 -foptimize-sibling-calls -foptimize-strlen -fpartial-inlining
5638 -fpeephole2 -freorder-blocks-algorithm=stc
5639 -freorder-blocks-and-partition -freorder-functions
5640 -frerun-cse-after-loop -fsched-interblock -fsched-spec
5641 -fschedule-insns -fschedule-insns2 -fstore-merging
5642 -fstrict-aliasing -fstrict-overflow -ftree-builtin-call-dce
5643 -ftree-switch-conversion -ftree-tail-merge -fcode-hoisting
5644 -ftree-pre -ftree-vrp -fipa-ra
5645
5646 Please note the warning under -fgcse about invoking -O2 on programs
5647 that use computed gotos.
5648
5649 -O3 Optimize yet more. -O3 turns on all optimizations specified by -O2
5650 and also turns on the -finline-functions, -funswitch-loops,
5651 -fpredictive-commoning, -fgcse-after-reload, -ftree-loop-vectorize,
5652 -ftree-loop-distribute-patterns, -fsplit-paths
5653 -ftree-slp-vectorize, -fvect-cost-model, -ftree-partial-pre,
5654 -fpeel-loops and -fipa-cp-clone options.
5655
5656 -O0 Reduce compilation time and make debugging produce the expected
5657 results. This is the default.
5658
5659 -Os Optimize for size. -Os enables all -O2 optimizations that do not
5660 typically increase code size. It also performs further
5661 optimizations designed to reduce code size.
5662
5663 -Os disables the following optimization flags: -falign-functions
5664 -falign-jumps -falign-loops -falign-labels -freorder-blocks
5665 -freorder-blocks-algorithm=stc -freorder-blocks-and-partition
5666 -fprefetch-loop-arrays
5667
5668 -Ofast
5669 Disregard strict standards compliance. -Ofast enables all -O3
5670 optimizations. It also enables optimizations that are not valid
5671 for all standard-compliant programs. It turns on -ffast-math and
5672 the Fortran-specific -fno-protect-parens and -fstack-arrays.
5673
5674 -Og Optimize debugging experience. -Og enables optimizations that do
5675 not interfere with debugging. It should be the optimization level
5676 of choice for the standard edit-compile-debug cycle, offering a
5677 reasonable level of optimization while maintaining fast compilation
5678 and a good debugging experience.
5679
5680 If you use multiple -O options, with or without level numbers, the last
5681 such option is the one that is effective.
5682
5683 Options of the form -fflag specify machine-independent flags. Most
5684 flags have both positive and negative forms; the negative form of -ffoo
5685 is -fno-foo. In the table below, only one of the forms is listed---the
5686 one you typically use. You can figure out the other form by either
5687 removing no- or adding it.
5688
5689 The following options control specific optimizations. They are either
5690 activated by -O options or are related to ones that are. You can use
5691 the following flags in the rare cases when "fine-tuning" of
5692 optimizations to be performed is desired.
5693
5694 -fno-defer-pop
5695 Always pop the arguments to each function call as soon as that
5696 function returns. For machines that must pop arguments after a
5697 function call, the compiler normally lets arguments accumulate on
5698 the stack for several function calls and pops them all at once.
5699
5700 Disabled at levels -O, -O2, -O3, -Os.
5701
5702 -fforward-propagate
5703 Perform a forward propagation pass on RTL. The pass tries to
5704 combine two instructions and checks if the result can be
5705 simplified. If loop unrolling is active, two passes are performed
5706 and the second is scheduled after loop unrolling.
5707
5708 This option is enabled by default at optimization levels -O, -O2,
5709 -O3, -Os.
5710
5711 -ffp-contract=style
5712 -ffp-contract=off disables floating-point expression contraction.
5713 -ffp-contract=fast enables floating-point expression contraction
5714 such as forming of fused multiply-add operations if the target has
5715 native support for them. -ffp-contract=on enables floating-point
5716 expression contraction if allowed by the language standard. This
5717 is currently not implemented and treated equal to
5718 -ffp-contract=off.
5719
5720 The default is -ffp-contract=fast.
5721
5722 -fomit-frame-pointer
5723 Don't keep the frame pointer in a register for functions that don't
5724 need one. This avoids the instructions to save, set up and restore
5725 frame pointers; it also makes an extra register available in many
5726 functions. It also makes debugging impossible on some machines.
5727
5728 On some machines, such as the VAX, this flag has no effect, because
5729 the standard calling sequence automatically handles the frame
5730 pointer and nothing is saved by pretending it doesn't exist. The
5731 machine-description macro "FRAME_POINTER_REQUIRED" controls whether
5732 a target machine supports this flag.
5733
5734 The default setting (when not optimizing for size) for 32-bit
5735 GNU/Linux x86 and 32-bit Darwin x86 targets is
5736 -fomit-frame-pointer. You can configure GCC with the
5737 --enable-frame-pointer configure option to change the default.
5738
5739 Enabled at levels -O, -O2, -O3, -Os.
5740
5741 -foptimize-sibling-calls
5742 Optimize sibling and tail recursive calls.
5743
5744 Enabled at levels -O2, -O3, -Os.
5745
5746 -foptimize-strlen
5747 Optimize various standard C string functions (e.g. "strlen",
5748 "strchr" or "strcpy") and their "_FORTIFY_SOURCE" counterparts into
5749 faster alternatives.
5750
5751 Enabled at levels -O2, -O3.
5752
5753 -fno-inline
5754 Do not expand any functions inline apart from those marked with the
5755 "always_inline" attribute. This is the default when not
5756 optimizing.
5757
5758 Single functions can be exempted from inlining by marking them with
5759 the "noinline" attribute.
5760
5761 -finline-small-functions
5762 Integrate functions into their callers when their body is smaller
5763 than expected function call code (so overall size of program gets
5764 smaller). The compiler heuristically decides which functions are
5765 simple enough to be worth integrating in this way. This inlining
5766 applies to all functions, even those not declared inline.
5767
5768 Enabled at level -O2.
5769
5770 -findirect-inlining
5771 Inline also indirect calls that are discovered to be known at
5772 compile time thanks to previous inlining. This option has any
5773 effect only when inlining itself is turned on by the
5774 -finline-functions or -finline-small-functions options.
5775
5776 Enabled at level -O2.
5777
5778 -finline-functions
5779 Consider all functions for inlining, even if they are not declared
5780 inline. The compiler heuristically decides which functions are
5781 worth integrating in this way.
5782
5783 If all calls to a given function are integrated, and the function
5784 is declared "static", then the function is normally not output as
5785 assembler code in its own right.
5786
5787 Enabled at level -O3.
5788
5789 -finline-functions-called-once
5790 Consider all "static" functions called once for inlining into their
5791 caller even if they are not marked "inline". If a call to a given
5792 function is integrated, then the function is not output as
5793 assembler code in its own right.
5794
5795 Enabled at levels -O1, -O2, -O3 and -Os.
5796
5797 -fearly-inlining
5798 Inline functions marked by "always_inline" and functions whose body
5799 seems smaller than the function call overhead early before doing
5800 -fprofile-generate instrumentation and real inlining pass. Doing
5801 so makes profiling significantly cheaper and usually inlining
5802 faster on programs having large chains of nested wrapper functions.
5803
5804 Enabled by default.
5805
5806 -fipa-sra
5807 Perform interprocedural scalar replacement of aggregates, removal
5808 of unused parameters and replacement of parameters passed by
5809 reference by parameters passed by value.
5810
5811 Enabled at levels -O2, -O3 and -Os.
5812
5813 -finline-limit=n
5814 By default, GCC limits the size of functions that can be inlined.
5815 This flag allows coarse control of this limit. n is the size of
5816 functions that can be inlined in number of pseudo instructions.
5817
5818 Inlining is actually controlled by a number of parameters, which
5819 may be specified individually by using --param name=value. The
5820 -finline-limit=n option sets some of these parameters as follows:
5821
5822 max-inline-insns-single
5823 is set to n/2.
5824
5825 max-inline-insns-auto
5826 is set to n/2.
5827
5828 See below for a documentation of the individual parameters
5829 controlling inlining and for the defaults of these parameters.
5830
5831 Note: there may be no value to -finline-limit that results in
5832 default behavior.
5833
5834 Note: pseudo instruction represents, in this particular context, an
5835 abstract measurement of function's size. In no way does it
5836 represent a count of assembly instructions and as such its exact
5837 meaning might change from one release to an another.
5838
5839 -fno-keep-inline-dllexport
5840 This is a more fine-grained version of -fkeep-inline-functions,
5841 which applies only to functions that are declared using the
5842 "dllexport" attribute or declspec.
5843
5844 -fkeep-inline-functions
5845 In C, emit "static" functions that are declared "inline" into the
5846 object file, even if the function has been inlined into all of its
5847 callers. This switch does not affect functions using the "extern
5848 inline" extension in GNU C90. In C++, emit any and all inline
5849 functions into the object file.
5850
5851 -fkeep-static-functions
5852 Emit "static" functions into the object file, even if the function
5853 is never used.
5854
5855 -fkeep-static-consts
5856 Emit variables declared "static const" when optimization isn't
5857 turned on, even if the variables aren't referenced.
5858
5859 GCC enables this option by default. If you want to force the
5860 compiler to check if a variable is referenced, regardless of
5861 whether or not optimization is turned on, use the
5862 -fno-keep-static-consts option.
5863
5864 -fmerge-constants
5865 Attempt to merge identical constants (string constants and
5866 floating-point constants) across compilation units.
5867
5868 This option is the default for optimized compilation if the
5869 assembler and linker support it. Use -fno-merge-constants to
5870 inhibit this behavior.
5871
5872 Enabled at levels -O, -O2, -O3, -Os.
5873
5874 -fmerge-all-constants
5875 Attempt to merge identical constants and identical variables.
5876
5877 This option implies -fmerge-constants. In addition to
5878 -fmerge-constants this considers e.g. even constant initialized
5879 arrays or initialized constant variables with integral or floating-
5880 point types. Languages like C or C++ require each variable,
5881 including multiple instances of the same variable in recursive
5882 calls, to have distinct locations, so using this option results in
5883 non-conforming behavior.
5884
5885 -fmodulo-sched
5886 Perform swing modulo scheduling immediately before the first
5887 scheduling pass. This pass looks at innermost loops and reorders
5888 their instructions by overlapping different iterations.
5889
5890 -fmodulo-sched-allow-regmoves
5891 Perform more aggressive SMS-based modulo scheduling with register
5892 moves allowed. By setting this flag certain anti-dependences edges
5893 are deleted, which triggers the generation of reg-moves based on
5894 the life-range analysis. This option is effective only with
5895 -fmodulo-sched enabled.
5896
5897 -fno-branch-count-reg
5898 Avoid running a pass scanning for opportunities to use "decrement
5899 and branch" instructions on a count register instead of generating
5900 sequences of instructions that decrement a register, compare it
5901 against zero, and then branch based upon the result. This option
5902 is only meaningful on architectures that support such instructions,
5903 which include x86, PowerPC, IA-64 and S/390. Note that the
5904 -fno-branch-count-reg option doesn't remove the decrement and
5905 branch instructions from the generated instruction stream
5906 introduced by other optimization passes.
5907
5908 Enabled by default at -O1 and higher.
5909
5910 The default is -fbranch-count-reg.
5911
5912 -fno-function-cse
5913 Do not put function addresses in registers; make each instruction
5914 that calls a constant function contain the function's address
5915 explicitly.
5916
5917 This option results in less efficient code, but some strange hacks
5918 that alter the assembler output may be confused by the
5919 optimizations performed when this option is not used.
5920
5921 The default is -ffunction-cse
5922
5923 -fno-zero-initialized-in-bss
5924 If the target supports a BSS section, GCC by default puts variables
5925 that are initialized to zero into BSS. This can save space in the
5926 resulting code.
5927
5928 This option turns off this behavior because some programs
5929 explicitly rely on variables going to the data section---e.g., so
5930 that the resulting executable can find the beginning of that
5931 section and/or make assumptions based on that.
5932
5933 The default is -fzero-initialized-in-bss.
5934
5935 -fthread-jumps
5936 Perform optimizations that check to see if a jump branches to a
5937 location where another comparison subsumed by the first is found.
5938 If so, the first branch is redirected to either the destination of
5939 the second branch or a point immediately following it, depending on
5940 whether the condition is known to be true or false.
5941
5942 Enabled at levels -O2, -O3, -Os.
5943
5944 -fsplit-wide-types
5945 When using a type that occupies multiple registers, such as "long
5946 long" on a 32-bit system, split the registers apart and allocate
5947 them independently. This normally generates better code for those
5948 types, but may make debugging more difficult.
5949
5950 Enabled at levels -O, -O2, -O3, -Os.
5951
5952 -fcse-follow-jumps
5953 In common subexpression elimination (CSE), scan through jump
5954 instructions when the target of the jump is not reached by any
5955 other path. For example, when CSE encounters an "if" statement
5956 with an "else" clause, CSE follows the jump when the condition
5957 tested is false.
5958
5959 Enabled at levels -O2, -O3, -Os.
5960
5961 -fcse-skip-blocks
5962 This is similar to -fcse-follow-jumps, but causes CSE to follow
5963 jumps that conditionally skip over blocks. When CSE encounters a
5964 simple "if" statement with no else clause, -fcse-skip-blocks causes
5965 CSE to follow the jump around the body of the "if".
5966
5967 Enabled at levels -O2, -O3, -Os.
5968
5969 -frerun-cse-after-loop
5970 Re-run common subexpression elimination after loop optimizations
5971 are performed.
5972
5973 Enabled at levels -O2, -O3, -Os.
5974
5975 -fgcse
5976 Perform a global common subexpression elimination pass. This pass
5977 also performs global constant and copy propagation.
5978
5979 Note: When compiling a program using computed gotos, a GCC
5980 extension, you may get better run-time performance if you disable
5981 the global common subexpression elimination pass by adding
5982 -fno-gcse to the command line.
5983
5984 Enabled at levels -O2, -O3, -Os.
5985
5986 -fgcse-lm
5987 When -fgcse-lm is enabled, global common subexpression elimination
5988 attempts to move loads that are only killed by stores into
5989 themselves. This allows a loop containing a load/store sequence to
5990 be changed to a load outside the loop, and a copy/store within the
5991 loop.
5992
5993 Enabled by default when -fgcse is enabled.
5994
5995 -fgcse-sm
5996 When -fgcse-sm is enabled, a store motion pass is run after global
5997 common subexpression elimination. This pass attempts to move
5998 stores out of loops. When used in conjunction with -fgcse-lm,
5999 loops containing a load/store sequence can be changed to a load
6000 before the loop and a store after the loop.
6001
6002 Not enabled at any optimization level.
6003
6004 -fgcse-las
6005 When -fgcse-las is enabled, the global common subexpression
6006 elimination pass eliminates redundant loads that come after stores
6007 to the same memory location (both partial and full redundancies).
6008
6009 Not enabled at any optimization level.
6010
6011 -fgcse-after-reload
6012 When -fgcse-after-reload is enabled, a redundant load elimination
6013 pass is performed after reload. The purpose of this pass is to
6014 clean up redundant spilling.
6015
6016 -faggressive-loop-optimizations
6017 This option tells the loop optimizer to use language constraints to
6018 derive bounds for the number of iterations of a loop. This assumes
6019 that loop code does not invoke undefined behavior by for example
6020 causing signed integer overflows or out-of-bound array accesses.
6021 The bounds for the number of iterations of a loop are used to guide
6022 loop unrolling and peeling and loop exit test optimizations. This
6023 option is enabled by default.
6024
6025 -funconstrained-commons
6026 This option tells the compiler that variables declared in common
6027 blocks (e.g. Fortran) may later be overridden with longer trailing
6028 arrays. This prevents certain optimizations that depend on knowing
6029 the array bounds.
6030
6031 -fcrossjumping
6032 Perform cross-jumping transformation. This transformation unifies
6033 equivalent code and saves code size. The resulting code may or may
6034 not perform better than without cross-jumping.
6035
6036 Enabled at levels -O2, -O3, -Os.
6037
6038 -fauto-inc-dec
6039 Combine increments or decrements of addresses with memory accesses.
6040 This pass is always skipped on architectures that do not have
6041 instructions to support this. Enabled by default at -O and higher
6042 on architectures that support this.
6043
6044 -fdce
6045 Perform dead code elimination (DCE) on RTL. Enabled by default at
6046 -O and higher.
6047
6048 -fdse
6049 Perform dead store elimination (DSE) on RTL. Enabled by default at
6050 -O and higher.
6051
6052 -fif-conversion
6053 Attempt to transform conditional jumps into branch-less
6054 equivalents. This includes use of conditional moves, min, max, set
6055 flags and abs instructions, and some tricks doable by standard
6056 arithmetics. The use of conditional execution on chips where it is
6057 available is controlled by -fif-conversion2.
6058
6059 Enabled at levels -O, -O2, -O3, -Os.
6060
6061 -fif-conversion2
6062 Use conditional execution (where available) to transform
6063 conditional jumps into branch-less equivalents.
6064
6065 Enabled at levels -O, -O2, -O3, -Os.
6066
6067 -fdeclone-ctor-dtor
6068 The C++ ABI requires multiple entry points for constructors and
6069 destructors: one for a base subobject, one for a complete object,
6070 and one for a virtual destructor that calls operator delete
6071 afterwards. For a hierarchy with virtual bases, the base and
6072 complete variants are clones, which means two copies of the
6073 function. With this option, the base and complete variants are
6074 changed to be thunks that call a common implementation.
6075
6076 Enabled by -Os.
6077
6078 -fdelete-null-pointer-checks
6079 Assume that programs cannot safely dereference null pointers, and
6080 that no code or data element resides at address zero. This option
6081 enables simple constant folding optimizations at all optimization
6082 levels. In addition, other optimization passes in GCC use this
6083 flag to control global dataflow analyses that eliminate useless
6084 checks for null pointers; these assume that a memory access to
6085 address zero always results in a trap, so that if a pointer is
6086 checked after it has already been dereferenced, it cannot be null.
6087
6088 Note however that in some environments this assumption is not true.
6089 Use -fno-delete-null-pointer-checks to disable this optimization
6090 for programs that depend on that behavior.
6091
6092 This option is enabled by default on most targets. On Nios II ELF,
6093 it defaults to off. On AVR and CR16, this option is completely
6094 disabled.
6095
6096 Passes that use the dataflow information are enabled independently
6097 at different optimization levels.
6098
6099 -fdevirtualize
6100 Attempt to convert calls to virtual functions to direct calls.
6101 This is done both within a procedure and interprocedurally as part
6102 of indirect inlining (-findirect-inlining) and interprocedural
6103 constant propagation (-fipa-cp). Enabled at levels -O2, -O3, -Os.
6104
6105 -fdevirtualize-speculatively
6106 Attempt to convert calls to virtual functions to speculative direct
6107 calls. Based on the analysis of the type inheritance graph,
6108 determine for a given call the set of likely targets. If the set is
6109 small, preferably of size 1, change the call into a conditional
6110 deciding between direct and indirect calls. The speculative calls
6111 enable more optimizations, such as inlining. When they seem
6112 useless after further optimization, they are converted back into
6113 original form.
6114
6115 -fdevirtualize-at-ltrans
6116 Stream extra information needed for aggressive devirtualization
6117 when running the link-time optimizer in local transformation mode.
6118 This option enables more devirtualization but significantly
6119 increases the size of streamed data. For this reason it is disabled
6120 by default.
6121
6122 -fexpensive-optimizations
6123 Perform a number of minor optimizations that are relatively
6124 expensive.
6125
6126 Enabled at levels -O2, -O3, -Os.
6127
6128 -free
6129 Attempt to remove redundant extension instructions. This is
6130 especially helpful for the x86-64 architecture, which implicitly
6131 zero-extends in 64-bit registers after writing to their lower
6132 32-bit half.
6133
6134 Enabled for Alpha, AArch64 and x86 at levels -O2, -O3, -Os.
6135
6136 -fno-lifetime-dse
6137 In C++ the value of an object is only affected by changes within
6138 its lifetime: when the constructor begins, the object has an
6139 indeterminate value, and any changes during the lifetime of the
6140 object are dead when the object is destroyed. Normally dead store
6141 elimination will take advantage of this; if your code relies on the
6142 value of the object storage persisting beyond the lifetime of the
6143 object, you can use this flag to disable this optimization. To
6144 preserve stores before the constructor starts (e.g. because your
6145 operator new clears the object storage) but still treat the object
6146 as dead after the destructor you, can use -flifetime-dse=1. The
6147 default behavior can be explicitly selected with -flifetime-dse=2.
6148 -flifetime-dse=0 is equivalent to -fno-lifetime-dse.
6149
6150 -flive-range-shrinkage
6151 Attempt to decrease register pressure through register live range
6152 shrinkage. This is helpful for fast processors with small or
6153 moderate size register sets.
6154
6155 -fira-algorithm=algorithm
6156 Use the specified coloring algorithm for the integrated register
6157 allocator. The algorithm argument can be priority, which specifies
6158 Chow's priority coloring, or CB, which specifies Chaitin-Briggs
6159 coloring. Chaitin-Briggs coloring is not implemented for all
6160 architectures, but for those targets that do support it, it is the
6161 default because it generates better code.
6162
6163 -fira-region=region
6164 Use specified regions for the integrated register allocator. The
6165 region argument should be one of the following:
6166
6167 all Use all loops as register allocation regions. This can give
6168 the best results for machines with a small and/or irregular
6169 register set.
6170
6171 mixed
6172 Use all loops except for loops with small register pressure as
6173 the regions. This value usually gives the best results in most
6174 cases and for most architectures, and is enabled by default
6175 when compiling with optimization for speed (-O, -O2, ...).
6176
6177 one Use all functions as a single region. This typically results
6178 in the smallest code size, and is enabled by default for -Os or
6179 -O0.
6180
6181 -fira-hoist-pressure
6182 Use IRA to evaluate register pressure in the code hoisting pass for
6183 decisions to hoist expressions. This option usually results in
6184 smaller code, but it can slow the compiler down.
6185
6186 This option is enabled at level -Os for all targets.
6187
6188 -fira-loop-pressure
6189 Use IRA to evaluate register pressure in loops for decisions to
6190 move loop invariants. This option usually results in generation of
6191 faster and smaller code on machines with large register files (>=
6192 32 registers), but it can slow the compiler down.
6193
6194 This option is enabled at level -O3 for some targets.
6195
6196 -fno-ira-share-save-slots
6197 Disable sharing of stack slots used for saving call-used hard
6198 registers living through a call. Each hard register gets a
6199 separate stack slot, and as a result function stack frames are
6200 larger.
6201
6202 -fno-ira-share-spill-slots
6203 Disable sharing of stack slots allocated for pseudo-registers.
6204 Each pseudo-register that does not get a hard register gets a
6205 separate stack slot, and as a result function stack frames are
6206 larger.
6207
6208 -flra-remat
6209 Enable CFG-sensitive rematerialization in LRA. Instead of loading
6210 values of spilled pseudos, LRA tries to rematerialize (recalculate)
6211 values if it is profitable.
6212
6213 Enabled at levels -O2, -O3, -Os.
6214
6215 -fdelayed-branch
6216 If supported for the target machine, attempt to reorder
6217 instructions to exploit instruction slots available after delayed
6218 branch instructions.
6219
6220 Enabled at levels -O, -O2, -O3, -Os.
6221
6222 -fschedule-insns
6223 If supported for the target machine, attempt to reorder
6224 instructions to eliminate execution stalls due to required data
6225 being unavailable. This helps machines that have slow floating
6226 point or memory load instructions by allowing other instructions to
6227 be issued until the result of the load or floating-point
6228 instruction is required.
6229
6230 Enabled at levels -O2, -O3.
6231
6232 -fschedule-insns2
6233 Similar to -fschedule-insns, but requests an additional pass of
6234 instruction scheduling after register allocation has been done.
6235 This is especially useful on machines with a relatively small
6236 number of registers and where memory load instructions take more
6237 than one cycle.
6238
6239 Enabled at levels -O2, -O3, -Os.
6240
6241 -fno-sched-interblock
6242 Don't schedule instructions across basic blocks. This is normally
6243 enabled by default when scheduling before register allocation, i.e.
6244 with -fschedule-insns or at -O2 or higher.
6245
6246 -fno-sched-spec
6247 Don't allow speculative motion of non-load instructions. This is
6248 normally enabled by default when scheduling before register
6249 allocation, i.e. with -fschedule-insns or at -O2 or higher.
6250
6251 -fsched-pressure
6252 Enable register pressure sensitive insn scheduling before register
6253 allocation. This only makes sense when scheduling before register
6254 allocation is enabled, i.e. with -fschedule-insns or at -O2 or
6255 higher. Usage of this option can improve the generated code and
6256 decrease its size by preventing register pressure increase above
6257 the number of available hard registers and subsequent spills in
6258 register allocation.
6259
6260 -fsched-spec-load
6261 Allow speculative motion of some load instructions. This only
6262 makes sense when scheduling before register allocation, i.e. with
6263 -fschedule-insns or at -O2 or higher.
6264
6265 -fsched-spec-load-dangerous
6266 Allow speculative motion of more load instructions. This only
6267 makes sense when scheduling before register allocation, i.e. with
6268 -fschedule-insns or at -O2 or higher.
6269
6270 -fsched-stalled-insns
6271 -fsched-stalled-insns=n
6272 Define how many insns (if any) can be moved prematurely from the
6273 queue of stalled insns into the ready list during the second
6274 scheduling pass. -fno-sched-stalled-insns means that no insns are
6275 moved prematurely, -fsched-stalled-insns=0 means there is no limit
6276 on how many queued insns can be moved prematurely.
6277 -fsched-stalled-insns without a value is equivalent to
6278 -fsched-stalled-insns=1.
6279
6280 -fsched-stalled-insns-dep
6281 -fsched-stalled-insns-dep=n
6282 Define how many insn groups (cycles) are examined for a dependency
6283 on a stalled insn that is a candidate for premature removal from
6284 the queue of stalled insns. This has an effect only during the
6285 second scheduling pass, and only if -fsched-stalled-insns is used.
6286 -fno-sched-stalled-insns-dep is equivalent to
6287 -fsched-stalled-insns-dep=0. -fsched-stalled-insns-dep without a
6288 value is equivalent to -fsched-stalled-insns-dep=1.
6289
6290 -fsched2-use-superblocks
6291 When scheduling after register allocation, use superblock
6292 scheduling. This allows motion across basic block boundaries,
6293 resulting in faster schedules. This option is experimental, as not
6294 all machine descriptions used by GCC model the CPU closely enough
6295 to avoid unreliable results from the algorithm.
6296
6297 This only makes sense when scheduling after register allocation,
6298 i.e. with -fschedule-insns2 or at -O2 or higher.
6299
6300 -fsched-group-heuristic
6301 Enable the group heuristic in the scheduler. This heuristic favors
6302 the instruction that belongs to a schedule group. This is enabled
6303 by default when scheduling is enabled, i.e. with -fschedule-insns
6304 or -fschedule-insns2 or at -O2 or higher.
6305
6306 -fsched-critical-path-heuristic
6307 Enable the critical-path heuristic in the scheduler. This
6308 heuristic favors instructions on the critical path. This is
6309 enabled by default when scheduling is enabled, i.e. with
6310 -fschedule-insns or -fschedule-insns2 or at -O2 or higher.
6311
6312 -fsched-spec-insn-heuristic
6313 Enable the speculative instruction heuristic in the scheduler.
6314 This heuristic favors speculative instructions with greater
6315 dependency weakness. This is enabled by default when scheduling is
6316 enabled, i.e. with -fschedule-insns or -fschedule-insns2 or at -O2
6317 or higher.
6318
6319 -fsched-rank-heuristic
6320 Enable the rank heuristic in the scheduler. This heuristic favors
6321 the instruction belonging to a basic block with greater size or
6322 frequency. This is enabled by default when scheduling is enabled,
6323 i.e. with -fschedule-insns or -fschedule-insns2 or at -O2 or
6324 higher.
6325
6326 -fsched-last-insn-heuristic
6327 Enable the last-instruction heuristic in the scheduler. This
6328 heuristic favors the instruction that is less dependent on the last
6329 instruction scheduled. This is enabled by default when scheduling
6330 is enabled, i.e. with -fschedule-insns or -fschedule-insns2 or at
6331 -O2 or higher.
6332
6333 -fsched-dep-count-heuristic
6334 Enable the dependent-count heuristic in the scheduler. This
6335 heuristic favors the instruction that has more instructions
6336 depending on it. This is enabled by default when scheduling is
6337 enabled, i.e. with -fschedule-insns or -fschedule-insns2 or at -O2
6338 or higher.
6339
6340 -freschedule-modulo-scheduled-loops
6341 Modulo scheduling is performed before traditional scheduling. If a
6342 loop is modulo scheduled, later scheduling passes may change its
6343 schedule. Use this option to control that behavior.
6344
6345 -fselective-scheduling
6346 Schedule instructions using selective scheduling algorithm.
6347 Selective scheduling runs instead of the first scheduler pass.
6348
6349 -fselective-scheduling2
6350 Schedule instructions using selective scheduling algorithm.
6351 Selective scheduling runs instead of the second scheduler pass.
6352
6353 -fsel-sched-pipelining
6354 Enable software pipelining of innermost loops during selective
6355 scheduling. This option has no effect unless one of
6356 -fselective-scheduling or -fselective-scheduling2 is turned on.
6357
6358 -fsel-sched-pipelining-outer-loops
6359 When pipelining loops during selective scheduling, also pipeline
6360 outer loops. This option has no effect unless
6361 -fsel-sched-pipelining is turned on.
6362
6363 -fsemantic-interposition
6364 Some object formats, like ELF, allow interposing of symbols by the
6365 dynamic linker. This means that for symbols exported from the DSO,
6366 the compiler cannot perform interprocedural propagation, inlining
6367 and other optimizations in anticipation that the function or
6368 variable in question may change. While this feature is useful, for
6369 example, to rewrite memory allocation functions by a debugging
6370 implementation, it is expensive in the terms of code quality. With
6371 -fno-semantic-interposition the compiler assumes that if
6372 interposition happens for functions the overwriting function will
6373 have precisely the same semantics (and side effects). Similarly if
6374 interposition happens for variables, the constructor of the
6375 variable will be the same. The flag has no effect for functions
6376 explicitly declared inline (where it is never allowed for
6377 interposition to change semantics) and for symbols explicitly
6378 declared weak.
6379
6380 -fshrink-wrap
6381 Emit function prologues only before parts of the function that need
6382 it, rather than at the top of the function. This flag is enabled
6383 by default at -O and higher.
6384
6385 -fshrink-wrap-separate
6386 Shrink-wrap separate parts of the prologue and epilogue separately,
6387 so that those parts are only executed when needed. This option is
6388 on by default, but has no effect unless -fshrink-wrap is also
6389 turned on and the target supports this.
6390
6391 -fcaller-saves
6392 Enable allocation of values to registers that are clobbered by
6393 function calls, by emitting extra instructions to save and restore
6394 the registers around such calls. Such allocation is done only when
6395 it seems to result in better code.
6396
6397 This option is always enabled by default on certain machines,
6398 usually those which have no call-preserved registers to use
6399 instead.
6400
6401 Enabled at levels -O2, -O3, -Os.
6402
6403 -fcombine-stack-adjustments
6404 Tracks stack adjustments (pushes and pops) and stack memory
6405 references and then tries to find ways to combine them.
6406
6407 Enabled by default at -O1 and higher.
6408
6409 -fipa-ra
6410 Use caller save registers for allocation if those registers are not
6411 used by any called function. In that case it is not necessary to
6412 save and restore them around calls. This is only possible if
6413 called functions are part of same compilation unit as current
6414 function and they are compiled before it.
6415
6416 Enabled at levels -O2, -O3, -Os, however the option is disabled if
6417 generated code will be instrumented for profiling (-p, or -pg) or
6418 if callee's register usage cannot be known exactly (this happens on
6419 targets that do not expose prologues and epilogues in RTL).
6420
6421 -fconserve-stack
6422 Attempt to minimize stack usage. The compiler attempts to use less
6423 stack space, even if that makes the program slower. This option
6424 implies setting the large-stack-frame parameter to 100 and the
6425 large-stack-frame-growth parameter to 400.
6426
6427 -ftree-reassoc
6428 Perform reassociation on trees. This flag is enabled by default at
6429 -O and higher.
6430
6431 -fcode-hoisting
6432 Perform code hoisting. Code hoisting tries to move the evaluation
6433 of expressions executed on all paths to the function exit as early
6434 as possible. This is especially useful as a code size
6435 optimization, but it often helps for code speed as well. This flag
6436 is enabled by default at -O2 and higher.
6437
6438 -ftree-pre
6439 Perform partial redundancy elimination (PRE) on trees. This flag
6440 is enabled by default at -O2 and -O3.
6441
6442 -ftree-partial-pre
6443 Make partial redundancy elimination (PRE) more aggressive. This
6444 flag is enabled by default at -O3.
6445
6446 -ftree-forwprop
6447 Perform forward propagation on trees. This flag is enabled by
6448 default at -O and higher.
6449
6450 -ftree-fre
6451 Perform full redundancy elimination (FRE) on trees. The difference
6452 between FRE and PRE is that FRE only considers expressions that are
6453 computed on all paths leading to the redundant computation. This
6454 analysis is faster than PRE, though it exposes fewer redundancies.
6455 This flag is enabled by default at -O and higher.
6456
6457 -ftree-phiprop
6458 Perform hoisting of loads from conditional pointers on trees. This
6459 pass is enabled by default at -O and higher.
6460
6461 -fhoist-adjacent-loads
6462 Speculatively hoist loads from both branches of an if-then-else if
6463 the loads are from adjacent locations in the same structure and the
6464 target architecture has a conditional move instruction. This flag
6465 is enabled by default at -O2 and higher.
6466
6467 -ftree-copy-prop
6468 Perform copy propagation on trees. This pass eliminates
6469 unnecessary copy operations. This flag is enabled by default at -O
6470 and higher.
6471
6472 -fipa-pure-const
6473 Discover which functions are pure or constant. Enabled by default
6474 at -O and higher.
6475
6476 -fipa-reference
6477 Discover which static variables do not escape the compilation unit.
6478 Enabled by default at -O and higher.
6479
6480 -fipa-pta
6481 Perform interprocedural pointer analysis and interprocedural
6482 modification and reference analysis. This option can cause
6483 excessive memory and compile-time usage on large compilation units.
6484 It is not enabled by default at any optimization level.
6485
6486 -fipa-profile
6487 Perform interprocedural profile propagation. The functions called
6488 only from cold functions are marked as cold. Also functions
6489 executed once (such as "cold", "noreturn", static constructors or
6490 destructors) are identified. Cold functions and loop less parts of
6491 functions executed once are then optimized for size. Enabled by
6492 default at -O and higher.
6493
6494 -fipa-cp
6495 Perform interprocedural constant propagation. This optimization
6496 analyzes the program to determine when values passed to functions
6497 are constants and then optimizes accordingly. This optimization
6498 can substantially increase performance if the application has
6499 constants passed to functions. This flag is enabled by default at
6500 -O2, -Os and -O3.
6501
6502 -fipa-cp-clone
6503 Perform function cloning to make interprocedural constant
6504 propagation stronger. When enabled, interprocedural constant
6505 propagation performs function cloning when externally visible
6506 function can be called with constant arguments. Because this
6507 optimization can create multiple copies of functions, it may
6508 significantly increase code size (see --param
6509 ipcp-unit-growth=value). This flag is enabled by default at -O3.
6510
6511 -fipa-bit-cp
6512 When enabled, perform interprocedural bitwise constant propagation.
6513 This flag is enabled by default at -O2. It requires that -fipa-cp
6514 is enabled.
6515
6516 -fipa-vrp
6517 When enabled, perform interprocedural propagation of value ranges.
6518 This flag is enabled by default at -O2. It requires that -fipa-cp
6519 is enabled.
6520
6521 -fipa-icf
6522 Perform Identical Code Folding for functions and read-only
6523 variables. The optimization reduces code size and may disturb
6524 unwind stacks by replacing a function by equivalent one with a
6525 different name. The optimization works more effectively with link-
6526 time optimization enabled.
6527
6528 Nevertheless the behavior is similar to Gold Linker ICF
6529 optimization, GCC ICF works on different levels and thus the
6530 optimizations are not same - there are equivalences that are found
6531 only by GCC and equivalences found only by Gold.
6532
6533 This flag is enabled by default at -O2 and -Os.
6534
6535 -fisolate-erroneous-paths-dereference
6536 Detect paths that trigger erroneous or undefined behavior due to
6537 dereferencing a null pointer. Isolate those paths from the main
6538 control flow and turn the statement with erroneous or undefined
6539 behavior into a trap. This flag is enabled by default at -O2 and
6540 higher and depends on -fdelete-null-pointer-checks also being
6541 enabled.
6542
6543 -fisolate-erroneous-paths-attribute
6544 Detect paths that trigger erroneous or undefined behavior due to a
6545 null value being used in a way forbidden by a "returns_nonnull" or
6546 "nonnull" attribute. Isolate those paths from the main control
6547 flow and turn the statement with erroneous or undefined behavior
6548 into a trap. This is not currently enabled, but may be enabled by
6549 -O2 in the future.
6550
6551 -ftree-sink
6552 Perform forward store motion on trees. This flag is enabled by
6553 default at -O and higher.
6554
6555 -ftree-bit-ccp
6556 Perform sparse conditional bit constant propagation on trees and
6557 propagate pointer alignment information. This pass only operates
6558 on local scalar variables and is enabled by default at -O and
6559 higher. It requires that -ftree-ccp is enabled.
6560
6561 -ftree-ccp
6562 Perform sparse conditional constant propagation (CCP) on trees.
6563 This pass only operates on local scalar variables and is enabled by
6564 default at -O and higher.
6565
6566 -fssa-backprop
6567 Propagate information about uses of a value up the definition chain
6568 in order to simplify the definitions. For example, this pass
6569 strips sign operations if the sign of a value never matters. The
6570 flag is enabled by default at -O and higher.
6571
6572 -fssa-phiopt
6573 Perform pattern matching on SSA PHI nodes to optimize conditional
6574 code. This pass is enabled by default at -O and higher.
6575
6576 -ftree-switch-conversion
6577 Perform conversion of simple initializations in a switch to
6578 initializations from a scalar array. This flag is enabled by
6579 default at -O2 and higher.
6580
6581 -ftree-tail-merge
6582 Look for identical code sequences. When found, replace one with a
6583 jump to the other. This optimization is known as tail merging or
6584 cross jumping. This flag is enabled by default at -O2 and higher.
6585 The compilation time in this pass can be limited using max-tail-
6586 merge-comparisons parameter and max-tail-merge-iterations
6587 parameter.
6588
6589 -ftree-dce
6590 Perform dead code elimination (DCE) on trees. This flag is enabled
6591 by default at -O and higher.
6592
6593 -ftree-builtin-call-dce
6594 Perform conditional dead code elimination (DCE) for calls to built-
6595 in functions that may set "errno" but are otherwise side-effect
6596 free. This flag is enabled by default at -O2 and higher if -Os is
6597 not also specified.
6598
6599 -ftree-dominator-opts
6600 Perform a variety of simple scalar cleanups (constant/copy
6601 propagation, redundancy elimination, range propagation and
6602 expression simplification) based on a dominator tree traversal.
6603 This also performs jump threading (to reduce jumps to jumps). This
6604 flag is enabled by default at -O and higher.
6605
6606 -ftree-dse
6607 Perform dead store elimination (DSE) on trees. A dead store is a
6608 store into a memory location that is later overwritten by another
6609 store without any intervening loads. In this case the earlier
6610 store can be deleted. This flag is enabled by default at -O and
6611 higher.
6612
6613 -ftree-ch
6614 Perform loop header copying on trees. This is beneficial since it
6615 increases effectiveness of code motion optimizations. It also
6616 saves one jump. This flag is enabled by default at -O and higher.
6617 It is not enabled for -Os, since it usually increases code size.
6618
6619 -ftree-loop-optimize
6620 Perform loop optimizations on trees. This flag is enabled by
6621 default at -O and higher.
6622
6623 -ftree-loop-linear
6624 -floop-interchange
6625 -floop-strip-mine
6626 -floop-block
6627 -floop-unroll-and-jam
6628 Perform loop nest optimizations. Same as -floop-nest-optimize. To
6629 use this code transformation, GCC has to be configured with
6630 --with-isl to enable the Graphite loop transformation
6631 infrastructure.
6632
6633 -fgraphite-identity
6634 Enable the identity transformation for graphite. For every SCoP we
6635 generate the polyhedral representation and transform it back to
6636 gimple. Using -fgraphite-identity we can check the costs or
6637 benefits of the GIMPLE -> GRAPHITE -> GIMPLE transformation. Some
6638 minimal optimizations are also performed by the code generator isl,
6639 like index splitting and dead code elimination in loops.
6640
6641 -floop-nest-optimize
6642 Enable the isl based loop nest optimizer. This is a generic loop
6643 nest optimizer based on the Pluto optimization algorithms. It
6644 calculates a loop structure optimized for data-locality and
6645 parallelism. This option is experimental.
6646
6647 -floop-parallelize-all
6648 Use the Graphite data dependence analysis to identify loops that
6649 can be parallelized. Parallelize all the loops that can be
6650 analyzed to not contain loop carried dependences without checking
6651 that it is profitable to parallelize the loops.
6652
6653 -ftree-coalesce-vars
6654 While transforming the program out of the SSA representation,
6655 attempt to reduce copying by coalescing versions of different user-
6656 defined variables, instead of just compiler temporaries. This may
6657 severely limit the ability to debug an optimized program compiled
6658 with -fno-var-tracking-assignments. In the negated form, this flag
6659 prevents SSA coalescing of user variables. This option is enabled
6660 by default if optimization is enabled, and it does very little
6661 otherwise.
6662
6663 -ftree-loop-if-convert
6664 Attempt to transform conditional jumps in the innermost loops to
6665 branch-less equivalents. The intent is to remove control-flow from
6666 the innermost loops in order to improve the ability of the
6667 vectorization pass to handle these loops. This is enabled by
6668 default if vectorization is enabled.
6669
6670 -ftree-loop-distribution
6671 Perform loop distribution. This flag can improve cache performance
6672 on big loop bodies and allow further loop optimizations, like
6673 parallelization or vectorization, to take place. For example, the
6674 loop
6675
6676 DO I = 1, N
6677 A(I) = B(I) + C
6678 D(I) = E(I) * F
6679 ENDDO
6680
6681 is transformed to
6682
6683 DO I = 1, N
6684 A(I) = B(I) + C
6685 ENDDO
6686 DO I = 1, N
6687 D(I) = E(I) * F
6688 ENDDO
6689
6690 -ftree-loop-distribute-patterns
6691 Perform loop distribution of patterns that can be code generated
6692 with calls to a library. This flag is enabled by default at -O3.
6693
6694 This pass distributes the initialization loops and generates a call
6695 to memset zero. For example, the loop
6696
6697 DO I = 1, N
6698 A(I) = 0
6699 B(I) = A(I) + I
6700 ENDDO
6701
6702 is transformed to
6703
6704 DO I = 1, N
6705 A(I) = 0
6706 ENDDO
6707 DO I = 1, N
6708 B(I) = A(I) + I
6709 ENDDO
6710
6711 and the initialization loop is transformed into a call to memset
6712 zero.
6713
6714 -ftree-loop-im
6715 Perform loop invariant motion on trees. This pass moves only
6716 invariants that are hard to handle at RTL level (function calls,
6717 operations that expand to nontrivial sequences of insns). With
6718 -funswitch-loops it also moves operands of conditions that are
6719 invariant out of the loop, so that we can use just trivial
6720 invariantness analysis in loop unswitching. The pass also includes
6721 store motion.
6722
6723 -ftree-loop-ivcanon
6724 Create a canonical counter for number of iterations in loops for
6725 which determining number of iterations requires complicated
6726 analysis. Later optimizations then may determine the number
6727 easily. Useful especially in connection with unrolling.
6728
6729 -fivopts
6730 Perform induction variable optimizations (strength reduction,
6731 induction variable merging and induction variable elimination) on
6732 trees.
6733
6734 -ftree-parallelize-loops=n
6735 Parallelize loops, i.e., split their iteration space to run in n
6736 threads. This is only possible for loops whose iterations are
6737 independent and can be arbitrarily reordered. The optimization is
6738 only profitable on multiprocessor machines, for loops that are CPU-
6739 intensive, rather than constrained e.g. by memory bandwidth. This
6740 option implies -pthread, and thus is only supported on targets that
6741 have support for -pthread.
6742
6743 -ftree-pta
6744 Perform function-local points-to analysis on trees. This flag is
6745 enabled by default at -O and higher.
6746
6747 -ftree-sra
6748 Perform scalar replacement of aggregates. This pass replaces
6749 structure references with scalars to prevent committing structures
6750 to memory too early. This flag is enabled by default at -O and
6751 higher.
6752
6753 -fstore-merging
6754 Perform merging of narrow stores to consecutive memory addresses.
6755 This pass merges contiguous stores of immediate values narrower
6756 than a word into fewer wider stores to reduce the number of
6757 instructions. This is enabled by default at -O2 and higher as well
6758 as -Os.
6759
6760 -ftree-ter
6761 Perform temporary expression replacement during the SSA->normal
6762 phase. Single use/single def temporaries are replaced at their use
6763 location with their defining expression. This results in non-
6764 GIMPLE code, but gives the expanders much more complex trees to
6765 work on resulting in better RTL generation. This is enabled by
6766 default at -O and higher.
6767
6768 -ftree-slsr
6769 Perform straight-line strength reduction on trees. This recognizes
6770 related expressions involving multiplications and replaces them by
6771 less expensive calculations when possible. This is enabled by
6772 default at -O and higher.
6773
6774 -ftree-vectorize
6775 Perform vectorization on trees. This flag enables
6776 -ftree-loop-vectorize and -ftree-slp-vectorize if not explicitly
6777 specified.
6778
6779 -ftree-loop-vectorize
6780 Perform loop vectorization on trees. This flag is enabled by
6781 default at -O3 and when -ftree-vectorize is enabled.
6782
6783 -ftree-slp-vectorize
6784 Perform basic block vectorization on trees. This flag is enabled by
6785 default at -O3 and when -ftree-vectorize is enabled.
6786
6787 -fvect-cost-model=model
6788 Alter the cost model used for vectorization. The model argument
6789 should be one of unlimited, dynamic or cheap. With the unlimited
6790 model the vectorized code-path is assumed to be profitable while
6791 with the dynamic model a runtime check guards the vectorized code-
6792 path to enable it only for iteration counts that will likely
6793 execute faster than when executing the original scalar loop. The
6794 cheap model disables vectorization of loops where doing so would be
6795 cost prohibitive for example due to required runtime checks for
6796 data dependence or alignment but otherwise is equal to the dynamic
6797 model. The default cost model depends on other optimization flags
6798 and is either dynamic or cheap.
6799
6800 -fsimd-cost-model=model
6801 Alter the cost model used for vectorization of loops marked with
6802 the OpenMP or Cilk Plus simd directive. The model argument should
6803 be one of unlimited, dynamic, cheap. All values of model have the
6804 same meaning as described in -fvect-cost-model and by default a
6805 cost model defined with -fvect-cost-model is used.
6806
6807 -ftree-vrp
6808 Perform Value Range Propagation on trees. This is similar to the
6809 constant propagation pass, but instead of values, ranges of values
6810 are propagated. This allows the optimizers to remove unnecessary
6811 range checks like array bound checks and null pointer checks. This
6812 is enabled by default at -O2 and higher. Null pointer check
6813 elimination is only done if -fdelete-null-pointer-checks is
6814 enabled.
6815
6816 -fsplit-paths
6817 Split paths leading to loop backedges. This can improve dead code
6818 elimination and common subexpression elimination. This is enabled
6819 by default at -O2 and above.
6820
6821 -fsplit-ivs-in-unroller
6822 Enables expression of values of induction variables in later
6823 iterations of the unrolled loop using the value in the first
6824 iteration. This breaks long dependency chains, thus improving
6825 efficiency of the scheduling passes.
6826
6827 A combination of -fweb and CSE is often sufficient to obtain the
6828 same effect. However, that is not reliable in cases where the loop
6829 body is more complicated than a single basic block. It also does
6830 not work at all on some architectures due to restrictions in the
6831 CSE pass.
6832
6833 This optimization is enabled by default.
6834
6835 -fvariable-expansion-in-unroller
6836 With this option, the compiler creates multiple copies of some
6837 local variables when unrolling a loop, which can result in superior
6838 code.
6839
6840 -fpartial-inlining
6841 Inline parts of functions. This option has any effect only when
6842 inlining itself is turned on by the -finline-functions or
6843 -finline-small-functions options.
6844
6845 Enabled at level -O2.
6846
6847 -fpredictive-commoning
6848 Perform predictive commoning optimization, i.e., reusing
6849 computations (especially memory loads and stores) performed in
6850 previous iterations of loops.
6851
6852 This option is enabled at level -O3.
6853
6854 -fprefetch-loop-arrays
6855 If supported by the target machine, generate instructions to
6856 prefetch memory to improve the performance of loops that access
6857 large arrays.
6858
6859 This option may generate better or worse code; results are highly
6860 dependent on the structure of loops within the source code.
6861
6862 Disabled at level -Os.
6863
6864 -fno-printf-return-value
6865 Do not substitute constants for known return value of formatted
6866 output functions such as "sprintf", "snprintf", "vsprintf", and
6867 "vsnprintf" (but not "printf" of "fprintf"). This transformation
6868 allows GCC to optimize or even eliminate branches based on the
6869 known return value of these functions called with arguments that
6870 are either constant, or whose values are known to be in a range
6871 that makes determining the exact return value possible. For
6872 example, when -fprintf-return-value is in effect, both the branch
6873 and the body of the "if" statement (but not the call to "snprint")
6874 can be optimized away when "i" is a 32-bit or smaller integer
6875 because the return value is guaranteed to be at most 8.
6876
6877 char buf[9];
6878 if (snprintf (buf, "%08x", i) >= sizeof buf)
6879 ...
6880
6881 The -fprintf-return-value option relies on other optimizations and
6882 yields best results with -O2. It works in tandem with the
6883 -Wformat-overflow and -Wformat-truncation options. The
6884 -fprintf-return-value option is enabled by default.
6885
6886 -fno-peephole
6887 -fno-peephole2
6888 Disable any machine-specific peephole optimizations. The
6889 difference between -fno-peephole and -fno-peephole2 is in how they
6890 are implemented in the compiler; some targets use one, some use the
6891 other, a few use both.
6892
6893 -fpeephole is enabled by default. -fpeephole2 enabled at levels
6894 -O2, -O3, -Os.
6895
6896 -fno-guess-branch-probability
6897 Do not guess branch probabilities using heuristics.
6898
6899 GCC uses heuristics to guess branch probabilities if they are not
6900 provided by profiling feedback (-fprofile-arcs). These heuristics
6901 are based on the control flow graph. If some branch probabilities
6902 are specified by "__builtin_expect", then the heuristics are used
6903 to guess branch probabilities for the rest of the control flow
6904 graph, taking the "__builtin_expect" info into account. The
6905 interactions between the heuristics and "__builtin_expect" can be
6906 complex, and in some cases, it may be useful to disable the
6907 heuristics so that the effects of "__builtin_expect" are easier to
6908 understand.
6909
6910 The default is -fguess-branch-probability at levels -O, -O2, -O3,
6911 -Os.
6912
6913 -freorder-blocks
6914 Reorder basic blocks in the compiled function in order to reduce
6915 number of taken branches and improve code locality.
6916
6917 Enabled at levels -O, -O2, -O3, -Os.
6918
6919 -freorder-blocks-algorithm=algorithm
6920 Use the specified algorithm for basic block reordering. The
6921 algorithm argument can be simple, which does not increase code size
6922 (except sometimes due to secondary effects like alignment), or stc,
6923 the "software trace cache" algorithm, which tries to put all often
6924 executed code together, minimizing the number of branches executed
6925 by making extra copies of code.
6926
6927 The default is simple at levels -O, -Os, and stc at levels -O2,
6928 -O3.
6929
6930 -freorder-blocks-and-partition
6931 In addition to reordering basic blocks in the compiled function, in
6932 order to reduce number of taken branches, partitions hot and cold
6933 basic blocks into separate sections of the assembly and .o files,
6934 to improve paging and cache locality performance.
6935
6936 This optimization is automatically turned off in the presence of
6937 exception handling, for linkonce sections, for functions with a
6938 user-defined section attribute and on any architecture that does
6939 not support named sections.
6940
6941 Enabled for x86 at levels -O2, -O3.
6942
6943 -freorder-functions
6944 Reorder functions in the object file in order to improve code
6945 locality. This is implemented by using special subsections
6946 ".text.hot" for most frequently executed functions and
6947 ".text.unlikely" for unlikely executed functions. Reordering is
6948 done by the linker so object file format must support named
6949 sections and linker must place them in a reasonable way.
6950
6951 Also profile feedback must be available to make this option
6952 effective. See -fprofile-arcs for details.
6953
6954 Enabled at levels -O2, -O3, -Os.
6955
6956 -fstrict-aliasing
6957 Allow the compiler to assume the strictest aliasing rules
6958 applicable to the language being compiled. For C (and C++), this
6959 activates optimizations based on the type of expressions. In
6960 particular, an object of one type is assumed never to reside at the
6961 same address as an object of a different type, unless the types are
6962 almost the same. For example, an "unsigned int" can alias an
6963 "int", but not a "void*" or a "double". A character type may alias
6964 any other type.
6965
6966 Pay special attention to code like this:
6967
6968 union a_union {
6969 int i;
6970 double d;
6971 };
6972
6973 int f() {
6974 union a_union t;
6975 t.d = 3.0;
6976 return t.i;
6977 }
6978
6979 The practice of reading from a different union member than the one
6980 most recently written to (called "type-punning") is common. Even
6981 with -fstrict-aliasing, type-punning is allowed, provided the
6982 memory is accessed through the union type. So, the code above
6983 works as expected. However, this code might not:
6984
6985 int f() {
6986 union a_union t;
6987 int* ip;
6988 t.d = 3.0;
6989 ip = &t.i;
6990 return *ip;
6991 }
6992
6993 Similarly, access by taking the address, casting the resulting
6994 pointer and dereferencing the result has undefined behavior, even
6995 if the cast uses a union type, e.g.:
6996
6997 int f() {
6998 double d = 3.0;
6999 return ((union a_union *) &d)->i;
7000 }
7001
7002 The -fstrict-aliasing option is enabled at levels -O2, -O3, -Os.
7003
7004 -fstrict-overflow
7005 Allow the compiler to assume strict signed overflow rules,
7006 depending on the language being compiled. For C (and C++) this
7007 means that overflow when doing arithmetic with signed numbers is
7008 undefined, which means that the compiler may assume that it does
7009 not happen. This permits various optimizations. For example, the
7010 compiler assumes that an expression like "i + 10 > i" is always
7011 true for signed "i". This assumption is only valid if signed
7012 overflow is undefined, as the expression is false if "i + 10"
7013 overflows when using twos complement arithmetic. When this option
7014 is in effect any attempt to determine whether an operation on
7015 signed numbers overflows must be written carefully to not actually
7016 involve overflow.
7017
7018 This option also allows the compiler to assume strict pointer
7019 semantics: given a pointer to an object, if adding an offset to
7020 that pointer does not produce a pointer to the same object, the
7021 addition is undefined. This permits the compiler to conclude that
7022 "p + u > p" is always true for a pointer "p" and unsigned integer
7023 "u". This assumption is only valid because pointer wraparound is
7024 undefined, as the expression is false if "p + u" overflows using
7025 twos complement arithmetic.
7026
7027 See also the -fwrapv option. Using -fwrapv means that integer
7028 signed overflow is fully defined: it wraps. When -fwrapv is used,
7029 there is no difference between -fstrict-overflow and
7030 -fno-strict-overflow for integers. With -fwrapv certain types of
7031 overflow are permitted. For example, if the compiler gets an
7032 overflow when doing arithmetic on constants, the overflowed value
7033 can still be used with -fwrapv, but not otherwise.
7034
7035 The -fstrict-overflow option is enabled at levels -O2, -O3, -Os.
7036
7037 -falign-functions
7038 -falign-functions=n
7039 Align the start of functions to the next power-of-two greater than
7040 n, skipping up to n bytes. For instance, -falign-functions=32
7041 aligns functions to the next 32-byte boundary, but
7042 -falign-functions=24 aligns to the next 32-byte boundary only if
7043 this can be done by skipping 23 bytes or less.
7044
7045 -fno-align-functions and -falign-functions=1 are equivalent and
7046 mean that functions are not aligned.
7047
7048 Some assemblers only support this flag when n is a power of two; in
7049 that case, it is rounded up.
7050
7051 If n is not specified or is zero, use a machine-dependent default.
7052 The maximum allowed n option value is 65536.
7053
7054 Enabled at levels -O2, -O3.
7055
7056 -flimit-function-alignment
7057 If this option is enabled, the compiler tries to avoid
7058 unnecessarily overaligning functions. It attempts to instruct the
7059 assembler to align by the amount specified by -falign-functions,
7060 but not to skip more bytes than the size of the function.
7061
7062 -falign-labels
7063 -falign-labels=n
7064 Align all branch targets to a power-of-two boundary, skipping up to
7065 n bytes like -falign-functions. This option can easily make code
7066 slower, because it must insert dummy operations for when the branch
7067 target is reached in the usual flow of the code.
7068
7069 -fno-align-labels and -falign-labels=1 are equivalent and mean that
7070 labels are not aligned.
7071
7072 If -falign-loops or -falign-jumps are applicable and are greater
7073 than this value, then their values are used instead.
7074
7075 If n is not specified or is zero, use a machine-dependent default
7076 which is very likely to be 1, meaning no alignment. The maximum
7077 allowed n option value is 65536.
7078
7079 Enabled at levels -O2, -O3.
7080
7081 -falign-loops
7082 -falign-loops=n
7083 Align loops to a power-of-two boundary, skipping up to n bytes like
7084 -falign-functions. If the loops are executed many times, this
7085 makes up for any execution of the dummy operations.
7086
7087 -fno-align-loops and -falign-loops=1 are equivalent and mean that
7088 loops are not aligned. The maximum allowed n option value is
7089 65536.
7090
7091 If n is not specified or is zero, use a machine-dependent default.
7092
7093 Enabled at levels -O2, -O3.
7094
7095 -falign-jumps
7096 -falign-jumps=n
7097 Align branch targets to a power-of-two boundary, for branch targets
7098 where the targets can only be reached by jumping, skipping up to n
7099 bytes like -falign-functions. In this case, no dummy operations
7100 need be executed.
7101
7102 -fno-align-jumps and -falign-jumps=1 are equivalent and mean that
7103 loops are not aligned.
7104
7105 If n is not specified or is zero, use a machine-dependent default.
7106 The maximum allowed n option value is 65536.
7107
7108 Enabled at levels -O2, -O3.
7109
7110 -funit-at-a-time
7111 This option is left for compatibility reasons. -funit-at-a-time has
7112 no effect, while -fno-unit-at-a-time implies -fno-toplevel-reorder
7113 and -fno-section-anchors.
7114
7115 Enabled by default.
7116
7117 -fno-toplevel-reorder
7118 Do not reorder top-level functions, variables, and "asm"
7119 statements. Output them in the same order that they appear in the
7120 input file. When this option is used, unreferenced static
7121 variables are not removed. This option is intended to support
7122 existing code that relies on a particular ordering. For new code,
7123 it is better to use attributes when possible.
7124
7125 Enabled at level -O0. When disabled explicitly, it also implies
7126 -fno-section-anchors, which is otherwise enabled at -O0 on some
7127 targets.
7128
7129 -fweb
7130 Constructs webs as commonly used for register allocation purposes
7131 and assign each web individual pseudo register. This allows the
7132 register allocation pass to operate on pseudos directly, but also
7133 strengthens several other optimization passes, such as CSE, loop
7134 optimizer and trivial dead code remover. It can, however, make
7135 debugging impossible, since variables no longer stay in a "home
7136 register".
7137
7138 Enabled by default with -funroll-loops.
7139
7140 -fwhole-program
7141 Assume that the current compilation unit represents the whole
7142 program being compiled. All public functions and variables with
7143 the exception of "main" and those merged by attribute
7144 "externally_visible" become static functions and in effect are
7145 optimized more aggressively by interprocedural optimizers.
7146
7147 This option should not be used in combination with -flto. Instead
7148 relying on a linker plugin should provide safer and more precise
7149 information.
7150
7151 -flto[=n]
7152 This option runs the standard link-time optimizer. When invoked
7153 with source code, it generates GIMPLE (one of GCC's internal
7154 representations) and writes it to special ELF sections in the
7155 object file. When the object files are linked together, all the
7156 function bodies are read from these ELF sections and instantiated
7157 as if they had been part of the same translation unit.
7158
7159 To use the link-time optimizer, -flto and optimization options
7160 should be specified at compile time and during the final link. It
7161 is recommended that you compile all the files participating in the
7162 same link with the same options and also specify those options at
7163 link time. For example:
7164
7165 gcc -c -O2 -flto foo.c
7166 gcc -c -O2 -flto bar.c
7167 gcc -o myprog -flto -O2 foo.o bar.o
7168
7169 The first two invocations to GCC save a bytecode representation of
7170 GIMPLE into special ELF sections inside foo.o and bar.o. The final
7171 invocation reads the GIMPLE bytecode from foo.o and bar.o, merges
7172 the two files into a single internal image, and compiles the result
7173 as usual. Since both foo.o and bar.o are merged into a single
7174 image, this causes all the interprocedural analyses and
7175 optimizations in GCC to work across the two files as if they were a
7176 single one. This means, for example, that the inliner is able to
7177 inline functions in bar.o into functions in foo.o and vice-versa.
7178
7179 Another (simpler) way to enable link-time optimization is:
7180
7181 gcc -o myprog -flto -O2 foo.c bar.c
7182
7183 The above generates bytecode for foo.c and bar.c, merges them
7184 together into a single GIMPLE representation and optimizes them as
7185 usual to produce myprog.
7186
7187 The only important thing to keep in mind is that to enable link-
7188 time optimizations you need to use the GCC driver to perform the
7189 link step. GCC then automatically performs link-time optimization
7190 if any of the objects involved were compiled with the -flto
7191 command-line option. You generally should specify the optimization
7192 options to be used for link-time optimization though GCC tries to
7193 be clever at guessing an optimization level to use from the options
7194 used at compile time if you fail to specify one at link time. You
7195 can always override the automatic decision to do link-time
7196 optimization by passing -fno-lto to the link command.
7197
7198 To make whole program optimization effective, it is necessary to
7199 make certain whole program assumptions. The compiler needs to know
7200 what functions and variables can be accessed by libraries and
7201 runtime outside of the link-time optimized unit. When supported by
7202 the linker, the linker plugin (see -fuse-linker-plugin) passes
7203 information to the compiler about used and externally visible
7204 symbols. When the linker plugin is not available, -fwhole-program
7205 should be used to allow the compiler to make these assumptions,
7206 which leads to more aggressive optimization decisions.
7207
7208 When -fuse-linker-plugin is not enabled, when a file is compiled
7209 with -flto, the generated object file is larger than a regular
7210 object file because it contains GIMPLE bytecodes and the usual
7211 final code (see -ffat-lto-objects. This means that object files
7212 with LTO information can be linked as normal object files; if
7213 -fno-lto is passed to the linker, no interprocedural optimizations
7214 are applied. Note that when -fno-fat-lto-objects is enabled the
7215 compile stage is faster but you cannot perform a regular, non-LTO
7216 link on them.
7217
7218 Additionally, the optimization flags used to compile individual
7219 files are not necessarily related to those used at link time. For
7220 instance,
7221
7222 gcc -c -O0 -ffat-lto-objects -flto foo.c
7223 gcc -c -O0 -ffat-lto-objects -flto bar.c
7224 gcc -o myprog -O3 foo.o bar.o
7225
7226 This produces individual object files with unoptimized assembler
7227 code, but the resulting binary myprog is optimized at -O3. If,
7228 instead, the final binary is generated with -fno-lto, then myprog
7229 is not optimized.
7230
7231 When producing the final binary, GCC only applies link-time
7232 optimizations to those files that contain bytecode. Therefore, you
7233 can mix and match object files and libraries with GIMPLE bytecodes
7234 and final object code. GCC automatically selects which files to
7235 optimize in LTO mode and which files to link without further
7236 processing.
7237
7238 There are some code generation flags preserved by GCC when
7239 generating bytecodes, as they need to be used during the final link
7240 stage. Generally options specified at link time override those
7241 specified at compile time.
7242
7243 If you do not specify an optimization level option -O at link time,
7244 then GCC uses the highest optimization level used when compiling
7245 the object files.
7246
7247 Currently, the following options and their settings are taken from
7248 the first object file that explicitly specifies them: -fPIC, -fpic,
7249 -fpie, -fcommon, -fexceptions, -fnon-call-exceptions, -fgnu-tm and
7250 all the -m target flags.
7251
7252 Certain ABI-changing flags are required to match in all compilation
7253 units, and trying to override this at link time with a conflicting
7254 value is ignored. This includes options such as
7255 -freg-struct-return and -fpcc-struct-return.
7256
7257 Other options such as -ffp-contract, -fno-strict-overflow, -fwrapv,
7258 -fno-trapv or -fno-strict-aliasing are passed through to the link
7259 stage and merged conservatively for conflicting translation units.
7260 Specifically -fno-strict-overflow, -fwrapv and -fno-trapv take
7261 precedence; and for example -ffp-contract=off takes precedence over
7262 -ffp-contract=fast. You can override them at link time.
7263
7264 If LTO encounters objects with C linkage declared with incompatible
7265 types in separate translation units to be linked together
7266 (undefined behavior according to ISO C99 6.2.7), a non-fatal
7267 diagnostic may be issued. The behavior is still undefined at run
7268 time. Similar diagnostics may be raised for other languages.
7269
7270 Another feature of LTO is that it is possible to apply
7271 interprocedural optimizations on files written in different
7272 languages:
7273
7274 gcc -c -flto foo.c
7275 g++ -c -flto bar.cc
7276 gfortran -c -flto baz.f90
7277 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
7278
7279 Notice that the final link is done with g++ to get the C++ runtime
7280 libraries and -lgfortran is added to get the Fortran runtime
7281 libraries. In general, when mixing languages in LTO mode, you
7282 should use the same link command options as when mixing languages
7283 in a regular (non-LTO) compilation.
7284
7285 If object files containing GIMPLE bytecode are stored in a library
7286 archive, say libfoo.a, it is possible to extract and use them in an
7287 LTO link if you are using a linker with plugin support. To create
7288 static libraries suitable for LTO, use gcc-ar and gcc-ranlib
7289 instead of ar and ranlib; to show the symbols of object files with
7290 GIMPLE bytecode, use gcc-nm. Those commands require that ar,
7291 ranlib and nm have been compiled with plugin support. At link
7292 time, use the the flag -fuse-linker-plugin to ensure that the
7293 library participates in the LTO optimization process:
7294
7295 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
7296
7297 With the linker plugin enabled, the linker extracts the needed
7298 GIMPLE files from libfoo.a and passes them on to the running GCC to
7299 make them part of the aggregated GIMPLE image to be optimized.
7300
7301 If you are not using a linker with plugin support and/or do not
7302 enable the linker plugin, then the objects inside libfoo.a are
7303 extracted and linked as usual, but they do not participate in the
7304 LTO optimization process. In order to make a static library
7305 suitable for both LTO optimization and usual linkage, compile its
7306 object files with -flto -ffat-lto-objects.
7307
7308 Link-time optimizations do not require the presence of the whole
7309 program to operate. If the program does not require any symbols to
7310 be exported, it is possible to combine -flto and -fwhole-program to
7311 allow the interprocedural optimizers to use more aggressive
7312 assumptions which may lead to improved optimization opportunities.
7313 Use of -fwhole-program is not needed when linker plugin is active
7314 (see -fuse-linker-plugin).
7315
7316 The current implementation of LTO makes no attempt to generate
7317 bytecode that is portable between different types of hosts. The
7318 bytecode files are versioned and there is a strict version check,
7319 so bytecode files generated in one version of GCC do not work with
7320 an older or newer version of GCC.
7321
7322 Link-time optimization does not work well with generation of
7323 debugging information. Combining -flto with -g is currently
7324 experimental and expected to produce unexpected results.
7325
7326 If you specify the optional n, the optimization and code generation
7327 done at link time is executed in parallel using n parallel jobs by
7328 utilizing an installed make program. The environment variable MAKE
7329 may be used to override the program used. The default value for n
7330 is 1.
7331
7332 You can also specify -flto=jobserver to use GNU make's job server
7333 mode to determine the number of parallel jobs. This is useful when
7334 the Makefile calling GCC is already executing in parallel. You
7335 must prepend a + to the command recipe in the parent Makefile for
7336 this to work. This option likely only works if MAKE is GNU make.
7337
7338 -flto-partition=alg
7339 Specify the partitioning algorithm used by the link-time optimizer.
7340 The value is either 1to1 to specify a partitioning mirroring the
7341 original source files or balanced to specify partitioning into
7342 equally sized chunks (whenever possible) or max to create new
7343 partition for every symbol where possible. Specifying none as an
7344 algorithm disables partitioning and streaming completely. The
7345 default value is balanced. While 1to1 can be used as an workaround
7346 for various code ordering issues, the max partitioning is intended
7347 for internal testing only. The value one specifies that exactly
7348 one partition should be used while the value none bypasses
7349 partitioning and executes the link-time optimization step directly
7350 from the WPA phase.
7351
7352 -flto-odr-type-merging
7353 Enable streaming of mangled types names of C++ types and their
7354 unification at link time. This increases size of LTO object files,
7355 but enables diagnostics about One Definition Rule violations.
7356
7357 -flto-compression-level=n
7358 This option specifies the level of compression used for
7359 intermediate language written to LTO object files, and is only
7360 meaningful in conjunction with LTO mode (-flto). Valid values are
7361 0 (no compression) to 9 (maximum compression). Values outside this
7362 range are clamped to either 0 or 9. If the option is not given, a
7363 default balanced compression setting is used.
7364
7365 -fuse-linker-plugin
7366 Enables the use of a linker plugin during link-time optimization.
7367 This option relies on plugin support in the linker, which is
7368 available in gold or in GNU ld 2.21 or newer.
7369
7370 This option enables the extraction of object files with GIMPLE
7371 bytecode out of library archives. This improves the quality of
7372 optimization by exposing more code to the link-time optimizer.
7373 This information specifies what symbols can be accessed externally
7374 (by non-LTO object or during dynamic linking). Resulting code
7375 quality improvements on binaries (and shared libraries that use
7376 hidden visibility) are similar to -fwhole-program. See -flto for a
7377 description of the effect of this flag and how to use it.
7378
7379 This option is enabled by default when LTO support in GCC is
7380 enabled and GCC was configured for use with a linker supporting
7381 plugins (GNU ld 2.21 or newer or gold).
7382
7383 -ffat-lto-objects
7384 Fat LTO objects are object files that contain both the intermediate
7385 language and the object code. This makes them usable for both LTO
7386 linking and normal linking. This option is effective only when
7387 compiling with -flto and is ignored at link time.
7388
7389 -fno-fat-lto-objects improves compilation time over plain LTO, but
7390 requires the complete toolchain to be aware of LTO. It requires a
7391 linker with linker plugin support for basic functionality.
7392 Additionally, nm, ar and ranlib need to support linker plugins to
7393 allow a full-featured build environment (capable of building static
7394 libraries etc). GCC provides the gcc-ar, gcc-nm, gcc-ranlib
7395 wrappers to pass the right options to these tools. With non fat LTO
7396 makefiles need to be modified to use them.
7397
7398 The default is -fno-fat-lto-objects on targets with linker plugin
7399 support.
7400
7401 -fcompare-elim
7402 After register allocation and post-register allocation instruction
7403 splitting, identify arithmetic instructions that compute processor
7404 flags similar to a comparison operation based on that arithmetic.
7405 If possible, eliminate the explicit comparison operation.
7406
7407 This pass only applies to certain targets that cannot explicitly
7408 represent the comparison operation before register allocation is
7409 complete.
7410
7411 Enabled at levels -O, -O2, -O3, -Os.
7412
7413 -fcprop-registers
7414 After register allocation and post-register allocation instruction
7415 splitting, perform a copy-propagation pass to try to reduce
7416 scheduling dependencies and occasionally eliminate the copy.
7417
7418 Enabled at levels -O, -O2, -O3, -Os.
7419
7420 -fprofile-correction
7421 Profiles collected using an instrumented binary for multi-threaded
7422 programs may be inconsistent due to missed counter updates. When
7423 this option is specified, GCC uses heuristics to correct or smooth
7424 out such inconsistencies. By default, GCC emits an error message
7425 when an inconsistent profile is detected.
7426
7427 -fprofile-use
7428 -fprofile-use=path
7429 Enable profile feedback-directed optimizations, and the following
7430 optimizations which are generally profitable only with profile
7431 feedback available: -fbranch-probabilities, -fvpt, -funroll-loops,
7432 -fpeel-loops, -ftracer, -ftree-vectorize, and ftree-loop-
7433 distribute-patterns.
7434
7435 Before you can use this option, you must first generate profiling
7436 information.
7437
7438 By default, GCC emits an error message if the feedback profiles do
7439 not match the source code. This error can be turned into a warning
7440 by using -Wcoverage-mismatch. Note this may result in poorly
7441 optimized code.
7442
7443 If path is specified, GCC looks at the path to find the profile
7444 feedback data files. See -fprofile-dir.
7445
7446 -fauto-profile
7447 -fauto-profile=path
7448 Enable sampling-based feedback-directed optimizations, and the
7449 following optimizations which are generally profitable only with
7450 profile feedback available: -fbranch-probabilities, -fvpt,
7451 -funroll-loops, -fpeel-loops, -ftracer, -ftree-vectorize,
7452 -finline-functions, -fipa-cp, -fipa-cp-clone,
7453 -fpredictive-commoning, -funswitch-loops, -fgcse-after-reload, and
7454 -ftree-loop-distribute-patterns.
7455
7456 path is the name of a file containing AutoFDO profile information.
7457 If omitted, it defaults to fbdata.afdo in the current directory.
7458
7459 Producing an AutoFDO profile data file requires running your
7460 program with the perf utility on a supported GNU/Linux target
7461 system. For more information, see <https://perf.wiki.kernel.org/>.
7462
7463 E.g.
7464
7465 perf record -e br_inst_retired:near_taken -b -o perf.data \
7466 -- your_program
7467
7468 Then use the create_gcov tool to convert the raw profile data to a
7469 format that can be used by GCC. You must also supply the
7470 unstripped binary for your program to this tool. See
7471 <https://github.com/google/autofdo>.
7472
7473 E.g.
7474
7475 create_gcov --binary=your_program.unstripped --profile=perf.data \
7476 --gcov=profile.afdo
7477
7478 The following options control compiler behavior regarding floating-
7479 point arithmetic. These options trade off between speed and
7480 correctness. All must be specifically enabled.
7481
7482 -ffloat-store
7483 Do not store floating-point variables in registers, and inhibit
7484 other options that might change whether a floating-point value is
7485 taken from a register or memory.
7486
7487 This option prevents undesirable excess precision on machines such
7488 as the 68000 where the floating registers (of the 68881) keep more
7489 precision than a "double" is supposed to have. Similarly for the
7490 x86 architecture. For most programs, the excess precision does
7491 only good, but a few programs rely on the precise definition of
7492 IEEE floating point. Use -ffloat-store for such programs, after
7493 modifying them to store all pertinent intermediate computations
7494 into variables.
7495
7496 -fexcess-precision=style
7497 This option allows further control over excess precision on
7498 machines where floating-point operations occur in a format with
7499 more precision or range than the IEEE standard and interchange
7500 floating-point types. By default, -fexcess-precision=fast is in
7501 effect; this means that operations may be carried out in a wider
7502 precision than the types specified in the source if that would
7503 result in faster code, and it is unpredictable when rounding to the
7504 types specified in the source code takes place. When compiling C,
7505 if -fexcess-precision=standard is specified then excess precision
7506 follows the rules specified in ISO C99; in particular, both casts
7507 and assignments cause values to be rounded to their semantic types
7508 (whereas -ffloat-store only affects assignments). This option is
7509 enabled by default for C if a strict conformance option such as
7510 -std=c99 is used. -ffast-math enables -fexcess-precision=fast by
7511 default regardless of whether a strict conformance option is used.
7512
7513 -fexcess-precision=standard is not implemented for languages other
7514 than C. On the x86, it has no effect if -mfpmath=sse or
7515 -mfpmath=sse+387 is specified; in the former case, IEEE semantics
7516 apply without excess precision, and in the latter, rounding is
7517 unpredictable.
7518
7519 -ffast-math
7520 Sets the options -fno-math-errno, -funsafe-math-optimizations,
7521 -ffinite-math-only, -fno-rounding-math, -fno-signaling-nans,
7522 -fcx-limited-range and -fexcess-precision=fast.
7523
7524 This option causes the preprocessor macro "__FAST_MATH__" to be
7525 defined.
7526
7527 This option is not turned on by any -O option besides -Ofast since
7528 it can result in incorrect output for programs that depend on an
7529 exact implementation of IEEE or ISO rules/specifications for math
7530 functions. It may, however, yield faster code for programs that do
7531 not require the guarantees of these specifications.
7532
7533 -fno-math-errno
7534 Do not set "errno" after calling math functions that are executed
7535 with a single instruction, e.g., "sqrt". A program that relies on
7536 IEEE exceptions for math error handling may want to use this flag
7537 for speed while maintaining IEEE arithmetic compatibility.
7538
7539 This option is not turned on by any -O option since it can result
7540 in incorrect output for programs that depend on an exact
7541 implementation of IEEE or ISO rules/specifications for math
7542 functions. It may, however, yield faster code for programs that do
7543 not require the guarantees of these specifications.
7544
7545 The default is -fmath-errno.
7546
7547 On Darwin systems, the math library never sets "errno". There is
7548 therefore no reason for the compiler to consider the possibility
7549 that it might, and -fno-math-errno is the default.
7550
7551 -funsafe-math-optimizations
7552 Allow optimizations for floating-point arithmetic that (a) assume
7553 that arguments and results are valid and (b) may violate IEEE or
7554 ANSI standards. When used at link time, it may include libraries
7555 or startup files that change the default FPU control word or other
7556 similar optimizations.
7557
7558 This option is not turned on by any -O option since it can result
7559 in incorrect output for programs that depend on an exact
7560 implementation of IEEE or ISO rules/specifications for math
7561 functions. It may, however, yield faster code for programs that do
7562 not require the guarantees of these specifications. Enables
7563 -fno-signed-zeros, -fno-trapping-math, -fassociative-math and
7564 -freciprocal-math.
7565
7566 The default is -fno-unsafe-math-optimizations.
7567
7568 -fassociative-math
7569 Allow re-association of operands in series of floating-point
7570 operations. This violates the ISO C and C++ language standard by
7571 possibly changing computation result. NOTE: re-ordering may change
7572 the sign of zero as well as ignore NaNs and inhibit or create
7573 underflow or overflow (and thus cannot be used on code that relies
7574 on rounding behavior like "(x + 2**52) - 2**52". May also reorder
7575 floating-point comparisons and thus may not be used when ordered
7576 comparisons are required. This option requires that both
7577 -fno-signed-zeros and -fno-trapping-math be in effect. Moreover,
7578 it doesn't make much sense with -frounding-math. For Fortran the
7579 option is automatically enabled when both -fno-signed-zeros and
7580 -fno-trapping-math are in effect.
7581
7582 The default is -fno-associative-math.
7583
7584 -freciprocal-math
7585 Allow the reciprocal of a value to be used instead of dividing by
7586 the value if this enables optimizations. For example "x / y" can
7587 be replaced with "x * (1/y)", which is useful if "(1/y)" is subject
7588 to common subexpression elimination. Note that this loses
7589 precision and increases the number of flops operating on the value.
7590
7591 The default is -fno-reciprocal-math.
7592
7593 -ffinite-math-only
7594 Allow optimizations for floating-point arithmetic that assume that
7595 arguments and results are not NaNs or +-Infs.
7596
7597 This option is not turned on by any -O option since it can result
7598 in incorrect output for programs that depend on an exact
7599 implementation of IEEE or ISO rules/specifications for math
7600 functions. It may, however, yield faster code for programs that do
7601 not require the guarantees of these specifications.
7602
7603 The default is -fno-finite-math-only.
7604
7605 -fno-signed-zeros
7606 Allow optimizations for floating-point arithmetic that ignore the
7607 signedness of zero. IEEE arithmetic specifies the behavior of
7608 distinct +0.0 and -0.0 values, which then prohibits simplification
7609 of expressions such as x+0.0 or 0.0*x (even with
7610 -ffinite-math-only). This option implies that the sign of a zero
7611 result isn't significant.
7612
7613 The default is -fsigned-zeros.
7614
7615 -fno-trapping-math
7616 Compile code assuming that floating-point operations cannot
7617 generate user-visible traps. These traps include division by zero,
7618 overflow, underflow, inexact result and invalid operation. This
7619 option requires that -fno-signaling-nans be in effect. Setting
7620 this option may allow faster code if one relies on "non-stop" IEEE
7621 arithmetic, for example.
7622
7623 This option should never be turned on by any -O option since it can
7624 result in incorrect output for programs that depend on an exact
7625 implementation of IEEE or ISO rules/specifications for math
7626 functions.
7627
7628 The default is -ftrapping-math.
7629
7630 -frounding-math
7631 Disable transformations and optimizations that assume default
7632 floating-point rounding behavior. This is round-to-zero for all
7633 floating point to integer conversions, and round-to-nearest for all
7634 other arithmetic truncations. This option should be specified for
7635 programs that change the FP rounding mode dynamically, or that may
7636 be executed with a non-default rounding mode. This option disables
7637 constant folding of floating-point expressions at compile time
7638 (which may be affected by rounding mode) and arithmetic
7639 transformations that are unsafe in the presence of sign-dependent
7640 rounding modes.
7641
7642 The default is -fno-rounding-math.
7643
7644 This option is experimental and does not currently guarantee to
7645 disable all GCC optimizations that are affected by rounding mode.
7646 Future versions of GCC may provide finer control of this setting
7647 using C99's "FENV_ACCESS" pragma. This command-line option will be
7648 used to specify the default state for "FENV_ACCESS".
7649
7650 -fsignaling-nans
7651 Compile code assuming that IEEE signaling NaNs may generate user-
7652 visible traps during floating-point operations. Setting this
7653 option disables optimizations that may change the number of
7654 exceptions visible with signaling NaNs. This option implies
7655 -ftrapping-math.
7656
7657 This option causes the preprocessor macro "__SUPPORT_SNAN__" to be
7658 defined.
7659
7660 The default is -fno-signaling-nans.
7661
7662 This option is experimental and does not currently guarantee to
7663 disable all GCC optimizations that affect signaling NaN behavior.
7664
7665 -fno-fp-int-builtin-inexact
7666 Do not allow the built-in functions "ceil", "floor", "round" and
7667 "trunc", and their "float" and "long double" variants, to generate
7668 code that raises the "inexact" floating-point exception for
7669 noninteger arguments. ISO C99 and C11 allow these functions to
7670 raise the "inexact" exception, but ISO/IEC TS 18661-1:2014, the C
7671 bindings to IEEE 754-2008, does not allow these functions to do so.
7672
7673 The default is -ffp-int-builtin-inexact, allowing the exception to
7674 be raised. This option does nothing unless -ftrapping-math is in
7675 effect.
7676
7677 Even if -fno-fp-int-builtin-inexact is used, if the functions
7678 generate a call to a library function then the "inexact" exception
7679 may be raised if the library implementation does not follow TS
7680 18661.
7681
7682 -fsingle-precision-constant
7683 Treat floating-point constants as single precision instead of
7684 implicitly converting them to double-precision constants.
7685
7686 -fcx-limited-range
7687 When enabled, this option states that a range reduction step is not
7688 needed when performing complex division. Also, there is no
7689 checking whether the result of a complex multiplication or division
7690 is "NaN + I*NaN", with an attempt to rescue the situation in that
7691 case. The default is -fno-cx-limited-range, but is enabled by
7692 -ffast-math.
7693
7694 This option controls the default setting of the ISO C99
7695 "CX_LIMITED_RANGE" pragma. Nevertheless, the option applies to all
7696 languages.
7697
7698 -fcx-fortran-rules
7699 Complex multiplication and division follow Fortran rules. Range
7700 reduction is done as part of complex division, but there is no
7701 checking whether the result of a complex multiplication or division
7702 is "NaN + I*NaN", with an attempt to rescue the situation in that
7703 case.
7704
7705 The default is -fno-cx-fortran-rules.
7706
7707 The following options control optimizations that may improve
7708 performance, but are not enabled by any -O options. This section
7709 includes experimental options that may produce broken code.
7710
7711 -fbranch-probabilities
7712 After running a program compiled with -fprofile-arcs, you can
7713 compile it a second time using -fbranch-probabilities, to improve
7714 optimizations based on the number of times each branch was taken.
7715 When a program compiled with -fprofile-arcs exits, it saves arc
7716 execution counts to a file called sourcename.gcda for each source
7717 file. The information in this data file is very dependent on the
7718 structure of the generated code, so you must use the same source
7719 code and the same optimization options for both compilations.
7720
7721 With -fbranch-probabilities, GCC puts a REG_BR_PROB note on each
7722 JUMP_INSN and CALL_INSN. These can be used to improve
7723 optimization. Currently, they are only used in one place: in
7724 reorg.c, instead of guessing which path a branch is most likely to
7725 take, the REG_BR_PROB values are used to exactly determine which
7726 path is taken more often.
7727
7728 -fprofile-values
7729 If combined with -fprofile-arcs, it adds code so that some data
7730 about values of expressions in the program is gathered.
7731
7732 With -fbranch-probabilities, it reads back the data gathered from
7733 profiling values of expressions for usage in optimizations.
7734
7735 Enabled with -fprofile-generate and -fprofile-use.
7736
7737 -fprofile-reorder-functions
7738 Function reordering based on profile instrumentation collects first
7739 time of execution of a function and orders these functions in
7740 ascending order.
7741
7742 Enabled with -fprofile-use.
7743
7744 -fvpt
7745 If combined with -fprofile-arcs, this option instructs the compiler
7746 to add code to gather information about values of expressions.
7747
7748 With -fbranch-probabilities, it reads back the data gathered and
7749 actually performs the optimizations based on them. Currently the
7750 optimizations include specialization of division operations using
7751 the knowledge about the value of the denominator.
7752
7753 -frename-registers
7754 Attempt to avoid false dependencies in scheduled code by making use
7755 of registers left over after register allocation. This
7756 optimization most benefits processors with lots of registers.
7757 Depending on the debug information format adopted by the target,
7758 however, it can make debugging impossible, since variables no
7759 longer stay in a "home register".
7760
7761 Enabled by default with -funroll-loops.
7762
7763 -fschedule-fusion
7764 Performs a target dependent pass over the instruction stream to
7765 schedule instructions of same type together because target machine
7766 can execute them more efficiently if they are adjacent to each
7767 other in the instruction flow.
7768
7769 Enabled at levels -O2, -O3, -Os.
7770
7771 -ftracer
7772 Perform tail duplication to enlarge superblock size. This
7773 transformation simplifies the control flow of the function allowing
7774 other optimizations to do a better job.
7775
7776 Enabled with -fprofile-use.
7777
7778 -funroll-loops
7779 Unroll loops whose number of iterations can be determined at
7780 compile time or upon entry to the loop. -funroll-loops implies
7781 -frerun-cse-after-loop, -fweb and -frename-registers. It also
7782 turns on complete loop peeling (i.e. complete removal of loops with
7783 a small constant number of iterations). This option makes code
7784 larger, and may or may not make it run faster.
7785
7786 Enabled with -fprofile-use.
7787
7788 -funroll-all-loops
7789 Unroll all loops, even if their number of iterations is uncertain
7790 when the loop is entered. This usually makes programs run more
7791 slowly. -funroll-all-loops implies the same options as
7792 -funroll-loops.
7793
7794 -fpeel-loops
7795 Peels loops for which there is enough information that they do not
7796 roll much (from profile feedback or static analysis). It also
7797 turns on complete loop peeling (i.e. complete removal of loops with
7798 small constant number of iterations).
7799
7800 Enabled with -O3 and/or -fprofile-use.
7801
7802 -fmove-loop-invariants
7803 Enables the loop invariant motion pass in the RTL loop optimizer.
7804 Enabled at level -O1
7805
7806 -fsplit-loops
7807 Split a loop into two if it contains a condition that's always true
7808 for one side of the iteration space and false for the other.
7809
7810 -funswitch-loops
7811 Move branches with loop invariant conditions out of the loop, with
7812 duplicates of the loop on both branches (modified according to
7813 result of the condition).
7814
7815 -ffunction-sections
7816 -fdata-sections
7817 Place each function or data item into its own section in the output
7818 file if the target supports arbitrary sections. The name of the
7819 function or the name of the data item determines the section's name
7820 in the output file.
7821
7822 Use these options on systems where the linker can perform
7823 optimizations to improve locality of reference in the instruction
7824 space. Most systems using the ELF object format and SPARC
7825 processors running Solaris 2 have linkers with such optimizations.
7826 AIX may have these optimizations in the future.
7827
7828 Only use these options when there are significant benefits from
7829 doing so. When you specify these options, the assembler and linker
7830 create larger object and executable files and are also slower. You
7831 cannot use gprof on all systems if you specify this option, and you
7832 may have problems with debugging if you specify both this option
7833 and -g.
7834
7835 -fbranch-target-load-optimize
7836 Perform branch target register load optimization before prologue /
7837 epilogue threading. The use of target registers can typically be
7838 exposed only during reload, thus hoisting loads out of loops and
7839 doing inter-block scheduling needs a separate optimization pass.
7840
7841 -fbranch-target-load-optimize2
7842 Perform branch target register load optimization after prologue /
7843 epilogue threading.
7844
7845 -fbtr-bb-exclusive
7846 When performing branch target register load optimization, don't
7847 reuse branch target registers within any basic block.
7848
7849 -fstdarg-opt
7850 Optimize the prologue of variadic argument functions with respect
7851 to usage of those arguments.
7852
7853 -fsection-anchors
7854 Try to reduce the number of symbolic address calculations by using
7855 shared "anchor" symbols to address nearby objects. This
7856 transformation can help to reduce the number of GOT entries and GOT
7857 accesses on some targets.
7858
7859 For example, the implementation of the following function "foo":
7860
7861 static int a, b, c;
7862 int foo (void) { return a + b + c; }
7863
7864 usually calculates the addresses of all three variables, but if you
7865 compile it with -fsection-anchors, it accesses the variables from a
7866 common anchor point instead. The effect is similar to the
7867 following pseudocode (which isn't valid C):
7868
7869 int foo (void)
7870 {
7871 register int *xr = &x;
7872 return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
7873 }
7874
7875 Not all targets support this option.
7876
7877 --param name=value
7878 In some places, GCC uses various constants to control the amount of
7879 optimization that is done. For example, GCC does not inline
7880 functions that contain more than a certain number of instructions.
7881 You can control some of these constants on the command line using
7882 the --param option.
7883
7884 The names of specific parameters, and the meaning of the values,
7885 are tied to the internals of the compiler, and are subject to
7886 change without notice in future releases.
7887
7888 In each case, the value is an integer. The allowable choices for
7889 name are:
7890
7891 predictable-branch-outcome
7892 When branch is predicted to be taken with probability lower
7893 than this threshold (in percent), then it is considered well
7894 predictable. The default is 10.
7895
7896 max-rtl-if-conversion-insns
7897 RTL if-conversion tries to remove conditional branches around a
7898 block and replace them with conditionally executed
7899 instructions. This parameter gives the maximum number of
7900 instructions in a block which should be considered for if-
7901 conversion. The default is 10, though the compiler will also
7902 use other heuristics to decide whether if-conversion is likely
7903 to be profitable.
7904
7905 max-rtl-if-conversion-predictable-cost
7906 max-rtl-if-conversion-unpredictable-cost
7907 RTL if-conversion will try to remove conditional branches
7908 around a block and replace them with conditionally executed
7909 instructions. These parameters give the maximum permissible
7910 cost for the sequence that would be generated by if-conversion
7911 depending on whether the branch is statically determined to be
7912 predictable or not. The units for this parameter are the same
7913 as those for the GCC internal seq_cost metric. The compiler
7914 will try to provide a reasonable default for this parameter
7915 using the BRANCH_COST target macro.
7916
7917 max-crossjump-edges
7918 The maximum number of incoming edges to consider for cross-
7919 jumping. The algorithm used by -fcrossjumping is O(N^2) in the
7920 number of edges incoming to each block. Increasing values mean
7921 more aggressive optimization, making the compilation time
7922 increase with probably small improvement in executable size.
7923
7924 min-crossjump-insns
7925 The minimum number of instructions that must be matched at the
7926 end of two blocks before cross-jumping is performed on them.
7927 This value is ignored in the case where all instructions in the
7928 block being cross-jumped from are matched. The default value
7929 is 5.
7930
7931 max-grow-copy-bb-insns
7932 The maximum code size expansion factor when copying basic
7933 blocks instead of jumping. The expansion is relative to a jump
7934 instruction. The default value is 8.
7935
7936 max-goto-duplication-insns
7937 The maximum number of instructions to duplicate to a block that
7938 jumps to a computed goto. To avoid O(N^2) behavior in a number
7939 of passes, GCC factors computed gotos early in the compilation
7940 process, and unfactors them as late as possible. Only computed
7941 jumps at the end of a basic blocks with no more than max-goto-
7942 duplication-insns are unfactored. The default value is 8.
7943
7944 max-delay-slot-insn-search
7945 The maximum number of instructions to consider when looking for
7946 an instruction to fill a delay slot. If more than this
7947 arbitrary number of instructions are searched, the time savings
7948 from filling the delay slot are minimal, so stop searching.
7949 Increasing values mean more aggressive optimization, making the
7950 compilation time increase with probably small improvement in
7951 execution time.
7952
7953 max-delay-slot-live-search
7954 When trying to fill delay slots, the maximum number of
7955 instructions to consider when searching for a block with valid
7956 live register information. Increasing this arbitrarily chosen
7957 value means more aggressive optimization, increasing the
7958 compilation time. This parameter should be removed when the
7959 delay slot code is rewritten to maintain the control-flow
7960 graph.
7961
7962 max-gcse-memory
7963 The approximate maximum amount of memory that can be allocated
7964 in order to perform the global common subexpression elimination
7965 optimization. If more memory than specified is required, the
7966 optimization is not done.
7967
7968 max-gcse-insertion-ratio
7969 If the ratio of expression insertions to deletions is larger
7970 than this value for any expression, then RTL PRE inserts or
7971 removes the expression and thus leaves partially redundant
7972 computations in the instruction stream. The default value is
7973 20.
7974
7975 max-pending-list-length
7976 The maximum number of pending dependencies scheduling allows
7977 before flushing the current state and starting over. Large
7978 functions with few branches or calls can create excessively
7979 large lists which needlessly consume memory and resources.
7980
7981 max-modulo-backtrack-attempts
7982 The maximum number of backtrack attempts the scheduler should
7983 make when modulo scheduling a loop. Larger values can
7984 exponentially increase compilation time.
7985
7986 max-inline-insns-single
7987 Several parameters control the tree inliner used in GCC. This
7988 number sets the maximum number of instructions (counted in
7989 GCC's internal representation) in a single function that the
7990 tree inliner considers for inlining. This only affects
7991 functions declared inline and methods implemented in a class
7992 declaration (C++). The default value is 400.
7993
7994 max-inline-insns-auto
7995 When you use -finline-functions (included in -O3), a lot of
7996 functions that would otherwise not be considered for inlining
7997 by the compiler are investigated. To those functions, a
7998 different (more restrictive) limit compared to functions
7999 declared inline can be applied. The default value is 40.
8000
8001 inline-min-speedup
8002 When estimated performance improvement of caller + callee
8003 runtime exceeds this threshold (in percent), the function can
8004 be inlined regardless of the limit on --param max-inline-insns-
8005 single and --param max-inline-insns-auto.
8006
8007 large-function-insns
8008 The limit specifying really large functions. For functions
8009 larger than this limit after inlining, inlining is constrained
8010 by --param large-function-growth. This parameter is useful
8011 primarily to avoid extreme compilation time caused by non-
8012 linear algorithms used by the back end. The default value is
8013 2700.
8014
8015 large-function-growth
8016 Specifies maximal growth of large function caused by inlining
8017 in percents. The default value is 100 which limits large
8018 function growth to 2.0 times the original size.
8019
8020 large-unit-insns
8021 The limit specifying large translation unit. Growth caused by
8022 inlining of units larger than this limit is limited by --param
8023 inline-unit-growth. For small units this might be too tight.
8024 For example, consider a unit consisting of function A that is
8025 inline and B that just calls A three times. If B is small
8026 relative to A, the growth of unit is 300\% and yet such
8027 inlining is very sane. For very large units consisting of
8028 small inlineable functions, however, the overall unit growth
8029 limit is needed to avoid exponential explosion of code size.
8030 Thus for smaller units, the size is increased to --param large-
8031 unit-insns before applying --param inline-unit-growth. The
8032 default is 10000.
8033
8034 inline-unit-growth
8035 Specifies maximal overall growth of the compilation unit caused
8036 by inlining. The default value is 20 which limits unit growth
8037 to 1.2 times the original size. Cold functions (either marked
8038 cold via an attribute or by profile feedback) are not accounted
8039 into the unit size.
8040
8041 ipcp-unit-growth
8042 Specifies maximal overall growth of the compilation unit caused
8043 by interprocedural constant propagation. The default value is
8044 10 which limits unit growth to 1.1 times the original size.
8045
8046 large-stack-frame
8047 The limit specifying large stack frames. While inlining the
8048 algorithm is trying to not grow past this limit too much. The
8049 default value is 256 bytes.
8050
8051 large-stack-frame-growth
8052 Specifies maximal growth of large stack frames caused by
8053 inlining in percents. The default value is 1000 which limits
8054 large stack frame growth to 11 times the original size.
8055
8056 max-inline-insns-recursive
8057 max-inline-insns-recursive-auto
8058 Specifies the maximum number of instructions an out-of-line
8059 copy of a self-recursive inline function can grow into by
8060 performing recursive inlining.
8061
8062 --param max-inline-insns-recursive applies to functions
8063 declared inline. For functions not declared inline, recursive
8064 inlining happens only when -finline-functions (included in -O3)
8065 is enabled; --param max-inline-insns-recursive-auto applies
8066 instead. The default value is 450.
8067
8068 max-inline-recursive-depth
8069 max-inline-recursive-depth-auto
8070 Specifies the maximum recursion depth used for recursive
8071 inlining.
8072
8073 --param max-inline-recursive-depth applies to functions
8074 declared inline. For functions not declared inline, recursive
8075 inlining happens only when -finline-functions (included in -O3)
8076 is enabled; --param max-inline-recursive-depth-auto applies
8077 instead. The default value is 8.
8078
8079 min-inline-recursive-probability
8080 Recursive inlining is profitable only for function having deep
8081 recursion in average and can hurt for function having little
8082 recursion depth by increasing the prologue size or complexity
8083 of function body to other optimizers.
8084
8085 When profile feedback is available (see -fprofile-generate) the
8086 actual recursion depth can be guessed from the probability that
8087 function recurses via a given call expression. This parameter
8088 limits inlining only to call expressions whose probability
8089 exceeds the given threshold (in percents). The default value
8090 is 10.
8091
8092 early-inlining-insns
8093 Specify growth that the early inliner can make. In effect it
8094 increases the amount of inlining for code having a large
8095 abstraction penalty. The default value is 14.
8096
8097 max-early-inliner-iterations
8098 Limit of iterations of the early inliner. This basically
8099 bounds the number of nested indirect calls the early inliner
8100 can resolve. Deeper chains are still handled by late inlining.
8101
8102 comdat-sharing-probability
8103 Probability (in percent) that C++ inline function with comdat
8104 visibility are shared across multiple compilation units. The
8105 default value is 20.
8106
8107 profile-func-internal-id
8108 A parameter to control whether to use function internal id in
8109 profile database lookup. If the value is 0, the compiler uses
8110 an id that is based on function assembler name and filename,
8111 which makes old profile data more tolerant to source changes
8112 such as function reordering etc. The default value is 0.
8113
8114 min-vect-loop-bound
8115 The minimum number of iterations under which loops are not
8116 vectorized when -ftree-vectorize is used. The number of
8117 iterations after vectorization needs to be greater than the
8118 value specified by this option to allow vectorization. The
8119 default value is 0.
8120
8121 gcse-cost-distance-ratio
8122 Scaling factor in calculation of maximum distance an expression
8123 can be moved by GCSE optimizations. This is currently
8124 supported only in the code hoisting pass. The bigger the
8125 ratio, the more aggressive code hoisting is with simple
8126 expressions, i.e., the expressions that have cost less than
8127 gcse-unrestricted-cost. Specifying 0 disables hoisting of
8128 simple expressions. The default value is 10.
8129
8130 gcse-unrestricted-cost
8131 Cost, roughly measured as the cost of a single typical machine
8132 instruction, at which GCSE optimizations do not constrain the
8133 distance an expression can travel. This is currently supported
8134 only in the code hoisting pass. The lesser the cost, the more
8135 aggressive code hoisting is. Specifying 0 allows all
8136 expressions to travel unrestricted distances. The default
8137 value is 3.
8138
8139 max-hoist-depth
8140 The depth of search in the dominator tree for expressions to
8141 hoist. This is used to avoid quadratic behavior in hoisting
8142 algorithm. The value of 0 does not limit on the search, but
8143 may slow down compilation of huge functions. The default value
8144 is 30.
8145
8146 max-tail-merge-comparisons
8147 The maximum amount of similar bbs to compare a bb with. This
8148 is used to avoid quadratic behavior in tree tail merging. The
8149 default value is 10.
8150
8151 max-tail-merge-iterations
8152 The maximum amount of iterations of the pass over the function.
8153 This is used to limit compilation time in tree tail merging.
8154 The default value is 2.
8155
8156 store-merging-allow-unaligned
8157 Allow the store merging pass to introduce unaligned stores if
8158 it is legal to do so. The default value is 1.
8159
8160 max-stores-to-merge
8161 The maximum number of stores to attempt to merge into wider
8162 stores in the store merging pass. The minimum value is 2 and
8163 the default is 64.
8164
8165 max-unrolled-insns
8166 The maximum number of instructions that a loop may have to be
8167 unrolled. If a loop is unrolled, this parameter also
8168 determines how many times the loop code is unrolled.
8169
8170 max-average-unrolled-insns
8171 The maximum number of instructions biased by probabilities of
8172 their execution that a loop may have to be unrolled. If a loop
8173 is unrolled, this parameter also determines how many times the
8174 loop code is unrolled.
8175
8176 max-unroll-times
8177 The maximum number of unrollings of a single loop.
8178
8179 max-peeled-insns
8180 The maximum number of instructions that a loop may have to be
8181 peeled. If a loop is peeled, this parameter also determines
8182 how many times the loop code is peeled.
8183
8184 max-peel-times
8185 The maximum number of peelings of a single loop.
8186
8187 max-peel-branches
8188 The maximum number of branches on the hot path through the
8189 peeled sequence.
8190
8191 max-completely-peeled-insns
8192 The maximum number of insns of a completely peeled loop.
8193
8194 max-completely-peel-times
8195 The maximum number of iterations of a loop to be suitable for
8196 complete peeling.
8197
8198 max-completely-peel-loop-nest-depth
8199 The maximum depth of a loop nest suitable for complete peeling.
8200
8201 max-unswitch-insns
8202 The maximum number of insns of an unswitched loop.
8203
8204 max-unswitch-level
8205 The maximum number of branches unswitched in a single loop.
8206
8207 max-loop-headers-insns
8208 The maximum number of insns in loop header duplicated by the
8209 copy loop headers pass.
8210
8211 lim-expensive
8212 The minimum cost of an expensive expression in the loop
8213 invariant motion.
8214
8215 iv-consider-all-candidates-bound
8216 Bound on number of candidates for induction variables, below
8217 which all candidates are considered for each use in induction
8218 variable optimizations. If there are more candidates than
8219 this, only the most relevant ones are considered to avoid
8220 quadratic time complexity.
8221
8222 iv-max-considered-uses
8223 The induction variable optimizations give up on loops that
8224 contain more induction variable uses.
8225
8226 iv-always-prune-cand-set-bound
8227 If the number of candidates in the set is smaller than this
8228 value, always try to remove unnecessary ivs from the set when
8229 adding a new one.
8230
8231 avg-loop-niter
8232 Average number of iterations of a loop.
8233
8234 dse-max-object-size
8235 Maximum size (in bytes) of objects tracked bytewise by dead
8236 store elimination. Larger values may result in larger
8237 compilation times.
8238
8239 scev-max-expr-size
8240 Bound on size of expressions used in the scalar evolutions
8241 analyzer. Large expressions slow the analyzer.
8242
8243 scev-max-expr-complexity
8244 Bound on the complexity of the expressions in the scalar
8245 evolutions analyzer. Complex expressions slow the analyzer.
8246
8247 max-tree-if-conversion-phi-args
8248 Maximum number of arguments in a PHI supported by TREE if
8249 conversion unless the loop is marked with simd pragma.
8250
8251 vect-max-version-for-alignment-checks
8252 The maximum number of run-time checks that can be performed
8253 when doing loop versioning for alignment in the vectorizer.
8254
8255 vect-max-version-for-alias-checks
8256 The maximum number of run-time checks that can be performed
8257 when doing loop versioning for alias in the vectorizer.
8258
8259 vect-max-peeling-for-alignment
8260 The maximum number of loop peels to enhance access alignment
8261 for vectorizer. Value -1 means no limit.
8262
8263 max-iterations-to-track
8264 The maximum number of iterations of a loop the brute-force
8265 algorithm for analysis of the number of iterations of the loop
8266 tries to evaluate.
8267
8268 hot-bb-count-ws-permille
8269 A basic block profile count is considered hot if it contributes
8270 to the given permillage (i.e. 0...1000) of the entire profiled
8271 execution.
8272
8273 hot-bb-frequency-fraction
8274 Select fraction of the entry block frequency of executions of
8275 basic block in function given basic block needs to have to be
8276 considered hot.
8277
8278 max-predicted-iterations
8279 The maximum number of loop iterations we predict statically.
8280 This is useful in cases where a function contains a single loop
8281 with known bound and another loop with unknown bound. The
8282 known number of iterations is predicted correctly, while the
8283 unknown number of iterations average to roughly 10. This means
8284 that the loop without bounds appears artificially cold relative
8285 to the other one.
8286
8287 builtin-expect-probability
8288 Control the probability of the expression having the specified
8289 value. This parameter takes a percentage (i.e. 0 ... 100) as
8290 input. The default probability of 90 is obtained empirically.
8291
8292 align-threshold
8293 Select fraction of the maximal frequency of executions of a
8294 basic block in a function to align the basic block.
8295
8296 align-loop-iterations
8297 A loop expected to iterate at least the selected number of
8298 iterations is aligned.
8299
8300 tracer-dynamic-coverage
8301 tracer-dynamic-coverage-feedback
8302 This value is used to limit superblock formation once the given
8303 percentage of executed instructions is covered. This limits
8304 unnecessary code size expansion.
8305
8306 The tracer-dynamic-coverage-feedback parameter is used only
8307 when profile feedback is available. The real profiles (as
8308 opposed to statically estimated ones) are much less balanced
8309 allowing the threshold to be larger value.
8310
8311 tracer-max-code-growth
8312 Stop tail duplication once code growth has reached given
8313 percentage. This is a rather artificial limit, as most of the
8314 duplicates are eliminated later in cross jumping, so it may be
8315 set to much higher values than is the desired code growth.
8316
8317 tracer-min-branch-ratio
8318 Stop reverse growth when the reverse probability of best edge
8319 is less than this threshold (in percent).
8320
8321 tracer-min-branch-probability
8322 tracer-min-branch-probability-feedback
8323 Stop forward growth if the best edge has probability lower than
8324 this threshold.
8325
8326 Similarly to tracer-dynamic-coverage two parameters are
8327 provided. tracer-min-branch-probability-feedback is used for
8328 compilation with profile feedback and tracer-min-branch-
8329 probability compilation without. The value for compilation
8330 with profile feedback needs to be more conservative (higher) in
8331 order to make tracer effective.
8332
8333 max-cse-path-length
8334 The maximum number of basic blocks on path that CSE considers.
8335 The default is 10.
8336
8337 max-cse-insns
8338 The maximum number of instructions CSE processes before
8339 flushing. The default is 1000.
8340
8341 ggc-min-expand
8342 GCC uses a garbage collector to manage its own memory
8343 allocation. This parameter specifies the minimum percentage by
8344 which the garbage collector's heap should be allowed to expand
8345 between collections. Tuning this may improve compilation
8346 speed; it has no effect on code generation.
8347
8348 The default is 30% + 70% * (RAM/1GB) with an upper bound of
8349 100% when RAM >= 1GB. If "getrlimit" is available, the notion
8350 of "RAM" is the smallest of actual RAM and "RLIMIT_DATA" or
8351 "RLIMIT_AS". If GCC is not able to calculate RAM on a
8352 particular platform, the lower bound of 30% is used. Setting
8353 this parameter and ggc-min-heapsize to zero causes a full
8354 collection to occur at every opportunity. This is extremely
8355 slow, but can be useful for debugging.
8356
8357 ggc-min-heapsize
8358 Minimum size of the garbage collector's heap before it begins
8359 bothering to collect garbage. The first collection occurs
8360 after the heap expands by ggc-min-expand% beyond ggc-min-
8361 heapsize. Again, tuning this may improve compilation speed,
8362 and has no effect on code generation.
8363
8364 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit
8365 that tries to ensure that RLIMIT_DATA or RLIMIT_AS are not
8366 exceeded, but with a lower bound of 4096 (four megabytes) and
8367 an upper bound of 131072 (128 megabytes). If GCC is not able
8368 to calculate RAM on a particular platform, the lower bound is
8369 used. Setting this parameter very large effectively disables
8370 garbage collection. Setting this parameter and ggc-min-expand
8371 to zero causes a full collection to occur at every opportunity.
8372
8373 max-reload-search-insns
8374 The maximum number of instruction reload should look backward
8375 for equivalent register. Increasing values mean more
8376 aggressive optimization, making the compilation time increase
8377 with probably slightly better performance. The default value
8378 is 100.
8379
8380 max-cselib-memory-locations
8381 The maximum number of memory locations cselib should take into
8382 account. Increasing values mean more aggressive optimization,
8383 making the compilation time increase with probably slightly
8384 better performance. The default value is 500.
8385
8386 max-sched-ready-insns
8387 The maximum number of instructions ready to be issued the
8388 scheduler should consider at any given time during the first
8389 scheduling pass. Increasing values mean more thorough
8390 searches, making the compilation time increase with probably
8391 little benefit. The default value is 100.
8392
8393 max-sched-region-blocks
8394 The maximum number of blocks in a region to be considered for
8395 interblock scheduling. The default value is 10.
8396
8397 max-pipeline-region-blocks
8398 The maximum number of blocks in a region to be considered for
8399 pipelining in the selective scheduler. The default value is
8400 15.
8401
8402 max-sched-region-insns
8403 The maximum number of insns in a region to be considered for
8404 interblock scheduling. The default value is 100.
8405
8406 max-pipeline-region-insns
8407 The maximum number of insns in a region to be considered for
8408 pipelining in the selective scheduler. The default value is
8409 200.
8410
8411 min-spec-prob
8412 The minimum probability (in percents) of reaching a source
8413 block for interblock speculative scheduling. The default value
8414 is 40.
8415
8416 max-sched-extend-regions-iters
8417 The maximum number of iterations through CFG to extend regions.
8418 A value of 0 (the default) disables region extensions.
8419
8420 max-sched-insn-conflict-delay
8421 The maximum conflict delay for an insn to be considered for
8422 speculative motion. The default value is 3.
8423
8424 sched-spec-prob-cutoff
8425 The minimal probability of speculation success (in percents),
8426 so that speculative insns are scheduled. The default value is
8427 40.
8428
8429 sched-state-edge-prob-cutoff
8430 The minimum probability an edge must have for the scheduler to
8431 save its state across it. The default value is 10.
8432
8433 sched-mem-true-dep-cost
8434 Minimal distance (in CPU cycles) between store and load
8435 targeting same memory locations. The default value is 1.
8436
8437 selsched-max-lookahead
8438 The maximum size of the lookahead window of selective
8439 scheduling. It is a depth of search for available
8440 instructions. The default value is 50.
8441
8442 selsched-max-sched-times
8443 The maximum number of times that an instruction is scheduled
8444 during selective scheduling. This is the limit on the number
8445 of iterations through which the instruction may be pipelined.
8446 The default value is 2.
8447
8448 selsched-insns-to-rename
8449 The maximum number of best instructions in the ready list that
8450 are considered for renaming in the selective scheduler. The
8451 default value is 2.
8452
8453 sms-min-sc
8454 The minimum value of stage count that swing modulo scheduler
8455 generates. The default value is 2.
8456
8457 max-last-value-rtl
8458 The maximum size measured as number of RTLs that can be
8459 recorded in an expression in combiner for a pseudo register as
8460 last known value of that register. The default is 10000.
8461
8462 max-combine-insns
8463 The maximum number of instructions the RTL combiner tries to
8464 combine. The default value is 2 at -Og and 4 otherwise.
8465
8466 integer-share-limit
8467 Small integer constants can use a shared data structure,
8468 reducing the compiler's memory usage and increasing its speed.
8469 This sets the maximum value of a shared integer constant. The
8470 default value is 256.
8471
8472 ssp-buffer-size
8473 The minimum size of buffers (i.e. arrays) that receive stack
8474 smashing protection when -fstack-protection is used.
8475
8476 min-size-for-stack-sharing
8477 The minimum size of variables taking part in stack slot sharing
8478 when not optimizing. The default value is 32.
8479
8480 max-jump-thread-duplication-stmts
8481 Maximum number of statements allowed in a block that needs to
8482 be duplicated when threading jumps.
8483
8484 max-fields-for-field-sensitive
8485 Maximum number of fields in a structure treated in a field
8486 sensitive manner during pointer analysis. The default is zero
8487 for -O0 and -O1, and 100 for -Os, -O2, and -O3.
8488
8489 prefetch-latency
8490 Estimate on average number of instructions that are executed
8491 before prefetch finishes. The distance prefetched ahead is
8492 proportional to this constant. Increasing this number may also
8493 lead to less streams being prefetched (see simultaneous-
8494 prefetches).
8495
8496 simultaneous-prefetches
8497 Maximum number of prefetches that can run at the same time.
8498
8499 l1-cache-line-size
8500 The size of cache line in L1 cache, in bytes.
8501
8502 l1-cache-size
8503 The size of L1 cache, in kilobytes.
8504
8505 l2-cache-size
8506 The size of L2 cache, in kilobytes.
8507
8508 min-insn-to-prefetch-ratio
8509 The minimum ratio between the number of instructions and the
8510 number of prefetches to enable prefetching in a loop.
8511
8512 prefetch-min-insn-to-mem-ratio
8513 The minimum ratio between the number of instructions and the
8514 number of memory references to enable prefetching in a loop.
8515
8516 use-canonical-types
8517 Whether the compiler should use the "canonical" type system.
8518 By default, this should always be 1, which uses a more
8519 efficient internal mechanism for comparing types in C++ and
8520 Objective-C++. However, if bugs in the canonical type system
8521 are causing compilation failures, set this value to 0 to
8522 disable canonical types.
8523
8524 switch-conversion-max-branch-ratio
8525 Switch initialization conversion refuses to create arrays that
8526 are bigger than switch-conversion-max-branch-ratio times the
8527 number of branches in the switch.
8528
8529 max-partial-antic-length
8530 Maximum length of the partial antic set computed during the
8531 tree partial redundancy elimination optimization (-ftree-pre)
8532 when optimizing at -O3 and above. For some sorts of source
8533 code the enhanced partial redundancy elimination optimization
8534 can run away, consuming all of the memory available on the host
8535 machine. This parameter sets a limit on the length of the sets
8536 that are computed, which prevents the runaway behavior.
8537 Setting a value of 0 for this parameter allows an unlimited set
8538 length.
8539
8540 sccvn-max-scc-size
8541 Maximum size of a strongly connected component (SCC) during
8542 SCCVN processing. If this limit is hit, SCCVN processing for
8543 the whole function is not done and optimizations depending on
8544 it are disabled. The default maximum SCC size is 10000.
8545
8546 sccvn-max-alias-queries-per-access
8547 Maximum number of alias-oracle queries we perform when looking
8548 for redundancies for loads and stores. If this limit is hit
8549 the search is aborted and the load or store is not considered
8550 redundant. The number of queries is algorithmically limited to
8551 the number of stores on all paths from the load to the function
8552 entry. The default maximum number of queries is 1000.
8553
8554 ira-max-loops-num
8555 IRA uses regional register allocation by default. If a
8556 function contains more loops than the number given by this
8557 parameter, only at most the given number of the most
8558 frequently-executed loops form regions for regional register
8559 allocation. The default value of the parameter is 100.
8560
8561 ira-max-conflict-table-size
8562 Although IRA uses a sophisticated algorithm to compress the
8563 conflict table, the table can still require excessive amounts
8564 of memory for huge functions. If the conflict table for a
8565 function could be more than the size in MB given by this
8566 parameter, the register allocator instead uses a faster,
8567 simpler, and lower-quality algorithm that does not require
8568 building a pseudo-register conflict table. The default value
8569 of the parameter is 2000.
8570
8571 ira-loop-reserved-regs
8572 IRA can be used to evaluate more accurate register pressure in
8573 loops for decisions to move loop invariants (see -O3). The
8574 number of available registers reserved for some other purposes
8575 is given by this parameter. The default value of the parameter
8576 is 2, which is the minimal number of registers needed by
8577 typical instructions. This value is the best found from
8578 numerous experiments.
8579
8580 lra-inheritance-ebb-probability-cutoff
8581 LRA tries to reuse values reloaded in registers in subsequent
8582 insns. This optimization is called inheritance. EBB is used
8583 as a region to do this optimization. The parameter defines a
8584 minimal fall-through edge probability in percentage used to add
8585 BB to inheritance EBB in LRA. The default value of the
8586 parameter is 40. The value was chosen from numerous runs of
8587 SPEC2000 on x86-64.
8588
8589 loop-invariant-max-bbs-in-loop
8590 Loop invariant motion can be very expensive, both in
8591 compilation time and in amount of needed compile-time memory,
8592 with very large loops. Loops with more basic blocks than this
8593 parameter won't have loop invariant motion optimization
8594 performed on them. The default value of the parameter is 1000
8595 for -O1 and 10000 for -O2 and above.
8596
8597 loop-max-datarefs-for-datadeps
8598 Building data dependencies is expensive for very large loops.
8599 This parameter limits the number of data references in loops
8600 that are considered for data dependence analysis. These large
8601 loops are no handled by the optimizations using loop data
8602 dependencies. The default value is 1000.
8603
8604 max-vartrack-size
8605 Sets a maximum number of hash table slots to use during
8606 variable tracking dataflow analysis of any function. If this
8607 limit is exceeded with variable tracking at assignments
8608 enabled, analysis for that function is retried without it,
8609 after removing all debug insns from the function. If the limit
8610 is exceeded even without debug insns, var tracking analysis is
8611 completely disabled for the function. Setting the parameter to
8612 zero makes it unlimited.
8613
8614 max-vartrack-expr-depth
8615 Sets a maximum number of recursion levels when attempting to
8616 map variable names or debug temporaries to value expressions.
8617 This trades compilation time for more complete debug
8618 information. If this is set too low, value expressions that
8619 are available and could be represented in debug information may
8620 end up not being used; setting this higher may enable the
8621 compiler to find more complex debug expressions, but compile
8622 time and memory use may grow. The default is 12.
8623
8624 min-nondebug-insn-uid
8625 Use uids starting at this parameter for nondebug insns. The
8626 range below the parameter is reserved exclusively for debug
8627 insns created by -fvar-tracking-assignments, but debug insns
8628 may get (non-overlapping) uids above it if the reserved range
8629 is exhausted.
8630
8631 ipa-sra-ptr-growth-factor
8632 IPA-SRA replaces a pointer to an aggregate with one or more new
8633 parameters only when their cumulative size is less or equal to
8634 ipa-sra-ptr-growth-factor times the size of the original
8635 pointer parameter.
8636
8637 sra-max-scalarization-size-Ospeed
8638 sra-max-scalarization-size-Osize
8639 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA)
8640 aim to replace scalar parts of aggregates with uses of
8641 independent scalar variables. These parameters control the
8642 maximum size, in storage units, of aggregate which is
8643 considered for replacement when compiling for speed (sra-max-
8644 scalarization-size-Ospeed) or size (sra-max-scalarization-size-
8645 Osize) respectively.
8646
8647 tm-max-aggregate-size
8648 When making copies of thread-local variables in a transaction,
8649 this parameter specifies the size in bytes after which
8650 variables are saved with the logging functions as opposed to
8651 save/restore code sequence pairs. This option only applies
8652 when using -fgnu-tm.
8653
8654 graphite-max-nb-scop-params
8655 To avoid exponential effects in the Graphite loop transforms,
8656 the number of parameters in a Static Control Part (SCoP) is
8657 bounded. The default value is 10 parameters. A variable whose
8658 value is unknown at compilation time and defined outside a SCoP
8659 is a parameter of the SCoP.
8660
8661 graphite-max-bbs-per-function
8662 To avoid exponential effects in the detection of SCoPs, the
8663 size of the functions analyzed by Graphite is bounded. The
8664 default value is 100 basic blocks.
8665
8666 loop-block-tile-size
8667 Loop blocking or strip mining transforms, enabled with
8668 -floop-block or -floop-strip-mine, strip mine each loop in the
8669 loop nest by a given number of iterations. The strip length
8670 can be changed using the loop-block-tile-size parameter. The
8671 default value is 51 iterations.
8672
8673 loop-unroll-jam-size
8674 Specify the unroll factor for the -floop-unroll-and-jam option.
8675 The default value is 4.
8676
8677 loop-unroll-jam-depth
8678 Specify the dimension to be unrolled (counting from the most
8679 inner loop) for the -floop-unroll-and-jam. The default value
8680 is 2.
8681
8682 ipa-cp-value-list-size
8683 IPA-CP attempts to track all possible values and types passed
8684 to a function's parameter in order to propagate them and
8685 perform devirtualization. ipa-cp-value-list-size is the
8686 maximum number of values and types it stores per one formal
8687 parameter of a function.
8688
8689 ipa-cp-eval-threshold
8690 IPA-CP calculates its own score of cloning profitability
8691 heuristics and performs those cloning opportunities with scores
8692 that exceed ipa-cp-eval-threshold.
8693
8694 ipa-cp-recursion-penalty
8695 Percentage penalty the recursive functions will receive when
8696 they are evaluated for cloning.
8697
8698 ipa-cp-single-call-penalty
8699 Percentage penalty functions containing a single call to
8700 another function will receive when they are evaluated for
8701 cloning.
8702
8703 ipa-max-agg-items
8704 IPA-CP is also capable to propagate a number of scalar values
8705 passed in an aggregate. ipa-max-agg-items controls the maximum
8706 number of such values per one parameter.
8707
8708 ipa-cp-loop-hint-bonus
8709 When IPA-CP determines that a cloning candidate would make the
8710 number of iterations of a loop known, it adds a bonus of ipa-
8711 cp-loop-hint-bonus to the profitability score of the candidate.
8712
8713 ipa-cp-array-index-hint-bonus
8714 When IPA-CP determines that a cloning candidate would make the
8715 index of an array access known, it adds a bonus of ipa-cp-
8716 array-index-hint-bonus to the profitability score of the
8717 candidate.
8718
8719 ipa-max-aa-steps
8720 During its analysis of function bodies, IPA-CP employs alias
8721 analysis in order to track values pointed to by function
8722 parameters. In order not spend too much time analyzing huge
8723 functions, it gives up and consider all memory clobbered after
8724 examining ipa-max-aa-steps statements modifying memory.
8725
8726 lto-partitions
8727 Specify desired number of partitions produced during WHOPR
8728 compilation. The number of partitions should exceed the number
8729 of CPUs used for compilation. The default value is 32.
8730
8731 lto-min-partition
8732 Size of minimal partition for WHOPR (in estimated
8733 instructions). This prevents expenses of splitting very small
8734 programs into too many partitions.
8735
8736 lto-max-partition
8737 Size of max partition for WHOPR (in estimated instructions).
8738 to provide an upper bound for individual size of partition.
8739 Meant to be used only with balanced partitioning.
8740
8741 cxx-max-namespaces-for-diagnostic-help
8742 The maximum number of namespaces to consult for suggestions
8743 when C++ name lookup fails for an identifier. The default is
8744 1000.
8745
8746 sink-frequency-threshold
8747 The maximum relative execution frequency (in percents) of the
8748 target block relative to a statement's original block to allow
8749 statement sinking of a statement. Larger numbers result in
8750 more aggressive statement sinking. The default value is 75. A
8751 small positive adjustment is applied for statements with memory
8752 operands as those are even more profitable so sink.
8753
8754 max-stores-to-sink
8755 The maximum number of conditional store pairs that can be sunk.
8756 Set to 0 if either vectorization (-ftree-vectorize) or if-
8757 conversion (-ftree-loop-if-convert) is disabled. The default
8758 is 2.
8759
8760 allow-store-data-races
8761 Allow optimizers to introduce new data races on stores. Set to
8762 1 to allow, otherwise to 0. This option is enabled by default
8763 at optimization level -Ofast.
8764
8765 case-values-threshold
8766 The smallest number of different values for which it is best to
8767 use a jump-table instead of a tree of conditional branches. If
8768 the value is 0, use the default for the machine. The default
8769 is 0.
8770
8771 tree-reassoc-width
8772 Set the maximum number of instructions executed in parallel in
8773 reassociated tree. This parameter overrides target dependent
8774 heuristics used by default if has non zero value.
8775
8776 sched-pressure-algorithm
8777 Choose between the two available implementations of
8778 -fsched-pressure. Algorithm 1 is the original implementation
8779 and is the more likely to prevent instructions from being
8780 reordered. Algorithm 2 was designed to be a compromise between
8781 the relatively conservative approach taken by algorithm 1 and
8782 the rather aggressive approach taken by the default scheduler.
8783 It relies more heavily on having a regular register file and
8784 accurate register pressure classes. See haifa-sched.c in the
8785 GCC sources for more details.
8786
8787 The default choice depends on the target.
8788
8789 max-slsr-cand-scan
8790 Set the maximum number of existing candidates that are
8791 considered when seeking a basis for a new straight-line
8792 strength reduction candidate.
8793
8794 asan-globals
8795 Enable buffer overflow detection for global objects. This kind
8796 of protection is enabled by default if you are using
8797 -fsanitize=address option. To disable global objects
8798 protection use --param asan-globals=0.
8799
8800 asan-stack
8801 Enable buffer overflow detection for stack objects. This kind
8802 of protection is enabled by default when using
8803 -fsanitize=address. To disable stack protection use --param
8804 asan-stack=0 option.
8805
8806 asan-instrument-reads
8807 Enable buffer overflow detection for memory reads. This kind
8808 of protection is enabled by default when using
8809 -fsanitize=address. To disable memory reads protection use
8810 --param asan-instrument-reads=0.
8811
8812 asan-instrument-writes
8813 Enable buffer overflow detection for memory writes. This kind
8814 of protection is enabled by default when using
8815 -fsanitize=address. To disable memory writes protection use
8816 --param asan-instrument-writes=0 option.
8817
8818 asan-memintrin
8819 Enable detection for built-in functions. This kind of
8820 protection is enabled by default when using -fsanitize=address.
8821 To disable built-in functions protection use --param
8822 asan-memintrin=0.
8823
8824 asan-use-after-return
8825 Enable detection of use-after-return. This kind of protection
8826 is enabled by default when using the -fsanitize=address option.
8827 To disable it use --param asan-use-after-return=0.
8828
8829 Note: By default the check is disabled at run time. To enable
8830 it, add "detect_stack_use_after_return=1" to the environment
8831 variable ASAN_OPTIONS.
8832
8833 asan-instrumentation-with-call-threshold
8834 If number of memory accesses in function being instrumented is
8835 greater or equal to this number, use callbacks instead of
8836 inline checks. E.g. to disable inline code use --param
8837 asan-instrumentation-with-call-threshold=0.
8838
8839 use-after-scope-direct-emission-threshold
8840 If the size of a local variable in bytes is smaller or equal to
8841 this number, directly poison (or unpoison) shadow memory
8842 instead of using run-time callbacks. The default value is 256.
8843
8844 chkp-max-ctor-size
8845 Static constructors generated by Pointer Bounds Checker may
8846 become very large and significantly increase compile time at
8847 optimization level -O1 and higher. This parameter is a maximum
8848 number of statements in a single generated constructor.
8849 Default value is 5000.
8850
8851 max-fsm-thread-path-insns
8852 Maximum number of instructions to copy when duplicating blocks
8853 on a finite state automaton jump thread path. The default is
8854 100.
8855
8856 max-fsm-thread-length
8857 Maximum number of basic blocks on a finite state automaton jump
8858 thread path. The default is 10.
8859
8860 max-fsm-thread-paths
8861 Maximum number of new jump thread paths to create for a finite
8862 state automaton. The default is 50.
8863
8864 parloops-chunk-size
8865 Chunk size of omp schedule for loops parallelized by parloops.
8866 The default is 0.
8867
8868 parloops-schedule
8869 Schedule type of omp schedule for loops parallelized by
8870 parloops (static, dynamic, guided, auto, runtime). The default
8871 is static.
8872
8873 max-ssa-name-query-depth
8874 Maximum depth of recursion when querying properties of SSA
8875 names in things like fold routines. One level of recursion
8876 corresponds to following a use-def chain.
8877
8878 hsa-gen-debug-stores
8879 Enable emission of special debug stores within HSA kernels
8880 which are then read and reported by libgomp plugin. Generation
8881 of these stores is disabled by default, use --param
8882 hsa-gen-debug-stores=1 to enable it.
8883
8884 max-speculative-devirt-maydefs
8885 The maximum number of may-defs we analyze when looking for a
8886 must-def specifying the dynamic type of an object that invokes
8887 a virtual call we may be able to devirtualize speculatively.
8888
8889 max-vrp-switch-assertions
8890 The maximum number of assertions to add along the default edge
8891 of a switch statement during VRP. The default is 10.
8892
8893 Program Instrumentation Options
8894 GCC supports a number of command-line options that control adding run-
8895 time instrumentation to the code it normally generates. For example,
8896 one purpose of instrumentation is collect profiling statistics for use
8897 in finding program hot spots, code coverage analysis, or profile-guided
8898 optimizations. Another class of program instrumentation is adding run-
8899 time checking to detect programming errors like invalid pointer
8900 dereferences or out-of-bounds array accesses, as well as deliberately
8901 hostile attacks such as stack smashing or C++ vtable hijacking. There
8902 is also a general hook which can be used to implement other forms of
8903 tracing or function-level instrumentation for debug or program analysis
8904 purposes.
8905
8906 -p Generate extra code to write profile information suitable for the
8907 analysis program prof. You must use this option when compiling the
8908 source files you want data about, and you must also use it when
8909 linking.
8910
8911 -pg Generate extra code to write profile information suitable for the
8912 analysis program gprof. You must use this option when compiling
8913 the source files you want data about, and you must also use it when
8914 linking.
8915
8916 -fprofile-arcs
8917 Add code so that program flow arcs are instrumented. During
8918 execution the program records how many times each branch and call
8919 is executed and how many times it is taken or returns. On targets
8920 that support constructors with priority support, profiling properly
8921 handles constructors, destructors and C++ constructors (and
8922 destructors) of classes which are used as a type of a global
8923 variable.
8924
8925 When the compiled program exits it saves this data to a file called
8926 auxname.gcda for each source file. The data may be used for
8927 profile-directed optimizations (-fbranch-probabilities), or for
8928 test coverage analysis (-ftest-coverage). Each object file's
8929 auxname is generated from the name of the output file, if
8930 explicitly specified and it is not the final executable, otherwise
8931 it is the basename of the source file. In both cases any suffix is
8932 removed (e.g. foo.gcda for input file dir/foo.c, or dir/foo.gcda
8933 for output file specified as -o dir/foo.o).
8934
8935 --coverage
8936 This option is used to compile and link code instrumented for
8937 coverage analysis. The option is a synonym for -fprofile-arcs
8938 -ftest-coverage (when compiling) and -lgcov (when linking). See
8939 the documentation for those options for more details.
8940
8941 * Compile the source files with -fprofile-arcs plus optimization
8942 and code generation options. For test coverage analysis, use
8943 the additional -ftest-coverage option. You do not need to
8944 profile every source file in a program.
8945
8946 * Link your object files with -lgcov or -fprofile-arcs (the
8947 latter implies the former).
8948
8949 * Run the program on a representative workload to generate the
8950 arc profile information. This may be repeated any number of
8951 times. You can run concurrent instances of your program, and
8952 provided that the file system supports locking, the data files
8953 will be correctly updated. Unless a strict ISO C dialect
8954 option is in effect, "fork" calls are detected and correctly
8955 handled without double counting.
8956
8957 * For profile-directed optimizations, compile the source files
8958 again with the same optimization and code generation options
8959 plus -fbranch-probabilities.
8960
8961 * For test coverage analysis, use gcov to produce human readable
8962 information from the .gcno and .gcda files. Refer to the gcov
8963 documentation for further information.
8964
8965 With -fprofile-arcs, for each function of your program GCC creates
8966 a program flow graph, then finds a spanning tree for the graph.
8967 Only arcs that are not on the spanning tree have to be
8968 instrumented: the compiler adds code to count the number of times
8969 that these arcs are executed. When an arc is the only exit or only
8970 entrance to a block, the instrumentation code can be added to the
8971 block; otherwise, a new basic block must be created to hold the
8972 instrumentation code.
8973
8974 -ftest-coverage
8975 Produce a notes file that the gcov code-coverage utility can use to
8976 show program coverage. Each source file's note file is called
8977 auxname.gcno. Refer to the -fprofile-arcs option above for a
8978 description of auxname and instructions on how to generate test
8979 coverage data. Coverage data matches the source files more closely
8980 if you do not optimize.
8981
8982 -fprofile-dir=path
8983 Set the directory to search for the profile data files in to path.
8984 This option affects only the profile data generated by
8985 -fprofile-generate, -ftest-coverage, -fprofile-arcs and used by
8986 -fprofile-use and -fbranch-probabilities and its related options.
8987 Both absolute and relative paths can be used. By default, GCC uses
8988 the current directory as path, thus the profile data file appears
8989 in the same directory as the object file.
8990
8991 -fprofile-generate
8992 -fprofile-generate=path
8993 Enable options usually used for instrumenting application to
8994 produce profile useful for later recompilation with profile
8995 feedback based optimization. You must use -fprofile-generate both
8996 when compiling and when linking your program.
8997
8998 The following options are enabled: -fprofile-arcs,
8999 -fprofile-values, -fvpt.
9000
9001 If path is specified, GCC looks at the path to find the profile
9002 feedback data files. See -fprofile-dir.
9003
9004 To optimize the program based on the collected profile information,
9005 use -fprofile-use.
9006
9007 -fprofile-update=method
9008 Alter the update method for an application instrumented for profile
9009 feedback based optimization. The method argument should be one of
9010 single, atomic or prefer-atomic. The first one is useful for
9011 single-threaded applications, while the second one prevents profile
9012 corruption by emitting thread-safe code.
9013
9014 Warning: When an application does not properly join all threads (or
9015 creates an detached thread), a profile file can be still corrupted.
9016
9017 Using prefer-atomic would be transformed either to atomic, when
9018 supported by a target, or to single otherwise. The GCC driver
9019 automatically selects prefer-atomic when -pthread is present in the
9020 command line.
9021
9022 -fsanitize=address
9023 Enable AddressSanitizer, a fast memory error detector. Memory
9024 access instructions are instrumented to detect out-of-bounds and
9025 use-after-free bugs. The option enables
9026 -fsanitize-address-use-after-scope. See
9027 <https://github.com/google/sanitizers/wiki/AddressSanitizer> for
9028 more details. The run-time behavior can be influenced using the
9029 ASAN_OPTIONS environment variable. When set to "help=1", the
9030 available options are shown at startup of the instrumented program.
9031 See
9032 <https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags>
9033 for a list of supported options. The option cannot be combined
9034 with -fsanitize=thread and/or -fcheck-pointer-bounds.
9035
9036 -fsanitize=kernel-address
9037 Enable AddressSanitizer for Linux kernel. See
9038 <https://github.com/google/kasan/wiki> for more details. The
9039 option cannot be combined with -fcheck-pointer-bounds.
9040
9041 -fsanitize=thread
9042 Enable ThreadSanitizer, a fast data race detector. Memory access
9043 instructions are instrumented to detect data race bugs. See
9044 <https://github.com/google/sanitizers/wiki#threadsanitizer> for
9045 more details. The run-time behavior can be influenced using the
9046 TSAN_OPTIONS environment variable; see
9047 <https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags>
9048 for a list of supported options. The option cannot be combined
9049 with -fsanitize=address, -fsanitize=leak and/or
9050 -fcheck-pointer-bounds.
9051
9052 Note that sanitized atomic builtins cannot throw exceptions when
9053 operating on invalid memory addresses with non-call exceptions
9054 (-fnon-call-exceptions).
9055
9056 -fsanitize=leak
9057 Enable LeakSanitizer, a memory leak detector. This option only
9058 matters for linking of executables and the executable is linked
9059 against a library that overrides "malloc" and other allocator
9060 functions. See
9061 <https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer>
9062 for more details. The run-time behavior can be influenced using
9063 the LSAN_OPTIONS environment variable. The option cannot be
9064 combined with -fsanitize=thread.
9065
9066 -fsanitize=undefined
9067 Enable UndefinedBehaviorSanitizer, a fast undefined behavior
9068 detector. Various computations are instrumented to detect
9069 undefined behavior at runtime. Current suboptions are:
9070
9071 -fsanitize=shift
9072 This option enables checking that the result of a shift
9073 operation is not undefined. Note that what exactly is
9074 considered undefined differs slightly between C and C++, as
9075 well as between ISO C90 and C99, etc. This option has two
9076 suboptions, -fsanitize=shift-base and
9077 -fsanitize=shift-exponent.
9078
9079 -fsanitize=shift-exponent
9080 This option enables checking that the second argument of a
9081 shift operation is not negative and is smaller than the
9082 precision of the promoted first argument.
9083
9084 -fsanitize=shift-base
9085 If the second argument of a shift operation is within range,
9086 check that the result of a shift operation is not undefined.
9087 Note that what exactly is considered undefined differs slightly
9088 between C and C++, as well as between ISO C90 and C99, etc.
9089
9090 -fsanitize=integer-divide-by-zero
9091 Detect integer division by zero as well as "INT_MIN / -1"
9092 division.
9093
9094 -fsanitize=unreachable
9095 With this option, the compiler turns the
9096 "__builtin_unreachable" call into a diagnostics message call
9097 instead. When reaching the "__builtin_unreachable" call, the
9098 behavior is undefined.
9099
9100 -fsanitize=vla-bound
9101 This option instructs the compiler to check that the size of a
9102 variable length array is positive.
9103
9104 -fsanitize=null
9105 This option enables pointer checking. Particularly, the
9106 application built with this option turned on will issue an
9107 error message when it tries to dereference a NULL pointer, or
9108 if a reference (possibly an rvalue reference) is bound to a
9109 NULL pointer, or if a method is invoked on an object pointed by
9110 a NULL pointer.
9111
9112 -fsanitize=return
9113 This option enables return statement checking. Programs built
9114 with this option turned on will issue an error message when the
9115 end of a non-void function is reached without actually
9116 returning a value. This option works in C++ only.
9117
9118 -fsanitize=signed-integer-overflow
9119 This option enables signed integer overflow checking. We check
9120 that the result of "+", "*", and both unary and binary "-" does
9121 not overflow in the signed arithmetics. Note, integer
9122 promotion rules must be taken into account. That is, the
9123 following is not an overflow:
9124
9125 signed char a = SCHAR_MAX;
9126 a++;
9127
9128 -fsanitize=bounds
9129 This option enables instrumentation of array bounds. Various
9130 out of bounds accesses are detected. Flexible array members,
9131 flexible array member-like arrays, and initializers of
9132 variables with static storage are not instrumented. The option
9133 cannot be combined with -fcheck-pointer-bounds.
9134
9135 -fsanitize=bounds-strict
9136 This option enables strict instrumentation of array bounds.
9137 Most out of bounds accesses are detected, including flexible
9138 array members and flexible array member-like arrays.
9139 Initializers of variables with static storage are not
9140 instrumented. The option cannot be combined with
9141 -fcheck-pointer-bounds.
9142
9143 -fsanitize=alignment
9144 This option enables checking of alignment of pointers when they
9145 are dereferenced, or when a reference is bound to
9146 insufficiently aligned target, or when a method or constructor
9147 is invoked on insufficiently aligned object.
9148
9149 -fsanitize=object-size
9150 This option enables instrumentation of memory references using
9151 the "__builtin_object_size" function. Various out of bounds
9152 pointer accesses are detected.
9153
9154 -fsanitize=float-divide-by-zero
9155 Detect floating-point division by zero. Unlike other similar
9156 options, -fsanitize=float-divide-by-zero is not enabled by
9157 -fsanitize=undefined, since floating-point division by zero can
9158 be a legitimate way of obtaining infinities and NaNs.
9159
9160 -fsanitize=float-cast-overflow
9161 This option enables floating-point type to integer conversion
9162 checking. We check that the result of the conversion does not
9163 overflow. Unlike other similar options,
9164 -fsanitize=float-cast-overflow is not enabled by
9165 -fsanitize=undefined. This option does not work well with
9166 "FE_INVALID" exceptions enabled.
9167
9168 -fsanitize=nonnull-attribute
9169 This option enables instrumentation of calls, checking whether
9170 null values are not passed to arguments marked as requiring a
9171 non-null value by the "nonnull" function attribute.
9172
9173 -fsanitize=returns-nonnull-attribute
9174 This option enables instrumentation of return statements in
9175 functions marked with "returns_nonnull" function attribute, to
9176 detect returning of null values from such functions.
9177
9178 -fsanitize=bool
9179 This option enables instrumentation of loads from bool. If a
9180 value other than 0/1 is loaded, a run-time error is issued.
9181
9182 -fsanitize=enum
9183 This option enables instrumentation of loads from an enum type.
9184 If a value outside the range of values for the enum type is
9185 loaded, a run-time error is issued.
9186
9187 -fsanitize=vptr
9188 This option enables instrumentation of C++ member function
9189 calls, member accesses and some conversions between pointers to
9190 base and derived classes, to verify the referenced object has
9191 the correct dynamic type.
9192
9193 While -ftrapv causes traps for signed overflows to be emitted,
9194 -fsanitize=undefined gives a diagnostic message. This currently
9195 works only for the C family of languages.
9196
9197 -fno-sanitize=all
9198 This option disables all previously enabled sanitizers.
9199 -fsanitize=all is not allowed, as some sanitizers cannot be used
9200 together.
9201
9202 -fasan-shadow-offset=number
9203 This option forces GCC to use custom shadow offset in
9204 AddressSanitizer checks. It is useful for experimenting with
9205 different shadow memory layouts in Kernel AddressSanitizer.
9206
9207 -fsanitize-sections=s1,s2,...
9208 Sanitize global variables in selected user-defined sections. si
9209 may contain wildcards.
9210
9211 -fsanitize-recover[=opts]
9212 -fsanitize-recover= controls error recovery mode for sanitizers
9213 mentioned in comma-separated list of opts. Enabling this option
9214 for a sanitizer component causes it to attempt to continue running
9215 the program as if no error happened. This means multiple runtime
9216 errors can be reported in a single program run, and the exit code
9217 of the program may indicate success even when errors have been
9218 reported. The -fno-sanitize-recover= option can be used to alter
9219 this behavior: only the first detected error is reported and
9220 program then exits with a non-zero exit code.
9221
9222 Currently this feature only works for -fsanitize=undefined (and its
9223 suboptions except for -fsanitize=unreachable and
9224 -fsanitize=return), -fsanitize=float-cast-overflow,
9225 -fsanitize=float-divide-by-zero, -fsanitize=bounds-strict,
9226 -fsanitize=kernel-address and -fsanitize=address. For these
9227 sanitizers error recovery is turned on by default, except
9228 -fsanitize=address, for which this feature is experimental.
9229 -fsanitize-recover=all and -fno-sanitize-recover=all is also
9230 accepted, the former enables recovery for all sanitizers that
9231 support it, the latter disables recovery for all sanitizers that
9232 support it.
9233
9234 Even if a recovery mode is turned on the compiler side, it needs to
9235 be also enabled on the runtime library side, otherwise the failures
9236 are still fatal. The runtime library defaults to "halt_on_error=0"
9237 for ThreadSanitizer and UndefinedBehaviorSanitizer, while default
9238 value for AddressSanitizer is "halt_on_error=1". This can be
9239 overridden through setting the "halt_on_error" flag in the
9240 corresponding environment variable.
9241
9242 Syntax without an explicit opts parameter is deprecated. It is
9243 equivalent to specifying an opts list of:
9244
9245 undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
9246
9247 -fsanitize-address-use-after-scope
9248 Enable sanitization of local variables to detect use-after-scope
9249 bugs. The option sets -fstack-reuse to none.
9250
9251 -fsanitize-undefined-trap-on-error
9252 The -fsanitize-undefined-trap-on-error option instructs the
9253 compiler to report undefined behavior using "__builtin_trap" rather
9254 than a "libubsan" library routine. The advantage of this is that
9255 the "libubsan" library is not needed and is not linked in, so this
9256 is usable even in freestanding environments.
9257
9258 -fsanitize-coverage=trace-pc
9259 Enable coverage-guided fuzzing code instrumentation. Inserts a
9260 call to "__sanitizer_cov_trace_pc" into every basic block.
9261
9262 -fbounds-check
9263 For front ends that support it, generate additional code to check
9264 that indices used to access arrays are within the declared range.
9265 This is currently only supported by the Fortran front end, where
9266 this option defaults to false.
9267
9268 -fcheck-pointer-bounds
9269 Enable Pointer Bounds Checker instrumentation. Each memory
9270 reference is instrumented with checks of the pointer used for
9271 memory access against bounds associated with that pointer.
9272
9273 Currently there is only an implementation for Intel MPX available,
9274 thus x86 GNU/Linux target and -mmpx are required to enable this
9275 feature. MPX-based instrumentation requires a runtime library to
9276 enable MPX in hardware and handle bounds violation signals. By
9277 default when -fcheck-pointer-bounds and -mmpx options are used to
9278 link a program, the GCC driver links against the libmpx and
9279 libmpxwrappers libraries. Bounds checking on calls to dynamic
9280 libraries requires a linker with -z bndplt support; if GCC was
9281 configured with a linker without support for this option (including
9282 the Gold linker and older versions of ld), a warning is given if
9283 you link with -mmpx without also specifying -static, since the
9284 overall effectiveness of the bounds checking protection is reduced.
9285 See also -static-libmpxwrappers.
9286
9287 MPX-based instrumentation may be used for debugging and also may be
9288 included in production code to increase program security.
9289 Depending on usage, you may have different requirements for the
9290 runtime library. The current version of the MPX runtime library is
9291 more oriented for use as a debugging tool. MPX runtime library
9292 usage implies -lpthread. See also -static-libmpx. The runtime
9293 library behavior can be influenced using various CHKP_RT_*
9294 environment variables. See
9295 <https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler>
9296 for more details.
9297
9298 Generated instrumentation may be controlled by various -fchkp-*
9299 options and by the "bnd_variable_size" structure field attribute
9300 and "bnd_legacy", and "bnd_instrument" function attributes. GCC
9301 also provides a number of built-in functions for controlling the
9302 Pointer Bounds Checker.
9303
9304 -fchkp-check-incomplete-type
9305 Generate pointer bounds checks for variables with incomplete type.
9306 Enabled by default.
9307
9308 -fchkp-narrow-bounds
9309 Controls bounds used by Pointer Bounds Checker for pointers to
9310 object fields. If narrowing is enabled then field bounds are used.
9311 Otherwise object bounds are used. See also
9312 -fchkp-narrow-to-innermost-array and
9313 -fchkp-first-field-has-own-bounds. Enabled by default.
9314
9315 -fchkp-first-field-has-own-bounds
9316 Forces Pointer Bounds Checker to use narrowed bounds for the
9317 address of the first field in the structure. By default a pointer
9318 to the first field has the same bounds as a pointer to the whole
9319 structure.
9320
9321 -fchkp-flexible-struct-trailing-arrays
9322 Forces Pointer Bounds Checker to treat all trailing arrays in
9323 structures as possibly flexible. By default only array fields with
9324 zero length or that are marked with attribute bnd_variable_size are
9325 treated as flexible.
9326
9327 -fchkp-narrow-to-innermost-array
9328 Forces Pointer Bounds Checker to use bounds of the innermost arrays
9329 in case of nested static array access. By default this option is
9330 disabled and bounds of the outermost array are used.
9331
9332 -fchkp-optimize
9333 Enables Pointer Bounds Checker optimizations. Enabled by default
9334 at optimization levels -O, -O2, -O3.
9335
9336 -fchkp-use-fast-string-functions
9337 Enables use of *_nobnd versions of string functions (not copying
9338 bounds) by Pointer Bounds Checker. Disabled by default.
9339
9340 -fchkp-use-nochk-string-functions
9341 Enables use of *_nochk versions of string functions (not checking
9342 bounds) by Pointer Bounds Checker. Disabled by default.
9343
9344 -fchkp-use-static-bounds
9345 Allow Pointer Bounds Checker to generate static bounds holding
9346 bounds of static variables. Enabled by default.
9347
9348 -fchkp-use-static-const-bounds
9349 Use statically-initialized bounds for constant bounds instead of
9350 generating them each time they are required. By default enabled
9351 when -fchkp-use-static-bounds is enabled.
9352
9353 -fchkp-treat-zero-dynamic-size-as-infinite
9354 With this option, objects with incomplete type whose dynamically-
9355 obtained size is zero are treated as having infinite size instead
9356 by Pointer Bounds Checker. This option may be helpful if a program
9357 is linked with a library missing size information for some symbols.
9358 Disabled by default.
9359
9360 -fchkp-check-read
9361 Instructs Pointer Bounds Checker to generate checks for all read
9362 accesses to memory. Enabled by default.
9363
9364 -fchkp-check-write
9365 Instructs Pointer Bounds Checker to generate checks for all write
9366 accesses to memory. Enabled by default.
9367
9368 -fchkp-store-bounds
9369 Instructs Pointer Bounds Checker to generate bounds stores for
9370 pointer writes. Enabled by default.
9371
9372 -fchkp-instrument-calls
9373 Instructs Pointer Bounds Checker to pass pointer bounds to calls.
9374 Enabled by default.
9375
9376 -fchkp-instrument-marked-only
9377 Instructs Pointer Bounds Checker to instrument only functions
9378 marked with the "bnd_instrument" attribute. Disabled by default.
9379
9380 -fchkp-use-wrappers
9381 Allows Pointer Bounds Checker to replace calls to built-in
9382 functions with calls to wrapper functions. When
9383 -fchkp-use-wrappers is used to link a program, the GCC driver
9384 automatically links against libmpxwrappers. See also
9385 -static-libmpxwrappers. Enabled by default.
9386
9387 -fstack-protector
9388 Emit extra code to check for buffer overflows, such as stack
9389 smashing attacks. This is done by adding a guard variable to
9390 functions with vulnerable objects. This includes functions that
9391 call "alloca", and functions with buffers larger than 8 bytes. The
9392 guards are initialized when a function is entered and then checked
9393 when the function exits. If a guard check fails, an error message
9394 is printed and the program exits.
9395
9396 -fstack-protector-all
9397 Like -fstack-protector except that all functions are protected.
9398
9399 -fstack-protector-strong
9400 Like -fstack-protector but includes additional functions to be
9401 protected --- those that have local array definitions, or have
9402 references to local frame addresses.
9403
9404 -fstack-protector-explicit
9405 Like -fstack-protector but only protects those functions which have
9406 the "stack_protect" attribute.
9407
9408 -fstack-check
9409 Generate code to verify that you do not go beyond the boundary of
9410 the stack. You should specify this flag if you are running in an
9411 environment with multiple threads, but you only rarely need to
9412 specify it in a single-threaded environment since stack overflow is
9413 automatically detected on nearly all systems if there is only one
9414 stack.
9415
9416 Note that this switch does not actually cause checking to be done;
9417 the operating system or the language runtime must do that. The
9418 switch causes generation of code to ensure that they see the stack
9419 being extended.
9420
9421 You can additionally specify a string parameter: no means no
9422 checking, generic means force the use of old-style checking,
9423 specific means use the best checking method and is equivalent to
9424 bare -fstack-check.
9425
9426 Old-style checking is a generic mechanism that requires no specific
9427 target support in the compiler but comes with the following
9428 drawbacks:
9429
9430 1. Modified allocation strategy for large objects: they are always
9431 allocated dynamically if their size exceeds a fixed threshold.
9432
9433 2. Fixed limit on the size of the static frame of functions: when
9434 it is topped by a particular function, stack checking is not
9435 reliable and a warning is issued by the compiler.
9436
9437 3. Inefficiency: because of both the modified allocation strategy
9438 and the generic implementation, code performance is hampered.
9439
9440 Note that old-style stack checking is also the fallback method for
9441 specific if no target support has been added in the compiler.
9442
9443 -fstack-limit-register=reg
9444 -fstack-limit-symbol=sym
9445 -fno-stack-limit
9446 Generate code to ensure that the stack does not grow beyond a
9447 certain value, either the value of a register or the address of a
9448 symbol. If a larger stack is required, a signal is raised at run
9449 time. For most targets, the signal is raised before the stack
9450 overruns the boundary, so it is possible to catch the signal
9451 without taking special precautions.
9452
9453 For instance, if the stack starts at absolute address 0x80000000
9454 and grows downwards, you can use the flags
9455 -fstack-limit-symbol=__stack_limit and
9456 -Wl,--defsym,__stack_limit=0x7ffe0000 to enforce a stack limit of
9457 128KB. Note that this may only work with the GNU linker.
9458
9459 You can locally override stack limit checking by using the
9460 "no_stack_limit" function attribute.
9461
9462 -fsplit-stack
9463 Generate code to automatically split the stack before it overflows.
9464 The resulting program has a discontiguous stack which can only
9465 overflow if the program is unable to allocate any more memory.
9466 This is most useful when running threaded programs, as it is no
9467 longer necessary to calculate a good stack size to use for each
9468 thread. This is currently only implemented for the x86 targets
9469 running GNU/Linux.
9470
9471 When code compiled with -fsplit-stack calls code compiled without
9472 -fsplit-stack, there may not be much stack space available for the
9473 latter code to run. If compiling all code, including library code,
9474 with -fsplit-stack is not an option, then the linker can fix up
9475 these calls so that the code compiled without -fsplit-stack always
9476 has a large stack. Support for this is implemented in the gold
9477 linker in GNU binutils release 2.21 and later.
9478
9479 -fvtable-verify=[std|preinit|none]
9480 This option is only available when compiling C++ code. It turns on
9481 (or off, if using -fvtable-verify=none) the security feature that
9482 verifies at run time, for every virtual call, that the vtable
9483 pointer through which the call is made is valid for the type of the
9484 object, and has not been corrupted or overwritten. If an invalid
9485 vtable pointer is detected at run time, an error is reported and
9486 execution of the program is immediately halted.
9487
9488 This option causes run-time data structures to be built at program
9489 startup, which are used for verifying the vtable pointers. The
9490 options std and preinit control the timing of when these data
9491 structures are built. In both cases the data structures are built
9492 before execution reaches "main". Using -fvtable-verify=std causes
9493 the data structures to be built after shared libraries have been
9494 loaded and initialized. -fvtable-verify=preinit causes them to be
9495 built before shared libraries have been loaded and initialized.
9496
9497 If this option appears multiple times in the command line with
9498 different values specified, none takes highest priority over both
9499 std and preinit; preinit takes priority over std.
9500
9501 -fvtv-debug
9502 When used in conjunction with -fvtable-verify=std or
9503 -fvtable-verify=preinit, causes debug versions of the runtime
9504 functions for the vtable verification feature to be called. This
9505 flag also causes the compiler to log information about which vtable
9506 pointers it finds for each class. This information is written to a
9507 file named vtv_set_ptr_data.log in the directory named by the
9508 environment variable VTV_LOGS_DIR if that is defined or the current
9509 working directory otherwise.
9510
9511 Note: This feature appends data to the log file. If you want a
9512 fresh log file, be sure to delete any existing one.
9513
9514 -fvtv-counts
9515 This is a debugging flag. When used in conjunction with
9516 -fvtable-verify=std or -fvtable-verify=preinit, this causes the
9517 compiler to keep track of the total number of virtual calls it
9518 encounters and the number of verifications it inserts. It also
9519 counts the number of calls to certain run-time library functions
9520 that it inserts and logs this information for each compilation
9521 unit. The compiler writes this information to a file named
9522 vtv_count_data.log in the directory named by the environment
9523 variable VTV_LOGS_DIR if that is defined or the current working
9524 directory otherwise. It also counts the size of the vtable pointer
9525 sets for each class, and writes this information to
9526 vtv_class_set_sizes.log in the same directory.
9527
9528 Note: This feature appends data to the log files. To get fresh
9529 log files, be sure to delete any existing ones.
9530
9531 -finstrument-functions
9532 Generate instrumentation calls for entry and exit to functions.
9533 Just after function entry and just before function exit, the
9534 following profiling functions are called with the address of the
9535 current function and its call site. (On some platforms,
9536 "__builtin_return_address" does not work beyond the current
9537 function, so the call site information may not be available to the
9538 profiling functions otherwise.)
9539
9540 void __cyg_profile_func_enter (void *this_fn,
9541 void *call_site);
9542 void __cyg_profile_func_exit (void *this_fn,
9543 void *call_site);
9544
9545 The first argument is the address of the start of the current
9546 function, which may be looked up exactly in the symbol table.
9547
9548 This instrumentation is also done for functions expanded inline in
9549 other functions. The profiling calls indicate where, conceptually,
9550 the inline function is entered and exited. This means that
9551 addressable versions of such functions must be available. If all
9552 your uses of a function are expanded inline, this may mean an
9553 additional expansion of code size. If you use "extern inline" in
9554 your C code, an addressable version of such functions must be
9555 provided. (This is normally the case anyway, but if you get lucky
9556 and the optimizer always expands the functions inline, you might
9557 have gotten away without providing static copies.)
9558
9559 A function may be given the attribute "no_instrument_function", in
9560 which case this instrumentation is not done. This can be used, for
9561 example, for the profiling functions listed above, high-priority
9562 interrupt routines, and any functions from which the profiling
9563 functions cannot safely be called (perhaps signal handlers, if the
9564 profiling routines generate output or allocate memory).
9565
9566 -finstrument-functions-exclude-file-list=file,file,...
9567 Set the list of functions that are excluded from instrumentation
9568 (see the description of -finstrument-functions). If the file that
9569 contains a function definition matches with one of file, then that
9570 function is not instrumented. The match is done on substrings: if
9571 the file parameter is a substring of the file name, it is
9572 considered to be a match.
9573
9574 For example:
9575
9576 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
9577
9578 excludes any inline function defined in files whose pathnames
9579 contain /bits/stl or include/sys.
9580
9581 If, for some reason, you want to include letter , in one of sym,
9582 write ,. For example,
9583 -finstrument-functions-exclude-file-list=',,tmp' (note the single
9584 quote surrounding the option).
9585
9586 -finstrument-functions-exclude-function-list=sym,sym,...
9587 This is similar to -finstrument-functions-exclude-file-list, but
9588 this option sets the list of function names to be excluded from
9589 instrumentation. The function name to be matched is its user-
9590 visible name, such as "vector<int> blah(const vector<int> &)", not
9591 the internal mangled name (e.g., "_Z4blahRSt6vectorIiSaIiEE"). The
9592 match is done on substrings: if the sym parameter is a substring of
9593 the function name, it is considered to be a match. For C99 and C++
9594 extended identifiers, the function name must be given in UTF-8, not
9595 using universal character names.
9596
9597 Options Controlling the Preprocessor
9598 These options control the C preprocessor, which is run on each C source
9599 file before actual compilation.
9600
9601 If you use the -E option, nothing is done except preprocessing. Some
9602 of these options make sense only together with -E because they cause
9603 the preprocessor output to be unsuitable for actual compilation.
9604
9605 In addition to the options listed here, there are a number of options
9606 to control search paths for include files documented in Directory
9607 Options. Options to control preprocessor diagnostics are listed in
9608 Warning Options.
9609
9610 -D name
9611 Predefine name as a macro, with definition 1.
9612
9613 -D name=definition
9614 The contents of definition are tokenized and processed as if they
9615 appeared during translation phase three in a #define directive. In
9616 particular, the definition is truncated by embedded newline
9617 characters.
9618
9619 If you are invoking the preprocessor from a shell or shell-like
9620 program you may need to use the shell's quoting syntax to protect
9621 characters such as spaces that have a meaning in the shell syntax.
9622
9623 If you wish to define a function-like macro on the command line,
9624 write its argument list with surrounding parentheses before the
9625 equals sign (if any). Parentheses are meaningful to most shells,
9626 so you should quote the option. With sh and csh,
9627 -D'name(args...)=definition' works.
9628
9629 -D and -U options are processed in the order they are given on the
9630 command line. All -imacros file and -include file options are
9631 processed after all -D and -U options.
9632
9633 -U name
9634 Cancel any previous definition of name, either built in or provided
9635 with a -D option.
9636
9637 -include file
9638 Process file as if "#include "file"" appeared as the first line of
9639 the primary source file. However, the first directory searched for
9640 file is the preprocessor's working directory instead of the
9641 directory containing the main source file. If not found there, it
9642 is searched for in the remainder of the "#include "..."" search
9643 chain as normal.
9644
9645 If multiple -include options are given, the files are included in
9646 the order they appear on the command line.
9647
9648 -imacros file
9649 Exactly like -include, except that any output produced by scanning
9650 file is thrown away. Macros it defines remain defined. This
9651 allows you to acquire all the macros from a header without also
9652 processing its declarations.
9653
9654 All files specified by -imacros are processed before all files
9655 specified by -include.
9656
9657 -undef
9658 Do not predefine any system-specific or GCC-specific macros. The
9659 standard predefined macros remain defined.
9660
9661 -pthread
9662 Define additional macros required for using the POSIX threads
9663 library. You should use this option consistently for both
9664 compilation and linking. This option is supported on GNU/Linux
9665 targets, most other Unix derivatives, and also on x86 Cygwin and
9666 MinGW targets.
9667
9668 -M Instead of outputting the result of preprocessing, output a rule
9669 suitable for make describing the dependencies of the main source
9670 file. The preprocessor outputs one make rule containing the object
9671 file name for that source file, a colon, and the names of all the
9672 included files, including those coming from -include or -imacros
9673 command-line options.
9674
9675 Unless specified explicitly (with -MT or -MQ), the object file name
9676 consists of the name of the source file with any suffix replaced
9677 with object file suffix and with any leading directory parts
9678 removed. If there are many included files then the rule is split
9679 into several lines using \-newline. The rule has no commands.
9680
9681 This option does not suppress the preprocessor's debug output, such
9682 as -dM. To avoid mixing such debug output with the dependency
9683 rules you should explicitly specify the dependency output file with
9684 -MF, or use an environment variable like DEPENDENCIES_OUTPUT.
9685 Debug output is still sent to the regular output stream as normal.
9686
9687 Passing -M to the driver implies -E, and suppresses warnings with
9688 an implicit -w.
9689
9690 -MM Like -M but do not mention header files that are found in system
9691 header directories, nor header files that are included, directly or
9692 indirectly, from such a header.
9693
9694 This implies that the choice of angle brackets or double quotes in
9695 an #include directive does not in itself determine whether that
9696 header appears in -MM dependency output.
9697
9698 -MF file
9699 When used with -M or -MM, specifies a file to write the
9700 dependencies to. If no -MF switch is given the preprocessor sends
9701 the rules to the same place it would send preprocessed output.
9702
9703 When used with the driver options -MD or -MMD, -MF overrides the
9704 default dependency output file.
9705
9706 -MG In conjunction with an option such as -M requesting dependency
9707 generation, -MG assumes missing header files are generated files
9708 and adds them to the dependency list without raising an error. The
9709 dependency filename is taken directly from the "#include" directive
9710 without prepending any path. -MG also suppresses preprocessed
9711 output, as a missing header file renders this useless.
9712
9713 This feature is used in automatic updating of makefiles.
9714
9715 -MP This option instructs CPP to add a phony target for each dependency
9716 other than the main file, causing each to depend on nothing. These
9717 dummy rules work around errors make gives if you remove header
9718 files without updating the Makefile to match.
9719
9720 This is typical output:
9721
9722 test.o: test.c test.h
9723
9724 test.h:
9725
9726 -MT target
9727 Change the target of the rule emitted by dependency generation. By
9728 default CPP takes the name of the main input file, deletes any
9729 directory components and any file suffix such as .c, and appends
9730 the platform's usual object suffix. The result is the target.
9731
9732 An -MT option sets the target to be exactly the string you specify.
9733 If you want multiple targets, you can specify them as a single
9734 argument to -MT, or use multiple -MT options.
9735
9736 For example, -MT '$(objpfx)foo.o' might give
9737
9738 $(objpfx)foo.o: foo.c
9739
9740 -MQ target
9741 Same as -MT, but it quotes any characters which are special to
9742 Make. -MQ '$(objpfx)foo.o' gives
9743
9744 $$(objpfx)foo.o: foo.c
9745
9746 The default target is automatically quoted, as if it were given
9747 with -MQ.
9748
9749 -MD -MD is equivalent to -M -MF file, except that -E is not implied.
9750 The driver determines file based on whether an -o option is given.
9751 If it is, the driver uses its argument but with a suffix of .d,
9752 otherwise it takes the name of the input file, removes any
9753 directory components and suffix, and applies a .d suffix.
9754
9755 If -MD is used in conjunction with -E, any -o switch is understood
9756 to specify the dependency output file, but if used without -E, each
9757 -o is understood to specify a target object file.
9758
9759 Since -E is not implied, -MD can be used to generate a dependency
9760 output file as a side-effect of the compilation process.
9761
9762 -MMD
9763 Like -MD except mention only user header files, not system header
9764 files.
9765
9766 -fpreprocessed
9767 Indicate to the preprocessor that the input file has already been
9768 preprocessed. This suppresses things like macro expansion,
9769 trigraph conversion, escaped newline splicing, and processing of
9770 most directives. The preprocessor still recognizes and removes
9771 comments, so that you can pass a file preprocessed with -C to the
9772 compiler without problems. In this mode the integrated
9773 preprocessor is little more than a tokenizer for the front ends.
9774
9775 -fpreprocessed is implicit if the input file has one of the
9776 extensions .i, .ii or .mi. These are the extensions that GCC uses
9777 for preprocessed files created by -save-temps.
9778
9779 -fdirectives-only
9780 When preprocessing, handle directives, but do not expand macros.
9781
9782 The option's behavior depends on the -E and -fpreprocessed options.
9783
9784 With -E, preprocessing is limited to the handling of directives
9785 such as "#define", "#ifdef", and "#error". Other preprocessor
9786 operations, such as macro expansion and trigraph conversion are not
9787 performed. In addition, the -dD option is implicitly enabled.
9788
9789 With -fpreprocessed, predefinition of command line and most builtin
9790 macros is disabled. Macros such as "__LINE__", which are
9791 contextually dependent, are handled normally. This enables
9792 compilation of files previously preprocessed with "-E
9793 -fdirectives-only".
9794
9795 With both -E and -fpreprocessed, the rules for -fpreprocessed take
9796 precedence. This enables full preprocessing of files previously
9797 preprocessed with "-E -fdirectives-only".
9798
9799 -fdollars-in-identifiers
9800 Accept $ in identifiers.
9801
9802 -fextended-identifiers
9803 Accept universal character names in identifiers. This option is
9804 enabled by default for C99 (and later C standard versions) and C++.
9805
9806 -fno-canonical-system-headers
9807 When preprocessing, do not shorten system header paths with
9808 canonicalization.
9809
9810 -ftabstop=width
9811 Set the distance between tab stops. This helps the preprocessor
9812 report correct column numbers in warnings or errors, even if tabs
9813 appear on the line. If the value is less than 1 or greater than
9814 100, the option is ignored. The default is 8.
9815
9816 -ftrack-macro-expansion[=level]
9817 Track locations of tokens across macro expansions. This allows the
9818 compiler to emit diagnostic about the current macro expansion stack
9819 when a compilation error occurs in a macro expansion. Using this
9820 option makes the preprocessor and the compiler consume more memory.
9821 The level parameter can be used to choose the level of precision of
9822 token location tracking thus decreasing the memory consumption if
9823 necessary. Value 0 of level de-activates this option. Value 1
9824 tracks tokens locations in a degraded mode for the sake of minimal
9825 memory overhead. In this mode all tokens resulting from the
9826 expansion of an argument of a function-like macro have the same
9827 location. Value 2 tracks tokens locations completely. This value is
9828 the most memory hungry. When this option is given no argument, the
9829 default parameter value is 2.
9830
9831 Note that "-ftrack-macro-expansion=2" is activated by default.
9832
9833 -fexec-charset=charset
9834 Set the execution character set, used for string and character
9835 constants. The default is UTF-8. charset can be any encoding
9836 supported by the system's "iconv" library routine.
9837
9838 -fwide-exec-charset=charset
9839 Set the wide execution character set, used for wide string and
9840 character constants. The default is UTF-32 or UTF-16, whichever
9841 corresponds to the width of "wchar_t". As with -fexec-charset,
9842 charset can be any encoding supported by the system's "iconv"
9843 library routine; however, you will have problems with encodings
9844 that do not fit exactly in "wchar_t".
9845
9846 -finput-charset=charset
9847 Set the input character set, used for translation from the
9848 character set of the input file to the source character set used by
9849 GCC. If the locale does not specify, or GCC cannot get this
9850 information from the locale, the default is UTF-8. This can be
9851 overridden by either the locale or this command-line option.
9852 Currently the command-line option takes precedence if there's a
9853 conflict. charset can be any encoding supported by the system's
9854 "iconv" library routine.
9855
9856 -fpch-deps
9857 When using precompiled headers, this flag causes the dependency-
9858 output flags to also list the files from the precompiled header's
9859 dependencies. If not specified, only the precompiled header are
9860 listed and not the files that were used to create it, because those
9861 files are not consulted when a precompiled header is used.
9862
9863 -fpch-preprocess
9864 This option allows use of a precompiled header together with -E.
9865 It inserts a special "#pragma", "#pragma GCC pch_preprocess
9866 "filename"" in the output to mark the place where the precompiled
9867 header was found, and its filename. When -fpreprocessed is in use,
9868 GCC recognizes this "#pragma" and loads the PCH.
9869
9870 This option is off by default, because the resulting preprocessed
9871 output is only really suitable as input to GCC. It is switched on
9872 by -save-temps.
9873
9874 You should not write this "#pragma" in your own code, but it is
9875 safe to edit the filename if the PCH file is available in a
9876 different location. The filename may be absolute or it may be
9877 relative to GCC's current directory.
9878
9879 -fworking-directory
9880 Enable generation of linemarkers in the preprocessor output that
9881 let the compiler know the current working directory at the time of
9882 preprocessing. When this option is enabled, the preprocessor
9883 emits, after the initial linemarker, a second linemarker with the
9884 current working directory followed by two slashes. GCC uses this
9885 directory, when it's present in the preprocessed input, as the
9886 directory emitted as the current working directory in some
9887 debugging information formats. This option is implicitly enabled
9888 if debugging information is enabled, but this can be inhibited with
9889 the negated form -fno-working-directory. If the -P flag is present
9890 in the command line, this option has no effect, since no "#line"
9891 directives are emitted whatsoever.
9892
9893 -A predicate=answer
9894 Make an assertion with the predicate predicate and answer answer.
9895 This form is preferred to the older form -A predicate(answer),
9896 which is still supported, because it does not use shell special
9897 characters.
9898
9899 -A -predicate=answer
9900 Cancel an assertion with the predicate predicate and answer answer.
9901
9902 -C Do not discard comments. All comments are passed through to the
9903 output file, except for comments in processed directives, which are
9904 deleted along with the directive.
9905
9906 You should be prepared for side effects when using -C; it causes
9907 the preprocessor to treat comments as tokens in their own right.
9908 For example, comments appearing at the start of what would be a
9909 directive line have the effect of turning that line into an
9910 ordinary source line, since the first token on the line is no
9911 longer a #.
9912
9913 -CC Do not discard comments, including during macro expansion. This is
9914 like -C, except that comments contained within macros are also
9915 passed through to the output file where the macro is expanded.
9916
9917 In addition to the side-effects of the -C option, the -CC option
9918 causes all C++-style comments inside a macro to be converted to
9919 C-style comments. This is to prevent later use of that macro from
9920 inadvertently commenting out the remainder of the source line.
9921
9922 The -CC option is generally used to support lint comments.
9923
9924 -P Inhibit generation of linemarkers in the output from the
9925 preprocessor. This might be useful when running the preprocessor
9926 on something that is not C code, and will be sent to a program
9927 which might be confused by the linemarkers.
9928
9929 -traditional
9930 -traditional-cpp
9931 Try to imitate the behavior of pre-standard C preprocessors, as
9932 opposed to ISO C preprocessors. See the GNU CPP manual for
9933 details.
9934
9935 Note that GCC does not otherwise attempt to emulate a pre-standard
9936 C compiler, and these options are only supported with the -E
9937 switch, or when invoking CPP explicitly.
9938
9939 -trigraphs
9940 Support ISO C trigraphs. These are three-character sequences, all
9941 starting with ??, that are defined by ISO C to stand for single
9942 characters. For example, ??/ stands for \, so '??/n' is a
9943 character constant for a newline.
9944
9945 The nine trigraphs and their replacements are
9946
9947 Trigraph: ??( ??) ??< ??> ??= ??/ ??' ??! ??-
9948 Replacement: [ ] { } # \ ^ | ~
9949
9950 By default, GCC ignores trigraphs, but in standard-conforming modes
9951 it converts them. See the -std and -ansi options.
9952
9953 -remap
9954 Enable special code to work around file systems which only permit
9955 very short file names, such as MS-DOS.
9956
9957 -H Print the name of each header file used, in addition to other
9958 normal activities. Each name is indented to show how deep in the
9959 #include stack it is. Precompiled header files are also printed,
9960 even if they are found to be invalid; an invalid precompiled header
9961 file is printed with ...x and a valid one with ...! .
9962
9963 -dletters
9964 Says to make debugging dumps during compilation as specified by
9965 letters. The flags documented here are those relevant to the
9966 preprocessor. Other letters are interpreted by the compiler
9967 proper, or reserved for future versions of GCC, and so are silently
9968 ignored. If you specify letters whose behavior conflicts, the
9969 result is undefined.
9970
9971 -dM Instead of the normal output, generate a list of #define
9972 directives for all the macros defined during the execution of
9973 the preprocessor, including predefined macros. This gives you
9974 a way of finding out what is predefined in your version of the
9975 preprocessor. Assuming you have no file foo.h, the command
9976
9977 touch foo.h; cpp -dM foo.h
9978
9979 shows all the predefined macros.
9980
9981 If you use -dM without the -E option, -dM is interpreted as a
9982 synonym for -fdump-rtl-mach.
9983
9984 -dD Like -dM except in two respects: it does not include the
9985 predefined macros, and it outputs both the #define directives
9986 and the result of preprocessing. Both kinds of output go to
9987 the standard output file.
9988
9989 -dN Like -dD, but emit only the macro names, not their expansions.
9990
9991 -dI Output #include directives in addition to the result of
9992 preprocessing.
9993
9994 -dU Like -dD except that only macros that are expanded, or whose
9995 definedness is tested in preprocessor directives, are output;
9996 the output is delayed until the use or test of the macro; and
9997 #undef directives are also output for macros tested but
9998 undefined at the time.
9999
10000 -fdebug-cpp
10001 This option is only useful for debugging GCC. When used from CPP
10002 or with -E, it dumps debugging information about location maps.
10003 Every token in the output is preceded by the dump of the map its
10004 location belongs to.
10005
10006 When used from GCC without -E, this option has no effect.
10007
10008 -Wp,option
10009 You can use -Wp,option to bypass the compiler driver and pass
10010 option directly through to the preprocessor. If option contains
10011 commas, it is split into multiple options at the commas. However,
10012 many options are modified, translated or interpreted by the
10013 compiler driver before being passed to the preprocessor, and -Wp
10014 forcibly bypasses this phase. The preprocessor's direct interface
10015 is undocumented and subject to change, so whenever possible you
10016 should avoid using -Wp and let the driver handle the options
10017 instead.
10018
10019 -Xpreprocessor option
10020 Pass option as an option to the preprocessor. You can use this to
10021 supply system-specific preprocessor options that GCC does not
10022 recognize.
10023
10024 If you want to pass an option that takes an argument, you must use
10025 -Xpreprocessor twice, once for the option and once for the
10026 argument.
10027
10028 -no-integrated-cpp
10029 Perform preprocessing as a separate pass before compilation. By
10030 default, GCC performs preprocessing as an integrated part of input
10031 tokenization and parsing. If this option is provided, the
10032 appropriate language front end (cc1, cc1plus, or cc1obj for C, C++,
10033 and Objective-C, respectively) is instead invoked twice, once for
10034 preprocessing only and once for actual compilation of the
10035 preprocessed input. This option may be useful in conjunction with
10036 the -B or -wrapper options to specify an alternate preprocessor or
10037 perform additional processing of the program source between normal
10038 preprocessing and compilation.
10039
10040 Passing Options to the Assembler
10041 You can pass options to the assembler.
10042
10043 -Wa,option
10044 Pass option as an option to the assembler. If option contains
10045 commas, it is split into multiple options at the commas.
10046
10047 -Xassembler option
10048 Pass option as an option to the assembler. You can use this to
10049 supply system-specific assembler options that GCC does not
10050 recognize.
10051
10052 If you want to pass an option that takes an argument, you must use
10053 -Xassembler twice, once for the option and once for the argument.
10054
10055 Options for Linking
10056 These options come into play when the compiler links object files into
10057 an executable output file. They are meaningless if the compiler is not
10058 doing a link step.
10059
10060 object-file-name
10061 A file name that does not end in a special recognized suffix is
10062 considered to name an object file or library. (Object files are
10063 distinguished from libraries by the linker according to the file
10064 contents.) If linking is done, these object files are used as
10065 input to the linker.
10066
10067 -c
10068 -S
10069 -E If any of these options is used, then the linker is not run, and
10070 object file names should not be used as arguments.
10071
10072 -fuse-ld=bfd
10073 Use the bfd linker instead of the default linker.
10074
10075 -fuse-ld=gold
10076 Use the gold linker instead of the default linker.
10077
10078 -llibrary
10079 -l library
10080 Search the library named library when linking. (The second
10081 alternative with the library as a separate argument is only for
10082 POSIX compliance and is not recommended.)
10083
10084 It makes a difference where in the command you write this option;
10085 the linker searches and processes libraries and object files in the
10086 order they are specified. Thus, foo.o -lz bar.o searches library z
10087 after file foo.o but before bar.o. If bar.o refers to functions in
10088 z, those functions may not be loaded.
10089
10090 The linker searches a standard list of directories for the library,
10091 which is actually a file named liblibrary.a. The linker then uses
10092 this file as if it had been specified precisely by name.
10093
10094 The directories searched include several standard system
10095 directories plus any that you specify with -L.
10096
10097 Normally the files found this way are library files---archive files
10098 whose members are object files. The linker handles an archive file
10099 by scanning through it for members which define symbols that have
10100 so far been referenced but not defined. But if the file that is
10101 found is an ordinary object file, it is linked in the usual
10102 fashion. The only difference between using an -l option and
10103 specifying a file name is that -l surrounds library with lib and .a
10104 and searches several directories.
10105
10106 -lobjc
10107 You need this special case of the -l option in order to link an
10108 Objective-C or Objective-C++ program.
10109
10110 -nostartfiles
10111 Do not use the standard system startup files when linking. The
10112 standard system libraries are used normally, unless -nostdlib or
10113 -nodefaultlibs is used.
10114
10115 -nodefaultlibs
10116 Do not use the standard system libraries when linking. Only the
10117 libraries you specify are passed to the linker, and options
10118 specifying linkage of the system libraries, such as -static-libgcc
10119 or -shared-libgcc, are ignored. The standard startup files are
10120 used normally, unless -nostartfiles is used.
10121
10122 The compiler may generate calls to "memcmp", "memset", "memcpy" and
10123 "memmove". These entries are usually resolved by entries in libc.
10124 These entry points should be supplied through some other mechanism
10125 when this option is specified.
10126
10127 -nostdlib
10128 Do not use the standard system startup files or libraries when
10129 linking. No startup files and only the libraries you specify are
10130 passed to the linker, and options specifying linkage of the system
10131 libraries, such as -static-libgcc or -shared-libgcc, are ignored.
10132
10133 The compiler may generate calls to "memcmp", "memset", "memcpy" and
10134 "memmove". These entries are usually resolved by entries in libc.
10135 These entry points should be supplied through some other mechanism
10136 when this option is specified.
10137
10138 One of the standard libraries bypassed by -nostdlib and
10139 -nodefaultlibs is libgcc.a, a library of internal subroutines which
10140 GCC uses to overcome shortcomings of particular machines, or
10141 special needs for some languages.
10142
10143 In most cases, you need libgcc.a even when you want to avoid other
10144 standard libraries. In other words, when you specify -nostdlib or
10145 -nodefaultlibs you should usually specify -lgcc as well. This
10146 ensures that you have no unresolved references to internal GCC
10147 library subroutines. (An example of such an internal subroutine is
10148 "__main", used to ensure C++ constructors are called.)
10149
10150 -pie
10151 Produce a position independent executable on targets that support
10152 it. For predictable results, you must also specify the same set of
10153 options used for compilation (-fpie, -fPIE, or model suboptions)
10154 when you specify this linker option.
10155
10156 -no-pie
10157 Don't produce a position independent executable.
10158
10159 -pthread
10160 Link with the POSIX threads library. This option is supported on
10161 GNU/Linux targets, most other Unix derivatives, and also on x86
10162 Cygwin and MinGW targets. On some targets this option also sets
10163 flags for the preprocessor, so it should be used consistently for
10164 both compilation and linking.
10165
10166 -rdynamic
10167 Pass the flag -export-dynamic to the ELF linker, on targets that
10168 support it. This instructs the linker to add all symbols, not only
10169 used ones, to the dynamic symbol table. This option is needed for
10170 some uses of "dlopen" or to allow obtaining backtraces from within
10171 a program.
10172
10173 -s Remove all symbol table and relocation information from the
10174 executable.
10175
10176 -static
10177 On systems that support dynamic linking, this prevents linking with
10178 the shared libraries. On other systems, this option has no effect.
10179
10180 -shared
10181 Produce a shared object which can then be linked with other objects
10182 to form an executable. Not all systems support this option. For
10183 predictable results, you must also specify the same set of options
10184 used for compilation (-fpic, -fPIC, or model suboptions) when you
10185 specify this linker option.[1]
10186
10187 -shared-libgcc
10188 -static-libgcc
10189 On systems that provide libgcc as a shared library, these options
10190 force the use of either the shared or static version, respectively.
10191 If no shared version of libgcc was built when the compiler was
10192 configured, these options have no effect.
10193
10194 There are several situations in which an application should use the
10195 shared libgcc instead of the static version. The most common of
10196 these is when the application wishes to throw and catch exceptions
10197 across different shared libraries. In that case, each of the
10198 libraries as well as the application itself should use the shared
10199 libgcc.
10200
10201 Therefore, the G++ driver automatically adds -shared-libgcc
10202 whenever you build a shared library or a main executable, because
10203 C++ programs typically use exceptions, so this is the right thing
10204 to do.
10205
10206 If, instead, you use the GCC driver to create shared libraries, you
10207 may find that they are not always linked with the shared libgcc.
10208 If GCC finds, at its configuration time, that you have a non-GNU
10209 linker or a GNU linker that does not support option --eh-frame-hdr,
10210 it links the shared version of libgcc into shared libraries by
10211 default. Otherwise, it takes advantage of the linker and optimizes
10212 away the linking with the shared version of libgcc, linking with
10213 the static version of libgcc by default. This allows exceptions to
10214 propagate through such shared libraries, without incurring
10215 relocation costs at library load time.
10216
10217 However, if a library or main executable is supposed to throw or
10218 catch exceptions, you must link it using the G++ driver, or using
10219 the option -shared-libgcc, such that it is linked with the shared
10220 libgcc.
10221
10222 -static-libasan
10223 When the -fsanitize=address option is used to link a program, the
10224 GCC driver automatically links against libasan. If libasan is
10225 available as a shared library, and the -static option is not used,
10226 then this links against the shared version of libasan. The
10227 -static-libasan option directs the GCC driver to link libasan
10228 statically, without necessarily linking other libraries statically.
10229
10230 -static-libtsan
10231 When the -fsanitize=thread option is used to link a program, the
10232 GCC driver automatically links against libtsan. If libtsan is
10233 available as a shared library, and the -static option is not used,
10234 then this links against the shared version of libtsan. The
10235 -static-libtsan option directs the GCC driver to link libtsan
10236 statically, without necessarily linking other libraries statically.
10237
10238 -static-liblsan
10239 When the -fsanitize=leak option is used to link a program, the GCC
10240 driver automatically links against liblsan. If liblsan is
10241 available as a shared library, and the -static option is not used,
10242 then this links against the shared version of liblsan. The
10243 -static-liblsan option directs the GCC driver to link liblsan
10244 statically, without necessarily linking other libraries statically.
10245
10246 -static-libubsan
10247 When the -fsanitize=undefined option is used to link a program, the
10248 GCC driver automatically links against libubsan. If libubsan is
10249 available as a shared library, and the -static option is not used,
10250 then this links against the shared version of libubsan. The
10251 -static-libubsan option directs the GCC driver to link libubsan
10252 statically, without necessarily linking other libraries statically.
10253
10254 -static-libmpx
10255 When the -fcheck-pointer bounds and -mmpx options are used to link
10256 a program, the GCC driver automatically links against libmpx. If
10257 libmpx is available as a shared library, and the -static option is
10258 not used, then this links against the shared version of libmpx.
10259 The -static-libmpx option directs the GCC driver to link libmpx
10260 statically, without necessarily linking other libraries statically.
10261
10262 -static-libmpxwrappers
10263 When the -fcheck-pointer bounds and -mmpx options are used to link
10264 a program without also using -fno-chkp-use-wrappers, the GCC driver
10265 automatically links against libmpxwrappers. If libmpxwrappers is
10266 available as a shared library, and the -static option is not used,
10267 then this links against the shared version of libmpxwrappers. The
10268 -static-libmpxwrappers option directs the GCC driver to link
10269 libmpxwrappers statically, without necessarily linking other
10270 libraries statically.
10271
10272 -static-libstdc++
10273 When the g++ program is used to link a C++ program, it normally
10274 automatically links against libstdc++. If libstdc++ is available
10275 as a shared library, and the -static option is not used, then this
10276 links against the shared version of libstdc++. That is normally
10277 fine. However, it is sometimes useful to freeze the version of
10278 libstdc++ used by the program without going all the way to a fully
10279 static link. The -static-libstdc++ option directs the g++ driver
10280 to link libstdc++ statically, without necessarily linking other
10281 libraries statically.
10282
10283 -symbolic
10284 Bind references to global symbols when building a shared object.
10285 Warn about any unresolved references (unless overridden by the link
10286 editor option -Xlinker -z -Xlinker defs). Only a few systems
10287 support this option.
10288
10289 -T script
10290 Use script as the linker script. This option is supported by most
10291 systems using the GNU linker. On some targets, such as bare-board
10292 targets without an operating system, the -T option may be required
10293 when linking to avoid references to undefined symbols.
10294
10295 -Xlinker option
10296 Pass option as an option to the linker. You can use this to supply
10297 system-specific linker options that GCC does not recognize.
10298
10299 If you want to pass an option that takes a separate argument, you
10300 must use -Xlinker twice, once for the option and once for the
10301 argument. For example, to pass -assert definitions, you must write
10302 -Xlinker -assert -Xlinker definitions. It does not work to write
10303 -Xlinker "-assert definitions", because this passes the entire
10304 string as a single argument, which is not what the linker expects.
10305
10306 When using the GNU linker, it is usually more convenient to pass
10307 arguments to linker options using the option=value syntax than as
10308 separate arguments. For example, you can specify -Xlinker
10309 -Map=output.map rather than -Xlinker -Map -Xlinker output.map.
10310 Other linkers may not support this syntax for command-line options.
10311
10312 -Wl,option
10313 Pass option as an option to the linker. If option contains commas,
10314 it is split into multiple options at the commas. You can use this
10315 syntax to pass an argument to the option. For example,
10316 -Wl,-Map,output.map passes -Map output.map to the linker. When
10317 using the GNU linker, you can also get the same effect with
10318 -Wl,-Map=output.map.
10319
10320 -u symbol
10321 Pretend the symbol symbol is undefined, to force linking of library
10322 modules to define it. You can use -u multiple times with different
10323 symbols to force loading of additional library modules.
10324
10325 -z keyword
10326 -z is passed directly on to the linker along with the keyword
10327 keyword. See the section in the documentation of your linker for
10328 permitted values and their meanings.
10329
10330 Options for Directory Search
10331 These options specify directories to search for header files, for
10332 libraries and for parts of the compiler:
10333
10334 -I dir
10335 -iquote dir
10336 -isystem dir
10337 -idirafter dir
10338 Add the directory dir to the list of directories to be searched for
10339 header files during preprocessing. If dir begins with =, then the
10340 = is replaced by the sysroot prefix; see --sysroot and -isysroot.
10341
10342 Directories specified with -iquote apply only to the quote form of
10343 the directive, "#include "file"". Directories specified with -I,
10344 -isystem, or -idirafter apply to lookup for both the
10345 "#include "file"" and "#include <file>" directives.
10346
10347 You can specify any number or combination of these options on the
10348 command line to search for header files in several directories.
10349 The lookup order is as follows:
10350
10351 1. For the quote form of the include directive, the directory of
10352 the current file is searched first.
10353
10354 2. For the quote form of the include directive, the directories
10355 specified by -iquote options are searched in left-to-right
10356 order, as they appear on the command line.
10357
10358 3. Directories specified with -I options are scanned in left-to-
10359 right order.
10360
10361 4. Directories specified with -isystem options are scanned in
10362 left-to-right order.
10363
10364 5. Standard system directories are scanned.
10365
10366 6. Directories specified with -idirafter options are scanned in
10367 left-to-right order.
10368
10369 You can use -I to override a system header file, substituting your
10370 own version, since these directories are searched before the
10371 standard system header file directories. However, you should not
10372 use this option to add directories that contain vendor-supplied
10373 system header files; use -isystem for that.
10374
10375 The -isystem and -idirafter options also mark the directory as a
10376 system directory, so that it gets the same special treatment that
10377 is applied to the standard system directories.
10378
10379 If a standard system include directory, or a directory specified
10380 with -isystem, is also specified with -I, the -I option is ignored.
10381 The directory is still searched but as a system directory at its
10382 normal position in the system include chain. This is to ensure
10383 that GCC's procedure to fix buggy system headers and the ordering
10384 for the "#include_next" directive are not inadvertently changed.
10385 If you really need to change the search order for system
10386 directories, use the -nostdinc and/or -isystem options.
10387
10388 -I- Split the include path. This option has been deprecated. Please
10389 use -iquote instead for -I directories before the -I- and remove
10390 the -I- option.
10391
10392 Any directories specified with -I options before -I- are searched
10393 only for headers requested with "#include "file""; they are not
10394 searched for "#include <file>". If additional directories are
10395 specified with -I options after the -I-, those directories are
10396 searched for all #include directives.
10397
10398 In addition, -I- inhibits the use of the directory of the current
10399 file directory as the first search directory for "#include "file"".
10400 There is no way to override this effect of -I-.
10401
10402 -iprefix prefix
10403 Specify prefix as the prefix for subsequent -iwithprefix options.
10404 If the prefix represents a directory, you should include the final
10405 /.
10406
10407 -iwithprefix dir
10408 -iwithprefixbefore dir
10409 Append dir to the prefix specified previously with -iprefix, and
10410 add the resulting directory to the include search path.
10411 -iwithprefixbefore puts it in the same place -I would; -iwithprefix
10412 puts it where -idirafter would.
10413
10414 -isysroot dir
10415 This option is like the --sysroot option, but applies only to
10416 header files (except for Darwin targets, where it applies to both
10417 header files and libraries). See the --sysroot option for more
10418 information.
10419
10420 -imultilib dir
10421 Use dir as a subdirectory of the directory containing target-
10422 specific C++ headers.
10423
10424 -nostdinc
10425 Do not search the standard system directories for header files.
10426 Only the directories explicitly specified with -I, -iquote,
10427 -isystem, and/or -idirafter options (and the directory of the
10428 current file, if appropriate) are searched.
10429
10430 -nostdinc++
10431 Do not search for header files in the C++-specific standard
10432 directories, but do still search the other standard directories.
10433 (This option is used when building the C++ library.)
10434
10435 -iplugindir=dir
10436 Set the directory to search for plugins that are passed by
10437 -fplugin=name instead of -fplugin=path/name.so. This option is not
10438 meant to be used by the user, but only passed by the driver.
10439
10440 -Ldir
10441 Add directory dir to the list of directories to be searched for -l.
10442
10443 -Bprefix
10444 This option specifies where to find the executables, libraries,
10445 include files, and data files of the compiler itself.
10446
10447 The compiler driver program runs one or more of the subprograms
10448 cpp, cc1, as and ld. It tries prefix as a prefix for each program
10449 it tries to run, both with and without machine/version/ for the
10450 corresponding target machine and compiler version.
10451
10452 For each subprogram to be run, the compiler driver first tries the
10453 -B prefix, if any. If that name is not found, or if -B is not
10454 specified, the driver tries two standard prefixes, /usr/lib/gcc/
10455 and /usr/local/lib/gcc/. If neither of those results in a file
10456 name that is found, the unmodified program name is searched for
10457 using the directories specified in your PATH environment variable.
10458
10459 The compiler checks to see if the path provided by -B refers to a
10460 directory, and if necessary it adds a directory separator character
10461 at the end of the path.
10462
10463 -B prefixes that effectively specify directory names also apply to
10464 libraries in the linker, because the compiler translates these
10465 options into -L options for the linker. They also apply to include
10466 files in the preprocessor, because the compiler translates these
10467 options into -isystem options for the preprocessor. In this case,
10468 the compiler appends include to the prefix.
10469
10470 The runtime support file libgcc.a can also be searched for using
10471 the -B prefix, if needed. If it is not found there, the two
10472 standard prefixes above are tried, and that is all. The file is
10473 left out of the link if it is not found by those means.
10474
10475 Another way to specify a prefix much like the -B prefix is to use
10476 the environment variable GCC_EXEC_PREFIX.
10477
10478 As a special kludge, if the path provided by -B is [dir/]stageN/,
10479 where N is a number in the range 0 to 9, then it is replaced by
10480 [dir/]include. This is to help with boot-strapping the compiler.
10481
10482 -no-canonical-prefixes
10483 Do not expand any symbolic links, resolve references to /../ or
10484 /./, or make the path absolute when generating a relative prefix.
10485
10486 --sysroot=dir
10487 Use dir as the logical root directory for headers and libraries.
10488 For example, if the compiler normally searches for headers in
10489 /usr/include and libraries in /usr/lib, it instead searches
10490 dir/usr/include and dir/usr/lib.
10491
10492 If you use both this option and the -isysroot option, then the
10493 --sysroot option applies to libraries, but the -isysroot option
10494 applies to header files.
10495
10496 The GNU linker (beginning with version 2.16) has the necessary
10497 support for this option. If your linker does not support this
10498 option, the header file aspect of --sysroot still works, but the
10499 library aspect does not.
10500
10501 --no-sysroot-suffix
10502 For some targets, a suffix is added to the root directory specified
10503 with --sysroot, depending on the other options used, so that
10504 headers may for example be found in dir/suffix/usr/include instead
10505 of dir/usr/include. This option disables the addition of such a
10506 suffix.
10507
10508 Options for Code Generation Conventions
10509 These machine-independent options control the interface conventions
10510 used in code generation.
10511
10512 Most of them have both positive and negative forms; the negative form
10513 of -ffoo is -fno-foo. In the table below, only one of the forms is
10514 listed---the one that is not the default. You can figure out the other
10515 form by either removing no- or adding it.
10516
10517 -fstack-reuse=reuse-level
10518 This option controls stack space reuse for user declared local/auto
10519 variables and compiler generated temporaries. reuse_level can be
10520 all, named_vars, or none. all enables stack reuse for all local
10521 variables and temporaries, named_vars enables the reuse only for
10522 user defined local variables with names, and none disables stack
10523 reuse completely. The default value is all. The option is needed
10524 when the program extends the lifetime of a scoped local variable or
10525 a compiler generated temporary beyond the end point defined by the
10526 language. When a lifetime of a variable ends, and if the variable
10527 lives in memory, the optimizing compiler has the freedom to reuse
10528 its stack space with other temporaries or scoped local variables
10529 whose live range does not overlap with it. Legacy code extending
10530 local lifetime is likely to break with the stack reuse
10531 optimization.
10532
10533 For example,
10534
10535 int *p;
10536 {
10537 int local1;
10538
10539 p = &local1;
10540 local1 = 10;
10541 ....
10542 }
10543 {
10544 int local2;
10545 local2 = 20;
10546 ...
10547 }
10548
10549 if (*p == 10) // out of scope use of local1
10550 {
10551
10552 }
10553
10554 Another example:
10555
10556 struct A
10557 {
10558 A(int k) : i(k), j(k) { }
10559 int i;
10560 int j;
10561 };
10562
10563 A *ap;
10564
10565 void foo(const A& ar)
10566 {
10567 ap = &ar;
10568 }
10569
10570 void bar()
10571 {
10572 foo(A(10)); // temp object's lifetime ends when foo returns
10573
10574 {
10575 A a(20);
10576 ....
10577 }
10578 ap->i+= 10; // ap references out of scope temp whose space
10579 // is reused with a. What is the value of ap->i?
10580 }
10581
10582 The lifetime of a compiler generated temporary is well defined by
10583 the C++ standard. When a lifetime of a temporary ends, and if the
10584 temporary lives in memory, the optimizing compiler has the freedom
10585 to reuse its stack space with other temporaries or scoped local
10586 variables whose live range does not overlap with it. However some
10587 of the legacy code relies on the behavior of older compilers in
10588 which temporaries' stack space is not reused, the aggressive stack
10589 reuse can lead to runtime errors. This option is used to control
10590 the temporary stack reuse optimization.
10591
10592 -ftrapv
10593 This option generates traps for signed overflow on addition,
10594 subtraction, multiplication operations. The options -ftrapv and
10595 -fwrapv override each other, so using -ftrapv -fwrapv on the
10596 command-line results in -fwrapv being effective. Note that only
10597 active options override, so using -ftrapv -fwrapv -fno-wrapv on the
10598 command-line results in -ftrapv being effective.
10599
10600 -fwrapv
10601 This option instructs the compiler to assume that signed arithmetic
10602 overflow of addition, subtraction and multiplication wraps around
10603 using twos-complement representation. This flag enables some
10604 optimizations and disables others. The options -ftrapv and -fwrapv
10605 override each other, so using -ftrapv -fwrapv on the command-line
10606 results in -fwrapv being effective. Note that only active options
10607 override, so using -ftrapv -fwrapv -fno-wrapv on the command-line
10608 results in -ftrapv being effective.
10609
10610 -fexceptions
10611 Enable exception handling. Generates extra code needed to
10612 propagate exceptions. For some targets, this implies GCC generates
10613 frame unwind information for all functions, which can produce
10614 significant data size overhead, although it does not affect
10615 execution. If you do not specify this option, GCC enables it by
10616 default for languages like C++ that normally require exception
10617 handling, and disables it for languages like C that do not normally
10618 require it. However, you may need to enable this option when
10619 compiling C code that needs to interoperate properly with exception
10620 handlers written in C++. You may also wish to disable this option
10621 if you are compiling older C++ programs that don't use exception
10622 handling.
10623
10624 -fnon-call-exceptions
10625 Generate code that allows trapping instructions to throw
10626 exceptions. Note that this requires platform-specific runtime
10627 support that does not exist everywhere. Moreover, it only allows
10628 trapping instructions to throw exceptions, i.e. memory references
10629 or floating-point instructions. It does not allow exceptions to be
10630 thrown from arbitrary signal handlers such as "SIGALRM".
10631
10632 -fdelete-dead-exceptions
10633 Consider that instructions that may throw exceptions but don't
10634 otherwise contribute to the execution of the program can be
10635 optimized away. This option is enabled by default for the Ada
10636 front end, as permitted by the Ada language specification.
10637 Optimization passes that cause dead exceptions to be removed are
10638 enabled independently at different optimization levels.
10639
10640 -funwind-tables
10641 Similar to -fexceptions, except that it just generates any needed
10642 static data, but does not affect the generated code in any other
10643 way. You normally do not need to enable this option; instead, a
10644 language processor that needs this handling enables it on your
10645 behalf.
10646
10647 -fasynchronous-unwind-tables
10648 Generate unwind table in DWARF format, if supported by target
10649 machine. The table is exact at each instruction boundary, so it
10650 can be used for stack unwinding from asynchronous events (such as
10651 debugger or garbage collector).
10652
10653 -fno-gnu-unique
10654 On systems with recent GNU assembler and C library, the C++
10655 compiler uses the "STB_GNU_UNIQUE" binding to make sure that
10656 definitions of template static data members and static local
10657 variables in inline functions are unique even in the presence of
10658 "RTLD_LOCAL"; this is necessary to avoid problems with a library
10659 used by two different "RTLD_LOCAL" plugins depending on a
10660 definition in one of them and therefore disagreeing with the other
10661 one about the binding of the symbol. But this causes "dlclose" to
10662 be ignored for affected DSOs; if your program relies on
10663 reinitialization of a DSO via "dlclose" and "dlopen", you can use
10664 -fno-gnu-unique.
10665
10666 -fpcc-struct-return
10667 Return "short" "struct" and "union" values in memory like longer
10668 ones, rather than in registers. This convention is less efficient,
10669 but it has the advantage of allowing intercallability between GCC-
10670 compiled files and files compiled with other compilers,
10671 particularly the Portable C Compiler (pcc).
10672
10673 The precise convention for returning structures in memory depends
10674 on the target configuration macros.
10675
10676 Short structures and unions are those whose size and alignment
10677 match that of some integer type.
10678
10679 Warning: code compiled with the -fpcc-struct-return switch is not
10680 binary compatible with code compiled with the -freg-struct-return
10681 switch. Use it to conform to a non-default application binary
10682 interface.
10683
10684 -freg-struct-return
10685 Return "struct" and "union" values in registers when possible.
10686 This is more efficient for small structures than
10687 -fpcc-struct-return.
10688
10689 If you specify neither -fpcc-struct-return nor -freg-struct-return,
10690 GCC defaults to whichever convention is standard for the target.
10691 If there is no standard convention, GCC defaults to
10692 -fpcc-struct-return, except on targets where GCC is the principal
10693 compiler. In those cases, we can choose the standard, and we chose
10694 the more efficient register return alternative.
10695
10696 Warning: code compiled with the -freg-struct-return switch is not
10697 binary compatible with code compiled with the -fpcc-struct-return
10698 switch. Use it to conform to a non-default application binary
10699 interface.
10700
10701 -fshort-enums
10702 Allocate to an "enum" type only as many bytes as it needs for the
10703 declared range of possible values. Specifically, the "enum" type
10704 is equivalent to the smallest integer type that has enough room.
10705
10706 Warning: the -fshort-enums switch causes GCC to generate code that
10707 is not binary compatible with code generated without that switch.
10708 Use it to conform to a non-default application binary interface.
10709
10710 -fshort-wchar
10711 Override the underlying type for "wchar_t" to be "short unsigned
10712 int" instead of the default for the target. This option is useful
10713 for building programs to run under WINE.
10714
10715 Warning: the -fshort-wchar switch causes GCC to generate code that
10716 is not binary compatible with code generated without that switch.
10717 Use it to conform to a non-default application binary interface.
10718
10719 -fno-common
10720 In C code, this option controls the placement of global variables
10721 defined without an initializer, known as tentative definitions in
10722 the C standard. Tentative definitions are distinct from
10723 declarations of a variable with the "extern" keyword, which do not
10724 allocate storage.
10725
10726 Unix C compilers have traditionally allocated storage for
10727 uninitialized global variables in a common block. This allows the
10728 linker to resolve all tentative definitions of the same variable in
10729 different compilation units to the same object, or to a non-
10730 tentative definition. This is the behavior specified by -fcommon,
10731 and is the default for GCC on most targets. On the other hand,
10732 this behavior is not required by ISO C, and on some targets may
10733 carry a speed or code size penalty on variable references.
10734
10735 The -fno-common option specifies that the compiler should instead
10736 place uninitialized global variables in the data section of the
10737 object file. This inhibits the merging of tentative definitions by
10738 the linker so you get a multiple-definition error if the same
10739 variable is defined in more than one compilation unit. Compiling
10740 with -fno-common is useful on targets for which it provides better
10741 performance, or if you wish to verify that the program will work on
10742 other systems that always treat uninitialized variable definitions
10743 this way.
10744
10745 -fno-ident
10746 Ignore the "#ident" directive.
10747
10748 -finhibit-size-directive
10749 Don't output a ".size" assembler directive, or anything else that
10750 would cause trouble if the function is split in the middle, and the
10751 two halves are placed at locations far apart in memory. This
10752 option is used when compiling crtstuff.c; you should not need to
10753 use it for anything else.
10754
10755 -fverbose-asm
10756 Put extra commentary information in the generated assembly code to
10757 make it more readable. This option is generally only of use to
10758 those who actually need to read the generated assembly code
10759 (perhaps while debugging the compiler itself).
10760
10761 -fno-verbose-asm, the default, causes the extra information to be
10762 omitted and is useful when comparing two assembler files.
10763
10764 The added comments include:
10765
10766 * information on the compiler version and command-line options,
10767
10768 * the source code lines associated with the assembly
10769 instructions, in the form FILENAME:LINENUMBER:CONTENT OF LINE,
10770
10771 * hints on which high-level expressions correspond to the various
10772 assembly instruction operands.
10773
10774 For example, given this C source file:
10775
10776 int test (int n)
10777 {
10778 int i;
10779 int total = 0;
10780
10781 for (i = 0; i < n; i++)
10782 total += i * i;
10783
10784 return total;
10785 }
10786
10787 compiling to (x86_64) assembly via -S and emitting the result
10788 direct to stdout via -o -
10789
10790 gcc -S test.c -fverbose-asm -Os -o -
10791
10792 gives output similar to this:
10793
10794 .file "test.c"
10795 # GNU C11 (GCC) version 7.0.0 20160809 (experimental) (x86_64-pc-linux-gnu)
10796 [...snip...]
10797 # options passed:
10798 [...snip...]
10799
10800 .text
10801 .globl test
10802 .type test, @function
10803 test:
10804 .LFB0:
10805 .cfi_startproc
10806 # test.c:4: int total = 0;
10807 xorl %eax, %eax # <retval>
10808 # test.c:6: for (i = 0; i < n; i++)
10809 xorl %edx, %edx # i
10810 .L2:
10811 # test.c:6: for (i = 0; i < n; i++)
10812 cmpl %edi, %edx # n, i
10813 jge .L5 #,
10814 # test.c:7: total += i * i;
10815 movl %edx, %ecx # i, tmp92
10816 imull %edx, %ecx # i, tmp92
10817 # test.c:6: for (i = 0; i < n; i++)
10818 incl %edx # i
10819 # test.c:7: total += i * i;
10820 addl %ecx, %eax # tmp92, <retval>
10821 jmp .L2 #
10822 .L5:
10823 # test.c:10: }
10824 ret
10825 .cfi_endproc
10826 .LFE0:
10827 .size test, .-test
10828 .ident "GCC: (GNU) 7.0.0 20160809 (experimental)"
10829 .section .note.GNU-stack,"",@progbits
10830
10831 The comments are intended for humans rather than machines and hence
10832 the precise format of the comments is subject to change.
10833
10834 -frecord-gcc-switches
10835 This switch causes the command line used to invoke the compiler to
10836 be recorded into the object file that is being created. This
10837 switch is only implemented on some targets and the exact format of
10838 the recording is target and binary file format dependent, but it
10839 usually takes the form of a section containing ASCII text. This
10840 switch is related to the -fverbose-asm switch, but that switch only
10841 records information in the assembler output file as comments, so it
10842 never reaches the object file. See also -grecord-gcc-switches for
10843 another way of storing compiler options into the object file.
10844
10845 -fpic
10846 Generate position-independent code (PIC) suitable for use in a
10847 shared library, if supported for the target machine. Such code
10848 accesses all constant addresses through a global offset table
10849 (GOT). The dynamic loader resolves the GOT entries when the
10850 program starts (the dynamic loader is not part of GCC; it is part
10851 of the operating system). If the GOT size for the linked
10852 executable exceeds a machine-specific maximum size, you get an
10853 error message from the linker indicating that -fpic does not work;
10854 in that case, recompile with -fPIC instead. (These maximums are 8k
10855 on the SPARC, 28k on AArch64 and 32k on the m68k and RS/6000. The
10856 x86 has no such limit.)
10857
10858 Position-independent code requires special support, and therefore
10859 works only on certain machines. For the x86, GCC supports PIC for
10860 System V but not for the Sun 386i. Code generated for the IBM
10861 RS/6000 is always position-independent.
10862
10863 When this flag is set, the macros "__pic__" and "__PIC__" are
10864 defined to 1.
10865
10866 -fPIC
10867 If supported for the target machine, emit position-independent
10868 code, suitable for dynamic linking and avoiding any limit on the
10869 size of the global offset table. This option makes a difference on
10870 AArch64, m68k, PowerPC and SPARC.
10871
10872 Position-independent code requires special support, and therefore
10873 works only on certain machines.
10874
10875 When this flag is set, the macros "__pic__" and "__PIC__" are
10876 defined to 2.
10877
10878 -fpie
10879 -fPIE
10880 These options are similar to -fpic and -fPIC, but generated
10881 position independent code can be only linked into executables.
10882 Usually these options are used when -pie GCC option is used during
10883 linking.
10884
10885 -fpie and -fPIE both define the macros "__pie__" and "__PIE__".
10886 The macros have the value 1 for -fpie and 2 for -fPIE.
10887
10888 -fno-plt
10889 Do not use the PLT for external function calls in position-
10890 independent code. Instead, load the callee address at call sites
10891 from the GOT and branch to it. This leads to more efficient code
10892 by eliminating PLT stubs and exposing GOT loads to optimizations.
10893 On architectures such as 32-bit x86 where PLT stubs expect the GOT
10894 pointer in a specific register, this gives more register allocation
10895 freedom to the compiler. Lazy binding requires use of the PLT;
10896 with -fno-plt all external symbols are resolved at load time.
10897
10898 Alternatively, the function attribute "noplt" can be used to avoid
10899 calls through the PLT for specific external functions.
10900
10901 In position-dependent code, a few targets also convert calls to
10902 functions that are marked to not use the PLT to use the GOT
10903 instead.
10904
10905 -fno-jump-tables
10906 Do not use jump tables for switch statements even where it would be
10907 more efficient than other code generation strategies. This option
10908 is of use in conjunction with -fpic or -fPIC for building code that
10909 forms part of a dynamic linker and cannot reference the address of
10910 a jump table. On some targets, jump tables do not require a GOT
10911 and this option is not needed.
10912
10913 -ffixed-reg
10914 Treat the register named reg as a fixed register; generated code
10915 should never refer to it (except perhaps as a stack pointer, frame
10916 pointer or in some other fixed role).
10917
10918 reg must be the name of a register. The register names accepted
10919 are machine-specific and are defined in the "REGISTER_NAMES" macro
10920 in the machine description macro file.
10921
10922 This flag does not have a negative form, because it specifies a
10923 three-way choice.
10924
10925 -fcall-used-reg
10926 Treat the register named reg as an allocable register that is
10927 clobbered by function calls. It may be allocated for temporaries
10928 or variables that do not live across a call. Functions compiled
10929 this way do not save and restore the register reg.
10930
10931 It is an error to use this flag with the frame pointer or stack
10932 pointer. Use of this flag for other registers that have fixed
10933 pervasive roles in the machine's execution model produces
10934 disastrous results.
10935
10936 This flag does not have a negative form, because it specifies a
10937 three-way choice.
10938
10939 -fcall-saved-reg
10940 Treat the register named reg as an allocable register saved by
10941 functions. It may be allocated even for temporaries or variables
10942 that live across a call. Functions compiled this way save and
10943 restore the register reg if they use it.
10944
10945 It is an error to use this flag with the frame pointer or stack
10946 pointer. Use of this flag for other registers that have fixed
10947 pervasive roles in the machine's execution model produces
10948 disastrous results.
10949
10950 A different sort of disaster results from the use of this flag for
10951 a register in which function values may be returned.
10952
10953 This flag does not have a negative form, because it specifies a
10954 three-way choice.
10955
10956 -fpack-struct[=n]
10957 Without a value specified, pack all structure members together
10958 without holes. When a value is specified (which must be a small
10959 power of two), pack structure members according to this value,
10960 representing the maximum alignment (that is, objects with default
10961 alignment requirements larger than this are output potentially
10962 unaligned at the next fitting location.
10963
10964 Warning: the -fpack-struct switch causes GCC to generate code that
10965 is not binary compatible with code generated without that switch.
10966 Additionally, it makes the code suboptimal. Use it to conform to a
10967 non-default application binary interface.
10968
10969 -fleading-underscore
10970 This option and its counterpart, -fno-leading-underscore, forcibly
10971 change the way C symbols are represented in the object file. One
10972 use is to help link with legacy assembly code.
10973
10974 Warning: the -fleading-underscore switch causes GCC to generate
10975 code that is not binary compatible with code generated without that
10976 switch. Use it to conform to a non-default application binary
10977 interface. Not all targets provide complete support for this
10978 switch.
10979
10980 -ftls-model=model
10981 Alter the thread-local storage model to be used. The model
10982 argument should be one of global-dynamic, local-dynamic, initial-
10983 exec or local-exec. Note that the choice is subject to
10984 optimization: the compiler may use a more efficient model for
10985 symbols not visible outside of the translation unit, or if -fpic is
10986 not given on the command line.
10987
10988 The default without -fpic is initial-exec; with -fpic the default
10989 is global-dynamic.
10990
10991 -ftrampolines
10992 For targets that normally need trampolines for nested functions,
10993 always generate them instead of using descriptors. Otherwise, for
10994 targets that do not need them, like for example HP-PA or IA-64, do
10995 nothing.
10996
10997 A trampoline is a small piece of code that is created at run time
10998 on the stack when the address of a nested function is taken, and is
10999 used to call the nested function indirectly. Therefore, it
11000 requires the stack to be made executable in order for the program
11001 to work properly.
11002
11003 -fno-trampolines is enabled by default on a language by language
11004 basis to let the compiler avoid generating them, if it computes
11005 that this is safe, and replace them with descriptors. Descriptors
11006 are made up of data only, but the generated code must be prepared
11007 to deal with them. As of this writing, -fno-trampolines is enabled
11008 by default only for Ada.
11009
11010 Moreover, code compiled with -ftrampolines and code compiled with
11011 -fno-trampolines are not binary compatible if nested functions are
11012 present. This option must therefore be used on a program-wide
11013 basis and be manipulated with extreme care.
11014
11015 -fvisibility=[default|internal|hidden|protected]
11016 Set the default ELF image symbol visibility to the specified
11017 option---all symbols are marked with this unless overridden within
11018 the code. Using this feature can very substantially improve
11019 linking and load times of shared object libraries, produce more
11020 optimized code, provide near-perfect API export and prevent symbol
11021 clashes. It is strongly recommended that you use this in any
11022 shared objects you distribute.
11023
11024 Despite the nomenclature, default always means public; i.e.,
11025 available to be linked against from outside the shared object.
11026 protected and internal are pretty useless in real-world usage so
11027 the only other commonly used option is hidden. The default if
11028 -fvisibility isn't specified is default, i.e., make every symbol
11029 public.
11030
11031 A good explanation of the benefits offered by ensuring ELF symbols
11032 have the correct visibility is given by "How To Write Shared
11033 Libraries" by Ulrich Drepper (which can be found at
11034 <https://www.akkadia.org/drepper/>)---however a superior solution
11035 made possible by this option to marking things hidden when the
11036 default is public is to make the default hidden and mark things
11037 public. This is the norm with DLLs on Windows and with
11038 -fvisibility=hidden and "__attribute__ ((visibility("default")))"
11039 instead of "__declspec(dllexport)" you get almost identical
11040 semantics with identical syntax. This is a great boon to those
11041 working with cross-platform projects.
11042
11043 For those adding visibility support to existing code, you may find
11044 "#pragma GCC visibility" of use. This works by you enclosing the
11045 declarations you wish to set visibility for with (for example)
11046 "#pragma GCC visibility push(hidden)" and "#pragma GCC visibility
11047 pop". Bear in mind that symbol visibility should be viewed as part
11048 of the API interface contract and thus all new code should always
11049 specify visibility when it is not the default; i.e., declarations
11050 only for use within the local DSO should always be marked
11051 explicitly as hidden as so to avoid PLT indirection
11052 overheads---making this abundantly clear also aids readability and
11053 self-documentation of the code. Note that due to ISO C++
11054 specification requirements, "operator new" and "operator delete"
11055 must always be of default visibility.
11056
11057 Be aware that headers from outside your project, in particular
11058 system headers and headers from any other library you use, may not
11059 be expecting to be compiled with visibility other than the default.
11060 You may need to explicitly say "#pragma GCC visibility
11061 push(default)" before including any such headers.
11062
11063 "extern" declarations are not affected by -fvisibility, so a lot of
11064 code can be recompiled with -fvisibility=hidden with no
11065 modifications. However, this means that calls to "extern"
11066 functions with no explicit visibility use the PLT, so it is more
11067 effective to use "__attribute ((visibility))" and/or "#pragma GCC
11068 visibility" to tell the compiler which "extern" declarations should
11069 be treated as hidden.
11070
11071 Note that -fvisibility does affect C++ vague linkage entities. This
11072 means that, for instance, an exception class that is be thrown
11073 between DSOs must be explicitly marked with default visibility so
11074 that the type_info nodes are unified between the DSOs.
11075
11076 An overview of these techniques, their benefits and how to use them
11077 is at <http://gcc.gnu.org/wiki/Visibility>.
11078
11079 -fstrict-volatile-bitfields
11080 This option should be used if accesses to volatile bit-fields (or
11081 other structure fields, although the compiler usually honors those
11082 types anyway) should use a single access of the width of the
11083 field's type, aligned to a natural alignment if possible. For
11084 example, targets with memory-mapped peripheral registers might
11085 require all such accesses to be 16 bits wide; with this flag you
11086 can declare all peripheral bit-fields as "unsigned short" (assuming
11087 short is 16 bits on these targets) to force GCC to use 16-bit
11088 accesses instead of, perhaps, a more efficient 32-bit access.
11089
11090 If this option is disabled, the compiler uses the most efficient
11091 instruction. In the previous example, that might be a 32-bit load
11092 instruction, even though that accesses bytes that do not contain
11093 any portion of the bit-field, or memory-mapped registers unrelated
11094 to the one being updated.
11095
11096 In some cases, such as when the "packed" attribute is applied to a
11097 structure field, it may not be possible to access the field with a
11098 single read or write that is correctly aligned for the target
11099 machine. In this case GCC falls back to generating multiple
11100 accesses rather than code that will fault or truncate the result at
11101 run time.
11102
11103 Note: Due to restrictions of the C/C++11 memory model, write
11104 accesses are not allowed to touch non bit-field members. It is
11105 therefore recommended to define all bits of the field's type as
11106 bit-field members.
11107
11108 The default value of this option is determined by the application
11109 binary interface for the target processor.
11110
11111 -fsync-libcalls
11112 This option controls whether any out-of-line instance of the
11113 "__sync" family of functions may be used to implement the C++11
11114 "__atomic" family of functions.
11115
11116 The default value of this option is enabled, thus the only useful
11117 form of the option is -fno-sync-libcalls. This option is used in
11118 the implementation of the libatomic runtime library.
11119
11120 GCC Developer Options
11121 This section describes command-line options that are primarily of
11122 interest to GCC developers, including options to support compiler
11123 testing and investigation of compiler bugs and compile-time performance
11124 problems. This includes options that produce debug dumps at various
11125 points in the compilation; that print statistics such as memory use and
11126 execution time; and that print information about GCC's configuration,
11127 such as where it searches for libraries. You should rarely need to use
11128 any of these options for ordinary compilation and linking tasks.
11129
11130 -dletters
11131 -fdump-rtl-pass
11132 -fdump-rtl-pass=filename
11133 Says to make debugging dumps during compilation at times specified
11134 by letters. This is used for debugging the RTL-based passes of the
11135 compiler. The file names for most of the dumps are made by
11136 appending a pass number and a word to the dumpname, and the files
11137 are created in the directory of the output file. In case of
11138 =filename option, the dump is output on the given file instead of
11139 the pass numbered dump files. Note that the pass number is
11140 assigned as passes are registered into the pass manager. Most
11141 passes are registered in the order that they will execute and for
11142 these passes the number corresponds to the pass execution order.
11143 However, passes registered by plugins, passes specific to
11144 compilation targets, or passes that are otherwise registered after
11145 all the other passes are numbered higher than a pass named "final",
11146 even if they are executed earlier. dumpname is generated from the
11147 name of the output file if explicitly specified and not an
11148 executable, otherwise it is the basename of the source file.
11149
11150 Some -dletters switches have different meaning when -E is used for
11151 preprocessing.
11152
11153 Debug dumps can be enabled with a -fdump-rtl switch or some -d
11154 option letters. Here are the possible letters for use in pass and
11155 letters, and their meanings:
11156
11157 -fdump-rtl-alignments
11158 Dump after branch alignments have been computed.
11159
11160 -fdump-rtl-asmcons
11161 Dump after fixing rtl statements that have unsatisfied in/out
11162 constraints.
11163
11164 -fdump-rtl-auto_inc_dec
11165 Dump after auto-inc-dec discovery. This pass is only run on
11166 architectures that have auto inc or auto dec instructions.
11167
11168 -fdump-rtl-barriers
11169 Dump after cleaning up the barrier instructions.
11170
11171 -fdump-rtl-bbpart
11172 Dump after partitioning hot and cold basic blocks.
11173
11174 -fdump-rtl-bbro
11175 Dump after block reordering.
11176
11177 -fdump-rtl-btl1
11178 -fdump-rtl-btl2
11179 -fdump-rtl-btl1 and -fdump-rtl-btl2 enable dumping after the
11180 two branch target load optimization passes.
11181
11182 -fdump-rtl-bypass
11183 Dump after jump bypassing and control flow optimizations.
11184
11185 -fdump-rtl-combine
11186 Dump after the RTL instruction combination pass.
11187
11188 -fdump-rtl-compgotos
11189 Dump after duplicating the computed gotos.
11190
11191 -fdump-rtl-ce1
11192 -fdump-rtl-ce2
11193 -fdump-rtl-ce3
11194 -fdump-rtl-ce1, -fdump-rtl-ce2, and -fdump-rtl-ce3 enable
11195 dumping after the three if conversion passes.
11196
11197 -fdump-rtl-cprop_hardreg
11198 Dump after hard register copy propagation.
11199
11200 -fdump-rtl-csa
11201 Dump after combining stack adjustments.
11202
11203 -fdump-rtl-cse1
11204 -fdump-rtl-cse2
11205 -fdump-rtl-cse1 and -fdump-rtl-cse2 enable dumping after the
11206 two common subexpression elimination passes.
11207
11208 -fdump-rtl-dce
11209 Dump after the standalone dead code elimination passes.
11210
11211 -fdump-rtl-dbr
11212 Dump after delayed branch scheduling.
11213
11214 -fdump-rtl-dce1
11215 -fdump-rtl-dce2
11216 -fdump-rtl-dce1 and -fdump-rtl-dce2 enable dumping after the
11217 two dead store elimination passes.
11218
11219 -fdump-rtl-eh
11220 Dump after finalization of EH handling code.
11221
11222 -fdump-rtl-eh_ranges
11223 Dump after conversion of EH handling range regions.
11224
11225 -fdump-rtl-expand
11226 Dump after RTL generation.
11227
11228 -fdump-rtl-fwprop1
11229 -fdump-rtl-fwprop2
11230 -fdump-rtl-fwprop1 and -fdump-rtl-fwprop2 enable dumping after
11231 the two forward propagation passes.
11232
11233 -fdump-rtl-gcse1
11234 -fdump-rtl-gcse2
11235 -fdump-rtl-gcse1 and -fdump-rtl-gcse2 enable dumping after
11236 global common subexpression elimination.
11237
11238 -fdump-rtl-init-regs
11239 Dump after the initialization of the registers.
11240
11241 -fdump-rtl-initvals
11242 Dump after the computation of the initial value sets.
11243
11244 -fdump-rtl-into_cfglayout
11245 Dump after converting to cfglayout mode.
11246
11247 -fdump-rtl-ira
11248 Dump after iterated register allocation.
11249
11250 -fdump-rtl-jump
11251 Dump after the second jump optimization.
11252
11253 -fdump-rtl-loop2
11254 -fdump-rtl-loop2 enables dumping after the rtl loop
11255 optimization passes.
11256
11257 -fdump-rtl-mach
11258 Dump after performing the machine dependent reorganization
11259 pass, if that pass exists.
11260
11261 -fdump-rtl-mode_sw
11262 Dump after removing redundant mode switches.
11263
11264 -fdump-rtl-rnreg
11265 Dump after register renumbering.
11266
11267 -fdump-rtl-outof_cfglayout
11268 Dump after converting from cfglayout mode.
11269
11270 -fdump-rtl-peephole2
11271 Dump after the peephole pass.
11272
11273 -fdump-rtl-postreload
11274 Dump after post-reload optimizations.
11275
11276 -fdump-rtl-pro_and_epilogue
11277 Dump after generating the function prologues and epilogues.
11278
11279 -fdump-rtl-sched1
11280 -fdump-rtl-sched2
11281 -fdump-rtl-sched1 and -fdump-rtl-sched2 enable dumping after
11282 the basic block scheduling passes.
11283
11284 -fdump-rtl-ree
11285 Dump after sign/zero extension elimination.
11286
11287 -fdump-rtl-seqabstr
11288 Dump after common sequence discovery.
11289
11290 -fdump-rtl-shorten
11291 Dump after shortening branches.
11292
11293 -fdump-rtl-sibling
11294 Dump after sibling call optimizations.
11295
11296 -fdump-rtl-split1
11297 -fdump-rtl-split2
11298 -fdump-rtl-split3
11299 -fdump-rtl-split4
11300 -fdump-rtl-split5
11301 These options enable dumping after five rounds of instruction
11302 splitting.
11303
11304 -fdump-rtl-sms
11305 Dump after modulo scheduling. This pass is only run on some
11306 architectures.
11307
11308 -fdump-rtl-stack
11309 Dump after conversion from GCC's "flat register file" registers
11310 to the x87's stack-like registers. This pass is only run on
11311 x86 variants.
11312
11313 -fdump-rtl-subreg1
11314 -fdump-rtl-subreg2
11315 -fdump-rtl-subreg1 and -fdump-rtl-subreg2 enable dumping after
11316 the two subreg expansion passes.
11317
11318 -fdump-rtl-unshare
11319 Dump after all rtl has been unshared.
11320
11321 -fdump-rtl-vartrack
11322 Dump after variable tracking.
11323
11324 -fdump-rtl-vregs
11325 Dump after converting virtual registers to hard registers.
11326
11327 -fdump-rtl-web
11328 Dump after live range splitting.
11329
11330 -fdump-rtl-regclass
11331 -fdump-rtl-subregs_of_mode_init
11332 -fdump-rtl-subregs_of_mode_finish
11333 -fdump-rtl-dfinit
11334 -fdump-rtl-dfinish
11335 These dumps are defined but always produce empty files.
11336
11337 -da
11338 -fdump-rtl-all
11339 Produce all the dumps listed above.
11340
11341 -dA Annotate the assembler output with miscellaneous debugging
11342 information.
11343
11344 -dD Dump all macro definitions, at the end of preprocessing, in
11345 addition to normal output.
11346
11347 -dH Produce a core dump whenever an error occurs.
11348
11349 -dp Annotate the assembler output with a comment indicating which
11350 pattern and alternative is used. The length of each
11351 instruction is also printed.
11352
11353 -dP Dump the RTL in the assembler output as a comment before each
11354 instruction. Also turns on -dp annotation.
11355
11356 -dx Just generate RTL for a function instead of compiling it.
11357 Usually used with -fdump-rtl-expand.
11358
11359 -fdump-noaddr
11360 When doing debugging dumps, suppress address output. This makes it
11361 more feasible to use diff on debugging dumps for compiler
11362 invocations with different compiler binaries and/or different text
11363 / bss / data / heap / stack / dso start locations.
11364
11365 -freport-bug
11366 Collect and dump debug information into a temporary file if an
11367 internal compiler error (ICE) occurs.
11368
11369 -fdump-unnumbered
11370 When doing debugging dumps, suppress instruction numbers and
11371 address output. This makes it more feasible to use diff on
11372 debugging dumps for compiler invocations with different options, in
11373 particular with and without -g.
11374
11375 -fdump-unnumbered-links
11376 When doing debugging dumps (see -d option above), suppress
11377 instruction numbers for the links to the previous and next
11378 instructions in a sequence.
11379
11380 -fdump-translation-unit (C++ only)
11381 -fdump-translation-unit-options (C++ only)
11382 Dump a representation of the tree structure for the entire
11383 translation unit to a file. The file name is made by appending .tu
11384 to the source file name, and the file is created in the same
11385 directory as the output file. If the -options form is used,
11386 options controls the details of the dump as described for the
11387 -fdump-tree options.
11388
11389 -fdump-class-hierarchy (C++ only)
11390 -fdump-class-hierarchy-options (C++ only)
11391 Dump a representation of each class's hierarchy and virtual
11392 function table layout to a file. The file name is made by
11393 appending .class to the source file name, and the file is created
11394 in the same directory as the output file. If the -options form is
11395 used, options controls the details of the dump as described for the
11396 -fdump-tree options.
11397
11398 -fdump-ipa-switch
11399 Control the dumping at various stages of inter-procedural analysis
11400 language tree to a file. The file name is generated by appending a
11401 switch specific suffix to the source file name, and the file is
11402 created in the same directory as the output file. The following
11403 dumps are possible:
11404
11405 all Enables all inter-procedural analysis dumps.
11406
11407 cgraph
11408 Dumps information about call-graph optimization, unused
11409 function removal, and inlining decisions.
11410
11411 inline
11412 Dump after function inlining.
11413
11414 -fdump-passes
11415 Print on stderr the list of optimization passes that are turned on
11416 and off by the current command-line options.
11417
11418 -fdump-statistics-option
11419 Enable and control dumping of pass statistics in a separate file.
11420 The file name is generated by appending a suffix ending in
11421 .statistics to the source file name, and the file is created in the
11422 same directory as the output file. If the -option form is used,
11423 -stats causes counters to be summed over the whole compilation unit
11424 while -details dumps every event as the passes generate them. The
11425 default with no option is to sum counters for each function
11426 compiled.
11427
11428 -fdump-tree-all
11429 -fdump-tree-switch
11430 -fdump-tree-switch-options
11431 -fdump-tree-switch-options=filename
11432 Control the dumping at various stages of processing the
11433 intermediate language tree to a file. The file name is generated
11434 by appending a switch-specific suffix to the source file name, and
11435 the file is created in the same directory as the output file. In
11436 case of =filename option, the dump is output on the given file
11437 instead of the auto named dump files. If the -options form is
11438 used, options is a list of - separated options which control the
11439 details of the dump. Not all options are applicable to all dumps;
11440 those that are not meaningful are ignored. The following options
11441 are available
11442
11443 address
11444 Print the address of each node. Usually this is not meaningful
11445 as it changes according to the environment and source file.
11446 Its primary use is for tying up a dump file with a debug
11447 environment.
11448
11449 asmname
11450 If "DECL_ASSEMBLER_NAME" has been set for a given decl, use
11451 that in the dump instead of "DECL_NAME". Its primary use is
11452 ease of use working backward from mangled names in the assembly
11453 file.
11454
11455 slim
11456 When dumping front-end intermediate representations, inhibit
11457 dumping of members of a scope or body of a function merely
11458 because that scope has been reached. Only dump such items when
11459 they are directly reachable by some other path.
11460
11461 When dumping pretty-printed trees, this option inhibits dumping
11462 the bodies of control structures.
11463
11464 When dumping RTL, print the RTL in slim (condensed) form
11465 instead of the default LISP-like representation.
11466
11467 raw Print a raw representation of the tree. By default, trees are
11468 pretty-printed into a C-like representation.
11469
11470 details
11471 Enable more detailed dumps (not honored by every dump option).
11472 Also include information from the optimization passes.
11473
11474 stats
11475 Enable dumping various statistics about the pass (not honored
11476 by every dump option).
11477
11478 blocks
11479 Enable showing basic block boundaries (disabled in raw dumps).
11480
11481 graph
11482 For each of the other indicated dump files (-fdump-rtl-pass),
11483 dump a representation of the control flow graph suitable for
11484 viewing with GraphViz to file.passid.pass.dot. Each function
11485 in the file is pretty-printed as a subgraph, so that GraphViz
11486 can render them all in a single plot.
11487
11488 This option currently only works for RTL dumps, and the RTL is
11489 always dumped in slim form.
11490
11491 vops
11492 Enable showing virtual operands for every statement.
11493
11494 lineno
11495 Enable showing line numbers for statements.
11496
11497 uid Enable showing the unique ID ("DECL_UID") for each variable.
11498
11499 verbose
11500 Enable showing the tree dump for each statement.
11501
11502 eh Enable showing the EH region number holding each statement.
11503
11504 scev
11505 Enable showing scalar evolution analysis details.
11506
11507 optimized
11508 Enable showing optimization information (only available in
11509 certain passes).
11510
11511 missed
11512 Enable showing missed optimization information (only available
11513 in certain passes).
11514
11515 note
11516 Enable other detailed optimization information (only available
11517 in certain passes).
11518
11519 =filename
11520 Instead of an auto named dump file, output into the given file
11521 name. The file names stdout and stderr are treated specially
11522 and are considered already open standard streams. For example,
11523
11524 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
11525 -fdump-tree-pre=/dev/stderr file.c
11526
11527 outputs vectorizer dump into foo.dump, while the PRE dump is
11528 output on to stderr. If two conflicting dump filenames are
11529 given for the same pass, then the latter option overrides the
11530 earlier one.
11531
11532 all Turn on all options, except raw, slim, verbose and lineno.
11533
11534 optall
11535 Turn on all optimization options, i.e., optimized, missed, and
11536 note.
11537
11538 To determine what tree dumps are available or find the dump for a
11539 pass of interest follow the steps below.
11540
11541 1. Invoke GCC with -fdump-passes and in the stderr output look for
11542 a code that corresponds to the pass you are interested in. For
11543 example, the codes "tree-evrp", "tree-vrp1", and "tree-vrp2"
11544 correspond to the three Value Range Propagation passes. The
11545 number at the end distinguishes distinct invocations of the
11546 same pass.
11547
11548 2. To enable the creation of the dump file, append the pass code
11549 to the -fdump- option prefix and invoke GCC with it. For
11550 example, to enable the dump from the Early Value Range
11551 Propagation pass, invoke GCC with the -fdump-tree-evrp option.
11552 Optionally, you may specify the name of the dump file. If you
11553 don't specify one, GCC creates as described below.
11554
11555 3. Find the pass dump in a file whose name is composed of three
11556 components separated by a period: the name of the source file
11557 GCC was invoked to compile, a numeric suffix indicating the
11558 pass number followed by the letter t for tree passes (and the
11559 letter r for RTL passes), and finally the pass code. For
11560 example, the Early VRP pass dump might be in a file named
11561 myfile.c.038t.evrp in the current working directory. Note that
11562 the numeric codes are not stable and may change from one
11563 version of GCC to another.
11564
11565 -fopt-info
11566 -fopt-info-options
11567 -fopt-info-options=filename
11568 Controls optimization dumps from various optimization passes. If
11569 the -options form is used, options is a list of - separated option
11570 keywords to select the dump details and optimizations.
11571
11572 The options can be divided into two groups: options describing the
11573 verbosity of the dump, and options describing which optimizations
11574 should be included. The options from both the groups can be freely
11575 mixed as they are non-overlapping. However, in case of any
11576 conflicts, the later options override the earlier options on the
11577 command line.
11578
11579 The following options control the dump verbosity:
11580
11581 optimized
11582 Print information when an optimization is successfully applied.
11583 It is up to a pass to decide which information is relevant. For
11584 example, the vectorizer passes print the source location of
11585 loops which are successfully vectorized.
11586
11587 missed
11588 Print information about missed optimizations. Individual passes
11589 control which information to include in the output.
11590
11591 note
11592 Print verbose information about optimizations, such as certain
11593 transformations, more detailed messages about decisions etc.
11594
11595 all Print detailed optimization information. This includes
11596 optimized, missed, and note.
11597
11598 One or more of the following option keywords can be used to
11599 describe a group of optimizations:
11600
11601 ipa Enable dumps from all interprocedural optimizations.
11602
11603 loop
11604 Enable dumps from all loop optimizations.
11605
11606 inline
11607 Enable dumps from all inlining optimizations.
11608
11609 omp Enable dumps from all OMP (Offloading and Multi Processing)
11610 optimizations.
11611
11612 vec Enable dumps from all vectorization optimizations.
11613
11614 optall
11615 Enable dumps from all optimizations. This is a superset of the
11616 optimization groups listed above.
11617
11618 If options is omitted, it defaults to optimized-optall, which means
11619 to dump all info about successful optimizations from all the
11620 passes.
11621
11622 If the filename is provided, then the dumps from all the applicable
11623 optimizations are concatenated into the filename. Otherwise the
11624 dump is output onto stderr. Though multiple -fopt-info options are
11625 accepted, only one of them can include a filename. If other
11626 filenames are provided then all but the first such option are
11627 ignored.
11628
11629 Note that the output filename is overwritten in case of multiple
11630 translation units. If a combined output from multiple translation
11631 units is desired, stderr should be used instead.
11632
11633 In the following example, the optimization info is output to
11634 stderr:
11635
11636 gcc -O3 -fopt-info
11637
11638 This example:
11639
11640 gcc -O3 -fopt-info-missed=missed.all
11641
11642 outputs missed optimization report from all the passes into
11643 missed.all, and this one:
11644
11645 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
11646
11647 prints information about missed optimization opportunities from
11648 vectorization passes on stderr. Note that -fopt-info-vec-missed is
11649 equivalent to -fopt-info-missed-vec.
11650
11651 As another example,
11652
11653 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
11654
11655 outputs information about missed optimizations as well as optimized
11656 locations from all the inlining passes into inline.txt.
11657
11658 Finally, consider:
11659
11660 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
11661
11662 Here the two output filenames vec.miss and loop.opt are in conflict
11663 since only one output file is allowed. In this case, only the first
11664 option takes effect and the subsequent options are ignored. Thus
11665 only vec.miss is produced which contains dumps from the vectorizer
11666 about missed opportunities.
11667
11668 -fsched-verbose=n
11669 On targets that use instruction scheduling, this option controls
11670 the amount of debugging output the scheduler prints to the dump
11671 files.
11672
11673 For n greater than zero, -fsched-verbose outputs the same
11674 information as -fdump-rtl-sched1 and -fdump-rtl-sched2. For n
11675 greater than one, it also output basic block probabilities,
11676 detailed ready list information and unit/insn info. For n greater
11677 than two, it includes RTL at abort point, control-flow and regions
11678 info. And for n over four, -fsched-verbose also includes
11679 dependence info.
11680
11681 -fenable-kind-pass
11682 -fdisable-kind-pass=range-list
11683 This is a set of options that are used to explicitly disable/enable
11684 optimization passes. These options are intended for use for
11685 debugging GCC. Compiler users should use regular options for
11686 enabling/disabling passes instead.
11687
11688 -fdisable-ipa-pass
11689 Disable IPA pass pass. pass is the pass name. If the same pass
11690 is statically invoked in the compiler multiple times, the pass
11691 name should be appended with a sequential number starting from
11692 1.
11693
11694 -fdisable-rtl-pass
11695 -fdisable-rtl-pass=range-list
11696 Disable RTL pass pass. pass is the pass name. If the same
11697 pass is statically invoked in the compiler multiple times, the
11698 pass name should be appended with a sequential number starting
11699 from 1. range-list is a comma-separated list of function
11700 ranges or assembler names. Each range is a number pair
11701 separated by a colon. The range is inclusive in both ends. If
11702 the range is trivial, the number pair can be simplified as a
11703 single number. If the function's call graph node's uid falls
11704 within one of the specified ranges, the pass is disabled for
11705 that function. The uid is shown in the function header of a
11706 dump file, and the pass names can be dumped by using option
11707 -fdump-passes.
11708
11709 -fdisable-tree-pass
11710 -fdisable-tree-pass=range-list
11711 Disable tree pass pass. See -fdisable-rtl for the description
11712 of option arguments.
11713
11714 -fenable-ipa-pass
11715 Enable IPA pass pass. pass is the pass name. If the same pass
11716 is statically invoked in the compiler multiple times, the pass
11717 name should be appended with a sequential number starting from
11718 1.
11719
11720 -fenable-rtl-pass
11721 -fenable-rtl-pass=range-list
11722 Enable RTL pass pass. See -fdisable-rtl for option argument
11723 description and examples.
11724
11725 -fenable-tree-pass
11726 -fenable-tree-pass=range-list
11727 Enable tree pass pass. See -fdisable-rtl for the description
11728 of option arguments.
11729
11730 Here are some examples showing uses of these options.
11731
11732 # disable ccp1 for all functions
11733 -fdisable-tree-ccp1
11734 # disable complete unroll for function whose cgraph node uid is 1
11735 -fenable-tree-cunroll=1
11736 # disable gcse2 for functions at the following ranges [1,1],
11737 # [300,400], and [400,1000]
11738 # disable gcse2 for functions foo and foo2
11739 -fdisable-rtl-gcse2=foo,foo2
11740 # disable early inlining
11741 -fdisable-tree-einline
11742 # disable ipa inlining
11743 -fdisable-ipa-inline
11744 # enable tree full unroll
11745 -fenable-tree-unroll
11746
11747 -fchecking
11748 -fchecking=n
11749 Enable internal consistency checking. The default depends on the
11750 compiler configuration. -fchecking=2 enables further internal
11751 consistency checking that might affect code generation.
11752
11753 -frandom-seed=string
11754 This option provides a seed that GCC uses in place of random
11755 numbers in generating certain symbol names that have to be
11756 different in every compiled file. It is also used to place unique
11757 stamps in coverage data files and the object files that produce
11758 them. You can use the -frandom-seed option to produce reproducibly
11759 identical object files.
11760
11761 The string can either be a number (decimal, octal or hex) or an
11762 arbitrary string (in which case it's converted to a number by
11763 computing CRC32).
11764
11765 The string should be different for every file you compile.
11766
11767 -save-temps
11768 -save-temps=cwd
11769 Store the usual "temporary" intermediate files permanently; place
11770 them in the current directory and name them based on the source
11771 file. Thus, compiling foo.c with -c -save-temps produces files
11772 foo.i and foo.s, as well as foo.o. This creates a preprocessed
11773 foo.i output file even though the compiler now normally uses an
11774 integrated preprocessor.
11775
11776 When used in combination with the -x command-line option,
11777 -save-temps is sensible enough to avoid over writing an input
11778 source file with the same extension as an intermediate file. The
11779 corresponding intermediate file may be obtained by renaming the
11780 source file before using -save-temps.
11781
11782 If you invoke GCC in parallel, compiling several different source
11783 files that share a common base name in different subdirectories or
11784 the same source file compiled for multiple output destinations, it
11785 is likely that the different parallel compilers will interfere with
11786 each other, and overwrite the temporary files. For instance:
11787
11788 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
11789 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
11790
11791 may result in foo.i and foo.o being written to simultaneously by
11792 both compilers.
11793
11794 -save-temps=obj
11795 Store the usual "temporary" intermediate files permanently. If the
11796 -o option is used, the temporary files are based on the object
11797 file. If the -o option is not used, the -save-temps=obj switch
11798 behaves like -save-temps.
11799
11800 For example:
11801
11802 gcc -save-temps=obj -c foo.c
11803 gcc -save-temps=obj -c bar.c -o dir/xbar.o
11804 gcc -save-temps=obj foobar.c -o dir2/yfoobar
11805
11806 creates foo.i, foo.s, dir/xbar.i, dir/xbar.s, dir2/yfoobar.i,
11807 dir2/yfoobar.s, and dir2/yfoobar.o.
11808
11809 -time[=file]
11810 Report the CPU time taken by each subprocess in the compilation
11811 sequence. For C source files, this is the compiler proper and
11812 assembler (plus the linker if linking is done).
11813
11814 Without the specification of an output file, the output looks like
11815 this:
11816
11817 # cc1 0.12 0.01
11818 # as 0.00 0.01
11819
11820 The first number on each line is the "user time", that is time
11821 spent executing the program itself. The second number is "system
11822 time", time spent executing operating system routines on behalf of
11823 the program. Both numbers are in seconds.
11824
11825 With the specification of an output file, the output is appended to
11826 the named file, and it looks like this:
11827
11828 0.12 0.01 cc1 <options>
11829 0.00 0.01 as <options>
11830
11831 The "user time" and the "system time" are moved before the program
11832 name, and the options passed to the program are displayed, so that
11833 one can later tell what file was being compiled, and with which
11834 options.
11835
11836 -fdump-final-insns[=file]
11837 Dump the final internal representation (RTL) to file. If the
11838 optional argument is omitted (or if file is "."), the name of the
11839 dump file is determined by appending ".gkd" to the compilation
11840 output file name.
11841
11842 -fcompare-debug[=opts]
11843 If no error occurs during compilation, run the compiler a second
11844 time, adding opts and -fcompare-debug-second to the arguments
11845 passed to the second compilation. Dump the final internal
11846 representation in both compilations, and print an error if they
11847 differ.
11848
11849 If the equal sign is omitted, the default -gtoggle is used.
11850
11851 The environment variable GCC_COMPARE_DEBUG, if defined, non-empty
11852 and nonzero, implicitly enables -fcompare-debug. If
11853 GCC_COMPARE_DEBUG is defined to a string starting with a dash, then
11854 it is used for opts, otherwise the default -gtoggle is used.
11855
11856 -fcompare-debug=, with the equal sign but without opts, is
11857 equivalent to -fno-compare-debug, which disables the dumping of the
11858 final representation and the second compilation, preventing even
11859 GCC_COMPARE_DEBUG from taking effect.
11860
11861 To verify full coverage during -fcompare-debug testing, set
11862 GCC_COMPARE_DEBUG to say -fcompare-debug-not-overridden, which GCC
11863 rejects as an invalid option in any actual compilation (rather than
11864 preprocessing, assembly or linking). To get just a warning,
11865 setting GCC_COMPARE_DEBUG to -w%n-fcompare-debug not overridden
11866 will do.
11867
11868 -fcompare-debug-second
11869 This option is implicitly passed to the compiler for the second
11870 compilation requested by -fcompare-debug, along with options to
11871 silence warnings, and omitting other options that would cause side-
11872 effect compiler outputs to files or to the standard output. Dump
11873 files and preserved temporary files are renamed so as to contain
11874 the ".gk" additional extension during the second compilation, to
11875 avoid overwriting those generated by the first.
11876
11877 When this option is passed to the compiler driver, it causes the
11878 first compilation to be skipped, which makes it useful for little
11879 other than debugging the compiler proper.
11880
11881 -gtoggle
11882 Turn off generation of debug info, if leaving out this option
11883 generates it, or turn it on at level 2 otherwise. The position of
11884 this argument in the command line does not matter; it takes effect
11885 after all other options are processed, and it does so only once, no
11886 matter how many times it is given. This is mainly intended to be
11887 used with -fcompare-debug.
11888
11889 -fvar-tracking-assignments-toggle
11890 Toggle -fvar-tracking-assignments, in the same way that -gtoggle
11891 toggles -g.
11892
11893 -Q Makes the compiler print out each function name as it is compiled,
11894 and print some statistics about each pass when it finishes.
11895
11896 -ftime-report
11897 Makes the compiler print some statistics about the time consumed by
11898 each pass when it finishes.
11899
11900 -ftime-report-details
11901 Record the time consumed by infrastructure parts separately for
11902 each pass.
11903
11904 -fira-verbose=n
11905 Control the verbosity of the dump file for the integrated register
11906 allocator. The default value is 5. If the value n is greater or
11907 equal to 10, the dump output is sent to stderr using the same
11908 format as n minus 10.
11909
11910 -flto-report
11911 Prints a report with internal details on the workings of the link-
11912 time optimizer. The contents of this report vary from version to
11913 version. It is meant to be useful to GCC developers when
11914 processing object files in LTO mode (via -flto).
11915
11916 Disabled by default.
11917
11918 -flto-report-wpa
11919 Like -flto-report, but only print for the WPA phase of Link Time
11920 Optimization.
11921
11922 -fmem-report
11923 Makes the compiler print some statistics about permanent memory
11924 allocation when it finishes.
11925
11926 -fmem-report-wpa
11927 Makes the compiler print some statistics about permanent memory
11928 allocation for the WPA phase only.
11929
11930 -fpre-ipa-mem-report
11931 -fpost-ipa-mem-report
11932 Makes the compiler print some statistics about permanent memory
11933 allocation before or after interprocedural optimization.
11934
11935 -fprofile-report
11936 Makes the compiler print some statistics about consistency of the
11937 (estimated) profile and effect of individual passes.
11938
11939 -fstack-usage
11940 Makes the compiler output stack usage information for the program,
11941 on a per-function basis. The filename for the dump is made by
11942 appending .su to the auxname. auxname is generated from the name
11943 of the output file, if explicitly specified and it is not an
11944 executable, otherwise it is the basename of the source file. An
11945 entry is made up of three fields:
11946
11947 * The name of the function.
11948
11949 * A number of bytes.
11950
11951 * One or more qualifiers: "static", "dynamic", "bounded".
11952
11953 The qualifier "static" means that the function manipulates the
11954 stack statically: a fixed number of bytes are allocated for the
11955 frame on function entry and released on function exit; no stack
11956 adjustments are otherwise made in the function. The second field
11957 is this fixed number of bytes.
11958
11959 The qualifier "dynamic" means that the function manipulates the
11960 stack dynamically: in addition to the static allocation described
11961 above, stack adjustments are made in the body of the function, for
11962 example to push/pop arguments around function calls. If the
11963 qualifier "bounded" is also present, the amount of these
11964 adjustments is bounded at compile time and the second field is an
11965 upper bound of the total amount of stack used by the function. If
11966 it is not present, the amount of these adjustments is not bounded
11967 at compile time and the second field only represents the bounded
11968 part.
11969
11970 -fstats
11971 Emit statistics about front-end processing at the end of the
11972 compilation. This option is supported only by the C++ front end,
11973 and the information is generally only useful to the G++ development
11974 team.
11975
11976 -fdbg-cnt-list
11977 Print the name and the counter upper bound for all debug counters.
11978
11979 -fdbg-cnt=counter-value-list
11980 Set the internal debug counter upper bound. counter-value-list is
11981 a comma-separated list of name:value pairs which sets the upper
11982 bound of each debug counter name to value. All debug counters have
11983 the initial upper bound of "UINT_MAX"; thus "dbg_cnt" returns true
11984 always unless the upper bound is set by this option. For example,
11985 with -fdbg-cnt=dce:10,tail_call:0, "dbg_cnt(dce)" returns true only
11986 for first 10 invocations.
11987
11988 -print-file-name=library
11989 Print the full absolute name of the library file library that would
11990 be used when linking---and don't do anything else. With this
11991 option, GCC does not compile or link anything; it just prints the
11992 file name.
11993
11994 -print-multi-directory
11995 Print the directory name corresponding to the multilib selected by
11996 any other switches present in the command line. This directory is
11997 supposed to exist in GCC_EXEC_PREFIX.
11998
11999 -print-multi-lib
12000 Print the mapping from multilib directory names to compiler
12001 switches that enable them. The directory name is separated from
12002 the switches by ;, and each switch starts with an @ instead of the
12003 -, without spaces between multiple switches. This is supposed to
12004 ease shell processing.
12005
12006 -print-multi-os-directory
12007 Print the path to OS libraries for the selected multilib, relative
12008 to some lib subdirectory. If OS libraries are present in the lib
12009 subdirectory and no multilibs are used, this is usually just ., if
12010 OS libraries are present in libsuffix sibling directories this
12011 prints e.g. ../lib64, ../lib or ../lib32, or if OS libraries are
12012 present in lib/subdir subdirectories it prints e.g. amd64, sparcv9
12013 or ev6.
12014
12015 -print-multiarch
12016 Print the path to OS libraries for the selected multiarch, relative
12017 to some lib subdirectory.
12018
12019 -print-prog-name=program
12020 Like -print-file-name, but searches for a program such as cpp.
12021
12022 -print-libgcc-file-name
12023 Same as -print-file-name=libgcc.a.
12024
12025 This is useful when you use -nostdlib or -nodefaultlibs but you do
12026 want to link with libgcc.a. You can do:
12027
12028 gcc -nostdlib <files>... `gcc -print-libgcc-file-name`
12029
12030 -print-search-dirs
12031 Print the name of the configured installation directory and a list
12032 of program and library directories gcc searches---and don't do
12033 anything else.
12034
12035 This is useful when gcc prints the error message installation
12036 problem, cannot exec cpp0: No such file or directory. To resolve
12037 this you either need to put cpp0 and the other compiler components
12038 where gcc expects to find them, or you can set the environment
12039 variable GCC_EXEC_PREFIX to the directory where you installed them.
12040 Don't forget the trailing /.
12041
12042 -print-sysroot
12043 Print the target sysroot directory that is used during compilation.
12044 This is the target sysroot specified either at configure time or
12045 using the --sysroot option, possibly with an extra suffix that
12046 depends on compilation options. If no target sysroot is specified,
12047 the option prints nothing.
12048
12049 -print-sysroot-headers-suffix
12050 Print the suffix added to the target sysroot when searching for
12051 headers, or give an error if the compiler is not configured with
12052 such a suffix---and don't do anything else.
12053
12054 -dumpmachine
12055 Print the compiler's target machine (for example,
12056 i686-pc-linux-gnu)---and don't do anything else.
12057
12058 -dumpversion
12059 Print the compiler version (for example, 3.0, 6.3.0 or 7)---and
12060 don't do anything else. This is the compiler version used in
12061 filesystem paths, specs, can be depending on how the compiler has
12062 been configured just a single number (major version), two numbers
12063 separated by dot (major and minor version) or three numbers
12064 separated by dots (major, minor and patchlevel version).
12065
12066 -dumpfullversion
12067 Print the full compiler version, always 3 numbers separated by
12068 dots, major, minor and patchlevel version.
12069
12070 -dumpspecs
12071 Print the compiler's built-in specs---and don't do anything else.
12072 (This is used when GCC itself is being built.)
12073
12074 Machine-Dependent Options
12075 Each target machine supported by GCC can have its own options---for
12076 example, to allow you to compile for a particular processor variant or
12077 ABI, or to control optimizations specific to that machine. By
12078 convention, the names of machine-specific options start with -m.
12079
12080 Some configurations of the compiler also support additional target-
12081 specific options, usually for compatibility with other compilers on the
12082 same platform.
12083
12084 AArch64 Options
12085
12086 These options are defined for AArch64 implementations:
12087
12088 -mabi=name
12089 Generate code for the specified data model. Permissible values are
12090 ilp32 for SysV-like data model where int, long int and pointers are
12091 32 bits, and lp64 for SysV-like data model where int is 32 bits,
12092 but long int and pointers are 64 bits.
12093
12094 The default depends on the specific target configuration. Note
12095 that the LP64 and ILP32 ABIs are not link-compatible; you must
12096 compile your entire program with the same ABI, and link with a
12097 compatible set of libraries.
12098
12099 -mbig-endian
12100 Generate big-endian code. This is the default when GCC is
12101 configured for an aarch64_be-*-* target.
12102
12103 -mgeneral-regs-only
12104 Generate code which uses only the general-purpose registers. This
12105 will prevent the compiler from using floating-point and Advanced
12106 SIMD registers but will not impose any restrictions on the
12107 assembler.
12108
12109 -mlittle-endian
12110 Generate little-endian code. This is the default when GCC is
12111 configured for an aarch64-*-* but not an aarch64_be-*-* target.
12112
12113 -mcmodel=tiny
12114 Generate code for the tiny code model. The program and its
12115 statically defined symbols must be within 1MB of each other.
12116 Programs can be statically or dynamically linked.
12117
12118 -mcmodel=small
12119 Generate code for the small code model. The program and its
12120 statically defined symbols must be within 4GB of each other.
12121 Programs can be statically or dynamically linked. This is the
12122 default code model.
12123
12124 -mcmodel=large
12125 Generate code for the large code model. This makes no assumptions
12126 about addresses and sizes of sections. Programs can be statically
12127 linked only.
12128
12129 -mstrict-align
12130 Avoid generating memory accesses that may not be aligned on a
12131 natural object boundary as described in the architecture
12132 specification.
12133
12134 -momit-leaf-frame-pointer
12135 -mno-omit-leaf-frame-pointer
12136 Omit or keep the frame pointer in leaf functions. The former
12137 behavior is the default.
12138
12139 -mtls-dialect=desc
12140 Use TLS descriptors as the thread-local storage mechanism for
12141 dynamic accesses of TLS variables. This is the default.
12142
12143 -mtls-dialect=traditional
12144 Use traditional TLS as the thread-local storage mechanism for
12145 dynamic accesses of TLS variables.
12146
12147 -mtls-size=size
12148 Specify bit size of immediate TLS offsets. Valid values are 12,
12149 24, 32, 48. This option requires binutils 2.26 or newer.
12150
12151 -mfix-cortex-a53-835769
12152 -mno-fix-cortex-a53-835769
12153 Enable or disable the workaround for the ARM Cortex-A53 erratum
12154 number 835769. This involves inserting a NOP instruction between
12155 memory instructions and 64-bit integer multiply-accumulate
12156 instructions.
12157
12158 -mfix-cortex-a53-843419
12159 -mno-fix-cortex-a53-843419
12160 Enable or disable the workaround for the ARM Cortex-A53 erratum
12161 number 843419. This erratum workaround is made at link time and
12162 this will only pass the corresponding flag to the linker.
12163
12164 -mlow-precision-recip-sqrt
12165 -mno-low-precision-recip-sqrt
12166 Enable or disable the reciprocal square root approximation. This
12167 option only has an effect if -ffast-math or
12168 -funsafe-math-optimizations is used as well. Enabling this reduces
12169 precision of reciprocal square root results to about 16 bits for
12170 single precision and to 32 bits for double precision.
12171
12172 -mlow-precision-sqrt
12173 -mno-low-precision-sqrt
12174 Enable or disable the square root approximation. This option only
12175 has an effect if -ffast-math or -funsafe-math-optimizations is used
12176 as well. Enabling this reduces precision of square root results to
12177 about 16 bits for single precision and to 32 bits for double
12178 precision. If enabled, it implies -mlow-precision-recip-sqrt.
12179
12180 -mlow-precision-div
12181 -mno-low-precision-div
12182 Enable or disable the division approximation. This option only has
12183 an effect if -ffast-math or -funsafe-math-optimizations is used as
12184 well. Enabling this reduces precision of division results to about
12185 16 bits for single precision and to 32 bits for double precision.
12186
12187 -march=name
12188 Specify the name of the target architecture and, optionally, one or
12189 more feature modifiers. This option has the form
12190 -march=arch{+[no]feature}*.
12191
12192 The permissible values for arch are armv8-a, armv8.1-a, armv8.2-a,
12193 armv8.3-a or native.
12194
12195 The value armv8.3-a implies armv8.2-a and enables compiler support
12196 for the ARMv8.3-A architecture extensions.
12197
12198 The value armv8.2-a implies armv8.1-a and enables compiler support
12199 for the ARMv8.2-A architecture extensions.
12200
12201 The value armv8.1-a implies armv8-a and enables compiler support
12202 for the ARMv8.1-A architecture extension. In particular, it
12203 enables the +crc and +lse features.
12204
12205 The value native is available on native AArch64 GNU/Linux and
12206 causes the compiler to pick the architecture of the host system.
12207 This option has no effect if the compiler is unable to recognize
12208 the architecture of the host system,
12209
12210 The permissible values for feature are listed in the sub-section on
12211 aarch64-feature-modifiers,,-march and -mcpu Feature Modifiers.
12212 Where conflicting feature modifiers are specified, the right-most
12213 feature is used.
12214
12215 GCC uses name to determine what kind of instructions it can emit
12216 when generating assembly code. If -march is specified without
12217 either of -mtune or -mcpu also being specified, the code is tuned
12218 to perform well across a range of target processors implementing
12219 the target architecture.
12220
12221 -mtune=name
12222 Specify the name of the target processor for which GCC should tune
12223 the performance of the code. Permissible values for this option
12224 are: generic, cortex-a35, cortex-a53, cortex-a57, cortex-a72,
12225 cortex-a73, exynos-m1, falkor, qdf24xx, xgene1, vulcan, thunderx,
12226 thunderxt88, thunderxt88p1, thunderxt81, thunderxt83, thunderx2t99,
12227 cortex-a57.cortex-a53, cortex-a72.cortex-a53,
12228 cortex-a73.cortex-a35, cortex-a73.cortex-a53, native.
12229
12230 The values cortex-a57.cortex-a53, cortex-a72.cortex-a53,
12231 cortex-a73.cortex-a35, cortex-a73.cortex-a53 specify that GCC
12232 should tune for a big.LITTLE system.
12233
12234 Additionally on native AArch64 GNU/Linux systems the value native
12235 tunes performance to the host system. This option has no effect if
12236 the compiler is unable to recognize the processor of the host
12237 system.
12238
12239 Where none of -mtune=, -mcpu= or -march= are specified, the code is
12240 tuned to perform well across a range of target processors.
12241
12242 This option cannot be suffixed by feature modifiers.
12243
12244 -mcpu=name
12245 Specify the name of the target processor, optionally suffixed by
12246 one or more feature modifiers. This option has the form
12247 -mcpu=cpu{+[no]feature}*, where the permissible values for cpu are
12248 the same as those available for -mtune. The permissible values for
12249 feature are documented in the sub-section on
12250 aarch64-feature-modifiers,,-march and -mcpu Feature Modifiers.
12251 Where conflicting feature modifiers are specified, the right-most
12252 feature is used.
12253
12254 GCC uses name to determine what kind of instructions it can emit
12255 when generating assembly code (as if by -march) and to determine
12256 the target processor for which to tune for performance (as if by
12257 -mtune). Where this option is used in conjunction with -march or
12258 -mtune, those options take precedence over the appropriate part of
12259 this option.
12260
12261 -moverride=string
12262 Override tuning decisions made by the back-end in response to a
12263 -mtune= switch. The syntax, semantics, and accepted values for
12264 string in this option are not guaranteed to be consistent across
12265 releases.
12266
12267 This option is only intended to be useful when developing GCC.
12268
12269 -mpc-relative-literal-loads
12270 Enable PC-relative literal loads. With this option literal pools
12271 are accessed using a single instruction and emitted after each
12272 function. This limits the maximum size of functions to 1MB. This
12273 is enabled by default for -mcmodel=tiny.
12274
12275 -msign-return-address=scope
12276 Select the function scope on which return address signing will be
12277 applied. Permissible values are none, which disables return
12278 address signing, non-leaf, which enables pointer signing for
12279 functions which are not leaf functions, and all, which enables
12280 pointer signing for all functions. The default value is none.
12281
12282 -march and -mcpu Feature Modifiers
12283
12284 Feature modifiers used with -march and -mcpu can be any of the
12285 following and their inverses nofeature:
12286
12287 crc Enable CRC extension. This is on by default for -march=armv8.1-a.
12288
12289 crypto
12290 Enable Crypto extension. This also enables Advanced SIMD and
12291 floating-point instructions.
12292
12293 fp Enable floating-point instructions. This is on by default for all
12294 possible values for options -march and -mcpu.
12295
12296 simd
12297 Enable Advanced SIMD instructions. This also enables floating-
12298 point instructions. This is on by default for all possible values
12299 for options -march and -mcpu.
12300
12301 lse Enable Large System Extension instructions. This is on by default
12302 for -march=armv8.1-a.
12303
12304 fp16
12305 Enable FP16 extension. This also enables floating-point
12306 instructions.
12307
12308 Feature crypto implies simd, which implies fp. Conversely, nofp
12309 implies nosimd, which implies nocrypto.
12310
12311 Adapteva Epiphany Options
12312
12313 These -m options are defined for Adapteva Epiphany:
12314
12315 -mhalf-reg-file
12316 Don't allocate any register in the range "r32"..."r63". That
12317 allows code to run on hardware variants that lack these registers.
12318
12319 -mprefer-short-insn-regs
12320 Preferentially allocate registers that allow short instruction
12321 generation. This can result in increased instruction count, so
12322 this may either reduce or increase overall code size.
12323
12324 -mbranch-cost=num
12325 Set the cost of branches to roughly num "simple" instructions.
12326 This cost is only a heuristic and is not guaranteed to produce
12327 consistent results across releases.
12328
12329 -mcmove
12330 Enable the generation of conditional moves.
12331
12332 -mnops=num
12333 Emit num NOPs before every other generated instruction.
12334
12335 -mno-soft-cmpsf
12336 For single-precision floating-point comparisons, emit an "fsub"
12337 instruction and test the flags. This is faster than a software
12338 comparison, but can get incorrect results in the presence of NaNs,
12339 or when two different small numbers are compared such that their
12340 difference is calculated as zero. The default is -msoft-cmpsf,
12341 which uses slower, but IEEE-compliant, software comparisons.
12342
12343 -mstack-offset=num
12344 Set the offset between the top of the stack and the stack pointer.
12345 E.g., a value of 8 means that the eight bytes in the range
12346 "sp+0...sp+7" can be used by leaf functions without stack
12347 allocation. Values other than 8 or 16 are untested and unlikely to
12348 work. Note also that this option changes the ABI; compiling a
12349 program with a different stack offset than the libraries have been
12350 compiled with generally does not work. This option can be useful
12351 if you want to evaluate if a different stack offset would give you
12352 better code, but to actually use a different stack offset to build
12353 working programs, it is recommended to configure the toolchain with
12354 the appropriate --with-stack-offset=num option.
12355
12356 -mno-round-nearest
12357 Make the scheduler assume that the rounding mode has been set to
12358 truncating. The default is -mround-nearest.
12359
12360 -mlong-calls
12361 If not otherwise specified by an attribute, assume all calls might
12362 be beyond the offset range of the "b" / "bl" instructions, and
12363 therefore load the function address into a register before
12364 performing a (otherwise direct) call. This is the default.
12365
12366 -mshort-calls
12367 If not otherwise specified by an attribute, assume all direct calls
12368 are in the range of the "b" / "bl" instructions, so use these
12369 instructions for direct calls. The default is -mlong-calls.
12370
12371 -msmall16
12372 Assume addresses can be loaded as 16-bit unsigned values. This
12373 does not apply to function addresses for which -mlong-calls
12374 semantics are in effect.
12375
12376 -mfp-mode=mode
12377 Set the prevailing mode of the floating-point unit. This
12378 determines the floating-point mode that is provided and expected at
12379 function call and return time. Making this mode match the mode you
12380 predominantly need at function start can make your programs smaller
12381 and faster by avoiding unnecessary mode switches.
12382
12383 mode can be set to one the following values:
12384
12385 caller
12386 Any mode at function entry is valid, and retained or restored
12387 when the function returns, and when it calls other functions.
12388 This mode is useful for compiling libraries or other
12389 compilation units you might want to incorporate into different
12390 programs with different prevailing FPU modes, and the
12391 convenience of being able to use a single object file outweighs
12392 the size and speed overhead for any extra mode switching that
12393 might be needed, compared with what would be needed with a more
12394 specific choice of prevailing FPU mode.
12395
12396 truncate
12397 This is the mode used for floating-point calculations with
12398 truncating (i.e. round towards zero) rounding mode. That
12399 includes conversion from floating point to integer.
12400
12401 round-nearest
12402 This is the mode used for floating-point calculations with
12403 round-to-nearest-or-even rounding mode.
12404
12405 int This is the mode used to perform integer calculations in the
12406 FPU, e.g. integer multiply, or integer multiply-and-
12407 accumulate.
12408
12409 The default is -mfp-mode=caller
12410
12411 -mnosplit-lohi
12412 -mno-postinc
12413 -mno-postmodify
12414 Code generation tweaks that disable, respectively, splitting of
12415 32-bit loads, generation of post-increment addresses, and
12416 generation of post-modify addresses. The defaults are msplit-lohi,
12417 -mpost-inc, and -mpost-modify.
12418
12419 -mnovect-double
12420 Change the preferred SIMD mode to SImode. The default is
12421 -mvect-double, which uses DImode as preferred SIMD mode.
12422
12423 -max-vect-align=num
12424 The maximum alignment for SIMD vector mode types. num may be 4 or
12425 8. The default is 8. Note that this is an ABI change, even though
12426 many library function interfaces are unaffected if they don't use
12427 SIMD vector modes in places that affect size and/or alignment of
12428 relevant types.
12429
12430 -msplit-vecmove-early
12431 Split vector moves into single word moves before reload. In theory
12432 this can give better register allocation, but so far the reverse
12433 seems to be generally the case.
12434
12435 -m1reg-reg
12436 Specify a register to hold the constant -1, which makes loading
12437 small negative constants and certain bitmasks faster. Allowable
12438 values for reg are r43 and r63, which specify use of that register
12439 as a fixed register, and none, which means that no register is used
12440 for this purpose. The default is -m1reg-none.
12441
12442 ARC Options
12443
12444 The following options control the architecture variant for which code
12445 is being compiled:
12446
12447 -mbarrel-shifter
12448 Generate instructions supported by barrel shifter. This is the
12449 default unless -mcpu=ARC601 or -mcpu=ARCEM is in effect.
12450
12451 -mcpu=cpu
12452 Set architecture type, register usage, and instruction scheduling
12453 parameters for cpu. There are also shortcut alias options
12454 available for backward compatibility and convenience. Supported
12455 values for cpu are
12456
12457 arc600
12458 Compile for ARC600. Aliases: -mA6, -mARC600.
12459
12460 arc601
12461 Compile for ARC601. Alias: -mARC601.
12462
12463 arc700
12464 Compile for ARC700. Aliases: -mA7, -mARC700. This is the
12465 default when configured with --with-cpu=arc700.
12466
12467 arcem
12468 Compile for ARC EM.
12469
12470 archs
12471 Compile for ARC HS.
12472
12473 em Compile for ARC EM CPU with no hardware extensions.
12474
12475 em4 Compile for ARC EM4 CPU.
12476
12477 em4_dmips
12478 Compile for ARC EM4 DMIPS CPU.
12479
12480 em4_fpus
12481 Compile for ARC EM4 DMIPS CPU with the single-precision
12482 floating-point extension.
12483
12484 em4_fpuda
12485 Compile for ARC EM4 DMIPS CPU with single-precision floating-
12486 point and double assist instructions.
12487
12488 hs Compile for ARC HS CPU with no hardware extensions except the
12489 atomic instructions.
12490
12491 hs34
12492 Compile for ARC HS34 CPU.
12493
12494 hs38
12495 Compile for ARC HS38 CPU.
12496
12497 hs38_linux
12498 Compile for ARC HS38 CPU with all hardware extensions on.
12499
12500 arc600_norm
12501 Compile for ARC 600 CPU with "norm" instructions enabled.
12502
12503 arc600_mul32x16
12504 Compile for ARC 600 CPU with "norm" and 32x16-bit multiply
12505 instructions enabled.
12506
12507 arc600_mul64
12508 Compile for ARC 600 CPU with "norm" and "mul64"-family
12509 instructions enabled.
12510
12511 arc601_norm
12512 Compile for ARC 601 CPU with "norm" instructions enabled.
12513
12514 arc601_mul32x16
12515 Compile for ARC 601 CPU with "norm" and 32x16-bit multiply
12516 instructions enabled.
12517
12518 arc601_mul64
12519 Compile for ARC 601 CPU with "norm" and "mul64"-family
12520 instructions enabled.
12521
12522 nps400
12523 Compile for ARC 700 on NPS400 chip.
12524
12525 -mdpfp
12526 -mdpfp-compact
12527 Generate double-precision FPX instructions, tuned for the compact
12528 implementation.
12529
12530 -mdpfp-fast
12531 Generate double-precision FPX instructions, tuned for the fast
12532 implementation.
12533
12534 -mno-dpfp-lrsr
12535 Disable "lr" and "sr" instructions from using FPX extension aux
12536 registers.
12537
12538 -mea
12539 Generate extended arithmetic instructions. Currently only "divaw",
12540 "adds", "subs", and "sat16" are supported. This is always enabled
12541 for -mcpu=ARC700.
12542
12543 -mno-mpy
12544 Do not generate "mpy"-family instructions for ARC700. This option
12545 is deprecated.
12546
12547 -mmul32x16
12548 Generate 32x16-bit multiply and multiply-accumulate instructions.
12549
12550 -mmul64
12551 Generate "mul64" and "mulu64" instructions. Only valid for
12552 -mcpu=ARC600.
12553
12554 -mnorm
12555 Generate "norm" instructions. This is the default if -mcpu=ARC700
12556 is in effect.
12557
12558 -mspfp
12559 -mspfp-compact
12560 Generate single-precision FPX instructions, tuned for the compact
12561 implementation.
12562
12563 -mspfp-fast
12564 Generate single-precision FPX instructions, tuned for the fast
12565 implementation.
12566
12567 -msimd
12568 Enable generation of ARC SIMD instructions via target-specific
12569 builtins. Only valid for -mcpu=ARC700.
12570
12571 -msoft-float
12572 This option ignored; it is provided for compatibility purposes
12573 only. Software floating-point code is emitted by default, and this
12574 default can overridden by FPX options; -mspfp, -mspfp-compact, or
12575 -mspfp-fast for single precision, and -mdpfp, -mdpfp-compact, or
12576 -mdpfp-fast for double precision.
12577
12578 -mswap
12579 Generate "swap" instructions.
12580
12581 -matomic
12582 This enables use of the locked load/store conditional extension to
12583 implement atomic memory built-in functions. Not available for ARC
12584 6xx or ARC EM cores.
12585
12586 -mdiv-rem
12587 Enable "div" and "rem" instructions for ARCv2 cores.
12588
12589 -mcode-density
12590 Enable code density instructions for ARC EM. This option is on by
12591 default for ARC HS.
12592
12593 -mll64
12594 Enable double load/store operations for ARC HS cores.
12595
12596 -mtp-regno=regno
12597 Specify thread pointer register number.
12598
12599 -mmpy-option=multo
12600 Compile ARCv2 code with a multiplier design option. You can
12601 specify the option using either a string or numeric value for
12602 multo. wlh1 is the default value. The recognized values are:
12603
12604 0
12605 none
12606 No multiplier available.
12607
12608 1
12609 w 16x16 multiplier, fully pipelined. The following instructions
12610 are enabled: "mpyw" and "mpyuw".
12611
12612 2
12613 wlh1
12614 32x32 multiplier, fully pipelined (1 stage). The following
12615 instructions are additionally enabled: "mpy", "mpyu", "mpym",
12616 "mpymu", and "mpy_s".
12617
12618 3
12619 wlh2
12620 32x32 multiplier, fully pipelined (2 stages). The following
12621 instructions are additionally enabled: "mpy", "mpyu", "mpym",
12622 "mpymu", and "mpy_s".
12623
12624 4
12625 wlh3
12626 Two 16x16 multipliers, blocking, sequential. The following
12627 instructions are additionally enabled: "mpy", "mpyu", "mpym",
12628 "mpymu", and "mpy_s".
12629
12630 5
12631 wlh4
12632 One 16x16 multiplier, blocking, sequential. The following
12633 instructions are additionally enabled: "mpy", "mpyu", "mpym",
12634 "mpymu", and "mpy_s".
12635
12636 6
12637 wlh5
12638 One 32x4 multiplier, blocking, sequential. The following
12639 instructions are additionally enabled: "mpy", "mpyu", "mpym",
12640 "mpymu", and "mpy_s".
12641
12642 7
12643 plus_dmpy
12644 ARC HS SIMD support.
12645
12646 8
12647 plus_macd
12648 ARC HS SIMD support.
12649
12650 9
12651 plus_qmacw
12652 ARC HS SIMD support.
12653
12654 This option is only available for ARCv2 cores.
12655
12656 -mfpu=fpu
12657 Enables support for specific floating-point hardware extensions for
12658 ARCv2 cores. Supported values for fpu are:
12659
12660 fpus
12661 Enables support for single-precision floating-point hardware
12662 extensions.
12663
12664 fpud
12665 Enables support for double-precision floating-point hardware
12666 extensions. The single-precision floating-point extension is
12667 also enabled. Not available for ARC EM.
12668
12669 fpuda
12670 Enables support for double-precision floating-point hardware
12671 extensions using double-precision assist instructions. The
12672 single-precision floating-point extension is also enabled.
12673 This option is only available for ARC EM.
12674
12675 fpuda_div
12676 Enables support for double-precision floating-point hardware
12677 extensions using double-precision assist instructions. The
12678 single-precision floating-point, square-root, and divide
12679 extensions are also enabled. This option is only available for
12680 ARC EM.
12681
12682 fpuda_fma
12683 Enables support for double-precision floating-point hardware
12684 extensions using double-precision assist instructions. The
12685 single-precision floating-point and fused multiply and add
12686 hardware extensions are also enabled. This option is only
12687 available for ARC EM.
12688
12689 fpuda_all
12690 Enables support for double-precision floating-point hardware
12691 extensions using double-precision assist instructions. All
12692 single-precision floating-point hardware extensions are also
12693 enabled. This option is only available for ARC EM.
12694
12695 fpus_div
12696 Enables support for single-precision floating-point, square-
12697 root and divide hardware extensions.
12698
12699 fpud_div
12700 Enables support for double-precision floating-point, square-
12701 root and divide hardware extensions. This option includes
12702 option fpus_div. Not available for ARC EM.
12703
12704 fpus_fma
12705 Enables support for single-precision floating-point and fused
12706 multiply and add hardware extensions.
12707
12708 fpud_fma
12709 Enables support for double-precision floating-point and fused
12710 multiply and add hardware extensions. This option includes
12711 option fpus_fma. Not available for ARC EM.
12712
12713 fpus_all
12714 Enables support for all single-precision floating-point
12715 hardware extensions.
12716
12717 fpud_all
12718 Enables support for all single- and double-precision floating-
12719 point hardware extensions. Not available for ARC EM.
12720
12721 The following options are passed through to the assembler, and also
12722 define preprocessor macro symbols.
12723
12724 -mdsp-packa
12725 Passed down to the assembler to enable the DSP Pack A extensions.
12726 Also sets the preprocessor symbol "__Xdsp_packa". This option is
12727 deprecated.
12728
12729 -mdvbf
12730 Passed down to the assembler to enable the dual Viterbi butterfly
12731 extension. Also sets the preprocessor symbol "__Xdvbf". This
12732 option is deprecated.
12733
12734 -mlock
12735 Passed down to the assembler to enable the locked load/store
12736 conditional extension. Also sets the preprocessor symbol
12737 "__Xlock".
12738
12739 -mmac-d16
12740 Passed down to the assembler. Also sets the preprocessor symbol
12741 "__Xxmac_d16". This option is deprecated.
12742
12743 -mmac-24
12744 Passed down to the assembler. Also sets the preprocessor symbol
12745 "__Xxmac_24". This option is deprecated.
12746
12747 -mrtsc
12748 Passed down to the assembler to enable the 64-bit time-stamp
12749 counter extension instruction. Also sets the preprocessor symbol
12750 "__Xrtsc". This option is deprecated.
12751
12752 -mswape
12753 Passed down to the assembler to enable the swap byte ordering
12754 extension instruction. Also sets the preprocessor symbol
12755 "__Xswape".
12756
12757 -mtelephony
12758 Passed down to the assembler to enable dual- and single-operand
12759 instructions for telephony. Also sets the preprocessor symbol
12760 "__Xtelephony". This option is deprecated.
12761
12762 -mxy
12763 Passed down to the assembler to enable the XY memory extension.
12764 Also sets the preprocessor symbol "__Xxy".
12765
12766 The following options control how the assembly code is annotated:
12767
12768 -misize
12769 Annotate assembler instructions with estimated addresses.
12770
12771 -mannotate-align
12772 Explain what alignment considerations lead to the decision to make
12773 an instruction short or long.
12774
12775 The following options are passed through to the linker:
12776
12777 -marclinux
12778 Passed through to the linker, to specify use of the "arclinux"
12779 emulation. This option is enabled by default in tool chains built
12780 for "arc-linux-uclibc" and "arceb-linux-uclibc" targets when
12781 profiling is not requested.
12782
12783 -marclinux_prof
12784 Passed through to the linker, to specify use of the "arclinux_prof"
12785 emulation. This option is enabled by default in tool chains built
12786 for "arc-linux-uclibc" and "arceb-linux-uclibc" targets when
12787 profiling is requested.
12788
12789 The following options control the semantics of generated code:
12790
12791 -mlong-calls
12792 Generate calls as register indirect calls, thus providing access to
12793 the full 32-bit address range.
12794
12795 -mmedium-calls
12796 Don't use less than 25-bit addressing range for calls, which is the
12797 offset available for an unconditional branch-and-link instruction.
12798 Conditional execution of function calls is suppressed, to allow use
12799 of the 25-bit range, rather than the 21-bit range with conditional
12800 branch-and-link. This is the default for tool chains built for
12801 "arc-linux-uclibc" and "arceb-linux-uclibc" targets.
12802
12803 -mno-sdata
12804 Do not generate sdata references. This is the default for tool
12805 chains built for "arc-linux-uclibc" and "arceb-linux-uclibc"
12806 targets.
12807
12808 -mvolatile-cache
12809 Use ordinarily cached memory accesses for volatile references.
12810 This is the default.
12811
12812 -mno-volatile-cache
12813 Enable cache bypass for volatile references.
12814
12815 The following options fine tune code generation:
12816
12817 -malign-call
12818 Do alignment optimizations for call instructions.
12819
12820 -mauto-modify-reg
12821 Enable the use of pre/post modify with register displacement.
12822
12823 -mbbit-peephole
12824 Enable bbit peephole2.
12825
12826 -mno-brcc
12827 This option disables a target-specific pass in arc_reorg to
12828 generate compare-and-branch ("brcc") instructions. It has no
12829 effect on generation of these instructions driven by the combiner
12830 pass.
12831
12832 -mcase-vector-pcrel
12833 Use PC-relative switch case tables to enable case table shortening.
12834 This is the default for -Os.
12835
12836 -mcompact-casesi
12837 Enable compact "casesi" pattern. This is the default for -Os, and
12838 only available for ARCv1 cores.
12839
12840 -mno-cond-exec
12841 Disable the ARCompact-specific pass to generate conditional
12842 execution instructions.
12843
12844 Due to delay slot scheduling and interactions between operand
12845 numbers, literal sizes, instruction lengths, and the support for
12846 conditional execution, the target-independent pass to generate
12847 conditional execution is often lacking, so the ARC port has kept a
12848 special pass around that tries to find more conditional execution
12849 generation opportunities after register allocation, branch
12850 shortening, and delay slot scheduling have been done. This pass
12851 generally, but not always, improves performance and code size, at
12852 the cost of extra compilation time, which is why there is an option
12853 to switch it off. If you have a problem with call instructions
12854 exceeding their allowable offset range because they are
12855 conditionalized, you should consider using -mmedium-calls instead.
12856
12857 -mearly-cbranchsi
12858 Enable pre-reload use of the "cbranchsi" pattern.
12859
12860 -mexpand-adddi
12861 Expand "adddi3" and "subdi3" at RTL generation time into "add.f",
12862 "adc" etc.
12863
12864 -mindexed-loads
12865 Enable the use of indexed loads. This can be problematic because
12866 some optimizers then assume that indexed stores exist, which is not
12867 the case.
12868
12869 Enable Local Register Allocation. This is still experimental for
12870 ARC, so by default the compiler uses standard reload (i.e.
12871 -mno-lra).
12872
12873 -mlra-priority-none
12874 Don't indicate any priority for target registers.
12875
12876 -mlra-priority-compact
12877 Indicate target register priority for r0..r3 / r12..r15.
12878
12879 -mlra-priority-noncompact
12880 Reduce target register priority for r0..r3 / r12..r15.
12881
12882 -mno-millicode
12883 When optimizing for size (using -Os), prologues and epilogues that
12884 have to save or restore a large number of registers are often
12885 shortened by using call to a special function in libgcc; this is
12886 referred to as a millicode call. As these calls can pose
12887 performance issues, and/or cause linking issues when linking in a
12888 nonstandard way, this option is provided to turn off millicode call
12889 generation.
12890
12891 -mmixed-code
12892 Tweak register allocation to help 16-bit instruction generation.
12893 This generally has the effect of decreasing the average instruction
12894 size while increasing the instruction count.
12895
12896 -mq-class
12897 Enable q instruction alternatives. This is the default for -Os.
12898
12899 -mRcq
12900 Enable Rcq constraint handling. Most short code generation depends
12901 on this. This is the default.
12902
12903 -mRcw
12904 Enable Rcw constraint handling. Most ccfsm condexec mostly depends
12905 on this. This is the default.
12906
12907 -msize-level=level
12908 Fine-tune size optimization with regards to instruction lengths and
12909 alignment. The recognized values for level are:
12910
12911 0 No size optimization. This level is deprecated and treated
12912 like 1.
12913
12914 1 Short instructions are used opportunistically.
12915
12916 2 In addition, alignment of loops and of code after barriers are
12917 dropped.
12918
12919 3 In addition, optional data alignment is dropped, and the option
12920 Os is enabled.
12921
12922 This defaults to 3 when -Os is in effect. Otherwise, the behavior
12923 when this is not set is equivalent to level 1.
12924
12925 -mtune=cpu
12926 Set instruction scheduling parameters for cpu, overriding any
12927 implied by -mcpu=.
12928
12929 Supported values for cpu are
12930
12931 ARC600
12932 Tune for ARC600 CPU.
12933
12934 ARC601
12935 Tune for ARC601 CPU.
12936
12937 ARC700
12938 Tune for ARC700 CPU with standard multiplier block.
12939
12940 ARC700-xmac
12941 Tune for ARC700 CPU with XMAC block.
12942
12943 ARC725D
12944 Tune for ARC725D CPU.
12945
12946 ARC750D
12947 Tune for ARC750D CPU.
12948
12949 -mmultcost=num
12950 Cost to assume for a multiply instruction, with 4 being equal to a
12951 normal instruction.
12952
12953 -munalign-prob-threshold=probability
12954 Set probability threshold for unaligning branches. When tuning for
12955 ARC700 and optimizing for speed, branches without filled delay slot
12956 are preferably emitted unaligned and long, unless profiling
12957 indicates that the probability for the branch to be taken is below
12958 probability. The default is (REG_BR_PROB_BASE/2), i.e. 5000.
12959
12960 The following options are maintained for backward compatibility, but
12961 are now deprecated and will be removed in a future release:
12962
12963 -margonaut
12964 Obsolete FPX.
12965
12966 -mbig-endian
12967 -EB Compile code for big-endian targets. Use of these options is now
12968 deprecated. Big-endian code is supported by configuring GCC to
12969 build "arceb-elf32" and "arceb-linux-uclibc" targets, for which big
12970 endian is the default.
12971
12972 -mlittle-endian
12973 -EL Compile code for little-endian targets. Use of these options is
12974 now deprecated. Little-endian code is supported by configuring GCC
12975 to build "arc-elf32" and "arc-linux-uclibc" targets, for which
12976 little endian is the default.
12977
12978 -mbarrel_shifter
12979 Replaced by -mbarrel-shifter.
12980
12981 -mdpfp_compact
12982 Replaced by -mdpfp-compact.
12983
12984 -mdpfp_fast
12985 Replaced by -mdpfp-fast.
12986
12987 -mdsp_packa
12988 Replaced by -mdsp-packa.
12989
12990 -mEA
12991 Replaced by -mea.
12992
12993 -mmac_24
12994 Replaced by -mmac-24.
12995
12996 -mmac_d16
12997 Replaced by -mmac-d16.
12998
12999 -mspfp_compact
13000 Replaced by -mspfp-compact.
13001
13002 -mspfp_fast
13003 Replaced by -mspfp-fast.
13004
13005 -mtune=cpu
13006 Values arc600, arc601, arc700 and arc700-xmac for cpu are replaced
13007 by ARC600, ARC601, ARC700 and ARC700-xmac respectively.
13008
13009 -multcost=num
13010 Replaced by -mmultcost.
13011
13012 ARM Options
13013
13014 These -m options are defined for the ARM port:
13015
13016 -mabi=name
13017 Generate code for the specified ABI. Permissible values are: apcs-
13018 gnu, atpcs, aapcs, aapcs-linux and iwmmxt.
13019
13020 -mapcs-frame
13021 Generate a stack frame that is compliant with the ARM Procedure
13022 Call Standard for all functions, even if this is not strictly
13023 necessary for correct execution of the code. Specifying
13024 -fomit-frame-pointer with this option causes the stack frames not
13025 to be generated for leaf functions. The default is
13026 -mno-apcs-frame. This option is deprecated.
13027
13028 -mapcs
13029 This is a synonym for -mapcs-frame and is deprecated.
13030
13031 -mthumb-interwork
13032 Generate code that supports calling between the ARM and Thumb
13033 instruction sets. Without this option, on pre-v5 architectures,
13034 the two instruction sets cannot be reliably used inside one
13035 program. The default is -mno-thumb-interwork, since slightly
13036 larger code is generated when -mthumb-interwork is specified. In
13037 AAPCS configurations this option is meaningless.
13038
13039 -mno-sched-prolog
13040 Prevent the reordering of instructions in the function prologue, or
13041 the merging of those instruction with the instructions in the
13042 function's body. This means that all functions start with a
13043 recognizable set of instructions (or in fact one of a choice from a
13044 small set of different function prologues), and this information
13045 can be used to locate the start of functions inside an executable
13046 piece of code. The default is -msched-prolog.
13047
13048 -mfloat-abi=name
13049 Specifies which floating-point ABI to use. Permissible values are:
13050 soft, softfp and hard.
13051
13052 Specifying soft causes GCC to generate output containing library
13053 calls for floating-point operations. softfp allows the generation
13054 of code using hardware floating-point instructions, but still uses
13055 the soft-float calling conventions. hard allows generation of
13056 floating-point instructions and uses FPU-specific calling
13057 conventions.
13058
13059 The default depends on the specific target configuration. Note
13060 that the hard-float and soft-float ABIs are not link-compatible;
13061 you must compile your entire program with the same ABI, and link
13062 with a compatible set of libraries.
13063
13064 -mlittle-endian
13065 Generate code for a processor running in little-endian mode. This
13066 is the default for all standard configurations.
13067
13068 -mbig-endian
13069 Generate code for a processor running in big-endian mode; the
13070 default is to compile code for a little-endian processor.
13071
13072 -march=name
13073 This specifies the name of the target ARM architecture. GCC uses
13074 this name to determine what kind of instructions it can emit when
13075 generating assembly code. This option can be used in conjunction
13076 with or instead of the -mcpu= option. Permissible names are:
13077 armv2, armv2a, armv3, armv3m, armv4, armv4t, armv5, armv5e, armv5t,
13078 armv5te, armv6, armv6-m, armv6j, armv6k, armv6kz, armv6s-m,
13079 armv6t2, armv6z, armv6zk, armv7, armv7-a, armv7-m, armv7-r,
13080 armv7e-m, armv7ve, armv8-a, armv8-a+crc, armv8.1-a, armv8.1-a+crc,
13081 armv8-m.base, armv8-m.main, armv8-m.main+dsp, iwmmxt, iwmmxt2.
13082
13083 Architecture revisions older than armv4t are deprecated.
13084
13085 -march=armv6s-m is the armv6-m architecture with support for the
13086 (now mandatory) SVC instruction.
13087
13088 -march=armv6zk is an alias for armv6kz, existing for backwards
13089 compatibility.
13090
13091 -march=armv7ve is the armv7-a architecture with virtualization
13092 extensions.
13093
13094 -march=armv8-a+crc enables code generation for the ARMv8-A
13095 architecture together with the optional CRC32 extensions.
13096
13097 -march=armv8.1-a enables compiler support for the ARMv8.1-A
13098 architecture. This also enables the features provided by
13099 -march=armv8-a+crc.
13100
13101 -march=armv8.2-a enables compiler support for the ARMv8.2-A
13102 architecture. This also enables the features provided by
13103 -march=armv8.1-a.
13104
13105 -march=armv8.2-a+fp16 enables compiler support for the ARMv8.2-A
13106 architecture with the optional FP16 instructions extension. This
13107 also enables the features provided by -march=armv8.1-a and implies
13108 -mfp16-format=ieee.
13109
13110 -march=native causes the compiler to auto-detect the architecture
13111 of the build computer. At present, this feature is only supported
13112 on GNU/Linux, and not all architectures are recognized. If the
13113 auto-detect is unsuccessful the option has no effect.
13114
13115 -mtune=name
13116 This option specifies the name of the target ARM processor for
13117 which GCC should tune the performance of the code. For some ARM
13118 implementations better performance can be obtained by using this
13119 option. Permissible names are: arm2, arm250, arm3, arm6, arm60,
13120 arm600, arm610, arm620, arm7, arm7m, arm7d, arm7dm, arm7di,
13121 arm7dmi, arm70, arm700, arm700i, arm710, arm710c, arm7100, arm720,
13122 arm7500, arm7500fe, arm7tdmi, arm7tdmi-s, arm710t, arm720t,
13123 arm740t, strongarm, strongarm110, strongarm1100, strongarm1110,
13124 arm8, arm810, arm9, arm9e, arm920, arm920t, arm922t, arm946e-s,
13125 arm966e-s, arm968e-s, arm926ej-s, arm940t, arm9tdmi, arm10tdmi,
13126 arm1020t, arm1026ej-s, arm10e, arm1020e, arm1022e, arm1136j-s,
13127 arm1136jf-s, mpcore, mpcorenovfp, arm1156t2-s, arm1156t2f-s,
13128 arm1176jz-s, arm1176jzf-s, generic-armv7-a, cortex-a5, cortex-a7,
13129 cortex-a8, cortex-a9, cortex-a12, cortex-a15, cortex-a17,
13130 cortex-a32, cortex-a35, cortex-a53, cortex-a57, cortex-a72,
13131 cortex-a73, cortex-r4, cortex-r4f, cortex-r5, cortex-r7, cortex-r8,
13132 cortex-m33, cortex-m23, cortex-m7, cortex-m4, cortex-m3, cortex-m1,
13133 cortex-m0, cortex-m0plus, cortex-m1.small-multiply,
13134 cortex-m0.small-multiply, cortex-m0plus.small-multiply, exynos-m1,
13135 marvell-pj4, xscale, iwmmxt, iwmmxt2, ep9312, fa526, fa626,
13136 fa606te, fa626te, fmp626, fa726te, xgene1.
13137
13138 Additionally, this option can specify that GCC should tune the
13139 performance of the code for a big.LITTLE system. Permissible names
13140 are: cortex-a15.cortex-a7, cortex-a17.cortex-a7,
13141 cortex-a57.cortex-a53, cortex-a72.cortex-a53,
13142 cortex-a72.cortex-a35, cortex-a73.cortex-a53.
13143
13144 -mtune=generic-arch specifies that GCC should tune the performance
13145 for a blend of processors within architecture arch. The aim is to
13146 generate code that run well on the current most popular processors,
13147 balancing between optimizations that benefit some CPUs in the
13148 range, and avoiding performance pitfalls of other CPUs. The
13149 effects of this option may change in future GCC versions as CPU
13150 models come and go.
13151
13152 -mtune=native causes the compiler to auto-detect the CPU of the
13153 build computer. At present, this feature is only supported on
13154 GNU/Linux, and not all architectures are recognized. If the auto-
13155 detect is unsuccessful the option has no effect.
13156
13157 -mcpu=name
13158 This specifies the name of the target ARM processor. GCC uses this
13159 name to derive the name of the target ARM architecture (as if
13160 specified by -march) and the ARM processor type for which to tune
13161 for performance (as if specified by -mtune). Where this option is
13162 used in conjunction with -march or -mtune, those options take
13163 precedence over the appropriate part of this option.
13164
13165 Permissible names for this option are the same as those for -mtune.
13166
13167 -mcpu=generic-arch is also permissible, and is equivalent to
13168 -march=arch -mtune=generic-arch. See -mtune for more information.
13169
13170 -mcpu=native causes the compiler to auto-detect the CPU of the
13171 build computer. At present, this feature is only supported on
13172 GNU/Linux, and not all architectures are recognized. If the auto-
13173 detect is unsuccessful the option has no effect.
13174
13175 -mfpu=name
13176 This specifies what floating-point hardware (or hardware emulation)
13177 is available on the target. Permissible names are: vfpv2, vfpv3,
13178 vfpv3-fp16, vfpv3-d16, vfpv3-d16-fp16, vfpv3xd, vfpv3xd-fp16,
13179 neon-vfpv3, neon-fp16, vfpv4, vfpv4-d16, fpv4-sp-d16, neon-vfpv4,
13180 fpv5-d16, fpv5-sp-d16, fp-armv8, neon-fp-armv8 and
13181 crypto-neon-fp-armv8. Note that neon is an alias for neon-vfpv3
13182 and vfp is an alias for vfpv2.
13183
13184 If -msoft-float is specified this specifies the format of floating-
13185 point values.
13186
13187 If the selected floating-point hardware includes the NEON extension
13188 (e.g. -mfpu=neon), note that floating-point operations are not
13189 generated by GCC's auto-vectorization pass unless
13190 -funsafe-math-optimizations is also specified. This is because
13191 NEON hardware does not fully implement the IEEE 754 standard for
13192 floating-point arithmetic (in particular denormal values are
13193 treated as zero), so the use of NEON instructions may lead to a
13194 loss of precision.
13195
13196 You can also set the fpu name at function level by using the
13197 "target("fpu=")" function attributes or pragmas.
13198
13199 -mfp16-format=name
13200 Specify the format of the "__fp16" half-precision floating-point
13201 type. Permissible names are none, ieee, and alternative; the
13202 default is none, in which case the "__fp16" type is not defined.
13203
13204 -mstructure-size-boundary=n
13205 The sizes of all structures and unions are rounded up to a multiple
13206 of the number of bits set by this option. Permissible values are
13207 8, 32 and 64. The default value varies for different toolchains.
13208 For the COFF targeted toolchain the default value is 8. A value of
13209 64 is only allowed if the underlying ABI supports it.
13210
13211 Specifying a larger number can produce faster, more efficient code,
13212 but can also increase the size of the program. Different values
13213 are potentially incompatible. Code compiled with one value cannot
13214 necessarily expect to work with code or libraries compiled with
13215 another value, if they exchange information using structures or
13216 unions.
13217
13218 -mabort-on-noreturn
13219 Generate a call to the function "abort" at the end of a "noreturn"
13220 function. It is executed if the function tries to return.
13221
13222 -mlong-calls
13223 -mno-long-calls
13224 Tells the compiler to perform function calls by first loading the
13225 address of the function into a register and then performing a
13226 subroutine call on this register. This switch is needed if the
13227 target function lies outside of the 64-megabyte addressing range of
13228 the offset-based version of subroutine call instruction.
13229
13230 Even if this switch is enabled, not all function calls are turned
13231 into long calls. The heuristic is that static functions, functions
13232 that have the "short_call" attribute, functions that are inside the
13233 scope of a "#pragma no_long_calls" directive, and functions whose
13234 definitions have already been compiled within the current
13235 compilation unit are not turned into long calls. The exceptions to
13236 this rule are that weak function definitions, functions with the
13237 "long_call" attribute or the "section" attribute, and functions
13238 that are within the scope of a "#pragma long_calls" directive are
13239 always turned into long calls.
13240
13241 This feature is not enabled by default. Specifying -mno-long-calls
13242 restores the default behavior, as does placing the function calls
13243 within the scope of a "#pragma long_calls_off" directive. Note
13244 these switches have no effect on how the compiler generates code to
13245 handle function calls via function pointers.
13246
13247 -msingle-pic-base
13248 Treat the register used for PIC addressing as read-only, rather
13249 than loading it in the prologue for each function. The runtime
13250 system is responsible for initializing this register with an
13251 appropriate value before execution begins.
13252
13253 -mpic-register=reg
13254 Specify the register to be used for PIC addressing. For standard
13255 PIC base case, the default is any suitable register determined by
13256 compiler. For single PIC base case, the default is R9 if target is
13257 EABI based or stack-checking is enabled, otherwise the default is
13258 R10.
13259
13260 -mpic-data-is-text-relative
13261 Assume that the displacement between the text and data segments is
13262 fixed at static link time. This permits using PC-relative
13263 addressing operations to access data known to be in the data
13264 segment. For non-VxWorks RTP targets, this option is enabled by
13265 default. When disabled on such targets, it will enable
13266 -msingle-pic-base by default.
13267
13268 -mpoke-function-name
13269 Write the name of each function into the text section, directly
13270 preceding the function prologue. The generated code is similar to
13271 this:
13272
13273 t0
13274 .ascii "arm_poke_function_name", 0
13275 .align
13276 t1
13277 .word 0xff000000 + (t1 - t0)
13278 arm_poke_function_name
13279 mov ip, sp
13280 stmfd sp!, {fp, ip, lr, pc}
13281 sub fp, ip, #4
13282
13283 When performing a stack backtrace, code can inspect the value of
13284 "pc" stored at "fp + 0". If the trace function then looks at
13285 location "pc - 12" and the top 8 bits are set, then we know that
13286 there is a function name embedded immediately preceding this
13287 location and has length "((pc[-3]) & 0xff000000)".
13288
13289 -mthumb
13290 -marm
13291 Select between generating code that executes in ARM and Thumb
13292 states. The default for most configurations is to generate code
13293 that executes in ARM state, but the default can be changed by
13294 configuring GCC with the --with-mode=state configure option.
13295
13296 You can also override the ARM and Thumb mode for each function by
13297 using the "target("thumb")" and "target("arm")" function attributes
13298 or pragmas.
13299
13300 -mtpcs-frame
13301 Generate a stack frame that is compliant with the Thumb Procedure
13302 Call Standard for all non-leaf functions. (A leaf function is one
13303 that does not call any other functions.) The default is
13304 -mno-tpcs-frame.
13305
13306 -mtpcs-leaf-frame
13307 Generate a stack frame that is compliant with the Thumb Procedure
13308 Call Standard for all leaf functions. (A leaf function is one that
13309 does not call any other functions.) The default is
13310 -mno-apcs-leaf-frame.
13311
13312 -mcallee-super-interworking
13313 Gives all externally visible functions in the file being compiled
13314 an ARM instruction set header which switches to Thumb mode before
13315 executing the rest of the function. This allows these functions to
13316 be called from non-interworking code. This option is not valid in
13317 AAPCS configurations because interworking is enabled by default.
13318
13319 -mcaller-super-interworking
13320 Allows calls via function pointers (including virtual functions) to
13321 execute correctly regardless of whether the target code has been
13322 compiled for interworking or not. There is a small overhead in the
13323 cost of executing a function pointer if this option is enabled.
13324 This option is not valid in AAPCS configurations because
13325 interworking is enabled by default.
13326
13327 -mtp=name
13328 Specify the access model for the thread local storage pointer. The
13329 valid models are soft, which generates calls to "__aeabi_read_tp",
13330 cp15, which fetches the thread pointer from "cp15" directly
13331 (supported in the arm6k architecture), and auto, which uses the
13332 best available method for the selected processor. The default
13333 setting is auto.
13334
13335 -mtls-dialect=dialect
13336 Specify the dialect to use for accessing thread local storage. Two
13337 dialects are supported---gnu and gnu2. The gnu dialect selects the
13338 original GNU scheme for supporting local and global dynamic TLS
13339 models. The gnu2 dialect selects the GNU descriptor scheme, which
13340 provides better performance for shared libraries. The GNU
13341 descriptor scheme is compatible with the original scheme, but does
13342 require new assembler, linker and library support. Initial and
13343 local exec TLS models are unaffected by this option and always use
13344 the original scheme.
13345
13346 -mword-relocations
13347 Only generate absolute relocations on word-sized values (i.e.
13348 R_ARM_ABS32). This is enabled by default on targets (uClinux,
13349 SymbianOS) where the runtime loader imposes this restriction, and
13350 when -fpic or -fPIC is specified.
13351
13352 -mfix-cortex-m3-ldrd
13353 Some Cortex-M3 cores can cause data corruption when "ldrd"
13354 instructions with overlapping destination and base registers are
13355 used. This option avoids generating these instructions. This
13356 option is enabled by default when -mcpu=cortex-m3 is specified.
13357
13358 -munaligned-access
13359 -mno-unaligned-access
13360 Enables (or disables) reading and writing of 16- and 32- bit values
13361 from addresses that are not 16- or 32- bit aligned. By default
13362 unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
13363 ARMv8-M Baseline architectures, and enabled for all other
13364 architectures. If unaligned access is not enabled then words in
13365 packed data structures are accessed a byte at a time.
13366
13367 The ARM attribute "Tag_CPU_unaligned_access" is set in the
13368 generated object file to either true or false, depending upon the
13369 setting of this option. If unaligned access is enabled then the
13370 preprocessor symbol "__ARM_FEATURE_UNALIGNED" is also defined.
13371
13372 -mneon-for-64bits
13373 Enables using Neon to handle scalar 64-bits operations. This is
13374 disabled by default since the cost of moving data from core
13375 registers to Neon is high.
13376
13377 -mslow-flash-data
13378 Assume loading data from flash is slower than fetching instruction.
13379 Therefore literal load is minimized for better performance. This
13380 option is only supported when compiling for ARMv7 M-profile and off
13381 by default.
13382
13383 -masm-syntax-unified
13384 Assume inline assembler is using unified asm syntax. The default
13385 is currently off which implies divided syntax. This option has no
13386 impact on Thumb2. However, this may change in future releases of
13387 GCC. Divided syntax should be considered deprecated.
13388
13389 -mrestrict-it
13390 Restricts generation of IT blocks to conform to the rules of ARMv8.
13391 IT blocks can only contain a single 16-bit instruction from a
13392 select set of instructions. This option is on by default for ARMv8
13393 Thumb mode.
13394
13395 -mprint-tune-info
13396 Print CPU tuning information as comment in assembler file. This is
13397 an option used only for regression testing of the compiler and not
13398 intended for ordinary use in compiling code. This option is
13399 disabled by default.
13400
13401 -mpure-code
13402 Do not allow constant data to be placed in code sections.
13403 Additionally, when compiling for ELF object format give all text
13404 sections the ELF processor-specific section attribute
13405 "SHF_ARM_PURECODE". This option is only available when generating
13406 non-pic code for ARMv7-M targets.
13407
13408 -mcmse
13409 Generate secure code as per the "ARMv8-M Security Extensions:
13410 Requirements on Development Tools Engineering Specification", which
13411 can be found on
13412 <http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf>.
13413
13414 AVR Options
13415
13416 These options are defined for AVR implementations:
13417
13418 -mmcu=mcu
13419 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
13420
13421 The default for this option is@tie{}avr2.
13422
13423 GCC supports the following AVR devices and ISAs:
13424
13425 "avr2"
13426 "Classic" devices with up to 8@tie{}KiB of program memory.
13427 mcu@tie{}= "attiny22", "attiny26", "at90c8534", "at90s2313",
13428 "at90s2323", "at90s2333", "at90s2343", "at90s4414",
13429 "at90s4433", "at90s4434", "at90s8515", "at90s8535".
13430
13431 "avr25"
13432 "Classic" devices with up to 8@tie{}KiB of program memory and
13433 with the "MOVW" instruction. mcu@tie{}= "ata5272", "ata6616c",
13434 "attiny13", "attiny13a", "attiny2313", "attiny2313a",
13435 "attiny24", "attiny24a", "attiny25", "attiny261", "attiny261a",
13436 "attiny43u", "attiny4313", "attiny44", "attiny44a",
13437 "attiny441", "attiny45", "attiny461", "attiny461a", "attiny48",
13438 "attiny828", "attiny84", "attiny84a", "attiny841", "attiny85",
13439 "attiny861", "attiny861a", "attiny87", "attiny88", "at86rf401".
13440
13441 "avr3"
13442 "Classic" devices with 16@tie{}KiB up to 64@tie{}KiB of
13443 program memory. mcu@tie{}= "at43usb355", "at76c711".
13444
13445 "avr31"
13446 "Classic" devices with 128@tie{}KiB of program memory.
13447 mcu@tie{}= "atmega103", "at43usb320".
13448
13449 "avr35"
13450 "Classic" devices with 16@tie{}KiB up to 64@tie{}KiB of program
13451 memory and with the "MOVW" instruction. mcu@tie{}= "ata5505",
13452 "ata6617c", "ata664251", "atmega16u2", "atmega32u2",
13453 "atmega8u2", "attiny1634", "attiny167", "at90usb162",
13454 "at90usb82".
13455
13456 "avr4"
13457 "Enhanced" devices with up to 8@tie{}KiB of program memory.
13458 mcu@tie{}= "ata6285", "ata6286", "ata6289", "ata6612c",
13459 "atmega48", "atmega48a", "atmega48p", "atmega48pa",
13460 "atmega48pb", "atmega8", "atmega8a", "atmega8hva",
13461 "atmega8515", "atmega8535", "atmega88", "atmega88a",
13462 "atmega88p", "atmega88pa", "atmega88pb", "at90pwm1",
13463 "at90pwm2", "at90pwm2b", "at90pwm3", "at90pwm3b", "at90pwm81".
13464
13465 "avr5"
13466 "Enhanced" devices with 16@tie{}KiB up to 64@tie{}KiB of
13467 program memory. mcu@tie{}= "ata5702m322", "ata5782",
13468 "ata5790", "ata5790n", "ata5791", "ata5795", "ata5831",
13469 "ata6613c", "ata6614q", "ata8210", "ata8510", "atmega16",
13470 "atmega16a", "atmega16hva", "atmega16hva2", "atmega16hvb",
13471 "atmega16hvbrevb", "atmega16m1", "atmega16u4", "atmega161",
13472 "atmega162", "atmega163", "atmega164a", "atmega164p",
13473 "atmega164pa", "atmega165", "atmega165a", "atmega165p",
13474 "atmega165pa", "atmega168", "atmega168a", "atmega168p",
13475 "atmega168pa", "atmega168pb", "atmega169", "atmega169a",
13476 "atmega169p", "atmega169pa", "atmega32", "atmega32a",
13477 "atmega32c1", "atmega32hvb", "atmega32hvbrevb", "atmega32m1",
13478 "atmega32u4", "atmega32u6", "atmega323", "atmega324a",
13479 "atmega324p", "atmega324pa", "atmega325", "atmega325a",
13480 "atmega325p", "atmega325pa", "atmega3250", "atmega3250a",
13481 "atmega3250p", "atmega3250pa", "atmega328", "atmega328p",
13482 "atmega328pb", "atmega329", "atmega329a", "atmega329p",
13483 "atmega329pa", "atmega3290", "atmega3290a", "atmega3290p",
13484 "atmega3290pa", "atmega406", "atmega64", "atmega64a",
13485 "atmega64c1", "atmega64hve", "atmega64hve2", "atmega64m1",
13486 "atmega64rfr2", "atmega640", "atmega644", "atmega644a",
13487 "atmega644p", "atmega644pa", "atmega644rfr2", "atmega645",
13488 "atmega645a", "atmega645p", "atmega6450", "atmega6450a",
13489 "atmega6450p", "atmega649", "atmega649a", "atmega649p",
13490 "atmega6490", "atmega6490a", "atmega6490p", "at90can32",
13491 "at90can64", "at90pwm161", "at90pwm216", "at90pwm316",
13492 "at90scr100", "at90usb646", "at90usb647", "at94k", "m3000".
13493
13494 "avr51"
13495 "Enhanced" devices with 128@tie{}KiB of program memory.
13496 mcu@tie{}= "atmega128", "atmega128a", "atmega128rfa1",
13497 "atmega128rfr2", "atmega1280", "atmega1281", "atmega1284",
13498 "atmega1284p", "atmega1284rfr2", "at90can128", "at90usb1286",
13499 "at90usb1287".
13500
13501 "avr6"
13502 "Enhanced" devices with 3-byte PC, i.e. with more than
13503 128@tie{}KiB of program memory. mcu@tie{}= "atmega256rfr2",
13504 "atmega2560", "atmega2561", "atmega2564rfr2".
13505
13506 "avrxmega2"
13507 "XMEGA" devices with more than 8@tie{}KiB and up to 64@tie{}KiB
13508 of program memory. mcu@tie{}= "atxmega16a4", "atxmega16a4u",
13509 "atxmega16c4", "atxmega16d4", "atxmega16e5", "atxmega32a4",
13510 "atxmega32a4u", "atxmega32c3", "atxmega32c4", "atxmega32d3",
13511 "atxmega32d4", "atxmega32e5", "atxmega8e5".
13512
13513 "avrxmega4"
13514 "XMEGA" devices with more than 64@tie{}KiB and up to
13515 128@tie{}KiB of program memory. mcu@tie{}= "atxmega64a3",
13516 "atxmega64a3u", "atxmega64a4u", "atxmega64b1", "atxmega64b3",
13517 "atxmega64c3", "atxmega64d3", "atxmega64d4".
13518
13519 "avrxmega5"
13520 "XMEGA" devices with more than 64@tie{}KiB and up to
13521 128@tie{}KiB of program memory and more than 64@tie{}KiB of
13522 RAM. mcu@tie{}= "atxmega64a1", "atxmega64a1u".
13523
13524 "avrxmega6"
13525 "XMEGA" devices with more than 128@tie{}KiB of program memory.
13526 mcu@tie{}= "atxmega128a3", "atxmega128a3u", "atxmega128b1",
13527 "atxmega128b3", "atxmega128c3", "atxmega128d3", "atxmega128d4",
13528 "atxmega192a3", "atxmega192a3u", "atxmega192c3",
13529 "atxmega192d3", "atxmega256a3", "atxmega256a3b",
13530 "atxmega256a3bu", "atxmega256a3u", "atxmega256c3",
13531 "atxmega256d3", "atxmega384c3", "atxmega384d3".
13532
13533 "avrxmega7"
13534 "XMEGA" devices with more than 128@tie{}KiB of program memory
13535 and more than 64@tie{}KiB of RAM. mcu@tie{}= "atxmega128a1",
13536 "atxmega128a1u", "atxmega128a4u".
13537
13538 "avrtiny"
13539 "TINY" Tiny core devices with 512@tie{}B up to 4@tie{}KiB of
13540 program memory. mcu@tie{}= "attiny10", "attiny20", "attiny4",
13541 "attiny40", "attiny5", "attiny9".
13542
13543 "avr1"
13544 This ISA is implemented by the minimal AVR core and supported
13545 for assembler only. mcu@tie{}= "attiny11", "attiny12",
13546 "attiny15", "attiny28", "at90s1200".
13547
13548 -mabsdata
13549 Assume that all data in static storage can be accessed by LDS / STS
13550 instructions. This option has only an effect on reduced Tiny
13551 devices like ATtiny40. See also the "absdata" AVR Variable
13552 Attributes,variable attribute.
13553
13554 -maccumulate-args
13555 Accumulate outgoing function arguments and acquire/release the
13556 needed stack space for outgoing function arguments once in function
13557 prologue/epilogue. Without this option, outgoing arguments are
13558 pushed before calling a function and popped afterwards.
13559
13560 Popping the arguments after the function call can be expensive on
13561 AVR so that accumulating the stack space might lead to smaller
13562 executables because arguments need not be removed from the stack
13563 after such a function call.
13564
13565 This option can lead to reduced code size for functions that
13566 perform several calls to functions that get their arguments on the
13567 stack like calls to printf-like functions.
13568
13569 -mbranch-cost=cost
13570 Set the branch costs for conditional branch instructions to cost.
13571 Reasonable values for cost are small, non-negative integers. The
13572 default branch cost is 0.
13573
13574 -mcall-prologues
13575 Functions prologues/epilogues are expanded as calls to appropriate
13576 subroutines. Code size is smaller.
13577
13578 -mint8
13579 Assume "int" to be 8-bit integer. This affects the sizes of all
13580 types: a "char" is 1 byte, an "int" is 1 byte, a "long" is 2 bytes,
13581 and "long long" is 4 bytes. Please note that this option does not
13582 conform to the C standards, but it results in smaller code size.
13583
13584 -mn-flash=num
13585 Assume that the flash memory has a size of num times 64@tie{}KiB.
13586
13587 -mno-interrupts
13588 Generated code is not compatible with hardware interrupts. Code
13589 size is smaller.
13590
13591 -mrelax
13592 Try to replace "CALL" resp. "JMP" instruction by the shorter
13593 "RCALL" resp. "RJMP" instruction if applicable. Setting -mrelax
13594 just adds the --mlink-relax option to the assembler's command line
13595 and the --relax option to the linker's command line.
13596
13597 Jump relaxing is performed by the linker because jump offsets are
13598 not known before code is located. Therefore, the assembler code
13599 generated by the compiler is the same, but the instructions in the
13600 executable may differ from instructions in the assembler code.
13601
13602 Relaxing must be turned on if linker stubs are needed, see the
13603 section on "EIND" and linker stubs below.
13604
13605 -mrmw
13606 Assume that the device supports the Read-Modify-Write instructions
13607 "XCH", "LAC", "LAS" and "LAT".
13608
13609 -msp8
13610 Treat the stack pointer register as an 8-bit register, i.e. assume
13611 the high byte of the stack pointer is zero. In general, you don't
13612 need to set this option by hand.
13613
13614 This option is used internally by the compiler to select and build
13615 multilibs for architectures "avr2" and "avr25". These
13616 architectures mix devices with and without "SPH". For any setting
13617 other than -mmcu=avr2 or -mmcu=avr25 the compiler driver adds or
13618 removes this option from the compiler proper's command line,
13619 because the compiler then knows if the device or architecture has
13620 an 8-bit stack pointer and thus no "SPH" register or not.
13621
13622 -mstrict-X
13623 Use address register "X" in a way proposed by the hardware. This
13624 means that "X" is only used in indirect, post-increment or pre-
13625 decrement addressing.
13626
13627 Without this option, the "X" register may be used in the same way
13628 as "Y" or "Z" which then is emulated by additional instructions.
13629 For example, loading a value with "X+const" addressing with a small
13630 non-negative "const < 64" to a register Rn is performed as
13631
13632 adiw r26, const ; X += const
13633 ld <Rn>, X ; <Rn> = *X
13634 sbiw r26, const ; X -= const
13635
13636 -mtiny-stack
13637 Only change the lower 8@tie{}bits of the stack pointer.
13638
13639 -mfract-convert-truncate
13640 Allow to use truncation instead of rounding towards zero for
13641 fractional fixed-point types.
13642
13643 -nodevicelib
13644 Don't link against AVR-LibC's device specific library "lib<mcu>.a".
13645
13646 -Waddr-space-convert
13647 Warn about conversions between address spaces in the case where the
13648 resulting address space is not contained in the incoming address
13649 space.
13650
13651 -Wmisspelled-isr
13652 Warn if the ISR is misspelled, i.e. without __vector prefix.
13653 Enabled by default.
13654
13655 "EIND" and Devices with More Than 128 Ki Bytes of Flash
13656
13657 Pointers in the implementation are 16@tie{}bits wide. The address of a
13658 function or label is represented as word address so that indirect jumps
13659 and calls can target any code address in the range of 64@tie{}Ki words.
13660
13661 In order to facilitate indirect jump on devices with more than
13662 128@tie{}Ki bytes of program memory space, there is a special function
13663 register called "EIND" that serves as most significant part of the
13664 target address when "EICALL" or "EIJMP" instructions are used.
13665
13666 Indirect jumps and calls on these devices are handled as follows by the
13667 compiler and are subject to some limitations:
13668
13669 * The compiler never sets "EIND".
13670
13671 * The compiler uses "EIND" implicitly in "EICALL"/"EIJMP"
13672 instructions or might read "EIND" directly in order to emulate an
13673 indirect call/jump by means of a "RET" instruction.
13674
13675 * The compiler assumes that "EIND" never changes during the startup
13676 code or during the application. In particular, "EIND" is not
13677 saved/restored in function or interrupt service routine
13678 prologue/epilogue.
13679
13680 * For indirect calls to functions and computed goto, the linker
13681 generates stubs. Stubs are jump pads sometimes also called
13682 trampolines. Thus, the indirect call/jump jumps to such a stub.
13683 The stub contains a direct jump to the desired address.
13684
13685 * Linker relaxation must be turned on so that the linker generates
13686 the stubs correctly in all situations. See the compiler option
13687 -mrelax and the linker option --relax. There are corner cases
13688 where the linker is supposed to generate stubs but aborts without
13689 relaxation and without a helpful error message.
13690
13691 * The default linker script is arranged for code with "EIND = 0". If
13692 code is supposed to work for a setup with "EIND != 0", a custom
13693 linker script has to be used in order to place the sections whose
13694 name start with ".trampolines" into the segment where "EIND" points
13695 to.
13696
13697 * The startup code from libgcc never sets "EIND". Notice that
13698 startup code is a blend of code from libgcc and AVR-LibC. For the
13699 impact of AVR-LibC on "EIND", see the AVR-LibC user manual
13700 ("http://nongnu.org/avr-libc/user-manual/").
13701
13702 * It is legitimate for user-specific startup code to set up "EIND"
13703 early, for example by means of initialization code located in
13704 section ".init3". Such code runs prior to general startup code that
13705 initializes RAM and calls constructors, but after the bit of
13706 startup code from AVR-LibC that sets "EIND" to the segment where
13707 the vector table is located.
13708
13709 #include <avr/io.h>
13710
13711 static void
13712 __attribute__((section(".init3"),naked,used,no_instrument_function))
13713 init3_set_eind (void)
13714 {
13715 __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
13716 "out %i0,r24" :: "n" (&EIND) : "r24","memory");
13717 }
13718
13719 The "__trampolines_start" symbol is defined in the linker script.
13720
13721 * Stubs are generated automatically by the linker if the following
13722 two conditions are met:
13723
13724 -<The address of a label is taken by means of the "gs" modifier>
13725 (short for generate stubs) like so:
13726
13727 LDI r24, lo8(gs(<func>))
13728 LDI r25, hi8(gs(<func>))
13729
13730 -<The final location of that label is in a code segment>
13731 outside the segment where the stubs are located.
13732
13733 * The compiler emits such "gs" modifiers for code labels in the
13734 following situations:
13735
13736 -<Taking address of a function or code label.>
13737 -<Computed goto.>
13738 -<If prologue-save function is used, see -mcall-prologues>
13739 command-line option.
13740
13741 -<Switch/case dispatch tables. If you do not want such dispatch>
13742 tables you can specify the -fno-jump-tables command-line
13743 option.
13744
13745 -<C and C++ constructors/destructors called during
13746 startup/shutdown.>
13747 -<If the tools hit a "gs()" modifier explained above.>
13748 * Jumping to non-symbolic addresses like so is not supported:
13749
13750 int main (void)
13751 {
13752 /* Call function at word address 0x2 */
13753 return ((int(*)(void)) 0x2)();
13754 }
13755
13756 Instead, a stub has to be set up, i.e. the function has to be
13757 called through a symbol ("func_4" in the example):
13758
13759 int main (void)
13760 {
13761 extern int func_4 (void);
13762
13763 /* Call function at byte address 0x4 */
13764 return func_4();
13765 }
13766
13767 and the application be linked with -Wl,--defsym,func_4=0x4.
13768 Alternatively, "func_4" can be defined in the linker script.
13769
13770 Handling of the "RAMPD", "RAMPX", "RAMPY" and "RAMPZ" Special Function
13771 Registers
13772
13773 Some AVR devices support memories larger than the 64@tie{}KiB range
13774 that can be accessed with 16-bit pointers. To access memory locations
13775 outside this 64@tie{}KiB range, the content of a "RAMP" register is
13776 used as high part of the address: The "X", "Y", "Z" address register is
13777 concatenated with the "RAMPX", "RAMPY", "RAMPZ" special function
13778 register, respectively, to get a wide address. Similarly, "RAMPD" is
13779 used together with direct addressing.
13780
13781 * The startup code initializes the "RAMP" special function registers
13782 with zero.
13783
13784 * If a AVR Named Address Spaces,named address space other than
13785 generic or "__flash" is used, then "RAMPZ" is set as needed before
13786 the operation.
13787
13788 * If the device supports RAM larger than 64@tie{}KiB and the compiler
13789 needs to change "RAMPZ" to accomplish an operation, "RAMPZ" is
13790 reset to zero after the operation.
13791
13792 * If the device comes with a specific "RAMP" register, the ISR
13793 prologue/epilogue saves/restores that SFR and initializes it with
13794 zero in case the ISR code might (implicitly) use it.
13795
13796 * RAM larger than 64@tie{}KiB is not supported by GCC for AVR
13797 targets. If you use inline assembler to read from locations
13798 outside the 16-bit address range and change one of the "RAMP"
13799 registers, you must reset it to zero after the access.
13800
13801 AVR Built-in Macros
13802
13803 GCC defines several built-in macros so that the user code can test for
13804 the presence or absence of features. Almost any of the following
13805 built-in macros are deduced from device capabilities and thus triggered
13806 by the -mmcu= command-line option.
13807
13808 For even more AVR-specific built-in macros see AVR Named Address Spaces
13809 and AVR Built-in Functions.
13810
13811 "__AVR_ARCH__"
13812 Build-in macro that resolves to a decimal number that identifies
13813 the architecture and depends on the -mmcu=mcu option. Possible
13814 values are:
13815
13816 2, 25, 3, 31, 35, 4, 5, 51, 6
13817
13818 for mcu="avr2", "avr25", "avr3", "avr31", "avr35", "avr4", "avr5",
13819 "avr51", "avr6",
13820
13821 respectively and
13822
13823 100, 102, 104, 105, 106, 107
13824
13825 for mcu="avrtiny", "avrxmega2", "avrxmega4", "avrxmega5",
13826 "avrxmega6", "avrxmega7", respectively. If mcu specifies a device,
13827 this built-in macro is set accordingly. For example, with
13828 -mmcu=atmega8 the macro is defined to 4.
13829
13830 "__AVR_Device__"
13831 Setting -mmcu=device defines this built-in macro which reflects the
13832 device's name. For example, -mmcu=atmega8 defines the built-in
13833 macro "__AVR_ATmega8__", -mmcu=attiny261a defines
13834 "__AVR_ATtiny261A__", etc.
13835
13836 The built-in macros' names follow the scheme "__AVR_Device__" where
13837 Device is the device name as from the AVR user manual. The
13838 difference between Device in the built-in macro and device in
13839 -mmcu=device is that the latter is always lowercase.
13840
13841 If device is not a device but only a core architecture like avr51,
13842 this macro is not defined.
13843
13844 "__AVR_DEVICE_NAME__"
13845 Setting -mmcu=device defines this built-in macro to the device's
13846 name. For example, with -mmcu=atmega8 the macro is defined to
13847 "atmega8".
13848
13849 If device is not a device but only a core architecture like avr51,
13850 this macro is not defined.
13851
13852 "__AVR_XMEGA__"
13853 The device / architecture belongs to the XMEGA family of devices.
13854
13855 "__AVR_HAVE_ELPM__"
13856 The device has the "ELPM" instruction.
13857
13858 "__AVR_HAVE_ELPMX__"
13859 The device has the "ELPM Rn,Z" and "ELPM Rn,Z+" instructions.
13860
13861 "__AVR_HAVE_MOVW__"
13862 The device has the "MOVW" instruction to perform 16-bit register-
13863 register moves.
13864
13865 "__AVR_HAVE_LPMX__"
13866 The device has the "LPM Rn,Z" and "LPM Rn,Z+" instructions.
13867
13868 "__AVR_HAVE_MUL__"
13869 The device has a hardware multiplier.
13870
13871 "__AVR_HAVE_JMP_CALL__"
13872 The device has the "JMP" and "CALL" instructions. This is the case
13873 for devices with at least 16@tie{}KiB of program memory.
13874
13875 "__AVR_HAVE_EIJMP_EICALL__"
13876 "__AVR_3_BYTE_PC__"
13877 The device has the "EIJMP" and "EICALL" instructions. This is the
13878 case for devices with more than 128@tie{}KiB of program memory.
13879 This also means that the program counter (PC) is 3@tie{}bytes wide.
13880
13881 "__AVR_2_BYTE_PC__"
13882 The program counter (PC) is 2@tie{}bytes wide. This is the case for
13883 devices with up to 128@tie{}KiB of program memory.
13884
13885 "__AVR_HAVE_8BIT_SP__"
13886 "__AVR_HAVE_16BIT_SP__"
13887 The stack pointer (SP) register is treated as 8-bit respectively
13888 16-bit register by the compiler. The definition of these macros is
13889 affected by -mtiny-stack.
13890
13891 "__AVR_HAVE_SPH__"
13892 "__AVR_SP8__"
13893 The device has the SPH (high part of stack pointer) special
13894 function register or has an 8-bit stack pointer, respectively. The
13895 definition of these macros is affected by -mmcu= and in the cases
13896 of -mmcu=avr2 and -mmcu=avr25 also by -msp8.
13897
13898 "__AVR_HAVE_RAMPD__"
13899 "__AVR_HAVE_RAMPX__"
13900 "__AVR_HAVE_RAMPY__"
13901 "__AVR_HAVE_RAMPZ__"
13902 The device has the "RAMPD", "RAMPX", "RAMPY", "RAMPZ" special
13903 function register, respectively.
13904
13905 "__NO_INTERRUPTS__"
13906 This macro reflects the -mno-interrupts command-line option.
13907
13908 "__AVR_ERRATA_SKIP__"
13909 "__AVR_ERRATA_SKIP_JMP_CALL__"
13910 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
13911 instructions because of a hardware erratum. Skip instructions are
13912 "SBRS", "SBRC", "SBIS", "SBIC" and "CPSE". The second macro is
13913 only defined if "__AVR_HAVE_JMP_CALL__" is also set.
13914
13915 "__AVR_ISA_RMW__"
13916 The device has Read-Modify-Write instructions (XCH, LAC, LAS and
13917 LAT).
13918
13919 "__AVR_SFR_OFFSET__=offset"
13920 Instructions that can address I/O special function registers
13921 directly like "IN", "OUT", "SBI", etc. may use a different address
13922 as if addressed by an instruction to access RAM like "LD" or "STS".
13923 This offset depends on the device architecture and has to be
13924 subtracted from the RAM address in order to get the respective
13925 I/O@tie{}address.
13926
13927 "__WITH_AVRLIBC__"
13928 The compiler is configured to be used together with AVR-Libc. See
13929 the --with-avrlibc configure option.
13930
13931 Blackfin Options
13932
13933 -mcpu=cpu[-sirevision]
13934 Specifies the name of the target Blackfin processor. Currently,
13935 cpu can be one of bf512, bf514, bf516, bf518, bf522, bf523, bf524,
13936 bf525, bf526, bf527, bf531, bf532, bf533, bf534, bf536, bf537,
13937 bf538, bf539, bf542, bf544, bf547, bf548, bf549, bf542m, bf544m,
13938 bf547m, bf548m, bf549m, bf561, bf592.
13939
13940 The optional sirevision specifies the silicon revision of the
13941 target Blackfin processor. Any workarounds available for the
13942 targeted silicon revision are enabled. If sirevision is none, no
13943 workarounds are enabled. If sirevision is any, all workarounds for
13944 the targeted processor are enabled. The "__SILICON_REVISION__"
13945 macro is defined to two hexadecimal digits representing the major
13946 and minor numbers in the silicon revision. If sirevision is none,
13947 the "__SILICON_REVISION__" is not defined. If sirevision is any,
13948 the "__SILICON_REVISION__" is defined to be 0xffff. If this
13949 optional sirevision is not used, GCC assumes the latest known
13950 silicon revision of the targeted Blackfin processor.
13951
13952 GCC defines a preprocessor macro for the specified cpu. For the
13953 bfin-elf toolchain, this option causes the hardware BSP provided by
13954 libgloss to be linked in if -msim is not given.
13955
13956 Without this option, bf532 is used as the processor by default.
13957
13958 Note that support for bf561 is incomplete. For bf561, only the
13959 preprocessor macro is defined.
13960
13961 -msim
13962 Specifies that the program will be run on the simulator. This
13963 causes the simulator BSP provided by libgloss to be linked in.
13964 This option has effect only for bfin-elf toolchain. Certain other
13965 options, such as -mid-shared-library and -mfdpic, imply -msim.
13966
13967 -momit-leaf-frame-pointer
13968 Don't keep the frame pointer in a register for leaf functions.
13969 This avoids the instructions to save, set up and restore frame
13970 pointers and makes an extra register available in leaf functions.
13971 The option -fomit-frame-pointer removes the frame pointer for all
13972 functions, which might make debugging harder.
13973
13974 -mspecld-anomaly
13975 When enabled, the compiler ensures that the generated code does not
13976 contain speculative loads after jump instructions. If this option
13977 is used, "__WORKAROUND_SPECULATIVE_LOADS" is defined.
13978
13979 -mno-specld-anomaly
13980 Don't generate extra code to prevent speculative loads from
13981 occurring.
13982
13983 -mcsync-anomaly
13984 When enabled, the compiler ensures that the generated code does not
13985 contain CSYNC or SSYNC instructions too soon after conditional
13986 branches. If this option is used, "__WORKAROUND_SPECULATIVE_SYNCS"
13987 is defined.
13988
13989 -mno-csync-anomaly
13990 Don't generate extra code to prevent CSYNC or SSYNC instructions
13991 from occurring too soon after a conditional branch.
13992
13993 -mlow-64k
13994 When enabled, the compiler is free to take advantage of the
13995 knowledge that the entire program fits into the low 64k of memory.
13996
13997 -mno-low-64k
13998 Assume that the program is arbitrarily large. This is the default.
13999
14000 -mstack-check-l1
14001 Do stack checking using information placed into L1 scratchpad
14002 memory by the uClinux kernel.
14003
14004 -mid-shared-library
14005 Generate code that supports shared libraries via the library ID
14006 method. This allows for execute in place and shared libraries in
14007 an environment without virtual memory management. This option
14008 implies -fPIC. With a bfin-elf target, this option implies -msim.
14009
14010 -mno-id-shared-library
14011 Generate code that doesn't assume ID-based shared libraries are
14012 being used. This is the default.
14013
14014 -mleaf-id-shared-library
14015 Generate code that supports shared libraries via the library ID
14016 method, but assumes that this library or executable won't link
14017 against any other ID shared libraries. That allows the compiler to
14018 use faster code for jumps and calls.
14019
14020 -mno-leaf-id-shared-library
14021 Do not assume that the code being compiled won't link against any
14022 ID shared libraries. Slower code is generated for jump and call
14023 insns.
14024
14025 -mshared-library-id=n
14026 Specifies the identification number of the ID-based shared library
14027 being compiled. Specifying a value of 0 generates more compact
14028 code; specifying other values forces the allocation of that number
14029 to the current library but is no more space- or time-efficient than
14030 omitting this option.
14031
14032 -msep-data
14033 Generate code that allows the data segment to be located in a
14034 different area of memory from the text segment. This allows for
14035 execute in place in an environment without virtual memory
14036 management by eliminating relocations against the text section.
14037
14038 -mno-sep-data
14039 Generate code that assumes that the data segment follows the text
14040 segment. This is the default.
14041
14042 -mlong-calls
14043 -mno-long-calls
14044 Tells the compiler to perform function calls by first loading the
14045 address of the function into a register and then performing a
14046 subroutine call on this register. This switch is needed if the
14047 target function lies outside of the 24-bit addressing range of the
14048 offset-based version of subroutine call instruction.
14049
14050 This feature is not enabled by default. Specifying -mno-long-calls
14051 restores the default behavior. Note these switches have no effect
14052 on how the compiler generates code to handle function calls via
14053 function pointers.
14054
14055 -mfast-fp
14056 Link with the fast floating-point library. This library relaxes
14057 some of the IEEE floating-point standard's rules for checking
14058 inputs against Not-a-Number (NAN), in the interest of performance.
14059
14060 -minline-plt
14061 Enable inlining of PLT entries in function calls to functions that
14062 are not known to bind locally. It has no effect without -mfdpic.
14063
14064 -mmulticore
14065 Build a standalone application for multicore Blackfin processors.
14066 This option causes proper start files and link scripts supporting
14067 multicore to be used, and defines the macro "__BFIN_MULTICORE". It
14068 can only be used with -mcpu=bf561[-sirevision].
14069
14070 This option can be used with -mcorea or -mcoreb, which selects the
14071 one-application-per-core programming model. Without -mcorea or
14072 -mcoreb, the single-application/dual-core programming model is
14073 used. In this model, the main function of Core B should be named as
14074 "coreb_main".
14075
14076 If this option is not used, the single-core application programming
14077 model is used.
14078
14079 -mcorea
14080 Build a standalone application for Core A of BF561 when using the
14081 one-application-per-core programming model. Proper start files and
14082 link scripts are used to support Core A, and the macro
14083 "__BFIN_COREA" is defined. This option can only be used in
14084 conjunction with -mmulticore.
14085
14086 -mcoreb
14087 Build a standalone application for Core B of BF561 when using the
14088 one-application-per-core programming model. Proper start files and
14089 link scripts are used to support Core B, and the macro
14090 "__BFIN_COREB" is defined. When this option is used, "coreb_main"
14091 should be used instead of "main". This option can only be used in
14092 conjunction with -mmulticore.
14093
14094 -msdram
14095 Build a standalone application for SDRAM. Proper start files and
14096 link scripts are used to put the application into SDRAM, and the
14097 macro "__BFIN_SDRAM" is defined. The loader should initialize
14098 SDRAM before loading the application.
14099
14100 -micplb
14101 Assume that ICPLBs are enabled at run time. This has an effect on
14102 certain anomaly workarounds. For Linux targets, the default is to
14103 assume ICPLBs are enabled; for standalone applications the default
14104 is off.
14105
14106 C6X Options
14107
14108 -march=name
14109 This specifies the name of the target architecture. GCC uses this
14110 name to determine what kind of instructions it can emit when
14111 generating assembly code. Permissible names are: c62x, c64x,
14112 c64x+, c67x, c67x+, c674x.
14113
14114 -mbig-endian
14115 Generate code for a big-endian target.
14116
14117 -mlittle-endian
14118 Generate code for a little-endian target. This is the default.
14119
14120 -msim
14121 Choose startup files and linker script suitable for the simulator.
14122
14123 -msdata=default
14124 Put small global and static data in the ".neardata" section, which
14125 is pointed to by register "B14". Put small uninitialized global
14126 and static data in the ".bss" section, which is adjacent to the
14127 ".neardata" section. Put small read-only data into the ".rodata"
14128 section. The corresponding sections used for large pieces of data
14129 are ".fardata", ".far" and ".const".
14130
14131 -msdata=all
14132 Put all data, not just small objects, into the sections reserved
14133 for small data, and use addressing relative to the "B14" register
14134 to access them.
14135
14136 -msdata=none
14137 Make no use of the sections reserved for small data, and use
14138 absolute addresses to access all data. Put all initialized global
14139 and static data in the ".fardata" section, and all uninitialized
14140 data in the ".far" section. Put all constant data into the
14141 ".const" section.
14142
14143 CRIS Options
14144
14145 These options are defined specifically for the CRIS ports.
14146
14147 -march=architecture-type
14148 -mcpu=architecture-type
14149 Generate code for the specified architecture. The choices for
14150 architecture-type are v3, v8 and v10 for respectively ETRAX 4,
14151 ETRAX 100, and ETRAX 100 LX. Default is v0 except for cris-axis-
14152 linux-gnu, where the default is v10.
14153
14154 -mtune=architecture-type
14155 Tune to architecture-type everything applicable about the generated
14156 code, except for the ABI and the set of available instructions.
14157 The choices for architecture-type are the same as for
14158 -march=architecture-type.
14159
14160 -mmax-stack-frame=n
14161 Warn when the stack frame of a function exceeds n bytes.
14162
14163 -metrax4
14164 -metrax100
14165 The options -metrax4 and -metrax100 are synonyms for -march=v3 and
14166 -march=v8 respectively.
14167
14168 -mmul-bug-workaround
14169 -mno-mul-bug-workaround
14170 Work around a bug in the "muls" and "mulu" instructions for CPU
14171 models where it applies. This option is active by default.
14172
14173 -mpdebug
14174 Enable CRIS-specific verbose debug-related information in the
14175 assembly code. This option also has the effect of turning off the
14176 #NO_APP formatted-code indicator to the assembler at the beginning
14177 of the assembly file.
14178
14179 -mcc-init
14180 Do not use condition-code results from previous instruction; always
14181 emit compare and test instructions before use of condition codes.
14182
14183 -mno-side-effects
14184 Do not emit instructions with side effects in addressing modes
14185 other than post-increment.
14186
14187 -mstack-align
14188 -mno-stack-align
14189 -mdata-align
14190 -mno-data-align
14191 -mconst-align
14192 -mno-const-align
14193 These options (no- options) arrange (eliminate arrangements) for
14194 the stack frame, individual data and constants to be aligned for
14195 the maximum single data access size for the chosen CPU model. The
14196 default is to arrange for 32-bit alignment. ABI details such as
14197 structure layout are not affected by these options.
14198
14199 -m32-bit
14200 -m16-bit
14201 -m8-bit
14202 Similar to the stack- data- and const-align options above, these
14203 options arrange for stack frame, writable data and constants to all
14204 be 32-bit, 16-bit or 8-bit aligned. The default is 32-bit
14205 alignment.
14206
14207 -mno-prologue-epilogue
14208 -mprologue-epilogue
14209 With -mno-prologue-epilogue, the normal function prologue and
14210 epilogue which set up the stack frame are omitted and no return
14211 instructions or return sequences are generated in the code. Use
14212 this option only together with visual inspection of the compiled
14213 code: no warnings or errors are generated when call-saved registers
14214 must be saved, or storage for local variables needs to be
14215 allocated.
14216
14217 -mno-gotplt
14218 -mgotplt
14219 With -fpic and -fPIC, don't generate (do generate) instruction
14220 sequences that load addresses for functions from the PLT part of
14221 the GOT rather than (traditional on other architectures) calls to
14222 the PLT. The default is -mgotplt.
14223
14224 -melf
14225 Legacy no-op option only recognized with the cris-axis-elf and
14226 cris-axis-linux-gnu targets.
14227
14228 -mlinux
14229 Legacy no-op option only recognized with the cris-axis-linux-gnu
14230 target.
14231
14232 -sim
14233 This option, recognized for the cris-axis-elf, arranges to link
14234 with input-output functions from a simulator library. Code,
14235 initialized data and zero-initialized data are allocated
14236 consecutively.
14237
14238 -sim2
14239 Like -sim, but pass linker options to locate initialized data at
14240 0x40000000 and zero-initialized data at 0x80000000.
14241
14242 CR16 Options
14243
14244 These options are defined specifically for the CR16 ports.
14245
14246 -mmac
14247 Enable the use of multiply-accumulate instructions. Disabled by
14248 default.
14249
14250 -mcr16cplus
14251 -mcr16c
14252 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture
14253 is default.
14254
14255 -msim
14256 Links the library libsim.a which is in compatible with simulator.
14257 Applicable to ELF compiler only.
14258
14259 -mint32
14260 Choose integer type as 32-bit wide.
14261
14262 -mbit-ops
14263 Generates "sbit"/"cbit" instructions for bit manipulations.
14264
14265 -mdata-model=model
14266 Choose a data model. The choices for model are near, far or medium.
14267 medium is default. However, far is not valid with -mcr16c, as the
14268 CR16C architecture does not support the far data model.
14269
14270 Darwin Options
14271
14272 These options are defined for all architectures running the Darwin
14273 operating system.
14274
14275 FSF GCC on Darwin does not create "fat" object files; it creates an
14276 object file for the single architecture that GCC was built to target.
14277 Apple's GCC on Darwin does create "fat" files if multiple -arch options
14278 are used; it does so by running the compiler or linker multiple times
14279 and joining the results together with lipo.
14280
14281 The subtype of the file created (like ppc7400 or ppc970 or i686) is
14282 determined by the flags that specify the ISA that GCC is targeting,
14283 like -mcpu or -march. The -force_cpusubtype_ALL option can be used to
14284 override this.
14285
14286 The Darwin tools vary in their behavior when presented with an ISA
14287 mismatch. The assembler, as, only permits instructions to be used that
14288 are valid for the subtype of the file it is generating, so you cannot
14289 put 64-bit instructions in a ppc750 object file. The linker for shared
14290 libraries, /usr/bin/libtool, fails and prints an error if asked to
14291 create a shared library with a less restrictive subtype than its input
14292 files (for instance, trying to put a ppc970 object file in a ppc7400
14293 library). The linker for executables, ld, quietly gives the executable
14294 the most restrictive subtype of any of its input files.
14295
14296 -Fdir
14297 Add the framework directory dir to the head of the list of
14298 directories to be searched for header files. These directories are
14299 interleaved with those specified by -I options and are scanned in a
14300 left-to-right order.
14301
14302 A framework directory is a directory with frameworks in it. A
14303 framework is a directory with a Headers and/or PrivateHeaders
14304 directory contained directly in it that ends in .framework. The
14305 name of a framework is the name of this directory excluding the
14306 .framework. Headers associated with the framework are found in one
14307 of those two directories, with Headers being searched first. A
14308 subframework is a framework directory that is in a framework's
14309 Frameworks directory. Includes of subframework headers can only
14310 appear in a header of a framework that contains the subframework,
14311 or in a sibling subframework header. Two subframeworks are
14312 siblings if they occur in the same framework. A subframework
14313 should not have the same name as a framework; a warning is issued
14314 if this is violated. Currently a subframework cannot have
14315 subframeworks; in the future, the mechanism may be extended to
14316 support this. The standard frameworks can be found in
14317 /System/Library/Frameworks and /Library/Frameworks. An example
14318 include looks like "#include <Framework/header.h>", where Framework
14319 denotes the name of the framework and header.h is found in the
14320 PrivateHeaders or Headers directory.
14321
14322 -iframeworkdir
14323 Like -F except the directory is a treated as a system directory.
14324 The main difference between this -iframework and -F is that with
14325 -iframework the compiler does not warn about constructs contained
14326 within header files found via dir. This option is valid only for
14327 the C family of languages.
14328
14329 -gused
14330 Emit debugging information for symbols that are used. For stabs
14331 debugging format, this enables -feliminate-unused-debug-symbols.
14332 This is by default ON.
14333
14334 -gfull
14335 Emit debugging information for all symbols and types.
14336
14337 -mmacosx-version-min=version
14338 The earliest version of MacOS X that this executable will run on is
14339 version. Typical values of version include 10.1, 10.2, and 10.3.9.
14340
14341 If the compiler was built to use the system's headers by default,
14342 then the default for this option is the system version on which the
14343 compiler is running, otherwise the default is to make choices that
14344 are compatible with as many systems and code bases as possible.
14345
14346 -mkernel
14347 Enable kernel development mode. The -mkernel option sets -static,
14348 -fno-common, -fno-use-cxa-atexit, -fno-exceptions,
14349 -fno-non-call-exceptions, -fapple-kext, -fno-weak and -fno-rtti
14350 where applicable. This mode also sets -mno-altivec, -msoft-float,
14351 -fno-builtin and -mlong-branch for PowerPC targets.
14352
14353 -mone-byte-bool
14354 Override the defaults for "bool" so that "sizeof(bool)==1". By
14355 default "sizeof(bool)" is 4 when compiling for Darwin/PowerPC and 1
14356 when compiling for Darwin/x86, so this option has no effect on x86.
14357
14358 Warning: The -mone-byte-bool switch causes GCC to generate code
14359 that is not binary compatible with code generated without that
14360 switch. Using this switch may require recompiling all other
14361 modules in a program, including system libraries. Use this switch
14362 to conform to a non-default data model.
14363
14364 -mfix-and-continue
14365 -ffix-and-continue
14366 -findirect-data
14367 Generate code suitable for fast turnaround development, such as to
14368 allow GDB to dynamically load .o files into already-running
14369 programs. -findirect-data and -ffix-and-continue are provided for
14370 backwards compatibility.
14371
14372 -all_load
14373 Loads all members of static archive libraries. See man ld(1) for
14374 more information.
14375
14376 -arch_errors_fatal
14377 Cause the errors having to do with files that have the wrong
14378 architecture to be fatal.
14379
14380 -bind_at_load
14381 Causes the output file to be marked such that the dynamic linker
14382 will bind all undefined references when the file is loaded or
14383 launched.
14384
14385 -bundle
14386 Produce a Mach-o bundle format file. See man ld(1) for more
14387 information.
14388
14389 -bundle_loader executable
14390 This option specifies the executable that will load the build
14391 output file being linked. See man ld(1) for more information.
14392
14393 -dynamiclib
14394 When passed this option, GCC produces a dynamic library instead of
14395 an executable when linking, using the Darwin libtool command.
14396
14397 -force_cpusubtype_ALL
14398 This causes GCC's output file to have the ALL subtype, instead of
14399 one controlled by the -mcpu or -march option.
14400
14401 -allowable_client client_name
14402 -client_name
14403 -compatibility_version
14404 -current_version
14405 -dead_strip
14406 -dependency-file
14407 -dylib_file
14408 -dylinker_install_name
14409 -dynamic
14410 -exported_symbols_list
14411 -filelist
14412 -flat_namespace
14413 -force_flat_namespace
14414 -headerpad_max_install_names
14415 -image_base
14416 -init
14417 -install_name
14418 -keep_private_externs
14419 -multi_module
14420 -multiply_defined
14421 -multiply_defined_unused
14422 -noall_load
14423 -no_dead_strip_inits_and_terms
14424 -nofixprebinding
14425 -nomultidefs
14426 -noprebind
14427 -noseglinkedit
14428 -pagezero_size
14429 -prebind
14430 -prebind_all_twolevel_modules
14431 -private_bundle
14432 -read_only_relocs
14433 -sectalign
14434 -sectobjectsymbols
14435 -whyload
14436 -seg1addr
14437 -sectcreate
14438 -sectobjectsymbols
14439 -sectorder
14440 -segaddr
14441 -segs_read_only_addr
14442 -segs_read_write_addr
14443 -seg_addr_table
14444 -seg_addr_table_filename
14445 -seglinkedit
14446 -segprot
14447 -segs_read_only_addr
14448 -segs_read_write_addr
14449 -single_module
14450 -static
14451 -sub_library
14452 -sub_umbrella
14453 -twolevel_namespace
14454 -umbrella
14455 -undefined
14456 -unexported_symbols_list
14457 -weak_reference_mismatches
14458 -whatsloaded
14459 These options are passed to the Darwin linker. The Darwin linker
14460 man page describes them in detail.
14461
14462 DEC Alpha Options
14463
14464 These -m options are defined for the DEC Alpha implementations:
14465
14466 -mno-soft-float
14467 -msoft-float
14468 Use (do not use) the hardware floating-point instructions for
14469 floating-point operations. When -msoft-float is specified,
14470 functions in libgcc.a are used to perform floating-point
14471 operations. Unless they are replaced by routines that emulate the
14472 floating-point operations, or compiled in such a way as to call
14473 such emulations routines, these routines issue floating-point
14474 operations. If you are compiling for an Alpha without floating-
14475 point operations, you must ensure that the library is built so as
14476 not to call them.
14477
14478 Note that Alpha implementations without floating-point operations
14479 are required to have floating-point registers.
14480
14481 -mfp-reg
14482 -mno-fp-regs
14483 Generate code that uses (does not use) the floating-point register
14484 set. -mno-fp-regs implies -msoft-float. If the floating-point
14485 register set is not used, floating-point operands are passed in
14486 integer registers as if they were integers and floating-point
14487 results are passed in $0 instead of $f0. This is a non-standard
14488 calling sequence, so any function with a floating-point argument or
14489 return value called by code compiled with -mno-fp-regs must also be
14490 compiled with that option.
14491
14492 A typical use of this option is building a kernel that does not
14493 use, and hence need not save and restore, any floating-point
14494 registers.
14495
14496 -mieee
14497 The Alpha architecture implements floating-point hardware optimized
14498 for maximum performance. It is mostly compliant with the IEEE
14499 floating-point standard. However, for full compliance, software
14500 assistance is required. This option generates code fully IEEE-
14501 compliant code except that the inexact-flag is not maintained (see
14502 below). If this option is turned on, the preprocessor macro
14503 "_IEEE_FP" is defined during compilation. The resulting code is
14504 less efficient but is able to correctly support denormalized
14505 numbers and exceptional IEEE values such as not-a-number and
14506 plus/minus infinity. Other Alpha compilers call this option
14507 -ieee_with_no_inexact.
14508
14509 -mieee-with-inexact
14510 This is like -mieee except the generated code also maintains the
14511 IEEE inexact-flag. Turning on this option causes the generated
14512 code to implement fully-compliant IEEE math. In addition to
14513 "_IEEE_FP", "_IEEE_FP_EXACT" is defined as a preprocessor macro.
14514 On some Alpha implementations the resulting code may execute
14515 significantly slower than the code generated by default. Since
14516 there is very little code that depends on the inexact-flag, you
14517 should normally not specify this option. Other Alpha compilers
14518 call this option -ieee_with_inexact.
14519
14520 -mfp-trap-mode=trap-mode
14521 This option controls what floating-point related traps are enabled.
14522 Other Alpha compilers call this option -fptm trap-mode. The trap
14523 mode can be set to one of four values:
14524
14525 n This is the default (normal) setting. The only traps that are
14526 enabled are the ones that cannot be disabled in software (e.g.,
14527 division by zero trap).
14528
14529 u In addition to the traps enabled by n, underflow traps are
14530 enabled as well.
14531
14532 su Like u, but the instructions are marked to be safe for software
14533 completion (see Alpha architecture manual for details).
14534
14535 sui Like su, but inexact traps are enabled as well.
14536
14537 -mfp-rounding-mode=rounding-mode
14538 Selects the IEEE rounding mode. Other Alpha compilers call this
14539 option -fprm rounding-mode. The rounding-mode can be one of:
14540
14541 n Normal IEEE rounding mode. Floating-point numbers are rounded
14542 towards the nearest machine number or towards the even machine
14543 number in case of a tie.
14544
14545 m Round towards minus infinity.
14546
14547 c Chopped rounding mode. Floating-point numbers are rounded
14548 towards zero.
14549
14550 d Dynamic rounding mode. A field in the floating-point control
14551 register (fpcr, see Alpha architecture reference manual)
14552 controls the rounding mode in effect. The C library
14553 initializes this register for rounding towards plus infinity.
14554 Thus, unless your program modifies the fpcr, d corresponds to
14555 round towards plus infinity.
14556
14557 -mtrap-precision=trap-precision
14558 In the Alpha architecture, floating-point traps are imprecise.
14559 This means without software assistance it is impossible to recover
14560 from a floating trap and program execution normally needs to be
14561 terminated. GCC can generate code that can assist operating system
14562 trap handlers in determining the exact location that caused a
14563 floating-point trap. Depending on the requirements of an
14564 application, different levels of precisions can be selected:
14565
14566 p Program precision. This option is the default and means a trap
14567 handler can only identify which program caused a floating-point
14568 exception.
14569
14570 f Function precision. The trap handler can determine the
14571 function that caused a floating-point exception.
14572
14573 i Instruction precision. The trap handler can determine the
14574 exact instruction that caused a floating-point exception.
14575
14576 Other Alpha compilers provide the equivalent options called
14577 -scope_safe and -resumption_safe.
14578
14579 -mieee-conformant
14580 This option marks the generated code as IEEE conformant. You must
14581 not use this option unless you also specify -mtrap-precision=i and
14582 either -mfp-trap-mode=su or -mfp-trap-mode=sui. Its only effect is
14583 to emit the line .eflag 48 in the function prologue of the
14584 generated assembly file.
14585
14586 -mbuild-constants
14587 Normally GCC examines a 32- or 64-bit integer constant to see if it
14588 can construct it from smaller constants in two or three
14589 instructions. If it cannot, it outputs the constant as a literal
14590 and generates code to load it from the data segment at run time.
14591
14592 Use this option to require GCC to construct all integer constants
14593 using code, even if it takes more instructions (the maximum is
14594 six).
14595
14596 You typically use this option to build a shared library dynamic
14597 loader. Itself a shared library, it must relocate itself in memory
14598 before it can find the variables and constants in its own data
14599 segment.
14600
14601 -mbwx
14602 -mno-bwx
14603 -mcix
14604 -mno-cix
14605 -mfix
14606 -mno-fix
14607 -mmax
14608 -mno-max
14609 Indicate whether GCC should generate code to use the optional BWX,
14610 CIX, FIX and MAX instruction sets. The default is to use the
14611 instruction sets supported by the CPU type specified via -mcpu=
14612 option or that of the CPU on which GCC was built if none is
14613 specified.
14614
14615 -mfloat-vax
14616 -mfloat-ieee
14617 Generate code that uses (does not use) VAX F and G floating-point
14618 arithmetic instead of IEEE single and double precision.
14619
14620 -mexplicit-relocs
14621 -mno-explicit-relocs
14622 Older Alpha assemblers provided no way to generate symbol
14623 relocations except via assembler macros. Use of these macros does
14624 not allow optimal instruction scheduling. GNU binutils as of
14625 version 2.12 supports a new syntax that allows the compiler to
14626 explicitly mark which relocations should apply to which
14627 instructions. This option is mostly useful for debugging, as GCC
14628 detects the capabilities of the assembler when it is built and sets
14629 the default accordingly.
14630
14631 -msmall-data
14632 -mlarge-data
14633 When -mexplicit-relocs is in effect, static data is accessed via
14634 gp-relative relocations. When -msmall-data is used, objects 8
14635 bytes long or smaller are placed in a small data area (the ".sdata"
14636 and ".sbss" sections) and are accessed via 16-bit relocations off
14637 of the $gp register. This limits the size of the small data area
14638 to 64KB, but allows the variables to be directly accessed via a
14639 single instruction.
14640
14641 The default is -mlarge-data. With this option the data area is
14642 limited to just below 2GB. Programs that require more than 2GB of
14643 data must use "malloc" or "mmap" to allocate the data in the heap
14644 instead of in the program's data segment.
14645
14646 When generating code for shared libraries, -fpic implies
14647 -msmall-data and -fPIC implies -mlarge-data.
14648
14649 -msmall-text
14650 -mlarge-text
14651 When -msmall-text is used, the compiler assumes that the code of
14652 the entire program (or shared library) fits in 4MB, and is thus
14653 reachable with a branch instruction. When -msmall-data is used,
14654 the compiler can assume that all local symbols share the same $gp
14655 value, and thus reduce the number of instructions required for a
14656 function call from 4 to 1.
14657
14658 The default is -mlarge-text.
14659
14660 -mcpu=cpu_type
14661 Set the instruction set and instruction scheduling parameters for
14662 machine type cpu_type. You can specify either the EV style name or
14663 the corresponding chip number. GCC supports scheduling parameters
14664 for the EV4, EV5 and EV6 family of processors and chooses the
14665 default values for the instruction set from the processor you
14666 specify. If you do not specify a processor type, GCC defaults to
14667 the processor on which the compiler was built.
14668
14669 Supported values for cpu_type are
14670
14671 ev4
14672 ev45
14673 21064
14674 Schedules as an EV4 and has no instruction set extensions.
14675
14676 ev5
14677 21164
14678 Schedules as an EV5 and has no instruction set extensions.
14679
14680 ev56
14681 21164a
14682 Schedules as an EV5 and supports the BWX extension.
14683
14684 pca56
14685 21164pc
14686 21164PC
14687 Schedules as an EV5 and supports the BWX and MAX extensions.
14688
14689 ev6
14690 21264
14691 Schedules as an EV6 and supports the BWX, FIX, and MAX
14692 extensions.
14693
14694 ev67
14695 21264a
14696 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX
14697 extensions.
14698
14699 Native toolchains also support the value native, which selects the
14700 best architecture option for the host processor. -mcpu=native has
14701 no effect if GCC does not recognize the processor.
14702
14703 -mtune=cpu_type
14704 Set only the instruction scheduling parameters for machine type
14705 cpu_type. The instruction set is not changed.
14706
14707 Native toolchains also support the value native, which selects the
14708 best architecture option for the host processor. -mtune=native has
14709 no effect if GCC does not recognize the processor.
14710
14711 -mmemory-latency=time
14712 Sets the latency the scheduler should assume for typical memory
14713 references as seen by the application. This number is highly
14714 dependent on the memory access patterns used by the application and
14715 the size of the external cache on the machine.
14716
14717 Valid options for time are
14718
14719 number
14720 A decimal number representing clock cycles.
14721
14722 L1
14723 L2
14724 L3
14725 main
14726 The compiler contains estimates of the number of clock cycles
14727 for "typical" EV4 & EV5 hardware for the Level 1, 2 & 3 caches
14728 (also called Dcache, Scache, and Bcache), as well as to main
14729 memory. Note that L3 is only valid for EV5.
14730
14731 FR30 Options
14732
14733 These options are defined specifically for the FR30 port.
14734
14735 -msmall-model
14736 Use the small address space model. This can produce smaller code,
14737 but it does assume that all symbolic values and addresses fit into
14738 a 20-bit range.
14739
14740 -mno-lsim
14741 Assume that runtime support has been provided and so there is no
14742 need to include the simulator library (libsim.a) on the linker
14743 command line.
14744
14745 FT32 Options
14746
14747 These options are defined specifically for the FT32 port.
14748
14749 -msim
14750 Specifies that the program will be run on the simulator. This
14751 causes an alternate runtime startup and library to be linked. You
14752 must not use this option when generating programs that will run on
14753 real hardware; you must provide your own runtime library for
14754 whatever I/O functions are needed.
14755
14756 -mlra
14757 Enable Local Register Allocation. This is still experimental for
14758 FT32, so by default the compiler uses standard reload.
14759
14760 -mnodiv
14761 Do not use div and mod instructions.
14762
14763 FRV Options
14764
14765 -mgpr-32
14766 Only use the first 32 general-purpose registers.
14767
14768 -mgpr-64
14769 Use all 64 general-purpose registers.
14770
14771 -mfpr-32
14772 Use only the first 32 floating-point registers.
14773
14774 -mfpr-64
14775 Use all 64 floating-point registers.
14776
14777 -mhard-float
14778 Use hardware instructions for floating-point operations.
14779
14780 -msoft-float
14781 Use library routines for floating-point operations.
14782
14783 -malloc-cc
14784 Dynamically allocate condition code registers.
14785
14786 -mfixed-cc
14787 Do not try to dynamically allocate condition code registers, only
14788 use "icc0" and "fcc0".
14789
14790 -mdword
14791 Change ABI to use double word insns.
14792
14793 -mno-dword
14794 Do not use double word instructions.
14795
14796 -mdouble
14797 Use floating-point double instructions.
14798
14799 -mno-double
14800 Do not use floating-point double instructions.
14801
14802 -mmedia
14803 Use media instructions.
14804
14805 -mno-media
14806 Do not use media instructions.
14807
14808 -mmuladd
14809 Use multiply and add/subtract instructions.
14810
14811 -mno-muladd
14812 Do not use multiply and add/subtract instructions.
14813
14814 -mfdpic
14815 Select the FDPIC ABI, which uses function descriptors to represent
14816 pointers to functions. Without any PIC/PIE-related options, it
14817 implies -fPIE. With -fpic or -fpie, it assumes GOT entries and
14818 small data are within a 12-bit range from the GOT base address;
14819 with -fPIC or -fPIE, GOT offsets are computed with 32 bits. With a
14820 bfin-elf target, this option implies -msim.
14821
14822 -minline-plt
14823 Enable inlining of PLT entries in function calls to functions that
14824 are not known to bind locally. It has no effect without -mfdpic.
14825 It's enabled by default if optimizing for speed and compiling for
14826 shared libraries (i.e., -fPIC or -fpic), or when an optimization
14827 option such as -O3 or above is present in the command line.
14828
14829 -mTLS
14830 Assume a large TLS segment when generating thread-local code.
14831
14832 -mtls
14833 Do not assume a large TLS segment when generating thread-local
14834 code.
14835
14836 -mgprel-ro
14837 Enable the use of "GPREL" relocations in the FDPIC ABI for data
14838 that is known to be in read-only sections. It's enabled by
14839 default, except for -fpic or -fpie: even though it may help make
14840 the global offset table smaller, it trades 1 instruction for 4.
14841 With -fPIC or -fPIE, it trades 3 instructions for 4, one of which
14842 may be shared by multiple symbols, and it avoids the need for a GOT
14843 entry for the referenced symbol, so it's more likely to be a win.
14844 If it is not, -mno-gprel-ro can be used to disable it.
14845
14846 -multilib-library-pic
14847 Link with the (library, not FD) pic libraries. It's implied by
14848 -mlibrary-pic, as well as by -fPIC and -fpic without -mfdpic. You
14849 should never have to use it explicitly.
14850
14851 -mlinked-fp
14852 Follow the EABI requirement of always creating a frame pointer
14853 whenever a stack frame is allocated. This option is enabled by
14854 default and can be disabled with -mno-linked-fp.
14855
14856 -mlong-calls
14857 Use indirect addressing to call functions outside the current
14858 compilation unit. This allows the functions to be placed anywhere
14859 within the 32-bit address space.
14860
14861 -malign-labels
14862 Try to align labels to an 8-byte boundary by inserting NOPs into
14863 the previous packet. This option only has an effect when VLIW
14864 packing is enabled. It doesn't create new packets; it merely adds
14865 NOPs to existing ones.
14866
14867 -mlibrary-pic
14868 Generate position-independent EABI code.
14869
14870 -macc-4
14871 Use only the first four media accumulator registers.
14872
14873 -macc-8
14874 Use all eight media accumulator registers.
14875
14876 -mpack
14877 Pack VLIW instructions.
14878
14879 -mno-pack
14880 Do not pack VLIW instructions.
14881
14882 -mno-eflags
14883 Do not mark ABI switches in e_flags.
14884
14885 -mcond-move
14886 Enable the use of conditional-move instructions (default).
14887
14888 This switch is mainly for debugging the compiler and will likely be
14889 removed in a future version.
14890
14891 -mno-cond-move
14892 Disable the use of conditional-move instructions.
14893
14894 This switch is mainly for debugging the compiler and will likely be
14895 removed in a future version.
14896
14897 -mscc
14898 Enable the use of conditional set instructions (default).
14899
14900 This switch is mainly for debugging the compiler and will likely be
14901 removed in a future version.
14902
14903 -mno-scc
14904 Disable the use of conditional set instructions.
14905
14906 This switch is mainly for debugging the compiler and will likely be
14907 removed in a future version.
14908
14909 -mcond-exec
14910 Enable the use of conditional execution (default).
14911
14912 This switch is mainly for debugging the compiler and will likely be
14913 removed in a future version.
14914
14915 -mno-cond-exec
14916 Disable the use of conditional execution.
14917
14918 This switch is mainly for debugging the compiler and will likely be
14919 removed in a future version.
14920
14921 -mvliw-branch
14922 Run a pass to pack branches into VLIW instructions (default).
14923
14924 This switch is mainly for debugging the compiler and will likely be
14925 removed in a future version.
14926
14927 -mno-vliw-branch
14928 Do not run a pass to pack branches into VLIW instructions.
14929
14930 This switch is mainly for debugging the compiler and will likely be
14931 removed in a future version.
14932
14933 -mmulti-cond-exec
14934 Enable optimization of "&&" and "||" in conditional execution
14935 (default).
14936
14937 This switch is mainly for debugging the compiler and will likely be
14938 removed in a future version.
14939
14940 -mno-multi-cond-exec
14941 Disable optimization of "&&" and "||" in conditional execution.
14942
14943 This switch is mainly for debugging the compiler and will likely be
14944 removed in a future version.
14945
14946 -mnested-cond-exec
14947 Enable nested conditional execution optimizations (default).
14948
14949 This switch is mainly for debugging the compiler and will likely be
14950 removed in a future version.
14951
14952 -mno-nested-cond-exec
14953 Disable nested conditional execution optimizations.
14954
14955 This switch is mainly for debugging the compiler and will likely be
14956 removed in a future version.
14957
14958 -moptimize-membar
14959 This switch removes redundant "membar" instructions from the
14960 compiler-generated code. It is enabled by default.
14961
14962 -mno-optimize-membar
14963 This switch disables the automatic removal of redundant "membar"
14964 instructions from the generated code.
14965
14966 -mtomcat-stats
14967 Cause gas to print out tomcat statistics.
14968
14969 -mcpu=cpu
14970 Select the processor type for which to generate code. Possible
14971 values are frv, fr550, tomcat, fr500, fr450, fr405, fr400, fr300
14972 and simple.
14973
14974 GNU/Linux Options
14975
14976 These -m options are defined for GNU/Linux targets:
14977
14978 -mglibc
14979 Use the GNU C library. This is the default except on
14980 *-*-linux-*uclibc*, *-*-linux-*musl* and *-*-linux-*android*
14981 targets.
14982
14983 -muclibc
14984 Use uClibc C library. This is the default on *-*-linux-*uclibc*
14985 targets.
14986
14987 -mmusl
14988 Use the musl C library. This is the default on *-*-linux-*musl*
14989 targets.
14990
14991 -mbionic
14992 Use Bionic C library. This is the default on *-*-linux-*android*
14993 targets.
14994
14995 -mandroid
14996 Compile code compatible with Android platform. This is the default
14997 on *-*-linux-*android* targets.
14998
14999 When compiling, this option enables -mbionic, -fPIC,
15000 -fno-exceptions and -fno-rtti by default. When linking, this
15001 option makes the GCC driver pass Android-specific options to the
15002 linker. Finally, this option causes the preprocessor macro
15003 "__ANDROID__" to be defined.
15004
15005 -tno-android-cc
15006 Disable compilation effects of -mandroid, i.e., do not enable
15007 -mbionic, -fPIC, -fno-exceptions and -fno-rtti by default.
15008
15009 -tno-android-ld
15010 Disable linking effects of -mandroid, i.e., pass standard Linux
15011 linking options to the linker.
15012
15013 H8/300 Options
15014
15015 These -m options are defined for the H8/300 implementations:
15016
15017 -mrelax
15018 Shorten some address references at link time, when possible; uses
15019 the linker option -relax.
15020
15021 -mh Generate code for the H8/300H.
15022
15023 -ms Generate code for the H8S.
15024
15025 -mn Generate code for the H8S and H8/300H in the normal mode. This
15026 switch must be used either with -mh or -ms.
15027
15028 -ms2600
15029 Generate code for the H8S/2600. This switch must be used with -ms.
15030
15031 -mexr
15032 Extended registers are stored on stack before execution of function
15033 with monitor attribute. Default option is -mexr. This option is
15034 valid only for H8S targets.
15035
15036 -mno-exr
15037 Extended registers are not stored on stack before execution of
15038 function with monitor attribute. Default option is -mno-exr. This
15039 option is valid only for H8S targets.
15040
15041 -mint32
15042 Make "int" data 32 bits by default.
15043
15044 -malign-300
15045 On the H8/300H and H8S, use the same alignment rules as for the
15046 H8/300. The default for the H8/300H and H8S is to align longs and
15047 floats on 4-byte boundaries. -malign-300 causes them to be aligned
15048 on 2-byte boundaries. This option has no effect on the H8/300.
15049
15050 HPPA Options
15051
15052 These -m options are defined for the HPPA family of computers:
15053
15054 -march=architecture-type
15055 Generate code for the specified architecture. The choices for
15056 architecture-type are 1.0 for PA 1.0, 1.1 for PA 1.1, and 2.0 for
15057 PA 2.0 processors. Refer to /usr/lib/sched.models on an HP-UX
15058 system to determine the proper architecture option for your
15059 machine. Code compiled for lower numbered architectures runs on
15060 higher numbered architectures, but not the other way around.
15061
15062 -mpa-risc-1-0
15063 -mpa-risc-1-1
15064 -mpa-risc-2-0
15065 Synonyms for -march=1.0, -march=1.1, and -march=2.0 respectively.
15066
15067 -mcaller-copies
15068 The caller copies function arguments passed by hidden reference.
15069 This option should be used with care as it is not compatible with
15070 the default 32-bit runtime. However, only aggregates larger than
15071 eight bytes are passed by hidden reference and the option provides
15072 better compatibility with OpenMP.
15073
15074 -mjump-in-delay
15075 This option is ignored and provided for compatibility purposes
15076 only.
15077
15078 -mdisable-fpregs
15079 Prevent floating-point registers from being used in any manner.
15080 This is necessary for compiling kernels that perform lazy context
15081 switching of floating-point registers. If you use this option and
15082 attempt to perform floating-point operations, the compiler aborts.
15083
15084 -mdisable-indexing
15085 Prevent the compiler from using indexing address modes. This
15086 avoids some rather obscure problems when compiling MIG generated
15087 code under MACH.
15088
15089 -mno-space-regs
15090 Generate code that assumes the target has no space registers. This
15091 allows GCC to generate faster indirect calls and use unscaled index
15092 address modes.
15093
15094 Such code is suitable for level 0 PA systems and kernels.
15095
15096 -mfast-indirect-calls
15097 Generate code that assumes calls never cross space boundaries.
15098 This allows GCC to emit code that performs faster indirect calls.
15099
15100 This option does not work in the presence of shared libraries or
15101 nested functions.
15102
15103 -mfixed-range=register-range
15104 Generate code treating the given register range as fixed registers.
15105 A fixed register is one that the register allocator cannot use.
15106 This is useful when compiling kernel code. A register range is
15107 specified as two registers separated by a dash. Multiple register
15108 ranges can be specified separated by a comma.
15109
15110 -mlong-load-store
15111 Generate 3-instruction load and store sequences as sometimes
15112 required by the HP-UX 10 linker. This is equivalent to the +k
15113 option to the HP compilers.
15114
15115 -mportable-runtime
15116 Use the portable calling conventions proposed by HP for ELF
15117 systems.
15118
15119 -mgas
15120 Enable the use of assembler directives only GAS understands.
15121
15122 -mschedule=cpu-type
15123 Schedule code according to the constraints for the machine type
15124 cpu-type. The choices for cpu-type are 700 7100, 7100LC, 7200,
15125 7300 and 8000. Refer to /usr/lib/sched.models on an HP-UX system
15126 to determine the proper scheduling option for your machine. The
15127 default scheduling is 8000.
15128
15129 -mlinker-opt
15130 Enable the optimization pass in the HP-UX linker. Note this makes
15131 symbolic debugging impossible. It also triggers a bug in the HP-UX
15132 8 and HP-UX 9 linkers in which they give bogus error messages when
15133 linking some programs.
15134
15135 -msoft-float
15136 Generate output containing library calls for floating point.
15137 Warning: the requisite libraries are not available for all HPPA
15138 targets. Normally the facilities of the machine's usual C compiler
15139 are used, but this cannot be done directly in cross-compilation.
15140 You must make your own arrangements to provide suitable library
15141 functions for cross-compilation.
15142
15143 -msoft-float changes the calling convention in the output file;
15144 therefore, it is only useful if you compile all of a program with
15145 this option. In particular, you need to compile libgcc.a, the
15146 library that comes with GCC, with -msoft-float in order for this to
15147 work.
15148
15149 -msio
15150 Generate the predefine, "_SIO", for server IO. The default is
15151 -mwsio. This generates the predefines, "__hp9000s700",
15152 "__hp9000s700__" and "_WSIO", for workstation IO. These options
15153 are available under HP-UX and HI-UX.
15154
15155 -mgnu-ld
15156 Use options specific to GNU ld. This passes -shared to ld when
15157 building a shared library. It is the default when GCC is
15158 configured, explicitly or implicitly, with the GNU linker. This
15159 option does not affect which ld is called; it only changes what
15160 parameters are passed to that ld. The ld that is called is
15161 determined by the --with-ld configure option, GCC's program search
15162 path, and finally by the user's PATH. The linker used by GCC can
15163 be printed using which `gcc -print-prog-name=ld`. This option is
15164 only available on the 64-bit HP-UX GCC, i.e. configured with
15165 hppa*64*-*-hpux*.
15166
15167 -mhp-ld
15168 Use options specific to HP ld. This passes -b to ld when building
15169 a shared library and passes +Accept TypeMismatch to ld on all
15170 links. It is the default when GCC is configured, explicitly or
15171 implicitly, with the HP linker. This option does not affect which
15172 ld is called; it only changes what parameters are passed to that
15173 ld. The ld that is called is determined by the --with-ld configure
15174 option, GCC's program search path, and finally by the user's PATH.
15175 The linker used by GCC can be printed using which `gcc
15176 -print-prog-name=ld`. This option is only available on the 64-bit
15177 HP-UX GCC, i.e. configured with hppa*64*-*-hpux*.
15178
15179 -mlong-calls
15180 Generate code that uses long call sequences. This ensures that a
15181 call is always able to reach linker generated stubs. The default
15182 is to generate long calls only when the distance from the call site
15183 to the beginning of the function or translation unit, as the case
15184 may be, exceeds a predefined limit set by the branch type being
15185 used. The limits for normal calls are 7,600,000 and 240,000 bytes,
15186 respectively for the PA 2.0 and PA 1.X architectures. Sibcalls are
15187 always limited at 240,000 bytes.
15188
15189 Distances are measured from the beginning of functions when using
15190 the -ffunction-sections option, or when using the -mgas and
15191 -mno-portable-runtime options together under HP-UX with the SOM
15192 linker.
15193
15194 It is normally not desirable to use this option as it degrades
15195 performance. However, it may be useful in large applications,
15196 particularly when partial linking is used to build the application.
15197
15198 The types of long calls used depends on the capabilities of the
15199 assembler and linker, and the type of code being generated. The
15200 impact on systems that support long absolute calls, and long pic
15201 symbol-difference or pc-relative calls should be relatively small.
15202 However, an indirect call is used on 32-bit ELF systems in pic code
15203 and it is quite long.
15204
15205 -munix=unix-std
15206 Generate compiler predefines and select a startfile for the
15207 specified UNIX standard. The choices for unix-std are 93, 95 and
15208 98. 93 is supported on all HP-UX versions. 95 is available on HP-
15209 UX 10.10 and later. 98 is available on HP-UX 11.11 and later. The
15210 default values are 93 for HP-UX 10.00, 95 for HP-UX 10.10 though to
15211 11.00, and 98 for HP-UX 11.11 and later.
15212
15213 -munix=93 provides the same predefines as GCC 3.3 and 3.4.
15214 -munix=95 provides additional predefines for "XOPEN_UNIX" and
15215 "_XOPEN_SOURCE_EXTENDED", and the startfile unix95.o. -munix=98
15216 provides additional predefines for "_XOPEN_UNIX",
15217 "_XOPEN_SOURCE_EXTENDED", "_INCLUDE__STDC_A1_SOURCE" and
15218 "_INCLUDE_XOPEN_SOURCE_500", and the startfile unix98.o.
15219
15220 It is important to note that this option changes the interfaces for
15221 various library routines. It also affects the operational behavior
15222 of the C library. Thus, extreme care is needed in using this
15223 option.
15224
15225 Library code that is intended to operate with more than one UNIX
15226 standard must test, set and restore the variable
15227 "__xpg4_extended_mask" as appropriate. Most GNU software doesn't
15228 provide this capability.
15229
15230 -nolibdld
15231 Suppress the generation of link options to search libdld.sl when
15232 the -static option is specified on HP-UX 10 and later.
15233
15234 -static
15235 The HP-UX implementation of setlocale in libc has a dependency on
15236 libdld.sl. There isn't an archive version of libdld.sl. Thus,
15237 when the -static option is specified, special link options are
15238 needed to resolve this dependency.
15239
15240 On HP-UX 10 and later, the GCC driver adds the necessary options to
15241 link with libdld.sl when the -static option is specified. This
15242 causes the resulting binary to be dynamic. On the 64-bit port, the
15243 linkers generate dynamic binaries by default in any case. The
15244 -nolibdld option can be used to prevent the GCC driver from adding
15245 these link options.
15246
15247 -threads
15248 Add support for multithreading with the dce thread library under
15249 HP-UX. This option sets flags for both the preprocessor and
15250 linker.
15251
15252 IA-64 Options
15253
15254 These are the -m options defined for the Intel IA-64 architecture.
15255
15256 -mbig-endian
15257 Generate code for a big-endian target. This is the default for HP-
15258 UX.
15259
15260 -mlittle-endian
15261 Generate code for a little-endian target. This is the default for
15262 AIX5 and GNU/Linux.
15263
15264 -mgnu-as
15265 -mno-gnu-as
15266 Generate (or don't) code for the GNU assembler. This is the
15267 default.
15268
15269 -mgnu-ld
15270 -mno-gnu-ld
15271 Generate (or don't) code for the GNU linker. This is the default.
15272
15273 -mno-pic
15274 Generate code that does not use a global pointer register. The
15275 result is not position independent code, and violates the IA-64
15276 ABI.
15277
15278 -mvolatile-asm-stop
15279 -mno-volatile-asm-stop
15280 Generate (or don't) a stop bit immediately before and after
15281 volatile asm statements.
15282
15283 -mregister-names
15284 -mno-register-names
15285 Generate (or don't) in, loc, and out register names for the stacked
15286 registers. This may make assembler output more readable.
15287
15288 -mno-sdata
15289 -msdata
15290 Disable (or enable) optimizations that use the small data section.
15291 This may be useful for working around optimizer bugs.
15292
15293 -mconstant-gp
15294 Generate code that uses a single constant global pointer value.
15295 This is useful when compiling kernel code.
15296
15297 -mauto-pic
15298 Generate code that is self-relocatable. This implies
15299 -mconstant-gp. This is useful when compiling firmware code.
15300
15301 -minline-float-divide-min-latency
15302 Generate code for inline divides of floating-point values using the
15303 minimum latency algorithm.
15304
15305 -minline-float-divide-max-throughput
15306 Generate code for inline divides of floating-point values using the
15307 maximum throughput algorithm.
15308
15309 -mno-inline-float-divide
15310 Do not generate inline code for divides of floating-point values.
15311
15312 -minline-int-divide-min-latency
15313 Generate code for inline divides of integer values using the
15314 minimum latency algorithm.
15315
15316 -minline-int-divide-max-throughput
15317 Generate code for inline divides of integer values using the
15318 maximum throughput algorithm.
15319
15320 -mno-inline-int-divide
15321 Do not generate inline code for divides of integer values.
15322
15323 -minline-sqrt-min-latency
15324 Generate code for inline square roots using the minimum latency
15325 algorithm.
15326
15327 -minline-sqrt-max-throughput
15328 Generate code for inline square roots using the maximum throughput
15329 algorithm.
15330
15331 -mno-inline-sqrt
15332 Do not generate inline code for "sqrt".
15333
15334 -mfused-madd
15335 -mno-fused-madd
15336 Do (don't) generate code that uses the fused multiply/add or
15337 multiply/subtract instructions. The default is to use these
15338 instructions.
15339
15340 -mno-dwarf2-asm
15341 -mdwarf2-asm
15342 Don't (or do) generate assembler code for the DWARF line number
15343 debugging info. This may be useful when not using the GNU
15344 assembler.
15345
15346 -mearly-stop-bits
15347 -mno-early-stop-bits
15348 Allow stop bits to be placed earlier than immediately preceding the
15349 instruction that triggered the stop bit. This can improve
15350 instruction scheduling, but does not always do so.
15351
15352 -mfixed-range=register-range
15353 Generate code treating the given register range as fixed registers.
15354 A fixed register is one that the register allocator cannot use.
15355 This is useful when compiling kernel code. A register range is
15356 specified as two registers separated by a dash. Multiple register
15357 ranges can be specified separated by a comma.
15358
15359 -mtls-size=tls-size
15360 Specify bit size of immediate TLS offsets. Valid values are 14,
15361 22, and 64.
15362
15363 -mtune=cpu-type
15364 Tune the instruction scheduling for a particular CPU, Valid values
15365 are itanium, itanium1, merced, itanium2, and mckinley.
15366
15367 -milp32
15368 -mlp64
15369 Generate code for a 32-bit or 64-bit environment. The 32-bit
15370 environment sets int, long and pointer to 32 bits. The 64-bit
15371 environment sets int to 32 bits and long and pointer to 64 bits.
15372 These are HP-UX specific flags.
15373
15374 -mno-sched-br-data-spec
15375 -msched-br-data-spec
15376 (Dis/En)able data speculative scheduling before reload. This
15377 results in generation of "ld.a" instructions and the corresponding
15378 check instructions ("ld.c" / "chk.a"). The default setting is
15379 disabled.
15380
15381 -msched-ar-data-spec
15382 -mno-sched-ar-data-spec
15383 (En/Dis)able data speculative scheduling after reload. This
15384 results in generation of "ld.a" instructions and the corresponding
15385 check instructions ("ld.c" / "chk.a"). The default setting is
15386 enabled.
15387
15388 -mno-sched-control-spec
15389 -msched-control-spec
15390 (Dis/En)able control speculative scheduling. This feature is
15391 available only during region scheduling (i.e. before reload). This
15392 results in generation of the "ld.s" instructions and the
15393 corresponding check instructions "chk.s". The default setting is
15394 disabled.
15395
15396 -msched-br-in-data-spec
15397 -mno-sched-br-in-data-spec
15398 (En/Dis)able speculative scheduling of the instructions that are
15399 dependent on the data speculative loads before reload. This is
15400 effective only with -msched-br-data-spec enabled. The default
15401 setting is enabled.
15402
15403 -msched-ar-in-data-spec
15404 -mno-sched-ar-in-data-spec
15405 (En/Dis)able speculative scheduling of the instructions that are
15406 dependent on the data speculative loads after reload. This is
15407 effective only with -msched-ar-data-spec enabled. The default
15408 setting is enabled.
15409
15410 -msched-in-control-spec
15411 -mno-sched-in-control-spec
15412 (En/Dis)able speculative scheduling of the instructions that are
15413 dependent on the control speculative loads. This is effective only
15414 with -msched-control-spec enabled. The default setting is enabled.
15415
15416 -mno-sched-prefer-non-data-spec-insns
15417 -msched-prefer-non-data-spec-insns
15418 If enabled, data-speculative instructions are chosen for schedule
15419 only if there are no other choices at the moment. This makes the
15420 use of the data speculation much more conservative. The default
15421 setting is disabled.
15422
15423 -mno-sched-prefer-non-control-spec-insns
15424 -msched-prefer-non-control-spec-insns
15425 If enabled, control-speculative instructions are chosen for
15426 schedule only if there are no other choices at the moment. This
15427 makes the use of the control speculation much more conservative.
15428 The default setting is disabled.
15429
15430 -mno-sched-count-spec-in-critical-path
15431 -msched-count-spec-in-critical-path
15432 If enabled, speculative dependencies are considered during
15433 computation of the instructions priorities. This makes the use of
15434 the speculation a bit more conservative. The default setting is
15435 disabled.
15436
15437 -msched-spec-ldc
15438 Use a simple data speculation check. This option is on by default.
15439
15440 -msched-control-spec-ldc
15441 Use a simple check for control speculation. This option is on by
15442 default.
15443
15444 -msched-stop-bits-after-every-cycle
15445 Place a stop bit after every cycle when scheduling. This option is
15446 on by default.
15447
15448 -msched-fp-mem-deps-zero-cost
15449 Assume that floating-point stores and loads are not likely to cause
15450 a conflict when placed into the same instruction group. This
15451 option is disabled by default.
15452
15453 -msel-sched-dont-check-control-spec
15454 Generate checks for control speculation in selective scheduling.
15455 This flag is disabled by default.
15456
15457 -msched-max-memory-insns=max-insns
15458 Limit on the number of memory insns per instruction group, giving
15459 lower priority to subsequent memory insns attempting to schedule in
15460 the same instruction group. Frequently useful to prevent cache bank
15461 conflicts. The default value is 1.
15462
15463 -msched-max-memory-insns-hard-limit
15464 Makes the limit specified by msched-max-memory-insns a hard limit,
15465 disallowing more than that number in an instruction group.
15466 Otherwise, the limit is "soft", meaning that non-memory operations
15467 are preferred when the limit is reached, but memory operations may
15468 still be scheduled.
15469
15470 LM32 Options
15471
15472 These -m options are defined for the LatticeMico32 architecture:
15473
15474 -mbarrel-shift-enabled
15475 Enable barrel-shift instructions.
15476
15477 -mdivide-enabled
15478 Enable divide and modulus instructions.
15479
15480 -mmultiply-enabled
15481 Enable multiply instructions.
15482
15483 -msign-extend-enabled
15484 Enable sign extend instructions.
15485
15486 -muser-enabled
15487 Enable user-defined instructions.
15488
15489 M32C Options
15490
15491 -mcpu=name
15492 Select the CPU for which code is generated. name may be one of r8c
15493 for the R8C/Tiny series, m16c for the M16C (up to /60) series,
15494 m32cm for the M16C/80 series, or m32c for the M32C/80 series.
15495
15496 -msim
15497 Specifies that the program will be run on the simulator. This
15498 causes an alternate runtime library to be linked in which supports,
15499 for example, file I/O. You must not use this option when
15500 generating programs that will run on real hardware; you must
15501 provide your own runtime library for whatever I/O functions are
15502 needed.
15503
15504 -memregs=number
15505 Specifies the number of memory-based pseudo-registers GCC uses
15506 during code generation. These pseudo-registers are used like real
15507 registers, so there is a tradeoff between GCC's ability to fit the
15508 code into available registers, and the performance penalty of using
15509 memory instead of registers. Note that all modules in a program
15510 must be compiled with the same value for this option. Because of
15511 that, you must not use this option with GCC's default runtime
15512 libraries.
15513
15514 M32R/D Options
15515
15516 These -m options are defined for Renesas M32R/D architectures:
15517
15518 -m32r2
15519 Generate code for the M32R/2.
15520
15521 -m32rx
15522 Generate code for the M32R/X.
15523
15524 -m32r
15525 Generate code for the M32R. This is the default.
15526
15527 -mmodel=small
15528 Assume all objects live in the lower 16MB of memory (so that their
15529 addresses can be loaded with the "ld24" instruction), and assume
15530 all subroutines are reachable with the "bl" instruction. This is
15531 the default.
15532
15533 The addressability of a particular object can be set with the
15534 "model" attribute.
15535
15536 -mmodel=medium
15537 Assume objects may be anywhere in the 32-bit address space (the
15538 compiler generates "seth/add3" instructions to load their
15539 addresses), and assume all subroutines are reachable with the "bl"
15540 instruction.
15541
15542 -mmodel=large
15543 Assume objects may be anywhere in the 32-bit address space (the
15544 compiler generates "seth/add3" instructions to load their
15545 addresses), and assume subroutines may not be reachable with the
15546 "bl" instruction (the compiler generates the much slower
15547 "seth/add3/jl" instruction sequence).
15548
15549 -msdata=none
15550 Disable use of the small data area. Variables are put into one of
15551 ".data", ".bss", or ".rodata" (unless the "section" attribute has
15552 been specified). This is the default.
15553
15554 The small data area consists of sections ".sdata" and ".sbss".
15555 Objects may be explicitly put in the small data area with the
15556 "section" attribute using one of these sections.
15557
15558 -msdata=sdata
15559 Put small global and static data in the small data area, but do not
15560 generate special code to reference them.
15561
15562 -msdata=use
15563 Put small global and static data in the small data area, and
15564 generate special instructions to reference them.
15565
15566 -G num
15567 Put global and static objects less than or equal to num bytes into
15568 the small data or BSS sections instead of the normal data or BSS
15569 sections. The default value of num is 8. The -msdata option must
15570 be set to one of sdata or use for this option to have any effect.
15571
15572 All modules should be compiled with the same -G num value.
15573 Compiling with different values of num may or may not work; if it
15574 doesn't the linker gives an error message---incorrect code is not
15575 generated.
15576
15577 -mdebug
15578 Makes the M32R-specific code in the compiler display some
15579 statistics that might help in debugging programs.
15580
15581 -malign-loops
15582 Align all loops to a 32-byte boundary.
15583
15584 -mno-align-loops
15585 Do not enforce a 32-byte alignment for loops. This is the default.
15586
15587 -missue-rate=number
15588 Issue number instructions per cycle. number can only be 1 or 2.
15589
15590 -mbranch-cost=number
15591 number can only be 1 or 2. If it is 1 then branches are preferred
15592 over conditional code, if it is 2, then the opposite applies.
15593
15594 -mflush-trap=number
15595 Specifies the trap number to use to flush the cache. The default
15596 is 12. Valid numbers are between 0 and 15 inclusive.
15597
15598 -mno-flush-trap
15599 Specifies that the cache cannot be flushed by using a trap.
15600
15601 -mflush-func=name
15602 Specifies the name of the operating system function to call to
15603 flush the cache. The default is _flush_cache, but a function call
15604 is only used if a trap is not available.
15605
15606 -mno-flush-func
15607 Indicates that there is no OS function for flushing the cache.
15608
15609 M680x0 Options
15610
15611 These are the -m options defined for M680x0 and ColdFire processors.
15612 The default settings depend on which architecture was selected when the
15613 compiler was configured; the defaults for the most common choices are
15614 given below.
15615
15616 -march=arch
15617 Generate code for a specific M680x0 or ColdFire instruction set
15618 architecture. Permissible values of arch for M680x0 architectures
15619 are: 68000, 68010, 68020, 68030, 68040, 68060 and cpu32. ColdFire
15620 architectures are selected according to Freescale's ISA
15621 classification and the permissible values are: isaa, isaaplus, isab
15622 and isac.
15623
15624 GCC defines a macro "__mcfarch__" whenever it is generating code
15625 for a ColdFire target. The arch in this macro is one of the -march
15626 arguments given above.
15627
15628 When used together, -march and -mtune select code that runs on a
15629 family of similar processors but that is optimized for a particular
15630 microarchitecture.
15631
15632 -mcpu=cpu
15633 Generate code for a specific M680x0 or ColdFire processor. The
15634 M680x0 cpus are: 68000, 68010, 68020, 68030, 68040, 68060, 68302,
15635 68332 and cpu32. The ColdFire cpus are given by the table below,
15636 which also classifies the CPUs into families:
15637
15638 Family : -mcpu arguments
15639 51 : 51 51ac 51ag 51cn 51em 51je 51jf 51jg 51jm 51mm 51qe 51qm
15640 5206 : 5202 5204 5206
15641 5206e : 5206e
15642 5208 : 5207 5208
15643 5211a : 5210a 5211a
15644 5213 : 5211 5212 5213
15645 5216 : 5214 5216
15646 52235 : 52230 52231 52232 52233 52234 52235
15647 5225 : 5224 5225
15648 52259 : 52252 52254 52255 52256 52258 52259
15649 5235 : 5232 5233 5234 5235 523x
15650 5249 : 5249
15651 5250 : 5250
15652 5271 : 5270 5271
15653 5272 : 5272
15654 5275 : 5274 5275
15655 5282 : 5280 5281 5282 528x
15656 53017 : 53011 53012 53013 53014 53015 53016 53017
15657 5307 : 5307
15658 5329 : 5327 5328 5329 532x
15659 5373 : 5372 5373 537x
15660 5407 : 5407
15661 5475 : 5470 5471 5472 5473 5474 5475 547x 5480 5481 5482 5483 5484
15662 5485
15663
15664 -mcpu=cpu overrides -march=arch if arch is compatible with cpu.
15665 Other combinations of -mcpu and -march are rejected.
15666
15667 GCC defines the macro "__mcf_cpu_cpu" when ColdFire target cpu is
15668 selected. It also defines "__mcf_family_family", where the value
15669 of family is given by the table above.
15670
15671 -mtune=tune
15672 Tune the code for a particular microarchitecture within the
15673 constraints set by -march and -mcpu. The M680x0 microarchitectures
15674 are: 68000, 68010, 68020, 68030, 68040, 68060 and cpu32. The
15675 ColdFire microarchitectures are: cfv1, cfv2, cfv3, cfv4 and cfv4e.
15676
15677 You can also use -mtune=68020-40 for code that needs to run
15678 relatively well on 68020, 68030 and 68040 targets. -mtune=68020-60
15679 is similar but includes 68060 targets as well. These two options
15680 select the same tuning decisions as -m68020-40 and -m68020-60
15681 respectively.
15682
15683 GCC defines the macros "__mcarch" and "__mcarch__" when tuning for
15684 680x0 architecture arch. It also defines "mcarch" unless either
15685 -ansi or a non-GNU -std option is used. If GCC is tuning for a
15686 range of architectures, as selected by -mtune=68020-40 or
15687 -mtune=68020-60, it defines the macros for every architecture in
15688 the range.
15689
15690 GCC also defines the macro "__muarch__" when tuning for ColdFire
15691 microarchitecture uarch, where uarch is one of the arguments given
15692 above.
15693
15694 -m68000
15695 -mc68000
15696 Generate output for a 68000. This is the default when the compiler
15697 is configured for 68000-based systems. It is equivalent to
15698 -march=68000.
15699
15700 Use this option for microcontrollers with a 68000 or EC000 core,
15701 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
15702
15703 -m68010
15704 Generate output for a 68010. This is the default when the compiler
15705 is configured for 68010-based systems. It is equivalent to
15706 -march=68010.
15707
15708 -m68020
15709 -mc68020
15710 Generate output for a 68020. This is the default when the compiler
15711 is configured for 68020-based systems. It is equivalent to
15712 -march=68020.
15713
15714 -m68030
15715 Generate output for a 68030. This is the default when the compiler
15716 is configured for 68030-based systems. It is equivalent to
15717 -march=68030.
15718
15719 -m68040
15720 Generate output for a 68040. This is the default when the compiler
15721 is configured for 68040-based systems. It is equivalent to
15722 -march=68040.
15723
15724 This option inhibits the use of 68881/68882 instructions that have
15725 to be emulated by software on the 68040. Use this option if your
15726 68040 does not have code to emulate those instructions.
15727
15728 -m68060
15729 Generate output for a 68060. This is the default when the compiler
15730 is configured for 68060-based systems. It is equivalent to
15731 -march=68060.
15732
15733 This option inhibits the use of 68020 and 68881/68882 instructions
15734 that have to be emulated by software on the 68060. Use this option
15735 if your 68060 does not have code to emulate those instructions.
15736
15737 -mcpu32
15738 Generate output for a CPU32. This is the default when the compiler
15739 is configured for CPU32-based systems. It is equivalent to
15740 -march=cpu32.
15741
15742 Use this option for microcontrollers with a CPU32 or CPU32+ core,
15743 including the 68330, 68331, 68332, 68333, 68334, 68336, 68340,
15744 68341, 68349 and 68360.
15745
15746 -m5200
15747 Generate output for a 520X ColdFire CPU. This is the default when
15748 the compiler is configured for 520X-based systems. It is
15749 equivalent to -mcpu=5206, and is now deprecated in favor of that
15750 option.
15751
15752 Use this option for microcontroller with a 5200 core, including the
15753 MCF5202, MCF5203, MCF5204 and MCF5206.
15754
15755 -m5206e
15756 Generate output for a 5206e ColdFire CPU. The option is now
15757 deprecated in favor of the equivalent -mcpu=5206e.
15758
15759 -m528x
15760 Generate output for a member of the ColdFire 528X family. The
15761 option is now deprecated in favor of the equivalent -mcpu=528x.
15762
15763 -m5307
15764 Generate output for a ColdFire 5307 CPU. The option is now
15765 deprecated in favor of the equivalent -mcpu=5307.
15766
15767 -m5407
15768 Generate output for a ColdFire 5407 CPU. The option is now
15769 deprecated in favor of the equivalent -mcpu=5407.
15770
15771 -mcfv4e
15772 Generate output for a ColdFire V4e family CPU (e.g. 547x/548x).
15773 This includes use of hardware floating-point instructions. The
15774 option is equivalent to -mcpu=547x, and is now deprecated in favor
15775 of that option.
15776
15777 -m68020-40
15778 Generate output for a 68040, without using any of the new
15779 instructions. This results in code that can run relatively
15780 efficiently on either a 68020/68881 or a 68030 or a 68040. The
15781 generated code does use the 68881 instructions that are emulated on
15782 the 68040.
15783
15784 The option is equivalent to -march=68020 -mtune=68020-40.
15785
15786 -m68020-60
15787 Generate output for a 68060, without using any of the new
15788 instructions. This results in code that can run relatively
15789 efficiently on either a 68020/68881 or a 68030 or a 68040. The
15790 generated code does use the 68881 instructions that are emulated on
15791 the 68060.
15792
15793 The option is equivalent to -march=68020 -mtune=68020-60.
15794
15795 -mhard-float
15796 -m68881
15797 Generate floating-point instructions. This is the default for
15798 68020 and above, and for ColdFire devices that have an FPU. It
15799 defines the macro "__HAVE_68881__" on M680x0 targets and
15800 "__mcffpu__" on ColdFire targets.
15801
15802 -msoft-float
15803 Do not generate floating-point instructions; use library calls
15804 instead. This is the default for 68000, 68010, and 68832 targets.
15805 It is also the default for ColdFire devices that have no FPU.
15806
15807 -mdiv
15808 -mno-div
15809 Generate (do not generate) ColdFire hardware divide and remainder
15810 instructions. If -march is used without -mcpu, the default is "on"
15811 for ColdFire architectures and "off" for M680x0 architectures.
15812 Otherwise, the default is taken from the target CPU (either the
15813 default CPU, or the one specified by -mcpu). For example, the
15814 default is "off" for -mcpu=5206 and "on" for -mcpu=5206e.
15815
15816 GCC defines the macro "__mcfhwdiv__" when this option is enabled.
15817
15818 -mshort
15819 Consider type "int" to be 16 bits wide, like "short int".
15820 Additionally, parameters passed on the stack are also aligned to a
15821 16-bit boundary even on targets whose API mandates promotion to
15822 32-bit.
15823
15824 -mno-short
15825 Do not consider type "int" to be 16 bits wide. This is the
15826 default.
15827
15828 -mnobitfield
15829 -mno-bitfield
15830 Do not use the bit-field instructions. The -m68000, -mcpu32 and
15831 -m5200 options imply -mnobitfield.
15832
15833 -mbitfield
15834 Do use the bit-field instructions. The -m68020 option implies
15835 -mbitfield. This is the default if you use a configuration
15836 designed for a 68020.
15837
15838 -mrtd
15839 Use a different function-calling convention, in which functions
15840 that take a fixed number of arguments return with the "rtd"
15841 instruction, which pops their arguments while returning. This
15842 saves one instruction in the caller since there is no need to pop
15843 the arguments there.
15844
15845 This calling convention is incompatible with the one normally used
15846 on Unix, so you cannot use it if you need to call libraries
15847 compiled with the Unix compiler.
15848
15849 Also, you must provide function prototypes for all functions that
15850 take variable numbers of arguments (including "printf"); otherwise
15851 incorrect code is generated for calls to those functions.
15852
15853 In addition, seriously incorrect code results if you call a
15854 function with too many arguments. (Normally, extra arguments are
15855 harmlessly ignored.)
15856
15857 The "rtd" instruction is supported by the 68010, 68020, 68030,
15858 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
15859
15860 -mno-rtd
15861 Do not use the calling conventions selected by -mrtd. This is the
15862 default.
15863
15864 -malign-int
15865 -mno-align-int
15866 Control whether GCC aligns "int", "long", "long long", "float",
15867 "double", and "long double" variables on a 32-bit boundary
15868 (-malign-int) or a 16-bit boundary (-mno-align-int). Aligning
15869 variables on 32-bit boundaries produces code that runs somewhat
15870 faster on processors with 32-bit busses at the expense of more
15871 memory.
15872
15873 Warning: if you use the -malign-int switch, GCC aligns structures
15874 containing the above types differently than most published
15875 application binary interface specifications for the m68k.
15876
15877 -mpcrel
15878 Use the pc-relative addressing mode of the 68000 directly, instead
15879 of using a global offset table. At present, this option implies
15880 -fpic, allowing at most a 16-bit offset for pc-relative addressing.
15881 -fPIC is not presently supported with -mpcrel, though this could be
15882 supported for 68020 and higher processors.
15883
15884 -mno-strict-align
15885 -mstrict-align
15886 Do not (do) assume that unaligned memory references are handled by
15887 the system.
15888
15889 -msep-data
15890 Generate code that allows the data segment to be located in a
15891 different area of memory from the text segment. This allows for
15892 execute-in-place in an environment without virtual memory
15893 management. This option implies -fPIC.
15894
15895 -mno-sep-data
15896 Generate code that assumes that the data segment follows the text
15897 segment. This is the default.
15898
15899 -mid-shared-library
15900 Generate code that supports shared libraries via the library ID
15901 method. This allows for execute-in-place and shared libraries in
15902 an environment without virtual memory management. This option
15903 implies -fPIC.
15904
15905 -mno-id-shared-library
15906 Generate code that doesn't assume ID-based shared libraries are
15907 being used. This is the default.
15908
15909 -mshared-library-id=n
15910 Specifies the identification number of the ID-based shared library
15911 being compiled. Specifying a value of 0 generates more compact
15912 code; specifying other values forces the allocation of that number
15913 to the current library, but is no more space- or time-efficient
15914 than omitting this option.
15915
15916 -mxgot
15917 -mno-xgot
15918 When generating position-independent code for ColdFire, generate
15919 code that works if the GOT has more than 8192 entries. This code
15920 is larger and slower than code generated without this option. On
15921 M680x0 processors, this option is not needed; -fPIC suffices.
15922
15923 GCC normally uses a single instruction to load values from the GOT.
15924 While this is relatively efficient, it only works if the GOT is
15925 smaller than about 64k. Anything larger causes the linker to
15926 report an error such as:
15927
15928 relocation truncated to fit: R_68K_GOT16O foobar
15929
15930 If this happens, you should recompile your code with -mxgot. It
15931 should then work with very large GOTs. However, code generated
15932 with -mxgot is less efficient, since it takes 4 instructions to
15933 fetch the value of a global symbol.
15934
15935 Note that some linkers, including newer versions of the GNU linker,
15936 can create multiple GOTs and sort GOT entries. If you have such a
15937 linker, you should only need to use -mxgot when compiling a single
15938 object file that accesses more than 8192 GOT entries. Very few do.
15939
15940 These options have no effect unless GCC is generating position-
15941 independent code.
15942
15943 -mlong-jump-table-offsets
15944 Use 32-bit offsets in "switch" tables. The default is to use
15945 16-bit offsets.
15946
15947 MCore Options
15948
15949 These are the -m options defined for the Motorola M*Core processors.
15950
15951 -mhardlit
15952 -mno-hardlit
15953 Inline constants into the code stream if it can be done in two
15954 instructions or less.
15955
15956 -mdiv
15957 -mno-div
15958 Use the divide instruction. (Enabled by default).
15959
15960 -mrelax-immediate
15961 -mno-relax-immediate
15962 Allow arbitrary-sized immediates in bit operations.
15963
15964 -mwide-bitfields
15965 -mno-wide-bitfields
15966 Always treat bit-fields as "int"-sized.
15967
15968 -m4byte-functions
15969 -mno-4byte-functions
15970 Force all functions to be aligned to a 4-byte boundary.
15971
15972 -mcallgraph-data
15973 -mno-callgraph-data
15974 Emit callgraph information.
15975
15976 -mslow-bytes
15977 -mno-slow-bytes
15978 Prefer word access when reading byte quantities.
15979
15980 -mlittle-endian
15981 -mbig-endian
15982 Generate code for a little-endian target.
15983
15984 -m210
15985 -m340
15986 Generate code for the 210 processor.
15987
15988 -mno-lsim
15989 Assume that runtime support has been provided and so omit the
15990 simulator library (libsim.a) from the linker command line.
15991
15992 -mstack-increment=size
15993 Set the maximum amount for a single stack increment operation.
15994 Large values can increase the speed of programs that contain
15995 functions that need a large amount of stack space, but they can
15996 also trigger a segmentation fault if the stack is extended too
15997 much. The default value is 0x1000.
15998
15999 MeP Options
16000
16001 -mabsdiff
16002 Enables the "abs" instruction, which is the absolute difference
16003 between two registers.
16004
16005 -mall-opts
16006 Enables all the optional instructions---average, multiply, divide,
16007 bit operations, leading zero, absolute difference, min/max, clip,
16008 and saturation.
16009
16010 -maverage
16011 Enables the "ave" instruction, which computes the average of two
16012 registers.
16013
16014 -mbased=n
16015 Variables of size n bytes or smaller are placed in the ".based"
16016 section by default. Based variables use the $tp register as a base
16017 register, and there is a 128-byte limit to the ".based" section.
16018
16019 -mbitops
16020 Enables the bit operation instructions---bit test ("btstm"), set
16021 ("bsetm"), clear ("bclrm"), invert ("bnotm"), and test-and-set
16022 ("tas").
16023
16024 -mc=name
16025 Selects which section constant data is placed in. name may be
16026 tiny, near, or far.
16027
16028 -mclip
16029 Enables the "clip" instruction. Note that -mclip is not useful
16030 unless you also provide -mminmax.
16031
16032 -mconfig=name
16033 Selects one of the built-in core configurations. Each MeP chip has
16034 one or more modules in it; each module has a core CPU and a variety
16035 of coprocessors, optional instructions, and peripherals. The
16036 "MeP-Integrator" tool, not part of GCC, provides these
16037 configurations through this option; using this option is the same
16038 as using all the corresponding command-line options. The default
16039 configuration is default.
16040
16041 -mcop
16042 Enables the coprocessor instructions. By default, this is a 32-bit
16043 coprocessor. Note that the coprocessor is normally enabled via the
16044 -mconfig= option.
16045
16046 -mcop32
16047 Enables the 32-bit coprocessor's instructions.
16048
16049 -mcop64
16050 Enables the 64-bit coprocessor's instructions.
16051
16052 -mivc2
16053 Enables IVC2 scheduling. IVC2 is a 64-bit VLIW coprocessor.
16054
16055 -mdc
16056 Causes constant variables to be placed in the ".near" section.
16057
16058 -mdiv
16059 Enables the "div" and "divu" instructions.
16060
16061 -meb
16062 Generate big-endian code.
16063
16064 -mel
16065 Generate little-endian code.
16066
16067 -mio-volatile
16068 Tells the compiler that any variable marked with the "io" attribute
16069 is to be considered volatile.
16070
16071 -ml Causes variables to be assigned to the ".far" section by default.
16072
16073 -mleadz
16074 Enables the "leadz" (leading zero) instruction.
16075
16076 -mm Causes variables to be assigned to the ".near" section by default.
16077
16078 -mminmax
16079 Enables the "min" and "max" instructions.
16080
16081 -mmult
16082 Enables the multiplication and multiply-accumulate instructions.
16083
16084 -mno-opts
16085 Disables all the optional instructions enabled by -mall-opts.
16086
16087 -mrepeat
16088 Enables the "repeat" and "erepeat" instructions, used for low-
16089 overhead looping.
16090
16091 -ms Causes all variables to default to the ".tiny" section. Note that
16092 there is a 65536-byte limit to this section. Accesses to these
16093 variables use the %gp base register.
16094
16095 -msatur
16096 Enables the saturation instructions. Note that the compiler does
16097 not currently generate these itself, but this option is included
16098 for compatibility with other tools, like "as".
16099
16100 -msdram
16101 Link the SDRAM-based runtime instead of the default ROM-based
16102 runtime.
16103
16104 -msim
16105 Link the simulator run-time libraries.
16106
16107 -msimnovec
16108 Link the simulator runtime libraries, excluding built-in support
16109 for reset and exception vectors and tables.
16110
16111 -mtf
16112 Causes all functions to default to the ".far" section. Without
16113 this option, functions default to the ".near" section.
16114
16115 -mtiny=n
16116 Variables that are n bytes or smaller are allocated to the ".tiny"
16117 section. These variables use the $gp base register. The default
16118 for this option is 4, but note that there's a 65536-byte limit to
16119 the ".tiny" section.
16120
16121 MicroBlaze Options
16122
16123 -msoft-float
16124 Use software emulation for floating point (default).
16125
16126 -mhard-float
16127 Use hardware floating-point instructions.
16128
16129 -mmemcpy
16130 Do not optimize block moves, use "memcpy".
16131
16132 -mno-clearbss
16133 This option is deprecated. Use -fno-zero-initialized-in-bss
16134 instead.
16135
16136 -mcpu=cpu-type
16137 Use features of, and schedule code for, the given CPU. Supported
16138 values are in the format vX.YY.Z, where X is a major version, YY is
16139 the minor version, and Z is compatibility code. Example values are
16140 v3.00.a, v4.00.b, v5.00.a, v5.00.b, v5.00.b, v6.00.a.
16141
16142 -mxl-soft-mul
16143 Use software multiply emulation (default).
16144
16145 -mxl-soft-div
16146 Use software emulation for divides (default).
16147
16148 -mxl-barrel-shift
16149 Use the hardware barrel shifter.
16150
16151 -mxl-pattern-compare
16152 Use pattern compare instructions.
16153
16154 -msmall-divides
16155 Use table lookup optimization for small signed integer divisions.
16156
16157 -mxl-stack-check
16158 This option is deprecated. Use -fstack-check instead.
16159
16160 -mxl-gp-opt
16161 Use GP-relative ".sdata"/".sbss" sections.
16162
16163 -mxl-multiply-high
16164 Use multiply high instructions for high part of 32x32 multiply.
16165
16166 -mxl-float-convert
16167 Use hardware floating-point conversion instructions.
16168
16169 -mxl-float-sqrt
16170 Use hardware floating-point square root instruction.
16171
16172 -mbig-endian
16173 Generate code for a big-endian target.
16174
16175 -mlittle-endian
16176 Generate code for a little-endian target.
16177
16178 -mxl-reorder
16179 Use reorder instructions (swap and byte reversed load/store).
16180
16181 -mxl-mode-app-model
16182 Select application model app-model. Valid models are
16183
16184 executable
16185 normal executable (default), uses startup code crt0.o.
16186
16187 xmdstub
16188 for use with Xilinx Microprocessor Debugger (XMD) based
16189 software intrusive debug agent called xmdstub. This uses
16190 startup file crt1.o and sets the start address of the program
16191 to 0x800.
16192
16193 bootstrap
16194 for applications that are loaded using a bootloader. This
16195 model uses startup file crt2.o which does not contain a
16196 processor reset vector handler. This is suitable for
16197 transferring control on a processor reset to the bootloader
16198 rather than the application.
16199
16200 novectors
16201 for applications that do not require any of the MicroBlaze
16202 vectors. This option may be useful for applications running
16203 within a monitoring application. This model uses crt3.o as a
16204 startup file.
16205
16206 Option -xl-mode-app-model is a deprecated alias for -mxl-mode-app-
16207 model.
16208
16209 MIPS Options
16210
16211 -EB Generate big-endian code.
16212
16213 -EL Generate little-endian code. This is the default for mips*el-*-*
16214 configurations.
16215
16216 -march=arch
16217 Generate code that runs on arch, which can be the name of a generic
16218 MIPS ISA, or the name of a particular processor. The ISA names
16219 are: mips1, mips2, mips3, mips4, mips32, mips32r2, mips32r3,
16220 mips32r5, mips32r6, mips64, mips64r2, mips64r3, mips64r5 and
16221 mips64r6. The processor names are: 4kc, 4km, 4kp, 4ksc, 4kec,
16222 4kem, 4kep, 4ksd, 5kc, 5kf, 20kc, 24kc, 24kf2_1, 24kf1_1, 24kec,
16223 24kef2_1, 24kef1_1, 34kc, 34kf2_1, 34kf1_1, 34kn, 74kc, 74kf2_1,
16224 74kf1_1, 74kf3_2, 1004kc, 1004kf2_1, 1004kf1_1, i6400, interaptiv,
16225 loongson2e, loongson2f, loongson3a, m4k, m14k, m14kc, m14ke,
16226 m14kec, m5100, m5101, octeon, octeon+, octeon2, octeon3, orion,
16227 p5600, r2000, r3000, r3900, r4000, r4400, r4600, r4650, r4700,
16228 r6000, r8000, rm7000, rm9000, r10000, r12000, r14000, r16000, sb1,
16229 sr71000, vr4100, vr4111, vr4120, vr4130, vr4300, vr5000, vr5400,
16230 vr5500, xlr and xlp. The special value from-abi selects the most
16231 compatible architecture for the selected ABI (that is, mips1 for
16232 32-bit ABIs and mips3 for 64-bit ABIs).
16233
16234 The native Linux/GNU toolchain also supports the value native,
16235 which selects the best architecture option for the host processor.
16236 -march=native has no effect if GCC does not recognize the
16237 processor.
16238
16239 In processor names, a final 000 can be abbreviated as k (for
16240 example, -march=r2k). Prefixes are optional, and vr may be written
16241 r.
16242
16243 Names of the form nf2_1 refer to processors with FPUs clocked at
16244 half the rate of the core, names of the form nf1_1 refer to
16245 processors with FPUs clocked at the same rate as the core, and
16246 names of the form nf3_2 refer to processors with FPUs clocked a
16247 ratio of 3:2 with respect to the core. For compatibility reasons,
16248 nf is accepted as a synonym for nf2_1 while nx and bfx are accepted
16249 as synonyms for nf1_1.
16250
16251 GCC defines two macros based on the value of this option. The
16252 first is "_MIPS_ARCH", which gives the name of target architecture,
16253 as a string. The second has the form "_MIPS_ARCH_foo", where foo
16254 is the capitalized value of "_MIPS_ARCH". For example,
16255 -march=r2000 sets "_MIPS_ARCH" to "r2000" and defines the macro
16256 "_MIPS_ARCH_R2000".
16257
16258 Note that the "_MIPS_ARCH" macro uses the processor names given
16259 above. In other words, it has the full prefix and does not
16260 abbreviate 000 as k. In the case of from-abi, the macro names the
16261 resolved architecture (either "mips1" or "mips3"). It names the
16262 default architecture when no -march option is given.
16263
16264 -mtune=arch
16265 Optimize for arch. Among other things, this option controls the
16266 way instructions are scheduled, and the perceived cost of
16267 arithmetic operations. The list of arch values is the same as for
16268 -march.
16269
16270 When this option is not used, GCC optimizes for the processor
16271 specified by -march. By using -march and -mtune together, it is
16272 possible to generate code that runs on a family of processors, but
16273 optimize the code for one particular member of that family.
16274
16275 -mtune defines the macros "_MIPS_TUNE" and "_MIPS_TUNE_foo", which
16276 work in the same way as the -march ones described above.
16277
16278 -mips1
16279 Equivalent to -march=mips1.
16280
16281 -mips2
16282 Equivalent to -march=mips2.
16283
16284 -mips3
16285 Equivalent to -march=mips3.
16286
16287 -mips4
16288 Equivalent to -march=mips4.
16289
16290 -mips32
16291 Equivalent to -march=mips32.
16292
16293 -mips32r3
16294 Equivalent to -march=mips32r3.
16295
16296 -mips32r5
16297 Equivalent to -march=mips32r5.
16298
16299 -mips32r6
16300 Equivalent to -march=mips32r6.
16301
16302 -mips64
16303 Equivalent to -march=mips64.
16304
16305 -mips64r2
16306 Equivalent to -march=mips64r2.
16307
16308 -mips64r3
16309 Equivalent to -march=mips64r3.
16310
16311 -mips64r5
16312 Equivalent to -march=mips64r5.
16313
16314 -mips64r6
16315 Equivalent to -march=mips64r6.
16316
16317 -mips16
16318 -mno-mips16
16319 Generate (do not generate) MIPS16 code. If GCC is targeting a
16320 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE.
16321
16322 MIPS16 code generation can also be controlled on a per-function
16323 basis by means of "mips16" and "nomips16" attributes.
16324
16325 -mflip-mips16
16326 Generate MIPS16 code on alternating functions. This option is
16327 provided for regression testing of mixed MIPS16/non-MIPS16 code
16328 generation, and is not intended for ordinary use in compiling user
16329 code.
16330
16331 -minterlink-compressed
16332 -mno-interlink-compressed
16333 Require (do not require) that code using the standard
16334 (uncompressed) MIPS ISA be link-compatible with MIPS16 and
16335 microMIPS code, and vice versa.
16336
16337 For example, code using the standard ISA encoding cannot jump
16338 directly to MIPS16 or microMIPS code; it must either use a call or
16339 an indirect jump. -minterlink-compressed therefore disables direct
16340 jumps unless GCC knows that the target of the jump is not
16341 compressed.
16342
16343 -minterlink-mips16
16344 -mno-interlink-mips16
16345 Aliases of -minterlink-compressed and -mno-interlink-compressed.
16346 These options predate the microMIPS ASE and are retained for
16347 backwards compatibility.
16348
16349 -mabi=32
16350 -mabi=o64
16351 -mabi=n32
16352 -mabi=64
16353 -mabi=eabi
16354 Generate code for the given ABI.
16355
16356 Note that the EABI has a 32-bit and a 64-bit variant. GCC normally
16357 generates 64-bit code when you select a 64-bit architecture, but
16358 you can use -mgp32 to get 32-bit code instead.
16359
16360 For information about the O64 ABI, see
16361 <http://gcc.gnu.org/projects/mipso64-abi.html>.
16362
16363 GCC supports a variant of the o32 ABI in which floating-point
16364 registers are 64 rather than 32 bits wide. You can select this
16365 combination with -mabi=32 -mfp64. This ABI relies on the "mthc1"
16366 and "mfhc1" instructions and is therefore only supported for
16367 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
16368
16369 The register assignments for arguments and return values remain the
16370 same, but each scalar value is passed in a single 64-bit register
16371 rather than a pair of 32-bit registers. For example, scalar
16372 floating-point values are returned in $f0 only, not a $f0/$f1 pair.
16373 The set of call-saved registers also remains the same in that the
16374 even-numbered double-precision registers are saved.
16375
16376 Two additional variants of the o32 ABI are supported to enable a
16377 transition from 32-bit to 64-bit registers. These are FPXX
16378 (-mfpxx) and FP64A (-mfp64 -mno-odd-spreg). The FPXX extension
16379 mandates that all code must execute correctly when run using 32-bit
16380 or 64-bit registers. The code can be interlinked with either FP32
16381 or FP64, but not both. The FP64A extension is similar to the FP64
16382 extension but forbids the use of odd-numbered single-precision
16383 registers. This can be used in conjunction with the "FRE" mode of
16384 FPUs in MIPS32R5 processors and allows both FP32 and FP64A code to
16385 interlink and run in the same process without changing FPU modes.
16386
16387 -mabicalls
16388 -mno-abicalls
16389 Generate (do not generate) code that is suitable for SVR4-style
16390 dynamic objects. -mabicalls is the default for SVR4-based systems.
16391
16392 -mshared
16393 -mno-shared
16394 Generate (do not generate) code that is fully position-independent,
16395 and that can therefore be linked into shared libraries. This
16396 option only affects -mabicalls.
16397
16398 All -mabicalls code has traditionally been position-independent,
16399 regardless of options like -fPIC and -fpic. However, as an
16400 extension, the GNU toolchain allows executables to use absolute
16401 accesses for locally-binding symbols. It can also use shorter GP
16402 initialization sequences and generate direct calls to locally-
16403 defined functions. This mode is selected by -mno-shared.
16404
16405 -mno-shared depends on binutils 2.16 or higher and generates
16406 objects that can only be linked by the GNU linker. However, the
16407 option does not affect the ABI of the final executable; it only
16408 affects the ABI of relocatable objects. Using -mno-shared
16409 generally makes executables both smaller and quicker.
16410
16411 -mshared is the default.
16412
16413 -mplt
16414 -mno-plt
16415 Assume (do not assume) that the static and dynamic linkers support
16416 PLTs and copy relocations. This option only affects -mno-shared
16417 -mabicalls. For the n64 ABI, this option has no effect without
16418 -msym32.
16419
16420 You can make -mplt the default by configuring GCC with
16421 --with-mips-plt. The default is -mno-plt otherwise.
16422
16423 -mxgot
16424 -mno-xgot
16425 Lift (do not lift) the usual restrictions on the size of the global
16426 offset table.
16427
16428 GCC normally uses a single instruction to load values from the GOT.
16429 While this is relatively efficient, it only works if the GOT is
16430 smaller than about 64k. Anything larger causes the linker to
16431 report an error such as:
16432
16433 relocation truncated to fit: R_MIPS_GOT16 foobar
16434
16435 If this happens, you should recompile your code with -mxgot. This
16436 works with very large GOTs, although the code is also less
16437 efficient, since it takes three instructions to fetch the value of
16438 a global symbol.
16439
16440 Note that some linkers can create multiple GOTs. If you have such
16441 a linker, you should only need to use -mxgot when a single object
16442 file accesses more than 64k's worth of GOT entries. Very few do.
16443
16444 These options have no effect unless GCC is generating position
16445 independent code.
16446
16447 -mgp32
16448 Assume that general-purpose registers are 32 bits wide.
16449
16450 -mgp64
16451 Assume that general-purpose registers are 64 bits wide.
16452
16453 -mfp32
16454 Assume that floating-point registers are 32 bits wide.
16455
16456 -mfp64
16457 Assume that floating-point registers are 64 bits wide.
16458
16459 -mfpxx
16460 Do not assume the width of floating-point registers.
16461
16462 -mhard-float
16463 Use floating-point coprocessor instructions.
16464
16465 -msoft-float
16466 Do not use floating-point coprocessor instructions. Implement
16467 floating-point calculations using library calls instead.
16468
16469 -mno-float
16470 Equivalent to -msoft-float, but additionally asserts that the
16471 program being compiled does not perform any floating-point
16472 operations. This option is presently supported only by some bare-
16473 metal MIPS configurations, where it may select a special set of
16474 libraries that lack all floating-point support (including, for
16475 example, the floating-point "printf" formats). If code compiled
16476 with -mno-float accidentally contains floating-point operations, it
16477 is likely to suffer a link-time or run-time failure.
16478
16479 -msingle-float
16480 Assume that the floating-point coprocessor only supports single-
16481 precision operations.
16482
16483 -mdouble-float
16484 Assume that the floating-point coprocessor supports double-
16485 precision operations. This is the default.
16486
16487 -modd-spreg
16488 -mno-odd-spreg
16489 Enable the use of odd-numbered single-precision floating-point
16490 registers for the o32 ABI. This is the default for processors that
16491 are known to support these registers. When using the o32 FPXX ABI,
16492 -mno-odd-spreg is set by default.
16493
16494 -mabs=2008
16495 -mabs=legacy
16496 These options control the treatment of the special not-a-number
16497 (NaN) IEEE 754 floating-point data with the "abs.fmt" and "neg.fmt"
16498 machine instructions.
16499
16500 By default or when -mabs=legacy is used the legacy treatment is
16501 selected. In this case these instructions are considered
16502 arithmetic and avoided where correct operation is required and the
16503 input operand might be a NaN. A longer sequence of instructions
16504 that manipulate the sign bit of floating-point datum manually is
16505 used instead unless the -ffinite-math-only option has also been
16506 specified.
16507
16508 The -mabs=2008 option selects the IEEE 754-2008 treatment. In this
16509 case these instructions are considered non-arithmetic and therefore
16510 operating correctly in all cases, including in particular where the
16511 input operand is a NaN. These instructions are therefore always
16512 used for the respective operations.
16513
16514 -mnan=2008
16515 -mnan=legacy
16516 These options control the encoding of the special not-a-number
16517 (NaN) IEEE 754 floating-point data.
16518
16519 The -mnan=legacy option selects the legacy encoding. In this case
16520 quiet NaNs (qNaNs) are denoted by the first bit of their trailing
16521 significand field being 0, whereas signaling NaNs (sNaNs) are
16522 denoted by the first bit of their trailing significand field being
16523 1.
16524
16525 The -mnan=2008 option selects the IEEE 754-2008 encoding. In this
16526 case qNaNs are denoted by the first bit of their trailing
16527 significand field being 1, whereas sNaNs are denoted by the first
16528 bit of their trailing significand field being 0.
16529
16530 The default is -mnan=legacy unless GCC has been configured with
16531 --with-nan=2008.
16532
16533 -mllsc
16534 -mno-llsc
16535 Use (do not use) ll, sc, and sync instructions to implement atomic
16536 memory built-in functions. When neither option is specified, GCC
16537 uses the instructions if the target architecture supports them.
16538
16539 -mllsc is useful if the runtime environment can emulate the
16540 instructions and -mno-llsc can be useful when compiling for
16541 nonstandard ISAs. You can make either option the default by
16542 configuring GCC with --with-llsc and --without-llsc respectively.
16543 --with-llsc is the default for some configurations; see the
16544 installation documentation for details.
16545
16546 -mdsp
16547 -mno-dsp
16548 Use (do not use) revision 1 of the MIPS DSP ASE.
16549 This option defines the preprocessor macro "__mips_dsp". It also
16550 defines "__mips_dsp_rev" to 1.
16551
16552 -mdspr2
16553 -mno-dspr2
16554 Use (do not use) revision 2 of the MIPS DSP ASE.
16555 This option defines the preprocessor macros "__mips_dsp" and
16556 "__mips_dspr2". It also defines "__mips_dsp_rev" to 2.
16557
16558 -msmartmips
16559 -mno-smartmips
16560 Use (do not use) the MIPS SmartMIPS ASE.
16561
16562 -mpaired-single
16563 -mno-paired-single
16564 Use (do not use) paired-single floating-point instructions.
16565 This option requires hardware floating-point support to be
16566 enabled.
16567
16568 -mdmx
16569 -mno-mdmx
16570 Use (do not use) MIPS Digital Media Extension instructions. This
16571 option can only be used when generating 64-bit code and requires
16572 hardware floating-point support to be enabled.
16573
16574 -mips3d
16575 -mno-mips3d
16576 Use (do not use) the MIPS-3D ASE. The option -mips3d implies
16577 -mpaired-single.
16578
16579 -mmicromips
16580 -mno-micromips
16581 Generate (do not generate) microMIPS code.
16582
16583 MicroMIPS code generation can also be controlled on a per-function
16584 basis by means of "micromips" and "nomicromips" attributes.
16585
16586 -mmt
16587 -mno-mt
16588 Use (do not use) MT Multithreading instructions.
16589
16590 -mmcu
16591 -mno-mcu
16592 Use (do not use) the MIPS MCU ASE instructions.
16593
16594 -meva
16595 -mno-eva
16596 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
16597
16598 -mvirt
16599 -mno-virt
16600 Use (do not use) the MIPS Virtualization (VZ) instructions.
16601
16602 -mxpa
16603 -mno-xpa
16604 Use (do not use) the MIPS eXtended Physical Address (XPA)
16605 instructions.
16606
16607 -mlong64
16608 Force "long" types to be 64 bits wide. See -mlong32 for an
16609 explanation of the default and the way that the pointer size is
16610 determined.
16611
16612 -mlong32
16613 Force "long", "int", and pointer types to be 32 bits wide.
16614
16615 The default size of "int"s, "long"s and pointers depends on the
16616 ABI. All the supported ABIs use 32-bit "int"s. The n64 ABI uses
16617 64-bit "long"s, as does the 64-bit EABI; the others use 32-bit
16618 "long"s. Pointers are the same size as "long"s, or the same size
16619 as integer registers, whichever is smaller.
16620
16621 -msym32
16622 -mno-sym32
16623 Assume (do not assume) that all symbols have 32-bit values,
16624 regardless of the selected ABI. This option is useful in
16625 combination with -mabi=64 and -mno-abicalls because it allows GCC
16626 to generate shorter and faster references to symbolic addresses.
16627
16628 -G num
16629 Put definitions of externally-visible data in a small data section
16630 if that data is no bigger than num bytes. GCC can then generate
16631 more efficient accesses to the data; see -mgpopt for details.
16632
16633 The default -G option depends on the configuration.
16634
16635 -mlocal-sdata
16636 -mno-local-sdata
16637 Extend (do not extend) the -G behavior to local data too, such as
16638 to static variables in C. -mlocal-sdata is the default for all
16639 configurations.
16640
16641 If the linker complains that an application is using too much small
16642 data, you might want to try rebuilding the less performance-
16643 critical parts with -mno-local-sdata. You might also want to build
16644 large libraries with -mno-local-sdata, so that the libraries leave
16645 more room for the main program.
16646
16647 -mextern-sdata
16648 -mno-extern-sdata
16649 Assume (do not assume) that externally-defined data is in a small
16650 data section if the size of that data is within the -G limit.
16651 -mextern-sdata is the default for all configurations.
16652
16653 If you compile a module Mod with -mextern-sdata -G num -mgpopt, and
16654 Mod references a variable Var that is no bigger than num bytes, you
16655 must make sure that Var is placed in a small data section. If Var
16656 is defined by another module, you must either compile that module
16657 with a high-enough -G setting or attach a "section" attribute to
16658 Var's definition. If Var is common, you must link the application
16659 with a high-enough -G setting.
16660
16661 The easiest way of satisfying these restrictions is to compile and
16662 link every module with the same -G option. However, you may wish
16663 to build a library that supports several different small data
16664 limits. You can do this by compiling the library with the highest
16665 supported -G setting and additionally using -mno-extern-sdata to
16666 stop the library from making assumptions about externally-defined
16667 data.
16668
16669 -mgpopt
16670 -mno-gpopt
16671 Use (do not use) GP-relative accesses for symbols that are known to
16672 be in a small data section; see -G, -mlocal-sdata and
16673 -mextern-sdata. -mgpopt is the default for all configurations.
16674
16675 -mno-gpopt is useful for cases where the $gp register might not
16676 hold the value of "_gp". For example, if the code is part of a
16677 library that might be used in a boot monitor, programs that call
16678 boot monitor routines pass an unknown value in $gp. (In such
16679 situations, the boot monitor itself is usually compiled with -G0.)
16680
16681 -mno-gpopt implies -mno-local-sdata and -mno-extern-sdata.
16682
16683 -membedded-data
16684 -mno-embedded-data
16685 Allocate variables to the read-only data section first if possible,
16686 then next in the small data section if possible, otherwise in data.
16687 This gives slightly slower code than the default, but reduces the
16688 amount of RAM required when executing, and thus may be preferred
16689 for some embedded systems.
16690
16691 -muninit-const-in-rodata
16692 -mno-uninit-const-in-rodata
16693 Put uninitialized "const" variables in the read-only data section.
16694 This option is only meaningful in conjunction with -membedded-data.
16695
16696 -mcode-readable=setting
16697 Specify whether GCC may generate code that reads from executable
16698 sections. There are three possible settings:
16699
16700 -mcode-readable=yes
16701 Instructions may freely access executable sections. This is
16702 the default setting.
16703
16704 -mcode-readable=pcrel
16705 MIPS16 PC-relative load instructions can access executable
16706 sections, but other instructions must not do so. This option
16707 is useful on 4KSc and 4KSd processors when the code TLBs have
16708 the Read Inhibit bit set. It is also useful on processors that
16709 can be configured to have a dual instruction/data SRAM
16710 interface and that, like the M4K, automatically redirect PC-
16711 relative loads to the instruction RAM.
16712
16713 -mcode-readable=no
16714 Instructions must not access executable sections. This option
16715 can be useful on targets that are configured to have a dual
16716 instruction/data SRAM interface but that (unlike the M4K) do
16717 not automatically redirect PC-relative loads to the instruction
16718 RAM.
16719
16720 -msplit-addresses
16721 -mno-split-addresses
16722 Enable (disable) use of the "%hi()" and "%lo()" assembler
16723 relocation operators. This option has been superseded by
16724 -mexplicit-relocs but is retained for backwards compatibility.
16725
16726 -mexplicit-relocs
16727 -mno-explicit-relocs
16728 Use (do not use) assembler relocation operators when dealing with
16729 symbolic addresses. The alternative, selected by
16730 -mno-explicit-relocs, is to use assembler macros instead.
16731
16732 -mexplicit-relocs is the default if GCC was configured to use an
16733 assembler that supports relocation operators.
16734
16735 -mcheck-zero-division
16736 -mno-check-zero-division
16737 Trap (do not trap) on integer division by zero.
16738
16739 The default is -mcheck-zero-division.
16740
16741 -mdivide-traps
16742 -mdivide-breaks
16743 MIPS systems check for division by zero by generating either a
16744 conditional trap or a break instruction. Using traps results in
16745 smaller code, but is only supported on MIPS II and later. Also,
16746 some versions of the Linux kernel have a bug that prevents trap
16747 from generating the proper signal ("SIGFPE"). Use -mdivide-traps
16748 to allow conditional traps on architectures that support them and
16749 -mdivide-breaks to force the use of breaks.
16750
16751 The default is usually -mdivide-traps, but this can be overridden
16752 at configure time using --with-divide=breaks. Divide-by-zero
16753 checks can be completely disabled using -mno-check-zero-division.
16754
16755 -mload-store-pairs
16756 -mno-load-store-pairs
16757 Enable (disable) an optimization that pairs consecutive load or
16758 store instructions to enable load/store bonding. This option is
16759 enabled by default but only takes effect when the selected
16760 architecture is known to support bonding.
16761
16762 -mmemcpy
16763 -mno-memcpy
16764 Force (do not force) the use of "memcpy" for non-trivial block
16765 moves. The default is -mno-memcpy, which allows GCC to inline most
16766 constant-sized copies.
16767
16768 -mlong-calls
16769 -mno-long-calls
16770 Disable (do not disable) use of the "jal" instruction. Calling
16771 functions using "jal" is more efficient but requires the caller and
16772 callee to be in the same 256 megabyte segment.
16773
16774 This option has no effect on abicalls code. The default is
16775 -mno-long-calls.
16776
16777 -mmad
16778 -mno-mad
16779 Enable (disable) use of the "mad", "madu" and "mul" instructions,
16780 as provided by the R4650 ISA.
16781
16782 -mimadd
16783 -mno-imadd
16784 Enable (disable) use of the "madd" and "msub" integer instructions.
16785 The default is -mimadd on architectures that support "madd" and
16786 "msub" except for the 74k architecture where it was found to
16787 generate slower code.
16788
16789 -mfused-madd
16790 -mno-fused-madd
16791 Enable (disable) use of the floating-point multiply-accumulate
16792 instructions, when they are available. The default is
16793 -mfused-madd.
16794
16795 On the R8000 CPU when multiply-accumulate instructions are used,
16796 the intermediate product is calculated to infinite precision and is
16797 not subject to the FCSR Flush to Zero bit. This may be undesirable
16798 in some circumstances. On other processors the result is
16799 numerically identical to the equivalent computation using separate
16800 multiply, add, subtract and negate instructions.
16801
16802 -nocpp
16803 Tell the MIPS assembler to not run its preprocessor over user
16804 assembler files (with a .s suffix) when assembling them.
16805
16806 -mfix-24k
16807 -mno-fix-24k
16808 Work around the 24K E48 (lost data on stores during refill) errata.
16809 The workarounds are implemented by the assembler rather than by
16810 GCC.
16811
16812 -mfix-r4000
16813 -mno-fix-r4000
16814 Work around certain R4000 CPU errata:
16815
16816 - A double-word or a variable shift may give an incorrect result
16817 if executed immediately after starting an integer division.
16818
16819 - A double-word or a variable shift may give an incorrect result
16820 if executed while an integer multiplication is in progress.
16821
16822 - An integer division may give an incorrect result if started in
16823 a delay slot of a taken branch or a jump.
16824
16825 -mfix-r4400
16826 -mno-fix-r4400
16827 Work around certain R4400 CPU errata:
16828
16829 - A double-word or a variable shift may give an incorrect result
16830 if executed immediately after starting an integer division.
16831
16832 -mfix-r10000
16833 -mno-fix-r10000
16834 Work around certain R10000 errata:
16835
16836 - "ll"/"sc" sequences may not behave atomically on revisions
16837 prior to 3.0. They may deadlock on revisions 2.6 and earlier.
16838
16839 This option can only be used if the target architecture supports
16840 branch-likely instructions. -mfix-r10000 is the default when
16841 -march=r10000 is used; -mno-fix-r10000 is the default otherwise.
16842
16843 -mfix-rm7000
16844 -mno-fix-rm7000
16845 Work around the RM7000 "dmult"/"dmultu" errata. The workarounds
16846 are implemented by the assembler rather than by GCC.
16847
16848 -mfix-vr4120
16849 -mno-fix-vr4120
16850 Work around certain VR4120 errata:
16851
16852 - "dmultu" does not always produce the correct result.
16853
16854 - "div" and "ddiv" do not always produce the correct result if
16855 one of the operands is negative.
16856
16857 The workarounds for the division errata rely on special functions
16858 in libgcc.a. At present, these functions are only provided by the
16859 "mips64vr*-elf" configurations.
16860
16861 Other VR4120 errata require a NOP to be inserted between certain
16862 pairs of instructions. These errata are handled by the assembler,
16863 not by GCC itself.
16864
16865 -mfix-vr4130
16866 Work around the VR4130 "mflo"/"mfhi" errata. The workarounds are
16867 implemented by the assembler rather than by GCC, although GCC
16868 avoids using "mflo" and "mfhi" if the VR4130 "macc", "macchi",
16869 "dmacc" and "dmacchi" instructions are available instead.
16870
16871 -mfix-sb1
16872 -mno-fix-sb1
16873 Work around certain SB-1 CPU core errata. (This flag currently
16874 works around the SB-1 revision 2 "F1" and "F2" floating-point
16875 errata.)
16876
16877 -mr10k-cache-barrier=setting
16878 Specify whether GCC should insert cache barriers to avoid the side-
16879 effects of speculation on R10K processors.
16880
16881 In common with many processors, the R10K tries to predict the
16882 outcome of a conditional branch and speculatively executes
16883 instructions from the "taken" branch. It later aborts these
16884 instructions if the predicted outcome is wrong. However, on the
16885 R10K, even aborted instructions can have side effects.
16886
16887 This problem only affects kernel stores and, depending on the
16888 system, kernel loads. As an example, a speculatively-executed
16889 store may load the target memory into cache and mark the cache line
16890 as dirty, even if the store itself is later aborted. If a DMA
16891 operation writes to the same area of memory before the "dirty" line
16892 is flushed, the cached data overwrites the DMA-ed data. See the
16893 R10K processor manual for a full description, including other
16894 potential problems.
16895
16896 One workaround is to insert cache barrier instructions before every
16897 memory access that might be speculatively executed and that might
16898 have side effects even if aborted. -mr10k-cache-barrier=setting
16899 controls GCC's implementation of this workaround. It assumes that
16900 aborted accesses to any byte in the following regions does not have
16901 side effects:
16902
16903 1. the memory occupied by the current function's stack frame;
16904
16905 2. the memory occupied by an incoming stack argument;
16906
16907 3. the memory occupied by an object with a link-time-constant
16908 address.
16909
16910 It is the kernel's responsibility to ensure that speculative
16911 accesses to these regions are indeed safe.
16912
16913 If the input program contains a function declaration such as:
16914
16915 void foo (void);
16916
16917 then the implementation of "foo" must allow "j foo" and "jal foo"
16918 to be executed speculatively. GCC honors this restriction for
16919 functions it compiles itself. It expects non-GCC functions (such
16920 as hand-written assembly code) to do the same.
16921
16922 The option has three forms:
16923
16924 -mr10k-cache-barrier=load-store
16925 Insert a cache barrier before a load or store that might be
16926 speculatively executed and that might have side effects even if
16927 aborted.
16928
16929 -mr10k-cache-barrier=store
16930 Insert a cache barrier before a store that might be
16931 speculatively executed and that might have side effects even if
16932 aborted.
16933
16934 -mr10k-cache-barrier=none
16935 Disable the insertion of cache barriers. This is the default
16936 setting.
16937
16938 -mflush-func=func
16939 -mno-flush-func
16940 Specifies the function to call to flush the I and D caches, or to
16941 not call any such function. If called, the function must take the
16942 same arguments as the common "_flush_func", that is, the address of
16943 the memory range for which the cache is being flushed, the size of
16944 the memory range, and the number 3 (to flush both caches). The
16945 default depends on the target GCC was configured for, but commonly
16946 is either "_flush_func" or "__cpu_flush".
16947
16948 mbranch-cost=num
16949 Set the cost of branches to roughly num "simple" instructions.
16950 This cost is only a heuristic and is not guaranteed to produce
16951 consistent results across releases. A zero cost redundantly
16952 selects the default, which is based on the -mtune setting.
16953
16954 -mbranch-likely
16955 -mno-branch-likely
16956 Enable or disable use of Branch Likely instructions, regardless of
16957 the default for the selected architecture. By default, Branch
16958 Likely instructions may be generated if they are supported by the
16959 selected architecture. An exception is for the MIPS32 and MIPS64
16960 architectures and processors that implement those architectures;
16961 for those, Branch Likely instructions are not be generated by
16962 default because the MIPS32 and MIPS64 architectures specifically
16963 deprecate their use.
16964
16965 -mcompact-branches=never
16966 -mcompact-branches=optimal
16967 -mcompact-branches=always
16968 These options control which form of branches will be generated.
16969 The default is -mcompact-branches=optimal.
16970
16971 The -mcompact-branches=never option ensures that compact branch
16972 instructions will never be generated.
16973
16974 The -mcompact-branches=always option ensures that a compact branch
16975 instruction will be generated if available. If a compact branch
16976 instruction is not available, a delay slot form of the branch will
16977 be used instead.
16978
16979 This option is supported from MIPS Release 6 onwards.
16980
16981 The -mcompact-branches=optimal option will cause a delay slot
16982 branch to be used if one is available in the current ISA and the
16983 delay slot is successfully filled. If the delay slot is not
16984 filled, a compact branch will be chosen if one is available.
16985
16986 -mfp-exceptions
16987 -mno-fp-exceptions
16988 Specifies whether FP exceptions are enabled. This affects how FP
16989 instructions are scheduled for some processors. The default is
16990 that FP exceptions are enabled.
16991
16992 For instance, on the SB-1, if FP exceptions are disabled, and we
16993 are emitting 64-bit code, then we can use both FP pipes.
16994 Otherwise, we can only use one FP pipe.
16995
16996 -mvr4130-align
16997 -mno-vr4130-align
16998 The VR4130 pipeline is two-way superscalar, but can only issue two
16999 instructions together if the first one is 8-byte aligned. When
17000 this option is enabled, GCC aligns pairs of instructions that it
17001 thinks should execute in parallel.
17002
17003 This option only has an effect when optimizing for the VR4130. It
17004 normally makes code faster, but at the expense of making it bigger.
17005 It is enabled by default at optimization level -O3.
17006
17007 -msynci
17008 -mno-synci
17009 Enable (disable) generation of "synci" instructions on
17010 architectures that support it. The "synci" instructions (if
17011 enabled) are generated when "__builtin___clear_cache" is compiled.
17012
17013 This option defaults to -mno-synci, but the default can be
17014 overridden by configuring GCC with --with-synci.
17015
17016 When compiling code for single processor systems, it is generally
17017 safe to use "synci". However, on many multi-core (SMP) systems, it
17018 does not invalidate the instruction caches on all cores and may
17019 lead to undefined behavior.
17020
17021 -mrelax-pic-calls
17022 -mno-relax-pic-calls
17023 Try to turn PIC calls that are normally dispatched via register $25
17024 into direct calls. This is only possible if the linker can resolve
17025 the destination at link time and if the destination is within range
17026 for a direct call.
17027
17028 -mrelax-pic-calls is the default if GCC was configured to use an
17029 assembler and a linker that support the ".reloc" assembly directive
17030 and -mexplicit-relocs is in effect. With -mno-explicit-relocs,
17031 this optimization can be performed by the assembler and the linker
17032 alone without help from the compiler.
17033
17034 -mmcount-ra-address
17035 -mno-mcount-ra-address
17036 Emit (do not emit) code that allows "_mcount" to modify the calling
17037 function's return address. When enabled, this option extends the
17038 usual "_mcount" interface with a new ra-address parameter, which
17039 has type "intptr_t *" and is passed in register $12. "_mcount" can
17040 then modify the return address by doing both of the following:
17041
17042 * Returning the new address in register $31.
17043
17044 * Storing the new address in "*ra-address", if ra-address is
17045 nonnull.
17046
17047 The default is -mno-mcount-ra-address.
17048
17049 -mframe-header-opt
17050 -mno-frame-header-opt
17051 Enable (disable) frame header optimization in the o32 ABI. When
17052 using the o32 ABI, calling functions will allocate 16 bytes on the
17053 stack for the called function to write out register arguments.
17054 When enabled, this optimization will suppress the allocation of the
17055 frame header if it can be determined that it is unused.
17056
17057 This optimization is off by default at all optimization levels.
17058
17059 -mlxc1-sxc1
17060 -mno-lxc1-sxc1
17061 When applicable, enable (disable) the generation of "lwxc1",
17062 "swxc1", "ldxc1", "sdxc1" instructions. Enabled by default.
17063
17064 -mmadd4
17065 -mno-madd4
17066 When applicable, enable (disable) the generation of 4-operand
17067 "madd.s", "madd.d" and related instructions. Enabled by default.
17068
17069 MMIX Options
17070
17071 These options are defined for the MMIX:
17072
17073 -mlibfuncs
17074 -mno-libfuncs
17075 Specify that intrinsic library functions are being compiled,
17076 passing all values in registers, no matter the size.
17077
17078 -mepsilon
17079 -mno-epsilon
17080 Generate floating-point comparison instructions that compare with
17081 respect to the "rE" epsilon register.
17082
17083 -mabi=mmixware
17084 -mabi=gnu
17085 Generate code that passes function parameters and return values
17086 that (in the called function) are seen as registers $0 and up, as
17087 opposed to the GNU ABI which uses global registers $231 and up.
17088
17089 -mzero-extend
17090 -mno-zero-extend
17091 When reading data from memory in sizes shorter than 64 bits, use
17092 (do not use) zero-extending load instructions by default, rather
17093 than sign-extending ones.
17094
17095 -mknuthdiv
17096 -mno-knuthdiv
17097 Make the result of a division yielding a remainder have the same
17098 sign as the divisor. With the default, -mno-knuthdiv, the sign of
17099 the remainder follows the sign of the dividend. Both methods are
17100 arithmetically valid, the latter being almost exclusively used.
17101
17102 -mtoplevel-symbols
17103 -mno-toplevel-symbols
17104 Prepend (do not prepend) a : to all global symbols, so the assembly
17105 code can be used with the "PREFIX" assembly directive.
17106
17107 -melf
17108 Generate an executable in the ELF format, rather than the default
17109 mmo format used by the mmix simulator.
17110
17111 -mbranch-predict
17112 -mno-branch-predict
17113 Use (do not use) the probable-branch instructions, when static
17114 branch prediction indicates a probable branch.
17115
17116 -mbase-addresses
17117 -mno-base-addresses
17118 Generate (do not generate) code that uses base addresses. Using a
17119 base address automatically generates a request (handled by the
17120 assembler and the linker) for a constant to be set up in a global
17121 register. The register is used for one or more base address
17122 requests within the range 0 to 255 from the value held in the
17123 register. The generally leads to short and fast code, but the
17124 number of different data items that can be addressed is limited.
17125 This means that a program that uses lots of static data may require
17126 -mno-base-addresses.
17127
17128 -msingle-exit
17129 -mno-single-exit
17130 Force (do not force) generated code to have a single exit point in
17131 each function.
17132
17133 MN10300 Options
17134
17135 These -m options are defined for Matsushita MN10300 architectures:
17136
17137 -mmult-bug
17138 Generate code to avoid bugs in the multiply instructions for the
17139 MN10300 processors. This is the default.
17140
17141 -mno-mult-bug
17142 Do not generate code to avoid bugs in the multiply instructions for
17143 the MN10300 processors.
17144
17145 -mam33
17146 Generate code using features specific to the AM33 processor.
17147
17148 -mno-am33
17149 Do not generate code using features specific to the AM33 processor.
17150 This is the default.
17151
17152 -mam33-2
17153 Generate code using features specific to the AM33/2.0 processor.
17154
17155 -mam34
17156 Generate code using features specific to the AM34 processor.
17157
17158 -mtune=cpu-type
17159 Use the timing characteristics of the indicated CPU type when
17160 scheduling instructions. This does not change the targeted
17161 processor type. The CPU type must be one of mn10300, am33, am33-2
17162 or am34.
17163
17164 -mreturn-pointer-on-d0
17165 When generating a function that returns a pointer, return the
17166 pointer in both "a0" and "d0". Otherwise, the pointer is returned
17167 only in "a0", and attempts to call such functions without a
17168 prototype result in errors. Note that this option is on by
17169 default; use -mno-return-pointer-on-d0 to disable it.
17170
17171 -mno-crt0
17172 Do not link in the C run-time initialization object file.
17173
17174 -mrelax
17175 Indicate to the linker that it should perform a relaxation
17176 optimization pass to shorten branches, calls and absolute memory
17177 addresses. This option only has an effect when used on the command
17178 line for the final link step.
17179
17180 This option makes symbolic debugging impossible.
17181
17182 -mliw
17183 Allow the compiler to generate Long Instruction Word instructions
17184 if the target is the AM33 or later. This is the default. This
17185 option defines the preprocessor macro "__LIW__".
17186
17187 -mnoliw
17188 Do not allow the compiler to generate Long Instruction Word
17189 instructions. This option defines the preprocessor macro
17190 "__NO_LIW__".
17191
17192 -msetlb
17193 Allow the compiler to generate the SETLB and Lcc instructions if
17194 the target is the AM33 or later. This is the default. This option
17195 defines the preprocessor macro "__SETLB__".
17196
17197 -mnosetlb
17198 Do not allow the compiler to generate SETLB or Lcc instructions.
17199 This option defines the preprocessor macro "__NO_SETLB__".
17200
17201 Moxie Options
17202
17203 -meb
17204 Generate big-endian code. This is the default for moxie-*-*
17205 configurations.
17206
17207 -mel
17208 Generate little-endian code.
17209
17210 -mmul.x
17211 Generate mul.x and umul.x instructions. This is the default for
17212 moxiebox-*-* configurations.
17213
17214 -mno-crt0
17215 Do not link in the C run-time initialization object file.
17216
17217 MSP430 Options
17218
17219 These options are defined for the MSP430:
17220
17221 -masm-hex
17222 Force assembly output to always use hex constants. Normally such
17223 constants are signed decimals, but this option is available for
17224 testsuite and/or aesthetic purposes.
17225
17226 -mmcu=
17227 Select the MCU to target. This is used to create a C preprocessor
17228 symbol based upon the MCU name, converted to upper case and pre-
17229 and post-fixed with __. This in turn is used by the msp430.h
17230 header file to select an MCU-specific supplementary header file.
17231
17232 The option also sets the ISA to use. If the MCU name is one that
17233 is known to only support the 430 ISA then that is selected,
17234 otherwise the 430X ISA is selected. A generic MCU name of msp430
17235 can also be used to select the 430 ISA. Similarly the generic
17236 msp430x MCU name selects the 430X ISA.
17237
17238 In addition an MCU-specific linker script is added to the linker
17239 command line. The script's name is the name of the MCU with .ld
17240 appended. Thus specifying -mmcu=xxx on the gcc command line
17241 defines the C preprocessor symbol "__XXX__" and cause the linker to
17242 search for a script called xxx.ld.
17243
17244 This option is also passed on to the assembler.
17245
17246 -mwarn-mcu
17247 -mno-warn-mcu
17248 This option enables or disables warnings about conflicts between
17249 the MCU name specified by the -mmcu option and the ISA set by the
17250 -mcpu option and/or the hardware multiply support set by the
17251 -mhwmult option. It also toggles warnings about unrecognized MCU
17252 names. This option is on by default.
17253
17254 -mcpu=
17255 Specifies the ISA to use. Accepted values are msp430, msp430x and
17256 msp430xv2. This option is deprecated. The -mmcu= option should be
17257 used to select the ISA.
17258
17259 -msim
17260 Link to the simulator runtime libraries and linker script.
17261 Overrides any scripts that would be selected by the -mmcu= option.
17262
17263 -mlarge
17264 Use large-model addressing (20-bit pointers, 32-bit "size_t").
17265
17266 -msmall
17267 Use small-model addressing (16-bit pointers, 16-bit "size_t").
17268
17269 -mrelax
17270 This option is passed to the assembler and linker, and allows the
17271 linker to perform certain optimizations that cannot be done until
17272 the final link.
17273
17274 mhwmult=
17275 Describes the type of hardware multiply supported by the target.
17276 Accepted values are none for no hardware multiply, 16bit for the
17277 original 16-bit-only multiply supported by early MCUs. 32bit for
17278 the 16/32-bit multiply supported by later MCUs and f5series for the
17279 16/32-bit multiply supported by F5-series MCUs. A value of auto
17280 can also be given. This tells GCC to deduce the hardware multiply
17281 support based upon the MCU name provided by the -mmcu option. If
17282 no -mmcu option is specified or if the MCU name is not recognized
17283 then no hardware multiply support is assumed. "auto" is the
17284 default setting.
17285
17286 Hardware multiplies are normally performed by calling a library
17287 routine. This saves space in the generated code. When compiling
17288 at -O3 or higher however the hardware multiplier is invoked inline.
17289 This makes for bigger, but faster code.
17290
17291 The hardware multiply routines disable interrupts whilst running
17292 and restore the previous interrupt state when they finish. This
17293 makes them safe to use inside interrupt handlers as well as in
17294 normal code.
17295
17296 -minrt
17297 Enable the use of a minimum runtime environment - no static
17298 initializers or constructors. This is intended for memory-
17299 constrained devices. The compiler includes special symbols in some
17300 objects that tell the linker and runtime which code fragments are
17301 required.
17302
17303 -mcode-region=
17304 -mdata-region=
17305 These options tell the compiler where to place functions and data
17306 that do not have one of the "lower", "upper", "either" or "section"
17307 attributes. Possible values are "lower", "upper", "either" or
17308 "any". The first three behave like the corresponding attribute.
17309 The fourth possible value - "any" - is the default. It leaves
17310 placement entirely up to the linker script and how it assigns the
17311 standard sections (".text", ".data", etc) to the memory regions.
17312
17313 -msilicon-errata=
17314 This option passes on a request to assembler to enable the fixes
17315 for the named silicon errata.
17316
17317 -msilicon-errata-warn=
17318 This option passes on a request to the assembler to enable warning
17319 messages when a silicon errata might need to be applied.
17320
17321 NDS32 Options
17322
17323 These options are defined for NDS32 implementations:
17324
17325 -mbig-endian
17326 Generate code in big-endian mode.
17327
17328 -mlittle-endian
17329 Generate code in little-endian mode.
17330
17331 -mreduced-regs
17332 Use reduced-set registers for register allocation.
17333
17334 -mfull-regs
17335 Use full-set registers for register allocation.
17336
17337 -mcmov
17338 Generate conditional move instructions.
17339
17340 -mno-cmov
17341 Do not generate conditional move instructions.
17342
17343 -mperf-ext
17344 Generate performance extension instructions.
17345
17346 -mno-perf-ext
17347 Do not generate performance extension instructions.
17348
17349 -mv3push
17350 Generate v3 push25/pop25 instructions.
17351
17352 -mno-v3push
17353 Do not generate v3 push25/pop25 instructions.
17354
17355 -m16-bit
17356 Generate 16-bit instructions.
17357
17358 -mno-16-bit
17359 Do not generate 16-bit instructions.
17360
17361 -misr-vector-size=num
17362 Specify the size of each interrupt vector, which must be 4 or 16.
17363
17364 -mcache-block-size=num
17365 Specify the size of each cache block, which must be a power of 2
17366 between 4 and 512.
17367
17368 -march=arch
17369 Specify the name of the target architecture.
17370
17371 -mcmodel=code-model
17372 Set the code model to one of
17373
17374 small
17375 All the data and read-only data segments must be within 512KB
17376 addressing space. The text segment must be within 16MB
17377 addressing space.
17378
17379 medium
17380 The data segment must be within 512KB while the read-only data
17381 segment can be within 4GB addressing space. The text segment
17382 should be still within 16MB addressing space.
17383
17384 large
17385 All the text and data segments can be within 4GB addressing
17386 space.
17387
17388 -mctor-dtor
17389 Enable constructor/destructor feature.
17390
17391 -mrelax
17392 Guide linker to relax instructions.
17393
17394 Nios II Options
17395
17396 These are the options defined for the Altera Nios II processor.
17397
17398 -G num
17399 Put global and static objects less than or equal to num bytes into
17400 the small data or BSS sections instead of the normal data or BSS
17401 sections. The default value of num is 8.
17402
17403 -mgpopt=option
17404 -mgpopt
17405 -mno-gpopt
17406 Generate (do not generate) GP-relative accesses. The following
17407 option names are recognized:
17408
17409 none
17410 Do not generate GP-relative accesses.
17411
17412 local
17413 Generate GP-relative accesses for small data objects that are
17414 not external, weak, or uninitialized common symbols. Also use
17415 GP-relative addressing for objects that have been explicitly
17416 placed in a small data section via a "section" attribute.
17417
17418 global
17419 As for local, but also generate GP-relative accesses for small
17420 data objects that are external, weak, or common. If you use
17421 this option, you must ensure that all parts of your program
17422 (including libraries) are compiled with the same -G setting.
17423
17424 data
17425 Generate GP-relative accesses for all data objects in the
17426 program. If you use this option, the entire data and BSS
17427 segments of your program must fit in 64K of memory and you must
17428 use an appropriate linker script to allocate them within the
17429 addressable range of the global pointer.
17430
17431 all Generate GP-relative addresses for function pointers as well as
17432 data pointers. If you use this option, the entire text, data,
17433 and BSS segments of your program must fit in 64K of memory and
17434 you must use an appropriate linker script to allocate them
17435 within the addressable range of the global pointer.
17436
17437 -mgpopt is equivalent to -mgpopt=local, and -mno-gpopt is
17438 equivalent to -mgpopt=none.
17439
17440 The default is -mgpopt except when -fpic or -fPIC is specified to
17441 generate position-independent code. Note that the Nios II ABI does
17442 not permit GP-relative accesses from shared libraries.
17443
17444 You may need to specify -mno-gpopt explicitly when building
17445 programs that include large amounts of small data, including large
17446 GOT data sections. In this case, the 16-bit offset for GP-relative
17447 addressing may not be large enough to allow access to the entire
17448 small data section.
17449
17450 -mel
17451 -meb
17452 Generate little-endian (default) or big-endian (experimental) code,
17453 respectively.
17454
17455 -march=arch
17456 This specifies the name of the target Nios II architecture. GCC
17457 uses this name to determine what kind of instructions it can emit
17458 when generating assembly code. Permissible names are: r1, r2.
17459
17460 The preprocessor macro "__nios2_arch__" is available to programs,
17461 with value 1 or 2, indicating the targeted ISA level.
17462
17463 -mbypass-cache
17464 -mno-bypass-cache
17465 Force all load and store instructions to always bypass cache by
17466 using I/O variants of the instructions. The default is not to
17467 bypass the cache.
17468
17469 -mno-cache-volatile
17470 -mcache-volatile
17471 Volatile memory access bypass the cache using the I/O variants of
17472 the load and store instructions. The default is not to bypass the
17473 cache.
17474
17475 -mno-fast-sw-div
17476 -mfast-sw-div
17477 Do not use table-based fast divide for small numbers. The default
17478 is to use the fast divide at -O3 and above.
17479
17480 -mno-hw-mul
17481 -mhw-mul
17482 -mno-hw-mulx
17483 -mhw-mulx
17484 -mno-hw-div
17485 -mhw-div
17486 Enable or disable emitting "mul", "mulx" and "div" family of
17487 instructions by the compiler. The default is to emit "mul" and not
17488 emit "div" and "mulx".
17489
17490 -mbmx
17491 -mno-bmx
17492 -mcdx
17493 -mno-cdx
17494 Enable or disable generation of Nios II R2 BMX (bit manipulation)
17495 and CDX (code density) instructions. Enabling these instructions
17496 also requires -march=r2. Since these instructions are optional
17497 extensions to the R2 architecture, the default is not to emit them.
17498
17499 -mcustom-insn=N
17500 -mno-custom-insn
17501 Each -mcustom-insn=N option enables use of a custom instruction
17502 with encoding N when generating code that uses insn. For example,
17503 -mcustom-fadds=253 generates custom instruction 253 for single-
17504 precision floating-point add operations instead of the default
17505 behavior of using a library call.
17506
17507 The following values of insn are supported. Except as otherwise
17508 noted, floating-point operations are expected to be implemented
17509 with normal IEEE 754 semantics and correspond directly to the C
17510 operators or the equivalent GCC built-in functions.
17511
17512 Single-precision floating point:
17513
17514 fadds, fsubs, fdivs, fmuls
17515 Binary arithmetic operations.
17516
17517 fnegs
17518 Unary negation.
17519
17520 fabss
17521 Unary absolute value.
17522
17523 fcmpeqs, fcmpges, fcmpgts, fcmples, fcmplts, fcmpnes
17524 Comparison operations.
17525
17526 fmins, fmaxs
17527 Floating-point minimum and maximum. These instructions are
17528 only generated if -ffinite-math-only is specified.
17529
17530 fsqrts
17531 Unary square root operation.
17532
17533 fcoss, fsins, ftans, fatans, fexps, flogs
17534 Floating-point trigonometric and exponential functions. These
17535 instructions are only generated if -funsafe-math-optimizations
17536 is also specified.
17537
17538 Double-precision floating point:
17539
17540 faddd, fsubd, fdivd, fmuld
17541 Binary arithmetic operations.
17542
17543 fnegd
17544 Unary negation.
17545
17546 fabsd
17547 Unary absolute value.
17548
17549 fcmpeqd, fcmpged, fcmpgtd, fcmpled, fcmpltd, fcmpned
17550 Comparison operations.
17551
17552 fmind, fmaxd
17553 Double-precision minimum and maximum. These instructions are
17554 only generated if -ffinite-math-only is specified.
17555
17556 fsqrtd
17557 Unary square root operation.
17558
17559 fcosd, fsind, ftand, fatand, fexpd, flogd
17560 Double-precision trigonometric and exponential functions.
17561 These instructions are only generated if
17562 -funsafe-math-optimizations is also specified.
17563
17564 Conversions:
17565
17566 fextsd
17567 Conversion from single precision to double precision.
17568
17569 ftruncds
17570 Conversion from double precision to single precision.
17571
17572 fixsi, fixsu, fixdi, fixdu
17573 Conversion from floating point to signed or unsigned integer
17574 types, with truncation towards zero.
17575
17576 round
17577 Conversion from single-precision floating point to signed
17578 integer, rounding to the nearest integer and ties away from
17579 zero. This corresponds to the "__builtin_lroundf" function
17580 when -fno-math-errno is used.
17581
17582 floatis, floatus, floatid, floatud
17583 Conversion from signed or unsigned integer types to floating-
17584 point types.
17585
17586 In addition, all of the following transfer instructions for
17587 internal registers X and Y must be provided to use any of the
17588 double-precision floating-point instructions. Custom instructions
17589 taking two double-precision source operands expect the first
17590 operand in the 64-bit register X. The other operand (or only
17591 operand of a unary operation) is given to the custom arithmetic
17592 instruction with the least significant half in source register src1
17593 and the most significant half in src2. A custom instruction that
17594 returns a double-precision result returns the most significant 32
17595 bits in the destination register and the other half in 32-bit
17596 register Y. GCC automatically generates the necessary code
17597 sequences to write register X and/or read register Y when double-
17598 precision floating-point instructions are used.
17599
17600 fwrx
17601 Write src1 into the least significant half of X and src2 into
17602 the most significant half of X.
17603
17604 fwry
17605 Write src1 into Y.
17606
17607 frdxhi, frdxlo
17608 Read the most or least (respectively) significant half of X and
17609 store it in dest.
17610
17611 frdy
17612 Read the value of Y and store it into dest.
17613
17614 Note that you can gain more local control over generation of Nios
17615 II custom instructions by using the "target("custom-insn=N")" and
17616 "target("no-custom-insn")" function attributes or pragmas.
17617
17618 -mcustom-fpu-cfg=name
17619 This option enables a predefined, named set of custom instruction
17620 encodings (see -mcustom-insn above). Currently, the following sets
17621 are defined:
17622
17623 -mcustom-fpu-cfg=60-1 is equivalent to: -mcustom-fmuls=252
17624 -mcustom-fadds=253 -mcustom-fsubs=254 -fsingle-precision-constant
17625
17626 -mcustom-fpu-cfg=60-2 is equivalent to: -mcustom-fmuls=252
17627 -mcustom-fadds=253 -mcustom-fsubs=254 -mcustom-fdivs=255
17628 -fsingle-precision-constant
17629
17630 -mcustom-fpu-cfg=72-3 is equivalent to: -mcustom-floatus=243
17631 -mcustom-fixsi=244 -mcustom-floatis=245 -mcustom-fcmpgts=246
17632 -mcustom-fcmples=249 -mcustom-fcmpeqs=250 -mcustom-fcmpnes=251
17633 -mcustom-fmuls=252 -mcustom-fadds=253 -mcustom-fsubs=254
17634 -mcustom-fdivs=255 -fsingle-precision-constant
17635
17636 Custom instruction assignments given by individual -mcustom-insn=
17637 options override those given by -mcustom-fpu-cfg=, regardless of
17638 the order of the options on the command line.
17639
17640 Note that you can gain more local control over selection of a FPU
17641 configuration by using the "target("custom-fpu-cfg=name")" function
17642 attribute or pragma.
17643
17644 These additional -m options are available for the Altera Nios II ELF
17645 (bare-metal) target:
17646
17647 -mhal
17648 Link with HAL BSP. This suppresses linking with the GCC-provided C
17649 runtime startup and termination code, and is typically used in
17650 conjunction with -msys-crt0= to specify the location of the
17651 alternate startup code provided by the HAL BSP.
17652
17653 -msmallc
17654 Link with a limited version of the C library, -lsmallc, rather than
17655 Newlib.
17656
17657 -msys-crt0=startfile
17658 startfile is the file name of the startfile (crt0) to use when
17659 linking. This option is only useful in conjunction with -mhal.
17660
17661 -msys-lib=systemlib
17662 systemlib is the library name of the library that provides low-
17663 level system calls required by the C library, e.g. "read" and
17664 "write". This option is typically used to link with a library
17665 provided by a HAL BSP.
17666
17667 Nvidia PTX Options
17668
17669 These options are defined for Nvidia PTX:
17670
17671 -m32
17672 -m64
17673 Generate code for 32-bit or 64-bit ABI.
17674
17675 -mmainkernel
17676 Link in code for a __main kernel. This is for stand-alone instead
17677 of offloading execution.
17678
17679 -moptimize
17680 Apply partitioned execution optimizations. This is the default
17681 when any level of optimization is selected.
17682
17683 -msoft-stack
17684 Generate code that does not use ".local" memory directly for stack
17685 storage. Instead, a per-warp stack pointer is maintained
17686 explicitly. This enables variable-length stack allocation (with
17687 variable-length arrays or "alloca"), and when global memory is used
17688 for underlying storage, makes it possible to access automatic
17689 variables from other threads, or with atomic instructions. This
17690 code generation variant is used for OpenMP offloading, but the
17691 option is exposed on its own for the purpose of testing the
17692 compiler; to generate code suitable for linking into programs using
17693 OpenMP offloading, use option -mgomp.
17694
17695 -muniform-simt
17696 Switch to code generation variant that allows to execute all
17697 threads in each warp, while maintaining memory state and side
17698 effects as if only one thread in each warp was active outside of
17699 OpenMP SIMD regions. All atomic operations and calls to runtime
17700 (malloc, free, vprintf) are conditionally executed (iff current
17701 lane index equals the master lane index), and the register being
17702 assigned is copied via a shuffle instruction from the master lane.
17703 Outside of SIMD regions lane 0 is the master; inside, each thread
17704 sees itself as the master. Shared memory array "int __nvptx_uni[]"
17705 stores all-zeros or all-ones bitmasks for each warp, indicating
17706 current mode (0 outside of SIMD regions). Each thread can bitwise-
17707 and the bitmask at position "tid.y" with current lane index to
17708 compute the master lane index.
17709
17710 -mgomp
17711 Generate code for use in OpenMP offloading: enables -msoft-stack
17712 and -muniform-simt options, and selects corresponding multilib
17713 variant.
17714
17715 PDP-11 Options
17716
17717 These options are defined for the PDP-11:
17718
17719 -mfpu
17720 Use hardware FPP floating point. This is the default. (FIS
17721 floating point on the PDP-11/40 is not supported.)
17722
17723 -msoft-float
17724 Do not use hardware floating point.
17725
17726 -mac0
17727 Return floating-point results in ac0 (fr0 in Unix assembler
17728 syntax).
17729
17730 -mno-ac0
17731 Return floating-point results in memory. This is the default.
17732
17733 -m40
17734 Generate code for a PDP-11/40.
17735
17736 -m45
17737 Generate code for a PDP-11/45. This is the default.
17738
17739 -m10
17740 Generate code for a PDP-11/10.
17741
17742 -mbcopy-builtin
17743 Use inline "movmemhi" patterns for copying memory. This is the
17744 default.
17745
17746 -mbcopy
17747 Do not use inline "movmemhi" patterns for copying memory.
17748
17749 -mint16
17750 -mno-int32
17751 Use 16-bit "int". This is the default.
17752
17753 -mint32
17754 -mno-int16
17755 Use 32-bit "int".
17756
17757 -mfloat64
17758 -mno-float32
17759 Use 64-bit "float". This is the default.
17760
17761 -mfloat32
17762 -mno-float64
17763 Use 32-bit "float".
17764
17765 -mabshi
17766 Use "abshi2" pattern. This is the default.
17767
17768 -mno-abshi
17769 Do not use "abshi2" pattern.
17770
17771 -mbranch-expensive
17772 Pretend that branches are expensive. This is for experimenting
17773 with code generation only.
17774
17775 -mbranch-cheap
17776 Do not pretend that branches are expensive. This is the default.
17777
17778 -munix-asm
17779 Use Unix assembler syntax. This is the default when configured for
17780 pdp11-*-bsd.
17781
17782 -mdec-asm
17783 Use DEC assembler syntax. This is the default when configured for
17784 any PDP-11 target other than pdp11-*-bsd.
17785
17786 picoChip Options
17787
17788 These -m options are defined for picoChip implementations:
17789
17790 -mae=ae_type
17791 Set the instruction set, register set, and instruction scheduling
17792 parameters for array element type ae_type. Supported values for
17793 ae_type are ANY, MUL, and MAC.
17794
17795 -mae=ANY selects a completely generic AE type. Code generated with
17796 this option runs on any of the other AE types. The code is not as
17797 efficient as it would be if compiled for a specific AE type, and
17798 some types of operation (e.g., multiplication) do not work properly
17799 on all types of AE.
17800
17801 -mae=MUL selects a MUL AE type. This is the most useful AE type
17802 for compiled code, and is the default.
17803
17804 -mae=MAC selects a DSP-style MAC AE. Code compiled with this
17805 option may suffer from poor performance of byte (char)
17806 manipulation, since the DSP AE does not provide hardware support
17807 for byte load/stores.
17808
17809 -msymbol-as-address
17810 Enable the compiler to directly use a symbol name as an address in
17811 a load/store instruction, without first loading it into a register.
17812 Typically, the use of this option generates larger programs, which
17813 run faster than when the option isn't used. However, the results
17814 vary from program to program, so it is left as a user option,
17815 rather than being permanently enabled.
17816
17817 -mno-inefficient-warnings
17818 Disables warnings about the generation of inefficient code. These
17819 warnings can be generated, for example, when compiling code that
17820 performs byte-level memory operations on the MAC AE type. The MAC
17821 AE has no hardware support for byte-level memory operations, so all
17822 byte load/stores must be synthesized from word load/store
17823 operations. This is inefficient and a warning is generated to
17824 indicate that you should rewrite the code to avoid byte operations,
17825 or to target an AE type that has the necessary hardware support.
17826 This option disables these warnings.
17827
17828 PowerPC Options
17829
17830 These are listed under
17831
17832 RISC-V Options
17833
17834 These command-line options are defined for RISC-V targets:
17835
17836 -mbranch-cost=n
17837 Set the cost of branches to roughly n instructions.
17838
17839 -mplt
17840 -mno-plt
17841 When generating PIC code, do or don't allow the use of PLTs.
17842 Ignored for non-PIC. The default is -mplt.
17843
17844 -mabi=ABI-string
17845 Specify integer and floating-point calling convention. ABI-string
17846 contains two parts: the size of integer types and the registers
17847 used for floating-point types. For example -march=rv64ifd
17848 -mabi=lp64d means that long and pointers are 64-bit (implicitly
17849 defining int to be 32-bit), and that floating-point values up to 64
17850 bits wide are passed in F registers. Contrast this with
17851 -march=rv64ifd -mabi=lp64f, which still allows the compiler to
17852 generate code that uses the F and D extensions but only allows
17853 floating-point values up to 32 bits long to be passed in registers;
17854 or -march=rv64ifd -mabi=lp64, in which no floating-point arguments
17855 will be passed in registers.
17856
17857 The default for this argument is system dependent, users who want a
17858 specific calling convention should specify one explicitly. The
17859 valid calling conventions are: ilp32, ilp32f, ilp32d, lp64, lp64f,
17860 and lp64d. Some calling conventions are impossible to implement on
17861 some ISAs: for example, -march=rv32if -mabi=ilp32d is invalid
17862 because the ABI requires 64-bit values be passed in F registers,
17863 but F registers are only 32 bits wide.
17864
17865 -mfdiv
17866 -mno-fdiv
17867 Do or don't use hardware floating-point divide and square root
17868 instructions. This requires the F or D extensions for floating-
17869 point registers. The default is to use them if the specified
17870 architecture has these instructions.
17871
17872 -mdiv
17873 -mno-div
17874 Do or don't use hardware instructions for integer division. This
17875 requires the M extension. The default is to use them if the
17876 specified architecture has these instructions.
17877
17878 -march=ISA-string
17879 Generate code for given RISC-V ISA (e.g. rv64im). ISA strings must
17880 be lower-case. Examples include rv64i, rv32g, and rv32imaf.
17881
17882 -mtune=processor-string
17883 Optimize the output for the given processor, specified by
17884 microarchitecture name.
17885
17886 -msmall-data-limit=n
17887 Put global and static data smaller than n bytes into a special
17888 section (on some targets).
17889
17890 -msave-restore
17891 -mno-save-restore
17892 Do or don't use smaller but slower prologue and epilogue code that
17893 uses library function calls. The default is to use fast inline
17894 prologues and epilogues.
17895
17896 -mstrict-align
17897 -mno-strict-align
17898 Do not or do generate unaligned memory accesses. The default is
17899 set depending on whether the processor we are optimizing for
17900 supports fast unaligned access or not.
17901
17902 -mcmodel=medlow
17903 Generate code for the medium-low code model. The program and its
17904 statically defined symbols must lie within a single 2 GiB address
17905 range and must lie between absolute addresses -2 GiB and +2 GiB.
17906 Programs can be statically or dynamically linked. This is the
17907 default code model.
17908
17909 -mcmodel=medany
17910 Generate code for the medium-any code model. The program and its
17911 statically defined symbols must be within any single 2 GiB address
17912 range. Programs can be statically or dynamically linked.
17913
17914 -mexplicit-relocs
17915 -mno-exlicit-relocs
17916 Use or do not use assembler relocation operators when dealing with
17917 symbolic addresses. The alternative is to use assembler macros
17918 instead, which may limit optimization.
17919
17920 RL78 Options
17921
17922 -msim
17923 Links in additional target libraries to support operation within a
17924 simulator.
17925
17926 -mmul=none
17927 -mmul=g10
17928 -mmul=g13
17929 -mmul=g14
17930 -mmul=rl78
17931 Specifies the type of hardware multiplication and division support
17932 to be used. The simplest is "none", which uses software for both
17933 multiplication and division. This is the default. The "g13" value
17934 is for the hardware multiply/divide peripheral found on the
17935 RL78/G13 (S2 core) targets. The "g14" value selects the use of the
17936 multiplication and division instructions supported by the RL78/G14
17937 (S3 core) parts. The value "rl78" is an alias for "g14" and the
17938 value "mg10" is an alias for "none".
17939
17940 In addition a C preprocessor macro is defined, based upon the
17941 setting of this option. Possible values are: "__RL78_MUL_NONE__",
17942 "__RL78_MUL_G13__" or "__RL78_MUL_G14__".
17943
17944 -mcpu=g10
17945 -mcpu=g13
17946 -mcpu=g14
17947 -mcpu=rl78
17948 Specifies the RL78 core to target. The default is the G14 core,
17949 also known as an S3 core or just RL78. The G13 or S2 core does not
17950 have multiply or divide instructions, instead it uses a hardware
17951 peripheral for these operations. The G10 or S1 core does not have
17952 register banks, so it uses a different calling convention.
17953
17954 If this option is set it also selects the type of hardware multiply
17955 support to use, unless this is overridden by an explicit -mmul=none
17956 option on the command line. Thus specifying -mcpu=g13 enables the
17957 use of the G13 hardware multiply peripheral and specifying
17958 -mcpu=g10 disables the use of hardware multiplications altogether.
17959
17960 Note, although the RL78/G14 core is the default target, specifying
17961 -mcpu=g14 or -mcpu=rl78 on the command line does change the
17962 behavior of the toolchain since it also enables G14 hardware
17963 multiply support. If these options are not specified on the
17964 command line then software multiplication routines will be used
17965 even though the code targets the RL78 core. This is for backwards
17966 compatibility with older toolchains which did not have hardware
17967 multiply and divide support.
17968
17969 In addition a C preprocessor macro is defined, based upon the
17970 setting of this option. Possible values are: "__RL78_G10__",
17971 "__RL78_G13__" or "__RL78_G14__".
17972
17973 -mg10
17974 -mg13
17975 -mg14
17976 -mrl78
17977 These are aliases for the corresponding -mcpu= option. They are
17978 provided for backwards compatibility.
17979
17980 -mallregs
17981 Allow the compiler to use all of the available registers. By
17982 default registers "r24..r31" are reserved for use in interrupt
17983 handlers. With this option enabled these registers can be used in
17984 ordinary functions as well.
17985
17986 -m64bit-doubles
17987 -m32bit-doubles
17988 Make the "double" data type be 64 bits (-m64bit-doubles) or 32 bits
17989 (-m32bit-doubles) in size. The default is -m32bit-doubles.
17990
17991 -msave-mduc-in-interrupts
17992 -mno-save-mduc-in-interrupts
17993 Specifies that interrupt handler functions should preserve the MDUC
17994 registers. This is only necessary if normal code might use the
17995 MDUC registers, for example because it performs multiplication and
17996 division operations. The default is to ignore the MDUC registers
17997 as this makes the interrupt handlers faster. The target option
17998 -mg13 needs to be passed for this to work as this feature is only
17999 available on the G13 target (S2 core). The MDUC registers will
18000 only be saved if the interrupt handler performs a multiplication or
18001 division operation or it calls another function.
18002
18003 IBM RS/6000 and PowerPC Options
18004
18005 These -m options are defined for the IBM RS/6000 and PowerPC:
18006
18007 -mpowerpc-gpopt
18008 -mno-powerpc-gpopt
18009 -mpowerpc-gfxopt
18010 -mno-powerpc-gfxopt
18011 -mpowerpc64
18012 -mno-powerpc64
18013 -mmfcrf
18014 -mno-mfcrf
18015 -mpopcntb
18016 -mno-popcntb
18017 -mpopcntd
18018 -mno-popcntd
18019 -mfprnd
18020 -mno-fprnd
18021 -mcmpb
18022 -mno-cmpb
18023 -mmfpgpr
18024 -mno-mfpgpr
18025 -mhard-dfp
18026 -mno-hard-dfp
18027 You use these options to specify which instructions are available
18028 on the processor you are using. The default value of these options
18029 is determined when configuring GCC. Specifying the -mcpu=cpu_type
18030 overrides the specification of these options. We recommend you use
18031 the -mcpu=cpu_type option rather than the options listed above.
18032
18033 Specifying -mpowerpc-gpopt allows GCC to use the optional PowerPC
18034 architecture instructions in the General Purpose group, including
18035 floating-point square root. Specifying -mpowerpc-gfxopt allows GCC
18036 to use the optional PowerPC architecture instructions in the
18037 Graphics group, including floating-point select.
18038
18039 The -mmfcrf option allows GCC to generate the move from condition
18040 register field instruction implemented on the POWER4 processor and
18041 other processors that support the PowerPC V2.01 architecture. The
18042 -mpopcntb option allows GCC to generate the popcount and double-
18043 precision FP reciprocal estimate instruction implemented on the
18044 POWER5 processor and other processors that support the PowerPC
18045 V2.02 architecture. The -mpopcntd option allows GCC to generate
18046 the popcount instruction implemented on the POWER7 processor and
18047 other processors that support the PowerPC V2.06 architecture. The
18048 -mfprnd option allows GCC to generate the FP round to integer
18049 instructions implemented on the POWER5+ processor and other
18050 processors that support the PowerPC V2.03 architecture. The -mcmpb
18051 option allows GCC to generate the compare bytes instruction
18052 implemented on the POWER6 processor and other processors that
18053 support the PowerPC V2.05 architecture. The -mmfpgpr option allows
18054 GCC to generate the FP move to/from general-purpose register
18055 instructions implemented on the POWER6X processor and other
18056 processors that support the extended PowerPC V2.05 architecture.
18057 The -mhard-dfp option allows GCC to generate the decimal floating-
18058 point instructions implemented on some POWER processors.
18059
18060 The -mpowerpc64 option allows GCC to generate the additional 64-bit
18061 instructions that are found in the full PowerPC64 architecture and
18062 to treat GPRs as 64-bit, doubleword quantities. GCC defaults to
18063 -mno-powerpc64.
18064
18065 -mcpu=cpu_type
18066 Set architecture type, register usage, and instruction scheduling
18067 parameters for machine type cpu_type. Supported values for
18068 cpu_type are 401, 403, 405, 405fp, 440, 440fp, 464, 464fp, 476,
18069 476fp, 505, 601, 602, 603, 603e, 604, 604e, 620, 630, 740, 7400,
18070 7450, 750, 801, 821, 823, 860, 970, 8540, a2, e300c2, e300c3,
18071 e500mc, e500mc64, e5500, e6500, ec603e, G3, G4, G5, titan, power3,
18072 power4, power5, power5+, power6, power6x, power7, power8, power9,
18073 powerpc, powerpc64, powerpc64le, and rs64.
18074
18075 -mcpu=powerpc, -mcpu=powerpc64, and -mcpu=powerpc64le specify pure
18076 32-bit PowerPC (either endian), 64-bit big endian PowerPC and
18077 64-bit little endian PowerPC architecture machine types, with an
18078 appropriate, generic processor model assumed for scheduling
18079 purposes.
18080
18081 The other options specify a specific processor. Code generated
18082 under those options runs best on that processor, and may not run at
18083 all on others.
18084
18085 The -mcpu options automatically enable or disable the following
18086 options:
18087
18088 -maltivec -mfprnd -mhard-float -mmfcrf -mmultiple -mpopcntb
18089 -mpopcntd -mpowerpc64 -mpowerpc-gpopt -mpowerpc-gfxopt
18090 -msingle-float -mdouble-float -msimple-fpu -mstring -mmulhw
18091 -mdlmzb -mmfpgpr -mvsx -mcrypto -mdirect-move -mhtm
18092 -mpower8-fusion -mpower8-vector -mquad-memory -mquad-memory-atomic
18093 -mfloat128 -mfloat128-hardware
18094
18095 The particular options set for any particular CPU varies between
18096 compiler versions, depending on what setting seems to produce
18097 optimal code for that CPU; it doesn't necessarily reflect the
18098 actual hardware's capabilities. If you wish to set an individual
18099 option to a particular value, you may specify it after the -mcpu
18100 option, like -mcpu=970 -mno-altivec.
18101
18102 On AIX, the -maltivec and -mpowerpc64 options are not enabled or
18103 disabled by the -mcpu option at present because AIX does not have
18104 full support for these options. You may still enable or disable
18105 them individually if you're sure it'll work in your environment.
18106
18107 -mtune=cpu_type
18108 Set the instruction scheduling parameters for machine type
18109 cpu_type, but do not set the architecture type or register usage,
18110 as -mcpu=cpu_type does. The same values for cpu_type are used for
18111 -mtune as for -mcpu. If both are specified, the code generated
18112 uses the architecture and registers set by -mcpu, but the
18113 scheduling parameters set by -mtune.
18114
18115 -mcmodel=small
18116 Generate PowerPC64 code for the small model: The TOC is limited to
18117 64k.
18118
18119 -mcmodel=medium
18120 Generate PowerPC64 code for the medium model: The TOC and other
18121 static data may be up to a total of 4G in size. This is the
18122 default for 64-bit Linux.
18123
18124 -mcmodel=large
18125 Generate PowerPC64 code for the large model: The TOC may be up to
18126 4G in size. Other data and code is only limited by the 64-bit
18127 address space.
18128
18129 -maltivec
18130 -mno-altivec
18131 Generate code that uses (does not use) AltiVec instructions, and
18132 also enable the use of built-in functions that allow more direct
18133 access to the AltiVec instruction set. You may also need to set
18134 -mabi=altivec to adjust the current ABI with AltiVec ABI
18135 enhancements.
18136
18137 When -maltivec is used, rather than -maltivec=le or -maltivec=be,
18138 the element order for AltiVec intrinsics such as "vec_splat",
18139 "vec_extract", and "vec_insert" match array element order
18140 corresponding to the endianness of the target. That is, element
18141 zero identifies the leftmost element in a vector register when
18142 targeting a big-endian platform, and identifies the rightmost
18143 element in a vector register when targeting a little-endian
18144 platform.
18145
18146 -maltivec=be
18147 Generate AltiVec instructions using big-endian element order,
18148 regardless of whether the target is big- or little-endian. This is
18149 the default when targeting a big-endian platform.
18150
18151 The element order is used to interpret element numbers in AltiVec
18152 intrinsics such as "vec_splat", "vec_extract", and "vec_insert".
18153 By default, these match array element order corresponding to the
18154 endianness for the target.
18155
18156 -maltivec=le
18157 Generate AltiVec instructions using little-endian element order,
18158 regardless of whether the target is big- or little-endian. This is
18159 the default when targeting a little-endian platform. This option
18160 is currently ignored when targeting a big-endian platform.
18161
18162 The element order is used to interpret element numbers in AltiVec
18163 intrinsics such as "vec_splat", "vec_extract", and "vec_insert".
18164 By default, these match array element order corresponding to the
18165 endianness for the target.
18166
18167 -mvrsave
18168 -mno-vrsave
18169 Generate VRSAVE instructions when generating AltiVec code.
18170
18171 -mgen-cell-microcode
18172 Generate Cell microcode instructions.
18173
18174 -mwarn-cell-microcode
18175 Warn when a Cell microcode instruction is emitted. An example of a
18176 Cell microcode instruction is a variable shift.
18177
18178 -msecure-plt
18179 Generate code that allows ld and ld.so to build executables and
18180 shared libraries with non-executable ".plt" and ".got" sections.
18181 This is a PowerPC 32-bit SYSV ABI option.
18182
18183 -mbss-plt
18184 Generate code that uses a BSS ".plt" section that ld.so fills in,
18185 and requires ".plt" and ".got" sections that are both writable and
18186 executable. This is a PowerPC 32-bit SYSV ABI option.
18187
18188 -misel
18189 -mno-isel
18190 This switch enables or disables the generation of ISEL
18191 instructions.
18192
18193 -misel=yes/no
18194 This switch has been deprecated. Use -misel and -mno-isel instead.
18195
18196 -mlra
18197 Enable Local Register Allocation. By default the port uses LRA.
18198 (i.e. -mno-lra).
18199
18200 -mspe
18201 -mno-spe
18202 This switch enables or disables the generation of SPE simd
18203 instructions.
18204
18205 -mpaired
18206 -mno-paired
18207 This switch enables or disables the generation of PAIRED simd
18208 instructions.
18209
18210 -mspe=yes/no
18211 This option has been deprecated. Use -mspe and -mno-spe instead.
18212
18213 -mvsx
18214 -mno-vsx
18215 Generate code that uses (does not use) vector/scalar (VSX)
18216 instructions, and also enable the use of built-in functions that
18217 allow more direct access to the VSX instruction set.
18218
18219 -mcrypto
18220 -mno-crypto
18221 Enable the use (disable) of the built-in functions that allow
18222 direct access to the cryptographic instructions that were added in
18223 version 2.07 of the PowerPC ISA.
18224
18225 -mdirect-move
18226 -mno-direct-move
18227 Generate code that uses (does not use) the instructions to move
18228 data between the general purpose registers and the vector/scalar
18229 (VSX) registers that were added in version 2.07 of the PowerPC ISA.
18230
18231 -mhtm
18232 -mno-htm
18233 Enable (disable) the use of the built-in functions that allow
18234 direct access to the Hardware Transactional Memory (HTM)
18235 instructions that were added in version 2.07 of the PowerPC ISA.
18236
18237 -mpower8-fusion
18238 -mno-power8-fusion
18239 Generate code that keeps (does not keeps) some integer operations
18240 adjacent so that the instructions can be fused together on power8
18241 and later processors.
18242
18243 -mpower8-vector
18244 -mno-power8-vector
18245 Generate code that uses (does not use) the vector and scalar
18246 instructions that were added in version 2.07 of the PowerPC ISA.
18247 Also enable the use of built-in functions that allow more direct
18248 access to the vector instructions.
18249
18250 -mquad-memory
18251 -mno-quad-memory
18252 Generate code that uses (does not use) the non-atomic quad word
18253 memory instructions. The -mquad-memory option requires use of
18254 64-bit mode.
18255
18256 -mquad-memory-atomic
18257 -mno-quad-memory-atomic
18258 Generate code that uses (does not use) the atomic quad word memory
18259 instructions. The -mquad-memory-atomic option requires use of
18260 64-bit mode.
18261
18262 -mupper-regs-di
18263 -mno-upper-regs-di
18264 Generate code that uses (does not use) the scalar instructions that
18265 target all 64 registers in the vector/scalar floating point
18266 register set that were added in version 2.06 of the PowerPC ISA
18267 when processing integers. -mupper-regs-di is turned on by default
18268 if you use any of the -mcpu=power7, -mcpu=power8, -mcpu=power9, or
18269 -mvsx options.
18270
18271 -mupper-regs-df
18272 -mno-upper-regs-df
18273 Generate code that uses (does not use) the scalar double precision
18274 instructions that target all 64 registers in the vector/scalar
18275 floating point register set that were added in version 2.06 of the
18276 PowerPC ISA. -mupper-regs-df is turned on by default if you use
18277 any of the -mcpu=power7, -mcpu=power8, -mcpu=power9, or -mvsx
18278 options.
18279
18280 -mupper-regs-sf
18281 -mno-upper-regs-sf
18282 Generate code that uses (does not use) the scalar single precision
18283 instructions that target all 64 registers in the vector/scalar
18284 floating point register set that were added in version 2.07 of the
18285 PowerPC ISA. -mupper-regs-sf is turned on by default if you use
18286 either of the -mcpu=power8, -mpower8-vector, or -mcpu=power9
18287 options.
18288
18289 -mupper-regs
18290 -mno-upper-regs
18291 Generate code that uses (does not use) the scalar instructions that
18292 target all 64 registers in the vector/scalar floating point
18293 register set, depending on the model of the machine.
18294
18295 If the -mno-upper-regs option is used, it turns off both
18296 -mupper-regs-sf and -mupper-regs-df options.
18297
18298 -mfloat128
18299 -mno-float128
18300 Enable/disable the __float128 keyword for IEEE 128-bit floating
18301 point and use either software emulation for IEEE 128-bit floating
18302 point or hardware instructions.
18303
18304 The VSX instruction set (-mvsx, -mcpu=power7, or -mcpu=power8) must
18305 be enabled to use the -mfloat128 option. The -mfloat128 option
18306 only works on PowerPC 64-bit Linux systems.
18307
18308 If you use the ISA 3.0 instruction set (-mcpu=power9), the
18309 -mfloat128 option will also enable the generation of ISA 3.0 IEEE
18310 128-bit floating point instructions. Otherwise, IEEE 128-bit
18311 floating point will be done with software emulation.
18312
18313 -mfloat128-hardware
18314 -mno-float128-hardware
18315 Enable/disable using ISA 3.0 hardware instructions to support the
18316 __float128 data type.
18317
18318 If you use -mfloat128-hardware, it will enable the option
18319 -mfloat128 as well.
18320
18321 If you select ISA 3.0 instructions with -mcpu=power9, but do not
18322 use either -mfloat128 or -mfloat128-hardware, the IEEE 128-bit
18323 floating point support will not be enabled.
18324
18325 -mfloat-gprs=yes/single/double/no
18326 -mfloat-gprs
18327 This switch enables or disables the generation of floating-point
18328 operations on the general-purpose registers for architectures that
18329 support it.
18330
18331 The argument yes or single enables the use of single-precision
18332 floating-point operations.
18333
18334 The argument double enables the use of single and double-precision
18335 floating-point operations.
18336
18337 The argument no disables floating-point operations on the general-
18338 purpose registers.
18339
18340 This option is currently only available on the MPC854x.
18341
18342 -m32
18343 -m64
18344 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
18345 targets (including GNU/Linux). The 32-bit environment sets int,
18346 long and pointer to 32 bits and generates code that runs on any
18347 PowerPC variant. The 64-bit environment sets int to 32 bits and
18348 long and pointer to 64 bits, and generates code for PowerPC64, as
18349 for -mpowerpc64.
18350
18351 -mfull-toc
18352 -mno-fp-in-toc
18353 -mno-sum-in-toc
18354 -mminimal-toc
18355 Modify generation of the TOC (Table Of Contents), which is created
18356 for every executable file. The -mfull-toc option is selected by
18357 default. In that case, GCC allocates at least one TOC entry for
18358 each unique non-automatic variable reference in your program. GCC
18359 also places floating-point constants in the TOC. However, only
18360 16,384 entries are available in the TOC.
18361
18362 If you receive a linker error message that saying you have
18363 overflowed the available TOC space, you can reduce the amount of
18364 TOC space used with the -mno-fp-in-toc and -mno-sum-in-toc options.
18365 -mno-fp-in-toc prevents GCC from putting floating-point constants
18366 in the TOC and -mno-sum-in-toc forces GCC to generate code to
18367 calculate the sum of an address and a constant at run time instead
18368 of putting that sum into the TOC. You may specify one or both of
18369 these options. Each causes GCC to produce very slightly slower and
18370 larger code at the expense of conserving TOC space.
18371
18372 If you still run out of space in the TOC even when you specify both
18373 of these options, specify -mminimal-toc instead. This option
18374 causes GCC to make only one TOC entry for every file. When you
18375 specify this option, GCC produces code that is slower and larger
18376 but which uses extremely little TOC space. You may wish to use
18377 this option only on files that contain less frequently-executed
18378 code.
18379
18380 -maix64
18381 -maix32
18382 Enable 64-bit AIX ABI and calling convention: 64-bit pointers,
18383 64-bit "long" type, and the infrastructure needed to support them.
18384 Specifying -maix64 implies -mpowerpc64, while -maix32 disables the
18385 64-bit ABI and implies -mno-powerpc64. GCC defaults to -maix32.
18386
18387 -mxl-compat
18388 -mno-xl-compat
18389 Produce code that conforms more closely to IBM XL compiler
18390 semantics when using AIX-compatible ABI. Pass floating-point
18391 arguments to prototyped functions beyond the register save area
18392 (RSA) on the stack in addition to argument FPRs. Do not assume
18393 that most significant double in 128-bit long double value is
18394 properly rounded when comparing values and converting to double.
18395 Use XL symbol names for long double support routines.
18396
18397 The AIX calling convention was extended but not initially
18398 documented to handle an obscure K&R C case of calling a function
18399 that takes the address of its arguments with fewer arguments than
18400 declared. IBM XL compilers access floating-point arguments that do
18401 not fit in the RSA from the stack when a subroutine is compiled
18402 without optimization. Because always storing floating-point
18403 arguments on the stack is inefficient and rarely needed, this
18404 option is not enabled by default and only is necessary when calling
18405 subroutines compiled by IBM XL compilers without optimization.
18406
18407 -mpe
18408 Support IBM RS/6000 SP Parallel Environment (PE). Link an
18409 application written to use message passing with special startup
18410 code to enable the application to run. The system must have PE
18411 installed in the standard location (/usr/lpp/ppe.poe/), or the
18412 specs file must be overridden with the -specs= option to specify
18413 the appropriate directory location. The Parallel Environment does
18414 not support threads, so the -mpe option and the -pthread option are
18415 incompatible.
18416
18417 -malign-natural
18418 -malign-power
18419 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
18420 -malign-natural overrides the ABI-defined alignment of larger
18421 types, such as floating-point doubles, on their natural size-based
18422 boundary. The option -malign-power instructs GCC to follow the
18423 ABI-specified alignment rules. GCC defaults to the standard
18424 alignment defined in the ABI.
18425
18426 On 64-bit Darwin, natural alignment is the default, and
18427 -malign-power is not supported.
18428
18429 -msoft-float
18430 -mhard-float
18431 Generate code that does not use (uses) the floating-point register
18432 set. Software floating-point emulation is provided if you use the
18433 -msoft-float option, and pass the option to GCC when linking.
18434
18435 -msingle-float
18436 -mdouble-float
18437 Generate code for single- or double-precision floating-point
18438 operations. -mdouble-float implies -msingle-float.
18439
18440 -msimple-fpu
18441 Do not generate "sqrt" and "div" instructions for hardware
18442 floating-point unit.
18443
18444 -mfpu=name
18445 Specify type of floating-point unit. Valid values for name are
18446 sp_lite (equivalent to -msingle-float -msimple-fpu), dp_lite
18447 (equivalent to -mdouble-float -msimple-fpu), sp_full (equivalent to
18448 -msingle-float), and dp_full (equivalent to -mdouble-float).
18449
18450 -mxilinx-fpu
18451 Perform optimizations for the floating-point unit on Xilinx PPC
18452 405/440.
18453
18454 -mmultiple
18455 -mno-multiple
18456 Generate code that uses (does not use) the load multiple word
18457 instructions and the store multiple word instructions. These
18458 instructions are generated by default on POWER systems, and not
18459 generated on PowerPC systems. Do not use -mmultiple on little-
18460 endian PowerPC systems, since those instructions do not work when
18461 the processor is in little-endian mode. The exceptions are PPC740
18462 and PPC750 which permit these instructions in little-endian mode.
18463
18464 -mstring
18465 -mno-string
18466 Generate code that uses (does not use) the load string instructions
18467 and the store string word instructions to save multiple registers
18468 and do small block moves. These instructions are generated by
18469 default on POWER systems, and not generated on PowerPC systems. Do
18470 not use -mstring on little-endian PowerPC systems, since those
18471 instructions do not work when the processor is in little-endian
18472 mode. The exceptions are PPC740 and PPC750 which permit these
18473 instructions in little-endian mode.
18474
18475 -mupdate
18476 -mno-update
18477 Generate code that uses (does not use) the load or store
18478 instructions that update the base register to the address of the
18479 calculated memory location. These instructions are generated by
18480 default. If you use -mno-update, there is a small window between
18481 the time that the stack pointer is updated and the address of the
18482 previous frame is stored, which means code that walks the stack
18483 frame across interrupts or signals may get corrupted data.
18484
18485 -mavoid-indexed-addresses
18486 -mno-avoid-indexed-addresses
18487 Generate code that tries to avoid (not avoid) the use of indexed
18488 load or store instructions. These instructions can incur a
18489 performance penalty on Power6 processors in certain situations,
18490 such as when stepping through large arrays that cross a 16M
18491 boundary. This option is enabled by default when targeting Power6
18492 and disabled otherwise.
18493
18494 -mfused-madd
18495 -mno-fused-madd
18496 Generate code that uses (does not use) the floating-point multiply
18497 and accumulate instructions. These instructions are generated by
18498 default if hardware floating point is used. The machine-dependent
18499 -mfused-madd option is now mapped to the machine-independent
18500 -ffp-contract=fast option, and -mno-fused-madd is mapped to
18501 -ffp-contract=off.
18502
18503 -mmulhw
18504 -mno-mulhw
18505 Generate code that uses (does not use) the half-word multiply and
18506 multiply-accumulate instructions on the IBM 405, 440, 464 and 476
18507 processors. These instructions are generated by default when
18508 targeting those processors.
18509
18510 -mdlmzb
18511 -mno-dlmzb
18512 Generate code that uses (does not use) the string-search dlmzb
18513 instruction on the IBM 405, 440, 464 and 476 processors. This
18514 instruction is generated by default when targeting those
18515 processors.
18516
18517 -mno-bit-align
18518 -mbit-align
18519 On System V.4 and embedded PowerPC systems do not (do) force
18520 structures and unions that contain bit-fields to be aligned to the
18521 base type of the bit-field.
18522
18523 For example, by default a structure containing nothing but 8
18524 "unsigned" bit-fields of length 1 is aligned to a 4-byte boundary
18525 and has a size of 4 bytes. By using -mno-bit-align, the structure
18526 is aligned to a 1-byte boundary and is 1 byte in size.
18527
18528 -mno-strict-align
18529 -mstrict-align
18530 On System V.4 and embedded PowerPC systems do not (do) assume that
18531 unaligned memory references are handled by the system.
18532
18533 -mrelocatable
18534 -mno-relocatable
18535 Generate code that allows (does not allow) a static executable to
18536 be relocated to a different address at run time. A simple embedded
18537 PowerPC system loader should relocate the entire contents of
18538 ".got2" and 4-byte locations listed in the ".fixup" section, a
18539 table of 32-bit addresses generated by this option. For this to
18540 work, all objects linked together must be compiled with
18541 -mrelocatable or -mrelocatable-lib. -mrelocatable code aligns the
18542 stack to an 8-byte boundary.
18543
18544 -mrelocatable-lib
18545 -mno-relocatable-lib
18546 Like -mrelocatable, -mrelocatable-lib generates a ".fixup" section
18547 to allow static executables to be relocated at run time, but
18548 -mrelocatable-lib does not use the smaller stack alignment of
18549 -mrelocatable. Objects compiled with -mrelocatable-lib may be
18550 linked with objects compiled with any combination of the
18551 -mrelocatable options.
18552
18553 -mno-toc
18554 -mtoc
18555 On System V.4 and embedded PowerPC systems do not (do) assume that
18556 register 2 contains a pointer to a global area pointing to the
18557 addresses used in the program.
18558
18559 -mlittle
18560 -mlittle-endian
18561 On System V.4 and embedded PowerPC systems compile code for the
18562 processor in little-endian mode. The -mlittle-endian option is the
18563 same as -mlittle.
18564
18565 -mbig
18566 -mbig-endian
18567 On System V.4 and embedded PowerPC systems compile code for the
18568 processor in big-endian mode. The -mbig-endian option is the same
18569 as -mbig.
18570
18571 -mdynamic-no-pic
18572 On Darwin and Mac OS X systems, compile code so that it is not
18573 relocatable, but that its external references are relocatable. The
18574 resulting code is suitable for applications, but not shared
18575 libraries.
18576
18577 -msingle-pic-base
18578 Treat the register used for PIC addressing as read-only, rather
18579 than loading it in the prologue for each function. The runtime
18580 system is responsible for initializing this register with an
18581 appropriate value before execution begins.
18582
18583 -mprioritize-restricted-insns=priority
18584 This option controls the priority that is assigned to dispatch-slot
18585 restricted instructions during the second scheduling pass. The
18586 argument priority takes the value 0, 1, or 2 to assign no, highest,
18587 or second-highest (respectively) priority to dispatch-slot
18588 restricted instructions.
18589
18590 -msched-costly-dep=dependence_type
18591 This option controls which dependences are considered costly by the
18592 target during instruction scheduling. The argument dependence_type
18593 takes one of the following values:
18594
18595 no No dependence is costly.
18596
18597 all All dependences are costly.
18598
18599 true_store_to_load
18600 A true dependence from store to load is costly.
18601
18602 store_to_load
18603 Any dependence from store to load is costly.
18604
18605 number
18606 Any dependence for which the latency is greater than or equal
18607 to number is costly.
18608
18609 -minsert-sched-nops=scheme
18610 This option controls which NOP insertion scheme is used during the
18611 second scheduling pass. The argument scheme takes one of the
18612 following values:
18613
18614 no Don't insert NOPs.
18615
18616 pad Pad with NOPs any dispatch group that has vacant issue slots,
18617 according to the scheduler's grouping.
18618
18619 regroup_exact
18620 Insert NOPs to force costly dependent insns into separate
18621 groups. Insert exactly as many NOPs as needed to force an insn
18622 to a new group, according to the estimated processor grouping.
18623
18624 number
18625 Insert NOPs to force costly dependent insns into separate
18626 groups. Insert number NOPs to force an insn to a new group.
18627
18628 -mcall-sysv
18629 On System V.4 and embedded PowerPC systems compile code using
18630 calling conventions that adhere to the March 1995 draft of the
18631 System V Application Binary Interface, PowerPC processor
18632 supplement. This is the default unless you configured GCC using
18633 powerpc-*-eabiaix.
18634
18635 -mcall-sysv-eabi
18636 -mcall-eabi
18637 Specify both -mcall-sysv and -meabi options.
18638
18639 -mcall-sysv-noeabi
18640 Specify both -mcall-sysv and -mno-eabi options.
18641
18642 -mcall-aixdesc
18643 On System V.4 and embedded PowerPC systems compile code for the AIX
18644 operating system.
18645
18646 -mcall-linux
18647 On System V.4 and embedded PowerPC systems compile code for the
18648 Linux-based GNU system.
18649
18650 -mcall-freebsd
18651 On System V.4 and embedded PowerPC systems compile code for the
18652 FreeBSD operating system.
18653
18654 -mcall-netbsd
18655 On System V.4 and embedded PowerPC systems compile code for the
18656 NetBSD operating system.
18657
18658 -mcall-openbsd
18659 On System V.4 and embedded PowerPC systems compile code for the
18660 OpenBSD operating system.
18661
18662 -maix-struct-return
18663 Return all structures in memory (as specified by the AIX ABI).
18664
18665 -msvr4-struct-return
18666 Return structures smaller than 8 bytes in registers (as specified
18667 by the SVR4 ABI).
18668
18669 -mabi=abi-type
18670 Extend the current ABI with a particular extension, or remove such
18671 extension. Valid values are altivec, no-altivec, spe, no-spe,
18672 ibmlongdouble, ieeelongdouble, elfv1, elfv2.
18673
18674 -mabi=spe
18675 Extend the current ABI with SPE ABI extensions. This does not
18676 change the default ABI, instead it adds the SPE ABI extensions to
18677 the current ABI.
18678
18679 -mabi=no-spe
18680 Disable Book-E SPE ABI extensions for the current ABI.
18681
18682 -mabi=ibmlongdouble
18683 Change the current ABI to use IBM extended-precision long double.
18684 This is a PowerPC 32-bit SYSV ABI option.
18685
18686 -mabi=ieeelongdouble
18687 Change the current ABI to use IEEE extended-precision long double.
18688 This is a PowerPC 32-bit Linux ABI option.
18689
18690 -mabi=elfv1
18691 Change the current ABI to use the ELFv1 ABI. This is the default
18692 ABI for big-endian PowerPC 64-bit Linux. Overriding the default
18693 ABI requires special system support and is likely to fail in
18694 spectacular ways.
18695
18696 -mabi=elfv2
18697 Change the current ABI to use the ELFv2 ABI. This is the default
18698 ABI for little-endian PowerPC 64-bit Linux. Overriding the default
18699 ABI requires special system support and is likely to fail in
18700 spectacular ways.
18701
18702 -mgnu-attribute
18703 -mno-gnu-attribute
18704 Emit .gnu_attribute assembly directives to set tag/value pairs in a
18705 .gnu.attributes section that specify ABI variations in function
18706 parameters or return values.
18707
18708 -mprototype
18709 -mno-prototype
18710 On System V.4 and embedded PowerPC systems assume that all calls to
18711 variable argument functions are properly prototyped. Otherwise,
18712 the compiler must insert an instruction before every non-prototyped
18713 call to set or clear bit 6 of the condition code register ("CR") to
18714 indicate whether floating-point values are passed in the floating-
18715 point registers in case the function takes variable arguments.
18716 With -mprototype, only calls to prototyped variable argument
18717 functions set or clear the bit.
18718
18719 -msim
18720 On embedded PowerPC systems, assume that the startup module is
18721 called sim-crt0.o and that the standard C libraries are libsim.a
18722 and libc.a. This is the default for powerpc-*-eabisim
18723 configurations.
18724
18725 -mmvme
18726 On embedded PowerPC systems, assume that the startup module is
18727 called crt0.o and the standard C libraries are libmvme.a and
18728 libc.a.
18729
18730 -mads
18731 On embedded PowerPC systems, assume that the startup module is
18732 called crt0.o and the standard C libraries are libads.a and libc.a.
18733
18734 -myellowknife
18735 On embedded PowerPC systems, assume that the startup module is
18736 called crt0.o and the standard C libraries are libyk.a and libc.a.
18737
18738 -mvxworks
18739 On System V.4 and embedded PowerPC systems, specify that you are
18740 compiling for a VxWorks system.
18741
18742 -memb
18743 On embedded PowerPC systems, set the "PPC_EMB" bit in the ELF flags
18744 header to indicate that eabi extended relocations are used.
18745
18746 -meabi
18747 -mno-eabi
18748 On System V.4 and embedded PowerPC systems do (do not) adhere to
18749 the Embedded Applications Binary Interface (EABI), which is a set
18750 of modifications to the System V.4 specifications. Selecting
18751 -meabi means that the stack is aligned to an 8-byte boundary, a
18752 function "__eabi" is called from "main" to set up the EABI
18753 environment, and the -msdata option can use both "r2" and "r13" to
18754 point to two separate small data areas. Selecting -mno-eabi means
18755 that the stack is aligned to a 16-byte boundary, no EABI
18756 initialization function is called from "main", and the -msdata
18757 option only uses "r13" to point to a single small data area. The
18758 -meabi option is on by default if you configured GCC using one of
18759 the powerpc*-*-eabi* options.
18760
18761 -msdata=eabi
18762 On System V.4 and embedded PowerPC systems, put small initialized
18763 "const" global and static data in the ".sdata2" section, which is
18764 pointed to by register "r2". Put small initialized non-"const"
18765 global and static data in the ".sdata" section, which is pointed to
18766 by register "r13". Put small uninitialized global and static data
18767 in the ".sbss" section, which is adjacent to the ".sdata" section.
18768 The -msdata=eabi option is incompatible with the -mrelocatable
18769 option. The -msdata=eabi option also sets the -memb option.
18770
18771 -msdata=sysv
18772 On System V.4 and embedded PowerPC systems, put small global and
18773 static data in the ".sdata" section, which is pointed to by
18774 register "r13". Put small uninitialized global and static data in
18775 the ".sbss" section, which is adjacent to the ".sdata" section.
18776 The -msdata=sysv option is incompatible with the -mrelocatable
18777 option.
18778
18779 -msdata=default
18780 -msdata
18781 On System V.4 and embedded PowerPC systems, if -meabi is used,
18782 compile code the same as -msdata=eabi, otherwise compile code the
18783 same as -msdata=sysv.
18784
18785 -msdata=data
18786 On System V.4 and embedded PowerPC systems, put small global data
18787 in the ".sdata" section. Put small uninitialized global data in
18788 the ".sbss" section. Do not use register "r13" to address small
18789 data however. This is the default behavior unless other -msdata
18790 options are used.
18791
18792 -msdata=none
18793 -mno-sdata
18794 On embedded PowerPC systems, put all initialized global and static
18795 data in the ".data" section, and all uninitialized data in the
18796 ".bss" section.
18797
18798 -mreadonly-in-sdata
18799 -mreadonly-in-sdata
18800 Put read-only objects in the ".sdata" section as well. This is the
18801 default.
18802
18803 -mblock-move-inline-limit=num
18804 Inline all block moves (such as calls to "memcpy" or structure
18805 copies) less than or equal to num bytes. The minimum value for num
18806 is 32 bytes on 32-bit targets and 64 bytes on 64-bit targets. The
18807 default value is target-specific.
18808
18809 -G num
18810 On embedded PowerPC systems, put global and static items less than
18811 or equal to num bytes into the small data or BSS sections instead
18812 of the normal data or BSS section. By default, num is 8. The -G
18813 num switch is also passed to the linker. All modules should be
18814 compiled with the same -G num value.
18815
18816 -mregnames
18817 -mno-regnames
18818 On System V.4 and embedded PowerPC systems do (do not) emit
18819 register names in the assembly language output using symbolic
18820 forms.
18821
18822 -mlongcall
18823 -mno-longcall
18824 By default assume that all calls are far away so that a longer and
18825 more expensive calling sequence is required. This is required for
18826 calls farther than 32 megabytes (33,554,432 bytes) from the current
18827 location. A short call is generated if the compiler knows the call
18828 cannot be that far away. This setting can be overridden by the
18829 "shortcall" function attribute, or by "#pragma longcall(0)".
18830
18831 Some linkers are capable of detecting out-of-range calls and
18832 generating glue code on the fly. On these systems, long calls are
18833 unnecessary and generate slower code. As of this writing, the AIX
18834 linker can do this, as can the GNU linker for PowerPC/64. It is
18835 planned to add this feature to the GNU linker for 32-bit PowerPC
18836 systems as well.
18837
18838 On Darwin/PPC systems, "#pragma longcall" generates "jbsr callee,
18839 L42", plus a branch island (glue code). The two target addresses
18840 represent the callee and the branch island. The Darwin/PPC linker
18841 prefers the first address and generates a "bl callee" if the PPC
18842 "bl" instruction reaches the callee directly; otherwise, the linker
18843 generates "bl L42" to call the branch island. The branch island is
18844 appended to the body of the calling function; it computes the full
18845 32-bit address of the callee and jumps to it.
18846
18847 On Mach-O (Darwin) systems, this option directs the compiler emit
18848 to the glue for every direct call, and the Darwin linker decides
18849 whether to use or discard it.
18850
18851 In the future, GCC may ignore all longcall specifications when the
18852 linker is known to generate glue.
18853
18854 -mtls-markers
18855 -mno-tls-markers
18856 Mark (do not mark) calls to "__tls_get_addr" with a relocation
18857 specifying the function argument. The relocation allows the linker
18858 to reliably associate function call with argument setup
18859 instructions for TLS optimization, which in turn allows GCC to
18860 better schedule the sequence.
18861
18862 -mrecip
18863 -mno-recip
18864 This option enables use of the reciprocal estimate and reciprocal
18865 square root estimate instructions with additional Newton-Raphson
18866 steps to increase precision instead of doing a divide or square
18867 root and divide for floating-point arguments. You should use the
18868 -ffast-math option when using -mrecip (or at least
18869 -funsafe-math-optimizations, -ffinite-math-only, -freciprocal-math
18870 and -fno-trapping-math). Note that while the throughput of the
18871 sequence is generally higher than the throughput of the non-
18872 reciprocal instruction, the precision of the sequence can be
18873 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals
18874 0.99999994) for reciprocal square roots.
18875
18876 -mrecip=opt
18877 This option controls which reciprocal estimate instructions may be
18878 used. opt is a comma-separated list of options, which may be
18879 preceded by a "!" to invert the option:
18880
18881 all Enable all estimate instructions.
18882
18883 default
18884 Enable the default instructions, equivalent to -mrecip.
18885
18886 none
18887 Disable all estimate instructions, equivalent to -mno-recip.
18888
18889 div Enable the reciprocal approximation instructions for both
18890 single and double precision.
18891
18892 divf
18893 Enable the single-precision reciprocal approximation
18894 instructions.
18895
18896 divd
18897 Enable the double-precision reciprocal approximation
18898 instructions.
18899
18900 rsqrt
18901 Enable the reciprocal square root approximation instructions
18902 for both single and double precision.
18903
18904 rsqrtf
18905 Enable the single-precision reciprocal square root
18906 approximation instructions.
18907
18908 rsqrtd
18909 Enable the double-precision reciprocal square root
18910 approximation instructions.
18911
18912 So, for example, -mrecip=all,!rsqrtd enables all of the reciprocal
18913 estimate instructions, except for the "FRSQRTE", "XSRSQRTEDP", and
18914 "XVRSQRTEDP" instructions which handle the double-precision
18915 reciprocal square root calculations.
18916
18917 -mrecip-precision
18918 -mno-recip-precision
18919 Assume (do not assume) that the reciprocal estimate instructions
18920 provide higher-precision estimates than is mandated by the PowerPC
18921 ABI. Selecting -mcpu=power6, -mcpu=power7 or -mcpu=power8
18922 automatically selects -mrecip-precision. The double-precision
18923 square root estimate instructions are not generated by default on
18924 low-precision machines, since they do not provide an estimate that
18925 converges after three steps.
18926
18927 -mveclibabi=type
18928 Specifies the ABI type to use for vectorizing intrinsics using an
18929 external library. The only type supported at present is mass,
18930 which specifies to use IBM's Mathematical Acceleration Subsystem
18931 (MASS) libraries for vectorizing intrinsics using external
18932 libraries. GCC currently emits calls to "acosd2", "acosf4",
18933 "acoshd2", "acoshf4", "asind2", "asinf4", "asinhd2", "asinhf4",
18934 "atan2d2", "atan2f4", "atand2", "atanf4", "atanhd2", "atanhf4",
18935 "cbrtd2", "cbrtf4", "cosd2", "cosf4", "coshd2", "coshf4", "erfcd2",
18936 "erfcf4", "erfd2", "erff4", "exp2d2", "exp2f4", "expd2", "expf4",
18937 "expm1d2", "expm1f4", "hypotd2", "hypotf4", "lgammad2", "lgammaf4",
18938 "log10d2", "log10f4", "log1pd2", "log1pf4", "log2d2", "log2f4",
18939 "logd2", "logf4", "powd2", "powf4", "sind2", "sinf4", "sinhd2",
18940 "sinhf4", "sqrtd2", "sqrtf4", "tand2", "tanf4", "tanhd2", and
18941 "tanhf4" when generating code for power7. Both -ftree-vectorize
18942 and -funsafe-math-optimizations must also be enabled. The MASS
18943 libraries must be specified at link time.
18944
18945 -mfriz
18946 -mno-friz
18947 Generate (do not generate) the "friz" instruction when the
18948 -funsafe-math-optimizations option is used to optimize rounding of
18949 floating-point values to 64-bit integer and back to floating point.
18950 The "friz" instruction does not return the same value if the
18951 floating-point number is too large to fit in an integer.
18952
18953 -mpointers-to-nested-functions
18954 -mno-pointers-to-nested-functions
18955 Generate (do not generate) code to load up the static chain
18956 register ("r11") when calling through a pointer on AIX and 64-bit
18957 Linux systems where a function pointer points to a 3-word
18958 descriptor giving the function address, TOC value to be loaded in
18959 register "r2", and static chain value to be loaded in register
18960 "r11". The -mpointers-to-nested-functions is on by default. You
18961 cannot call through pointers to nested functions or pointers to
18962 functions compiled in other languages that use the static chain if
18963 you use -mno-pointers-to-nested-functions.
18964
18965 -msave-toc-indirect
18966 -mno-save-toc-indirect
18967 Generate (do not generate) code to save the TOC value in the
18968 reserved stack location in the function prologue if the function
18969 calls through a pointer on AIX and 64-bit Linux systems. If the
18970 TOC value is not saved in the prologue, it is saved just before the
18971 call through the pointer. The -mno-save-toc-indirect option is the
18972 default.
18973
18974 -mcompat-align-parm
18975 -mno-compat-align-parm
18976 Generate (do not generate) code to pass structure parameters with a
18977 maximum alignment of 64 bits, for compatibility with older versions
18978 of GCC.
18979
18980 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
18981 structure parameter on a 128-bit boundary when that structure
18982 contained a member requiring 128-bit alignment. This is corrected
18983 in more recent versions of GCC. This option may be used to
18984 generate code that is compatible with functions compiled with older
18985 versions of GCC.
18986
18987 The -mno-compat-align-parm option is the default.
18988
18989 -mstack-protector-guard=guard
18990 -mstack-protector-guard-reg=reg
18991 -mstack-protector-guard-offset=offset
18992 Generate stack protection code using canary at guard. Supported
18993 locations are global for global canary or tls for per-thread canary
18994 in the TLS block (the default with GNU libc version 2.4 or later).
18995
18996 With the latter choice the options -mstack-protector-guard-reg=reg
18997 and -mstack-protector-guard-offset=offset furthermore specify which
18998 register to use as base register for reading the canary, and from
18999 what offset from that base register. The default for those is as
19000 specified in the relevant ABI.
19001
19002 RX Options
19003
19004 These command-line options are defined for RX targets:
19005
19006 -m64bit-doubles
19007 -m32bit-doubles
19008 Make the "double" data type be 64 bits (-m64bit-doubles) or 32 bits
19009 (-m32bit-doubles) in size. The default is -m32bit-doubles. Note
19010 RX floating-point hardware only works on 32-bit values, which is
19011 why the default is -m32bit-doubles.
19012
19013 -fpu
19014 -nofpu
19015 Enables (-fpu) or disables (-nofpu) the use of RX floating-point
19016 hardware. The default is enabled for the RX600 series and disabled
19017 for the RX200 series.
19018
19019 Floating-point instructions are only generated for 32-bit floating-
19020 point values, however, so the FPU hardware is not used for doubles
19021 if the -m64bit-doubles option is used.
19022
19023 Note If the -fpu option is enabled then -funsafe-math-optimizations
19024 is also enabled automatically. This is because the RX FPU
19025 instructions are themselves unsafe.
19026
19027 -mcpu=name
19028 Selects the type of RX CPU to be targeted. Currently three types
19029 are supported, the generic RX600 and RX200 series hardware and the
19030 specific RX610 CPU. The default is RX600.
19031
19032 The only difference between RX600 and RX610 is that the RX610 does
19033 not support the "MVTIPL" instruction.
19034
19035 The RX200 series does not have a hardware floating-point unit and
19036 so -nofpu is enabled by default when this type is selected.
19037
19038 -mbig-endian-data
19039 -mlittle-endian-data
19040 Store data (but not code) in the big-endian format. The default is
19041 -mlittle-endian-data, i.e. to store data in the little-endian
19042 format.
19043
19044 -msmall-data-limit=N
19045 Specifies the maximum size in bytes of global and static variables
19046 which can be placed into the small data area. Using the small data
19047 area can lead to smaller and faster code, but the size of area is
19048 limited and it is up to the programmer to ensure that the area does
19049 not overflow. Also when the small data area is used one of the
19050 RX's registers (usually "r13") is reserved for use pointing to this
19051 area, so it is no longer available for use by the compiler. This
19052 could result in slower and/or larger code if variables are pushed
19053 onto the stack instead of being held in this register.
19054
19055 Note, common variables (variables that have not been initialized)
19056 and constants are not placed into the small data area as they are
19057 assigned to other sections in the output executable.
19058
19059 The default value is zero, which disables this feature. Note, this
19060 feature is not enabled by default with higher optimization levels
19061 (-O2 etc) because of the potentially detrimental effects of
19062 reserving a register. It is up to the programmer to experiment and
19063 discover whether this feature is of benefit to their program. See
19064 the description of the -mpid option for a description of how the
19065 actual register to hold the small data area pointer is chosen.
19066
19067 -msim
19068 -mno-sim
19069 Use the simulator runtime. The default is to use the libgloss
19070 board-specific runtime.
19071
19072 -mas100-syntax
19073 -mno-as100-syntax
19074 When generating assembler output use a syntax that is compatible
19075 with Renesas's AS100 assembler. This syntax can also be handled by
19076 the GAS assembler, but it has some restrictions so it is not
19077 generated by default.
19078
19079 -mmax-constant-size=N
19080 Specifies the maximum size, in bytes, of a constant that can be
19081 used as an operand in a RX instruction. Although the RX
19082 instruction set does allow constants of up to 4 bytes in length to
19083 be used in instructions, a longer value equates to a longer
19084 instruction. Thus in some circumstances it can be beneficial to
19085 restrict the size of constants that are used in instructions.
19086 Constants that are too big are instead placed into a constant pool
19087 and referenced via register indirection.
19088
19089 The value N can be between 0 and 4. A value of 0 (the default) or
19090 4 means that constants of any size are allowed.
19091
19092 -mrelax
19093 Enable linker relaxation. Linker relaxation is a process whereby
19094 the linker attempts to reduce the size of a program by finding
19095 shorter versions of various instructions. Disabled by default.
19096
19097 -mint-register=N
19098 Specify the number of registers to reserve for fast interrupt
19099 handler functions. The value N can be between 0 and 4. A value of
19100 1 means that register "r13" is reserved for the exclusive use of
19101 fast interrupt handlers. A value of 2 reserves "r13" and "r12". A
19102 value of 3 reserves "r13", "r12" and "r11", and a value of 4
19103 reserves "r13" through "r10". A value of 0, the default, does not
19104 reserve any registers.
19105
19106 -msave-acc-in-interrupts
19107 Specifies that interrupt handler functions should preserve the
19108 accumulator register. This is only necessary if normal code might
19109 use the accumulator register, for example because it performs
19110 64-bit multiplications. The default is to ignore the accumulator
19111 as this makes the interrupt handlers faster.
19112
19113 -mpid
19114 -mno-pid
19115 Enables the generation of position independent data. When enabled
19116 any access to constant data is done via an offset from a base
19117 address held in a register. This allows the location of constant
19118 data to be determined at run time without requiring the executable
19119 to be relocated, which is a benefit to embedded applications with
19120 tight memory constraints. Data that can be modified is not
19121 affected by this option.
19122
19123 Note, using this feature reserves a register, usually "r13", for
19124 the constant data base address. This can result in slower and/or
19125 larger code, especially in complicated functions.
19126
19127 The actual register chosen to hold the constant data base address
19128 depends upon whether the -msmall-data-limit and/or the
19129 -mint-register command-line options are enabled. Starting with
19130 register "r13" and proceeding downwards, registers are allocated
19131 first to satisfy the requirements of -mint-register, then -mpid and
19132 finally -msmall-data-limit. Thus it is possible for the small data
19133 area register to be "r8" if both -mint-register=4 and -mpid are
19134 specified on the command line.
19135
19136 By default this feature is not enabled. The default can be
19137 restored via the -mno-pid command-line option.
19138
19139 -mno-warn-multiple-fast-interrupts
19140 -mwarn-multiple-fast-interrupts
19141 Prevents GCC from issuing a warning message if it finds more than
19142 one fast interrupt handler when it is compiling a file. The
19143 default is to issue a warning for each extra fast interrupt handler
19144 found, as the RX only supports one such interrupt.
19145
19146 -mallow-string-insns
19147 -mno-allow-string-insns
19148 Enables or disables the use of the string manipulation instructions
19149 "SMOVF", "SCMPU", "SMOVB", "SMOVU", "SUNTIL" "SWHILE" and also the
19150 "RMPA" instruction. These instructions may prefetch data, which is
19151 not safe to do if accessing an I/O register. (See section 12.2.7
19152 of the RX62N Group User's Manual for more information).
19153
19154 The default is to allow these instructions, but it is not possible
19155 for GCC to reliably detect all circumstances where a string
19156 instruction might be used to access an I/O register, so their use
19157 cannot be disabled automatically. Instead it is reliant upon the
19158 programmer to use the -mno-allow-string-insns option if their
19159 program accesses I/O space.
19160
19161 When the instructions are enabled GCC defines the C preprocessor
19162 symbol "__RX_ALLOW_STRING_INSNS__", otherwise it defines the symbol
19163 "__RX_DISALLOW_STRING_INSNS__".
19164
19165 -mjsr
19166 -mno-jsr
19167 Use only (or not only) "JSR" instructions to access functions.
19168 This option can be used when code size exceeds the range of "BSR"
19169 instructions. Note that -mno-jsr does not mean to not use "JSR"
19170 but instead means that any type of branch may be used.
19171
19172 Note: The generic GCC command-line option -ffixed-reg has special
19173 significance to the RX port when used with the "interrupt" function
19174 attribute. This attribute indicates a function intended to process
19175 fast interrupts. GCC ensures that it only uses the registers "r10",
19176 "r11", "r12" and/or "r13" and only provided that the normal use of the
19177 corresponding registers have been restricted via the -ffixed-reg or
19178 -mint-register command-line options.
19179
19180 S/390 and zSeries Options
19181
19182 These are the -m options defined for the S/390 and zSeries
19183 architecture.
19184
19185 -mhard-float
19186 -msoft-float
19187 Use (do not use) the hardware floating-point instructions and
19188 registers for floating-point operations. When -msoft-float is
19189 specified, functions in libgcc.a are used to perform floating-point
19190 operations. When -mhard-float is specified, the compiler generates
19191 IEEE floating-point instructions. This is the default.
19192
19193 -mhard-dfp
19194 -mno-hard-dfp
19195 Use (do not use) the hardware decimal-floating-point instructions
19196 for decimal-floating-point operations. When -mno-hard-dfp is
19197 specified, functions in libgcc.a are used to perform decimal-
19198 floating-point operations. When -mhard-dfp is specified, the
19199 compiler generates decimal-floating-point hardware instructions.
19200 This is the default for -march=z9-ec or higher.
19201
19202 -mlong-double-64
19203 -mlong-double-128
19204 These switches control the size of "long double" type. A size of 64
19205 bits makes the "long double" type equivalent to the "double" type.
19206 This is the default.
19207
19208 -mbackchain
19209 -mno-backchain
19210 Store (do not store) the address of the caller's frame as backchain
19211 pointer into the callee's stack frame. A backchain may be needed
19212 to allow debugging using tools that do not understand DWARF call
19213 frame information. When -mno-packed-stack is in effect, the
19214 backchain pointer is stored at the bottom of the stack frame; when
19215 -mpacked-stack is in effect, the backchain is placed into the
19216 topmost word of the 96/160 byte register save area.
19217
19218 In general, code compiled with -mbackchain is call-compatible with
19219 code compiled with -mmo-backchain; however, use of the backchain
19220 for debugging purposes usually requires that the whole binary is
19221 built with -mbackchain. Note that the combination of -mbackchain,
19222 -mpacked-stack and -mhard-float is not supported. In order to
19223 build a linux kernel use -msoft-float.
19224
19225 The default is to not maintain the backchain.
19226
19227 -mpacked-stack
19228 -mno-packed-stack
19229 Use (do not use) the packed stack layout. When -mno-packed-stack
19230 is specified, the compiler uses the all fields of the 96/160 byte
19231 register save area only for their default purpose; unused fields
19232 still take up stack space. When -mpacked-stack is specified,
19233 register save slots are densely packed at the top of the register
19234 save area; unused space is reused for other purposes, allowing for
19235 more efficient use of the available stack space. However, when
19236 -mbackchain is also in effect, the topmost word of the save area is
19237 always used to store the backchain, and the return address register
19238 is always saved two words below the backchain.
19239
19240 As long as the stack frame backchain is not used, code generated
19241 with -mpacked-stack is call-compatible with code generated with
19242 -mno-packed-stack. Note that some non-FSF releases of GCC 2.95 for
19243 S/390 or zSeries generated code that uses the stack frame backchain
19244 at run time, not just for debugging purposes. Such code is not
19245 call-compatible with code compiled with -mpacked-stack. Also, note
19246 that the combination of -mbackchain, -mpacked-stack and
19247 -mhard-float is not supported. In order to build a linux kernel
19248 use -msoft-float.
19249
19250 The default is to not use the packed stack layout.
19251
19252 -msmall-exec
19253 -mno-small-exec
19254 Generate (or do not generate) code using the "bras" instruction to
19255 do subroutine calls. This only works reliably if the total
19256 executable size does not exceed 64k. The default is to use the
19257 "basr" instruction instead, which does not have this limitation.
19258
19259 -m64
19260 -m31
19261 When -m31 is specified, generate code compliant to the GNU/Linux
19262 for S/390 ABI. When -m64 is specified, generate code compliant to
19263 the GNU/Linux for zSeries ABI. This allows GCC in particular to
19264 generate 64-bit instructions. For the s390 targets, the default is
19265 -m31, while the s390x targets default to -m64.
19266
19267 -mzarch
19268 -mesa
19269 When -mzarch is specified, generate code using the instructions
19270 available on z/Architecture. When -mesa is specified, generate
19271 code using the instructions available on ESA/390. Note that -mesa
19272 is not possible with -m64. When generating code compliant to the
19273 GNU/Linux for S/390 ABI, the default is -mesa. When generating
19274 code compliant to the GNU/Linux for zSeries ABI, the default is
19275 -mzarch.
19276
19277 -mhtm
19278 -mno-htm
19279 The -mhtm option enables a set of builtins making use of
19280 instructions available with the transactional execution facility
19281 introduced with the IBM zEnterprise EC12 machine generation S/390
19282 System z Built-in Functions. -mhtm is enabled by default when
19283 using -march=zEC12.
19284
19285 -mvx
19286 -mno-vx
19287 When -mvx is specified, generate code using the instructions
19288 available with the vector extension facility introduced with the
19289 IBM z13 machine generation. This option changes the ABI for some
19290 vector type values with regard to alignment and calling
19291 conventions. In case vector type values are being used in an ABI-
19292 relevant context a GAS .gnu_attribute command will be added to mark
19293 the resulting binary with the ABI used. -mvx is enabled by default
19294 when using -march=z13.
19295
19296 -mzvector
19297 -mno-zvector
19298 The -mzvector option enables vector language extensions and
19299 builtins using instructions available with the vector extension
19300 facility introduced with the IBM z13 machine generation. This
19301 option adds support for vector to be used as a keyword to define
19302 vector type variables and arguments. vector is only available when
19303 GNU extensions are enabled. It will not be expanded when
19304 requesting strict standard compliance e.g. with -std=c99. In
19305 addition to the GCC low-level builtins -mzvector enables a set of
19306 builtins added for compatibility with AltiVec-style implementations
19307 like Power and Cell. In order to make use of these builtins the
19308 header file vecintrin.h needs to be included. -mzvector is
19309 disabled by default.
19310
19311 -mmvcle
19312 -mno-mvcle
19313 Generate (or do not generate) code using the "mvcle" instruction to
19314 perform block moves. When -mno-mvcle is specified, use a "mvc"
19315 loop instead. This is the default unless optimizing for size.
19316
19317 -mdebug
19318 -mno-debug
19319 Print (or do not print) additional debug information when
19320 compiling. The default is to not print debug information.
19321
19322 -march=cpu-type
19323 Generate code that runs on cpu-type, which is the name of a system
19324 representing a certain processor type. Possible values for cpu-
19325 type are z900/arch5, z990/arch6, z9-109, z9-ec/arch7, z10/arch8,
19326 z196/arch9, zEC12, z13/arch11, z14/arch12, and native.
19327
19328 The default is -march=z900. g5/arch3 and g6 are deprecated and
19329 will be removed with future releases.
19330
19331 Specifying native as cpu type can be used to select the best
19332 architecture option for the host processor. -march=native has no
19333 effect if GCC does not recognize the processor.
19334
19335 -mtune=cpu-type
19336 Tune to cpu-type everything applicable about the generated code,
19337 except for the ABI and the set of available instructions. The list
19338 of cpu-type values is the same as for -march. The default is the
19339 value used for -march.
19340
19341 -mtpf-trace
19342 -mno-tpf-trace
19343 Generate code that adds (does not add) in TPF OS specific branches
19344 to trace routines in the operating system. This option is off by
19345 default, even when compiling for the TPF OS.
19346
19347 -mfused-madd
19348 -mno-fused-madd
19349 Generate code that uses (does not use) the floating-point multiply
19350 and accumulate instructions. These instructions are generated by
19351 default if hardware floating point is used.
19352
19353 -mwarn-framesize=framesize
19354 Emit a warning if the current function exceeds the given frame
19355 size. Because this is a compile-time check it doesn't need to be a
19356 real problem when the program runs. It is intended to identify
19357 functions that most probably cause a stack overflow. It is useful
19358 to be used in an environment with limited stack size e.g. the linux
19359 kernel.
19360
19361 -mwarn-dynamicstack
19362 Emit a warning if the function calls "alloca" or uses dynamically-
19363 sized arrays. This is generally a bad idea with a limited stack
19364 size.
19365
19366 -mstack-guard=stack-guard
19367 -mstack-size=stack-size
19368 If these options are provided the S/390 back end emits additional
19369 instructions in the function prologue that trigger a trap if the
19370 stack size is stack-guard bytes above the stack-size (remember that
19371 the stack on S/390 grows downward). If the stack-guard option is
19372 omitted the smallest power of 2 larger than the frame size of the
19373 compiled function is chosen. These options are intended to be used
19374 to help debugging stack overflow problems. The additionally
19375 emitted code causes only little overhead and hence can also be used
19376 in production-like systems without greater performance degradation.
19377 The given values have to be exact powers of 2 and stack-size has to
19378 be greater than stack-guard without exceeding 64k. In order to be
19379 efficient the extra code makes the assumption that the stack starts
19380 at an address aligned to the value given by stack-size. The stack-
19381 guard option can only be used in conjunction with stack-size.
19382
19383 -mhotpatch=pre-halfwords,post-halfwords
19384 If the hotpatch option is enabled, a "hot-patching" function
19385 prologue is generated for all functions in the compilation unit.
19386 The funtion label is prepended with the given number of two-byte
19387 NOP instructions (pre-halfwords, maximum 1000000). After the
19388 label, 2 * post-halfwords bytes are appended, using the largest NOP
19389 like instructions the architecture allows (maximum 1000000).
19390
19391 If both arguments are zero, hotpatching is disabled.
19392
19393 This option can be overridden for individual functions with the
19394 "hotpatch" attribute.
19395
19396 Score Options
19397
19398 These options are defined for Score implementations:
19399
19400 -meb
19401 Compile code for big-endian mode. This is the default.
19402
19403 -mel
19404 Compile code for little-endian mode.
19405
19406 -mnhwloop
19407 Disable generation of "bcnz" instructions.
19408
19409 -muls
19410 Enable generation of unaligned load and store instructions.
19411
19412 -mmac
19413 Enable the use of multiply-accumulate instructions. Disabled by
19414 default.
19415
19416 -mscore5
19417 Specify the SCORE5 as the target architecture.
19418
19419 -mscore5u
19420 Specify the SCORE5U of the target architecture.
19421
19422 -mscore7
19423 Specify the SCORE7 as the target architecture. This is the default.
19424
19425 -mscore7d
19426 Specify the SCORE7D as the target architecture.
19427
19428 SH Options
19429
19430 These -m options are defined for the SH implementations:
19431
19432 -m1 Generate code for the SH1.
19433
19434 -m2 Generate code for the SH2.
19435
19436 -m2e
19437 Generate code for the SH2e.
19438
19439 -m2a-nofpu
19440 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a
19441 way that the floating-point unit is not used.
19442
19443 -m2a-single-only
19444 Generate code for the SH2a-FPU, in such a way that no double-
19445 precision floating-point operations are used.
19446
19447 -m2a-single
19448 Generate code for the SH2a-FPU assuming the floating-point unit is
19449 in single-precision mode by default.
19450
19451 -m2a
19452 Generate code for the SH2a-FPU assuming the floating-point unit is
19453 in double-precision mode by default.
19454
19455 -m3 Generate code for the SH3.
19456
19457 -m3e
19458 Generate code for the SH3e.
19459
19460 -m4-nofpu
19461 Generate code for the SH4 without a floating-point unit.
19462
19463 -m4-single-only
19464 Generate code for the SH4 with a floating-point unit that only
19465 supports single-precision arithmetic.
19466
19467 -m4-single
19468 Generate code for the SH4 assuming the floating-point unit is in
19469 single-precision mode by default.
19470
19471 -m4 Generate code for the SH4.
19472
19473 -m4-100
19474 Generate code for SH4-100.
19475
19476 -m4-100-nofpu
19477 Generate code for SH4-100 in such a way that the floating-point
19478 unit is not used.
19479
19480 -m4-100-single
19481 Generate code for SH4-100 assuming the floating-point unit is in
19482 single-precision mode by default.
19483
19484 -m4-100-single-only
19485 Generate code for SH4-100 in such a way that no double-precision
19486 floating-point operations are used.
19487
19488 -m4-200
19489 Generate code for SH4-200.
19490
19491 -m4-200-nofpu
19492 Generate code for SH4-200 without in such a way that the floating-
19493 point unit is not used.
19494
19495 -m4-200-single
19496 Generate code for SH4-200 assuming the floating-point unit is in
19497 single-precision mode by default.
19498
19499 -m4-200-single-only
19500 Generate code for SH4-200 in such a way that no double-precision
19501 floating-point operations are used.
19502
19503 -m4-300
19504 Generate code for SH4-300.
19505
19506 -m4-300-nofpu
19507 Generate code for SH4-300 without in such a way that the floating-
19508 point unit is not used.
19509
19510 -m4-300-single
19511 Generate code for SH4-300 in such a way that no double-precision
19512 floating-point operations are used.
19513
19514 -m4-300-single-only
19515 Generate code for SH4-300 in such a way that no double-precision
19516 floating-point operations are used.
19517
19518 -m4-340
19519 Generate code for SH4-340 (no MMU, no FPU).
19520
19521 -m4-500
19522 Generate code for SH4-500 (no FPU). Passes -isa=sh4-nofpu to the
19523 assembler.
19524
19525 -m4a-nofpu
19526 Generate code for the SH4al-dsp, or for a SH4a in such a way that
19527 the floating-point unit is not used.
19528
19529 -m4a-single-only
19530 Generate code for the SH4a, in such a way that no double-precision
19531 floating-point operations are used.
19532
19533 -m4a-single
19534 Generate code for the SH4a assuming the floating-point unit is in
19535 single-precision mode by default.
19536
19537 -m4a
19538 Generate code for the SH4a.
19539
19540 -m4al
19541 Same as -m4a-nofpu, except that it implicitly passes -dsp to the
19542 assembler. GCC doesn't generate any DSP instructions at the
19543 moment.
19544
19545 -mb Compile code for the processor in big-endian mode.
19546
19547 -ml Compile code for the processor in little-endian mode.
19548
19549 -mdalign
19550 Align doubles at 64-bit boundaries. Note that this changes the
19551 calling conventions, and thus some functions from the standard C
19552 library do not work unless you recompile it first with -mdalign.
19553
19554 -mrelax
19555 Shorten some address references at link time, when possible; uses
19556 the linker option -relax.
19557
19558 -mbigtable
19559 Use 32-bit offsets in "switch" tables. The default is to use
19560 16-bit offsets.
19561
19562 -mbitops
19563 Enable the use of bit manipulation instructions on SH2A.
19564
19565 -mfmovd
19566 Enable the use of the instruction "fmovd". Check -mdalign for
19567 alignment constraints.
19568
19569 -mrenesas
19570 Comply with the calling conventions defined by Renesas.
19571
19572 -mno-renesas
19573 Comply with the calling conventions defined for GCC before the
19574 Renesas conventions were available. This option is the default for
19575 all targets of the SH toolchain.
19576
19577 -mnomacsave
19578 Mark the "MAC" register as call-clobbered, even if -mrenesas is
19579 given.
19580
19581 -mieee
19582 -mno-ieee
19583 Control the IEEE compliance of floating-point comparisons, which
19584 affects the handling of cases where the result of a comparison is
19585 unordered. By default -mieee is implicitly enabled. If
19586 -ffinite-math-only is enabled -mno-ieee is implicitly set, which
19587 results in faster floating-point greater-equal and less-equal
19588 comparisons. The implicit settings can be overridden by specifying
19589 either -mieee or -mno-ieee.
19590
19591 -minline-ic_invalidate
19592 Inline code to invalidate instruction cache entries after setting
19593 up nested function trampolines. This option has no effect if
19594 -musermode is in effect and the selected code generation option
19595 (e.g. -m4) does not allow the use of the "icbi" instruction. If
19596 the selected code generation option does not allow the use of the
19597 "icbi" instruction, and -musermode is not in effect, the inlined
19598 code manipulates the instruction cache address array directly with
19599 an associative write. This not only requires privileged mode at
19600 run time, but it also fails if the cache line had been mapped via
19601 the TLB and has become unmapped.
19602
19603 -misize
19604 Dump instruction size and location in the assembly code.
19605
19606 -mpadstruct
19607 This option is deprecated. It pads structures to multiple of 4
19608 bytes, which is incompatible with the SH ABI.
19609
19610 -matomic-model=model
19611 Sets the model of atomic operations and additional parameters as a
19612 comma separated list. For details on the atomic built-in functions
19613 see __atomic Builtins. The following models and parameters are
19614 supported:
19615
19616 none
19617 Disable compiler generated atomic sequences and emit library
19618 calls for atomic operations. This is the default if the target
19619 is not "sh*-*-linux*".
19620
19621 soft-gusa
19622 Generate GNU/Linux compatible gUSA software atomic sequences
19623 for the atomic built-in functions. The generated atomic
19624 sequences require additional support from the
19625 interrupt/exception handling code of the system and are only
19626 suitable for SH3* and SH4* single-core systems. This option is
19627 enabled by default when the target is "sh*-*-linux*" and SH3*
19628 or SH4*. When the target is SH4A, this option also partially
19629 utilizes the hardware atomic instructions "movli.l" and
19630 "movco.l" to create more efficient code, unless strict is
19631 specified.
19632
19633 soft-tcb
19634 Generate software atomic sequences that use a variable in the
19635 thread control block. This is a variation of the gUSA
19636 sequences which can also be used on SH1* and SH2* targets. The
19637 generated atomic sequences require additional support from the
19638 interrupt/exception handling code of the system and are only
19639 suitable for single-core systems. When using this model, the
19640 gbr-offset= parameter has to be specified as well.
19641
19642 soft-imask
19643 Generate software atomic sequences that temporarily disable
19644 interrupts by setting "SR.IMASK = 1111". This model works only
19645 when the program runs in privileged mode and is only suitable
19646 for single-core systems. Additional support from the
19647 interrupt/exception handling code of the system is not
19648 required. This model is enabled by default when the target is
19649 "sh*-*-linux*" and SH1* or SH2*.
19650
19651 hard-llcs
19652 Generate hardware atomic sequences using the "movli.l" and
19653 "movco.l" instructions only. This is only available on SH4A
19654 and is suitable for multi-core systems. Since the hardware
19655 instructions support only 32 bit atomic variables access to 8
19656 or 16 bit variables is emulated with 32 bit accesses. Code
19657 compiled with this option is also compatible with other
19658 software atomic model interrupt/exception handling systems if
19659 executed on an SH4A system. Additional support from the
19660 interrupt/exception handling code of the system is not required
19661 for this model.
19662
19663 gbr-offset=
19664 This parameter specifies the offset in bytes of the variable in
19665 the thread control block structure that should be used by the
19666 generated atomic sequences when the soft-tcb model has been
19667 selected. For other models this parameter is ignored. The
19668 specified value must be an integer multiple of four and in the
19669 range 0-1020.
19670
19671 strict
19672 This parameter prevents mixed usage of multiple atomic models,
19673 even if they are compatible, and makes the compiler generate
19674 atomic sequences of the specified model only.
19675
19676 -mtas
19677 Generate the "tas.b" opcode for "__atomic_test_and_set". Notice
19678 that depending on the particular hardware and software
19679 configuration this can degrade overall performance due to the
19680 operand cache line flushes that are implied by the "tas.b"
19681 instruction. On multi-core SH4A processors the "tas.b" instruction
19682 must be used with caution since it can result in data corruption
19683 for certain cache configurations.
19684
19685 -mprefergot
19686 When generating position-independent code, emit function calls
19687 using the Global Offset Table instead of the Procedure Linkage
19688 Table.
19689
19690 -musermode
19691 -mno-usermode
19692 Don't allow (allow) the compiler generating privileged mode code.
19693 Specifying -musermode also implies -mno-inline-ic_invalidate if the
19694 inlined code would not work in user mode. -musermode is the
19695 default when the target is "sh*-*-linux*". If the target is SH1*
19696 or SH2* -musermode has no effect, since there is no user mode.
19697
19698 -multcost=number
19699 Set the cost to assume for a multiply insn.
19700
19701 -mdiv=strategy
19702 Set the division strategy to be used for integer division
19703 operations. strategy can be one of:
19704
19705 call-div1
19706 Calls a library function that uses the single-step division
19707 instruction "div1" to perform the operation. Division by zero
19708 calculates an unspecified result and does not trap. This is
19709 the default except for SH4, SH2A and SHcompact.
19710
19711 call-fp
19712 Calls a library function that performs the operation in double
19713 precision floating point. Division by zero causes a floating-
19714 point exception. This is the default for SHcompact with FPU.
19715 Specifying this for targets that do not have a double precision
19716 FPU defaults to "call-div1".
19717
19718 call-table
19719 Calls a library function that uses a lookup table for small
19720 divisors and the "div1" instruction with case distinction for
19721 larger divisors. Division by zero calculates an unspecified
19722 result and does not trap. This is the default for SH4.
19723 Specifying this for targets that do not have dynamic shift
19724 instructions defaults to "call-div1".
19725
19726 When a division strategy has not been specified the default
19727 strategy is selected based on the current target. For SH2A the
19728 default strategy is to use the "divs" and "divu" instructions
19729 instead of library function calls.
19730
19731 -maccumulate-outgoing-args
19732 Reserve space once for outgoing arguments in the function prologue
19733 rather than around each call. Generally beneficial for performance
19734 and size. Also needed for unwinding to avoid changing the stack
19735 frame around conditional code.
19736
19737 -mdivsi3_libfunc=name
19738 Set the name of the library function used for 32-bit signed
19739 division to name. This only affects the name used in the call
19740 division strategies, and the compiler still expects the same sets
19741 of input/output/clobbered registers as if this option were not
19742 present.
19743
19744 -mfixed-range=register-range
19745 Generate code treating the given register range as fixed registers.
19746 A fixed register is one that the register allocator can not use.
19747 This is useful when compiling kernel code. A register range is
19748 specified as two registers separated by a dash. Multiple register
19749 ranges can be specified separated by a comma.
19750
19751 -mbranch-cost=num
19752 Assume num to be the cost for a branch instruction. Higher numbers
19753 make the compiler try to generate more branch-free code if
19754 possible. If not specified the value is selected depending on the
19755 processor type that is being compiled for.
19756
19757 -mzdcbranch
19758 -mno-zdcbranch
19759 Assume (do not assume) that zero displacement conditional branch
19760 instructions "bt" and "bf" are fast. If -mzdcbranch is specified,
19761 the compiler prefers zero displacement branch code sequences. This
19762 is enabled by default when generating code for SH4 and SH4A. It
19763 can be explicitly disabled by specifying -mno-zdcbranch.
19764
19765 -mcbranch-force-delay-slot
19766 Force the usage of delay slots for conditional branches, which
19767 stuffs the delay slot with a "nop" if a suitable instruction cannot
19768 be found. By default this option is disabled. It can be enabled
19769 to work around hardware bugs as found in the original SH7055.
19770
19771 -mfused-madd
19772 -mno-fused-madd
19773 Generate code that uses (does not use) the floating-point multiply
19774 and accumulate instructions. These instructions are generated by
19775 default if hardware floating point is used. The machine-dependent
19776 -mfused-madd option is now mapped to the machine-independent
19777 -ffp-contract=fast option, and -mno-fused-madd is mapped to
19778 -ffp-contract=off.
19779
19780 -mfsca
19781 -mno-fsca
19782 Allow or disallow the compiler to emit the "fsca" instruction for
19783 sine and cosine approximations. The option -mfsca must be used in
19784 combination with -funsafe-math-optimizations. It is enabled by
19785 default when generating code for SH4A. Using -mno-fsca disables
19786 sine and cosine approximations even if -funsafe-math-optimizations
19787 is in effect.
19788
19789 -mfsrra
19790 -mno-fsrra
19791 Allow or disallow the compiler to emit the "fsrra" instruction for
19792 reciprocal square root approximations. The option -mfsrra must be
19793 used in combination with -funsafe-math-optimizations and
19794 -ffinite-math-only. It is enabled by default when generating code
19795 for SH4A. Using -mno-fsrra disables reciprocal square root
19796 approximations even if -funsafe-math-optimizations and
19797 -ffinite-math-only are in effect.
19798
19799 -mpretend-cmove
19800 Prefer zero-displacement conditional branches for conditional move
19801 instruction patterns. This can result in faster code on the SH4
19802 processor.
19803
19804 -mfdpic
19805 Generate code using the FDPIC ABI.
19806
19807 Solaris 2 Options
19808
19809 These -m options are supported on Solaris 2:
19810
19811 -mclear-hwcap
19812 -mclear-hwcap tells the compiler to remove the hardware
19813 capabilities generated by the Solaris assembler. This is only
19814 necessary when object files use ISA extensions not supported by the
19815 current machine, but check at runtime whether or not to use them.
19816
19817 -mimpure-text
19818 -mimpure-text, used in addition to -shared, tells the compiler to
19819 not pass -z text to the linker when linking a shared object. Using
19820 this option, you can link position-dependent code into a shared
19821 object.
19822
19823 -mimpure-text suppresses the "relocations remain against
19824 allocatable but non-writable sections" linker error message.
19825 However, the necessary relocations trigger copy-on-write, and the
19826 shared object is not actually shared across processes. Instead of
19827 using -mimpure-text, you should compile all source code with -fpic
19828 or -fPIC.
19829
19830 These switches are supported in addition to the above on Solaris 2:
19831
19832 -pthreads
19833 This is a synonym for -pthread.
19834
19835 SPARC Options
19836
19837 These -m options are supported on the SPARC:
19838
19839 -mno-app-regs
19840 -mapp-regs
19841 Specify -mapp-regs to generate output using the global registers 2
19842 through 4, which the SPARC SVR4 ABI reserves for applications.
19843 Like the global register 1, each global register 2 through 4 is
19844 then treated as an allocable register that is clobbered by function
19845 calls. This is the default.
19846
19847 To be fully SVR4 ABI-compliant at the cost of some performance
19848 loss, specify -mno-app-regs. You should compile libraries and
19849 system software with this option.
19850
19851 -mflat
19852 -mno-flat
19853 With -mflat, the compiler does not generate save/restore
19854 instructions and uses a "flat" or single register window model.
19855 This model is compatible with the regular register window model.
19856 The local registers and the input registers (0--5) are still
19857 treated as "call-saved" registers and are saved on the stack as
19858 needed.
19859
19860 With -mno-flat (the default), the compiler generates save/restore
19861 instructions (except for leaf functions). This is the normal
19862 operating mode.
19863
19864 -mfpu
19865 -mhard-float
19866 Generate output containing floating-point instructions. This is
19867 the default.
19868
19869 -mno-fpu
19870 -msoft-float
19871 Generate output containing library calls for floating point.
19872 Warning: the requisite libraries are not available for all SPARC
19873 targets. Normally the facilities of the machine's usual C compiler
19874 are used, but this cannot be done directly in cross-compilation.
19875 You must make your own arrangements to provide suitable library
19876 functions for cross-compilation. The embedded targets sparc-*-aout
19877 and sparclite-*-* do provide software floating-point support.
19878
19879 -msoft-float changes the calling convention in the output file;
19880 therefore, it is only useful if you compile all of a program with
19881 this option. In particular, you need to compile libgcc.a, the
19882 library that comes with GCC, with -msoft-float in order for this to
19883 work.
19884
19885 -mhard-quad-float
19886 Generate output containing quad-word (long double) floating-point
19887 instructions.
19888
19889 -msoft-quad-float
19890 Generate output containing library calls for quad-word (long
19891 double) floating-point instructions. The functions called are
19892 those specified in the SPARC ABI. This is the default.
19893
19894 As of this writing, there are no SPARC implementations that have
19895 hardware support for the quad-word floating-point instructions.
19896 They all invoke a trap handler for one of these instructions, and
19897 then the trap handler emulates the effect of the instruction.
19898 Because of the trap handler overhead, this is much slower than
19899 calling the ABI library routines. Thus the -msoft-quad-float
19900 option is the default.
19901
19902 -mno-unaligned-doubles
19903 -munaligned-doubles
19904 Assume that doubles have 8-byte alignment. This is the default.
19905
19906 With -munaligned-doubles, GCC assumes that doubles have 8-byte
19907 alignment only if they are contained in another type, or if they
19908 have an absolute address. Otherwise, it assumes they have 4-byte
19909 alignment. Specifying this option avoids some rare compatibility
19910 problems with code generated by other compilers. It is not the
19911 default because it results in a performance loss, especially for
19912 floating-point code.
19913
19914 -muser-mode
19915 -mno-user-mode
19916 Do not generate code that can only run in supervisor mode. This is
19917 relevant only for the "casa" instruction emitted for the LEON3
19918 processor. This is the default.
19919
19920 -mfaster-structs
19921 -mno-faster-structs
19922 With -mfaster-structs, the compiler assumes that structures should
19923 have 8-byte alignment. This enables the use of pairs of "ldd" and
19924 "std" instructions for copies in structure assignment, in place of
19925 twice as many "ld" and "st" pairs. However, the use of this
19926 changed alignment directly violates the SPARC ABI. Thus, it's
19927 intended only for use on targets where the developer acknowledges
19928 that their resulting code is not directly in line with the rules of
19929 the ABI.
19930
19931 -mstd-struct-return
19932 -mno-std-struct-return
19933 With -mstd-struct-return, the compiler generates checking code in
19934 functions returning structures or unions to detect size mismatches
19935 between the two sides of function calls, as per the 32-bit ABI.
19936
19937 The default is -mno-std-struct-return. This option has no effect
19938 in 64-bit mode.
19939
19940 -mlra
19941 -mno-lra
19942 Enable Local Register Allocation. This is the default for SPARC
19943 since GCC 7 so -mno-lra needs to be passed to get old Reload.
19944
19945 -mcpu=cpu_type
19946 Set the instruction set, register set, and instruction scheduling
19947 parameters for machine type cpu_type. Supported values for
19948 cpu_type are v7, cypress, v8, supersparc, hypersparc, leon, leon3,
19949 leon3v7, sparclite, f930, f934, sparclite86x, sparclet, tsc701, v9,
19950 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4,
19951 niagara7 and m8.
19952
19953 Native Solaris and GNU/Linux toolchains also support the value
19954 native, which selects the best architecture option for the host
19955 processor. -mcpu=native has no effect if GCC does not recognize
19956 the processor.
19957
19958 Default instruction scheduling parameters are used for values that
19959 select an architecture and not an implementation. These are v7,
19960 v8, sparclite, sparclet, v9.
19961
19962 Here is a list of each supported architecture and their supported
19963 implementations.
19964
19965 v7 cypress, leon3v7
19966
19967 v8 supersparc, hypersparc, leon, leon3
19968
19969 sparclite
19970 f930, f934, sparclite86x
19971
19972 sparclet
19973 tsc701
19974
19975 v9 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4,
19976 niagara7, m8
19977
19978 By default (unless configured otherwise), GCC generates code for
19979 the V7 variant of the SPARC architecture. With -mcpu=cypress, the
19980 compiler additionally optimizes it for the Cypress CY7C602 chip, as
19981 used in the SPARCStation/SPARCServer 3xx series. This is also
19982 appropriate for the older SPARCStation 1, 2, IPX etc.
19983
19984 With -mcpu=v8, GCC generates code for the V8 variant of the SPARC
19985 architecture. The only difference from V7 code is that the
19986 compiler emits the integer multiply and integer divide instructions
19987 which exist in SPARC-V8 but not in SPARC-V7. With
19988 -mcpu=supersparc, the compiler additionally optimizes it for the
19989 SuperSPARC chip, as used in the SPARCStation 10, 1000 and 2000
19990 series.
19991
19992 With -mcpu=sparclite, GCC generates code for the SPARClite variant
19993 of the SPARC architecture. This adds the integer multiply, integer
19994 divide step and scan ("ffs") instructions which exist in SPARClite
19995 but not in SPARC-V7. With -mcpu=f930, the compiler additionally
19996 optimizes it for the Fujitsu MB86930 chip, which is the original
19997 SPARClite, with no FPU. With -mcpu=f934, the compiler additionally
19998 optimizes it for the Fujitsu MB86934 chip, which is the more recent
19999 SPARClite with FPU.
20000
20001 With -mcpu=sparclet, GCC generates code for the SPARClet variant of
20002 the SPARC architecture. This adds the integer multiply,
20003 multiply/accumulate, integer divide step and scan ("ffs")
20004 instructions which exist in SPARClet but not in SPARC-V7. With
20005 -mcpu=tsc701, the compiler additionally optimizes it for the TEMIC
20006 SPARClet chip.
20007
20008 With -mcpu=v9, GCC generates code for the V9 variant of the SPARC
20009 architecture. This adds 64-bit integer and floating-point move
20010 instructions, 3 additional floating-point condition code registers
20011 and conditional move instructions. With -mcpu=ultrasparc, the
20012 compiler additionally optimizes it for the Sun UltraSPARC I/II/IIi
20013 chips. With -mcpu=ultrasparc3, the compiler additionally optimizes
20014 it for the Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips. With
20015 -mcpu=niagara, the compiler additionally optimizes it for Sun
20016 UltraSPARC T1 chips. With -mcpu=niagara2, the compiler
20017 additionally optimizes it for Sun UltraSPARC T2 chips. With
20018 -mcpu=niagara3, the compiler additionally optimizes it for Sun
20019 UltraSPARC T3 chips. With -mcpu=niagara4, the compiler
20020 additionally optimizes it for Sun UltraSPARC T4 chips. With
20021 -mcpu=niagara7, the compiler additionally optimizes it for Oracle
20022 SPARC M7 chips. With -mcpu=m8, the compiler additionally optimizes
20023 it for Oracle M8 chips.
20024
20025 -mtune=cpu_type
20026 Set the instruction scheduling parameters for machine type
20027 cpu_type, but do not set the instruction set or register set that
20028 the option -mcpu=cpu_type does.
20029
20030 The same values for -mcpu=cpu_type can be used for -mtune=cpu_type,
20031 but the only useful values are those that select a particular CPU
20032 implementation. Those are cypress, supersparc, hypersparc, leon,
20033 leon3, leon3v7, f930, f934, sparclite86x, tsc701, ultrasparc,
20034 ultrasparc3, niagara, niagara2, niagara3, niagara4, niagara7 and
20035 m8. With native Solaris and GNU/Linux toolchains, native can also
20036 be used.
20037
20038 -mv8plus
20039 -mno-v8plus
20040 With -mv8plus, GCC generates code for the SPARC-V8+ ABI. The
20041 difference from the V8 ABI is that the global and out registers are
20042 considered 64 bits wide. This is enabled by default on Solaris in
20043 32-bit mode for all SPARC-V9 processors.
20044
20045 -mvis
20046 -mno-vis
20047 With -mvis, GCC generates code that takes advantage of the
20048 UltraSPARC Visual Instruction Set extensions. The default is
20049 -mno-vis.
20050
20051 -mvis2
20052 -mno-vis2
20053 With -mvis2, GCC generates code that takes advantage of version 2.0
20054 of the UltraSPARC Visual Instruction Set extensions. The default
20055 is -mvis2 when targeting a cpu that supports such instructions,
20056 such as UltraSPARC-III and later. Setting -mvis2 also sets -mvis.
20057
20058 -mvis3
20059 -mno-vis3
20060 With -mvis3, GCC generates code that takes advantage of version 3.0
20061 of the UltraSPARC Visual Instruction Set extensions. The default
20062 is -mvis3 when targeting a cpu that supports such instructions,
20063 such as niagara-3 and later. Setting -mvis3 also sets -mvis2 and
20064 -mvis.
20065
20066 -mvis4
20067 -mno-vis4
20068 With -mvis4, GCC generates code that takes advantage of version 4.0
20069 of the UltraSPARC Visual Instruction Set extensions. The default
20070 is -mvis4 when targeting a cpu that supports such instructions,
20071 such as niagara-7 and later. Setting -mvis4 also sets -mvis3,
20072 -mvis2 and -mvis.
20073
20074 -mvis4b
20075 -mno-vis4b
20076 With -mvis4b, GCC generates code that takes advantage of version
20077 4.0 of the UltraSPARC Visual Instruction Set extensions, plus the
20078 additional VIS instructions introduced in the Oracle SPARC
20079 Architecture 2017. The default is -mvis4b when targeting a cpu
20080 that supports such instructions, such as m8 and later. Setting
20081 -mvis4b also sets -mvis4, -mvis3, -mvis2 and -mvis.
20082
20083 -mcbcond
20084 -mno-cbcond
20085 With -mcbcond, GCC generates code that takes advantage of the
20086 UltraSPARC Compare-and-Branch-on-Condition instructions. The
20087 default is -mcbcond when targeting a CPU that supports such
20088 instructions, such as Niagara-4 and later.
20089
20090 -mfmaf
20091 -mno-fmaf
20092 With -mfmaf, GCC generates code that takes advantage of the
20093 UltraSPARC Fused Multiply-Add Floating-point instructions. The
20094 default is -mfmaf when targeting a CPU that supports such
20095 instructions, such as Niagara-3 and later.
20096
20097 -mfsmuld
20098 -mno-fsmuld
20099 With -mfsmuld, GCC generates code that takes advantage of the
20100 Floating-point Multiply Single to Double (FsMULd) instruction. The
20101 default is -mfsmuld when targeting a CPU supporting the
20102 architecture versions V8 or V9 with FPU except -mcpu=leon.
20103
20104 -mpopc
20105 -mno-popc
20106 With -mpopc, GCC generates code that takes advantage of the
20107 UltraSPARC Population Count instruction. The default is -mpopc
20108 when targeting a CPU that supports such an instruction, such as
20109 Niagara-2 and later.
20110
20111 -msubxc
20112 -mno-subxc
20113 With -msubxc, GCC generates code that takes advantage of the
20114 UltraSPARC Subtract-Extended-with-Carry instruction. The default
20115 is -msubxc when targeting a CPU that supports such an instruction,
20116 such as Niagara-7 and later.
20117
20118 -mfix-at697f
20119 Enable the documented workaround for the single erratum of the
20120 Atmel AT697F processor (which corresponds to erratum #13 of the
20121 AT697E processor).
20122
20123 -mfix-ut699
20124 Enable the documented workarounds for the floating-point errata and
20125 the data cache nullify errata of the UT699 processor.
20126
20127 -mfix-ut700
20128 Enable the documented workaround for the back-to-back store errata
20129 of the UT699E/UT700 processor.
20130
20131 -mfix-gr712rc
20132 Enable the documented workaround for the back-to-back store errata
20133 of the GR712RC processor.
20134
20135 These -m options are supported in addition to the above on SPARC-V9
20136 processors in 64-bit environments:
20137
20138 -m32
20139 -m64
20140 Generate code for a 32-bit or 64-bit environment. The 32-bit
20141 environment sets int, long and pointer to 32 bits. The 64-bit
20142 environment sets int to 32 bits and long and pointer to 64 bits.
20143
20144 -mcmodel=which
20145 Set the code model to one of
20146
20147 medlow
20148 The Medium/Low code model: 64-bit addresses, programs must be
20149 linked in the low 32 bits of memory. Programs can be
20150 statically or dynamically linked.
20151
20152 medmid
20153 The Medium/Middle code model: 64-bit addresses, programs must
20154 be linked in the low 44 bits of memory, the text and data
20155 segments must be less than 2GB in size and the data segment
20156 must be located within 2GB of the text segment.
20157
20158 medany
20159 The Medium/Anywhere code model: 64-bit addresses, programs may
20160 be linked anywhere in memory, the text and data segments must
20161 be less than 2GB in size and the data segment must be located
20162 within 2GB of the text segment.
20163
20164 embmedany
20165 The Medium/Anywhere code model for embedded systems: 64-bit
20166 addresses, the text and data segments must be less than 2GB in
20167 size, both starting anywhere in memory (determined at link
20168 time). The global register %g4 points to the base of the data
20169 segment. Programs are statically linked and PIC is not
20170 supported.
20171
20172 -mmemory-model=mem-model
20173 Set the memory model in force on the processor to one of
20174
20175 default
20176 The default memory model for the processor and operating
20177 system.
20178
20179 rmo Relaxed Memory Order
20180
20181 pso Partial Store Order
20182
20183 tso Total Store Order
20184
20185 sc Sequential Consistency
20186
20187 These memory models are formally defined in Appendix D of the
20188 SPARC-V9 architecture manual, as set in the processor's "PSTATE.MM"
20189 field.
20190
20191 -mstack-bias
20192 -mno-stack-bias
20193 With -mstack-bias, GCC assumes that the stack pointer, and frame
20194 pointer if present, are offset by -2047 which must be added back
20195 when making stack frame references. This is the default in 64-bit
20196 mode. Otherwise, assume no such offset is present.
20197
20198 SPU Options
20199
20200 These -m options are supported on the SPU:
20201
20202 -mwarn-reloc
20203 -merror-reloc
20204 The loader for SPU does not handle dynamic relocations. By
20205 default, GCC gives an error when it generates code that requires a
20206 dynamic relocation. -mno-error-reloc disables the error,
20207 -mwarn-reloc generates a warning instead.
20208
20209 -msafe-dma
20210 -munsafe-dma
20211 Instructions that initiate or test completion of DMA must not be
20212 reordered with respect to loads and stores of the memory that is
20213 being accessed. With -munsafe-dma you must use the "volatile"
20214 keyword to protect memory accesses, but that can lead to
20215 inefficient code in places where the memory is known to not change.
20216 Rather than mark the memory as volatile, you can use -msafe-dma to
20217 tell the compiler to treat the DMA instructions as potentially
20218 affecting all memory.
20219
20220 -mbranch-hints
20221 By default, GCC generates a branch hint instruction to avoid
20222 pipeline stalls for always-taken or probably-taken branches. A
20223 hint is not generated closer than 8 instructions away from its
20224 branch. There is little reason to disable them, except for
20225 debugging purposes, or to make an object a little bit smaller.
20226
20227 -msmall-mem
20228 -mlarge-mem
20229 By default, GCC generates code assuming that addresses are never
20230 larger than 18 bits. With -mlarge-mem code is generated that
20231 assumes a full 32-bit address.
20232
20233 -mstdmain
20234 By default, GCC links against startup code that assumes the SPU-
20235 style main function interface (which has an unconventional
20236 parameter list). With -mstdmain, GCC links your program against
20237 startup code that assumes a C99-style interface to "main",
20238 including a local copy of "argv" strings.
20239
20240 -mfixed-range=register-range
20241 Generate code treating the given register range as fixed registers.
20242 A fixed register is one that the register allocator cannot use.
20243 This is useful when compiling kernel code. A register range is
20244 specified as two registers separated by a dash. Multiple register
20245 ranges can be specified separated by a comma.
20246
20247 -mea32
20248 -mea64
20249 Compile code assuming that pointers to the PPU address space
20250 accessed via the "__ea" named address space qualifier are either 32
20251 or 64 bits wide. The default is 32 bits. As this is an ABI-
20252 changing option, all object code in an executable must be compiled
20253 with the same setting.
20254
20255 -maddress-space-conversion
20256 -mno-address-space-conversion
20257 Allow/disallow treating the "__ea" address space as superset of the
20258 generic address space. This enables explicit type casts between
20259 "__ea" and generic pointer as well as implicit conversions of
20260 generic pointers to "__ea" pointers. The default is to allow
20261 address space pointer conversions.
20262
20263 -mcache-size=cache-size
20264 This option controls the version of libgcc that the compiler links
20265 to an executable and selects a software-managed cache for accessing
20266 variables in the "__ea" address space with a particular cache size.
20267 Possible options for cache-size are 8, 16, 32, 64 and 128. The
20268 default cache size is 64KB.
20269
20270 -matomic-updates
20271 -mno-atomic-updates
20272 This option controls the version of libgcc that the compiler links
20273 to an executable and selects whether atomic updates to the
20274 software-managed cache of PPU-side variables are used. If you use
20275 atomic updates, changes to a PPU variable from SPU code using the
20276 "__ea" named address space qualifier do not interfere with changes
20277 to other PPU variables residing in the same cache line from PPU
20278 code. If you do not use atomic updates, such interference may
20279 occur; however, writing back cache lines is more efficient. The
20280 default behavior is to use atomic updates.
20281
20282 -mdual-nops
20283 -mdual-nops=n
20284 By default, GCC inserts NOPs to increase dual issue when it expects
20285 it to increase performance. n can be a value from 0 to 10. A
20286 smaller n inserts fewer NOPs. 10 is the default, 0 is the same as
20287 -mno-dual-nops. Disabled with -Os.
20288
20289 -mhint-max-nops=n
20290 Maximum number of NOPs to insert for a branch hint. A branch hint
20291 must be at least 8 instructions away from the branch it is
20292 affecting. GCC inserts up to n NOPs to enforce this, otherwise it
20293 does not generate the branch hint.
20294
20295 -mhint-max-distance=n
20296 The encoding of the branch hint instruction limits the hint to be
20297 within 256 instructions of the branch it is affecting. By default,
20298 GCC makes sure it is within 125.
20299
20300 -msafe-hints
20301 Work around a hardware bug that causes the SPU to stall
20302 indefinitely. By default, GCC inserts the "hbrp" instruction to
20303 make sure this stall won't happen.
20304
20305 Options for System V
20306
20307 These additional options are available on System V Release 4 for
20308 compatibility with other compilers on those systems:
20309
20310 -G Create a shared object. It is recommended that -symbolic or
20311 -shared be used instead.
20312
20313 -Qy Identify the versions of each tool used by the compiler, in a
20314 ".ident" assembler directive in the output.
20315
20316 -Qn Refrain from adding ".ident" directives to the output file (this is
20317 the default).
20318
20319 -YP,dirs
20320 Search the directories dirs, and no others, for libraries specified
20321 with -l.
20322
20323 -Ym,dir
20324 Look in the directory dir to find the M4 preprocessor. The
20325 assembler uses this option.
20326
20327 TILE-Gx Options
20328
20329 These -m options are supported on the TILE-Gx:
20330
20331 -mcmodel=small
20332 Generate code for the small model. The distance for direct calls
20333 is limited to 500M in either direction. PC-relative addresses are
20334 32 bits. Absolute addresses support the full address range.
20335
20336 -mcmodel=large
20337 Generate code for the large model. There is no limitation on call
20338 distance, pc-relative addresses, or absolute addresses.
20339
20340 -mcpu=name
20341 Selects the type of CPU to be targeted. Currently the only
20342 supported type is tilegx.
20343
20344 -m32
20345 -m64
20346 Generate code for a 32-bit or 64-bit environment. The 32-bit
20347 environment sets int, long, and pointer to 32 bits. The 64-bit
20348 environment sets int to 32 bits and long and pointer to 64 bits.
20349
20350 -mbig-endian
20351 -mlittle-endian
20352 Generate code in big/little endian mode, respectively.
20353
20354 TILEPro Options
20355
20356 These -m options are supported on the TILEPro:
20357
20358 -mcpu=name
20359 Selects the type of CPU to be targeted. Currently the only
20360 supported type is tilepro.
20361
20362 -m32
20363 Generate code for a 32-bit environment, which sets int, long, and
20364 pointer to 32 bits. This is the only supported behavior so the
20365 flag is essentially ignored.
20366
20367 V850 Options
20368
20369 These -m options are defined for V850 implementations:
20370
20371 -mlong-calls
20372 -mno-long-calls
20373 Treat all calls as being far away (near). If calls are assumed to
20374 be far away, the compiler always loads the function's address into
20375 a register, and calls indirect through the pointer.
20376
20377 -mno-ep
20378 -mep
20379 Do not optimize (do optimize) basic blocks that use the same index
20380 pointer 4 or more times to copy pointer into the "ep" register, and
20381 use the shorter "sld" and "sst" instructions. The -mep option is
20382 on by default if you optimize.
20383
20384 -mno-prolog-function
20385 -mprolog-function
20386 Do not use (do use) external functions to save and restore
20387 registers at the prologue and epilogue of a function. The external
20388 functions are slower, but use less code space if more than one
20389 function saves the same number of registers. The -mprolog-function
20390 option is on by default if you optimize.
20391
20392 -mspace
20393 Try to make the code as small as possible. At present, this just
20394 turns on the -mep and -mprolog-function options.
20395
20396 -mtda=n
20397 Put static or global variables whose size is n bytes or less into
20398 the tiny data area that register "ep" points to. The tiny data
20399 area can hold up to 256 bytes in total (128 bytes for byte
20400 references).
20401
20402 -msda=n
20403 Put static or global variables whose size is n bytes or less into
20404 the small data area that register "gp" points to. The small data
20405 area can hold up to 64 kilobytes.
20406
20407 -mzda=n
20408 Put static or global variables whose size is n bytes or less into
20409 the first 32 kilobytes of memory.
20410
20411 -mv850
20412 Specify that the target processor is the V850.
20413
20414 -mv850e3v5
20415 Specify that the target processor is the V850E3V5. The
20416 preprocessor constant "__v850e3v5__" is defined if this option is
20417 used.
20418
20419 -mv850e2v4
20420 Specify that the target processor is the V850E3V5. This is an
20421 alias for the -mv850e3v5 option.
20422
20423 -mv850e2v3
20424 Specify that the target processor is the V850E2V3. The
20425 preprocessor constant "__v850e2v3__" is defined if this option is
20426 used.
20427
20428 -mv850e2
20429 Specify that the target processor is the V850E2. The preprocessor
20430 constant "__v850e2__" is defined if this option is used.
20431
20432 -mv850e1
20433 Specify that the target processor is the V850E1. The preprocessor
20434 constants "__v850e1__" and "__v850e__" are defined if this option
20435 is used.
20436
20437 -mv850es
20438 Specify that the target processor is the V850ES. This is an alias
20439 for the -mv850e1 option.
20440
20441 -mv850e
20442 Specify that the target processor is the V850E. The preprocessor
20443 constant "__v850e__" is defined if this option is used.
20444
20445 If neither -mv850 nor -mv850e nor -mv850e1 nor -mv850e2 nor
20446 -mv850e2v3 nor -mv850e3v5 are defined then a default target
20447 processor is chosen and the relevant __v850*__ preprocessor
20448 constant is defined.
20449
20450 The preprocessor constants "__v850" and "__v851__" are always
20451 defined, regardless of which processor variant is the target.
20452
20453 -mdisable-callt
20454 -mno-disable-callt
20455 This option suppresses generation of the "CALLT" instruction for
20456 the v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the
20457 v850 architecture.
20458
20459 This option is enabled by default when the RH850 ABI is in use (see
20460 -mrh850-abi), and disabled by default when the GCC ABI is in use.
20461 If "CALLT" instructions are being generated then the C preprocessor
20462 symbol "__V850_CALLT__" is defined.
20463
20464 -mrelax
20465 -mno-relax
20466 Pass on (or do not pass on) the -mrelax command-line option to the
20467 assembler.
20468
20469 -mlong-jumps
20470 -mno-long-jumps
20471 Disable (or re-enable) the generation of PC-relative jump
20472 instructions.
20473
20474 -msoft-float
20475 -mhard-float
20476 Disable (or re-enable) the generation of hardware floating point
20477 instructions. This option is only significant when the target
20478 architecture is V850E2V3 or higher. If hardware floating point
20479 instructions are being generated then the C preprocessor symbol
20480 "__FPU_OK__" is defined, otherwise the symbol "__NO_FPU__" is
20481 defined.
20482
20483 -mloop
20484 Enables the use of the e3v5 LOOP instruction. The use of this
20485 instruction is not enabled by default when the e3v5 architecture is
20486 selected because its use is still experimental.
20487
20488 -mrh850-abi
20489 -mghs
20490 Enables support for the RH850 version of the V850 ABI. This is the
20491 default. With this version of the ABI the following rules apply:
20492
20493 * Integer sized structures and unions are returned via a memory
20494 pointer rather than a register.
20495
20496 * Large structures and unions (more than 8 bytes in size) are
20497 passed by value.
20498
20499 * Functions are aligned to 16-bit boundaries.
20500
20501 * The -m8byte-align command-line option is supported.
20502
20503 * The -mdisable-callt command-line option is enabled by default.
20504 The -mno-disable-callt command-line option is not supported.
20505
20506 When this version of the ABI is enabled the C preprocessor symbol
20507 "__V850_RH850_ABI__" is defined.
20508
20509 -mgcc-abi
20510 Enables support for the old GCC version of the V850 ABI. With this
20511 version of the ABI the following rules apply:
20512
20513 * Integer sized structures and unions are returned in register
20514 "r10".
20515
20516 * Large structures and unions (more than 8 bytes in size) are
20517 passed by reference.
20518
20519 * Functions are aligned to 32-bit boundaries, unless optimizing
20520 for size.
20521
20522 * The -m8byte-align command-line option is not supported.
20523
20524 * The -mdisable-callt command-line option is supported but not
20525 enabled by default.
20526
20527 When this version of the ABI is enabled the C preprocessor symbol
20528 "__V850_GCC_ABI__" is defined.
20529
20530 -m8byte-align
20531 -mno-8byte-align
20532 Enables support for "double" and "long long" types to be aligned on
20533 8-byte boundaries. The default is to restrict the alignment of all
20534 objects to at most 4-bytes. When -m8byte-align is in effect the C
20535 preprocessor symbol "__V850_8BYTE_ALIGN__" is defined.
20536
20537 -mbig-switch
20538 Generate code suitable for big switch tables. Use this option only
20539 if the assembler/linker complain about out of range branches within
20540 a switch table.
20541
20542 -mapp-regs
20543 This option causes r2 and r5 to be used in the code generated by
20544 the compiler. This setting is the default.
20545
20546 -mno-app-regs
20547 This option causes r2 and r5 to be treated as fixed registers.
20548
20549 VAX Options
20550
20551 These -m options are defined for the VAX:
20552
20553 -munix
20554 Do not output certain jump instructions ("aobleq" and so on) that
20555 the Unix assembler for the VAX cannot handle across long ranges.
20556
20557 -mgnu
20558 Do output those jump instructions, on the assumption that the GNU
20559 assembler is being used.
20560
20561 -mg Output code for G-format floating-point numbers instead of
20562 D-format.
20563
20564 Visium Options
20565
20566 -mdebug
20567 A program which performs file I/O and is destined to run on an MCM
20568 target should be linked with this option. It causes the libraries
20569 libc.a and libdebug.a to be linked. The program should be run on
20570 the target under the control of the GDB remote debugging stub.
20571
20572 -msim
20573 A program which performs file I/O and is destined to run on the
20574 simulator should be linked with option. This causes libraries
20575 libc.a and libsim.a to be linked.
20576
20577 -mfpu
20578 -mhard-float
20579 Generate code containing floating-point instructions. This is the
20580 default.
20581
20582 -mno-fpu
20583 -msoft-float
20584 Generate code containing library calls for floating-point.
20585
20586 -msoft-float changes the calling convention in the output file;
20587 therefore, it is only useful if you compile all of a program with
20588 this option. In particular, you need to compile libgcc.a, the
20589 library that comes with GCC, with -msoft-float in order for this to
20590 work.
20591
20592 -mcpu=cpu_type
20593 Set the instruction set, register set, and instruction scheduling
20594 parameters for machine type cpu_type. Supported values for
20595 cpu_type are mcm, gr5 and gr6.
20596
20597 mcm is a synonym of gr5 present for backward compatibility.
20598
20599 By default (unless configured otherwise), GCC generates code for
20600 the GR5 variant of the Visium architecture.
20601
20602 With -mcpu=gr6, GCC generates code for the GR6 variant of the
20603 Visium architecture. The only difference from GR5 code is that the
20604 compiler will generate block move instructions.
20605
20606 -mtune=cpu_type
20607 Set the instruction scheduling parameters for machine type
20608 cpu_type, but do not set the instruction set or register set that
20609 the option -mcpu=cpu_type would.
20610
20611 -msv-mode
20612 Generate code for the supervisor mode, where there are no
20613 restrictions on the access to general registers. This is the
20614 default.
20615
20616 -muser-mode
20617 Generate code for the user mode, where the access to some general
20618 registers is forbidden: on the GR5, registers r24 to r31 cannot be
20619 accessed in this mode; on the GR6, only registers r29 to r31 are
20620 affected.
20621
20622 VMS Options
20623
20624 These -m options are defined for the VMS implementations:
20625
20626 -mvms-return-codes
20627 Return VMS condition codes from "main". The default is to return
20628 POSIX-style condition (e.g. error) codes.
20629
20630 -mdebug-main=prefix
20631 Flag the first routine whose name starts with prefix as the main
20632 routine for the debugger.
20633
20634 -mmalloc64
20635 Default to 64-bit memory allocation routines.
20636
20637 -mpointer-size=size
20638 Set the default size of pointers. Possible options for size are 32
20639 or short for 32 bit pointers, 64 or long for 64 bit pointers, and
20640 no for supporting only 32 bit pointers. The later option disables
20641 "pragma pointer_size".
20642
20643 VxWorks Options
20644
20645 The options in this section are defined for all VxWorks targets.
20646 Options specific to the target hardware are listed with the other
20647 options for that target.
20648
20649 -mrtp
20650 GCC can generate code for both VxWorks kernels and real time
20651 processes (RTPs). This option switches from the former to the
20652 latter. It also defines the preprocessor macro "__RTP__".
20653
20654 -non-static
20655 Link an RTP executable against shared libraries rather than static
20656 libraries. The options -static and -shared can also be used for
20657 RTPs; -static is the default.
20658
20659 -Bstatic
20660 -Bdynamic
20661 These options are passed down to the linker. They are defined for
20662 compatibility with Diab.
20663
20664 -Xbind-lazy
20665 Enable lazy binding of function calls. This option is equivalent
20666 to -Wl,-z,now and is defined for compatibility with Diab.
20667
20668 -Xbind-now
20669 Disable lazy binding of function calls. This option is the default
20670 and is defined for compatibility with Diab.
20671
20672 x86 Options
20673
20674 These -m options are defined for the x86 family of computers.
20675
20676 -march=cpu-type
20677 Generate instructions for the machine type cpu-type. In contrast
20678 to -mtune=cpu-type, which merely tunes the generated code for the
20679 specified cpu-type, -march=cpu-type allows GCC to generate code
20680 that may not run at all on processors other than the one indicated.
20681 Specifying -march=cpu-type implies -mtune=cpu-type.
20682
20683 The choices for cpu-type are:
20684
20685 native
20686 This selects the CPU to generate code for at compilation time
20687 by determining the processor type of the compiling machine.
20688 Using -march=native enables all instruction subsets supported
20689 by the local machine (hence the result might not run on
20690 different machines). Using -mtune=native produces code
20691 optimized for the local machine under the constraints of the
20692 selected instruction set.
20693
20694 i386
20695 Original Intel i386 CPU.
20696
20697 i486
20698 Intel i486 CPU. (No scheduling is implemented for this chip.)
20699
20700 i586
20701 pentium
20702 Intel Pentium CPU with no MMX support.
20703
20704 lakemont
20705 Intel Lakemont MCU, based on Intel Pentium CPU.
20706
20707 pentium-mmx
20708 Intel Pentium MMX CPU, based on Pentium core with MMX
20709 instruction set support.
20710
20711 pentiumpro
20712 Intel Pentium Pro CPU.
20713
20714 i686
20715 When used with -march, the Pentium Pro instruction set is used,
20716 so the code runs on all i686 family chips. When used with
20717 -mtune, it has the same meaning as generic.
20718
20719 pentium2
20720 Intel Pentium II CPU, based on Pentium Pro core with MMX
20721 instruction set support.
20722
20723 pentium3
20724 pentium3m
20725 Intel Pentium III CPU, based on Pentium Pro core with MMX and
20726 SSE instruction set support.
20727
20728 pentium-m
20729 Intel Pentium M; low-power version of Intel Pentium III CPU
20730 with MMX, SSE and SSE2 instruction set support. Used by
20731 Centrino notebooks.
20732
20733 pentium4
20734 pentium4m
20735 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set
20736 support.
20737
20738 prescott
20739 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and
20740 SSE3 instruction set support.
20741
20742 nocona
20743 Improved version of Intel Pentium 4 CPU with 64-bit extensions,
20744 MMX, SSE, SSE2 and SSE3 instruction set support.
20745
20746 core2
20747 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3
20748 and SSSE3 instruction set support.
20749
20750 nehalem
20751 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3,
20752 SSSE3, SSE4.1, SSE4.2 and POPCNT instruction set support.
20753
20754 westmere
20755 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2,
20756 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction
20757 set support.
20758
20759 sandybridge
20760 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2,
20761 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL
20762 instruction set support.
20763
20764 ivybridge
20765 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2,
20766 SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL,
20767 FSGSBASE, RDRND and F16C instruction set support.
20768
20769 haswell
20770 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE,
20771 SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES,
20772 PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2 and F16C instruction
20773 set support.
20774
20775 broadwell
20776 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE,
20777 SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES,
20778 PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX and
20779 PREFETCHW instruction set support.
20780
20781 skylake
20782 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE,
20783 SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES,
20784 PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX,
20785 PREFETCHW, CLFLUSHOPT, XSAVEC and XSAVES instruction set
20786 support.
20787
20788 bonnell
20789 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE,
20790 SSE2, SSE3 and SSSE3 instruction set support.
20791
20792 silvermont
20793 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE,
20794 SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and
20795 RDRND instruction set support.
20796
20797 knl Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX,
20798 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES,
20799 PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX,
20800 PREFETCHW, AVX512F, AVX512PF, AVX512ER and AVX512CD instruction
20801 set support.
20802
20803 skylake-avx512
20804 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX,
20805 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2,
20806 AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED,
20807 ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, AVX512VL,
20808 AVX512BW, AVX512DQ and AVX512CD instruction set support.
20809
20810 k6 AMD K6 CPU with MMX instruction set support.
20811
20812 k6-2
20813 k6-3
20814 Improved versions of AMD K6 CPU with MMX and 3DNow! instruction
20815 set support.
20816
20817 athlon
20818 athlon-tbird
20819 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow! and SSE
20820 prefetch instructions support.
20821
20822 athlon-4
20823 athlon-xp
20824 athlon-mp
20825 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow! and
20826 full SSE instruction set support.
20827
20828 k8
20829 opteron
20830 athlon64
20831 athlon-fx
20832 Processors based on the AMD K8 core with x86-64 instruction set
20833 support, including the AMD Opteron, Athlon 64, and Athlon 64 FX
20834 processors. (This supersets MMX, SSE, SSE2, 3DNow!, enhanced
20835 3DNow! and 64-bit instruction set extensions.)
20836
20837 k8-sse3
20838 opteron-sse3
20839 athlon64-sse3
20840 Improved versions of AMD K8 cores with SSE3 instruction set
20841 support.
20842
20843 amdfam10
20844 barcelona
20845 CPUs based on AMD Family 10h cores with x86-64 instruction set
20846 support. (This supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!,
20847 enhanced 3DNow!, ABM and 64-bit instruction set extensions.)
20848
20849 bdver1
20850 CPUs based on AMD Family 15h cores with x86-64 instruction set
20851 support. (This supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL,
20852 CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM
20853 and 64-bit instruction set extensions.)
20854
20855 bdver2
20856 AMD Family 15h core based CPUs with x86-64 instruction set
20857 support. (This supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP,
20858 LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
20859 SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
20860
20861 bdver3
20862 AMD Family 15h core based CPUs with x86-64 instruction set
20863 support. (This supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE,
20864 AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
20865 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set
20866 extensions.
20867
20868 bdver4
20869 AMD Family 15h core based CPUs with x86-64 instruction set
20870 support. (This supersets BMI, BMI2, TBM, F16C, FMA, FMA4,
20871 FSGSBASE, AVX, AVX2, XOP, LWP, AES, PCL_MUL, CX16, MOVBE, MMX,
20872 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit
20873 instruction set extensions.
20874
20875 znver1
20876 AMD Family 17h core based CPUs with x86-64 instruction set
20877 support. (This supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX,
20878 AVX2, ADCX, RDSEED, MWAITX, SHA, CLZERO, AES, PCL_MUL, CX16,
20879 MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM,
20880 XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit instruction set
20881 extensions.
20882
20883 btver1
20884 CPUs based on AMD Family 14h cores with x86-64 instruction set
20885 support. (This supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A,
20886 CX16, ABM and 64-bit instruction set extensions.)
20887
20888 btver2
20889 CPUs based on AMD Family 16h cores with x86-64 instruction set
20890 support. This includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES,
20891 SSE4.2, SSE4.1, CX16, ABM, SSE4A, SSSE3, SSE3, SSE2, SSE, MMX
20892 and 64-bit instruction set extensions.
20893
20894 winchip-c6
20895 IDT WinChip C6 CPU, dealt in same way as i486 with additional
20896 MMX instruction set support.
20897
20898 winchip2
20899 IDT WinChip 2 CPU, dealt in same way as i486 with additional
20900 MMX and 3DNow! instruction set support.
20901
20902 c3 VIA C3 CPU with MMX and 3DNow! instruction set support. (No
20903 scheduling is implemented for this chip.)
20904
20905 c3-2
20906 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set
20907 support. (No scheduling is implemented for this chip.)
20908
20909 c7 VIA C7 (Esther) CPU with MMX, SSE, SSE2 and SSE3 instruction
20910 set support. (No scheduling is implemented for this chip.)
20911
20912 samuel-2
20913 VIA Eden Samuel 2 CPU with MMX and 3DNow! instruction set
20914 support. (No scheduling is implemented for this chip.)
20915
20916 nehemiah
20917 VIA Eden Nehemiah CPU with MMX and SSE instruction set support.
20918 (No scheduling is implemented for this chip.)
20919
20920 esther
20921 VIA Eden Esther CPU with MMX, SSE, SSE2 and SSE3 instruction
20922 set support. (No scheduling is implemented for this chip.)
20923
20924 eden-x2
20925 VIA Eden X2 CPU with x86-64, MMX, SSE, SSE2 and SSE3
20926 instruction set support. (No scheduling is implemented for
20927 this chip.)
20928
20929 eden-x4
20930 VIA Eden X4 CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3,
20931 SSE4.1, SSE4.2, AVX and AVX2 instruction set support. (No
20932 scheduling is implemented for this chip.)
20933
20934 nano
20935 Generic VIA Nano CPU with x86-64, MMX, SSE, SSE2, SSE3 and
20936 SSSE3 instruction set support. (No scheduling is implemented
20937 for this chip.)
20938
20939 nano-1000
20940 VIA Nano 1xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
20941 instruction set support. (No scheduling is implemented for
20942 this chip.)
20943
20944 nano-2000
20945 VIA Nano 2xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
20946 instruction set support. (No scheduling is implemented for
20947 this chip.)
20948
20949 nano-3000
20950 VIA Nano 3xxx CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and
20951 SSE4.1 instruction set support. (No scheduling is implemented
20952 for this chip.)
20953
20954 nano-x2
20955 VIA Nano Dual Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3
20956 and SSE4.1 instruction set support. (No scheduling is
20957 implemented for this chip.)
20958
20959 nano-x4
20960 VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3
20961 and SSE4.1 instruction set support. (No scheduling is
20962 implemented for this chip.)
20963
20964 geode
20965 AMD Geode embedded processor with MMX and 3DNow! instruction
20966 set support.
20967
20968 -mtune=cpu-type
20969 Tune to cpu-type everything applicable about the generated code,
20970 except for the ABI and the set of available instructions. While
20971 picking a specific cpu-type schedules things appropriately for that
20972 particular chip, the compiler does not generate any code that
20973 cannot run on the default machine type unless you use a -march=cpu-
20974 type option. For example, if GCC is configured for
20975 i686-pc-linux-gnu then -mtune=pentium4 generates code that is tuned
20976 for Pentium 4 but still runs on i686 machines.
20977
20978 The choices for cpu-type are the same as for -march. In addition,
20979 -mtune supports 2 extra choices for cpu-type:
20980
20981 generic
20982 Produce code optimized for the most common IA32/AMD64/EM64T
20983 processors. If you know the CPU on which your code will run,
20984 then you should use the corresponding -mtune or -march option
20985 instead of -mtune=generic. But, if you do not know exactly
20986 what CPU users of your application will have, then you should
20987 use this option.
20988
20989 As new processors are deployed in the marketplace, the behavior
20990 of this option will change. Therefore, if you upgrade to a
20991 newer version of GCC, code generation controlled by this option
20992 will change to reflect the processors that are most common at
20993 the time that version of GCC is released.
20994
20995 There is no -march=generic option because -march indicates the
20996 instruction set the compiler can use, and there is no generic
20997 instruction set applicable to all processors. In contrast,
20998 -mtune indicates the processor (or, in this case, collection of
20999 processors) for which the code is optimized.
21000
21001 intel
21002 Produce code optimized for the most current Intel processors,
21003 which are Haswell and Silvermont for this version of GCC. If
21004 you know the CPU on which your code will run, then you should
21005 use the corresponding -mtune or -march option instead of
21006 -mtune=intel. But, if you want your application performs
21007 better on both Haswell and Silvermont, then you should use this
21008 option.
21009
21010 As new Intel processors are deployed in the marketplace, the
21011 behavior of this option will change. Therefore, if you upgrade
21012 to a newer version of GCC, code generation controlled by this
21013 option will change to reflect the most current Intel processors
21014 at the time that version of GCC is released.
21015
21016 There is no -march=intel option because -march indicates the
21017 instruction set the compiler can use, and there is no common
21018 instruction set applicable to all processors. In contrast,
21019 -mtune indicates the processor (or, in this case, collection of
21020 processors) for which the code is optimized.
21021
21022 -mcpu=cpu-type
21023 A deprecated synonym for -mtune.
21024
21025 -mfpmath=unit
21026 Generate floating-point arithmetic for selected unit unit. The
21027 choices for unit are:
21028
21029 387 Use the standard 387 floating-point coprocessor present on the
21030 majority of chips and emulated otherwise. Code compiled with
21031 this option runs almost everywhere. The temporary results are
21032 computed in 80-bit precision instead of the precision specified
21033 by the type, resulting in slightly different results compared
21034 to most of other chips. See -ffloat-store for more detailed
21035 description.
21036
21037 This is the default choice for non-Darwin x86-32 targets.
21038
21039 sse Use scalar floating-point instructions present in the SSE
21040 instruction set. This instruction set is supported by Pentium
21041 III and newer chips, and in the AMD line by Athlon-4, Athlon XP
21042 and Athlon MP chips. The earlier version of the SSE
21043 instruction set supports only single-precision arithmetic, thus
21044 the double and extended-precision arithmetic are still done
21045 using 387. A later version, present only in Pentium 4 and AMD
21046 x86-64 chips, supports double-precision arithmetic too.
21047
21048 For the x86-32 compiler, you must use -march=cpu-type, -msse or
21049 -msse2 switches to enable SSE extensions and make this option
21050 effective. For the x86-64 compiler, these extensions are
21051 enabled by default.
21052
21053 The resulting code should be considerably faster in the
21054 majority of cases and avoid the numerical instability problems
21055 of 387 code, but may break some existing code that expects
21056 temporaries to be 80 bits.
21057
21058 This is the default choice for the x86-64 compiler, Darwin
21059 x86-32 targets, and the default choice for x86-32 targets with
21060 the SSE2 instruction set when -ffast-math is enabled.
21061
21062 sse,387
21063 sse+387
21064 both
21065 Attempt to utilize both instruction sets at once. This
21066 effectively doubles the amount of available registers, and on
21067 chips with separate execution units for 387 and SSE the
21068 execution resources too. Use this option with care, as it is
21069 still experimental, because the GCC register allocator does not
21070 model separate functional units well, resulting in unstable
21071 performance.
21072
21073 -masm=dialect
21074 Output assembly instructions using selected dialect. Also affects
21075 which dialect is used for basic "asm" and extended "asm". Supported
21076 choices (in dialect order) are att or intel. The default is att.
21077 Darwin does not support intel.
21078
21079 -mieee-fp
21080 -mno-ieee-fp
21081 Control whether or not the compiler uses IEEE floating-point
21082 comparisons. These correctly handle the case where the result of a
21083 comparison is unordered.
21084
21085 -m80387
21086 -mhard-float
21087 Generate output containing 80387 instructions for floating point.
21088
21089 -mno-80387
21090 -msoft-float
21091 Generate output containing library calls for floating point.
21092
21093 Warning: the requisite libraries are not part of GCC. Normally the
21094 facilities of the machine's usual C compiler are used, but this
21095 cannot be done directly in cross-compilation. You must make your
21096 own arrangements to provide suitable library functions for cross-
21097 compilation.
21098
21099 On machines where a function returns floating-point results in the
21100 80387 register stack, some floating-point opcodes may be emitted
21101 even if -msoft-float is used.
21102
21103 -mno-fp-ret-in-387
21104 Do not use the FPU registers for return values of functions.
21105
21106 The usual calling convention has functions return values of types
21107 "float" and "double" in an FPU register, even if there is no FPU.
21108 The idea is that the operating system should emulate an FPU.
21109
21110 The option -mno-fp-ret-in-387 causes such values to be returned in
21111 ordinary CPU registers instead.
21112
21113 -mno-fancy-math-387
21114 Some 387 emulators do not support the "sin", "cos" and "sqrt"
21115 instructions for the 387. Specify this option to avoid generating
21116 those instructions. This option is the default on OpenBSD and
21117 NetBSD. This option is overridden when -march indicates that the
21118 target CPU always has an FPU and so the instruction does not need
21119 emulation. These instructions are not generated unless you also
21120 use the -funsafe-math-optimizations switch.
21121
21122 -malign-double
21123 -mno-align-double
21124 Control whether GCC aligns "double", "long double", and "long long"
21125 variables on a two-word boundary or a one-word boundary. Aligning
21126 "double" variables on a two-word boundary produces code that runs
21127 somewhat faster on a Pentium at the expense of more memory.
21128
21129 On x86-64, -malign-double is enabled by default.
21130
21131 Warning: if you use the -malign-double switch, structures
21132 containing the above types are aligned differently than the
21133 published application binary interface specifications for the
21134 x86-32 and are not binary compatible with structures in code
21135 compiled without that switch.
21136
21137 -m96bit-long-double
21138 -m128bit-long-double
21139 These switches control the size of "long double" type. The x86-32
21140 application binary interface specifies the size to be 96 bits, so
21141 -m96bit-long-double is the default in 32-bit mode.
21142
21143 Modern architectures (Pentium and newer) prefer "long double" to be
21144 aligned to an 8- or 16-byte boundary. In arrays or structures
21145 conforming to the ABI, this is not possible. So specifying
21146 -m128bit-long-double aligns "long double" to a 16-byte boundary by
21147 padding the "long double" with an additional 32-bit zero.
21148
21149 In the x86-64 compiler, -m128bit-long-double is the default choice
21150 as its ABI specifies that "long double" is aligned on 16-byte
21151 boundary.
21152
21153 Notice that neither of these options enable any extra precision
21154 over the x87 standard of 80 bits for a "long double".
21155
21156 Warning: if you override the default value for your target ABI,
21157 this changes the size of structures and arrays containing "long
21158 double" variables, as well as modifying the function calling
21159 convention for functions taking "long double". Hence they are not
21160 binary-compatible with code compiled without that switch.
21161
21162 -mlong-double-64
21163 -mlong-double-80
21164 -mlong-double-128
21165 These switches control the size of "long double" type. A size of 64
21166 bits makes the "long double" type equivalent to the "double" type.
21167 This is the default for 32-bit Bionic C library. A size of 128
21168 bits makes the "long double" type equivalent to the "__float128"
21169 type. This is the default for 64-bit Bionic C library.
21170
21171 Warning: if you override the default value for your target ABI,
21172 this changes the size of structures and arrays containing "long
21173 double" variables, as well as modifying the function calling
21174 convention for functions taking "long double". Hence they are not
21175 binary-compatible with code compiled without that switch.
21176
21177 -malign-data=type
21178 Control how GCC aligns variables. Supported values for type are
21179 compat uses increased alignment value compatible uses GCC 4.8 and
21180 earlier, abi uses alignment value as specified by the psABI, and
21181 cacheline uses increased alignment value to match the cache line
21182 size. compat is the default.
21183
21184 -mlarge-data-threshold=threshold
21185 When -mcmodel=medium is specified, data objects larger than
21186 threshold are placed in the large data section. This value must be
21187 the same across all objects linked into the binary, and defaults to
21188 65535.
21189
21190 -mrtd
21191 Use a different function-calling convention, in which functions
21192 that take a fixed number of arguments return with the "ret num"
21193 instruction, which pops their arguments while returning. This
21194 saves one instruction in the caller since there is no need to pop
21195 the arguments there.
21196
21197 You can specify that an individual function is called with this
21198 calling sequence with the function attribute "stdcall". You can
21199 also override the -mrtd option by using the function attribute
21200 "cdecl".
21201
21202 Warning: this calling convention is incompatible with the one
21203 normally used on Unix, so you cannot use it if you need to call
21204 libraries compiled with the Unix compiler.
21205
21206 Also, you must provide function prototypes for all functions that
21207 take variable numbers of arguments (including "printf"); otherwise
21208 incorrect code is generated for calls to those functions.
21209
21210 In addition, seriously incorrect code results if you call a
21211 function with too many arguments. (Normally, extra arguments are
21212 harmlessly ignored.)
21213
21214 -mregparm=num
21215 Control how many registers are used to pass integer arguments. By
21216 default, no registers are used to pass arguments, and at most 3
21217 registers can be used. You can control this behavior for a
21218 specific function by using the function attribute "regparm".
21219
21220 Warning: if you use this switch, and num is nonzero, then you must
21221 build all modules with the same value, including any libraries.
21222 This includes the system libraries and startup modules.
21223
21224 -msseregparm
21225 Use SSE register passing conventions for float and double arguments
21226 and return values. You can control this behavior for a specific
21227 function by using the function attribute "sseregparm".
21228
21229 Warning: if you use this switch then you must build all modules
21230 with the same value, including any libraries. This includes the
21231 system libraries and startup modules.
21232
21233 -mvect8-ret-in-mem
21234 Return 8-byte vectors in memory instead of MMX registers. This is
21235 the default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of
21236 the Sun Studio compilers until version 12. Later compiler versions
21237 (starting with Studio 12 Update@tie{}1) follow the ABI used by
21238 other x86 targets, which is the default on Solaris@tie{}10 and
21239 later. Only use this option if you need to remain compatible with
21240 existing code produced by those previous compiler versions or older
21241 versions of GCC.
21242
21243 -mpc32
21244 -mpc64
21245 -mpc80
21246 Set 80387 floating-point precision to 32, 64 or 80 bits. When
21247 -mpc32 is specified, the significands of results of floating-point
21248 operations are rounded to 24 bits (single precision); -mpc64 rounds
21249 the significands of results of floating-point operations to 53 bits
21250 (double precision) and -mpc80 rounds the significands of results of
21251 floating-point operations to 64 bits (extended double precision),
21252 which is the default. When this option is used, floating-point
21253 operations in higher precisions are not available to the programmer
21254 without setting the FPU control word explicitly.
21255
21256 Setting the rounding of floating-point operations to less than the
21257 default 80 bits can speed some programs by 2% or more. Note that
21258 some mathematical libraries assume that extended-precision (80-bit)
21259 floating-point operations are enabled by default; routines in such
21260 libraries could suffer significant loss of accuracy, typically
21261 through so-called "catastrophic cancellation", when this option is
21262 used to set the precision to less than extended precision.
21263
21264 -mstackrealign
21265 Realign the stack at entry. On the x86, the -mstackrealign option
21266 generates an alternate prologue and epilogue that realigns the run-
21267 time stack if necessary. This supports mixing legacy codes that
21268 keep 4-byte stack alignment with modern codes that keep 16-byte
21269 stack alignment for SSE compatibility. See also the attribute
21270 "force_align_arg_pointer", applicable to individual functions.
21271
21272 -mpreferred-stack-boundary=num
21273 Attempt to keep the stack boundary aligned to a 2 raised to num
21274 byte boundary. If -mpreferred-stack-boundary is not specified, the
21275 default is 4 (16 bytes or 128 bits).
21276
21277 Warning: When generating code for the x86-64 architecture with SSE
21278 extensions disabled, -mpreferred-stack-boundary=3 can be used to
21279 keep the stack boundary aligned to 8 byte boundary. Since x86-64
21280 ABI require 16 byte stack alignment, this is ABI incompatible and
21281 intended to be used in controlled environment where stack space is
21282 important limitation. This option leads to wrong code when
21283 functions compiled with 16 byte stack alignment (such as functions
21284 from a standard library) are called with misaligned stack. In this
21285 case, SSE instructions may lead to misaligned memory access traps.
21286 In addition, variable arguments are handled incorrectly for 16 byte
21287 aligned objects (including x87 long double and __int128), leading
21288 to wrong results. You must build all modules with
21289 -mpreferred-stack-boundary=3, including any libraries. This
21290 includes the system libraries and startup modules.
21291
21292 -mincoming-stack-boundary=num
21293 Assume the incoming stack is aligned to a 2 raised to num byte
21294 boundary. If -mincoming-stack-boundary is not specified, the one
21295 specified by -mpreferred-stack-boundary is used.
21296
21297 On Pentium and Pentium Pro, "double" and "long double" values
21298 should be aligned to an 8-byte boundary (see -malign-double) or
21299 suffer significant run time performance penalties. On Pentium III,
21300 the Streaming SIMD Extension (SSE) data type "__m128" may not work
21301 properly if it is not 16-byte aligned.
21302
21303 To ensure proper alignment of this values on the stack, the stack
21304 boundary must be as aligned as that required by any value stored on
21305 the stack. Further, every function must be generated such that it
21306 keeps the stack aligned. Thus calling a function compiled with a
21307 higher preferred stack boundary from a function compiled with a
21308 lower preferred stack boundary most likely misaligns the stack. It
21309 is recommended that libraries that use callbacks always use the
21310 default setting.
21311
21312 This extra alignment does consume extra stack space, and generally
21313 increases code size. Code that is sensitive to stack space usage,
21314 such as embedded systems and operating system kernels, may want to
21315 reduce the preferred alignment to -mpreferred-stack-boundary=2.
21316
21317 -mmmx
21318 -msse
21319 -msse2
21320 -msse3
21321 -mssse3
21322 -msse4
21323 -msse4a
21324 -msse4.1
21325 -msse4.2
21326 -mavx
21327 -mavx2
21328 -mavx512f
21329 -mavx512pf
21330 -mavx512er
21331 -mavx512cd
21332 -mavx512vl
21333 -mavx512bw
21334 -mavx512dq
21335 -mavx512ifma
21336 -mavx512vbmi
21337 -msha
21338 -maes
21339 -mpclmul
21340 -mclflushopt
21341 -mfsgsbase
21342 -mrdrnd
21343 -mf16c
21344 -mfma
21345 -mfma4
21346 -mprefetchwt1
21347 -mxop
21348 -mlwp
21349 -m3dnow
21350 -m3dnowa
21351 -mpopcnt
21352 -mabm
21353 -mbmi
21354 -mbmi2
21355 -mlzcnt
21356 -mfxsr
21357 -mxsave
21358 -mxsaveopt
21359 -mxsavec
21360 -mxsaves
21361 -mrtm
21362 -mtbm
21363 -mmpx
21364 -mmwaitx
21365 -mclzero
21366 -mpku
21367 These switches enable the use of instructions in the MMX, SSE,
21368 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER,
21369 AVX512CD, SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A,
21370 FMA4, XOP, LWP, ABM, AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA
21371 AVX512VBMI, BMI, BMI2, FXSR, XSAVE, XSAVEOPT, LZCNT, RTM, MPX,
21372 MWAITX, PKU, 3DNow! or enhanced 3DNow! extended instruction sets.
21373 Each has a corresponding -mno- option to disable use of these
21374 instructions.
21375
21376 These extensions are also available as built-in functions: see x86
21377 Built-in Functions, for details of the functions enabled and
21378 disabled by these switches.
21379
21380 To generate SSE/SSE2 instructions automatically from floating-point
21381 code (as opposed to 387 instructions), see -mfpmath=sse.
21382
21383 GCC depresses SSEx instructions when -mavx is used. Instead, it
21384 generates new AVX instructions or AVX equivalence for all SSEx
21385 instructions when needed.
21386
21387 These options enable GCC to use these extended instructions in
21388 generated code, even without -mfpmath=sse. Applications that
21389 perform run-time CPU detection must compile separate files for each
21390 supported architecture, using the appropriate flags. In
21391 particular, the file containing the CPU detection code should be
21392 compiled without these options.
21393
21394 -mdump-tune-features
21395 This option instructs GCC to dump the names of the x86 performance
21396 tuning features and default settings. The names can be used in
21397 -mtune-ctrl=feature-list.
21398
21399 -mtune-ctrl=feature-list
21400 This option is used to do fine grain control of x86 code generation
21401 features. feature-list is a comma separated list of feature names.
21402 See also -mdump-tune-features. When specified, the feature is
21403 turned on if it is not preceded with ^, otherwise, it is turned
21404 off. -mtune-ctrl=feature-list is intended to be used by GCC
21405 developers. Using it may lead to code paths not covered by testing
21406 and can potentially result in compiler ICEs or runtime errors.
21407
21408 -mno-default
21409 This option instructs GCC to turn off all tunable features. See
21410 also -mtune-ctrl=feature-list and -mdump-tune-features.
21411
21412 -mcld
21413 This option instructs GCC to emit a "cld" instruction in the
21414 prologue of functions that use string instructions. String
21415 instructions depend on the DF flag to select between autoincrement
21416 or autodecrement mode. While the ABI specifies the DF flag to be
21417 cleared on function entry, some operating systems violate this
21418 specification by not clearing the DF flag in their exception
21419 dispatchers. The exception handler can be invoked with the DF flag
21420 set, which leads to wrong direction mode when string instructions
21421 are used. This option can be enabled by default on 32-bit x86
21422 targets by configuring GCC with the --enable-cld configure option.
21423 Generation of "cld" instructions can be suppressed with the
21424 -mno-cld compiler option in this case.
21425
21426 -mvzeroupper
21427 This option instructs GCC to emit a "vzeroupper" instruction before
21428 a transfer of control flow out of the function to minimize the AVX
21429 to SSE transition penalty as well as remove unnecessary "zeroupper"
21430 intrinsics.
21431
21432 -mprefer-avx128
21433 This option instructs GCC to use 128-bit AVX instructions instead
21434 of 256-bit AVX instructions in the auto-vectorizer.
21435
21436 -mcx16
21437 This option enables GCC to generate "CMPXCHG16B" instructions in
21438 64-bit code to implement compare-and-exchange operations on 16-byte
21439 aligned 128-bit objects. This is useful for atomic updates of data
21440 structures exceeding one machine word in size. The compiler uses
21441 this instruction to implement __sync Builtins. However, for
21442 __atomic Builtins operating on 128-bit integers, a library call is
21443 always used.
21444
21445 -msahf
21446 This option enables generation of "SAHF" instructions in 64-bit
21447 code. Early Intel Pentium 4 CPUs with Intel 64 support, prior to
21448 the introduction of Pentium 4 G1 step in December 2005, lacked the
21449 "LAHF" and "SAHF" instructions which are supported by AMD64. These
21450 are load and store instructions, respectively, for certain status
21451 flags. In 64-bit mode, the "SAHF" instruction is used to optimize
21452 "fmod", "drem", and "remainder" built-in functions; see Other
21453 Builtins for details.
21454
21455 -mmovbe
21456 This option enables use of the "movbe" instruction to implement
21457 "__builtin_bswap32" and "__builtin_bswap64".
21458
21459 -mcrc32
21460 This option enables built-in functions "__builtin_ia32_crc32qi",
21461 "__builtin_ia32_crc32hi", "__builtin_ia32_crc32si" and
21462 "__builtin_ia32_crc32di" to generate the "crc32" machine
21463 instruction.
21464
21465 -mrecip
21466 This option enables use of "RCPSS" and "RSQRTSS" instructions (and
21467 their vectorized variants "RCPPS" and "RSQRTPS") with an additional
21468 Newton-Raphson step to increase precision instead of "DIVSS" and
21469 "SQRTSS" (and their vectorized variants) for single-precision
21470 floating-point arguments. These instructions are generated only
21471 when -funsafe-math-optimizations is enabled together with
21472 -ffinite-math-only and -fno-trapping-math. Note that while the
21473 throughput of the sequence is higher than the throughput of the
21474 non-reciprocal instruction, the precision of the sequence can be
21475 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals
21476 0.99999994).
21477
21478 Note that GCC implements "1.0f/sqrtf(x)" in terms of "RSQRTSS" (or
21479 "RSQRTPS") already with -ffast-math (or the above option
21480 combination), and doesn't need -mrecip.
21481
21482 Also note that GCC emits the above sequence with additional Newton-
21483 Raphson step for vectorized single-float division and vectorized
21484 "sqrtf(x)" already with -ffast-math (or the above option
21485 combination), and doesn't need -mrecip.
21486
21487 -mrecip=opt
21488 This option controls which reciprocal estimate instructions may be
21489 used. opt is a comma-separated list of options, which may be
21490 preceded by a ! to invert the option:
21491
21492 all Enable all estimate instructions.
21493
21494 default
21495 Enable the default instructions, equivalent to -mrecip.
21496
21497 none
21498 Disable all estimate instructions, equivalent to -mno-recip.
21499
21500 div Enable the approximation for scalar division.
21501
21502 vec-div
21503 Enable the approximation for vectorized division.
21504
21505 sqrt
21506 Enable the approximation for scalar square root.
21507
21508 vec-sqrt
21509 Enable the approximation for vectorized square root.
21510
21511 So, for example, -mrecip=all,!sqrt enables all of the reciprocal
21512 approximations, except for square root.
21513
21514 -mveclibabi=type
21515 Specifies the ABI type to use for vectorizing intrinsics using an
21516 external library. Supported values for type are svml for the Intel
21517 short vector math library and acml for the AMD math core library.
21518 To use this option, both -ftree-vectorize and
21519 -funsafe-math-optimizations have to be enabled, and an SVML or ACML
21520 ABI-compatible library must be specified at link time.
21521
21522 GCC currently emits calls to "vmldExp2", "vmldLn2", "vmldLog102",
21523 "vmldLog102", "vmldPow2", "vmldTanh2", "vmldTan2", "vmldAtan2",
21524 "vmldAtanh2", "vmldCbrt2", "vmldSinh2", "vmldSin2", "vmldAsinh2",
21525 "vmldAsin2", "vmldCosh2", "vmldCos2", "vmldAcosh2", "vmldAcos2",
21526 "vmlsExp4", "vmlsLn4", "vmlsLog104", "vmlsLog104", "vmlsPow4",
21527 "vmlsTanh4", "vmlsTan4", "vmlsAtan4", "vmlsAtanh4", "vmlsCbrt4",
21528 "vmlsSinh4", "vmlsSin4", "vmlsAsinh4", "vmlsAsin4", "vmlsCosh4",
21529 "vmlsCos4", "vmlsAcosh4" and "vmlsAcos4" for corresponding function
21530 type when -mveclibabi=svml is used, and "__vrd2_sin", "__vrd2_cos",
21531 "__vrd2_exp", "__vrd2_log", "__vrd2_log2", "__vrd2_log10",
21532 "__vrs4_sinf", "__vrs4_cosf", "__vrs4_expf", "__vrs4_logf",
21533 "__vrs4_log2f", "__vrs4_log10f" and "__vrs4_powf" for the
21534 corresponding function type when -mveclibabi=acml is used.
21535
21536 -mabi=name
21537 Generate code for the specified calling convention. Permissible
21538 values are sysv for the ABI used on GNU/Linux and other systems,
21539 and ms for the Microsoft ABI. The default is to use the Microsoft
21540 ABI when targeting Microsoft Windows and the SysV ABI on all other
21541 systems. You can control this behavior for specific functions by
21542 using the function attributes "ms_abi" and "sysv_abi".
21543
21544 -mtls-dialect=type
21545 Generate code to access thread-local storage using the gnu or gnu2
21546 conventions. gnu is the conservative default; gnu2 is more
21547 efficient, but it may add compile- and run-time requirements that
21548 cannot be satisfied on all systems.
21549
21550 -mpush-args
21551 -mno-push-args
21552 Use PUSH operations to store outgoing parameters. This method is
21553 shorter and usually equally fast as method using SUB/MOV operations
21554 and is enabled by default. In some cases disabling it may improve
21555 performance because of improved scheduling and reduced
21556 dependencies.
21557
21558 -maccumulate-outgoing-args
21559 If enabled, the maximum amount of space required for outgoing
21560 arguments is computed in the function prologue. This is faster on
21561 most modern CPUs because of reduced dependencies, improved
21562 scheduling and reduced stack usage when the preferred stack
21563 boundary is not equal to 2. The drawback is a notable increase in
21564 code size. This switch implies -mno-push-args.
21565
21566 -mthreads
21567 Support thread-safe exception handling on MinGW. Programs that
21568 rely on thread-safe exception handling must compile and link all
21569 code with the -mthreads option. When compiling, -mthreads defines
21570 -D_MT; when linking, it links in a special thread helper library
21571 -lmingwthrd which cleans up per-thread exception-handling data.
21572
21573 -mms-bitfields
21574 -mno-ms-bitfields
21575 Enable/disable bit-field layout compatible with the native
21576 Microsoft Windows compiler.
21577
21578 If "packed" is used on a structure, or if bit-fields are used, it
21579 may be that the Microsoft ABI lays out the structure differently
21580 than the way GCC normally does. Particularly when moving packed
21581 data between functions compiled with GCC and the native Microsoft
21582 compiler (either via function call or as data in a file), it may be
21583 necessary to access either format.
21584
21585 This option is enabled by default for Microsoft Windows targets.
21586 This behavior can also be controlled locally by use of variable or
21587 type attributes. For more information, see x86 Variable Attributes
21588 and x86 Type Attributes.
21589
21590 The Microsoft structure layout algorithm is fairly simple with the
21591 exception of the bit-field packing. The padding and alignment of
21592 members of structures and whether a bit-field can straddle a
21593 storage-unit boundary are determine by these rules:
21594
21595 1. Structure members are stored sequentially in the order in which
21596 they are
21597 declared: the first member has the lowest memory address and
21598 the last member the highest.
21599
21600 2. Every data object has an alignment requirement. The alignment
21601 requirement
21602 for all data except structures, unions, and arrays is either
21603 the size of the object or the current packing size (specified
21604 with either the "aligned" attribute or the "pack" pragma),
21605 whichever is less. For structures, unions, and arrays, the
21606 alignment requirement is the largest alignment requirement of
21607 its members. Every object is allocated an offset so that:
21608
21609 offset % alignment_requirement == 0
21610
21611 3. Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte
21612 allocation
21613 unit if the integral types are the same size and if the next
21614 bit-field fits into the current allocation unit without
21615 crossing the boundary imposed by the common alignment
21616 requirements of the bit-fields.
21617
21618 MSVC interprets zero-length bit-fields in the following ways:
21619
21620 1. If a zero-length bit-field is inserted between two bit-fields
21621 that
21622 are normally coalesced, the bit-fields are not coalesced.
21623
21624 For example:
21625
21626 struct
21627 {
21628 unsigned long bf_1 : 12;
21629 unsigned long : 0;
21630 unsigned long bf_2 : 12;
21631 } t1;
21632
21633 The size of "t1" is 8 bytes with the zero-length bit-field. If
21634 the zero-length bit-field were removed, "t1"'s size would be 4
21635 bytes.
21636
21637 2. If a zero-length bit-field is inserted after a bit-field, "foo",
21638 and the
21639 alignment of the zero-length bit-field is greater than the
21640 member that follows it, "bar", "bar" is aligned as the type of
21641 the zero-length bit-field.
21642
21643 For example:
21644
21645 struct
21646 {
21647 char foo : 4;
21648 short : 0;
21649 char bar;
21650 } t2;
21651
21652 struct
21653 {
21654 char foo : 4;
21655 short : 0;
21656 double bar;
21657 } t3;
21658
21659 For "t2", "bar" is placed at offset 2, rather than offset 1.
21660 Accordingly, the size of "t2" is 4. For "t3", the zero-length
21661 bit-field does not affect the alignment of "bar" or, as a
21662 result, the size of the structure.
21663
21664 Taking this into account, it is important to note the
21665 following:
21666
21667 1. If a zero-length bit-field follows a normal bit-field, the
21668 type of the
21669 zero-length bit-field may affect the alignment of the
21670 structure as whole. For example, "t2" has a size of 4
21671 bytes, since the zero-length bit-field follows a normal
21672 bit-field, and is of type short.
21673
21674 2. Even if a zero-length bit-field is not followed by a normal
21675 bit-field, it may
21676 still affect the alignment of the structure:
21677
21678 struct
21679 {
21680 char foo : 6;
21681 long : 0;
21682 } t4;
21683
21684 Here, "t4" takes up 4 bytes.
21685
21686 3. Zero-length bit-fields following non-bit-field members are
21687 ignored:
21688 struct
21689 {
21690 char foo;
21691 long : 0;
21692 char bar;
21693 } t5;
21694
21695 Here, "t5" takes up 2 bytes.
21696
21697 -mno-align-stringops
21698 Do not align the destination of inlined string operations. This
21699 switch reduces code size and improves performance in case the
21700 destination is already aligned, but GCC doesn't know about it.
21701
21702 -minline-all-stringops
21703 By default GCC inlines string operations only when the destination
21704 is known to be aligned to least a 4-byte boundary. This enables
21705 more inlining and increases code size, but may improve performance
21706 of code that depends on fast "memcpy", "strlen", and "memset" for
21707 short lengths.
21708
21709 -minline-stringops-dynamically
21710 For string operations of unknown size, use run-time checks with
21711 inline code for small blocks and a library call for large blocks.
21712
21713 -mstringop-strategy=alg
21714 Override the internal decision heuristic for the particular
21715 algorithm to use for inlining string operations. The allowed
21716 values for alg are:
21717
21718 rep_byte
21719 rep_4byte
21720 rep_8byte
21721 Expand using i386 "rep" prefix of the specified size.
21722
21723 byte_loop
21724 loop
21725 unrolled_loop
21726 Expand into an inline loop.
21727
21728 libcall
21729 Always use a library call.
21730
21731 -mmemcpy-strategy=strategy
21732 Override the internal decision heuristic to decide if
21733 "__builtin_memcpy" should be inlined and what inline algorithm to
21734 use when the expected size of the copy operation is known. strategy
21735 is a comma-separated list of alg:max_size:dest_align triplets. alg
21736 is specified in -mstringop-strategy, max_size specifies the max
21737 byte size with which inline algorithm alg is allowed. For the last
21738 triplet, the max_size must be "-1". The max_size of the triplets in
21739 the list must be specified in increasing order. The minimal byte
21740 size for alg is 0 for the first triplet and "max_size + 1" of the
21741 preceding range.
21742
21743 -mmemset-strategy=strategy
21744 The option is similar to -mmemcpy-strategy= except that it is to
21745 control "__builtin_memset" expansion.
21746
21747 -momit-leaf-frame-pointer
21748 Don't keep the frame pointer in a register for leaf functions.
21749 This avoids the instructions to save, set up, and restore frame
21750 pointers and makes an extra register available in leaf functions.
21751 The option -fomit-leaf-frame-pointer removes the frame pointer for
21752 leaf functions, which might make debugging harder.
21753
21754 -mtls-direct-seg-refs
21755 -mno-tls-direct-seg-refs
21756 Controls whether TLS variables may be accessed with offsets from
21757 the TLS segment register (%gs for 32-bit, %fs for 64-bit), or
21758 whether the thread base pointer must be added. Whether or not this
21759 is valid depends on the operating system, and whether it maps the
21760 segment to cover the entire TLS area.
21761
21762 For systems that use the GNU C Library, the default is on.
21763
21764 -msse2avx
21765 -mno-sse2avx
21766 Specify that the assembler should encode SSE instructions with VEX
21767 prefix. The option -mavx turns this on by default.
21768
21769 -mfentry
21770 -mno-fentry
21771 If profiling is active (-pg), put the profiling counter call before
21772 the prologue. Note: On x86 architectures the attribute
21773 "ms_hook_prologue" isn't possible at the moment for -mfentry and
21774 -pg.
21775
21776 -mrecord-mcount
21777 -mno-record-mcount
21778 If profiling is active (-pg), generate a __mcount_loc section that
21779 contains pointers to each profiling call. This is useful for
21780 automatically patching and out calls.
21781
21782 -mnop-mcount
21783 -mno-nop-mcount
21784 If profiling is active (-pg), generate the calls to the profiling
21785 functions as NOPs. This is useful when they should be patched in
21786 later dynamically. This is likely only useful together with
21787 -mrecord-mcount.
21788
21789 -mskip-rax-setup
21790 -mno-skip-rax-setup
21791 When generating code for the x86-64 architecture with SSE
21792 extensions disabled, -mskip-rax-setup can be used to skip setting
21793 up RAX register when there are no variable arguments passed in
21794 vector registers.
21795
21796 Warning: Since RAX register is used to avoid unnecessarily saving
21797 vector registers on stack when passing variable arguments, the
21798 impacts of this option are callees may waste some stack space,
21799 misbehave or jump to a random location. GCC 4.4 or newer don't
21800 have those issues, regardless the RAX register value.
21801
21802 -m8bit-idiv
21803 -mno-8bit-idiv
21804 On some processors, like Intel Atom, 8-bit unsigned integer divide
21805 is much faster than 32-bit/64-bit integer divide. This option
21806 generates a run-time check. If both dividend and divisor are
21807 within range of 0 to 255, 8-bit unsigned integer divide is used
21808 instead of 32-bit/64-bit integer divide.
21809
21810 -mavx256-split-unaligned-load
21811 -mavx256-split-unaligned-store
21812 Split 32-byte AVX unaligned load and store.
21813
21814 -mstack-protector-guard=guard
21815 Generate stack protection code using canary at guard. Supported
21816 locations are global for global canary or tls for per-thread canary
21817 in the TLS block (the default). This option has effect only when
21818 -fstack-protector or -fstack-protector-all is specified.
21819
21820 -mmitigate-rop
21821 Try to avoid generating code sequences that contain unintended
21822 return opcodes, to mitigate against certain forms of attack. At the
21823 moment, this option is limited in what it can do and should not be
21824 relied on to provide serious protection.
21825
21826 -mgeneral-regs-only
21827 Generate code that uses only the general-purpose registers. This
21828 prevents the compiler from using floating-point, vector, mask and
21829 bound registers.
21830
21831 -mindirect-branch=choice
21832 Convert indirect call and jump with choice. The default is keep,
21833 which keeps indirect call and jump unmodified. thunk converts
21834 indirect call and jump to call and return thunk. thunk-inline
21835 converts indirect call and jump to inlined call and return thunk.
21836 thunk-extern converts indirect call and jump to external call and
21837 return thunk provided in a separate object file. You can control
21838 this behavior for a specific function by using the function
21839 attribute "indirect_branch".
21840
21841 Note that -mcmodel=large is incompatible with
21842 -mindirect-branch=thunk nor -mindirect-branch=thunk-extern since
21843 the thunk function may not be reachable in large code model.
21844
21845 -mfunction-return=choice
21846 Convert function return with choice. The default is keep, which
21847 keeps function return unmodified. thunk converts function return
21848 to call and return thunk. thunk-inline converts function return to
21849 inlined call and return thunk. thunk-extern converts function
21850 return to external call and return thunk provided in a separate
21851 object file. You can control this behavior for a specific function
21852 by using the function attribute "function_return".
21853
21854 Note that -mcmodel=large is incompatible with
21855 -mfunction-return=thunk nor -mfunction-return=thunk-extern since
21856 the thunk function may not be reachable in large code model.
21857
21858 -mindirect-branch-register
21859 Force indirect call and jump via register.
21860
21861 These -m switches are supported in addition to the above on x86-64
21862 processors in 64-bit environments.
21863
21864 -m32
21865 -m64
21866 -mx32
21867 -m16
21868 -miamcu
21869 Generate code for a 16-bit, 32-bit or 64-bit environment. The -m32
21870 option sets "int", "long", and pointer types to 32 bits, and
21871 generates code that runs on any i386 system.
21872
21873 The -m64 option sets "int" to 32 bits and "long" and pointer types
21874 to 64 bits, and generates code for the x86-64 architecture. For
21875 Darwin only the -m64 option also turns off the -fno-pic and
21876 -mdynamic-no-pic options.
21877
21878 The -mx32 option sets "int", "long", and pointer types to 32 bits,
21879 and generates code for the x86-64 architecture.
21880
21881 The -m16 option is the same as -m32, except for that it outputs the
21882 ".code16gcc" assembly directive at the beginning of the assembly
21883 output so that the binary can run in 16-bit mode.
21884
21885 The -miamcu option generates code which conforms to Intel MCU
21886 psABI. It requires the -m32 option to be turned on.
21887
21888 -mno-red-zone
21889 Do not use a so-called "red zone" for x86-64 code. The red zone is
21890 mandated by the x86-64 ABI; it is a 128-byte area beyond the
21891 location of the stack pointer that is not modified by signal or
21892 interrupt handlers and therefore can be used for temporary data
21893 without adjusting the stack pointer. The flag -mno-red-zone
21894 disables this red zone.
21895
21896 -mcmodel=small
21897 Generate code for the small code model: the program and its symbols
21898 must be linked in the lower 2 GB of the address space. Pointers
21899 are 64 bits. Programs can be statically or dynamically linked.
21900 This is the default code model.
21901
21902 -mcmodel=kernel
21903 Generate code for the kernel code model. The kernel runs in the
21904 negative 2 GB of the address space. This model has to be used for
21905 Linux kernel code.
21906
21907 -mcmodel=medium
21908 Generate code for the medium model: the program is linked in the
21909 lower 2 GB of the address space. Small symbols are also placed
21910 there. Symbols with sizes larger than -mlarge-data-threshold are
21911 put into large data or BSS sections and can be located above 2GB.
21912 Programs can be statically or dynamically linked.
21913
21914 -mcmodel=large
21915 Generate code for the large model. This model makes no assumptions
21916 about addresses and sizes of sections.
21917
21918 -maddress-mode=long
21919 Generate code for long address mode. This is only supported for
21920 64-bit and x32 environments. It is the default address mode for
21921 64-bit environments.
21922
21923 -maddress-mode=short
21924 Generate code for short address mode. This is only supported for
21925 32-bit and x32 environments. It is the default address mode for
21926 32-bit and x32 environments.
21927
21928 x86 Windows Options
21929
21930 These additional options are available for Microsoft Windows targets:
21931
21932 -mconsole
21933 This option specifies that a console application is to be
21934 generated, by instructing the linker to set the PE header subsystem
21935 type required for console applications. This option is available
21936 for Cygwin and MinGW targets and is enabled by default on those
21937 targets.
21938
21939 -mdll
21940 This option is available for Cygwin and MinGW targets. It
21941 specifies that a DLL---a dynamic link library---is to be generated,
21942 enabling the selection of the required runtime startup object and
21943 entry point.
21944
21945 -mnop-fun-dllimport
21946 This option is available for Cygwin and MinGW targets. It
21947 specifies that the "dllimport" attribute should be ignored.
21948
21949 -mthread
21950 This option is available for MinGW targets. It specifies that
21951 MinGW-specific thread support is to be used.
21952
21953 -municode
21954 This option is available for MinGW-w64 targets. It causes the
21955 "UNICODE" preprocessor macro to be predefined, and chooses Unicode-
21956 capable runtime startup code.
21957
21958 -mwin32
21959 This option is available for Cygwin and MinGW targets. It
21960 specifies that the typical Microsoft Windows predefined macros are
21961 to be set in the pre-processor, but does not influence the choice
21962 of runtime library/startup code.
21963
21964 -mwindows
21965 This option is available for Cygwin and MinGW targets. It
21966 specifies that a GUI application is to be generated by instructing
21967 the linker to set the PE header subsystem type appropriately.
21968
21969 -fno-set-stack-executable
21970 This option is available for MinGW targets. It specifies that the
21971 executable flag for the stack used by nested functions isn't set.
21972 This is necessary for binaries running in kernel mode of Microsoft
21973 Windows, as there the User32 API, which is used to set executable
21974 privileges, isn't available.
21975
21976 -fwritable-relocated-rdata
21977 This option is available for MinGW and Cygwin targets. It
21978 specifies that relocated-data in read-only section is put into the
21979 ".data" section. This is a necessary for older runtimes not
21980 supporting modification of ".rdata" sections for pseudo-relocation.
21981
21982 -mpe-aligned-commons
21983 This option is available for Cygwin and MinGW targets. It
21984 specifies that the GNU extension to the PE file format that permits
21985 the correct alignment of COMMON variables should be used when
21986 generating code. It is enabled by default if GCC detects that the
21987 target assembler found during configuration supports the feature.
21988
21989 See also under x86 Options for standard options.
21990
21991 Xstormy16 Options
21992
21993 These options are defined for Xstormy16:
21994
21995 -msim
21996 Choose startup files and linker script suitable for the simulator.
21997
21998 Xtensa Options
21999
22000 These options are supported for Xtensa targets:
22001
22002 -mconst16
22003 -mno-const16
22004 Enable or disable use of "CONST16" instructions for loading
22005 constant values. The "CONST16" instruction is currently not a
22006 standard option from Tensilica. When enabled, "CONST16"
22007 instructions are always used in place of the standard "L32R"
22008 instructions. The use of "CONST16" is enabled by default only if
22009 the "L32R" instruction is not available.
22010
22011 -mfused-madd
22012 -mno-fused-madd
22013 Enable or disable use of fused multiply/add and multiply/subtract
22014 instructions in the floating-point option. This has no effect if
22015 the floating-point option is not also enabled. Disabling fused
22016 multiply/add and multiply/subtract instructions forces the compiler
22017 to use separate instructions for the multiply and add/subtract
22018 operations. This may be desirable in some cases where strict IEEE
22019 754-compliant results are required: the fused multiply add/subtract
22020 instructions do not round the intermediate result, thereby
22021 producing results with more bits of precision than specified by the
22022 IEEE standard. Disabling fused multiply add/subtract instructions
22023 also ensures that the program output is not sensitive to the
22024 compiler's ability to combine multiply and add/subtract operations.
22025
22026 -mserialize-volatile
22027 -mno-serialize-volatile
22028 When this option is enabled, GCC inserts "MEMW" instructions before
22029 "volatile" memory references to guarantee sequential consistency.
22030 The default is -mserialize-volatile. Use -mno-serialize-volatile
22031 to omit the "MEMW" instructions.
22032
22033 -mforce-no-pic
22034 For targets, like GNU/Linux, where all user-mode Xtensa code must
22035 be position-independent code (PIC), this option disables PIC for
22036 compiling kernel code.
22037
22038 -mtext-section-literals
22039 -mno-text-section-literals
22040 These options control the treatment of literal pools. The default
22041 is -mno-text-section-literals, which places literals in a separate
22042 section in the output file. This allows the literal pool to be
22043 placed in a data RAM/ROM, and it also allows the linker to combine
22044 literal pools from separate object files to remove redundant
22045 literals and improve code size. With -mtext-section-literals, the
22046 literals are interspersed in the text section in order to keep them
22047 as close as possible to their references. This may be necessary
22048 for large assembly files. Literals for each function are placed
22049 right before that function.
22050
22051 -mauto-litpools
22052 -mno-auto-litpools
22053 These options control the treatment of literal pools. The default
22054 is -mno-auto-litpools, which places literals in a separate section
22055 in the output file unless -mtext-section-literals is used. With
22056 -mauto-litpools the literals are interspersed in the text section
22057 by the assembler. Compiler does not produce explicit ".literal"
22058 directives and loads literals into registers with "MOVI"
22059 instructions instead of "L32R" to let the assembler do relaxation
22060 and place literals as necessary. This option allows assembler to
22061 create several literal pools per function and assemble very big
22062 functions, which may not be possible with -mtext-section-literals.
22063
22064 -mtarget-align
22065 -mno-target-align
22066 When this option is enabled, GCC instructs the assembler to
22067 automatically align instructions to reduce branch penalties at the
22068 expense of some code density. The assembler attempts to widen
22069 density instructions to align branch targets and the instructions
22070 following call instructions. If there are not enough preceding
22071 safe density instructions to align a target, no widening is
22072 performed. The default is -mtarget-align. These options do not
22073 affect the treatment of auto-aligned instructions like "LOOP",
22074 which the assembler always aligns, either by widening density
22075 instructions or by inserting NOP instructions.
22076
22077 -mlongcalls
22078 -mno-longcalls
22079 When this option is enabled, GCC instructs the assembler to
22080 translate direct calls to indirect calls unless it can determine
22081 that the target of a direct call is in the range allowed by the
22082 call instruction. This translation typically occurs for calls to
22083 functions in other source files. Specifically, the assembler
22084 translates a direct "CALL" instruction into an "L32R" followed by a
22085 "CALLX" instruction. The default is -mno-longcalls. This option
22086 should be used in programs where the call target can potentially be
22087 out of range. This option is implemented in the assembler, not the
22088 compiler, so the assembly code generated by GCC still shows direct
22089 call instructions---look at the disassembled object code to see the
22090 actual instructions. Note that the assembler uses an indirect call
22091 for every cross-file call, not just those that really are out of
22092 range.
22093
22094 zSeries Options
22095
22096 These are listed under
22097
22099 This section describes several environment variables that affect how
22100 GCC operates. Some of them work by specifying directories or prefixes
22101 to use when searching for various kinds of files. Some are used to
22102 specify other aspects of the compilation environment.
22103
22104 Note that you can also specify places to search using options such as
22105 -B, -I and -L. These take precedence over places specified using
22106 environment variables, which in turn take precedence over those
22107 specified by the configuration of GCC.
22108
22109 LANG
22110 LC_CTYPE
22111 LC_MESSAGES
22112 LC_ALL
22113 These environment variables control the way that GCC uses
22114 localization information which allows GCC to work with different
22115 national conventions. GCC inspects the locale categories LC_CTYPE
22116 and LC_MESSAGES if it has been configured to do so. These locale
22117 categories can be set to any value supported by your installation.
22118 A typical value is en_GB.UTF-8 for English in the United Kingdom
22119 encoded in UTF-8.
22120
22121 The LC_CTYPE environment variable specifies character
22122 classification. GCC uses it to determine the character boundaries
22123 in a string; this is needed for some multibyte encodings that
22124 contain quote and escape characters that are otherwise interpreted
22125 as a string end or escape.
22126
22127 The LC_MESSAGES environment variable specifies the language to use
22128 in diagnostic messages.
22129
22130 If the LC_ALL environment variable is set, it overrides the value
22131 of LC_CTYPE and LC_MESSAGES; otherwise, LC_CTYPE and LC_MESSAGES
22132 default to the value of the LANG environment variable. If none of
22133 these variables are set, GCC defaults to traditional C English
22134 behavior.
22135
22136 TMPDIR
22137 If TMPDIR is set, it specifies the directory to use for temporary
22138 files. GCC uses temporary files to hold the output of one stage of
22139 compilation which is to be used as input to the next stage: for
22140 example, the output of the preprocessor, which is the input to the
22141 compiler proper.
22142
22143 GCC_COMPARE_DEBUG
22144 Setting GCC_COMPARE_DEBUG is nearly equivalent to passing
22145 -fcompare-debug to the compiler driver. See the documentation of
22146 this option for more details.
22147
22148 GCC_EXEC_PREFIX
22149 If GCC_EXEC_PREFIX is set, it specifies a prefix to use in the
22150 names of the subprograms executed by the compiler. No slash is
22151 added when this prefix is combined with the name of a subprogram,
22152 but you can specify a prefix that ends with a slash if you wish.
22153
22154 If GCC_EXEC_PREFIX is not set, GCC attempts to figure out an
22155 appropriate prefix to use based on the pathname it is invoked with.
22156
22157 If GCC cannot find the subprogram using the specified prefix, it
22158 tries looking in the usual places for the subprogram.
22159
22160 The default value of GCC_EXEC_PREFIX is prefix/lib/gcc/ where
22161 prefix is the prefix to the installed compiler. In many cases
22162 prefix is the value of "prefix" when you ran the configure script.
22163
22164 Other prefixes specified with -B take precedence over this prefix.
22165
22166 This prefix is also used for finding files such as crt0.o that are
22167 used for linking.
22168
22169 In addition, the prefix is used in an unusual way in finding the
22170 directories to search for header files. For each of the standard
22171 directories whose name normally begins with /usr/local/lib/gcc
22172 (more precisely, with the value of GCC_INCLUDE_DIR), GCC tries
22173 replacing that beginning with the specified prefix to produce an
22174 alternate directory name. Thus, with -Bfoo/, GCC searches foo/bar
22175 just before it searches the standard directory /usr/local/lib/bar.
22176 If a standard directory begins with the configured prefix then the
22177 value of prefix is replaced by GCC_EXEC_PREFIX when looking for
22178 header files.
22179
22180 COMPILER_PATH
22181 The value of COMPILER_PATH is a colon-separated list of
22182 directories, much like PATH. GCC tries the directories thus
22183 specified when searching for subprograms, if it cannot find the
22184 subprograms using GCC_EXEC_PREFIX.
22185
22186 LIBRARY_PATH
22187 The value of LIBRARY_PATH is a colon-separated list of directories,
22188 much like PATH. When configured as a native compiler, GCC tries
22189 the directories thus specified when searching for special linker
22190 files, if it cannot find them using GCC_EXEC_PREFIX. Linking using
22191 GCC also uses these directories when searching for ordinary
22192 libraries for the -l option (but directories specified with -L come
22193 first).
22194
22195 LANG
22196 This variable is used to pass locale information to the compiler.
22197 One way in which this information is used is to determine the
22198 character set to be used when character literals, string literals
22199 and comments are parsed in C and C++. When the compiler is
22200 configured to allow multibyte characters, the following values for
22201 LANG are recognized:
22202
22203 C-JIS
22204 Recognize JIS characters.
22205
22206 C-SJIS
22207 Recognize SJIS characters.
22208
22209 C-EUCJP
22210 Recognize EUCJP characters.
22211
22212 If LANG is not defined, or if it has some other value, then the
22213 compiler uses "mblen" and "mbtowc" as defined by the default locale
22214 to recognize and translate multibyte characters.
22215
22216 Some additional environment variables affect the behavior of the
22217 preprocessor.
22218
22219 CPATH
22220 C_INCLUDE_PATH
22221 CPLUS_INCLUDE_PATH
22222 OBJC_INCLUDE_PATH
22223 Each variable's value is a list of directories separated by a
22224 special character, much like PATH, in which to look for header
22225 files. The special character, "PATH_SEPARATOR", is target-
22226 dependent and determined at GCC build time. For Microsoft Windows-
22227 based targets it is a semicolon, and for almost all other targets
22228 it is a colon.
22229
22230 CPATH specifies a list of directories to be searched as if
22231 specified with -I, but after any paths given with -I options on the
22232 command line. This environment variable is used regardless of
22233 which language is being preprocessed.
22234
22235 The remaining environment variables apply only when preprocessing
22236 the particular language indicated. Each specifies a list of
22237 directories to be searched as if specified with -isystem, but after
22238 any paths given with -isystem options on the command line.
22239
22240 In all these variables, an empty element instructs the compiler to
22241 search its current working directory. Empty elements can appear at
22242 the beginning or end of a path. For instance, if the value of
22243 CPATH is ":/special/include", that has the same effect as
22244 -I. -I/special/include.
22245
22246 DEPENDENCIES_OUTPUT
22247 If this variable is set, its value specifies how to output
22248 dependencies for Make based on the non-system header files
22249 processed by the compiler. System header files are ignored in the
22250 dependency output.
22251
22252 The value of DEPENDENCIES_OUTPUT can be just a file name, in which
22253 case the Make rules are written to that file, guessing the target
22254 name from the source file name. Or the value can have the form
22255 file target, in which case the rules are written to file file using
22256 target as the target name.
22257
22258 In other words, this environment variable is equivalent to
22259 combining the options -MM and -MF, with an optional -MT switch too.
22260
22261 SUNPRO_DEPENDENCIES
22262 This variable is the same as DEPENDENCIES_OUTPUT (see above),
22263 except that system header files are not ignored, so it implies -M
22264 rather than -MM. However, the dependence on the main input file is
22265 omitted.
22266
22267 SOURCE_DATE_EPOCH
22268 If this variable is set, its value specifies a UNIX timestamp to be
22269 used in replacement of the current date and time in the "__DATE__"
22270 and "__TIME__" macros, so that the embedded timestamps become
22271 reproducible.
22272
22273 The value of SOURCE_DATE_EPOCH must be a UNIX timestamp, defined as
22274 the number of seconds (excluding leap seconds) since 01 Jan 1970
22275 00:00:00 represented in ASCII; identical to the output of
22276 @command{date +%s} on GNU/Linux and other systems that support the
22277 %s extension in the "date" command.
22278
22279 The value should be a known timestamp such as the last modification
22280 time of the source or package and it should be set by the build
22281 process.
22282
22284 For instructions on reporting bugs, see <https://bugzilla.redhat.com/>.
22285
22287 1. On some systems, gcc -shared needs to build supplementary stub code
22288 for constructors to work. On multi-libbed systems, gcc -shared
22289 must select the correct support libraries to link against. Failing
22290 to supply the correct flags may lead to subtle defects. Supplying
22291 them in cases where they are not necessary is innocuous.
22292
22294 gpl(7), gfdl(7), fsf-funding(7), cpp(1), gcov(1), as(1), ld(1), gdb(1),
22295 adb(1), dbx(1), sdb(1) and the Info entries for gcc, cpp, as, ld,
22296 binutils and gdb.
22297
22299 See the Info entry for gcc, or
22300 <http://gcc.gnu.org/onlinedocs/gcc/Contributors.html>, for contributors
22301 to GCC.
22302
22304 Copyright (c) 1988-2017 Free Software Foundation, Inc.
22305
22306 Permission is granted to copy, distribute and/or modify this document
22307 under the terms of the GNU Free Documentation License, Version 1.3 or
22308 any later version published by the Free Software Foundation; with the
22309 Invariant Sections being "GNU General Public License" and "Funding Free
22310 Software", the Front-Cover texts being (a) (see below), and with the
22311 Back-Cover Texts being (b) (see below). A copy of the license is
22312 included in the gfdl(7) man page.
22313
22314 (a) The FSF's Front-Cover Text is:
22315
22316 A GNU Manual
22317
22318 (b) The FSF's Back-Cover Text is:
22319
22320 You have freedom to copy and modify this GNU Manual, like GNU
22321 software. Copies published by the Free Software Foundation raise
22322 funds for GNU development.
22323
22324
22325
22326gcc-7.4.0 2018-12-06 GCC(1)