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...] [-pedantic]
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 stage of processing. Some options
28 control the preprocessor and others the compiler itself. Yet other
29 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 gcc program accepts options and file names as operands. Many
39 options have multi-letter names; therefore multiple single-letter
40 options may not be grouped: -dv is very different from -d -v.
41
42 You can mix options and other arguments. For the most part, the order
43 you use doesn't matter. Order does matter when you use several options
44 of the same kind; for example, if you specify -L more than once, the
45 directories are searched in the order specified. Also, the placement
46 of the -l option is significant.
47
48 Many options have long names starting with -f or with -W---for example,
49 -fmove-loop-invariants, -Wformat and so on. Most of these have both
50 positive and negative forms; the negative form of -ffoo would be
51 -fno-foo. This manual documents only one of these two forms, whichever
52 one is not the default.
53
55 Option Summary
56 Here is a summary of all the options, grouped by type. Explanations
57 are in the following sections.
58
59 Overall Options
60 -c -S -E -o file -combine -no-canonical-prefixes -pipe
61 -pass-exit-codes -x language -v -### --help[=class[,...]]
62 --target-help --version -wrapper@file -fplugin=file
63 -fplugin-arg-name=arg
64
65 C Language Options
66 -ansi -std=standard -fgnu89-inline -aux-info filename -fno-asm
67 -fno-builtin -fno-builtin-function -fhosted -ffreestanding
68 -fopenmp -fms-extensions -trigraphs -no-integrated-cpp
69 -traditional -traditional-cpp -fallow-single-precision
70 -fcond-mismatch -flax-vector-conversions -fsigned-bitfields
71 -fsigned-char -funsigned-bitfields -funsigned-char
72
73 C++ Language Options
74 -fabi-version=n -fno-access-control -fcheck-new -fconserve-space
75 -ffriend-injection -fno-elide-constructors -fno-enforce-eh-specs
76 -ffor-scope -fno-for-scope -fno-gnu-keywords
77 -fno-implicit-templates -fno-implicit-inline-templates
78 -fno-implement-inlines -fms-extensions -fno-nonansi-builtins
79 -fno-operator-names -fno-optional-diags -fpermissive
80 -fno-pretty-templates -frepo -fno-rtti -fstats
81 -ftemplate-depth=n -fno-threadsafe-statics -fuse-cxa-atexit
82 -fno-weak -nostdinc++ -fno-default-inline
83 -fvisibility-inlines-hidden -fvisibility-ms-compat -Wabi
84 -Wconversion-null -Wctor-dtor-privacy -Wnon-virtual-dtor
85 -Wreorder -Weffc++ -Wstrict-null-sentinel -Wno-non-template-friend
86 -Wold-style-cast -Woverloaded-virtual -Wno-pmf-conversions
87 -Wsign-promo
88
89 Objective-C and Objective-C++ Language Options
90 -fconstant-string-class=class-name -fgnu-runtime -fnext-runtime
91 -fno-nil-receivers -fobjc-call-cxx-cdtors -fobjc-direct-dispatch
92 -fobjc-exceptions -fobjc-gc -freplace-objc-classes -fzero-link
93 -gen-decls -Wassign-intercept -Wno-protocol -Wselector
94 -Wstrict-selector-match -Wundeclared-selector
95
96 Language Independent Options
97 -fmessage-length=n -fdiagnostics-show-location=[once|every-line]
98 -fdiagnostics-show-option
99
100 Warning Options
101 -fsyntax-only -pedantic -pedantic-errors -w -Wextra -Wall
102 -Waddress -Waggregate-return -Warray-bounds -Wno-attributes
103 -Wno-builtin-macro-redefined -Wc++-compat -Wc++0x-compat
104 -Wcast-align -Wcast-qual -Wchar-subscripts -Wclobbered -Wcomment
105 -Wconversion -Wcoverage-mismatch -Wno-deprecated
106 -Wno-deprecated-declarations -Wdisabled-optimization
107 -Wno-div-by-zero -Wempty-body -Wenum-compare -Wno-endif-labels
108 -Werror -Werror=* -Wfatal-errors -Wfloat-equal -Wformat
109 -Wformat=2 -Wno-format-contains-nul -Wno-format-extra-args
110 -Wformat-nonliteral -Wformat-security -Wformat-y2k
111 -Wframe-larger-than=len -Wjump-misses-init -Wignored-qualifiers
112 -Wimplicit -Wimplicit-function-declaration -Wimplicit-int
113 -Winit-self -Winline -Wno-int-to-pointer-cast
114 -Wno-invalid-offsetof -Winvalid-pch -Wlarger-than=len
115 -Wunsafe-loop-optimizations -Wlogical-op -Wlong-long -Wmain
116 -Wmissing-braces -Wmissing-field-initializers
117 -Wmissing-format-attribute -Wmissing-include-dirs
118 -Wmissing-noreturn -Wno-mudflap -Wno-multichar -Wnonnull
119 -Wno-overflow -Woverlength-strings -Wpacked
120 -Wpacked-bitfield-compat -Wpadded -Wparentheses
121 -Wpedantic-ms-format -Wno-pedantic-ms-format -Wpointer-arith
122 -Wno-pointer-to-int-cast -Wredundant-decls -Wreturn-type
123 -Wsequence-point -Wshadow -Wsign-compare -Wsign-conversion
124 -Wstack-protector -Wstrict-aliasing -Wstrict-aliasing=n
125 -Wstrict-overflow -Wstrict-overflow=n -Wswitch -Wswitch-default
126 -Wswitch-enum -Wsync-nand -Wsystem-headers -Wtrigraphs
127 -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas
128 -Wno-pragmas -Wunsuffixed-float-constants -Wunused
129 -Wunused-function -Wunused-label -Wunused-parameter
130 -Wno-unused-result -Wunused-value -Wunused-variable
131 -Wvariadic-macros -Wvla -Wvolatile-register-var -Wwrite-strings
132
133 C and Objective-C-only Warning Options
134 -Wbad-function-cast -Wmissing-declarations
135 -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs
136 -Wold-style-declaration -Wold-style-definition -Wstrict-prototypes
137 -Wtraditional -Wtraditional-conversion
138 -Wdeclaration-after-statement -Wpointer-sign
139
140 Debugging Options
141 -dletters -dumpspecs -dumpmachine -dumpversion -fdbg-cnt-list
142 -fdbg-cnt=counter-value-list -fdump-noaddr -fdump-unnumbered
143 -fdump-unnumbered-links -fdump-translation-unit[-n]
144 -fdump-class-hierarchy[-n] -fdump-ipa-all -fdump-ipa-cgraph
145 -fdump-ipa-inline -fdump-statistics -fdump-tree-all
146 -fdump-tree-original[-n] -fdump-tree-optimized[-n] -fdump-tree-cfg
147 -fdump-tree-vcg -fdump-tree-alias -fdump-tree-ch
148 -fdump-tree-ssa[-n] -fdump-tree-pre[-n] -fdump-tree-ccp[-n]
149 -fdump-tree-dce[-n] -fdump-tree-gimple[-raw]
150 -fdump-tree-mudflap[-n] -fdump-tree-dom[-n] -fdump-tree-dse[-n]
151 -fdump-tree-phiprop[-n] -fdump-tree-phiopt[-n]
152 -fdump-tree-forwprop[-n] -fdump-tree-copyrename[-n] -fdump-tree-nrv
153 -fdump-tree-vect -fdump-tree-sink -fdump-tree-sra[-n]
154 -fdump-tree-forwprop[-n] -fdump-tree-fre[-n] -fdump-tree-vrp[-n]
155 -ftree-vectorizer-verbose=n -fdump-tree-storeccp[-n]
156 -fdump-final-insns=file -fcompare-debug[=opts]
157 -fcompare-debug-second -feliminate-dwarf2-dups
158 -feliminate-unused-debug-types -feliminate-unused-debug-symbols
159 -femit-class-debug-always -fenable-icf-debug -fmem-report
160 -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs
161 -frandom-seed=string -fsched-verbose=n -fsel-sched-verbose
162 -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose -ftest-coverage
163 -ftime-report -fvar-tracking -fvar-tracking-assignments
164 -fvar-tracking-assignments-toggle -g -glevel -gtoggle -gcoff
165 -gdwarf-version -ggdb -gstabs -gstabs+ -gstrict-dwarf
166 -gno-strict-dwarf -gvms -gxcoff -gxcoff+ -fno-merge-debug-strings
167 -fno-dwarf2-cfi-asm -fdebug-prefix-map=old=new
168 -femit-struct-debug-baseonly -femit-struct-debug-reduced
169 -femit-struct-debug-detailed[=spec-list] -p -pg
170 -print-file-name=library -print-libgcc-file-name
171 -print-multi-directory -print-multi-lib -print-multi-os-directory
172 -print-prog-name=program -print-search-dirs -Q -print-sysroot
173 -print-sysroot-headers-suffix -save-temps -save-temps=cwd
174 -save-temps=obj -time[=file]
175
176 Optimization Options
177 -falign-functions[=n] -falign-jumps[=n] -falign-labels[=n]
178 -falign-loops[=n] -fassociative-math -fauto-inc-dec
179 -fbranch-probabilities -fbranch-target-load-optimize
180 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves
181 -fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping
182 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules
183 -fcx-limited-range -fdata-sections -fdce -fdce -fdelayed-branch
184 -fdelete-null-pointer-checks -fdse -fdse -fearly-inlining -fipa-sra
185 -fexpensive-optimizations -ffast-math -ffinite-math-only
186 -ffloat-store -fexcess-precision=style -fforward-propagate
187 -ffunction-sections -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm
188 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining
189 -finline-functions -finline-functions-called-once -finline-limit=n
190 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg
191 -fipa-pta -fipa-pure-const -fipa-reference -fipa-struct-reorg
192 -fipa-type-escape -fira-algorithm=algorithm -fira-region=region
193 -fira-coalesce -fira-loop-pressure -fno-ira-share-save-slots
194 -fno-ira-share-spill-slots -fira-verbose=n -fivopts
195 -fkeep-inline-functions -fkeep-static-consts -floop-block
196 -floop-interchange -floop-strip-mine -fgraphite-identity
197 -floop-parallelize-all -flto -flto-compression-level -flto-report
198 -fltrans -fltrans-output-list -fmerge-all-constants
199 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves
200 -fmove-loop-invariants -fmudflap -fmudflapir -fmudflapth
201 -fno-branch-count-reg -fno-default-inline -fno-defer-pop
202 -fno-function-cse -fno-guess-branch-probability -fno-inline
203 -fno-math-errno -fno-peephole -fno-peephole2 -fno-sched-interblock
204 -fno-sched-spec -fno-signed-zeros -fno-toplevel-reorder
205 -fno-trapping-math -fno-zero-initialized-in-bss
206 -fomit-frame-pointer -foptimize-register-move
207 -foptimize-sibling-calls -fpeel-loops -fpredictive-commoning
208 -fprefetch-loop-arrays -fprofile-correction -fprofile-dir=path
209 -fprofile-generate -fprofile-generate=path -fprofile-use
210 -fprofile-use=path -fprofile-values -freciprocal-math -fregmove
211 -frename-registers -freorder-blocks -freorder-blocks-and-partition
212 -freorder-functions -frerun-cse-after-loop
213 -freschedule-modulo-scheduled-loops -frounding-math
214 -fsched2-use-superblocks -fsched-pressure -fsched-spec-load
215 -fsched-spec-load-dangerous -fsched-stalled-insns-dep[=n]
216 -fsched-stalled-insns[=n] -fsched-group-heuristic
217 -fsched-critical-path-heuristic -fsched-spec-insn-heuristic
218 -fsched-rank-heuristic -fsched-last-insn-heuristic
219 -fsched-dep-count-heuristic -fschedule-insns -fschedule-insns2
220 -fsection-anchors -fselective-scheduling -fselective-scheduling2
221 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops
222 -fsignaling-nans -fsingle-precision-constant
223 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector
224 -fstack-protector-all -fstrict-aliasing -fstrict-overflow
225 -fthread-jumps -ftracer -ftree-builtin-call-dce -ftree-ccp
226 -ftree-ch -ftree-copy-prop -ftree-copyrename -ftree-dce
227 -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre
228 -ftree-loop-im -ftree-phiprop -ftree-loop-distribution
229 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize
230 -ftree-parallelize-loops=n -ftree-pre -ftree-pta -ftree-reassoc
231 -ftree-sink -ftree-sra -ftree-switch-conversion -ftree-ter
232 -ftree-vect-loop-version -ftree-vectorize -ftree-vrp
233 -funit-at-a-time -funroll-all-loops -funroll-loops
234 -funsafe-loop-optimizations -funsafe-math-optimizations
235 -funswitch-loops -fvariable-expansion-in-unroller -fvect-cost-model
236 -fvpt -fweb -fwhole-program -fwhopr -fwpa -fuse-linker-plugin
237 --param name=value -O -O0 -O1 -O2 -O3 -Os
238
239 Preprocessor Options
240 -Aquestion=answer -A-question[=answer] -C -dD -dI -dM -dN
241 -Dmacro[=defn] -E -H -idirafter dir -include file -imacros file
242 -iprefix file -iwithprefix dir -iwithprefixbefore dir -isystem
243 dir -imultilib dir -isysroot dir -M -MM -MF -MG -MP -MQ -MT
244 -nostdinc -P -fworking-directory -remap -trigraphs -undef
245 -Umacro -Wp,option -Xpreprocessor option
246
247 Assembler Option
248 -Wa,option -Xassembler option
249
250 Linker Options
251 object-file-name -llibrary -nostartfiles -nodefaultlibs
252 -nostdlib -pie -rdynamic -s -static -static-libgcc
253 -static-libstdc++ -shared -shared-libgcc -symbolic -T script
254 -Wl,option -Xlinker option -u symbol
255
256 Directory Options
257 -Bprefix -Idir -iquotedir -Ldir -specs=file -I- --sysroot=dir
258
259 Target Options
260 -V version -b machine
261
262 Machine Dependent Options
263 ARC Options -EB -EL -mmangle-cpu -mcpu=cpu -mtext=text-section
264 -mdata=data-section -mrodata=readonly-data-section
265
266 ARM Options -mapcs-frame -mno-apcs-frame -mabi=name
267 -mapcs-stack-check -mno-apcs-stack-check -mapcs-float
268 -mno-apcs-float -mapcs-reentrant -mno-apcs-reentrant
269 -msched-prolog -mno-sched-prolog -mlittle-endian -mbig-endian
270 -mwords-little-endian -mfloat-abi=name -msoft-float -mhard-float
271 -mfpe -mfp16-format=name -mthumb-interwork -mno-thumb-interwork
272 -mcpu=name -march=name -mfpu=name -mstructure-size-boundary=n
273 -mabort-on-noreturn -mlong-calls -mno-long-calls -msingle-pic-base
274 -mno-single-pic-base -mpic-register=reg -mnop-fun-dllimport
275 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns
276 -mpoke-function-name -mthumb -marm -mtpcs-frame -mtpcs-leaf-frame
277 -mcaller-super-interworking -mcallee-super-interworking -mtp=name
278 -mword-relocations -mfix-cortex-m3-ldrd
279
280 AVR Options -mmcu=mcu -mno-interrupts -mcall-prologues
281 -mtiny-stack -mint8
282
283 Blackfin Options -mcpu=cpu[-sirevision] -msim
284 -momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer
285 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly
286 -mno-csync-anomaly -mlow-64k -mno-low64k -mstack-check-l1
287 -mid-shared-library -mno-id-shared-library -mshared-library-id=n
288 -mleaf-id-shared-library -mno-leaf-id-shared-library -msep-data
289 -mno-sep-data -mlong-calls -mno-long-calls -mfast-fp -minline-plt
290 -mmulticore -mcorea -mcoreb -msdram -micplb
291
292 CRIS Options -mcpu=cpu -march=cpu -mtune=cpu -mmax-stack-frame=n
293 -melinux-stacksize=n -metrax4 -metrax100 -mpdebug -mcc-init
294 -mno-side-effects -mstack-align -mdata-align -mconst-align
295 -m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt
296 -melf -maout -melinux -mlinux -sim -sim2 -mmul-bug-workaround
297 -mno-mul-bug-workaround
298
299 CRX Options -mmac -mpush-args
300
301 Darwin Options -all_load -allowable_client -arch
302 -arch_errors_fatal -arch_only -bind_at_load -bundle
303 -bundle_loader -client_name -compatibility_version
304 -current_version -dead_strip -dependency-file -dylib_file
305 -dylinker_install_name -dynamic -dynamiclib
306 -exported_symbols_list -filelist -flat_namespace
307 -force_cpusubtype_ALL -force_flat_namespace
308 -headerpad_max_install_names -iframework -image_base -init
309 -install_name -keep_private_externs -multi_module
310 -multiply_defined -multiply_defined_unused -noall_load
311 -no_dead_strip_inits_and_terms -nofixprebinding -nomultidefs
312 -noprebind -noseglinkedit -pagezero_size -prebind
313 -prebind_all_twolevel_modules -private_bundle -read_only_relocs
314 -sectalign -sectobjectsymbols -whyload -seg1addr -sectcreate
315 -sectobjectsymbols -sectorder -segaddr -segs_read_only_addr
316 -segs_read_write_addr -seg_addr_table -seg_addr_table_filename
317 -seglinkedit -segprot -segs_read_only_addr -segs_read_write_addr
318 -single_module -static -sub_library -sub_umbrella
319 -twolevel_namespace -umbrella -undefined -unexported_symbols_list
320 -weak_reference_mismatches -whatsloaded -F -gused -gfull
321 -mmacosx-version-min=version -mkernel -mone-byte-bool
322
323 DEC Alpha Options -mno-fp-regs -msoft-float -malpha-as -mgas
324 -mieee -mieee-with-inexact -mieee-conformant -mfp-trap-mode=mode
325 -mfp-rounding-mode=mode -mtrap-precision=mode -mbuild-constants
326 -mcpu=cpu-type -mtune=cpu-type -mbwx -mmax -mfix -mcix
327 -mfloat-vax -mfloat-ieee -mexplicit-relocs -msmall-data
328 -mlarge-data -msmall-text -mlarge-text -mmemory-latency=time
329
330 DEC Alpha/VMS Options -mvms-return-codes -mdebug-main=prefix
331 -mmalloc64
332
333 FR30 Options -msmall-model -mno-lsim
334
335 FRV Options -mgpr-32 -mgpr-64 -mfpr-32 -mfpr-64 -mhard-float
336 -msoft-float -malloc-cc -mfixed-cc -mdword -mno-dword -mdouble
337 -mno-double -mmedia -mno-media -mmuladd -mno-muladd -mfdpic
338 -minline-plt -mgprel-ro -multilib-library-pic -mlinked-fp
339 -mlong-calls -malign-labels -mlibrary-pic -macc-4 -macc-8 -mpack
340 -mno-pack -mno-eflags -mcond-move -mno-cond-move
341 -moptimize-membar -mno-optimize-membar -mscc -mno-scc -mcond-exec
342 -mno-cond-exec -mvliw-branch -mno-vliw-branch -mmulti-cond-exec
343 -mno-multi-cond-exec -mnested-cond-exec -mno-nested-cond-exec
344 -mtomcat-stats -mTLS -mtls -mcpu=cpu
345
346 GNU/Linux Options -muclibc
347
348 H8/300 Options -mrelax -mh -ms -mn -mint32 -malign-300
349
350 HPPA Options -march=architecture-type -mbig-switch
351 -mdisable-fpregs -mdisable-indexing -mfast-indirect-calls -mgas
352 -mgnu-ld -mhp-ld -mfixed-range=register-range -mjump-in-delay
353 -mlinker-opt -mlong-calls -mlong-load-store -mno-big-switch
354 -mno-disable-fpregs -mno-disable-indexing -mno-fast-indirect-calls
355 -mno-gas -mno-jump-in-delay -mno-long-load-store
356 -mno-portable-runtime -mno-soft-float -mno-space-regs
357 -msoft-float -mpa-risc-1-0 -mpa-risc-1-1 -mpa-risc-2-0
358 -mportable-runtime -mschedule=cpu-type -mspace-regs -msio -mwsio
359 -munix=unix-std -nolibdld -static -threads
360
361 i386 and x86-64 Options -mtune=cpu-type -march=cpu-type
362 -mfpmath=unit -masm=dialect -mno-fancy-math-387 -mno-fp-ret-in-387
363 -msoft-float -mno-wide-multiply -mrtd -malign-double
364 -mpreferred-stack-boundary=num -mincoming-stack-boundary=num -mcld
365 -mcx16 -msahf -mmovbe -mcrc32 -mrecip -mmmx -msse -msse2 -msse3
366 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx -maes -mpclmul -mfused-madd
367 -msse4a -m3dnow -mpopcnt -mabm -mfma4 -mxop -mlwp -mthreads
368 -mno-align-stringops -minline-all-stringops
369 -minline-stringops-dynamically -mstringop-strategy=alg -mpush-args
370 -maccumulate-outgoing-args -m128bit-long-double
371 -m96bit-long-double -mregparm=num -msseregparm -mveclibabi=type
372 -mpc32 -mpc64 -mpc80 -mstackrealign -momit-leaf-frame-pointer
373 -mno-red-zone -mno-tls-direct-seg-refs -mcmodel=code-model
374 -mabi=name -m32 -m64 -mlarge-data-threshold=num -msse2avx
375
376 IA-64 Options -mbig-endian -mlittle-endian -mgnu-as -mgnu-ld
377 -mno-pic -mvolatile-asm-stop -mregister-names -msdata -mno-sdata
378 -mconstant-gp -mauto-pic -mfused-madd
379 -minline-float-divide-min-latency
380 -minline-float-divide-max-throughput -mno-inline-float-divide
381 -minline-int-divide-min-latency -minline-int-divide-max-throughput
382 -mno-inline-int-divide -minline-sqrt-min-latency
383 -minline-sqrt-max-throughput -mno-inline-sqrt -mdwarf2-asm
384 -mearly-stop-bits -mfixed-range=register-range -mtls-size=tls-size
385 -mtune=cpu-type -milp32 -mlp64 -msched-br-data-spec
386 -msched-ar-data-spec -msched-control-spec -msched-br-in-data-spec
387 -msched-ar-in-data-spec -msched-in-control-spec -msched-spec-ldc
388 -msched-spec-control-ldc -msched-prefer-non-data-spec-insns
389 -msched-prefer-non-control-spec-insns
390 -msched-stop-bits-after-every-cycle
391 -msched-count-spec-in-critical-path
392 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost
393 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=max-
394 insns
395
396 IA-64/VMS Options -mvms-return-codes -mdebug-main=prefix -mmalloc64
397
398 LM32 Options -mbarrel-shift-enabled -mdivide-enabled
399 -mmultiply-enabled -msign-extend-enabled -muser-enabled
400
401 M32R/D Options -m32r2 -m32rx -m32r -mdebug -malign-loops
402 -mno-align-loops -missue-rate=number -mbranch-cost=number
403 -mmodel=code-size-model-type -msdata=sdata-type -mno-flush-func
404 -mflush-func=name -mno-flush-trap -mflush-trap=number -G num
405
406 M32C Options -mcpu=cpu -msim -memregs=number
407
408 M680x0 Options -march=arch -mcpu=cpu -mtune=tune -m68000 -m68020
409 -m68020-40 -m68020-60 -m68030 -m68040 -m68060 -mcpu32 -m5200
410 -m5206e -m528x -m5307 -m5407 -mcfv4e -mbitfield -mno-bitfield
411 -mc68000 -mc68020 -mnobitfield -mrtd -mno-rtd -mdiv -mno-div
412 -mshort -mno-short -mhard-float -m68881 -msoft-float -mpcrel
413 -malign-int -mstrict-align -msep-data -mno-sep-data
414 -mshared-library-id=n -mid-shared-library -mno-id-shared-library
415 -mxgot -mno-xgot
416
417 M68hc1x Options -m6811 -m6812 -m68hc11 -m68hc12 -m68hcs12
418 -mauto-incdec -minmax -mlong-calls -mshort
419 -msoft-reg-count=count
420
421 MCore Options -mhardlit -mno-hardlit -mdiv -mno-div
422 -mrelax-immediates -mno-relax-immediates -mwide-bitfields
423 -mno-wide-bitfields -m4byte-functions -mno-4byte-functions
424 -mcallgraph-data -mno-callgraph-data -mslow-bytes -mno-slow-bytes
425 -mno-lsim -mlittle-endian -mbig-endian -m210 -m340
426 -mstack-increment
427
428 MeP Options -mabsdiff -mall-opts -maverage -mbased=n -mbitops -mc=n
429 -mclip -mconfig=name -mcop -mcop32 -mcop64 -mivc2 -mdc -mdiv -meb
430 -mel -mio-volatile -ml -mleadz -mm -mminmax -mmult -mno-opts
431 -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf -mtiny=n
432
433 MIPS Options -EL -EB -march=arch -mtune=arch -mips1 -mips2
434 -mips3 -mips4 -mips32 -mips32r2 -mips64 -mips64r2 -mips16
435 -mno-mips16 -mflip-mips16 -minterlink-mips16
436 -mno-interlink-mips16 -mabi=abi -mabicalls -mno-abicalls -mshared
437 -mno-shared -mplt -mno-plt -mxgot -mno-xgot -mgp32 -mgp64
438 -mfp32 -mfp64 -mhard-float -msoft-float -msingle-float
439 -mdouble-float -mdsp -mno-dsp -mdspr2 -mno-dspr2 -mfpu=fpu-type
440 -msmartmips -mno-smartmips -mpaired-single -mno-paired-single
441 -mdmx -mno-mdmx -mips3d -mno-mips3d -mmt -mno-mt -mllsc
442 -mno-llsc -mlong64 -mlong32 -msym32 -mno-sym32 -Gnum
443 -mlocal-sdata -mno-local-sdata -mextern-sdata -mno-extern-sdata
444 -mgpopt -mno-gopt -membedded-data -mno-embedded-data
445 -muninit-const-in-rodata -mno-uninit-const-in-rodata
446 -mcode-readable=setting -msplit-addresses -mno-split-addresses
447 -mexplicit-relocs -mno-explicit-relocs -mcheck-zero-division
448 -mno-check-zero-division -mdivide-traps -mdivide-breaks -mmemcpy
449 -mno-memcpy -mlong-calls -mno-long-calls -mmad -mno-mad
450 -mfused-madd -mno-fused-madd -nocpp -mfix-r4000 -mno-fix-r4000
451 -mfix-r4400 -mno-fix-r4400 -mfix-r10000 -mno-fix-r10000
452 -mfix-vr4120 -mno-fix-vr4120 -mfix-vr4130 -mno-fix-vr4130
453 -mfix-sb1 -mno-fix-sb1 -mflush-func=func -mno-flush-func
454 -mbranch-cost=num -mbranch-likely -mno-branch-likely
455 -mfp-exceptions -mno-fp-exceptions -mvr4130-align -mno-vr4130-align
456 -msynci -mno-synci -mrelax-pic-calls -mno-relax-pic-calls
457 -mmcount-ra-address
458
459 MMIX Options -mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon
460 -mabi=gnu -mabi=mmixware -mzero-extend -mknuthdiv
461 -mtoplevel-symbols -melf -mbranch-predict -mno-branch-predict
462 -mbase-addresses -mno-base-addresses -msingle-exit
463 -mno-single-exit
464
465 MN10300 Options -mmult-bug -mno-mult-bug -mam33 -mno-am33
466 -mam33-2 -mno-am33-2 -mreturn-pointer-on-d0 -mno-crt0 -mrelax
467
468 PDP-11 Options -mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45
469 -m10 -mbcopy -mbcopy-builtin -mint32 -mno-int16 -mint16
470 -mno-int32 -mfloat32 -mno-float64 -mfloat64 -mno-float32
471 -mabshi -mno-abshi -mbranch-expensive -mbranch-cheap -msplit
472 -mno-split -munix-asm -mdec-asm
473
474 picoChip Options -mae=ae_type -mvliw-lookahead=N
475 -msymbol-as-address -mno-inefficient-warnings
476
477 PowerPC Options See RS/6000 and PowerPC Options.
478
479 RS/6000 and PowerPC Options -mcpu=cpu-type -mtune=cpu-type -mpower
480 -mno-power -mpower2 -mno-power2 -mpowerpc -mpowerpc64
481 -mno-powerpc -maltivec -mno-altivec -mpowerpc-gpopt
482 -mno-powerpc-gpopt -mpowerpc-gfxopt -mno-powerpc-gfxopt -mmfcrf
483 -mno-mfcrf -mpopcntb -mno-popcntb -mpopcntd -mno-popcntd -mfprnd
484 -mno-fprnd -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp
485 -mno-hard-dfp -mnew-mnemonics -mold-mnemonics -mfull-toc
486 -mminimal-toc -mno-fp-in-toc -mno-sum-in-toc -m64 -m32
487 -mxl-compat -mno-xl-compat -mpe -malign-power -malign-natural
488 -msoft-float -mhard-float -mmultiple -mno-multiple
489 -msingle-float -mdouble-float -msimple-fpu -mstring -mno-string
490 -mupdate -mno-update -mavoid-indexed-addresses
491 -mno-avoid-indexed-addresses -mfused-madd -mno-fused-madd
492 -mbit-align -mno-bit-align -mstrict-align -mno-strict-align
493 -mrelocatable -mno-relocatable -mrelocatable-lib
494 -mno-relocatable-lib -mtoc -mno-toc -mlittle -mlittle-endian
495 -mbig -mbig-endian -mdynamic-no-pic -maltivec -mswdiv
496 -mprioritize-restricted-insns=priority
497 -msched-costly-dep=dependence_type -minsert-sched-nops=scheme
498 -mcall-sysv -mcall-netbsd -maix-struct-return
499 -msvr4-struct-return -mabi=abi-type -msecure-plt -mbss-plt -misel
500 -mno-isel -misel=yes -misel=no -mspe -mno-spe -mspe=yes -mspe=no
501 -mpaired -mgen-cell-microcode -mwarn-cell-microcode -mvrsave
502 -mno-vrsave -mmulhw -mno-mulhw -mdlmzb -mno-dlmzb -mfloat-gprs=yes
503 -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double -mprototype
504 -mno-prototype -msim -mmvme -mads -myellowknife -memb -msdata
505 -msdata=opt -mvxworks -G num -pthread
506
507 RX Options -m64bit-doubles -m32bit-doubles -fpu -nofpu -mcpu=
508 -patch= -mbig-endian-data -mlittle-endian-data -msmall-data -msim
509 -mno-sim -mas100-syntax -mno-as100-syntax -mrelax
510 -mmax-constant-size= -mint-register= -msave-acc-in-interrupts
511
512 S/390 and zSeries Options -mtune=cpu-type -march=cpu-type
513 -mhard-float -msoft-float -mhard-dfp -mno-hard-dfp
514 -mlong-double-64 -mlong-double-128 -mbackchain -mno-backchain
515 -mpacked-stack -mno-packed-stack -msmall-exec -mno-small-exec
516 -mmvcle -mno-mvcle -m64 -m31 -mdebug -mno-debug -mesa -mzarch
517 -mtpf-trace -mno-tpf-trace -mfused-madd -mno-fused-madd
518 -mwarn-framesize -mwarn-dynamicstack -mstack-size -mstack-guard
519
520 Score Options -meb -mel -mnhwloop -muls -mmac -mscore5 -mscore5u
521 -mscore7 -mscore7d
522
523 SH Options -m1 -m2 -m2e -m2a-nofpu -m2a-single-only -m2a-single
524 -m2a -m3 -m3e -m4-nofpu -m4-single-only -m4-single -m4
525 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al -m5-64media
526 -m5-64media-nofpu -m5-32media -m5-32media-nofpu -m5-compact
527 -m5-compact-nofpu -mb -ml -mdalign -mrelax -mbigtable -mfmovd
528 -mhitachi -mrenesas -mno-renesas -mnomacsave -mieee -mbitops
529 -misize -minline-ic_invalidate -mpadstruct -mspace -mprefergot
530 -musermode -multcost=number -mdiv=strategy -mdivsi3_libfunc=name
531 -mfixed-range=register-range -madjust-unroll -mindexed-addressing
532 -mgettrcost=number -mpt-fixed -minvalid-symbols
533
534 SPARC Options -mcpu=cpu-type -mtune=cpu-type -mcmodel=code-model
535 -m32 -m64 -mapp-regs -mno-app-regs -mfaster-structs
536 -mno-faster-structs -mfpu -mno-fpu -mhard-float -msoft-float
537 -mhard-quad-float -msoft-quad-float -mimpure-text
538 -mno-impure-text -mlittle-endian -mstack-bias -mno-stack-bias
539 -munaligned-doubles -mno-unaligned-doubles -mv8plus -mno-v8plus
540 -mvis -mno-vis -threads -pthreads -pthread
541
542 SPU Options -mwarn-reloc -merror-reloc -msafe-dma -munsafe-dma
543 -mbranch-hints -msmall-mem -mlarge-mem -mstdmain
544 -mfixed-range=register-range -mea32 -mea64
545 -maddress-space-conversion -mno-address-space-conversion
546 -mcache-size=cache-size -matomic-updates -mno-atomic-updates
547
548 System V Options -Qy -Qn -YP,paths -Ym,dir
549
550 V850 Options -mlong-calls -mno-long-calls -mep -mno-ep
551 -mprolog-function -mno-prolog-function -mspace -mtda=n -msda=n
552 -mzda=n -mapp-regs -mno-app-regs -mdisable-callt
553 -mno-disable-callt -mv850e1 -mv850e -mv850 -mbig-switch
554
555 VAX Options -mg -mgnu -munix
556
557 VxWorks Options -mrtp -non-static -Bstatic -Bdynamic -Xbind-lazy
558 -Xbind-now
559
560 x86-64 Options See i386 and x86-64 Options.
561
562 i386 and x86-64 Windows Options -mconsole -mcygwin -mno-cygwin
563 -mdll -mnop-fun-dllimport -mthread -municode -mwin32 -mwindows
564 -fno-set-stack-executable
565
566 Xstormy16 Options -msim
567
568 Xtensa Options -mconst16 -mno-const16 -mfused-madd -mno-fused-madd
569 -mserialize-volatile -mno-serialize-volatile
570 -mtext-section-literals -mno-text-section-literals -mtarget-align
571 -mno-target-align -mlongcalls -mno-longcalls
572
573 zSeries Options See S/390 and zSeries Options.
574
575 Code Generation Options
576 -fcall-saved-reg -fcall-used-reg -ffixed-reg -fexceptions
577 -fnon-call-exceptions -funwind-tables -fasynchronous-unwind-tables
578 -finhibit-size-directive -finstrument-functions
579 -finstrument-functions-exclude-function-list=sym,sym,...
580 -finstrument-functions-exclude-file-list=file,file,... -fno-common
581 -fno-ident -fpcc-struct-return -fpic -fPIC -fpie -fPIE
582 -fno-jump-tables -frecord-gcc-switches -freg-struct-return
583 -fshort-enums -fshort-double -fshort-wchar -fverbose-asm
584 -fpack-struct[=n] -fstack-check -fstack-limit-register=reg
585 -fstack-limit-symbol=sym -fno-stack-limit -fargument-alias
586 -fargument-noalias -fargument-noalias-global
587 -fargument-noalias-anything -fleading-underscore -ftls-model=model
588 -ftrapv -fwrapv -fbounds-check -fvisibility
589
590 Options Controlling the Kind of Output
591 Compilation can involve up to four stages: preprocessing, compilation
592 proper, assembly and linking, always in that order. GCC is capable of
593 preprocessing and compiling several files either into several assembler
594 input files, or into one assembler input file; then each assembler
595 input file produces an object file, and linking combines all the object
596 files (those newly compiled, and those specified as input) into an
597 executable file.
598
599 For any given input file, the file name suffix determines what kind of
600 compilation is done:
601
602 file.c
603 C source code which must be preprocessed.
604
605 file.i
606 C source code which should not be preprocessed.
607
608 file.ii
609 C++ source code which should not be preprocessed.
610
611 file.m
612 Objective-C source code. Note that you must link with the libobjc
613 library to make an Objective-C program work.
614
615 file.mi
616 Objective-C source code which should not be preprocessed.
617
618 file.mm
619 file.M
620 Objective-C++ source code. Note that you must link with the
621 libobjc library to make an Objective-C++ program work. Note that
622 .M refers to a literal capital M.
623
624 file.mii
625 Objective-C++ source code which should not be preprocessed.
626
627 file.h
628 C, C++, Objective-C or Objective-C++ header file to be turned into
629 a precompiled header.
630
631 file.cc
632 file.cp
633 file.cxx
634 file.cpp
635 file.CPP
636 file.c++
637 file.C
638 C++ source code which must be preprocessed. Note that in .cxx, the
639 last two letters must both be literally x. Likewise, .C refers to
640 a literal capital C.
641
642 file.mm
643 file.M
644 Objective-C++ source code which must be preprocessed.
645
646 file.mii
647 Objective-C++ source code which should not be preprocessed.
648
649 file.hh
650 file.H
651 file.hp
652 file.hxx
653 file.hpp
654 file.HPP
655 file.h++
656 file.tcc
657 C++ header file to be turned into a precompiled header.
658
659 file.f
660 file.for
661 file.ftn
662 Fixed form Fortran source code which should not be preprocessed.
663
664 file.F
665 file.FOR
666 file.fpp
667 file.FPP
668 file.FTN
669 Fixed form Fortran source code which must be preprocessed (with the
670 traditional preprocessor).
671
672 file.f90
673 file.f95
674 file.f03
675 file.f08
676 Free form Fortran source code which should not be preprocessed.
677
678 file.F90
679 file.F95
680 file.F03
681 file.F08
682 Free form Fortran source code which must be preprocessed (with the
683 traditional preprocessor).
684
685 file.ads
686 Ada source code file which contains a library unit declaration (a
687 declaration of a package, subprogram, or generic, or a generic
688 instantiation), or a library unit renaming declaration (a package,
689 generic, or subprogram renaming declaration). Such files are also
690 called specs.
691
692 file.adb
693 Ada source code file containing a library unit body (a subprogram
694 or package body). Such files are also called bodies.
695
696 file.s
697 Assembler code.
698
699 file.S
700 file.sx
701 Assembler code which must be preprocessed.
702
703 other
704 An object file to be fed straight into linking. Any file name with
705 no recognized suffix is treated this way.
706
707 You can specify the input language explicitly with the -x option:
708
709 -x language
710 Specify explicitly the language for the following input files
711 (rather than letting the compiler choose a default based on the
712 file name suffix). This option applies to all following input
713 files until the next -x option. Possible values for language are:
714
715 c c-header c-cpp-output
716 c++ c++-header c++-cpp-output
717 objective-c objective-c-header objective-c-cpp-output
718 objective-c++ objective-c++-header objective-c++-cpp-output
719 assembler assembler-with-cpp
720 ada
721 f77 f77-cpp-input f95 f95-cpp-input
722 java
723
724 -x none
725 Turn off any specification of a language, so that subsequent files
726 are handled according to their file name suffixes (as they are if
727 -x has not been used at all).
728
729 -pass-exit-codes
730 Normally the gcc program will exit with the code of 1 if any phase
731 of the compiler returns a non-success return code. If you specify
732 -pass-exit-codes, the gcc program will instead return with
733 numerically highest error produced by any phase that returned an
734 error indication. The C, C++, and Fortran frontends return 4, if
735 an internal compiler error is encountered.
736
737 If you only want some of the stages of compilation, you can use -x (or
738 filename suffixes) to tell gcc where to start, and one of the options
739 -c, -S, or -E to say where gcc is to stop. Note that some combinations
740 (for example, -x cpp-output -E) instruct gcc to do nothing at all.
741
742 -c Compile or assemble the source files, but do not link. The linking
743 stage simply is not done. The ultimate output is in the form of an
744 object file for each source file.
745
746 By default, the object file name for a source file is made by
747 replacing the suffix .c, .i, .s, etc., with .o.
748
749 Unrecognized input files, not requiring compilation or assembly,
750 are ignored.
751
752 -S Stop after the stage of compilation proper; do not assemble. The
753 output is in the form of an assembler code file for each non-
754 assembler input file specified.
755
756 By default, the assembler file name for a source file is made by
757 replacing the suffix .c, .i, etc., with .s.
758
759 Input files that don't require compilation are ignored.
760
761 -E Stop after the preprocessing stage; do not run the compiler proper.
762 The output is in the form of preprocessed source code, which is
763 sent to the standard output.
764
765 Input files which don't require preprocessing are ignored.
766
767 -o file
768 Place output in file file. This applies regardless to whatever
769 sort of output is being produced, whether it be an executable file,
770 an object file, an assembler file or preprocessed C code.
771
772 If -o is not specified, the default is to put an executable file in
773 a.out, the object file for source.suffix in source.o, its assembler
774 file in source.s, a precompiled header file in source.suffix.gch,
775 and all preprocessed C source on standard output.
776
777 -v Print (on standard error output) the commands executed to run the
778 stages of compilation. Also print the version number of the
779 compiler driver program and of the preprocessor and the compiler
780 proper.
781
782 -###
783 Like -v except the commands are not executed and all command
784 arguments are quoted. This is useful for shell scripts to capture
785 the driver-generated command lines.
786
787 -pipe
788 Use pipes rather than temporary files for communication between the
789 various stages of compilation. This fails to work on some systems
790 where the assembler is unable to read from a pipe; but the GNU
791 assembler has no trouble.
792
793 -combine
794 If you are compiling multiple source files, this option tells the
795 driver to pass all the source files to the compiler at once (for
796 those languages for which the compiler can handle this). This will
797 allow intermodule analysis (IMA) to be performed by the compiler.
798 Currently the only language for which this is supported is C. If
799 you pass source files for multiple languages to the driver, using
800 this option, the driver will invoke the compiler(s) that support
801 IMA once each, passing each compiler all the source files
802 appropriate for it. For those languages that do not support IMA
803 this option will be ignored, and the compiler will be invoked once
804 for each source file in that language. If you use this option in
805 conjunction with -save-temps, the compiler will generate multiple
806 pre-processed files (one for each source file), but only one
807 (combined) .o or .s file.
808
809 --help
810 Print (on the standard output) a description of the command line
811 options understood by gcc. If the -v option is also specified then
812 --help will also be passed on to the various processes invoked by
813 gcc, so that they can display the command line options they accept.
814 If the -Wextra option has also been specified (prior to the --help
815 option), then command line options which have no documentation
816 associated with them will also be displayed.
817
818 --target-help
819 Print (on the standard output) a description of target-specific
820 command line options for each tool. For some targets extra target-
821 specific information may also be printed.
822
823 --help={class|[^]qualifier}[,...]
824 Print (on the standard output) a description of the command line
825 options understood by the compiler that fit into all specified
826 classes and qualifiers. These are the supported classes:
827
828 optimizers
829 This will display all of the optimization options supported by
830 the compiler.
831
832 warnings
833 This will display all of the options controlling warning
834 messages produced by the compiler.
835
836 target
837 This will display target-specific options. Unlike the
838 --target-help option however, target-specific options of the
839 linker and assembler will not be displayed. This is because
840 those tools do not currently support the extended --help=
841 syntax.
842
843 params
844 This will display the values recognized by the --param option.
845
846 language
847 This will display the options supported for language, where
848 language is the name of one of the languages supported in this
849 version of GCC.
850
851 common
852 This will display the options that are common to all languages.
853
854 These are the supported qualifiers:
855
856 undocumented
857 Display only those options which are undocumented.
858
859 joined
860 Display options which take an argument that appears after an
861 equal sign in the same continuous piece of text, such as:
862 --help=target.
863
864 separate
865 Display options which take an argument that appears as a
866 separate word following the original option, such as: -o
867 output-file.
868
869 Thus for example to display all the undocumented target-specific
870 switches supported by the compiler the following can be used:
871
872 --help=target,undocumented
873
874 The sense of a qualifier can be inverted by prefixing it with the ^
875 character, so for example to display all binary warning options
876 (i.e., ones that are either on or off and that do not take an
877 argument), which have a description the following can be used:
878
879 --help=warnings,^joined,^undocumented
880
881 The argument to --help= should not consist solely of inverted
882 qualifiers.
883
884 Combining several classes is possible, although this usually
885 restricts the output by so much that there is nothing to display.
886 One case where it does work however is when one of the classes is
887 target. So for example to display all the target-specific
888 optimization options the following can be used:
889
890 --help=target,optimizers
891
892 The --help= option can be repeated on the command line. Each
893 successive use will display its requested class of options,
894 skipping those that have already been displayed.
895
896 If the -Q option appears on the command line before the --help=
897 option, then the descriptive text displayed by --help= is changed.
898 Instead of describing the displayed options, an indication is given
899 as to whether the option is enabled, disabled or set to a specific
900 value (assuming that the compiler knows this at the point where the
901 --help= option is used).
902
903 Here is a truncated example from the ARM port of gcc:
904
905 % gcc -Q -mabi=2 --help=target -c
906 The following options are target specific:
907 -mabi= 2
908 -mabort-on-noreturn [disabled]
909 -mapcs [disabled]
910
911 The output is sensitive to the effects of previous command line
912 options, so for example it is possible to find out which
913 optimizations are enabled at -O2 by using:
914
915 -Q -O2 --help=optimizers
916
917 Alternatively you can discover which binary optimizations are
918 enabled by -O3 by using:
919
920 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
921 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
922 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
923
924 -no-canonical-prefixes
925 Do not expand any symbolic links, resolve references to /../ or
926 /./, or make the path absolute when generating a relative prefix.
927
928 --version
929 Display the version number and copyrights of the invoked GCC.
930
931 -wrapper
932 Invoke all subcommands under a wrapper program. It takes a single
933 comma separated list as an argument, which will be used to invoke
934 the wrapper:
935
936 gcc -c t.c -wrapper gdb,--args
937
938 This will invoke all subprograms of gcc under "gdb --args", thus
939 cc1 invocation will be "gdb --args cc1 ...".
940
941 -fplugin=name.so
942 Load the plugin code in file name.so, assumed to be a shared object
943 to be dlopen'd by the compiler. The base name of the shared object
944 file is used to identify the plugin for the purposes of argument
945 parsing (See -fplugin-arg-name-key=value below). Each plugin
946 should define the callback functions specified in the Plugins API.
947
948 -fplugin-arg-name-key=value
949 Define an argument called key with a value of value for the plugin
950 called name.
951
952 @file
953 Read command-line options from file. The options read are inserted
954 in place of the original @file option. If file does not exist, or
955 cannot be read, then the option will be treated literally, and not
956 removed.
957
958 Options in file are separated by whitespace. A whitespace
959 character may be included in an option by surrounding the entire
960 option in either single or double quotes. Any character (including
961 a backslash) may be included by prefixing the character to be
962 included with a backslash. The file may itself contain additional
963 @file options; any such options will be processed recursively.
964
965 Compiling C++ Programs
966 C++ source files conventionally use one of the suffixes .C, .cc, .cpp,
967 .CPP, .c++, .cp, or .cxx; C++ header files often use .hh, .hpp, .H, or
968 (for shared template code) .tcc; and preprocessed C++ files use the
969 suffix .ii. GCC recognizes files with these names and compiles them as
970 C++ programs even if you call the compiler the same way as for
971 compiling C programs (usually with the name gcc).
972
973 However, the use of gcc does not add the C++ library. g++ is a program
974 that calls GCC and treats .c, .h and .i files as C++ source files
975 instead of C source files unless -x is used, and automatically
976 specifies linking against the C++ library. This program is also useful
977 when precompiling a C header file with a .h extension for use in C++
978 compilations. On many systems, g++ is also installed with the name
979 c++.
980
981 When you compile C++ programs, you may specify many of the same
982 command-line options that you use for compiling programs in any
983 language; or command-line options meaningful for C and related
984 languages; or options that are meaningful only for C++ programs.
985
986 Options Controlling C Dialect
987 The following options control the dialect of C (or languages derived
988 from C, such as C++, Objective-C and Objective-C++) that the compiler
989 accepts:
990
991 -ansi
992 In C mode, this is equivalent to -std=c90. In C++ mode, it is
993 equivalent to -std=c++98.
994
995 This turns off certain features of GCC that are incompatible with
996 ISO C90 (when compiling C code), or of standard C++ (when compiling
997 C++ code), such as the "asm" and "typeof" keywords, and predefined
998 macros such as "unix" and "vax" that identify the type of system
999 you are using. It also enables the undesirable and rarely used ISO
1000 trigraph feature. For the C compiler, it disables recognition of
1001 C++ style // comments as well as the "inline" keyword.
1002
1003 The alternate keywords "__asm__", "__extension__", "__inline__" and
1004 "__typeof__" continue to work despite -ansi. You would not want to
1005 use them in an ISO C program, of course, but it is useful to put
1006 them in header files that might be included in compilations done
1007 with -ansi. Alternate predefined macros such as "__unix__" and
1008 "__vax__" are also available, with or without -ansi.
1009
1010 The -ansi option does not cause non-ISO programs to be rejected
1011 gratuitously. For that, -pedantic is required in addition to
1012 -ansi.
1013
1014 The macro "__STRICT_ANSI__" is predefined when the -ansi option is
1015 used. Some header files may notice this macro and refrain from
1016 declaring certain functions or defining certain macros that the ISO
1017 standard doesn't call for; this is to avoid interfering with any
1018 programs that might use these names for other things.
1019
1020 Functions that would normally be built in but do not have semantics
1021 defined by ISO C (such as "alloca" and "ffs") are not built-in
1022 functions when -ansi is used.
1023
1024 -std=
1025 Determine the language standard. This option is currently only
1026 supported when compiling C or C++.
1027
1028 The compiler can accept several base standards, such as c90 or
1029 c++98, and GNU dialects of those standards, such as gnu90 or
1030 gnu++98. By specifying a base standard, the compiler will accept
1031 all programs following that standard and those using GNU extensions
1032 that do not contradict it. For example, -std=c90 turns off certain
1033 features of GCC that are incompatible with ISO C90, such as the
1034 "asm" and "typeof" keywords, but not other GNU extensions that do
1035 not have a meaning in ISO C90, such as omitting the middle term of
1036 a "?:" expression. On the other hand, by specifying a GNU dialect
1037 of a standard, all features the compiler support are enabled, even
1038 when those features change the meaning of the base standard and
1039 some strict-conforming programs may be rejected. The particular
1040 standard is used by -pedantic to identify which features are GNU
1041 extensions given that version of the standard. For example
1042 -std=gnu90 -pedantic would warn about C++ style // comments, while
1043 -std=gnu99 -pedantic would not.
1044
1045 A value for this option must be provided; possible values are
1046
1047 c90
1048 c89
1049 iso9899:1990
1050 Support all ISO C90 programs (certain GNU extensions that
1051 conflict with ISO C90 are disabled). Same as -ansi for C code.
1052
1053 iso9899:199409
1054 ISO C90 as modified in amendment 1.
1055
1056 c99
1057 c9x
1058 iso9899:1999
1059 iso9899:199x
1060 ISO C99. Note that this standard is not yet fully supported;
1061 see <http://gcc.gnu.org/gcc-4.5/c99status.html> for more
1062 information. The names c9x and iso9899:199x are deprecated.
1063
1064 gnu90
1065 gnu89
1066 GNU dialect of ISO C90 (including some C99 features). This is
1067 the default for C code.
1068
1069 gnu99
1070 gnu9x
1071 GNU dialect of ISO C99. When ISO C99 is fully implemented in
1072 GCC, this will become the default. The name gnu9x is
1073 deprecated.
1074
1075 c++98
1076 The 1998 ISO C++ standard plus amendments. Same as -ansi for
1077 C++ code.
1078
1079 gnu++98
1080 GNU dialect of -std=c++98. This is the default for C++ code.
1081
1082 c++0x
1083 The working draft of the upcoming ISO C++0x standard. This
1084 option enables experimental features that are likely to be
1085 included in C++0x. The working draft is constantly changing,
1086 and any feature that is enabled by this flag may be removed
1087 from future versions of GCC if it is not part of the C++0x
1088 standard.
1089
1090 gnu++0x
1091 GNU dialect of -std=c++0x. This option enables experimental
1092 features that may be removed in future versions of GCC.
1093
1094 -fgnu89-inline
1095 The option -fgnu89-inline tells GCC to use the traditional GNU
1096 semantics for "inline" functions when in C99 mode.
1097 This option is accepted and ignored by GCC versions 4.1.3 up to
1098 but not including 4.3. In GCC versions 4.3 and later it changes
1099 the behavior of GCC in C99 mode. Using this option is roughly
1100 equivalent to adding the "gnu_inline" function attribute to all
1101 inline functions.
1102
1103 The option -fno-gnu89-inline explicitly tells GCC to use the C99
1104 semantics for "inline" when in C99 or gnu99 mode (i.e., it
1105 specifies the default behavior). This option was first supported
1106 in GCC 4.3. This option is not supported in -std=c90 or -std=gnu90
1107 mode.
1108
1109 The preprocessor macros "__GNUC_GNU_INLINE__" and
1110 "__GNUC_STDC_INLINE__" may be used to check which semantics are in
1111 effect for "inline" functions.
1112
1113 -aux-info filename
1114 Output to the given filename prototyped declarations for all
1115 functions declared and/or defined in a translation unit, including
1116 those in header files. This option is silently ignored in any
1117 language other than C.
1118
1119 Besides declarations, the file indicates, in comments, the origin
1120 of each declaration (source file and line), whether the declaration
1121 was implicit, prototyped or unprototyped (I, N for new or O for
1122 old, respectively, in the first character after the line number and
1123 the colon), and whether it came from a declaration or a definition
1124 (C or F, respectively, in the following character). In the case of
1125 function definitions, a K&R-style list of arguments followed by
1126 their declarations is also provided, inside comments, after the
1127 declaration.
1128
1129 -fno-asm
1130 Do not recognize "asm", "inline" or "typeof" as a keyword, so that
1131 code can use these words as identifiers. You can use the keywords
1132 "__asm__", "__inline__" and "__typeof__" instead. -ansi implies
1133 -fno-asm.
1134
1135 In C++, this switch only affects the "typeof" keyword, since "asm"
1136 and "inline" are standard keywords. You may want to use the
1137 -fno-gnu-keywords flag instead, which has the same effect. In C99
1138 mode (-std=c99 or -std=gnu99), this switch only affects the "asm"
1139 and "typeof" keywords, since "inline" is a standard keyword in ISO
1140 C99.
1141
1142 -fno-builtin
1143 -fno-builtin-function
1144 Don't recognize built-in functions that do not begin with
1145 __builtin_ as prefix.
1146
1147 GCC normally generates special code to handle certain built-in
1148 functions more efficiently; for instance, calls to "alloca" may
1149 become single instructions that adjust the stack directly, and
1150 calls to "memcpy" may become inline copy loops. The resulting code
1151 is often both smaller and faster, but since the function calls no
1152 longer appear as such, you cannot set a breakpoint on those calls,
1153 nor can you change the behavior of the functions by linking with a
1154 different library. In addition, when a function is recognized as a
1155 built-in function, GCC may use information about that function to
1156 warn about problems with calls to that function, or to generate
1157 more efficient code, even if the resulting code still contains
1158 calls to that function. For example, warnings are given with
1159 -Wformat for bad calls to "printf", when "printf" is built in, and
1160 "strlen" is known not to modify global memory.
1161
1162 With the -fno-builtin-function option only the built-in function
1163 function is disabled. function must not begin with __builtin_. If
1164 a function is named that is not built-in in this version of GCC,
1165 this option is ignored. There is no corresponding
1166 -fbuiltin-function option; if you wish to enable built-in functions
1167 selectively when using -fno-builtin or -ffreestanding, you may
1168 define macros such as:
1169
1170 #define abs(n) __builtin_abs ((n))
1171 #define strcpy(d, s) __builtin_strcpy ((d), (s))
1172
1173 -fhosted
1174 Assert that compilation takes place in a hosted environment. This
1175 implies -fbuiltin. A hosted environment is one in which the entire
1176 standard library is available, and in which "main" has a return
1177 type of "int". Examples are nearly everything except a kernel.
1178 This is equivalent to -fno-freestanding.
1179
1180 -ffreestanding
1181 Assert that compilation takes place in a freestanding environment.
1182 This implies -fno-builtin. A freestanding environment is one in
1183 which the standard library may not exist, and program startup may
1184 not necessarily be at "main". The most obvious example is an OS
1185 kernel. This is equivalent to -fno-hosted.
1186
1187 -fopenmp
1188 Enable handling of OpenMP directives "#pragma omp" in C/C++ and
1189 "!$omp" in Fortran. When -fopenmp is specified, the compiler
1190 generates parallel code according to the OpenMP Application Program
1191 Interface v3.0 <http://www.openmp.org/>. This option implies
1192 -pthread, and thus is only supported on targets that have support
1193 for -pthread.
1194
1195 -fms-extensions
1196 Accept some non-standard constructs used in Microsoft header files.
1197
1198 Some cases of unnamed fields in structures and unions are only
1199 accepted with this option.
1200
1201 -trigraphs
1202 Support ISO C trigraphs. The -ansi option (and -std options for
1203 strict ISO C conformance) implies -trigraphs.
1204
1205 -no-integrated-cpp
1206 Performs a compilation in two passes: preprocessing and compiling.
1207 This option allows a user supplied "cc1", "cc1plus", or "cc1obj"
1208 via the -B option. The user supplied compilation step can then add
1209 in an additional preprocessing step after normal preprocessing but
1210 before compiling. The default is to use the integrated cpp
1211 (internal cpp)
1212
1213 The semantics of this option will change if "cc1", "cc1plus", and
1214 "cc1obj" are merged.
1215
1216 -traditional
1217 -traditional-cpp
1218 Formerly, these options caused GCC to attempt to emulate a pre-
1219 standard C compiler. They are now only supported with the -E
1220 switch. The preprocessor continues to support a pre-standard mode.
1221 See the GNU CPP manual for details.
1222
1223 -fcond-mismatch
1224 Allow conditional expressions with mismatched types in the second
1225 and third arguments. The value of such an expression is void.
1226 This option is not supported for C++.
1227
1228 -flax-vector-conversions
1229 Allow implicit conversions between vectors with differing numbers
1230 of elements and/or incompatible element types. This option should
1231 not be used for new code.
1232
1233 -funsigned-char
1234 Let the type "char" be unsigned, like "unsigned char".
1235
1236 Each kind of machine has a default for what "char" should be. It
1237 is either like "unsigned char" by default or like "signed char" by
1238 default.
1239
1240 Ideally, a portable program should always use "signed char" or
1241 "unsigned char" when it depends on the signedness of an object.
1242 But many programs have been written to use plain "char" and expect
1243 it to be signed, or expect it to be unsigned, depending on the
1244 machines they were written for. This option, and its inverse, let
1245 you make such a program work with the opposite default.
1246
1247 The type "char" is always a distinct type from each of "signed
1248 char" or "unsigned char", even though its behavior is always just
1249 like one of those two.
1250
1251 -fsigned-char
1252 Let the type "char" be signed, like "signed char".
1253
1254 Note that this is equivalent to -fno-unsigned-char, which is the
1255 negative form of -funsigned-char. Likewise, the option
1256 -fno-signed-char is equivalent to -funsigned-char.
1257
1258 -fsigned-bitfields
1259 -funsigned-bitfields
1260 -fno-signed-bitfields
1261 -fno-unsigned-bitfields
1262 These options control whether a bit-field is signed or unsigned,
1263 when the declaration does not use either "signed" or "unsigned".
1264 By default, such a bit-field is signed, because this is consistent:
1265 the basic integer types such as "int" are signed types.
1266
1267 Options Controlling C++ Dialect
1268 This section describes the command-line options that are only
1269 meaningful for C++ programs; but you can also use most of the GNU
1270 compiler options regardless of what language your program is in. For
1271 example, you might compile a file "firstClass.C" like this:
1272
1273 g++ -g -frepo -O -c firstClass.C
1274
1275 In this example, only -frepo is an option meant only for C++ programs;
1276 you can use the other options with any language supported by GCC.
1277
1278 Here is a list of options that are only for compiling C++ programs:
1279
1280 -fabi-version=n
1281 Use version n of the C++ ABI. Version 2 is the version of the C++
1282 ABI that first appeared in G++ 3.4. Version 1 is the version of
1283 the C++ ABI that first appeared in G++ 3.2. Version 0 will always
1284 be the version that conforms most closely to the C++ ABI
1285 specification. Therefore, the ABI obtained using version 0 will
1286 change as ABI bugs are fixed.
1287
1288 The default is version 2.
1289
1290 Version 3 corrects an error in mangling a constant address as a
1291 template argument.
1292
1293 Version 4 implements a standard mangling for vector types.
1294
1295 See also -Wabi.
1296
1297 -fno-access-control
1298 Turn off all access checking. This switch is mainly useful for
1299 working around bugs in the access control code.
1300
1301 -fcheck-new
1302 Check that the pointer returned by "operator new" is non-null
1303 before attempting to modify the storage allocated. This check is
1304 normally unnecessary because the C++ standard specifies that
1305 "operator new" will only return 0 if it is declared throw(), in
1306 which case the compiler will always check the return value even
1307 without this option. In all other cases, when "operator new" has a
1308 non-empty exception specification, memory exhaustion is signalled
1309 by throwing "std::bad_alloc". See also new (nothrow).
1310
1311 -fconserve-space
1312 Put uninitialized or runtime-initialized global variables into the
1313 common segment, as C does. This saves space in the executable at
1314 the cost of not diagnosing duplicate definitions. If you compile
1315 with this flag and your program mysteriously crashes after "main()"
1316 has completed, you may have an object that is being destroyed twice
1317 because two definitions were merged.
1318
1319 This option is no longer useful on most targets, now that support
1320 has been added for putting variables into BSS without making them
1321 common.
1322
1323 -fno-deduce-init-list
1324 Disable deduction of a template type parameter as
1325 std::initializer_list from a brace-enclosed initializer list, i.e.
1326
1327 template <class T> auto forward(T t) -> decltype (realfn (t))
1328 {
1329 return realfn (t);
1330 }
1331
1332 void f()
1333 {
1334 forward({1,2}); // call forward<std::initializer_list<int>>
1335 }
1336
1337 This option is present because this deduction is an extension to
1338 the current specification in the C++0x working draft, and there was
1339 some concern about potential overload resolution problems.
1340
1341 -ffriend-injection
1342 Inject friend functions into the enclosing namespace, so that they
1343 are visible outside the scope of the class in which they are
1344 declared. Friend functions were documented to work this way in the
1345 old Annotated C++ Reference Manual, and versions of G++ before 4.1
1346 always worked that way. However, in ISO C++ a friend function
1347 which is not declared in an enclosing scope can only be found using
1348 argument dependent lookup. This option causes friends to be
1349 injected as they were in earlier releases.
1350
1351 This option is for compatibility, and may be removed in a future
1352 release of G++.
1353
1354 -fno-elide-constructors
1355 The C++ standard allows an implementation to omit creating a
1356 temporary which is only used to initialize another object of the
1357 same type. Specifying this option disables that optimization, and
1358 forces G++ to call the copy constructor in all cases.
1359
1360 -fno-enforce-eh-specs
1361 Don't generate code to check for violation of exception
1362 specifications at runtime. This option violates the C++ standard,
1363 but may be useful for reducing code size in production builds, much
1364 like defining NDEBUG. This does not give user code permission to
1365 throw exceptions in violation of the exception specifications; the
1366 compiler will still optimize based on the specifications, so
1367 throwing an unexpected exception will result in undefined behavior.
1368
1369 -ffor-scope
1370 -fno-for-scope
1371 If -ffor-scope is specified, the scope of variables declared in a
1372 for-init-statement is limited to the for loop itself, as specified
1373 by the C++ standard. If -fno-for-scope is specified, the scope of
1374 variables declared in a for-init-statement extends to the end of
1375 the enclosing scope, as was the case in old versions of G++, and
1376 other (traditional) implementations of C++.
1377
1378 The default if neither flag is given to follow the standard, but to
1379 allow and give a warning for old-style code that would otherwise be
1380 invalid, or have different behavior.
1381
1382 -fno-gnu-keywords
1383 Do not recognize "typeof" as a keyword, so that code can use this
1384 word as an identifier. You can use the keyword "__typeof__"
1385 instead. -ansi implies -fno-gnu-keywords.
1386
1387 -fno-implicit-templates
1388 Never emit code for non-inline templates which are instantiated
1389 implicitly (i.e. by use); only emit code for explicit
1390 instantiations.
1391
1392 -fno-implicit-inline-templates
1393 Don't emit code for implicit instantiations of inline templates,
1394 either. The default is to handle inlines differently so that
1395 compiles with and without optimization will need the same set of
1396 explicit instantiations.
1397
1398 -fno-implement-inlines
1399 To save space, do not emit out-of-line copies of inline functions
1400 controlled by #pragma implementation. This will cause linker
1401 errors if these functions are not inlined everywhere they are
1402 called.
1403
1404 -fms-extensions
1405 Disable pedantic warnings about constructs used in MFC, such as
1406 implicit int and getting a pointer to member function via non-
1407 standard syntax.
1408
1409 -fno-nonansi-builtins
1410 Disable built-in declarations of functions that are not mandated by
1411 ANSI/ISO C. These include "ffs", "alloca", "_exit", "index",
1412 "bzero", "conjf", and other related functions.
1413
1414 -fno-operator-names
1415 Do not treat the operator name keywords "and", "bitand", "bitor",
1416 "compl", "not", "or" and "xor" as synonyms as keywords.
1417
1418 -fno-optional-diags
1419 Disable diagnostics that the standard says a compiler does not need
1420 to issue. Currently, the only such diagnostic issued by G++ is the
1421 one for a name having multiple meanings within a class.
1422
1423 -fpermissive
1424 Downgrade some diagnostics about nonconformant code from errors to
1425 warnings. Thus, using -fpermissive will allow some nonconforming
1426 code to compile.
1427
1428 -fno-pretty-templates
1429 When an error message refers to a specialization of a function
1430 template, the compiler will normally print the signature of the
1431 template followed by the template arguments and any typedefs or
1432 typenames in the signature (e.g. "void f(T) [with T = int]" rather
1433 than "void f(int)") so that it's clear which template is involved.
1434 When an error message refers to a specialization of a class
1435 template, the compiler will omit any template arguments which match
1436 the default template arguments for that template. If either of
1437 these behaviors make it harder to understand the error message
1438 rather than easier, using -fno-pretty-templates will disable them.
1439
1440 -frepo
1441 Enable automatic template instantiation at link time. This option
1442 also implies -fno-implicit-templates.
1443
1444 -fno-rtti
1445 Disable generation of information about every class with virtual
1446 functions for use by the C++ runtime type identification features
1447 (dynamic_cast and typeid). If you don't use those parts of the
1448 language, you can save some space by using this flag. Note that
1449 exception handling uses the same information, but it will generate
1450 it as needed. The dynamic_cast operator can still be used for casts
1451 that do not require runtime type information, i.e. casts to "void
1452 *" or to unambiguous base classes.
1453
1454 -fstats
1455 Emit statistics about front-end processing at the end of the
1456 compilation. This information is generally only useful to the G++
1457 development team.
1458
1459 -ftemplate-depth=n
1460 Set the maximum instantiation depth for template classes to n. A
1461 limit on the template instantiation depth is needed to detect
1462 endless recursions during template class instantiation. ANSI/ISO
1463 C++ conforming programs must not rely on a maximum depth greater
1464 than 17 (changed to 1024 in C++0x).
1465
1466 -fno-threadsafe-statics
1467 Do not emit the extra code to use the routines specified in the C++
1468 ABI for thread-safe initialization of local statics. You can use
1469 this option to reduce code size slightly in code that doesn't need
1470 to be thread-safe.
1471
1472 -fuse-cxa-atexit
1473 Register destructors for objects with static storage duration with
1474 the "__cxa_atexit" function rather than the "atexit" function.
1475 This option is required for fully standards-compliant handling of
1476 static destructors, but will only work if your C library supports
1477 "__cxa_atexit".
1478
1479 -fno-use-cxa-get-exception-ptr
1480 Don't use the "__cxa_get_exception_ptr" runtime routine. This will
1481 cause "std::uncaught_exception" to be incorrect, but is necessary
1482 if the runtime routine is not available.
1483
1484 -fvisibility-inlines-hidden
1485 This switch declares that the user does not attempt to compare
1486 pointers to inline methods where the addresses of the two functions
1487 were taken in different shared objects.
1488
1489 The effect of this is that GCC may, effectively, mark inline
1490 methods with "__attribute__ ((visibility ("hidden")))" so that they
1491 do not appear in the export table of a DSO and do not require a PLT
1492 indirection when used within the DSO. Enabling this option can
1493 have a dramatic effect on load and link times of a DSO as it
1494 massively reduces the size of the dynamic export table when the
1495 library makes heavy use of templates.
1496
1497 The behavior of this switch is not quite the same as marking the
1498 methods as hidden directly, because it does not affect static
1499 variables local to the function or cause the compiler to deduce
1500 that the function is defined in only one shared object.
1501
1502 You may mark a method as having a visibility explicitly to negate
1503 the effect of the switch for that method. For example, if you do
1504 want to compare pointers to a particular inline method, you might
1505 mark it as having default visibility. Marking the enclosing class
1506 with explicit visibility will have no effect.
1507
1508 Explicitly instantiated inline methods are unaffected by this
1509 option as their linkage might otherwise cross a shared library
1510 boundary.
1511
1512 -fvisibility-ms-compat
1513 This flag attempts to use visibility settings to make GCC's C++
1514 linkage model compatible with that of Microsoft Visual Studio.
1515
1516 The flag makes these changes to GCC's linkage model:
1517
1518 1. It sets the default visibility to "hidden", like
1519 -fvisibility=hidden.
1520
1521 2. Types, but not their members, are not hidden by default.
1522
1523 3. The One Definition Rule is relaxed for types without explicit
1524 visibility specifications which are defined in more than one
1525 different shared object: those declarations are permitted if
1526 they would have been permitted when this option was not used.
1527
1528 In new code it is better to use -fvisibility=hidden and export
1529 those classes which are intended to be externally visible.
1530 Unfortunately it is possible for code to rely, perhaps
1531 accidentally, on the Visual Studio behavior.
1532
1533 Among the consequences of these changes are that static data
1534 members of the same type with the same name but defined in
1535 different shared objects will be different, so changing one will
1536 not change the other; and that pointers to function members defined
1537 in different shared objects may not compare equal. When this flag
1538 is given, it is a violation of the ODR to define types with the
1539 same name differently.
1540
1541 -fno-weak
1542 Do not use weak symbol support, even if it is provided by the
1543 linker. By default, G++ will use weak symbols if they are
1544 available. This option exists only for testing, and should not be
1545 used by end-users; it will result in inferior code and has no
1546 benefits. This option may be removed in a future release of G++.
1547
1548 -nostdinc++
1549 Do not search for header files in the standard directories specific
1550 to C++, but do still search the other standard directories. (This
1551 option is used when building the C++ library.)
1552
1553 In addition, these optimization, warning, and code generation options
1554 have meanings only for C++ programs:
1555
1556 -fno-default-inline
1557 Do not assume inline for functions defined inside a class scope.
1558 Note that these functions will have linkage like inline
1559 functions; they just won't be inlined by default.
1560
1561 -Wabi (C, Objective-C, C++ and Objective-C++ only)
1562 Warn when G++ generates code that is probably not compatible with
1563 the vendor-neutral C++ ABI. Although an effort has been made to
1564 warn about all such cases, there are probably some cases that are
1565 not warned about, even though G++ is generating incompatible code.
1566 There may also be cases where warnings are emitted even though the
1567 code that is generated will be compatible.
1568
1569 You should rewrite your code to avoid these warnings if you are
1570 concerned about the fact that code generated by G++ may not be
1571 binary compatible with code generated by other compilers.
1572
1573 The known incompatibilities in -fabi-version=2 (the default)
1574 include:
1575
1576 · A template with a non-type template parameter of reference type
1577 is mangled incorrectly:
1578
1579 extern int N;
1580 template <int &> struct S {};
1581 void n (S<N>) {2}
1582
1583 This is fixed in -fabi-version=3.
1584
1585 · SIMD vector types declared using "__attribute ((vector_size))"
1586 are mangled in a non-standard way that does not allow for
1587 overloading of functions taking vectors of different sizes.
1588
1589 The mangling is changed in -fabi-version=4.
1590
1591 The known incompatibilities in -fabi-version=1 include:
1592
1593 · Incorrect handling of tail-padding for bit-fields. G++ may
1594 attempt to pack data into the same byte as a base class. For
1595 example:
1596
1597 struct A { virtual void f(); int f1 : 1; };
1598 struct B : public A { int f2 : 1; };
1599
1600 In this case, G++ will place "B::f2" into the same byte
1601 as"A::f1"; other compilers will not. You can avoid this
1602 problem by explicitly padding "A" so that its size is a
1603 multiple of the byte size on your platform; that will cause G++
1604 and other compilers to layout "B" identically.
1605
1606 · Incorrect handling of tail-padding for virtual bases. G++ does
1607 not use tail padding when laying out virtual bases. For
1608 example:
1609
1610 struct A { virtual void f(); char c1; };
1611 struct B { B(); char c2; };
1612 struct C : public A, public virtual B {};
1613
1614 In this case, G++ will not place "B" into the tail-padding for
1615 "A"; other compilers will. You can avoid this problem by
1616 explicitly padding "A" so that its size is a multiple of its
1617 alignment (ignoring virtual base classes); that will cause G++
1618 and other compilers to layout "C" identically.
1619
1620 · Incorrect handling of bit-fields with declared widths greater
1621 than that of their underlying types, when the bit-fields appear
1622 in a union. For example:
1623
1624 union U { int i : 4096; };
1625
1626 Assuming that an "int" does not have 4096 bits, G++ will make
1627 the union too small by the number of bits in an "int".
1628
1629 · Empty classes can be placed at incorrect offsets. For example:
1630
1631 struct A {};
1632
1633 struct B {
1634 A a;
1635 virtual void f ();
1636 };
1637
1638 struct C : public B, public A {};
1639
1640 G++ will place the "A" base class of "C" at a nonzero offset;
1641 it should be placed at offset zero. G++ mistakenly believes
1642 that the "A" data member of "B" is already at offset zero.
1643
1644 · Names of template functions whose types involve "typename" or
1645 template template parameters can be mangled incorrectly.
1646
1647 template <typename Q>
1648 void f(typename Q::X) {}
1649
1650 template <template <typename> class Q>
1651 void f(typename Q<int>::X) {}
1652
1653 Instantiations of these templates may be mangled incorrectly.
1654
1655 It also warns psABI related changes. The known psABI changes at
1656 this point include:
1657
1658 · For SYSV/x86-64, when passing union with long double, it is
1659 changed to pass in memory as specified in psABI. For example:
1660
1661 union U {
1662 long double ld;
1663 int i;
1664 };
1665
1666 "union U" will always be passed in memory.
1667
1668 -Wctor-dtor-privacy (C++ and Objective-C++ only)
1669 Warn when a class seems unusable because all the constructors or
1670 destructors in that class are private, and it has neither friends
1671 nor public static member functions.
1672
1673 -Wnon-virtual-dtor (C++ and Objective-C++ only)
1674 Warn when a class has virtual functions and accessible non-virtual
1675 destructor, in which case it would be possible but unsafe to delete
1676 an instance of a derived class through a pointer to the base class.
1677 This warning is also enabled if -Weffc++ is specified.
1678
1679 -Wreorder (C++ and Objective-C++ only)
1680 Warn when the order of member initializers given in the code does
1681 not match the order in which they must be executed. For instance:
1682
1683 struct A {
1684 int i;
1685 int j;
1686 A(): j (0), i (1) { }
1687 };
1688
1689 The compiler will rearrange the member initializers for i and j to
1690 match the declaration order of the members, emitting a warning to
1691 that effect. This warning is enabled by -Wall.
1692
1693 The following -W... options are not affected by -Wall.
1694
1695 -Weffc++ (C++ and Objective-C++ only)
1696 Warn about violations of the following style guidelines from Scott
1697 Meyers' Effective C++ book:
1698
1699 · Item 11: Define a copy constructor and an assignment operator
1700 for classes with dynamically allocated memory.
1701
1702 · Item 12: Prefer initialization to assignment in constructors.
1703
1704 · Item 14: Make destructors virtual in base classes.
1705
1706 · Item 15: Have "operator=" return a reference to *this.
1707
1708 · Item 23: Don't try to return a reference when you must return
1709 an object.
1710
1711 Also warn about violations of the following style guidelines from
1712 Scott Meyers' More Effective C++ book:
1713
1714 · Item 6: Distinguish between prefix and postfix forms of
1715 increment and decrement operators.
1716
1717 · Item 7: Never overload "&&", "||", or ",".
1718
1719 When selecting this option, be aware that the standard library
1720 headers do not obey all of these guidelines; use grep -v to filter
1721 out those warnings.
1722
1723 -Wstrict-null-sentinel (C++ and Objective-C++ only)
1724 Warn also about the use of an uncasted "NULL" as sentinel. When
1725 compiling only with GCC this is a valid sentinel, as "NULL" is
1726 defined to "__null". Although it is a null pointer constant not a
1727 null pointer, it is guaranteed to be of the same size as a pointer.
1728 But this use is not portable across different compilers.
1729
1730 -Wno-non-template-friend (C++ and Objective-C++ only)
1731 Disable warnings when non-templatized friend functions are declared
1732 within a template. Since the advent of explicit template
1733 specification support in G++, if the name of the friend is an
1734 unqualified-id (i.e., friend foo(int)), the C++ language
1735 specification demands that the friend declare or define an
1736 ordinary, nontemplate function. (Section 14.5.3). Before G++
1737 implemented explicit specification, unqualified-ids could be
1738 interpreted as a particular specialization of a templatized
1739 function. Because this non-conforming behavior is no longer the
1740 default behavior for G++, -Wnon-template-friend allows the compiler
1741 to check existing code for potential trouble spots and is on by
1742 default. This new compiler behavior can be turned off with
1743 -Wno-non-template-friend which keeps the conformant compiler code
1744 but disables the helpful warning.
1745
1746 -Wold-style-cast (C++ and Objective-C++ only)
1747 Warn if an old-style (C-style) cast to a non-void type is used
1748 within a C++ program. The new-style casts (dynamic_cast,
1749 static_cast, reinterpret_cast, and const_cast) are less vulnerable
1750 to unintended effects and much easier to search for.
1751
1752 -Woverloaded-virtual (C++ and Objective-C++ only)
1753 Warn when a function declaration hides virtual functions from a
1754 base class. For example, in:
1755
1756 struct A {
1757 virtual void f();
1758 };
1759
1760 struct B: public A {
1761 void f(int);
1762 };
1763
1764 the "A" class version of "f" is hidden in "B", and code like:
1765
1766 B* b;
1767 b->f();
1768
1769 will fail to compile.
1770
1771 -Wno-pmf-conversions (C++ and Objective-C++ only)
1772 Disable the diagnostic for converting a bound pointer to member
1773 function to a plain pointer.
1774
1775 -Wsign-promo (C++ and Objective-C++ only)
1776 Warn when overload resolution chooses a promotion from unsigned or
1777 enumerated type to a signed type, over a conversion to an unsigned
1778 type of the same size. Previous versions of G++ would try to
1779 preserve unsignedness, but the standard mandates the current
1780 behavior.
1781
1782 struct A {
1783 operator int ();
1784 A& operator = (int);
1785 };
1786
1787 main ()
1788 {
1789 A a,b;
1790 a = b;
1791 }
1792
1793 In this example, G++ will synthesize a default A& operator = (const
1794 A&);, while cfront will use the user-defined operator =.
1795
1796 Options Controlling Objective-C and Objective-C++ Dialects
1797 (NOTE: This manual does not describe the Objective-C and Objective-C++
1798 languages themselves. See
1799
1800 This section describes the command-line options that are only
1801 meaningful for Objective-C and Objective-C++ programs, but you can also
1802 use most of the language-independent GNU compiler options. For
1803 example, you might compile a file "some_class.m" like this:
1804
1805 gcc -g -fgnu-runtime -O -c some_class.m
1806
1807 In this example, -fgnu-runtime is an option meant only for Objective-C
1808 and Objective-C++ programs; you can use the other options with any
1809 language supported by GCC.
1810
1811 Note that since Objective-C is an extension of the C language,
1812 Objective-C compilations may also use options specific to the C front-
1813 end (e.g., -Wtraditional). Similarly, Objective-C++ compilations may
1814 use C++-specific options (e.g., -Wabi).
1815
1816 Here is a list of options that are only for compiling Objective-C and
1817 Objective-C++ programs:
1818
1819 -fconstant-string-class=class-name
1820 Use class-name as the name of the class to instantiate for each
1821 literal string specified with the syntax "@"..."". The default
1822 class name is "NXConstantString" if the GNU runtime is being used,
1823 and "NSConstantString" if the NeXT runtime is being used (see
1824 below). The -fconstant-cfstrings option, if also present, will
1825 override the -fconstant-string-class setting and cause "@"...""
1826 literals to be laid out as constant CoreFoundation strings.
1827
1828 -fgnu-runtime
1829 Generate object code compatible with the standard GNU Objective-C
1830 runtime. This is the default for most types of systems.
1831
1832 -fnext-runtime
1833 Generate output compatible with the NeXT runtime. This is the
1834 default for NeXT-based systems, including Darwin and Mac OS X. The
1835 macro "__NEXT_RUNTIME__" is predefined if (and only if) this option
1836 is used.
1837
1838 -fno-nil-receivers
1839 Assume that all Objective-C message dispatches (e.g., "[receiver
1840 message:arg]") in this translation unit ensure that the receiver is
1841 not "nil". This allows for more efficient entry points in the
1842 runtime to be used. Currently, this option is only available in
1843 conjunction with the NeXT runtime on Mac OS X 10.3 and later.
1844
1845 -fobjc-call-cxx-cdtors
1846 For each Objective-C class, check if any of its instance variables
1847 is a C++ object with a non-trivial default constructor. If so,
1848 synthesize a special "- (id) .cxx_construct" instance method that
1849 will run non-trivial default constructors on any such instance
1850 variables, in order, and then return "self". Similarly, check if
1851 any instance variable is a C++ object with a non-trivial
1852 destructor, and if so, synthesize a special "- (void)
1853 .cxx_destruct" method that will run all such default destructors,
1854 in reverse order.
1855
1856 The "- (id) .cxx_construct" and/or "- (void) .cxx_destruct" methods
1857 thusly generated will only operate on instance variables declared
1858 in the current Objective-C class, and not those inherited from
1859 superclasses. It is the responsibility of the Objective-C runtime
1860 to invoke all such methods in an object's inheritance hierarchy.
1861 The "- (id) .cxx_construct" methods will be invoked by the runtime
1862 immediately after a new object instance is allocated; the "- (void)
1863 .cxx_destruct" methods will be invoked immediately before the
1864 runtime deallocates an object instance.
1865
1866 As of this writing, only the NeXT runtime on Mac OS X 10.4 and
1867 later has support for invoking the "- (id) .cxx_construct" and "-
1868 (void) .cxx_destruct" methods.
1869
1870 -fobjc-direct-dispatch
1871 Allow fast jumps to the message dispatcher. On Darwin this is
1872 accomplished via the comm page.
1873
1874 -fobjc-exceptions
1875 Enable syntactic support for structured exception handling in
1876 Objective-C, similar to what is offered by C++ and Java. This
1877 option is unavailable in conjunction with the NeXT runtime on Mac
1878 OS X 10.2 and earlier.
1879
1880 @try {
1881 ...
1882 @throw expr;
1883 ...
1884 }
1885 @catch (AnObjCClass *exc) {
1886 ...
1887 @throw expr;
1888 ...
1889 @throw;
1890 ...
1891 }
1892 @catch (AnotherClass *exc) {
1893 ...
1894 }
1895 @catch (id allOthers) {
1896 ...
1897 }
1898 @finally {
1899 ...
1900 @throw expr;
1901 ...
1902 }
1903
1904 The @throw statement may appear anywhere in an Objective-C or
1905 Objective-C++ program; when used inside of a @catch block, the
1906 @throw may appear without an argument (as shown above), in which
1907 case the object caught by the @catch will be rethrown.
1908
1909 Note that only (pointers to) Objective-C objects may be thrown and
1910 caught using this scheme. When an object is thrown, it will be
1911 caught by the nearest @catch clause capable of handling objects of
1912 that type, analogously to how "catch" blocks work in C++ and Java.
1913 A "@catch(id ...)" clause (as shown above) may also be provided to
1914 catch any and all Objective-C exceptions not caught by previous
1915 @catch clauses (if any).
1916
1917 The @finally clause, if present, will be executed upon exit from
1918 the immediately preceding "@try ... @catch" section. This will
1919 happen regardless of whether any exceptions are thrown, caught or
1920 rethrown inside the "@try ... @catch" section, analogously to the
1921 behavior of the "finally" clause in Java.
1922
1923 There are several caveats to using the new exception mechanism:
1924
1925 · Although currently designed to be binary compatible with
1926 "NS_HANDLER"-style idioms provided by the "NSException" class,
1927 the new exceptions can only be used on Mac OS X 10.3 (Panther)
1928 and later systems, due to additional functionality needed in
1929 the (NeXT) Objective-C runtime.
1930
1931 · As mentioned above, the new exceptions do not support handling
1932 types other than Objective-C objects. Furthermore, when used
1933 from Objective-C++, the Objective-C exception model does not
1934 interoperate with C++ exceptions at this time. This means you
1935 cannot @throw an exception from Objective-C and "catch" it in
1936 C++, or vice versa (i.e., "throw ... @catch").
1937
1938 The -fobjc-exceptions switch also enables the use of
1939 synchronization blocks for thread-safe execution:
1940
1941 @synchronized (ObjCClass *guard) {
1942 ...
1943 }
1944
1945 Upon entering the @synchronized block, a thread of execution shall
1946 first check whether a lock has been placed on the corresponding
1947 "guard" object by another thread. If it has, the current thread
1948 shall wait until the other thread relinquishes its lock. Once
1949 "guard" becomes available, the current thread will place its own
1950 lock on it, execute the code contained in the @synchronized block,
1951 and finally relinquish the lock (thereby making "guard" available
1952 to other threads).
1953
1954 Unlike Java, Objective-C does not allow for entire methods to be
1955 marked @synchronized. Note that throwing exceptions out of
1956 @synchronized blocks is allowed, and will cause the guarding object
1957 to be unlocked properly.
1958
1959 -fobjc-gc
1960 Enable garbage collection (GC) in Objective-C and Objective-C++
1961 programs.
1962
1963 -freplace-objc-classes
1964 Emit a special marker instructing ld(1) not to statically link in
1965 the resulting object file, and allow dyld(1) to load it in at run
1966 time instead. This is used in conjunction with the Fix-and-
1967 Continue debugging mode, where the object file in question may be
1968 recompiled and dynamically reloaded in the course of program
1969 execution, without the need to restart the program itself.
1970 Currently, Fix-and-Continue functionality is only available in
1971 conjunction with the NeXT runtime on Mac OS X 10.3 and later.
1972
1973 -fzero-link
1974 When compiling for the NeXT runtime, the compiler ordinarily
1975 replaces calls to "objc_getClass("...")" (when the name of the
1976 class is known at compile time) with static class references that
1977 get initialized at load time, which improves run-time performance.
1978 Specifying the -fzero-link flag suppresses this behavior and causes
1979 calls to "objc_getClass("...")" to be retained. This is useful in
1980 Zero-Link debugging mode, since it allows for individual class
1981 implementations to be modified during program execution.
1982
1983 -gen-decls
1984 Dump interface declarations for all classes seen in the source file
1985 to a file named sourcename.decl.
1986
1987 -Wassign-intercept (Objective-C and Objective-C++ only)
1988 Warn whenever an Objective-C assignment is being intercepted by the
1989 garbage collector.
1990
1991 -Wno-protocol (Objective-C and Objective-C++ only)
1992 If a class is declared to implement a protocol, a warning is issued
1993 for every method in the protocol that is not implemented by the
1994 class. The default behavior is to issue a warning for every method
1995 not explicitly implemented in the class, even if a method
1996 implementation is inherited from the superclass. If you use the
1997 -Wno-protocol option, then methods inherited from the superclass
1998 are considered to be implemented, and no warning is issued for
1999 them.
2000
2001 -Wselector (Objective-C and Objective-C++ only)
2002 Warn if multiple methods of different types for the same selector
2003 are found during compilation. The check is performed on the list
2004 of methods in the final stage of compilation. Additionally, a
2005 check is performed for each selector appearing in a
2006 "@selector(...)" expression, and a corresponding method for that
2007 selector has been found during compilation. Because these checks
2008 scan the method table only at the end of compilation, these
2009 warnings are not produced if the final stage of compilation is not
2010 reached, for example because an error is found during compilation,
2011 or because the -fsyntax-only option is being used.
2012
2013 -Wstrict-selector-match (Objective-C and Objective-C++ only)
2014 Warn if multiple methods with differing argument and/or return
2015 types are found for a given selector when attempting to send a
2016 message using this selector to a receiver of type "id" or "Class".
2017 When this flag is off (which is the default behavior), the compiler
2018 will omit such warnings if any differences found are confined to
2019 types which share the same size and alignment.
2020
2021 -Wundeclared-selector (Objective-C and Objective-C++ only)
2022 Warn if a "@selector(...)" expression referring to an undeclared
2023 selector is found. A selector is considered undeclared if no
2024 method with that name has been declared before the "@selector(...)"
2025 expression, either explicitly in an @interface or @protocol
2026 declaration, or implicitly in an @implementation section. This
2027 option always performs its checks as soon as a "@selector(...)"
2028 expression is found, while -Wselector only performs its checks in
2029 the final stage of compilation. This also enforces the coding
2030 style convention that methods and selectors must be declared before
2031 being used.
2032
2033 -print-objc-runtime-info
2034 Generate C header describing the largest structure that is passed
2035 by value, if any.
2036
2037 Options to Control Diagnostic Messages Formatting
2038 Traditionally, diagnostic messages have been formatted irrespective of
2039 the output device's aspect (e.g. its width, ...). The options
2040 described below can be used to control the diagnostic messages
2041 formatting algorithm, e.g. how many characters per line, how often
2042 source location information should be reported. Right now, only the
2043 C++ front end can honor these options. However it is expected, in the
2044 near future, that the remaining front ends would be able to digest them
2045 correctly.
2046
2047 -fmessage-length=n
2048 Try to format error messages so that they fit on lines of about n
2049 characters. The default is 72 characters for g++ and 0 for the
2050 rest of the front ends supported by GCC. If n is zero, then no
2051 line-wrapping will be done; each error message will appear on a
2052 single line.
2053
2054 -fdiagnostics-show-location=once
2055 Only meaningful in line-wrapping mode. Instructs the diagnostic
2056 messages reporter to emit once source location information; that
2057 is, in case the message is too long to fit on a single physical
2058 line and has to be wrapped, the source location won't be emitted
2059 (as prefix) again, over and over, in subsequent continuation lines.
2060 This is the default behavior.
2061
2062 -fdiagnostics-show-location=every-line
2063 Only meaningful in line-wrapping mode. Instructs the diagnostic
2064 messages reporter to emit the same source location information (as
2065 prefix) for physical lines that result from the process of breaking
2066 a message which is too long to fit on a single line.
2067
2068 -fdiagnostics-show-option
2069 This option instructs the diagnostic machinery to add text to each
2070 diagnostic emitted, which indicates which command line option
2071 directly controls that diagnostic, when such an option is known to
2072 the diagnostic machinery.
2073
2074 -Wcoverage-mismatch
2075 Warn if feedback profiles do not match when using the -fprofile-use
2076 option. If a source file was changed between -fprofile-gen and
2077 -fprofile-use, the files with the profile feedback can fail to
2078 match the source file and GCC can not use the profile feedback
2079 information. By default, GCC emits an error message in this case.
2080 The option -Wcoverage-mismatch emits a warning instead of an error.
2081 GCC does not use appropriate feedback profiles, so using this
2082 option can result in poorly optimized code. This option is useful
2083 only in the case of very minor changes such as bug fixes to an
2084 existing code-base.
2085
2086 Options to Request or Suppress Warnings
2087 Warnings are diagnostic messages that report constructions which are
2088 not inherently erroneous but which are risky or suggest there may have
2089 been an error.
2090
2091 The following language-independent options do not enable specific
2092 warnings but control the kinds of diagnostics produced by GCC.
2093
2094 -fsyntax-only
2095 Check the code for syntax errors, but don't do anything beyond
2096 that.
2097
2098 -w Inhibit all warning messages.
2099
2100 -Werror
2101 Make all warnings into errors.
2102
2103 -Werror=
2104 Make the specified warning into an error. The specifier for a
2105 warning is appended, for example -Werror=switch turns the warnings
2106 controlled by -Wswitch into errors. This switch takes a negative
2107 form, to be used to negate -Werror for specific warnings, for
2108 example -Wno-error=switch makes -Wswitch warnings not be errors,
2109 even when -Werror is in effect. You can use the
2110 -fdiagnostics-show-option option to have each controllable warning
2111 amended with the option which controls it, to determine what to use
2112 with this option.
2113
2114 Note that specifying -Werror=foo automatically implies -Wfoo.
2115 However, -Wno-error=foo does not imply anything.
2116
2117 -Wfatal-errors
2118 This option causes the compiler to abort compilation on the first
2119 error occurred rather than trying to keep going and printing
2120 further error messages.
2121
2122 You can request many specific warnings with options beginning -W, for
2123 example -Wimplicit to request warnings on implicit declarations. Each
2124 of these specific warning options also has a negative form beginning
2125 -Wno- to turn off warnings; for example, -Wno-implicit. This manual
2126 lists only one of the two forms, whichever is not the default. For
2127 further, language-specific options also refer to C++ Dialect Options
2128 and Objective-C and Objective-C++ Dialect Options.
2129
2130 -pedantic
2131 Issue all the warnings demanded by strict ISO C and ISO C++; reject
2132 all programs that use forbidden extensions, and some other programs
2133 that do not follow ISO C and ISO C++. For ISO C, follows the
2134 version of the ISO C standard specified by any -std option used.
2135
2136 Valid ISO C and ISO C++ programs should compile properly with or
2137 without this option (though a rare few will require -ansi or a -std
2138 option specifying the required version of ISO C). However, without
2139 this option, certain GNU extensions and traditional C and C++
2140 features are supported as well. With this option, they are
2141 rejected.
2142
2143 -pedantic does not cause warning messages for use of the alternate
2144 keywords whose names begin and end with __. Pedantic warnings are
2145 also disabled in the expression that follows "__extension__".
2146 However, only system header files should use these escape routes;
2147 application programs should avoid them.
2148
2149 Some users try to use -pedantic to check programs for strict ISO C
2150 conformance. They soon find that it does not do quite what they
2151 want: it finds some non-ISO practices, but not all---only those for
2152 which ISO C requires a diagnostic, and some others for which
2153 diagnostics have been added.
2154
2155 A feature to report any failure to conform to ISO C might be useful
2156 in some instances, but would require considerable additional work
2157 and would be quite different from -pedantic. We don't have plans
2158 to support such a feature in the near future.
2159
2160 Where the standard specified with -std represents a GNU extended
2161 dialect of C, such as gnu90 or gnu99, there is a corresponding base
2162 standard, the version of ISO C on which the GNU extended dialect is
2163 based. Warnings from -pedantic are given where they are required
2164 by the base standard. (It would not make sense for such warnings
2165 to be given only for features not in the specified GNU C dialect,
2166 since by definition the GNU dialects of C include all features the
2167 compiler supports with the given option, and there would be nothing
2168 to warn about.)
2169
2170 -pedantic-errors
2171 Like -pedantic, except that errors are produced rather than
2172 warnings.
2173
2174 -Wall
2175 This enables all the warnings about constructions that some users
2176 consider questionable, and that are easy to avoid (or modify to
2177 prevent the warning), even in conjunction with macros. This also
2178 enables some language-specific warnings described in C++ Dialect
2179 Options and Objective-C and Objective-C++ Dialect Options.
2180
2181 -Wall turns on the following warning flags:
2182
2183 -Waddress -Warray-bounds (only with -O2) -Wc++0x-compat
2184 -Wchar-subscripts -Wenum-compare (in C/Objc; this is on by default
2185 in C++) -Wimplicit-int -Wimplicit-function-declaration -Wcomment
2186 -Wformat -Wmain (only for C/ObjC and unless -ffreestanding)
2187 -Wmissing-braces -Wnonnull -Wparentheses -Wpointer-sign -Wreorder
2188 -Wreturn-type -Wsequence-point -Wsign-compare (only in C++)
2189 -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch -Wtrigraphs
2190 -Wuninitialized -Wunknown-pragmas -Wunused-function -Wunused-label
2191 -Wunused-value -Wunused-variable -Wvolatile-register-var
2192
2193 Note that some warning flags are not implied by -Wall. Some of
2194 them warn about constructions that users generally do not consider
2195 questionable, but which occasionally you might wish to check for;
2196 others warn about constructions that are necessary or hard to avoid
2197 in some cases, and there is no simple way to modify the code to
2198 suppress the warning. Some of them are enabled by -Wextra but many
2199 of them must be enabled individually.
2200
2201 -Wextra
2202 This enables some extra warning flags that are not enabled by
2203 -Wall. (This option used to be called -W. The older name is still
2204 supported, but the newer name is more descriptive.)
2205
2206 -Wclobbered -Wempty-body -Wignored-qualifiers
2207 -Wmissing-field-initializers -Wmissing-parameter-type (C only)
2208 -Wold-style-declaration (C only) -Woverride-init -Wsign-compare
2209 -Wtype-limits -Wuninitialized -Wunused-parameter (only with
2210 -Wunused or -Wall)
2211
2212 The option -Wextra also prints warning messages for the following
2213 cases:
2214
2215 · A pointer is compared against integer zero with <, <=, >, or
2216 >=.
2217
2218 · (C++ only) An enumerator and a non-enumerator both appear in a
2219 conditional expression.
2220
2221 · (C++ only) Ambiguous virtual bases.
2222
2223 · (C++ only) Subscripting an array which has been declared
2224 register.
2225
2226 · (C++ only) Taking the address of a variable which has been
2227 declared register.
2228
2229 · (C++ only) A base class is not initialized in a derived class'
2230 copy constructor.
2231
2232 -Wchar-subscripts
2233 Warn if an array subscript has type "char". This is a common cause
2234 of error, as programmers often forget that this type is signed on
2235 some machines. This warning is enabled by -Wall.
2236
2237 -Wcomment
2238 Warn whenever a comment-start sequence /* appears in a /* comment,
2239 or whenever a Backslash-Newline appears in a // comment. This
2240 warning is enabled by -Wall.
2241
2242 -Wformat
2243 Check calls to "printf" and "scanf", etc., to make sure that the
2244 arguments supplied have types appropriate to the format string
2245 specified, and that the conversions specified in the format string
2246 make sense. This includes standard functions, and others specified
2247 by format attributes, in the "printf", "scanf", "strftime" and
2248 "strfmon" (an X/Open extension, not in the C standard) families (or
2249 other target-specific families). Which functions are checked
2250 without format attributes having been specified depends on the
2251 standard version selected, and such checks of functions without the
2252 attribute specified are disabled by -ffreestanding or -fno-builtin.
2253
2254 The formats are checked against the format features supported by
2255 GNU libc version 2.2. These include all ISO C90 and C99 features,
2256 as well as features from the Single Unix Specification and some BSD
2257 and GNU extensions. Other library implementations may not support
2258 all these features; GCC does not support warning about features
2259 that go beyond a particular library's limitations. However, if
2260 -pedantic is used with -Wformat, warnings will be given about
2261 format features not in the selected standard version (but not for
2262 "strfmon" formats, since those are not in any version of the C
2263 standard).
2264
2265 Since -Wformat also checks for null format arguments for several
2266 functions, -Wformat also implies -Wnonnull.
2267
2268 -Wformat is included in -Wall. For more control over some aspects
2269 of format checking, the options -Wformat-y2k,
2270 -Wno-format-extra-args, -Wno-format-zero-length,
2271 -Wformat-nonliteral, -Wformat-security, and -Wformat=2 are
2272 available, but are not included in -Wall.
2273
2274 -Wformat-y2k
2275 If -Wformat is specified, also warn about "strftime" formats which
2276 may yield only a two-digit year.
2277
2278 -Wno-format-contains-nul
2279 If -Wformat is specified, do not warn about format strings that
2280 contain NUL bytes.
2281
2282 -Wno-format-extra-args
2283 If -Wformat is specified, do not warn about excess arguments to a
2284 "printf" or "scanf" format function. The C standard specifies that
2285 such arguments are ignored.
2286
2287 Where the unused arguments lie between used arguments that are
2288 specified with $ operand number specifications, normally warnings
2289 are still given, since the implementation could not know what type
2290 to pass to "va_arg" to skip the unused arguments. However, in the
2291 case of "scanf" formats, this option will suppress the warning if
2292 the unused arguments are all pointers, since the Single Unix
2293 Specification says that such unused arguments are allowed.
2294
2295 -Wno-format-zero-length (C and Objective-C only)
2296 If -Wformat is specified, do not warn about zero-length formats.
2297 The C standard specifies that zero-length formats are allowed.
2298
2299 -Wformat-nonliteral
2300 If -Wformat is specified, also warn if the format string is not a
2301 string literal and so cannot be checked, unless the format function
2302 takes its format arguments as a "va_list".
2303
2304 -Wformat-security
2305 If -Wformat is specified, also warn about uses of format functions
2306 that represent possible security problems. At present, this warns
2307 about calls to "printf" and "scanf" functions where the format
2308 string is not a string literal and there are no format arguments,
2309 as in "printf (foo);". This may be a security hole if the format
2310 string came from untrusted input and contains %n. (This is
2311 currently a subset of what -Wformat-nonliteral warns about, but in
2312 future warnings may be added to -Wformat-security that are not
2313 included in -Wformat-nonliteral.)
2314
2315 -Wformat=2
2316 Enable -Wformat plus format checks not included in -Wformat.
2317 Currently equivalent to -Wformat -Wformat-nonliteral
2318 -Wformat-security -Wformat-y2k.
2319
2320 -Wnonnull (C and Objective-C only)
2321 Warn about passing a null pointer for arguments marked as requiring
2322 a non-null value by the "nonnull" function attribute.
2323
2324 -Wnonnull is included in -Wall and -Wformat. It can be disabled
2325 with the -Wno-nonnull option.
2326
2327 -Winit-self (C, C++, Objective-C and Objective-C++ only)
2328 Warn about uninitialized variables which are initialized with
2329 themselves. Note this option can only be used with the
2330 -Wuninitialized option.
2331
2332 For example, GCC will warn about "i" being uninitialized in the
2333 following snippet only when -Winit-self has been specified:
2334
2335 int f()
2336 {
2337 int i = i;
2338 return i;
2339 }
2340
2341 -Wimplicit-int (C and Objective-C only)
2342 Warn when a declaration does not specify a type. This warning is
2343 enabled by -Wall.
2344
2345 -Wimplicit-function-declaration (C and Objective-C only)
2346 Give a warning whenever a function is used before being declared.
2347 In C99 mode (-std=c99 or -std=gnu99), this warning is enabled by
2348 default and it is made into an error by -pedantic-errors. This
2349 warning is also enabled by -Wall.
2350
2351 -Wimplicit
2352 Same as -Wimplicit-int and -Wimplicit-function-declaration. This
2353 warning is enabled by -Wall.
2354
2355 -Wignored-qualifiers (C and C++ only)
2356 Warn if the return type of a function has a type qualifier such as
2357 "const". For ISO C such a type qualifier has no effect, since the
2358 value returned by a function is not an lvalue. For C++, the
2359 warning is only emitted for scalar types or "void". ISO C
2360 prohibits qualified "void" return types on function definitions, so
2361 such return types always receive a warning even without this
2362 option.
2363
2364 This warning is also enabled by -Wextra.
2365
2366 -Wmain
2367 Warn if the type of main is suspicious. main should be a function
2368 with external linkage, returning int, taking either zero arguments,
2369 two, or three arguments of appropriate types. This warning is
2370 enabled by default in C++ and is enabled by either -Wall or
2371 -pedantic.
2372
2373 -Wmissing-braces
2374 Warn if an aggregate or union initializer is not fully bracketed.
2375 In the following example, the initializer for a is not fully
2376 bracketed, but that for b is fully bracketed.
2377
2378 int a[2][2] = { 0, 1, 2, 3 };
2379 int b[2][2] = { { 0, 1 }, { 2, 3 } };
2380
2381 This warning is enabled by -Wall.
2382
2383 -Wmissing-include-dirs (C, C++, Objective-C and Objective-C++ only)
2384 Warn if a user-supplied include directory does not exist.
2385
2386 -Wparentheses
2387 Warn if parentheses are omitted in certain contexts, such as when
2388 there is an assignment in a context where a truth value is
2389 expected, or when operators are nested whose precedence people
2390 often get confused about.
2391
2392 Also warn if a comparison like x<=y<=z appears; this is equivalent
2393 to (x<=y ? 1 : 0) <= z, which is a different interpretation from
2394 that of ordinary mathematical notation.
2395
2396 Also warn about constructions where there may be confusion to which
2397 "if" statement an "else" branch belongs. Here is an example of
2398 such a case:
2399
2400 {
2401 if (a)
2402 if (b)
2403 foo ();
2404 else
2405 bar ();
2406 }
2407
2408 In C/C++, every "else" branch belongs to the innermost possible
2409 "if" statement, which in this example is "if (b)". This is often
2410 not what the programmer expected, as illustrated in the above
2411 example by indentation the programmer chose. When there is the
2412 potential for this confusion, GCC will issue a warning when this
2413 flag is specified. To eliminate the warning, add explicit braces
2414 around the innermost "if" statement so there is no way the "else"
2415 could belong to the enclosing "if". The resulting code would look
2416 like this:
2417
2418 {
2419 if (a)
2420 {
2421 if (b)
2422 foo ();
2423 else
2424 bar ();
2425 }
2426 }
2427
2428 This warning is enabled by -Wall.
2429
2430 -Wsequence-point
2431 Warn about code that may have undefined semantics because of
2432 violations of sequence point rules in the C and C++ standards.
2433
2434 The C and C++ standards defines the order in which expressions in a
2435 C/C++ program are evaluated in terms of sequence points, which
2436 represent a partial ordering between the execution of parts of the
2437 program: those executed before the sequence point, and those
2438 executed after it. These occur after the evaluation of a full
2439 expression (one which is not part of a larger expression), after
2440 the evaluation of the first operand of a "&&", "||", "? :" or ","
2441 (comma) operator, before a function is called (but after the
2442 evaluation of its arguments and the expression denoting the called
2443 function), and in certain other places. Other than as expressed by
2444 the sequence point rules, the order of evaluation of subexpressions
2445 of an expression is not specified. All these rules describe only a
2446 partial order rather than a total order, since, for example, if two
2447 functions are called within one expression with no sequence point
2448 between them, the order in which the functions are called is not
2449 specified. However, the standards committee have ruled that
2450 function calls do not overlap.
2451
2452 It is not specified when between sequence points modifications to
2453 the values of objects take effect. Programs whose behavior depends
2454 on this have undefined behavior; the C and C++ standards specify
2455 that "Between the previous and next sequence point an object shall
2456 have its stored value modified at most once by the evaluation of an
2457 expression. Furthermore, the prior value shall be read only to
2458 determine the value to be stored.". If a program breaks these
2459 rules, the results on any particular implementation are entirely
2460 unpredictable.
2461
2462 Examples of code with undefined behavior are "a = a++;", "a[n] =
2463 b[n++]" and "a[i++] = i;". Some more complicated cases are not
2464 diagnosed by this option, and it may give an occasional false
2465 positive result, but in general it has been found fairly effective
2466 at detecting this sort of problem in programs.
2467
2468 The standard is worded confusingly, therefore there is some debate
2469 over the precise meaning of the sequence point rules in subtle
2470 cases. Links to discussions of the problem, including proposed
2471 formal definitions, may be found on the GCC readings page, at
2472 <http://gcc.gnu.org/readings.html>.
2473
2474 This warning is enabled by -Wall for C and C++.
2475
2476 -Wreturn-type
2477 Warn whenever a function is defined with a return-type that
2478 defaults to "int". Also warn about any "return" statement with no
2479 return-value in a function whose return-type is not "void" (falling
2480 off the end of the function body is considered returning without a
2481 value), and about a "return" statement with an expression in a
2482 function whose return-type is "void".
2483
2484 For C++, a function without return type always produces a
2485 diagnostic message, even when -Wno-return-type is specified. The
2486 only exceptions are main and functions defined in system headers.
2487
2488 This warning is enabled by -Wall.
2489
2490 -Wswitch
2491 Warn whenever a "switch" statement has an index of enumerated type
2492 and lacks a "case" for one or more of the named codes of that
2493 enumeration. (The presence of a "default" label prevents this
2494 warning.) "case" labels outside the enumeration range also provoke
2495 warnings when this option is used (even if there is a "default"
2496 label). This warning is enabled by -Wall.
2497
2498 -Wswitch-default
2499 Warn whenever a "switch" statement does not have a "default" case.
2500
2501 -Wswitch-enum
2502 Warn whenever a "switch" statement has an index of enumerated type
2503 and lacks a "case" for one or more of the named codes of that
2504 enumeration. "case" labels outside the enumeration range also
2505 provoke warnings when this option is used. The only difference
2506 between -Wswitch and this option is that this option gives a
2507 warning about an omitted enumeration code even if there is a
2508 "default" label.
2509
2510 -Wsync-nand (C and C++ only)
2511 Warn when "__sync_fetch_and_nand" and "__sync_nand_and_fetch"
2512 built-in functions are used. These functions changed semantics in
2513 GCC 4.4.
2514
2515 -Wtrigraphs
2516 Warn if any trigraphs are encountered that might change the meaning
2517 of the program (trigraphs within comments are not warned about).
2518 This warning is enabled by -Wall.
2519
2520 -Wunused-function
2521 Warn whenever a static function is declared but not defined or a
2522 non-inline static function is unused. This warning is enabled by
2523 -Wall.
2524
2525 -Wunused-label
2526 Warn whenever a label is declared but not used. This warning is
2527 enabled by -Wall.
2528
2529 To suppress this warning use the unused attribute.
2530
2531 -Wunused-parameter
2532 Warn whenever a function parameter is unused aside from its
2533 declaration.
2534
2535 To suppress this warning use the unused attribute.
2536
2537 -Wno-unused-result
2538 Do not warn if a caller of a function marked with attribute
2539 "warn_unused_result" does not use its return value. The default is
2540 -Wunused-result.
2541
2542 -Wunused-variable
2543 Warn whenever a local variable or non-constant static variable is
2544 unused aside from its declaration. This warning is enabled by
2545 -Wall.
2546
2547 To suppress this warning use the unused attribute.
2548
2549 -Wunused-value
2550 Warn whenever a statement computes a result that is explicitly not
2551 used. To suppress this warning cast the unused expression to void.
2552 This includes an expression-statement or the left-hand side of a
2553 comma expression that contains no side effects. For example, an
2554 expression such as x[i,j] will cause a warning, while x[(void)i,j]
2555 will not.
2556
2557 This warning is enabled by -Wall.
2558
2559 -Wunused
2560 All the above -Wunused options combined.
2561
2562 In order to get a warning about an unused function parameter, you
2563 must either specify -Wextra -Wunused (note that -Wall implies
2564 -Wunused), or separately specify -Wunused-parameter.
2565
2566 -Wuninitialized
2567 Warn if an automatic variable is used without first being
2568 initialized or if a variable may be clobbered by a "setjmp" call.
2569 In C++, warn if a non-static reference or non-static const member
2570 appears in a class without constructors.
2571
2572 If you want to warn about code which uses the uninitialized value
2573 of the variable in its own initializer, use the -Winit-self option.
2574
2575 These warnings occur for individual uninitialized or clobbered
2576 elements of structure, union or array variables as well as for
2577 variables which are uninitialized or clobbered as a whole. They do
2578 not occur for variables or elements declared "volatile". Because
2579 these warnings depend on optimization, the exact variables or
2580 elements for which there are warnings will depend on the precise
2581 optimization options and version of GCC used.
2582
2583 Note that there may be no warning about a variable that is used
2584 only to compute a value that itself is never used, because such
2585 computations may be deleted by data flow analysis before the
2586 warnings are printed.
2587
2588 These warnings are made optional because GCC is not smart enough to
2589 see all the reasons why the code might be correct despite appearing
2590 to have an error. Here is one example of how this can happen:
2591
2592 {
2593 int x;
2594 switch (y)
2595 {
2596 case 1: x = 1;
2597 break;
2598 case 2: x = 4;
2599 break;
2600 case 3: x = 5;
2601 }
2602 foo (x);
2603 }
2604
2605 If the value of "y" is always 1, 2 or 3, then "x" is always
2606 initialized, but GCC doesn't know this. Here is another common
2607 case:
2608
2609 {
2610 int save_y;
2611 if (change_y) save_y = y, y = new_y;
2612 ...
2613 if (change_y) y = save_y;
2614 }
2615
2616 This has no bug because "save_y" is used only if it is set.
2617
2618 This option also warns when a non-volatile automatic variable might
2619 be changed by a call to "longjmp". These warnings as well are
2620 possible only in optimizing compilation.
2621
2622 The compiler sees only the calls to "setjmp". It cannot know where
2623 "longjmp" will be called; in fact, a signal handler could call it
2624 at any point in the code. As a result, you may get a warning even
2625 when there is in fact no problem because "longjmp" cannot in fact
2626 be called at the place which would cause a problem.
2627
2628 Some spurious warnings can be avoided if you declare all the
2629 functions you use that never return as "noreturn".
2630
2631 This warning is enabled by -Wall or -Wextra.
2632
2633 -Wunknown-pragmas
2634 Warn when a #pragma directive is encountered which is not
2635 understood by GCC. If this command line option is used, warnings
2636 will even be issued for unknown pragmas in system header files.
2637 This is not the case if the warnings were only enabled by the -Wall
2638 command line option.
2639
2640 -Wno-pragmas
2641 Do not warn about misuses of pragmas, such as incorrect parameters,
2642 invalid syntax, or conflicts between pragmas. See also
2643 -Wunknown-pragmas.
2644
2645 -Wstrict-aliasing
2646 This option is only active when -fstrict-aliasing is active. It
2647 warns about code which might break the strict aliasing rules that
2648 the compiler is using for optimization. The warning does not catch
2649 all cases, but does attempt to catch the more common pitfalls. It
2650 is included in -Wall. It is equivalent to -Wstrict-aliasing=3
2651
2652 -Wstrict-aliasing=n
2653 This option is only active when -fstrict-aliasing is active. It
2654 warns about code which might break the strict aliasing rules that
2655 the compiler is using for optimization. Higher levels correspond
2656 to higher accuracy (fewer false positives). Higher levels also
2657 correspond to more effort, similar to the way -O works.
2658 -Wstrict-aliasing is equivalent to -Wstrict-aliasing=n, with n=3.
2659
2660 Level 1: Most aggressive, quick, least accurate. Possibly useful
2661 when higher levels do not warn but -fstrict-aliasing still breaks
2662 the code, as it has very few false negatives. However, it has many
2663 false positives. Warns for all pointer conversions between
2664 possibly incompatible types, even if never dereferenced. Runs in
2665 the frontend only.
2666
2667 Level 2: Aggressive, quick, not too precise. May still have many
2668 false positives (not as many as level 1 though), and few false
2669 negatives (but possibly more than level 1). Unlike level 1, it
2670 only warns when an address is taken. Warns about incomplete types.
2671 Runs in the frontend only.
2672
2673 Level 3 (default for -Wstrict-aliasing): Should have very few false
2674 positives and few false negatives. Slightly slower than levels 1
2675 or 2 when optimization is enabled. Takes care of the common
2676 pun+dereference pattern in the frontend: "*(int*)&some_float". If
2677 optimization is enabled, it also runs in the backend, where it
2678 deals with multiple statement cases using flow-sensitive points-to
2679 information. Only warns when the converted pointer is
2680 dereferenced. Does not warn about incomplete types.
2681
2682 -Wstrict-overflow
2683 -Wstrict-overflow=n
2684 This option is only active when -fstrict-overflow is active. It
2685 warns about cases where the compiler optimizes based on the
2686 assumption that signed overflow does not occur. Note that it does
2687 not warn about all cases where the code might overflow: it only
2688 warns about cases where the compiler implements some optimization.
2689 Thus this warning depends on the optimization level.
2690
2691 An optimization which assumes that signed overflow does not occur
2692 is perfectly safe if the values of the variables involved are such
2693 that overflow never does, in fact, occur. Therefore this warning
2694 can easily give a false positive: a warning about code which is not
2695 actually a problem. To help focus on important issues, several
2696 warning levels are defined. No warnings are issued for the use of
2697 undefined signed overflow when estimating how many iterations a
2698 loop will require, in particular when determining whether a loop
2699 will be executed at all.
2700
2701 -Wstrict-overflow=1
2702 Warn about cases which are both questionable and easy to avoid.
2703 For example: "x + 1 > x"; with -fstrict-overflow, the compiler
2704 will simplify this to 1. This level of -Wstrict-overflow is
2705 enabled by -Wall; higher levels are not, and must be explicitly
2706 requested.
2707
2708 -Wstrict-overflow=2
2709 Also warn about other cases where a comparison is simplified to
2710 a constant. For example: "abs (x) >= 0". This can only be
2711 simplified when -fstrict-overflow is in effect, because "abs
2712 (INT_MIN)" overflows to "INT_MIN", which is less than zero.
2713 -Wstrict-overflow (with no level) is the same as
2714 -Wstrict-overflow=2.
2715
2716 -Wstrict-overflow=3
2717 Also warn about other cases where a comparison is simplified.
2718 For example: "x + 1 > 1" will be simplified to "x > 0".
2719
2720 -Wstrict-overflow=4
2721 Also warn about other simplifications not covered by the above
2722 cases. For example: "(x * 10) / 5" will be simplified to "x *
2723 2".
2724
2725 -Wstrict-overflow=5
2726 Also warn about cases where the compiler reduces the magnitude
2727 of a constant involved in a comparison. For example: "x + 2 >
2728 y" will be simplified to "x + 1 >= y". This is reported only
2729 at the highest warning level because this simplification
2730 applies to many comparisons, so this warning level will give a
2731 very large number of false positives.
2732
2733 -Warray-bounds
2734 This option is only active when -ftree-vrp is active (default for
2735 -O2 and above). It warns about subscripts to arrays that are always
2736 out of bounds. This warning is enabled by -Wall.
2737
2738 -Wno-div-by-zero
2739 Do not warn about compile-time integer division by zero. Floating
2740 point division by zero is not warned about, as it can be a
2741 legitimate way of obtaining infinities and NaNs.
2742
2743 -Wsystem-headers
2744 Print warning messages for constructs found in system header files.
2745 Warnings from system headers are normally suppressed, on the
2746 assumption that they usually do not indicate real problems and
2747 would only make the compiler output harder to read. Using this
2748 command line option tells GCC to emit warnings from system headers
2749 as if they occurred in user code. However, note that using -Wall
2750 in conjunction with this option will not warn about unknown pragmas
2751 in system headers---for that, -Wunknown-pragmas must also be used.
2752
2753 -Wfloat-equal
2754 Warn if floating point values are used in equality comparisons.
2755
2756 The idea behind this is that sometimes it is convenient (for the
2757 programmer) to consider floating-point values as approximations to
2758 infinitely precise real numbers. If you are doing this, then you
2759 need to compute (by analyzing the code, or in some other way) the
2760 maximum or likely maximum error that the computation introduces,
2761 and allow for it when performing comparisons (and when producing
2762 output, but that's a different problem). In particular, instead of
2763 testing for equality, you would check to see whether the two values
2764 have ranges that overlap; and this is done with the relational
2765 operators, so equality comparisons are probably mistaken.
2766
2767 -Wtraditional (C and Objective-C only)
2768 Warn about certain constructs that behave differently in
2769 traditional and ISO C. Also warn about ISO C constructs that have
2770 no traditional C equivalent, and/or problematic constructs which
2771 should be avoided.
2772
2773 · Macro parameters that appear within string literals in the
2774 macro body. In traditional C macro replacement takes place
2775 within string literals, but does not in ISO C.
2776
2777 · In traditional C, some preprocessor directives did not exist.
2778 Traditional preprocessors would only consider a line to be a
2779 directive if the # appeared in column 1 on the line. Therefore
2780 -Wtraditional warns about directives that traditional C
2781 understands but would ignore because the # does not appear as
2782 the first character on the line. It also suggests you hide
2783 directives like #pragma not understood by traditional C by
2784 indenting them. Some traditional implementations would not
2785 recognize #elif, so it suggests avoiding it altogether.
2786
2787 · A function-like macro that appears without arguments.
2788
2789 · The unary plus operator.
2790
2791 · The U integer constant suffix, or the F or L floating point
2792 constant suffixes. (Traditional C does support the L suffix on
2793 integer constants.) Note, these suffixes appear in macros
2794 defined in the system headers of most modern systems, e.g. the
2795 _MIN/_MAX macros in "<limits.h>". Use of these macros in user
2796 code might normally lead to spurious warnings, however GCC's
2797 integrated preprocessor has enough context to avoid warning in
2798 these cases.
2799
2800 · A function declared external in one block and then used after
2801 the end of the block.
2802
2803 · A "switch" statement has an operand of type "long".
2804
2805 · A non-"static" function declaration follows a "static" one.
2806 This construct is not accepted by some traditional C compilers.
2807
2808 · The ISO type of an integer constant has a different width or
2809 signedness from its traditional type. This warning is only
2810 issued if the base of the constant is ten. I.e. hexadecimal or
2811 octal values, which typically represent bit patterns, are not
2812 warned about.
2813
2814 · Usage of ISO string concatenation is detected.
2815
2816 · Initialization of automatic aggregates.
2817
2818 · Identifier conflicts with labels. Traditional C lacks a
2819 separate namespace for labels.
2820
2821 · Initialization of unions. If the initializer is zero, the
2822 warning is omitted. This is done under the assumption that the
2823 zero initializer in user code appears conditioned on e.g.
2824 "__STDC__" to avoid missing initializer warnings and relies on
2825 default initialization to zero in the traditional C case.
2826
2827 · Conversions by prototypes between fixed/floating point values
2828 and vice versa. The absence of these prototypes when compiling
2829 with traditional C would cause serious problems. This is a
2830 subset of the possible conversion warnings, for the full set
2831 use -Wtraditional-conversion.
2832
2833 · Use of ISO C style function definitions. This warning
2834 intentionally is not issued for prototype declarations or
2835 variadic functions because these ISO C features will appear in
2836 your code when using libiberty's traditional C compatibility
2837 macros, "PARAMS" and "VPARAMS". This warning is also bypassed
2838 for nested functions because that feature is already a GCC
2839 extension and thus not relevant to traditional C compatibility.
2840
2841 -Wtraditional-conversion (C and Objective-C only)
2842 Warn if a prototype causes a type conversion that is different from
2843 what would happen to the same argument in the absence of a
2844 prototype. This includes conversions of fixed point to floating
2845 and vice versa, and conversions changing the width or signedness of
2846 a fixed point argument except when the same as the default
2847 promotion.
2848
2849 -Wdeclaration-after-statement (C and Objective-C only)
2850 Warn when a declaration is found after a statement in a block.
2851 This construct, known from C++, was introduced with ISO C99 and is
2852 by default allowed in GCC. It is not supported by ISO C90 and was
2853 not supported by GCC versions before GCC 3.0.
2854
2855 -Wundef
2856 Warn if an undefined identifier is evaluated in an #if directive.
2857
2858 -Wno-endif-labels
2859 Do not warn whenever an #else or an #endif are followed by text.
2860
2861 -Wshadow
2862 Warn whenever a local variable shadows another local variable,
2863 parameter or global variable or whenever a built-in function is
2864 shadowed.
2865
2866 -Wlarger-than=len
2867 Warn whenever an object of larger than len bytes is defined.
2868
2869 -Wframe-larger-than=len
2870 Warn if the size of a function frame is larger than len bytes. The
2871 computation done to determine the stack frame size is approximate
2872 and not conservative. The actual requirements may be somewhat
2873 greater than len even if you do not get a warning. In addition,
2874 any space allocated via "alloca", variable-length arrays, or
2875 related constructs is not included by the compiler when determining
2876 whether or not to issue a warning.
2877
2878 -Wunsafe-loop-optimizations
2879 Warn if the loop cannot be optimized because the compiler could not
2880 assume anything on the bounds of the loop indices. With
2881 -funsafe-loop-optimizations warn if the compiler made such
2882 assumptions.
2883
2884 -Wno-pedantic-ms-format (MinGW targets only)
2885 Disables the warnings about non-ISO "printf" / "scanf" format width
2886 specifiers "I32", "I64", and "I" used on Windows targets depending
2887 on the MS runtime, when you are using the options -Wformat and
2888 -pedantic without gnu-extensions.
2889
2890 -Wpointer-arith
2891 Warn about anything that depends on the "size of" a function type
2892 or of "void". GNU C assigns these types a size of 1, for
2893 convenience in calculations with "void *" pointers and pointers to
2894 functions. In C++, warn also when an arithmetic operation involves
2895 "NULL". This warning is also enabled by -pedantic.
2896
2897 -Wtype-limits
2898 Warn if a comparison is always true or always false due to the
2899 limited range of the data type, but do not warn for constant
2900 expressions. For example, warn if an unsigned variable is compared
2901 against zero with < or >=. This warning is also enabled by
2902 -Wextra.
2903
2904 -Wbad-function-cast (C and Objective-C only)
2905 Warn whenever a function call is cast to a non-matching type. For
2906 example, warn if "int malloc()" is cast to "anything *".
2907
2908 -Wc++-compat (C and Objective-C only)
2909 Warn about ISO C constructs that are outside of the common subset
2910 of ISO C and ISO C++, e.g. request for implicit conversion from
2911 "void *" to a pointer to non-"void" type.
2912
2913 -Wc++0x-compat (C++ and Objective-C++ only)
2914 Warn about C++ constructs whose meaning differs between ISO C++
2915 1998 and ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will
2916 become keywords in ISO C++ 200x. This warning is enabled by -Wall.
2917
2918 -Wcast-qual
2919 Warn whenever a pointer is cast so as to remove a type qualifier
2920 from the target type. For example, warn if a "const char *" is
2921 cast to an ordinary "char *".
2922
2923 Also warn when making a cast which introduces a type qualifier in
2924 an unsafe way. For example, casting "char **" to "const char **"
2925 is unsafe, as in this example:
2926
2927 /* p is char ** value. */
2928 const char **q = (const char **) p;
2929 /* Assignment of readonly string to const char * is OK. */
2930 *q = "string";
2931 /* Now char** pointer points to read-only memory. */
2932 **p = 'b';
2933
2934 -Wcast-align
2935 Warn whenever a pointer is cast such that the required alignment of
2936 the target is increased. For example, warn if a "char *" is cast
2937 to an "int *" on machines where integers can only be accessed at
2938 two- or four-byte boundaries.
2939
2940 -Wwrite-strings
2941 When compiling C, give string constants the type "const
2942 char[length]" so that copying the address of one into a non-"const"
2943 "char *" pointer will get a warning. These warnings will help you
2944 find at compile time code that can try to write into a string
2945 constant, but only if you have been very careful about using
2946 "const" in declarations and prototypes. Otherwise, it will just be
2947 a nuisance. This is why we did not make -Wall request these
2948 warnings.
2949
2950 When compiling C++, warn about the deprecated conversion from
2951 string literals to "char *". This warning is enabled by default
2952 for C++ programs.
2953
2954 -Wclobbered
2955 Warn for variables that might be changed by longjmp or vfork. This
2956 warning is also enabled by -Wextra.
2957
2958 -Wconversion
2959 Warn for implicit conversions that may alter a value. This includes
2960 conversions between real and integer, like "abs (x)" when "x" is
2961 "double"; conversions between signed and unsigned, like "unsigned
2962 ui = -1"; and conversions to smaller types, like "sqrtf (M_PI)". Do
2963 not warn for explicit casts like "abs ((int) x)" and "ui =
2964 (unsigned) -1", or if the value is not changed by the conversion
2965 like in "abs (2.0)". Warnings about conversions between signed and
2966 unsigned integers can be disabled by using -Wno-sign-conversion.
2967
2968 For C++, also warn for confusing overload resolution for user-
2969 defined conversions; and conversions that will never use a type
2970 conversion operator: conversions to "void", the same type, a base
2971 class or a reference to them. Warnings about conversions between
2972 signed and unsigned integers are disabled by default in C++ unless
2973 -Wsign-conversion is explicitly enabled.
2974
2975 -Wno-conversion-null (C++ and Objective-C++ only)
2976 Do not warn for conversions between "NULL" and non-pointer types.
2977 -Wconversion-null is enabled by default.
2978
2979 -Wempty-body
2980 Warn if an empty body occurs in an if, else or do while statement.
2981 This warning is also enabled by -Wextra.
2982
2983 -Wenum-compare
2984 Warn about a comparison between values of different enum types. In
2985 C++ this warning is enabled by default. In C this warning is
2986 enabled by -Wall.
2987
2988 -Wjump-misses-init (C, Objective-C only)
2989 Warn if a "goto" statement or a "switch" statement jumps forward
2990 across the initialization of a variable, or jumps backward to a
2991 label after the variable has been initialized. This only warns
2992 about variables which are initialized when they are declared. This
2993 warning is only supported for C and Objective C; in C++ this sort
2994 of branch is an error in any case.
2995
2996 -Wjump-misses-init is included in -Wc++-compat. It can be disabled
2997 with the -Wno-jump-misses-init option.
2998
2999 -Wsign-compare
3000 Warn when a comparison between signed and unsigned values could
3001 produce an incorrect result when the signed value is converted to
3002 unsigned. This warning is also enabled by -Wextra; to get the
3003 other warnings of -Wextra without this warning, use -Wextra
3004 -Wno-sign-compare.
3005
3006 -Wsign-conversion
3007 Warn for implicit conversions that may change the sign of an
3008 integer value, like assigning a signed integer expression to an
3009 unsigned integer variable. An explicit cast silences the warning.
3010 In C, this option is enabled also by -Wconversion.
3011
3012 -Waddress
3013 Warn about suspicious uses of memory addresses. These include using
3014 the address of a function in a conditional expression, such as
3015 "void func(void); if (func)", and comparisons against the memory
3016 address of a string literal, such as "if (x == "abc")". Such uses
3017 typically indicate a programmer error: the address of a function
3018 always evaluates to true, so their use in a conditional usually
3019 indicate that the programmer forgot the parentheses in a function
3020 call; and comparisons against string literals result in unspecified
3021 behavior and are not portable in C, so they usually indicate that
3022 the programmer intended to use "strcmp". This warning is enabled
3023 by -Wall.
3024
3025 -Wlogical-op
3026 Warn about suspicious uses of logical operators in expressions.
3027 This includes using logical operators in contexts where a bit-wise
3028 operator is likely to be expected.
3029
3030 -Waggregate-return
3031 Warn if any functions that return structures or unions are defined
3032 or called. (In languages where you can return an array, this also
3033 elicits a warning.)
3034
3035 -Wno-attributes
3036 Do not warn if an unexpected "__attribute__" is used, such as
3037 unrecognized attributes, function attributes applied to variables,
3038 etc. This will not stop errors for incorrect use of supported
3039 attributes.
3040
3041 -Wno-builtin-macro-redefined
3042 Do not warn if certain built-in macros are redefined. This
3043 suppresses warnings for redefinition of "__TIMESTAMP__",
3044 "__TIME__", "__DATE__", "__FILE__", and "__BASE_FILE__".
3045
3046 -Wstrict-prototypes (C and Objective-C only)
3047 Warn if a function is declared or defined without specifying the
3048 argument types. (An old-style function definition is permitted
3049 without a warning if preceded by a declaration which specifies the
3050 argument types.)
3051
3052 -Wold-style-declaration (C and Objective-C only)
3053 Warn for obsolescent usages, according to the C Standard, in a
3054 declaration. For example, warn if storage-class specifiers like
3055 "static" are not the first things in a declaration. This warning
3056 is also enabled by -Wextra.
3057
3058 -Wold-style-definition (C and Objective-C only)
3059 Warn if an old-style function definition is used. A warning is
3060 given even if there is a previous prototype.
3061
3062 -Wmissing-parameter-type (C and Objective-C only)
3063 A function parameter is declared without a type specifier in
3064 K&R-style functions:
3065
3066 void foo(bar) { }
3067
3068 This warning is also enabled by -Wextra.
3069
3070 -Wmissing-prototypes (C and Objective-C only)
3071 Warn if a global function is defined without a previous prototype
3072 declaration. This warning is issued even if the definition itself
3073 provides a prototype. The aim is to detect global functions that
3074 fail to be declared in header files.
3075
3076 -Wmissing-declarations
3077 Warn if a global function is defined without a previous
3078 declaration. Do so even if the definition itself provides a
3079 prototype. Use this option to detect global functions that are not
3080 declared in header files. In C++, no warnings are issued for
3081 function templates, or for inline functions, or for functions in
3082 anonymous namespaces.
3083
3084 -Wmissing-field-initializers
3085 Warn if a structure's initializer has some fields missing. For
3086 example, the following code would cause such a warning, because
3087 "x.h" is implicitly zero:
3088
3089 struct s { int f, g, h; };
3090 struct s x = { 3, 4 };
3091
3092 This option does not warn about designated initializers, so the
3093 following modification would not trigger a warning:
3094
3095 struct s { int f, g, h; };
3096 struct s x = { .f = 3, .g = 4 };
3097
3098 This warning is included in -Wextra. To get other -Wextra warnings
3099 without this one, use -Wextra -Wno-missing-field-initializers.
3100
3101 -Wmissing-noreturn
3102 Warn about functions which might be candidates for attribute
3103 "noreturn". Note these are only possible candidates, not absolute
3104 ones. Care should be taken to manually verify functions actually
3105 do not ever return before adding the "noreturn" attribute,
3106 otherwise subtle code generation bugs could be introduced. You
3107 will not get a warning for "main" in hosted C environments.
3108
3109 -Wmissing-format-attribute
3110 Warn about function pointers which might be candidates for "format"
3111 attributes. Note these are only possible candidates, not absolute
3112 ones. GCC will guess that function pointers with "format"
3113 attributes that are used in assignment, initialization, parameter
3114 passing or return statements should have a corresponding "format"
3115 attribute in the resulting type. I.e. the left-hand side of the
3116 assignment or initialization, the type of the parameter variable,
3117 or the return type of the containing function respectively should
3118 also have a "format" attribute to avoid the warning.
3119
3120 GCC will also warn about function definitions which might be
3121 candidates for "format" attributes. Again, these are only possible
3122 candidates. GCC will guess that "format" attributes might be
3123 appropriate for any function that calls a function like "vprintf"
3124 or "vscanf", but this might not always be the case, and some
3125 functions for which "format" attributes are appropriate may not be
3126 detected.
3127
3128 -Wno-multichar
3129 Do not warn if a multicharacter constant ('FOOF') is used. Usually
3130 they indicate a typo in the user's code, as they have
3131 implementation-defined values, and should not be used in portable
3132 code.
3133
3134 -Wnormalized=<none|id|nfc|nfkc>
3135 In ISO C and ISO C++, two identifiers are different if they are
3136 different sequences of characters. However, sometimes when
3137 characters outside the basic ASCII character set are used, you can
3138 have two different character sequences that look the same. To
3139 avoid confusion, the ISO 10646 standard sets out some normalization
3140 rules which when applied ensure that two sequences that look the
3141 same are turned into the same sequence. GCC can warn you if you
3142 are using identifiers which have not been normalized; this option
3143 controls that warning.
3144
3145 There are four levels of warning that GCC supports. The default is
3146 -Wnormalized=nfc, which warns about any identifier which is not in
3147 the ISO 10646 "C" normalized form, NFC. NFC is the recommended
3148 form for most uses.
3149
3150 Unfortunately, there are some characters which ISO C and ISO C++
3151 allow in identifiers that when turned into NFC aren't allowable as
3152 identifiers. That is, there's no way to use these symbols in
3153 portable ISO C or C++ and have all your identifiers in NFC.
3154 -Wnormalized=id suppresses the warning for these characters. It is
3155 hoped that future versions of the standards involved will correct
3156 this, which is why this option is not the default.
3157
3158 You can switch the warning off for all characters by writing
3159 -Wnormalized=none. You would only want to do this if you were
3160 using some other normalization scheme (like "D"), because otherwise
3161 you can easily create bugs that are literally impossible to see.
3162
3163 Some characters in ISO 10646 have distinct meanings but look
3164 identical in some fonts or display methodologies, especially once
3165 formatting has been applied. For instance "\u207F", "SUPERSCRIPT
3166 LATIN SMALL LETTER N", will display just like a regular "n" which
3167 has been placed in a superscript. ISO 10646 defines the NFKC
3168 normalization scheme to convert all these into a standard form as
3169 well, and GCC will warn if your code is not in NFKC if you use
3170 -Wnormalized=nfkc. This warning is comparable to warning about
3171 every identifier that contains the letter O because it might be
3172 confused with the digit 0, and so is not the default, but may be
3173 useful as a local coding convention if the programming environment
3174 is unable to be fixed to display these characters distinctly.
3175
3176 -Wno-deprecated
3177 Do not warn about usage of deprecated features.
3178
3179 -Wno-deprecated-declarations
3180 Do not warn about uses of functions, variables, and types marked as
3181 deprecated by using the "deprecated" attribute.
3182
3183 -Wno-overflow
3184 Do not warn about compile-time overflow in constant expressions.
3185
3186 -Woverride-init (C and Objective-C only)
3187 Warn if an initialized field without side effects is overridden
3188 when using designated initializers.
3189
3190 This warning is included in -Wextra. To get other -Wextra warnings
3191 without this one, use -Wextra -Wno-override-init.
3192
3193 -Wpacked
3194 Warn if a structure is given the packed attribute, but the packed
3195 attribute has no effect on the layout or size of the structure.
3196 Such structures may be mis-aligned for little benefit. For
3197 instance, in this code, the variable "f.x" in "struct bar" will be
3198 misaligned even though "struct bar" does not itself have the packed
3199 attribute:
3200
3201 struct foo {
3202 int x;
3203 char a, b, c, d;
3204 } __attribute__((packed));
3205 struct bar {
3206 char z;
3207 struct foo f;
3208 };
3209
3210 -Wpacked-bitfield-compat
3211 The 4.1, 4.2 and 4.3 series of GCC ignore the "packed" attribute on
3212 bit-fields of type "char". This has been fixed in GCC 4.4 but the
3213 change can lead to differences in the structure layout. GCC
3214 informs you when the offset of such a field has changed in GCC 4.4.
3215 For example there is no longer a 4-bit padding between field "a"
3216 and "b" in this structure:
3217
3218 struct foo
3219 {
3220 char a:4;
3221 char b:8;
3222 } __attribute__ ((packed));
3223
3224 This warning is enabled by default. Use
3225 -Wno-packed-bitfield-compat to disable this warning.
3226
3227 -Wpadded
3228 Warn if padding is included in a structure, either to align an
3229 element of the structure or to align the whole structure.
3230 Sometimes when this happens it is possible to rearrange the fields
3231 of the structure to reduce the padding and so make the structure
3232 smaller.
3233
3234 -Wredundant-decls
3235 Warn if anything is declared more than once in the same scope, even
3236 in cases where multiple declaration is valid and changes nothing.
3237
3238 -Wnested-externs (C and Objective-C only)
3239 Warn if an "extern" declaration is encountered within a function.
3240
3241 -Winline
3242 Warn if a function can not be inlined and it was declared as
3243 inline. Even with this option, the compiler will not warn about
3244 failures to inline functions declared in system headers.
3245
3246 The compiler uses a variety of heuristics to determine whether or
3247 not to inline a function. For example, the compiler takes into
3248 account the size of the function being inlined and the amount of
3249 inlining that has already been done in the current function.
3250 Therefore, seemingly insignificant changes in the source program
3251 can cause the warnings produced by -Winline to appear or disappear.
3252
3253 -Wno-invalid-offsetof (C++ and Objective-C++ only)
3254 Suppress warnings from applying the offsetof macro to a non-POD
3255 type. According to the 1998 ISO C++ standard, applying offsetof to
3256 a non-POD type is undefined. In existing C++ implementations,
3257 however, offsetof typically gives meaningful results even when
3258 applied to certain kinds of non-POD types. (Such as a simple struct
3259 that fails to be a POD type only by virtue of having a
3260 constructor.) This flag is for users who are aware that they are
3261 writing nonportable code and who have deliberately chosen to ignore
3262 the warning about it.
3263
3264 The restrictions on offsetof may be relaxed in a future version of
3265 the C++ standard.
3266
3267 -Wno-int-to-pointer-cast (C and Objective-C only)
3268 Suppress warnings from casts to pointer type of an integer of a
3269 different size.
3270
3271 -Wno-pointer-to-int-cast (C and Objective-C only)
3272 Suppress warnings from casts from a pointer to an integer type of a
3273 different size.
3274
3275 -Winvalid-pch
3276 Warn if a precompiled header is found in the search path but can't
3277 be used.
3278
3279 -Wlong-long
3280 Warn if long long type is used. This is enabled by either
3281 -pedantic or -Wtraditional in ISO C90 and C++98 modes. To inhibit
3282 the warning messages, use -Wno-long-long.
3283
3284 -Wvariadic-macros
3285 Warn if variadic macros are used in pedantic ISO C90 mode, or the
3286 GNU alternate syntax when in pedantic ISO C99 mode. This is
3287 default. To inhibit the warning messages, use
3288 -Wno-variadic-macros.
3289
3290 -Wvla
3291 Warn if variable length array is used in the code. -Wno-vla will
3292 prevent the -pedantic warning of the variable length array.
3293
3294 -Wvolatile-register-var
3295 Warn if a register variable is declared volatile. The volatile
3296 modifier does not inhibit all optimizations that may eliminate
3297 reads and/or writes to register variables. This warning is enabled
3298 by -Wall.
3299
3300 -Wdisabled-optimization
3301 Warn if a requested optimization pass is disabled. This warning
3302 does not generally indicate that there is anything wrong with your
3303 code; it merely indicates that GCC's optimizers were unable to
3304 handle the code effectively. Often, the problem is that your code
3305 is too big or too complex; GCC will refuse to optimize programs
3306 when the optimization itself is likely to take inordinate amounts
3307 of time.
3308
3309 -Wpointer-sign (C and Objective-C only)
3310 Warn for pointer argument passing or assignment with different
3311 signedness. This option is only supported for C and Objective-C.
3312 It is implied by -Wall and by -pedantic, which can be disabled with
3313 -Wno-pointer-sign.
3314
3315 -Wstack-protector
3316 This option is only active when -fstack-protector is active. It
3317 warns about functions that will not be protected against stack
3318 smashing.
3319
3320 -Wno-mudflap
3321 Suppress warnings about constructs that cannot be instrumented by
3322 -fmudflap.
3323
3324 -Woverlength-strings
3325 Warn about string constants which are longer than the "minimum
3326 maximum" length specified in the C standard. Modern compilers
3327 generally allow string constants which are much longer than the
3328 standard's minimum limit, but very portable programs should avoid
3329 using longer strings.
3330
3331 The limit applies after string constant concatenation, and does not
3332 count the trailing NUL. In C90, the limit was 509 characters; in
3333 C99, it was raised to 4095. C++98 does not specify a normative
3334 minimum maximum, so we do not diagnose overlength strings in C++.
3335
3336 This option is implied by -pedantic, and can be disabled with
3337 -Wno-overlength-strings.
3338
3339 -Wunsuffixed-float-constants (C and Objective-C only)
3340 GCC will issue a warning for any floating constant that does not
3341 have a suffix. When used together with -Wsystem-headers it will
3342 warn about such constants in system header files. This can be
3343 useful when preparing code to use with the "FLOAT_CONST_DECIMAL64"
3344 pragma from the decimal floating-point extension to C99.
3345
3346 Options for Debugging Your Program or GCC
3347 GCC has various special options that are used for debugging either your
3348 program or GCC:
3349
3350 -g Produce debugging information in the operating system's native
3351 format (stabs, COFF, XCOFF, or DWARF 2). GDB can work with this
3352 debugging information.
3353
3354 On most systems that use stabs format, -g enables use of extra
3355 debugging information that only GDB can use; this extra information
3356 makes debugging work better in GDB but will probably make other
3357 debuggers crash or refuse to read the program. If you want to
3358 control for certain whether to generate the extra information, use
3359 -gstabs+, -gstabs, -gxcoff+, -gxcoff, or -gvms (see below).
3360
3361 GCC allows you to use -g with -O. The shortcuts taken by optimized
3362 code may occasionally produce surprising results: some variables
3363 you declared may not exist at all; flow of control may briefly move
3364 where you did not expect it; some statements may not be executed
3365 because they compute constant results or their values were already
3366 at hand; some statements may execute in different places because
3367 they were moved out of loops.
3368
3369 Nevertheless it proves possible to debug optimized output. This
3370 makes it reasonable to use the optimizer for programs that might
3371 have bugs.
3372
3373 The following options are useful when GCC is generated with the
3374 capability for more than one debugging format.
3375
3376 -ggdb
3377 Produce debugging information for use by GDB. This means to use
3378 the most expressive format available (DWARF 2, stabs, or the native
3379 format if neither of those are supported), including GDB extensions
3380 if at all possible.
3381
3382 -gstabs
3383 Produce debugging information in stabs format (if that is
3384 supported), without GDB extensions. This is the format used by DBX
3385 on most BSD systems. On MIPS, Alpha and System V Release 4 systems
3386 this option produces stabs debugging output which is not understood
3387 by DBX or SDB. On System V Release 4 systems this option requires
3388 the GNU assembler.
3389
3390 -feliminate-unused-debug-symbols
3391 Produce debugging information in stabs format (if that is
3392 supported), for only symbols that are actually used.
3393
3394 -femit-class-debug-always
3395 Instead of emitting debugging information for a C++ class in only
3396 one object file, emit it in all object files using the class. This
3397 option should be used only with debuggers that are unable to handle
3398 the way GCC normally emits debugging information for classes
3399 because using this option will increase the size of debugging
3400 information by as much as a factor of two.
3401
3402 -gstabs+
3403 Produce debugging information in stabs format (if that is
3404 supported), using GNU extensions understood only by the GNU
3405 debugger (GDB). The use of these extensions is likely to make
3406 other debuggers crash or refuse to read the program.
3407
3408 -gcoff
3409 Produce debugging information in COFF format (if that is
3410 supported). This is the format used by SDB on most System V
3411 systems prior to System V Release 4.
3412
3413 -gxcoff
3414 Produce debugging information in XCOFF format (if that is
3415 supported). This is the format used by the DBX debugger on IBM
3416 RS/6000 systems.
3417
3418 -gxcoff+
3419 Produce debugging information in XCOFF format (if that is
3420 supported), using GNU extensions understood only by the GNU
3421 debugger (GDB). The use of these extensions is likely to make
3422 other debuggers crash or refuse to read the program, and may cause
3423 assemblers other than the GNU assembler (GAS) to fail with an
3424 error.
3425
3426 -gdwarf-version
3427 Produce debugging information in DWARF format (if that is
3428 supported). This is the format used by DBX on IRIX 6. The value
3429 of version may be either 2, 3 or 4; the default version is 2.
3430
3431 Note that with DWARF version 2 some ports require, and will always
3432 use, some non-conflicting DWARF 3 extensions in the unwind tables.
3433
3434 Version 4 may require GDB 7.0 and -fvar-tracking-assignments for
3435 maximum benefit.
3436
3437 -gstrict-dwarf
3438 Disallow using extensions of later DWARF standard version than
3439 selected with -gdwarf-version. On most targets using non-
3440 conflicting DWARF extensions from later standard versions is
3441 allowed.
3442
3443 -gno-strict-dwarf
3444 Allow using extensions of later DWARF standard version than
3445 selected with -gdwarf-version.
3446
3447 -gvms
3448 Produce debugging information in VMS debug format (if that is
3449 supported). This is the format used by DEBUG on VMS systems.
3450
3451 -glevel
3452 -ggdblevel
3453 -gstabslevel
3454 -gcofflevel
3455 -gxcofflevel
3456 -gvmslevel
3457 Request debugging information and also use level to specify how
3458 much information. The default level is 2.
3459
3460 Level 0 produces no debug information at all. Thus, -g0 negates
3461 -g.
3462
3463 Level 1 produces minimal information, enough for making backtraces
3464 in parts of the program that you don't plan to debug. This
3465 includes descriptions of functions and external variables, but no
3466 information about local variables and no line numbers.
3467
3468 Level 3 includes extra information, such as all the macro
3469 definitions present in the program. Some debuggers support macro
3470 expansion when you use -g3.
3471
3472 -gdwarf-2 does not accept a concatenated debug level, because GCC
3473 used to support an option -gdwarf that meant to generate debug
3474 information in version 1 of the DWARF format (which is very
3475 different from version 2), and it would have been too confusing.
3476 That debug format is long obsolete, but the option cannot be
3477 changed now. Instead use an additional -glevel option to change
3478 the debug level for DWARF.
3479
3480 -gtoggle
3481 Turn off generation of debug info, if leaving out this option would
3482 have generated it, or turn it on at level 2 otherwise. The
3483 position of this argument in the command line does not matter, it
3484 takes effect after all other options are processed, and it does so
3485 only once, no matter how many times it is given. This is mainly
3486 intended to be used with -fcompare-debug.
3487
3488 -fdump-final-insns[=file]
3489 Dump the final internal representation (RTL) to file. If the
3490 optional argument is omitted (or if file is "."), the name of the
3491 dump file will be determined by appending ".gkd" to the compilation
3492 output file name.
3493
3494 -fcompare-debug[=opts]
3495 If no error occurs during compilation, run the compiler a second
3496 time, adding opts and -fcompare-debug-second to the arguments
3497 passed to the second compilation. Dump the final internal
3498 representation in both compilations, and print an error if they
3499 differ.
3500
3501 If the equal sign is omitted, the default -gtoggle is used.
3502
3503 The environment variable GCC_COMPARE_DEBUG, if defined, non-empty
3504 and nonzero, implicitly enables -fcompare-debug. If
3505 GCC_COMPARE_DEBUG is defined to a string starting with a dash, then
3506 it is used for opts, otherwise the default -gtoggle is used.
3507
3508 -fcompare-debug=, with the equal sign but without opts, is
3509 equivalent to -fno-compare-debug, which disables the dumping of the
3510 final representation and the second compilation, preventing even
3511 GCC_COMPARE_DEBUG from taking effect.
3512
3513 To verify full coverage during -fcompare-debug testing, set
3514 GCC_COMPARE_DEBUG to say -fcompare-debug-not-overridden, which GCC
3515 will reject as an invalid option in any actual compilation (rather
3516 than preprocessing, assembly or linking). To get just a warning,
3517 setting GCC_COMPARE_DEBUG to -w%n-fcompare-debug not overridden
3518 will do.
3519
3520 -fcompare-debug-second
3521 This option is implicitly passed to the compiler for the second
3522 compilation requested by -fcompare-debug, along with options to
3523 silence warnings, and omitting other options that would cause side-
3524 effect compiler outputs to files or to the standard output. Dump
3525 files and preserved temporary files are renamed so as to contain
3526 the ".gk" additional extension during the second compilation, to
3527 avoid overwriting those generated by the first.
3528
3529 When this option is passed to the compiler driver, it causes the
3530 first compilation to be skipped, which makes it useful for little
3531 other than debugging the compiler proper.
3532
3533 -feliminate-dwarf2-dups
3534 Compress DWARF2 debugging information by eliminating duplicated
3535 information about each symbol. This option only makes sense when
3536 generating DWARF2 debugging information with -gdwarf-2.
3537
3538 -femit-struct-debug-baseonly
3539 Emit debug information for struct-like types only when the base
3540 name of the compilation source file matches the base name of file
3541 in which the struct was defined.
3542
3543 This option substantially reduces the size of debugging
3544 information, but at significant potential loss in type information
3545 to the debugger. See -femit-struct-debug-reduced for a less
3546 aggressive option. See -femit-struct-debug-detailed for more
3547 detailed control.
3548
3549 This option works only with DWARF 2.
3550
3551 -femit-struct-debug-reduced
3552 Emit debug information for struct-like types only when the base
3553 name of the compilation source file matches the base name of file
3554 in which the type was defined, unless the struct is a template or
3555 defined in a system header.
3556
3557 This option significantly reduces the size of debugging
3558 information, with some potential loss in type information to the
3559 debugger. See -femit-struct-debug-baseonly for a more aggressive
3560 option. See -femit-struct-debug-detailed for more detailed
3561 control.
3562
3563 This option works only with DWARF 2.
3564
3565 -femit-struct-debug-detailed[=spec-list]
3566 Specify the struct-like types for which the compiler will generate
3567 debug information. The intent is to reduce duplicate struct debug
3568 information between different object files within the same program.
3569
3570 This option is a detailed version of -femit-struct-debug-reduced
3571 and -femit-struct-debug-baseonly, which will serve for most needs.
3572
3573 A specification has the syntax
3574 [dir:|ind:][ord:|gen:](any|sys|base|none)
3575
3576 The optional first word limits the specification to structs that
3577 are used directly (dir:) or used indirectly (ind:). A struct type
3578 is used directly when it is the type of a variable, member.
3579 Indirect uses arise through pointers to structs. That is, when use
3580 of an incomplete struct would be legal, the use is indirect. An
3581 example is struct one direct; struct two * indirect;.
3582
3583 The optional second word limits the specification to ordinary
3584 structs (ord:) or generic structs (gen:). Generic structs are a
3585 bit complicated to explain. For C++, these are non-explicit
3586 specializations of template classes, or non-template classes within
3587 the above. Other programming languages have generics, but
3588 -femit-struct-debug-detailed does not yet implement them.
3589
3590 The third word specifies the source files for those structs for
3591 which the compiler will emit debug information. The values none
3592 and any have the normal meaning. The value base means that the
3593 base of name of the file in which the type declaration appears must
3594 match the base of the name of the main compilation file. In
3595 practice, this means that types declared in foo.c and foo.h will
3596 have debug information, but types declared in other header will
3597 not. The value sys means those types satisfying base or declared
3598 in system or compiler headers.
3599
3600 You may need to experiment to determine the best settings for your
3601 application.
3602
3603 The default is -femit-struct-debug-detailed=all.
3604
3605 This option works only with DWARF 2.
3606
3607 -fenable-icf-debug
3608 Generate additional debug information to support identical code
3609 folding (ICF). This option only works with DWARF version 2 or
3610 higher.
3611
3612 -fno-merge-debug-strings
3613 Direct the linker to not merge together strings in the debugging
3614 information which are identical in different object files. Merging
3615 is not supported by all assemblers or linkers. Merging decreases
3616 the size of the debug information in the output file at the cost of
3617 increasing link processing time. Merging is enabled by default.
3618
3619 -fdebug-prefix-map=old=new
3620 When compiling files in directory old, record debugging information
3621 describing them as in new instead.
3622
3623 -fno-dwarf2-cfi-asm
3624 Emit DWARF 2 unwind info as compiler generated ".eh_frame" section
3625 instead of using GAS ".cfi_*" directives.
3626
3627 -p Generate extra code to write profile information suitable for the
3628 analysis program prof. You must use this option when compiling the
3629 source files you want data about, and you must also use it when
3630 linking.
3631
3632 -pg Generate extra code to write profile information suitable for the
3633 analysis program gprof. You must use this option when compiling
3634 the source files you want data about, and you must also use it when
3635 linking.
3636
3637 -Q Makes the compiler print out each function name as it is compiled,
3638 and print some statistics about each pass when it finishes.
3639
3640 -ftime-report
3641 Makes the compiler print some statistics about the time consumed by
3642 each pass when it finishes.
3643
3644 -fmem-report
3645 Makes the compiler print some statistics about permanent memory
3646 allocation when it finishes.
3647
3648 -fpre-ipa-mem-report
3649 -fpost-ipa-mem-report
3650 Makes the compiler print some statistics about permanent memory
3651 allocation before or after interprocedural optimization.
3652
3653 -fprofile-arcs
3654 Add code so that program flow arcs are instrumented. During
3655 execution the program records how many times each branch and call
3656 is executed and how many times it is taken or returns. When the
3657 compiled program exits it saves this data to a file called
3658 auxname.gcda for each source file. The data may be used for
3659 profile-directed optimizations (-fbranch-probabilities), or for
3660 test coverage analysis (-ftest-coverage). Each object file's
3661 auxname is generated from the name of the output file, if
3662 explicitly specified and it is not the final executable, otherwise
3663 it is the basename of the source file. In both cases any suffix is
3664 removed (e.g. foo.gcda for input file dir/foo.c, or dir/foo.gcda
3665 for output file specified as -o dir/foo.o).
3666
3667 --coverage
3668 This option is used to compile and link code instrumented for
3669 coverage analysis. The option is a synonym for -fprofile-arcs
3670 -ftest-coverage (when compiling) and -lgcov (when linking). See
3671 the documentation for those options for more details.
3672
3673 · Compile the source files with -fprofile-arcs plus optimization
3674 and code generation options. For test coverage analysis, use
3675 the additional -ftest-coverage option. You do not need to
3676 profile every source file in a program.
3677
3678 · Link your object files with -lgcov or -fprofile-arcs (the
3679 latter implies the former).
3680
3681 · Run the program on a representative workload to generate the
3682 arc profile information. This may be repeated any number of
3683 times. You can run concurrent instances of your program, and
3684 provided that the file system supports locking, the data files
3685 will be correctly updated. Also "fork" calls are detected and
3686 correctly handled (double counting will not happen).
3687
3688 · For profile-directed optimizations, compile the source files
3689 again with the same optimization and code generation options
3690 plus -fbranch-probabilities.
3691
3692 · For test coverage analysis, use gcov to produce human readable
3693 information from the .gcno and .gcda files. Refer to the gcov
3694 documentation for further information.
3695
3696 With -fprofile-arcs, for each function of your program GCC creates
3697 a program flow graph, then finds a spanning tree for the graph.
3698 Only arcs that are not on the spanning tree have to be
3699 instrumented: the compiler adds code to count the number of times
3700 that these arcs are executed. When an arc is the only exit or only
3701 entrance to a block, the instrumentation code can be added to the
3702 block; otherwise, a new basic block must be created to hold the
3703 instrumentation code.
3704
3705 -ftest-coverage
3706 Produce a notes file that the gcov code-coverage utility can use to
3707 show program coverage. Each source file's note file is called
3708 auxname.gcno. Refer to the -fprofile-arcs option above for a
3709 description of auxname and instructions on how to generate test
3710 coverage data. Coverage data will match the source files more
3711 closely, if you do not optimize.
3712
3713 -fdbg-cnt-list
3714 Print the name and the counter upperbound for all debug counters.
3715
3716 -fdbg-cnt=counter-value-list
3717 Set the internal debug counter upperbound. counter-value-list is a
3718 comma-separated list of name:value pairs which sets the upperbound
3719 of each debug counter name to value. All debug counters have the
3720 initial upperbound of UINT_MAX, thus dbg_cnt() returns true always
3721 unless the upperbound is set by this option. e.g. With
3722 -fdbg-cnt=dce:10,tail_call:0 dbg_cnt(dce) will return true only for
3723 first 10 invocations and dbg_cnt(tail_call) will return false
3724 always.
3725
3726 -dletters
3727 -fdump-rtl-pass
3728 Says to make debugging dumps during compilation at times specified
3729 by letters. This is used for debugging the RTL-based passes of the
3730 compiler. The file names for most of the dumps are made by
3731 appending a pass number and a word to the dumpname, and the files
3732 are created in the directory of the output file. dumpname is
3733 generated from the name of the output file, if explicitly specified
3734 and it is not an executable, otherwise it is the basename of the
3735 source file. These switches may have different effects when -E is
3736 used for preprocessing.
3737
3738 Debug dumps can be enabled with a -fdump-rtl switch or some -d
3739 option letters. Here are the possible letters for use in pass and
3740 letters, and their meanings:
3741
3742 -fdump-rtl-alignments
3743 Dump after branch alignments have been computed.
3744
3745 -fdump-rtl-asmcons
3746 Dump after fixing rtl statements that have unsatisfied in/out
3747 constraints.
3748
3749 -fdump-rtl-auto_inc_dec
3750 Dump after auto-inc-dec discovery. This pass is only run on
3751 architectures that have auto inc or auto dec instructions.
3752
3753 -fdump-rtl-barriers
3754 Dump after cleaning up the barrier instructions.
3755
3756 -fdump-rtl-bbpart
3757 Dump after partitioning hot and cold basic blocks.
3758
3759 -fdump-rtl-bbro
3760 Dump after block reordering.
3761
3762 -fdump-rtl-btl1
3763 -fdump-rtl-btl2
3764 -fdump-rtl-btl1 and -fdump-rtl-btl2 enable dumping after the
3765 two branch target load optimization passes.
3766
3767 -fdump-rtl-bypass
3768 Dump after jump bypassing and control flow optimizations.
3769
3770 -fdump-rtl-combine
3771 Dump after the RTL instruction combination pass.
3772
3773 -fdump-rtl-compgotos
3774 Dump after duplicating the computed gotos.
3775
3776 -fdump-rtl-ce1
3777 -fdump-rtl-ce2
3778 -fdump-rtl-ce3
3779 -fdump-rtl-ce1, -fdump-rtl-ce2, and -fdump-rtl-ce3 enable
3780 dumping after the three if conversion passes.
3781
3782 -fdump-rtl-cprop_hardreg
3783 Dump after hard register copy propagation.
3784
3785 -fdump-rtl-csa
3786 Dump after combining stack adjustments.
3787
3788 -fdump-rtl-cse1
3789 -fdump-rtl-cse2
3790 -fdump-rtl-cse1 and -fdump-rtl-cse2 enable dumping after the
3791 two common sub-expression elimination passes.
3792
3793 -fdump-rtl-dce
3794 Dump after the standalone dead code elimination passes.
3795
3796 -fdump-rtl-dbr
3797 Dump after delayed branch scheduling.
3798
3799 -fdump-rtl-dce1
3800 -fdump-rtl-dce2
3801 -fdump-rtl-dce1 and -fdump-rtl-dce2 enable dumping after the
3802 two dead store elimination passes.
3803
3804 -fdump-rtl-eh
3805 Dump after finalization of EH handling code.
3806
3807 -fdump-rtl-eh_ranges
3808 Dump after conversion of EH handling range regions.
3809
3810 -fdump-rtl-expand
3811 Dump after RTL generation.
3812
3813 -fdump-rtl-fwprop1
3814 -fdump-rtl-fwprop2
3815 -fdump-rtl-fwprop1 and -fdump-rtl-fwprop2 enable dumping after
3816 the two forward propagation passes.
3817
3818 -fdump-rtl-gcse1
3819 -fdump-rtl-gcse2
3820 -fdump-rtl-gcse1 and -fdump-rtl-gcse2 enable dumping after
3821 global common subexpression elimination.
3822
3823 -fdump-rtl-init-regs
3824 Dump after the initialization of the registers.
3825
3826 -fdump-rtl-initvals
3827 Dump after the computation of the initial value sets.
3828
3829 -fdump-rtl-into_cfglayout
3830 Dump after converting to cfglayout mode.
3831
3832 -fdump-rtl-ira
3833 Dump after iterated register allocation.
3834
3835 -fdump-rtl-jump
3836 Dump after the second jump optimization.
3837
3838 -fdump-rtl-loop2
3839 -fdump-rtl-loop2 enables dumping after the rtl loop
3840 optimization passes.
3841
3842 -fdump-rtl-mach
3843 Dump after performing the machine dependent reorganization
3844 pass, if that pass exists.
3845
3846 -fdump-rtl-mode_sw
3847 Dump after removing redundant mode switches.
3848
3849 -fdump-rtl-rnreg
3850 Dump after register renumbering.
3851
3852 -fdump-rtl-outof_cfglayout
3853 Dump after converting from cfglayout mode.
3854
3855 -fdump-rtl-peephole2
3856 Dump after the peephole pass.
3857
3858 -fdump-rtl-postreload
3859 Dump after post-reload optimizations.
3860
3861 -fdump-rtl-pro_and_epilogue
3862 Dump after generating the function pro and epilogues.
3863
3864 -fdump-rtl-regmove
3865 Dump after the register move pass.
3866
3867 -fdump-rtl-sched1
3868 -fdump-rtl-sched2
3869 -fdump-rtl-sched1 and -fdump-rtl-sched2 enable dumping after
3870 the basic block scheduling passes.
3871
3872 -fdump-rtl-see
3873 Dump after sign extension elimination.
3874
3875 -fdump-rtl-seqabstr
3876 Dump after common sequence discovery.
3877
3878 -fdump-rtl-shorten
3879 Dump after shortening branches.
3880
3881 -fdump-rtl-sibling
3882 Dump after sibling call optimizations.
3883
3884 -fdump-rtl-split1
3885 -fdump-rtl-split2
3886 -fdump-rtl-split3
3887 -fdump-rtl-split4
3888 -fdump-rtl-split5
3889 -fdump-rtl-split1, -fdump-rtl-split2, -fdump-rtl-split3,
3890 -fdump-rtl-split4 and -fdump-rtl-split5 enable dumping after
3891 five rounds of instruction splitting.
3892
3893 -fdump-rtl-sms
3894 Dump after modulo scheduling. This pass is only run on some
3895 architectures.
3896
3897 -fdump-rtl-stack
3898 Dump after conversion from GCC's "flat register file" registers
3899 to the x87's stack-like registers. This pass is only run on
3900 x86 variants.
3901
3902 -fdump-rtl-subreg1
3903 -fdump-rtl-subreg2
3904 -fdump-rtl-subreg1 and -fdump-rtl-subreg2 enable dumping after
3905 the two subreg expansion passes.
3906
3907 -fdump-rtl-unshare
3908 Dump after all rtl has been unshared.
3909
3910 -fdump-rtl-vartrack
3911 Dump after variable tracking.
3912
3913 -fdump-rtl-vregs
3914 Dump after converting virtual registers to hard registers.
3915
3916 -fdump-rtl-web
3917 Dump after live range splitting.
3918
3919 -fdump-rtl-regclass
3920 -fdump-rtl-subregs_of_mode_init
3921 -fdump-rtl-subregs_of_mode_finish
3922 -fdump-rtl-dfinit
3923 -fdump-rtl-dfinish
3924 These dumps are defined but always produce empty files.
3925
3926 -fdump-rtl-all
3927 Produce all the dumps listed above.
3928
3929 -dA Annotate the assembler output with miscellaneous debugging
3930 information.
3931
3932 -dD Dump all macro definitions, at the end of preprocessing, in
3933 addition to normal output.
3934
3935 -dH Produce a core dump whenever an error occurs.
3936
3937 -dm Print statistics on memory usage, at the end of the run, to
3938 standard error.
3939
3940 -dp Annotate the assembler output with a comment indicating which
3941 pattern and alternative was used. The length of each
3942 instruction is also printed.
3943
3944 -dP Dump the RTL in the assembler output as a comment before each
3945 instruction. Also turns on -dp annotation.
3946
3947 -dv For each of the other indicated dump files (-fdump-rtl-pass),
3948 dump a representation of the control flow graph suitable for
3949 viewing with VCG to file.pass.vcg.
3950
3951 -dx Just generate RTL for a function instead of compiling it.
3952 Usually used with -fdump-rtl-expand.
3953
3954 -dy Dump debugging information during parsing, to standard error.
3955
3956 -fdump-noaddr
3957 When doing debugging dumps, suppress address output. This makes it
3958 more feasible to use diff on debugging dumps for compiler
3959 invocations with different compiler binaries and/or different text
3960 / bss / data / heap / stack / dso start locations.
3961
3962 -fdump-unnumbered
3963 When doing debugging dumps, suppress instruction numbers and
3964 address output. This makes it more feasible to use diff on
3965 debugging dumps for compiler invocations with different options, in
3966 particular with and without -g.
3967
3968 -fdump-unnumbered-links
3969 When doing debugging dumps (see -d option above), suppress
3970 instruction numbers for the links to the previous and next
3971 instructions in a sequence.
3972
3973 -fdump-translation-unit (C++ only)
3974 -fdump-translation-unit-options (C++ only)
3975 Dump a representation of the tree structure for the entire
3976 translation unit to a file. The file name is made by appending .tu
3977 to the source file name, and the file is created in the same
3978 directory as the output file. If the -options form is used,
3979 options controls the details of the dump as described for the
3980 -fdump-tree options.
3981
3982 -fdump-class-hierarchy (C++ only)
3983 -fdump-class-hierarchy-options (C++ only)
3984 Dump a representation of each class's hierarchy and virtual
3985 function table layout to a file. The file name is made by
3986 appending .class to the source file name, and the file is created
3987 in the same directory as the output file. If the -options form is
3988 used, options controls the details of the dump as described for the
3989 -fdump-tree options.
3990
3991 -fdump-ipa-switch
3992 Control the dumping at various stages of inter-procedural analysis
3993 language tree to a file. The file name is generated by appending a
3994 switch specific suffix to the source file name, and the file is
3995 created in the same directory as the output file. The following
3996 dumps are possible:
3997
3998 all Enables all inter-procedural analysis dumps.
3999
4000 cgraph
4001 Dumps information about call-graph optimization, unused
4002 function removal, and inlining decisions.
4003
4004 inline
4005 Dump after function inlining.
4006
4007 -fdump-statistics-option
4008 Enable and control dumping of pass statistics in a separate file.
4009 The file name is generated by appending a suffix ending in
4010 .statistics to the source file name, and the file is created in the
4011 same directory as the output file. If the -option form is used,
4012 -stats will cause counters to be summed over the whole compilation
4013 unit while -details will dump every event as the passes generate
4014 them. The default with no option is to sum counters for each
4015 function compiled.
4016
4017 -fdump-tree-switch
4018 -fdump-tree-switch-options
4019 Control the dumping at various stages of processing the
4020 intermediate language tree to a file. The file name is generated
4021 by appending a switch specific suffix to the source file name, and
4022 the file is created in the same directory as the output file. If
4023 the -options form is used, options is a list of - separated options
4024 that control the details of the dump. Not all options are
4025 applicable to all dumps, those which are not meaningful will be
4026 ignored. The following options are available
4027
4028 address
4029 Print the address of each node. Usually this is not meaningful
4030 as it changes according to the environment and source file.
4031 Its primary use is for tying up a dump file with a debug
4032 environment.
4033
4034 asmname
4035 If "DECL_ASSEMBLER_NAME" has been set for a given decl, use
4036 that in the dump instead of "DECL_NAME". Its primary use is
4037 ease of use working backward from mangled names in the assembly
4038 file.
4039
4040 slim
4041 Inhibit dumping of members of a scope or body of a function
4042 merely because that scope has been reached. Only dump such
4043 items when they are directly reachable by some other path.
4044 When dumping pretty-printed trees, this option inhibits dumping
4045 the bodies of control structures.
4046
4047 raw Print a raw representation of the tree. By default, trees are
4048 pretty-printed into a C-like representation.
4049
4050 details
4051 Enable more detailed dumps (not honored by every dump option).
4052
4053 stats
4054 Enable dumping various statistics about the pass (not honored
4055 by every dump option).
4056
4057 blocks
4058 Enable showing basic block boundaries (disabled in raw dumps).
4059
4060 vops
4061 Enable showing virtual operands for every statement.
4062
4063 lineno
4064 Enable showing line numbers for statements.
4065
4066 uid Enable showing the unique ID ("DECL_UID") for each variable.
4067
4068 verbose
4069 Enable showing the tree dump for each statement.
4070
4071 eh Enable showing the EH region number holding each statement.
4072
4073 all Turn on all options, except raw, slim, verbose and lineno.
4074
4075 The following tree dumps are possible:
4076
4077 original
4078 Dump before any tree based optimization, to file.original.
4079
4080 optimized
4081 Dump after all tree based optimization, to file.optimized.
4082
4083 gimple
4084 Dump each function before and after the gimplification pass to
4085 a file. The file name is made by appending .gimple to the
4086 source file name.
4087
4088 cfg Dump the control flow graph of each function to a file. The
4089 file name is made by appending .cfg to the source file name.
4090
4091 vcg Dump the control flow graph of each function to a file in VCG
4092 format. The file name is made by appending .vcg to the source
4093 file name. Note that if the file contains more than one
4094 function, the generated file cannot be used directly by VCG.
4095 You will need to cut and paste each function's graph into its
4096 own separate file first.
4097
4098 ch Dump each function after copying loop headers. The file name
4099 is made by appending .ch to the source file name.
4100
4101 ssa Dump SSA related information to a file. The file name is made
4102 by appending .ssa to the source file name.
4103
4104 alias
4105 Dump aliasing information for each function. The file name is
4106 made by appending .alias to the source file name.
4107
4108 ccp Dump each function after CCP. The file name is made by
4109 appending .ccp to the source file name.
4110
4111 storeccp
4112 Dump each function after STORE-CCP. The file name is made by
4113 appending .storeccp to the source file name.
4114
4115 pre Dump trees after partial redundancy elimination. The file name
4116 is made by appending .pre to the source file name.
4117
4118 fre Dump trees after full redundancy elimination. The file name is
4119 made by appending .fre to the source file name.
4120
4121 copyprop
4122 Dump trees after copy propagation. The file name is made by
4123 appending .copyprop to the source file name.
4124
4125 store_copyprop
4126 Dump trees after store copy-propagation. The file name is made
4127 by appending .store_copyprop to the source file name.
4128
4129 dce Dump each function after dead code elimination. The file name
4130 is made by appending .dce to the source file name.
4131
4132 mudflap
4133 Dump each function after adding mudflap instrumentation. The
4134 file name is made by appending .mudflap to the source file
4135 name.
4136
4137 sra Dump each function after performing scalar replacement of
4138 aggregates. The file name is made by appending .sra to the
4139 source file name.
4140
4141 sink
4142 Dump each function after performing code sinking. The file
4143 name is made by appending .sink to the source file name.
4144
4145 dom Dump each function after applying dominator tree optimizations.
4146 The file name is made by appending .dom to the source file
4147 name.
4148
4149 dse Dump each function after applying dead store elimination. The
4150 file name is made by appending .dse to the source file name.
4151
4152 phiopt
4153 Dump each function after optimizing PHI nodes into straightline
4154 code. The file name is made by appending .phiopt to the source
4155 file name.
4156
4157 forwprop
4158 Dump each function after forward propagating single use
4159 variables. The file name is made by appending .forwprop to the
4160 source file name.
4161
4162 copyrename
4163 Dump each function after applying the copy rename optimization.
4164 The file name is made by appending .copyrename to the source
4165 file name.
4166
4167 nrv Dump each function after applying the named return value
4168 optimization on generic trees. The file name is made by
4169 appending .nrv to the source file name.
4170
4171 vect
4172 Dump each function after applying vectorization of loops. The
4173 file name is made by appending .vect to the source file name.
4174
4175 slp Dump each function after applying vectorization of basic
4176 blocks. The file name is made by appending .slp to the source
4177 file name.
4178
4179 vrp Dump each function after Value Range Propagation (VRP). The
4180 file name is made by appending .vrp to the source file name.
4181
4182 all Enable all the available tree dumps with the flags provided in
4183 this option.
4184
4185 -ftree-vectorizer-verbose=n
4186 This option controls the amount of debugging output the vectorizer
4187 prints. This information is written to standard error, unless
4188 -fdump-tree-all or -fdump-tree-vect is specified, in which case it
4189 is output to the usual dump listing file, .vect. For n=0 no
4190 diagnostic information is reported. If n=1 the vectorizer reports
4191 each loop that got vectorized, and the total number of loops that
4192 got vectorized. If n=2 the vectorizer also reports non-vectorized
4193 loops that passed the first analysis phase (vect_analyze_loop_form)
4194 - i.e. countable, inner-most, single-bb, single-entry/exit loops.
4195 This is the same verbosity level that -fdump-tree-vect-stats uses.
4196 Higher verbosity levels mean either more information dumped for
4197 each reported loop, or same amount of information reported for more
4198 loops: if n=3, vectorizer cost model information is reported. If
4199 n=4, alignment related information is added to the reports. If
4200 n=5, data-references related information (e.g. memory dependences,
4201 memory access-patterns) is added to the reports. If n=6, the
4202 vectorizer reports also non-vectorized inner-most loops that did
4203 not pass the first analysis phase (i.e., may not be countable, or
4204 may have complicated control-flow). If n=7, the vectorizer reports
4205 also non-vectorized nested loops. If n=8, SLP related information
4206 is added to the reports. For n=9, all the information the
4207 vectorizer generates during its analysis and transformation is
4208 reported. This is the same verbosity level that
4209 -fdump-tree-vect-details uses.
4210
4211 -frandom-seed=string
4212 This option provides a seed that GCC uses when it would otherwise
4213 use random numbers. It is used to generate certain symbol names
4214 that have to be different in every compiled file. It is also used
4215 to place unique stamps in coverage data files and the object files
4216 that produce them. You can use the -frandom-seed option to produce
4217 reproducibly identical object files.
4218
4219 The string should be different for every file you compile.
4220
4221 -fsched-verbose=n
4222 On targets that use instruction scheduling, this option controls
4223 the amount of debugging output the scheduler prints. This
4224 information is written to standard error, unless -fdump-rtl-sched1
4225 or -fdump-rtl-sched2 is specified, in which case it is output to
4226 the usual dump listing file, .sched1 or .sched2 respectively.
4227 However for n greater than nine, the output is always printed to
4228 standard error.
4229
4230 For n greater than zero, -fsched-verbose outputs the same
4231 information as -fdump-rtl-sched1 and -fdump-rtl-sched2. For n
4232 greater than one, it also output basic block probabilities,
4233 detailed ready list information and unit/insn info. For n greater
4234 than two, it includes RTL at abort point, control-flow and regions
4235 info. And for n over four, -fsched-verbose also includes
4236 dependence info.
4237
4238 -save-temps
4239 -save-temps=cwd
4240 Store the usual "temporary" intermediate files permanently; place
4241 them in the current directory and name them based on the source
4242 file. Thus, compiling foo.c with -c -save-temps would produce
4243 files foo.i and foo.s, as well as foo.o. This creates a
4244 preprocessed foo.i output file even though the compiler now
4245 normally uses an integrated preprocessor.
4246
4247 When used in combination with the -x command line option,
4248 -save-temps is sensible enough to avoid over writing an input
4249 source file with the same extension as an intermediate file. The
4250 corresponding intermediate file may be obtained by renaming the
4251 source file before using -save-temps.
4252
4253 If you invoke GCC in parallel, compiling several different source
4254 files that share a common base name in different subdirectories or
4255 the same source file compiled for multiple output destinations, it
4256 is likely that the different parallel compilers will interfere with
4257 each other, and overwrite the temporary files. For instance:
4258
4259 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
4260 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
4261
4262 may result in foo.i and foo.o being written to simultaneously by
4263 both compilers.
4264
4265 -save-temps=obj
4266 Store the usual "temporary" intermediate files permanently. If the
4267 -o option is used, the temporary files are based on the object
4268 file. If the -o option is not used, the -save-temps=obj switch
4269 behaves like -save-temps.
4270
4271 For example:
4272
4273 gcc -save-temps=obj -c foo.c
4274 gcc -save-temps=obj -c bar.c -o dir/xbar.o
4275 gcc -save-temps=obj foobar.c -o dir2/yfoobar
4276
4277 would create foo.i, foo.s, dir/xbar.i, dir/xbar.s, dir2/yfoobar.i,
4278 dir2/yfoobar.s, and dir2/yfoobar.o.
4279
4280 -time[=file]
4281 Report the CPU time taken by each subprocess in the compilation
4282 sequence. For C source files, this is the compiler proper and
4283 assembler (plus the linker if linking is done).
4284
4285 Without the specification of an output file, the output looks like
4286 this:
4287
4288 # cc1 0.12 0.01
4289 # as 0.00 0.01
4290
4291 The first number on each line is the "user time", that is time
4292 spent executing the program itself. The second number is "system
4293 time", time spent executing operating system routines on behalf of
4294 the program. Both numbers are in seconds.
4295
4296 With the specification of an output file, the output is appended to
4297 the named file, and it looks like this:
4298
4299 0.12 0.01 cc1 <options>
4300 0.00 0.01 as <options>
4301
4302 The "user time" and the "system time" are moved before the program
4303 name, and the options passed to the program are displayed, so that
4304 one can later tell what file was being compiled, and with which
4305 options.
4306
4307 -fvar-tracking
4308 Run variable tracking pass. It computes where variables are stored
4309 at each position in code. Better debugging information is then
4310 generated (if the debugging information format supports this
4311 information).
4312
4313 It is enabled by default when compiling with optimization (-Os, -O,
4314 -O2, ...), debugging information (-g) and the debug info format
4315 supports it.
4316
4317 -fvar-tracking-assignments
4318 Annotate assignments to user variables early in the compilation and
4319 attempt to carry the annotations over throughout the compilation
4320 all the way to the end, in an attempt to improve debug information
4321 while optimizing. Use of -gdwarf-4 is recommended along with it.
4322
4323 It can be enabled even if var-tracking is disabled, in which case
4324 annotations will be created and maintained, but discarded at the
4325 end.
4326
4327 -fvar-tracking-assignments-toggle
4328 Toggle -fvar-tracking-assignments, in the same way that -gtoggle
4329 toggles -g.
4330
4331 -print-file-name=library
4332 Print the full absolute name of the library file library that would
4333 be used when linking---and don't do anything else. With this
4334 option, GCC does not compile or link anything; it just prints the
4335 file name.
4336
4337 -print-multi-directory
4338 Print the directory name corresponding to the multilib selected by
4339 any other switches present in the command line. This directory is
4340 supposed to exist in GCC_EXEC_PREFIX.
4341
4342 -print-multi-lib
4343 Print the mapping from multilib directory names to compiler
4344 switches that enable them. The directory name is separated from
4345 the switches by ;, and each switch starts with an @} instead of the
4346 @samp{-, without spaces between multiple switches. This is
4347 supposed to ease shell-processing.
4348
4349 -print-multi-os-directory
4350 Print the path to OS libraries for the selected multilib, relative
4351 to some lib subdirectory. If OS libraries are present in the lib
4352 subdirectory and no multilibs are used, this is usually just ., if
4353 OS libraries are present in libsuffix sibling directories this
4354 prints e.g. ../lib64, ../lib or ../lib32, or if OS libraries are
4355 present in lib/subdir subdirectories it prints e.g. amd64, sparcv9
4356 or ev6.
4357
4358 -print-prog-name=program
4359 Like -print-file-name, but searches for a program such as cpp.
4360
4361 -print-libgcc-file-name
4362 Same as -print-file-name=libgcc.a.
4363
4364 This is useful when you use -nostdlib or -nodefaultlibs but you do
4365 want to link with libgcc.a. You can do
4366
4367 gcc -nostdlib <files>... `gcc -print-libgcc-file-name`
4368
4369 -print-search-dirs
4370 Print the name of the configured installation directory and a list
4371 of program and library directories gcc will search---and don't do
4372 anything else.
4373
4374 This is useful when gcc prints the error message installation
4375 problem, cannot exec cpp0: No such file or directory. To resolve
4376 this you either need to put cpp0 and the other compiler components
4377 where gcc expects to find them, or you can set the environment
4378 variable GCC_EXEC_PREFIX to the directory where you installed them.
4379 Don't forget the trailing /.
4380
4381 -print-sysroot
4382 Print the target sysroot directory that will be used during
4383 compilation. This is the target sysroot specified either at
4384 configure time or using the --sysroot option, possibly with an
4385 extra suffix that depends on compilation options. If no target
4386 sysroot is specified, the option prints nothing.
4387
4388 -print-sysroot-headers-suffix
4389 Print the suffix added to the target sysroot when searching for
4390 headers, or give an error if the compiler is not configured with
4391 such a suffix---and don't do anything else.
4392
4393 -dumpmachine
4394 Print the compiler's target machine (for example,
4395 i686-pc-linux-gnu)---and don't do anything else.
4396
4397 -dumpversion
4398 Print the compiler version (for example, 3.0)---and don't do
4399 anything else.
4400
4401 -dumpspecs
4402 Print the compiler's built-in specs---and don't do anything else.
4403 (This is used when GCC itself is being built.)
4404
4405 -feliminate-unused-debug-types
4406 Normally, when producing DWARF2 output, GCC will emit debugging
4407 information for all types declared in a compilation unit,
4408 regardless of whether or not they are actually used in that
4409 compilation unit. Sometimes this is useful, such as if, in the
4410 debugger, you want to cast a value to a type that is not actually
4411 used in your program (but is declared). More often, however, this
4412 results in a significant amount of wasted space. With this option,
4413 GCC will avoid producing debug symbol output for types that are
4414 nowhere used in the source file being compiled.
4415
4416 Options That Control Optimization
4417 These options control various sorts of optimizations.
4418
4419 Without any optimization option, the compiler's goal is to reduce the
4420 cost of compilation and to make debugging produce the expected results.
4421 Statements are independent: if you stop the program with a breakpoint
4422 between statements, you can then assign a new value to any variable or
4423 change the program counter to any other statement in the function and
4424 get exactly the results you would expect from the source code.
4425
4426 Turning on optimization flags makes the compiler attempt to improve the
4427 performance and/or code size at the expense of compilation time and
4428 possibly the ability to debug the program.
4429
4430 The compiler performs optimization based on the knowledge it has of the
4431 program. Compiling multiple files at once to a single output file mode
4432 allows the compiler to use information gained from all of the files
4433 when compiling each of them.
4434
4435 Not all optimizations are controlled directly by a flag. Only
4436 optimizations that have a flag are listed in this section.
4437
4438 Most optimizations are only enabled if an -O level is set on the
4439 command line. Otherwise they are disabled, even if individual
4440 optimization flags are specified.
4441
4442 Depending on the target and how GCC was configured, a slightly
4443 different set of optimizations may be enabled at each -O level than
4444 those listed here. You can invoke GCC with -Q --help=optimizers to
4445 find out the exact set of optimizations that are enabled at each level.
4446
4447 -O
4448 -O1 Optimize. Optimizing compilation takes somewhat more time, and a
4449 lot more memory for a large function.
4450
4451 With -O, the compiler tries to reduce code size and execution time,
4452 without performing any optimizations that take a great deal of
4453 compilation time.
4454
4455 -O turns on the following optimization flags:
4456
4457 -fauto-inc-dec -fcprop-registers -fdce -fdefer-pop -fdelayed-branch
4458 -fdse -fguess-branch-probability -fif-conversion2 -fif-conversion
4459 -fipa-pure-const -fipa-reference -fmerge-constants
4460 -fsplit-wide-types -ftree-builtin-call-dce -ftree-ccp -ftree-ch
4461 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse
4462 -ftree-forwprop -ftree-fre -ftree-phiprop -ftree-sra -ftree-pta
4463 -ftree-ter -funit-at-a-time
4464
4465 -O also turns on -fomit-frame-pointer on machines where doing so
4466 does not interfere with debugging.
4467
4468 -O2 Optimize even more. GCC performs nearly all supported
4469 optimizations that do not involve a space-speed tradeoff. As
4470 compared to -O, this option increases both compilation time and the
4471 performance of the generated code.
4472
4473 -O2 turns on all optimization flags specified by -O. It also turns
4474 on the following optimization flags: -fthread-jumps
4475 -falign-functions -falign-jumps -falign-loops -falign-labels
4476 -fcaller-saves -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks
4477 -fdelete-null-pointer-checks -fexpensive-optimizations -fgcse
4478 -fgcse-lm -finline-small-functions -findirect-inlining -fipa-sra
4479 -foptimize-sibling-calls -fpeephole2 -fregmove -freorder-blocks
4480 -freorder-functions -frerun-cse-after-loop -fsched-interblock
4481 -fsched-spec -fschedule-insns -fschedule-insns2 -fstrict-aliasing
4482 -fstrict-overflow -ftree-switch-conversion -ftree-pre -ftree-vrp
4483
4484 Please note the warning under -fgcse about invoking -O2 on programs
4485 that use computed gotos.
4486
4487 -O3 Optimize yet more. -O3 turns on all optimizations specified by -O2
4488 and also turns on the -finline-functions, -funswitch-loops,
4489 -fpredictive-commoning, -fgcse-after-reload and -ftree-vectorize
4490 options.
4491
4492 -O0 Reduce compilation time and make debugging produce the expected
4493 results. This is the default.
4494
4495 -Os Optimize for size. -Os enables all -O2 optimizations that do not
4496 typically increase code size. It also performs further
4497 optimizations designed to reduce code size.
4498
4499 -Os disables the following optimization flags: -falign-functions
4500 -falign-jumps -falign-loops -falign-labels -freorder-blocks
4501 -freorder-blocks-and-partition -fprefetch-loop-arrays
4502 -ftree-vect-loop-version
4503
4504 If you use multiple -O options, with or without level numbers, the
4505 last such option is the one that is effective.
4506
4507 Options of the form -fflag specify machine-independent flags. Most
4508 flags have both positive and negative forms; the negative form of -ffoo
4509 would be -fno-foo. In the table below, only one of the forms is
4510 listed---the one you typically will use. You can figure out the other
4511 form by either removing no- or adding it.
4512
4513 The following options control specific optimizations. They are either
4514 activated by -O options or are related to ones that are. You can use
4515 the following flags in the rare cases when "fine-tuning" of
4516 optimizations to be performed is desired.
4517
4518 -fno-default-inline
4519 Do not make member functions inline by default merely because they
4520 are defined inside the class scope (C++ only). Otherwise, when you
4521 specify -O, member functions defined inside class scope are
4522 compiled inline by default; i.e., you don't need to add inline in
4523 front of the member function name.
4524
4525 -fno-defer-pop
4526 Always pop the arguments to each function call as soon as that
4527 function returns. For machines which must pop arguments after a
4528 function call, the compiler normally lets arguments accumulate on
4529 the stack for several function calls and pops them all at once.
4530
4531 Disabled at levels -O, -O2, -O3, -Os.
4532
4533 -fforward-propagate
4534 Perform a forward propagation pass on RTL. The pass tries to
4535 combine two instructions and checks if the result can be
4536 simplified. If loop unrolling is active, two passes are performed
4537 and the second is scheduled after loop unrolling.
4538
4539 This option is enabled by default at optimization levels -O, -O2,
4540 -O3, -Os.
4541
4542 -fomit-frame-pointer
4543 Don't keep the frame pointer in a register for functions that don't
4544 need one. This avoids the instructions to save, set up and restore
4545 frame pointers; it also makes an extra register available in many
4546 functions. It also makes debugging impossible on some machines.
4547
4548 On some machines, such as the VAX, this flag has no effect, because
4549 the standard calling sequence automatically handles the frame
4550 pointer and nothing is saved by pretending it doesn't exist. The
4551 machine-description macro "FRAME_POINTER_REQUIRED" controls whether
4552 a target machine supports this flag.
4553
4554 Enabled at levels -O, -O2, -O3, -Os.
4555
4556 -foptimize-sibling-calls
4557 Optimize sibling and tail recursive calls.
4558
4559 Enabled at levels -O2, -O3, -Os.
4560
4561 -fno-inline
4562 Don't pay attention to the "inline" keyword. Normally this option
4563 is used to keep the compiler from expanding any functions inline.
4564 Note that if you are not optimizing, no functions can be expanded
4565 inline.
4566
4567 -finline-small-functions
4568 Integrate functions into their callers when their body is smaller
4569 than expected function call code (so overall size of program gets
4570 smaller). The compiler heuristically decides which functions are
4571 simple enough to be worth integrating in this way.
4572
4573 Enabled at level -O2.
4574
4575 -findirect-inlining
4576 Inline also indirect calls that are discovered to be known at
4577 compile time thanks to previous inlining. This option has any
4578 effect only when inlining itself is turned on by the
4579 -finline-functions or -finline-small-functions options.
4580
4581 Enabled at level -O2.
4582
4583 -finline-functions
4584 Integrate all simple functions into their callers. The compiler
4585 heuristically decides which functions are simple enough to be worth
4586 integrating in this way.
4587
4588 If all calls to a given function are integrated, and the function
4589 is declared "static", then the function is normally not output as
4590 assembler code in its own right.
4591
4592 Enabled at level -O3.
4593
4594 -finline-functions-called-once
4595 Consider all "static" functions called once for inlining into their
4596 caller even if they are not marked "inline". If a call to a given
4597 function is integrated, then the function is not output as
4598 assembler code in its own right.
4599
4600 Enabled at levels -O1, -O2, -O3 and -Os.
4601
4602 -fearly-inlining
4603 Inline functions marked by "always_inline" and functions whose body
4604 seems smaller than the function call overhead early before doing
4605 -fprofile-generate instrumentation and real inlining pass. Doing
4606 so makes profiling significantly cheaper and usually inlining
4607 faster on programs having large chains of nested wrapper functions.
4608
4609 Enabled by default.
4610
4611 -fipa-sra
4612 Perform interprocedural scalar replacement of aggregates, removal
4613 of unused parameters and replacement of parameters passed by
4614 reference by parameters passed by value.
4615
4616 Enabled at levels -O2, -O3 and -Os.
4617
4618 -finline-limit=n
4619 By default, GCC limits the size of functions that can be inlined.
4620 This flag allows coarse control of this limit. n is the size of
4621 functions that can be inlined in number of pseudo instructions.
4622
4623 Inlining is actually controlled by a number of parameters, which
4624 may be specified individually by using --param name=value. The
4625 -finline-limit=n option sets some of these parameters as follows:
4626
4627 max-inline-insns-single
4628 is set to n/2.
4629
4630 max-inline-insns-auto
4631 is set to n/2.
4632
4633 See below for a documentation of the individual parameters
4634 controlling inlining and for the defaults of these parameters.
4635
4636 Note: there may be no value to -finline-limit that results in
4637 default behavior.
4638
4639 Note: pseudo instruction represents, in this particular context, an
4640 abstract measurement of function's size. In no way does it
4641 represent a count of assembly instructions and as such its exact
4642 meaning might change from one release to an another.
4643
4644 -fkeep-inline-functions
4645 In C, emit "static" functions that are declared "inline" into the
4646 object file, even if the function has been inlined into all of its
4647 callers. This switch does not affect functions using the "extern
4648 inline" extension in GNU C90. In C++, emit any and all inline
4649 functions into the object file.
4650
4651 -fkeep-static-consts
4652 Emit variables declared "static const" when optimization isn't
4653 turned on, even if the variables aren't referenced.
4654
4655 GCC enables this option by default. If you want to force the
4656 compiler to check if the variable was referenced, regardless of
4657 whether or not optimization is turned on, use the
4658 -fno-keep-static-consts option.
4659
4660 -fmerge-constants
4661 Attempt to merge identical constants (string constants and floating
4662 point constants) across compilation units.
4663
4664 This option is the default for optimized compilation if the
4665 assembler and linker support it. Use -fno-merge-constants to
4666 inhibit this behavior.
4667
4668 Enabled at levels -O, -O2, -O3, -Os.
4669
4670 -fmerge-all-constants
4671 Attempt to merge identical constants and identical variables.
4672
4673 This option implies -fmerge-constants. In addition to
4674 -fmerge-constants this considers e.g. even constant initialized
4675 arrays or initialized constant variables with integral or floating
4676 point types. Languages like C or C++ require each variable,
4677 including multiple instances of the same variable in recursive
4678 calls, to have distinct locations, so using this option will result
4679 in non-conforming behavior.
4680
4681 -fmodulo-sched
4682 Perform swing modulo scheduling immediately before the first
4683 scheduling pass. This pass looks at innermost loops and reorders
4684 their instructions by overlapping different iterations.
4685
4686 -fmodulo-sched-allow-regmoves
4687 Perform more aggressive SMS based modulo scheduling with register
4688 moves allowed. By setting this flag certain anti-dependences edges
4689 will be deleted which will trigger the generation of reg-moves
4690 based on the life-range analysis. This option is effective only
4691 with -fmodulo-sched enabled.
4692
4693 -fno-branch-count-reg
4694 Do not use "decrement and branch" instructions on a count register,
4695 but instead generate a sequence of instructions that decrement a
4696 register, compare it against zero, then branch based upon the
4697 result. This option is only meaningful on architectures that
4698 support such instructions, which include x86, PowerPC, IA-64 and
4699 S/390.
4700
4701 The default is -fbranch-count-reg.
4702
4703 -fno-function-cse
4704 Do not put function addresses in registers; make each instruction
4705 that calls a constant function contain the function's address
4706 explicitly.
4707
4708 This option results in less efficient code, but some strange hacks
4709 that alter the assembler output may be confused by the
4710 optimizations performed when this option is not used.
4711
4712 The default is -ffunction-cse
4713
4714 -fno-zero-initialized-in-bss
4715 If the target supports a BSS section, GCC by default puts variables
4716 that are initialized to zero into BSS. This can save space in the
4717 resulting code.
4718
4719 This option turns off this behavior because some programs
4720 explicitly rely on variables going to the data section. E.g., so
4721 that the resulting executable can find the beginning of that
4722 section and/or make assumptions based on that.
4723
4724 The default is -fzero-initialized-in-bss.
4725
4726 -fmudflap -fmudflapth -fmudflapir
4727 For front-ends that support it (C and C++), instrument all risky
4728 pointer/array dereferencing operations, some standard library
4729 string/heap functions, and some other associated constructs with
4730 range/validity tests. Modules so instrumented should be immune to
4731 buffer overflows, invalid heap use, and some other classes of C/C++
4732 programming errors. The instrumentation relies on a separate
4733 runtime library (libmudflap), which will be linked into a program
4734 if -fmudflap is given at link time. Run-time behavior of the
4735 instrumented program is controlled by the MUDFLAP_OPTIONS
4736 environment variable. See "env MUDFLAP_OPTIONS=-help a.out" for
4737 its options.
4738
4739 Use -fmudflapth instead of -fmudflap to compile and to link if your
4740 program is multi-threaded. Use -fmudflapir, in addition to
4741 -fmudflap or -fmudflapth, if instrumentation should ignore pointer
4742 reads. This produces less instrumentation (and therefore faster
4743 execution) and still provides some protection against outright
4744 memory corrupting writes, but allows erroneously read data to
4745 propagate within a program.
4746
4747 -fthread-jumps
4748 Perform optimizations where we check to see if a jump branches to a
4749 location where another comparison subsumed by the first is found.
4750 If so, the first branch is redirected to either the destination of
4751 the second branch or a point immediately following it, depending on
4752 whether the condition is known to be true or false.
4753
4754 Enabled at levels -O2, -O3, -Os.
4755
4756 -fsplit-wide-types
4757 When using a type that occupies multiple registers, such as "long
4758 long" on a 32-bit system, split the registers apart and allocate
4759 them independently. This normally generates better code for those
4760 types, but may make debugging more difficult.
4761
4762 Enabled at levels -O, -O2, -O3, -Os.
4763
4764 -fcse-follow-jumps
4765 In common subexpression elimination (CSE), scan through jump
4766 instructions when the target of the jump is not reached by any
4767 other path. For example, when CSE encounters an "if" statement
4768 with an "else" clause, CSE will follow the jump when the condition
4769 tested is false.
4770
4771 Enabled at levels -O2, -O3, -Os.
4772
4773 -fcse-skip-blocks
4774 This is similar to -fcse-follow-jumps, but causes CSE to follow
4775 jumps which conditionally skip over blocks. When CSE encounters a
4776 simple "if" statement with no else clause, -fcse-skip-blocks causes
4777 CSE to follow the jump around the body of the "if".
4778
4779 Enabled at levels -O2, -O3, -Os.
4780
4781 -frerun-cse-after-loop
4782 Re-run common subexpression elimination after loop optimizations
4783 has been performed.
4784
4785 Enabled at levels -O2, -O3, -Os.
4786
4787 -fgcse
4788 Perform a global common subexpression elimination pass. This pass
4789 also performs global constant and copy propagation.
4790
4791 Note: When compiling a program using computed gotos, a GCC
4792 extension, you may get better runtime performance if you disable
4793 the global common subexpression elimination pass by adding
4794 -fno-gcse to the command line.
4795
4796 Enabled at levels -O2, -O3, -Os.
4797
4798 -fgcse-lm
4799 When -fgcse-lm is enabled, global common subexpression elimination
4800 will attempt to move loads which are only killed by stores into
4801 themselves. This allows a loop containing a load/store sequence to
4802 be changed to a load outside the loop, and a copy/store within the
4803 loop.
4804
4805 Enabled by default when gcse is enabled.
4806
4807 -fgcse-sm
4808 When -fgcse-sm is enabled, a store motion pass is run after global
4809 common subexpression elimination. This pass will attempt to move
4810 stores out of loops. When used in conjunction with -fgcse-lm,
4811 loops containing a load/store sequence can be changed to a load
4812 before the loop and a store after the loop.
4813
4814 Not enabled at any optimization level.
4815
4816 -fgcse-las
4817 When -fgcse-las is enabled, the global common subexpression
4818 elimination pass eliminates redundant loads that come after stores
4819 to the same memory location (both partial and full redundancies).
4820
4821 Not enabled at any optimization level.
4822
4823 -fgcse-after-reload
4824 When -fgcse-after-reload is enabled, a redundant load elimination
4825 pass is performed after reload. The purpose of this pass is to
4826 cleanup redundant spilling.
4827
4828 -funsafe-loop-optimizations
4829 If given, the loop optimizer will assume that loop indices do not
4830 overflow, and that the loops with nontrivial exit condition are not
4831 infinite. This enables a wider range of loop optimizations even if
4832 the loop optimizer itself cannot prove that these assumptions are
4833 valid. Using -Wunsafe-loop-optimizations, the compiler will warn
4834 you if it finds this kind of loop.
4835
4836 -fcrossjumping
4837 Perform cross-jumping transformation. This transformation unifies
4838 equivalent code and save code size. The resulting code may or may
4839 not perform better than without cross-jumping.
4840
4841 Enabled at levels -O2, -O3, -Os.
4842
4843 -fauto-inc-dec
4844 Combine increments or decrements of addresses with memory accesses.
4845 This pass is always skipped on architectures that do not have
4846 instructions to support this. Enabled by default at -O and higher
4847 on architectures that support this.
4848
4849 -fdce
4850 Perform dead code elimination (DCE) on RTL. Enabled by default at
4851 -O and higher.
4852
4853 -fdse
4854 Perform dead store elimination (DSE) on RTL. Enabled by default at
4855 -O and higher.
4856
4857 -fif-conversion
4858 Attempt to transform conditional jumps into branch-less
4859 equivalents. This include use of conditional moves, min, max, set
4860 flags and abs instructions, and some tricks doable by standard
4861 arithmetics. The use of conditional execution on chips where it is
4862 available is controlled by "if-conversion2".
4863
4864 Enabled at levels -O, -O2, -O3, -Os.
4865
4866 -fif-conversion2
4867 Use conditional execution (where available) to transform
4868 conditional jumps into branch-less equivalents.
4869
4870 Enabled at levels -O, -O2, -O3, -Os.
4871
4872 -fdelete-null-pointer-checks
4873 Assume that programs cannot safely dereference null pointers, and
4874 that no code or data element resides there. This enables simple
4875 constant folding optimizations at all optimization levels. In
4876 addition, other optimization passes in GCC use this flag to control
4877 global dataflow analyses that eliminate useless checks for null
4878 pointers; these assume that if a pointer is checked after it has
4879 already been dereferenced, it cannot be null.
4880
4881 Note however that in some environments this assumption is not true.
4882 Use -fno-delete-null-pointer-checks to disable this optimization
4883 for programs which depend on that behavior.
4884
4885 Some targets, especially embedded ones, disable this option at all
4886 levels. Otherwise it is enabled at all levels: -O0, -O1, -O2, -O3,
4887 -Os. Passes that use the information are enabled independently at
4888 different optimization levels.
4889
4890 -fexpensive-optimizations
4891 Perform a number of minor optimizations that are relatively
4892 expensive.
4893
4894 Enabled at levels -O2, -O3, -Os.
4895
4896 -foptimize-register-move
4897 -fregmove
4898 Attempt to reassign register numbers in move instructions and as
4899 operands of other simple instructions in order to maximize the
4900 amount of register tying. This is especially helpful on machines
4901 with two-operand instructions.
4902
4903 Note -fregmove and -foptimize-register-move are the same
4904 optimization.
4905
4906 Enabled at levels -O2, -O3, -Os.
4907
4908 -fira-algorithm=algorithm
4909 Use specified coloring algorithm for the integrated register
4910 allocator. The algorithm argument should be "priority" or "CB".
4911 The first algorithm specifies Chow's priority coloring, the second
4912 one specifies Chaitin-Briggs coloring. The second algorithm can be
4913 unimplemented for some architectures. If it is implemented, it is
4914 the default because Chaitin-Briggs coloring as a rule generates a
4915 better code.
4916
4917 -fira-region=region
4918 Use specified regions for the integrated register allocator. The
4919 region argument should be one of "all", "mixed", or "one". The
4920 first value means using all loops as register allocation regions,
4921 the second value which is the default means using all loops except
4922 for loops with small register pressure as the regions, and third
4923 one means using all function as a single region. The first value
4924 can give best result for machines with small size and irregular
4925 register set, the third one results in faster and generates decent
4926 code and the smallest size code, and the default value usually give
4927 the best results in most cases and for most architectures.
4928
4929 -fira-coalesce
4930 Do optimistic register coalescing. This option might be profitable
4931 for architectures with big regular register files.
4932
4933 -fira-loop-pressure
4934 Use IRA to evaluate register pressure in loops for decision to move
4935 loop invariants. Usage of this option usually results in
4936 generation of faster and smaller code on machines with big register
4937 files (>= 32 registers) but it can slow compiler down.
4938
4939 This option is enabled at level -O3 for some targets.
4940
4941 -fno-ira-share-save-slots
4942 Switch off sharing stack slots used for saving call used hard
4943 registers living through a call. Each hard register will get a
4944 separate stack slot and as a result function stack frame will be
4945 bigger.
4946
4947 -fno-ira-share-spill-slots
4948 Switch off sharing stack slots allocated for pseudo-registers.
4949 Each pseudo-register which did not get a hard register will get a
4950 separate stack slot and as a result function stack frame will be
4951 bigger.
4952
4953 -fira-verbose=n
4954 Set up how verbose dump file for the integrated register allocator
4955 will be. Default value is 5. If the value is greater or equal to
4956 10, the dump file will be stderr as if the value were n minus 10.
4957
4958 -fdelayed-branch
4959 If supported for the target machine, attempt to reorder
4960 instructions to exploit instruction slots available after delayed
4961 branch instructions.
4962
4963 Enabled at levels -O, -O2, -O3, -Os.
4964
4965 -fschedule-insns
4966 If supported for the target machine, attempt to reorder
4967 instructions to eliminate execution stalls due to required data
4968 being unavailable. This helps machines that have slow floating
4969 point or memory load instructions by allowing other instructions to
4970 be issued until the result of the load or floating point
4971 instruction is required.
4972
4973 Enabled at levels -O2, -O3.
4974
4975 -fschedule-insns2
4976 Similar to -fschedule-insns, but requests an additional pass of
4977 instruction scheduling after register allocation has been done.
4978 This is especially useful on machines with a relatively small
4979 number of registers and where memory load instructions take more
4980 than one cycle.
4981
4982 Enabled at levels -O2, -O3, -Os.
4983
4984 -fno-sched-interblock
4985 Don't schedule instructions across basic blocks. This is normally
4986 enabled by default when scheduling before register allocation, i.e.
4987 with -fschedule-insns or at -O2 or higher.
4988
4989 -fno-sched-spec
4990 Don't allow speculative motion of non-load instructions. This is
4991 normally enabled by default when scheduling before register
4992 allocation, i.e. with -fschedule-insns or at -O2 or higher.
4993
4994 -fsched-pressure
4995 Enable register pressure sensitive insn scheduling before the
4996 register allocation. This only makes sense when scheduling before
4997 register allocation is enabled, i.e. with -fschedule-insns or at
4998 -O2 or higher. Usage of this option can improve the generated code
4999 and decrease its size by preventing register pressure increase
5000 above the number of available hard registers and as a consequence
5001 register spills in the register allocation.
5002
5003 -fsched-spec-load
5004 Allow speculative motion of some load instructions. This only
5005 makes sense when scheduling before register allocation, i.e. with
5006 -fschedule-insns or at -O2 or higher.
5007
5008 -fsched-spec-load-dangerous
5009 Allow speculative motion of more load instructions. This only
5010 makes sense when scheduling before register allocation, i.e. with
5011 -fschedule-insns or at -O2 or higher.
5012
5013 -fsched-stalled-insns
5014 -fsched-stalled-insns=n
5015 Define how many insns (if any) can be moved prematurely from the
5016 queue of stalled insns into the ready list, during the second
5017 scheduling pass. -fno-sched-stalled-insns means that no insns will
5018 be moved prematurely, -fsched-stalled-insns=0 means there is no
5019 limit on how many queued insns can be moved prematurely.
5020 -fsched-stalled-insns without a value is equivalent to
5021 -fsched-stalled-insns=1.
5022
5023 -fsched-stalled-insns-dep
5024 -fsched-stalled-insns-dep=n
5025 Define how many insn groups (cycles) will be examined for a
5026 dependency on a stalled insn that is candidate for premature
5027 removal from the queue of stalled insns. This has an effect only
5028 during the second scheduling pass, and only if
5029 -fsched-stalled-insns is used. -fno-sched-stalled-insns-dep is
5030 equivalent to -fsched-stalled-insns-dep=0.
5031 -fsched-stalled-insns-dep without a value is equivalent to
5032 -fsched-stalled-insns-dep=1.
5033
5034 -fsched2-use-superblocks
5035 When scheduling after register allocation, do use superblock
5036 scheduling algorithm. Superblock scheduling allows motion across
5037 basic block boundaries resulting on faster schedules. This option
5038 is experimental, as not all machine descriptions used by GCC model
5039 the CPU closely enough to avoid unreliable results from the
5040 algorithm.
5041
5042 This only makes sense when scheduling after register allocation,
5043 i.e. with -fschedule-insns2 or at -O2 or higher.
5044
5045 -fsched-group-heuristic
5046 Enable the group heuristic in the scheduler. This heuristic favors
5047 the instruction that belongs to a schedule group. This is enabled
5048 by default when scheduling is enabled, i.e. with -fschedule-insns
5049 or -fschedule-insns2 or at -O2 or higher.
5050
5051 -fsched-critical-path-heuristic
5052 Enable the critical-path heuristic in the scheduler. This
5053 heuristic favors instructions on the critical path. This is
5054 enabled by default when scheduling is enabled, i.e. with
5055 -fschedule-insns or -fschedule-insns2 or at -O2 or higher.
5056
5057 -fsched-spec-insn-heuristic
5058 Enable the speculative instruction heuristic in the scheduler.
5059 This heuristic favors speculative instructions with greater
5060 dependency weakness. This is enabled by default when scheduling is
5061 enabled, i.e. with -fschedule-insns or -fschedule-insns2 or at -O2
5062 or higher.
5063
5064 -fsched-rank-heuristic
5065 Enable the rank heuristic in the scheduler. This heuristic favors
5066 the instruction belonging to a basic block with greater size or
5067 frequency. This is enabled by default when scheduling is enabled,
5068 i.e. with -fschedule-insns or -fschedule-insns2 or at -O2 or
5069 higher.
5070
5071 -fsched-last-insn-heuristic
5072 Enable the last-instruction heuristic in the scheduler. This
5073 heuristic favors the instruction that is less dependent on the last
5074 instruction scheduled. This is enabled by default when scheduling
5075 is enabled, i.e. with -fschedule-insns or -fschedule-insns2 or at
5076 -O2 or higher.
5077
5078 -fsched-dep-count-heuristic
5079 Enable the dependent-count heuristic in the scheduler. This
5080 heuristic favors the instruction that has more instructions
5081 depending on it. This is enabled by default when scheduling is
5082 enabled, i.e. with -fschedule-insns or -fschedule-insns2 or at -O2
5083 or higher.
5084
5085 -freschedule-modulo-scheduled-loops
5086 The modulo scheduling comes before the traditional scheduling, if a
5087 loop was modulo scheduled we may want to prevent the later
5088 scheduling passes from changing its schedule, we use this option to
5089 control that.
5090
5091 -fselective-scheduling
5092 Schedule instructions using selective scheduling algorithm.
5093 Selective scheduling runs instead of the first scheduler pass.
5094
5095 -fselective-scheduling2
5096 Schedule instructions using selective scheduling algorithm.
5097 Selective scheduling runs instead of the second scheduler pass.
5098
5099 -fsel-sched-pipelining
5100 Enable software pipelining of innermost loops during selective
5101 scheduling. This option has no effect until one of
5102 -fselective-scheduling or -fselective-scheduling2 is turned on.
5103
5104 -fsel-sched-pipelining-outer-loops
5105 When pipelining loops during selective scheduling, also pipeline
5106 outer loops. This option has no effect until
5107 -fsel-sched-pipelining is turned on.
5108
5109 -fcaller-saves
5110 Enable values to be allocated in registers that will be clobbered
5111 by function calls, by emitting extra instructions to save and
5112 restore the registers around such calls. Such allocation is done
5113 only when it seems to result in better code than would otherwise be
5114 produced.
5115
5116 This option is always enabled by default on certain machines,
5117 usually those which have no call-preserved registers to use
5118 instead.
5119
5120 Enabled at levels -O2, -O3, -Os.
5121
5122 -fconserve-stack
5123 Attempt to minimize stack usage. The compiler will attempt to use
5124 less stack space, even if that makes the program slower. This
5125 option implies setting the large-stack-frame parameter to 100 and
5126 the large-stack-frame-growth parameter to 400.
5127
5128 -ftree-reassoc
5129 Perform reassociation on trees. This flag is enabled by default at
5130 -O and higher.
5131
5132 -ftree-pre
5133 Perform partial redundancy elimination (PRE) on trees. This flag
5134 is enabled by default at -O2 and -O3.
5135
5136 -ftree-forwprop
5137 Perform forward propagation on trees. This flag is enabled by
5138 default at -O and higher.
5139
5140 -ftree-fre
5141 Perform full redundancy elimination (FRE) on trees. The difference
5142 between FRE and PRE is that FRE only considers expressions that are
5143 computed on all paths leading to the redundant computation. This
5144 analysis is faster than PRE, though it exposes fewer redundancies.
5145 This flag is enabled by default at -O and higher.
5146
5147 -ftree-phiprop
5148 Perform hoisting of loads from conditional pointers on trees. This
5149 pass is enabled by default at -O and higher.
5150
5151 -ftree-copy-prop
5152 Perform copy propagation on trees. This pass eliminates
5153 unnecessary copy operations. This flag is enabled by default at -O
5154 and higher.
5155
5156 -fipa-pure-const
5157 Discover which functions are pure or constant. Enabled by default
5158 at -O and higher.
5159
5160 -fipa-reference
5161 Discover which static variables do not escape cannot escape the
5162 compilation unit. Enabled by default at -O and higher.
5163
5164 -fipa-struct-reorg
5165 Perform structure reorganization optimization, that change C-like
5166 structures layout in order to better utilize spatial locality.
5167 This transformation is affective for programs containing arrays of
5168 structures. Available in two compilation modes: profile-based
5169 (enabled with -fprofile-generate) or static (which uses built-in
5170 heuristics). Require -fipa-type-escape to provide the safety of
5171 this transformation. It works only in whole program mode, so it
5172 requires -fwhole-program and -combine to be enabled. Structures
5173 considered cold by this transformation are not affected (see
5174 --param struct-reorg-cold-struct-ratio=value).
5175
5176 With this flag, the program debug info reflects a new structure
5177 layout.
5178
5179 -fipa-pta
5180 Perform interprocedural pointer analysis. This option is
5181 experimental and does not affect generated code.
5182
5183 -fipa-cp
5184 Perform interprocedural constant propagation. This optimization
5185 analyzes the program to determine when values passed to functions
5186 are constants and then optimizes accordingly. This optimization
5187 can substantially increase performance if the application has
5188 constants passed to functions. This flag is enabled by default at
5189 -O2, -Os and -O3.
5190
5191 -fipa-cp-clone
5192 Perform function cloning to make interprocedural constant
5193 propagation stronger. When enabled, interprocedural constant
5194 propagation will perform function cloning when externally visible
5195 function can be called with constant arguments. Because this
5196 optimization can create multiple copies of functions, it may
5197 significantly increase code size (see --param
5198 ipcp-unit-growth=value). This flag is enabled by default at -O3.
5199
5200 -fipa-matrix-reorg
5201 Perform matrix flattening and transposing. Matrix flattening tries
5202 to replace an m-dimensional matrix with its equivalent
5203 n-dimensional matrix, where n < m. This reduces the level of
5204 indirection needed for accessing the elements of the matrix. The
5205 second optimization is matrix transposing that attempts to change
5206 the order of the matrix's dimensions in order to improve cache
5207 locality. Both optimizations need the -fwhole-program flag.
5208 Transposing is enabled only if profiling information is available.
5209
5210 -ftree-sink
5211 Perform forward store motion on trees. This flag is enabled by
5212 default at -O and higher.
5213
5214 -ftree-ccp
5215 Perform sparse conditional constant propagation (CCP) on trees.
5216 This pass only operates on local scalar variables and is enabled by
5217 default at -O and higher.
5218
5219 -ftree-switch-conversion
5220 Perform conversion of simple initializations in a switch to
5221 initializations from a scalar array. This flag is enabled by
5222 default at -O2 and higher.
5223
5224 -ftree-dce
5225 Perform dead code elimination (DCE) on trees. This flag is enabled
5226 by default at -O and higher.
5227
5228 -ftree-builtin-call-dce
5229 Perform conditional dead code elimination (DCE) for calls to
5230 builtin functions that may set "errno" but are otherwise side-
5231 effect free. This flag is enabled by default at -O2 and higher if
5232 -Os is not also specified.
5233
5234 -ftree-dominator-opts
5235 Perform a variety of simple scalar cleanups (constant/copy
5236 propagation, redundancy elimination, range propagation and
5237 expression simplification) based on a dominator tree traversal.
5238 This also performs jump threading (to reduce jumps to jumps). This
5239 flag is enabled by default at -O and higher.
5240
5241 -ftree-dse
5242 Perform dead store elimination (DSE) on trees. A dead store is a
5243 store into a memory location which will later be overwritten by
5244 another store without any intervening loads. In this case the
5245 earlier store can be deleted. This flag is enabled by default at
5246 -O and higher.
5247
5248 -ftree-ch
5249 Perform loop header copying on trees. This is beneficial since it
5250 increases effectiveness of code motion optimizations. It also
5251 saves one jump. This flag is enabled by default at -O and higher.
5252 It is not enabled for -Os, since it usually increases code size.
5253
5254 -ftree-loop-optimize
5255 Perform loop optimizations on trees. This flag is enabled by
5256 default at -O and higher.
5257
5258 -ftree-loop-linear
5259 Perform linear loop transformations on tree. This flag can improve
5260 cache performance and allow further loop optimizations to take
5261 place.
5262
5263 -floop-interchange
5264 Perform loop interchange transformations on loops. Interchanging
5265 two nested loops switches the inner and outer loops. For example,
5266 given a loop like:
5267
5268 DO J = 1, M
5269 DO I = 1, N
5270 A(J, I) = A(J, I) * C
5271 ENDDO
5272 ENDDO
5273
5274 loop interchange will transform the loop as if the user had
5275 written:
5276
5277 DO I = 1, N
5278 DO J = 1, M
5279 A(J, I) = A(J, I) * C
5280 ENDDO
5281 ENDDO
5282
5283 which can be beneficial when "N" is larger than the caches, because
5284 in Fortran, the elements of an array are stored in memory
5285 contiguously by column, and the original loop iterates over rows,
5286 potentially creating at each access a cache miss. This
5287 optimization applies to all the languages supported by GCC and is
5288 not limited to Fortran. To use this code transformation, GCC has
5289 to be configured with --with-ppl and --with-cloog to enable the
5290 Graphite loop transformation infrastructure.
5291
5292 -floop-strip-mine
5293 Perform loop strip mining transformations on loops. Strip mining
5294 splits a loop into two nested loops. The outer loop has strides
5295 equal to the strip size and the inner loop has strides of the
5296 original loop within a strip. The strip length can be changed
5297 using the loop-block-tile-size parameter. For example, given a
5298 loop like:
5299
5300 DO I = 1, N
5301 A(I) = A(I) + C
5302 ENDDO
5303
5304 loop strip mining will transform the loop as if the user had
5305 written:
5306
5307 DO II = 1, N, 51
5308 DO I = II, min (II + 50, N)
5309 A(I) = A(I) + C
5310 ENDDO
5311 ENDDO
5312
5313 This optimization applies to all the languages supported by GCC and
5314 is not limited to Fortran. To use this code transformation, GCC
5315 has to be configured with --with-ppl and --with-cloog to enable the
5316 Graphite loop transformation infrastructure.
5317
5318 -floop-block
5319 Perform loop blocking transformations on loops. Blocking strip
5320 mines each loop in the loop nest such that the memory accesses of
5321 the element loops fit inside caches. The strip length can be
5322 changed using the loop-block-tile-size parameter. For example,
5323 given a loop like:
5324
5325 DO I = 1, N
5326 DO J = 1, M
5327 A(J, I) = B(I) + C(J)
5328 ENDDO
5329 ENDDO
5330
5331 loop blocking will transform the loop as if the user had written:
5332
5333 DO II = 1, N, 51
5334 DO JJ = 1, M, 51
5335 DO I = II, min (II + 50, N)
5336 DO J = JJ, min (JJ + 50, M)
5337 A(J, I) = B(I) + C(J)
5338 ENDDO
5339 ENDDO
5340 ENDDO
5341 ENDDO
5342
5343 which can be beneficial when "M" is larger than the caches, because
5344 the innermost loop will iterate over a smaller amount of data that
5345 can be kept in the caches. This optimization applies to all the
5346 languages supported by GCC and is not limited to Fortran. To use
5347 this code transformation, GCC has to be configured with --with-ppl
5348 and --with-cloog to enable the Graphite loop transformation
5349 infrastructure.
5350
5351 -fgraphite-identity
5352 Enable the identity transformation for graphite. For every SCoP we
5353 generate the polyhedral representation and transform it back to
5354 gimple. Using -fgraphite-identity we can check the costs or
5355 benefits of the GIMPLE -> GRAPHITE -> GIMPLE transformation. Some
5356 minimal optimizations are also performed by the code generator
5357 CLooG, like index splitting and dead code elimination in loops.
5358
5359 -floop-parallelize-all
5360 Use the Graphite data dependence analysis to identify loops that
5361 can be parallelized. Parallelize all the loops that can be
5362 analyzed to not contain loop carried dependences without checking
5363 that it is profitable to parallelize the loops.
5364
5365 -fcheck-data-deps
5366 Compare the results of several data dependence analyzers. This
5367 option is used for debugging the data dependence analyzers.
5368
5369 -ftree-loop-distribution
5370 Perform loop distribution. This flag can improve cache performance
5371 on big loop bodies and allow further loop optimizations, like
5372 parallelization or vectorization, to take place. For example, the
5373 loop
5374
5375 DO I = 1, N
5376 A(I) = B(I) + C
5377 D(I) = E(I) * F
5378 ENDDO
5379
5380 is transformed to
5381
5382 DO I = 1, N
5383 A(I) = B(I) + C
5384 ENDDO
5385 DO I = 1, N
5386 D(I) = E(I) * F
5387 ENDDO
5388
5389 -ftree-loop-im
5390 Perform loop invariant motion on trees. This pass moves only
5391 invariants that would be hard to handle at RTL level (function
5392 calls, operations that expand to nontrivial sequences of insns).
5393 With -funswitch-loops it also moves operands of conditions that are
5394 invariant out of the loop, so that we can use just trivial
5395 invariantness analysis in loop unswitching. The pass also includes
5396 store motion.
5397
5398 -ftree-loop-ivcanon
5399 Create a canonical counter for number of iterations in the loop for
5400 that determining number of iterations requires complicated
5401 analysis. Later optimizations then may determine the number
5402 easily. Useful especially in connection with unrolling.
5403
5404 -fivopts
5405 Perform induction variable optimizations (strength reduction,
5406 induction variable merging and induction variable elimination) on
5407 trees.
5408
5409 -ftree-parallelize-loops=n
5410 Parallelize loops, i.e., split their iteration space to run in n
5411 threads. This is only possible for loops whose iterations are
5412 independent and can be arbitrarily reordered. The optimization is
5413 only profitable on multiprocessor machines, for loops that are CPU-
5414 intensive, rather than constrained e.g. by memory bandwidth. This
5415 option implies -pthread, and thus is only supported on targets that
5416 have support for -pthread.
5417
5418 -ftree-pta
5419 Perform function-local points-to analysis on trees. This flag is
5420 enabled by default at -O and higher.
5421
5422 -ftree-sra
5423 Perform scalar replacement of aggregates. This pass replaces
5424 structure references with scalars to prevent committing structures
5425 to memory too early. This flag is enabled by default at -O and
5426 higher.
5427
5428 -ftree-copyrename
5429 Perform copy renaming on trees. This pass attempts to rename
5430 compiler temporaries to other variables at copy locations, usually
5431 resulting in variable names which more closely resemble the
5432 original variables. This flag is enabled by default at -O and
5433 higher.
5434
5435 -ftree-ter
5436 Perform temporary expression replacement during the SSA->normal
5437 phase. Single use/single def temporaries are replaced at their use
5438 location with their defining expression. This results in non-
5439 GIMPLE code, but gives the expanders much more complex trees to
5440 work on resulting in better RTL generation. This is enabled by
5441 default at -O and higher.
5442
5443 -ftree-vectorize
5444 Perform loop vectorization on trees. This flag is enabled by
5445 default at -O3.
5446
5447 -ftree-slp-vectorize
5448 Perform basic block vectorization on trees. This flag is enabled by
5449 default at -O3 and when -ftree-vectorize is enabled.
5450
5451 -ftree-vect-loop-version
5452 Perform loop versioning when doing loop vectorization on trees.
5453 When a loop appears to be vectorizable except that data alignment
5454 or data dependence cannot be determined at compile time then
5455 vectorized and non-vectorized versions of the loop are generated
5456 along with runtime checks for alignment or dependence to control
5457 which version is executed. This option is enabled by default
5458 except at level -Os where it is disabled.
5459
5460 -fvect-cost-model
5461 Enable cost model for vectorization.
5462
5463 -ftree-vrp
5464 Perform Value Range Propagation on trees. This is similar to the
5465 constant propagation pass, but instead of values, ranges of values
5466 are propagated. This allows the optimizers to remove unnecessary
5467 range checks like array bound checks and null pointer checks. This
5468 is enabled by default at -O2 and higher. Null pointer check
5469 elimination is only done if -fdelete-null-pointer-checks is
5470 enabled.
5471
5472 -ftracer
5473 Perform tail duplication to enlarge superblock size. This
5474 transformation simplifies the control flow of the function allowing
5475 other optimizations to do better job.
5476
5477 -funroll-loops
5478 Unroll loops whose number of iterations can be determined at
5479 compile time or upon entry to the loop. -funroll-loops implies
5480 -frerun-cse-after-loop. This option makes code larger, and may or
5481 may not make it run faster.
5482
5483 -funroll-all-loops
5484 Unroll all loops, even if their number of iterations is uncertain
5485 when the loop is entered. This usually makes programs run more
5486 slowly. -funroll-all-loops implies the same options as
5487 -funroll-loops,
5488
5489 -fsplit-ivs-in-unroller
5490 Enables expressing of values of induction variables in later
5491 iterations of the unrolled loop using the value in the first
5492 iteration. This breaks long dependency chains, thus improving
5493 efficiency of the scheduling passes.
5494
5495 Combination of -fweb and CSE is often sufficient to obtain the same
5496 effect. However in cases the loop body is more complicated than a
5497 single basic block, this is not reliable. It also does not work at
5498 all on some of the architectures due to restrictions in the CSE
5499 pass.
5500
5501 This optimization is enabled by default.
5502
5503 -fvariable-expansion-in-unroller
5504 With this option, the compiler will create multiple copies of some
5505 local variables when unrolling a loop which can result in superior
5506 code.
5507
5508 -fpredictive-commoning
5509 Perform predictive commoning optimization, i.e., reusing
5510 computations (especially memory loads and stores) performed in
5511 previous iterations of loops.
5512
5513 This option is enabled at level -O3.
5514
5515 -fprefetch-loop-arrays
5516 If supported by the target machine, generate instructions to
5517 prefetch memory to improve the performance of loops that access
5518 large arrays.
5519
5520 This option may generate better or worse code; results are highly
5521 dependent on the structure of loops within the source code.
5522
5523 Disabled at level -Os.
5524
5525 -fno-peephole
5526 -fno-peephole2
5527 Disable any machine-specific peephole optimizations. The
5528 difference between -fno-peephole and -fno-peephole2 is in how they
5529 are implemented in the compiler; some targets use one, some use the
5530 other, a few use both.
5531
5532 -fpeephole is enabled by default. -fpeephole2 enabled at levels
5533 -O2, -O3, -Os.
5534
5535 -fno-guess-branch-probability
5536 Do not guess branch probabilities using heuristics.
5537
5538 GCC will use heuristics to guess branch probabilities if they are
5539 not provided by profiling feedback (-fprofile-arcs). These
5540 heuristics are based on the control flow graph. If some branch
5541 probabilities are specified by __builtin_expect, then the
5542 heuristics will be used to guess branch probabilities for the rest
5543 of the control flow graph, taking the __builtin_expect info into
5544 account. The interactions between the heuristics and
5545 __builtin_expect can be complex, and in some cases, it may be
5546 useful to disable the heuristics so that the effects of
5547 __builtin_expect are easier to understand.
5548
5549 The default is -fguess-branch-probability at levels -O, -O2, -O3,
5550 -Os.
5551
5552 -freorder-blocks
5553 Reorder basic blocks in the compiled function in order to reduce
5554 number of taken branches and improve code locality.
5555
5556 Enabled at levels -O2, -O3.
5557
5558 -freorder-blocks-and-partition
5559 In addition to reordering basic blocks in the compiled function, in
5560 order to reduce number of taken branches, partitions hot and cold
5561 basic blocks into separate sections of the assembly and .o files,
5562 to improve paging and cache locality performance.
5563
5564 This optimization is automatically turned off in the presence of
5565 exception handling, for linkonce sections, for functions with a
5566 user-defined section attribute and on any architecture that does
5567 not support named sections.
5568
5569 -freorder-functions
5570 Reorder functions in the object file in order to improve code
5571 locality. This is implemented by using special subsections
5572 ".text.hot" for most frequently executed functions and
5573 ".text.unlikely" for unlikely executed functions. Reordering is
5574 done by the linker so object file format must support named
5575 sections and linker must place them in a reasonable way.
5576
5577 Also profile feedback must be available in to make this option
5578 effective. See -fprofile-arcs for details.
5579
5580 Enabled at levels -O2, -O3, -Os.
5581
5582 -fstrict-aliasing
5583 Allow the compiler to assume the strictest aliasing rules
5584 applicable to the language being compiled. For C (and C++), this
5585 activates optimizations based on the type of expressions. In
5586 particular, an object of one type is assumed never to reside at the
5587 same address as an object of a different type, unless the types are
5588 almost the same. For example, an "unsigned int" can alias an
5589 "int", but not a "void*" or a "double". A character type may alias
5590 any other type.
5591
5592 Pay special attention to code like this:
5593
5594 union a_union {
5595 int i;
5596 double d;
5597 };
5598
5599 int f() {
5600 union a_union t;
5601 t.d = 3.0;
5602 return t.i;
5603 }
5604
5605 The practice of reading from a different union member than the one
5606 most recently written to (called "type-punning") is common. Even
5607 with -fstrict-aliasing, type-punning is allowed, provided the
5608 memory is accessed through the union type. So, the code above will
5609 work as expected. However, this code might not:
5610
5611 int f() {
5612 union a_union t;
5613 int* ip;
5614 t.d = 3.0;
5615 ip = &t.i;
5616 return *ip;
5617 }
5618
5619 Similarly, access by taking the address, casting the resulting
5620 pointer and dereferencing the result has undefined behavior, even
5621 if the cast uses a union type, e.g.:
5622
5623 int f() {
5624 double d = 3.0;
5625 return ((union a_union *) &d)->i;
5626 }
5627
5628 The -fstrict-aliasing option is enabled at levels -O2, -O3, -Os.
5629
5630 -fstrict-overflow
5631 Allow the compiler to assume strict signed overflow rules,
5632 depending on the language being compiled. For C (and C++) this
5633 means that overflow when doing arithmetic with signed numbers is
5634 undefined, which means that the compiler may assume that it will
5635 not happen. This permits various optimizations. For example, the
5636 compiler will assume that an expression like "i + 10 > i" will
5637 always be true for signed "i". This assumption is only valid if
5638 signed overflow is undefined, as the expression is false if "i +
5639 10" overflows when using twos complement arithmetic. When this
5640 option is in effect any attempt to determine whether an operation
5641 on signed numbers will overflow must be written carefully to not
5642 actually involve overflow.
5643
5644 This option also allows the compiler to assume strict pointer
5645 semantics: given a pointer to an object, if adding an offset to
5646 that pointer does not produce a pointer to the same object, the
5647 addition is undefined. This permits the compiler to conclude that
5648 "p + u > p" is always true for a pointer "p" and unsigned integer
5649 "u". This assumption is only valid because pointer wraparound is
5650 undefined, as the expression is false if "p + u" overflows using
5651 twos complement arithmetic.
5652
5653 See also the -fwrapv option. Using -fwrapv means that integer
5654 signed overflow is fully defined: it wraps. When -fwrapv is used,
5655 there is no difference between -fstrict-overflow and
5656 -fno-strict-overflow for integers. With -fwrapv certain types of
5657 overflow are permitted. For example, if the compiler gets an
5658 overflow when doing arithmetic on constants, the overflowed value
5659 can still be used with -fwrapv, but not otherwise.
5660
5661 The -fstrict-overflow option is enabled at levels -O2, -O3, -Os.
5662
5663 -falign-functions
5664 -falign-functions=n
5665 Align the start of functions to the next power-of-two greater than
5666 n, skipping up to n bytes. For instance, -falign-functions=32
5667 aligns functions to the next 32-byte boundary, but
5668 -falign-functions=24 would align to the next 32-byte boundary only
5669 if this can be done by skipping 23 bytes or less.
5670
5671 -fno-align-functions and -falign-functions=1 are equivalent and
5672 mean that functions will not be aligned.
5673
5674 Some assemblers only support this flag when n is a power of two; in
5675 that case, it is rounded up.
5676
5677 If n is not specified or is zero, use a machine-dependent default.
5678
5679 Enabled at levels -O2, -O3.
5680
5681 -falign-labels
5682 -falign-labels=n
5683 Align all branch targets to a power-of-two boundary, skipping up to
5684 n bytes like -falign-functions. This option can easily make code
5685 slower, because it must insert dummy operations for when the branch
5686 target is reached in the usual flow of the code.
5687
5688 -fno-align-labels and -falign-labels=1 are equivalent and mean that
5689 labels will not be aligned.
5690
5691 If -falign-loops or -falign-jumps are applicable and are greater
5692 than this value, then their values are used instead.
5693
5694 If n is not specified or is zero, use a machine-dependent default
5695 which is very likely to be 1, meaning no alignment.
5696
5697 Enabled at levels -O2, -O3.
5698
5699 -falign-loops
5700 -falign-loops=n
5701 Align loops to a power-of-two boundary, skipping up to n bytes like
5702 -falign-functions. The hope is that the loop will be executed many
5703 times, which will make up for any execution of the dummy
5704 operations.
5705
5706 -fno-align-loops and -falign-loops=1 are equivalent and mean that
5707 loops will not be aligned.
5708
5709 If n is not specified or is zero, use a machine-dependent default.
5710
5711 Enabled at levels -O2, -O3.
5712
5713 -falign-jumps
5714 -falign-jumps=n
5715 Align branch targets to a power-of-two boundary, for branch targets
5716 where the targets can only be reached by jumping, skipping up to n
5717 bytes like -falign-functions. In this case, no dummy operations
5718 need be executed.
5719
5720 -fno-align-jumps and -falign-jumps=1 are equivalent and mean that
5721 loops will not be aligned.
5722
5723 If n is not specified or is zero, use a machine-dependent default.
5724
5725 Enabled at levels -O2, -O3.
5726
5727 -funit-at-a-time
5728 This option is left for compatibility reasons. -funit-at-a-time has
5729 no effect, while -fno-unit-at-a-time implies -fno-toplevel-reorder
5730 and -fno-section-anchors.
5731
5732 Enabled by default.
5733
5734 -fno-toplevel-reorder
5735 Do not reorder top-level functions, variables, and "asm"
5736 statements. Output them in the same order that they appear in the
5737 input file. When this option is used, unreferenced static
5738 variables will not be removed. This option is intended to support
5739 existing code which relies on a particular ordering. For new code,
5740 it is better to use attributes.
5741
5742 Enabled at level -O0. When disabled explicitly, it also imply
5743 -fno-section-anchors that is otherwise enabled at -O0 on some
5744 targets.
5745
5746 -fweb
5747 Constructs webs as commonly used for register allocation purposes
5748 and assign each web individual pseudo register. This allows the
5749 register allocation pass to operate on pseudos directly, but also
5750 strengthens several other optimization passes, such as CSE, loop
5751 optimizer and trivial dead code remover. It can, however, make
5752 debugging impossible, since variables will no longer stay in a
5753 "home register".
5754
5755 Enabled by default with -funroll-loops.
5756
5757 -fwhole-program
5758 Assume that the current compilation unit represents the whole
5759 program being compiled. All public functions and variables with
5760 the exception of "main" and those merged by attribute
5761 "externally_visible" become static functions and in effect are
5762 optimized more aggressively by interprocedural optimizers. While
5763 this option is equivalent to proper use of the "static" keyword for
5764 programs consisting of a single file, in combination with option
5765 -combine, -flto or -fwhopr this flag can be used to compile many
5766 smaller scale programs since the functions and variables become
5767 local for the whole combined compilation unit, not for the single
5768 source file itself.
5769
5770 This option implies -fwhole-file for Fortran programs.
5771
5772 -flto
5773 This option runs the standard link-time optimizer. When invoked
5774 with source code, it generates GIMPLE (one of GCC's internal
5775 representations) and writes it to special ELF sections in the
5776 object file. When the object files are linked together, all the
5777 function bodies are read from these ELF sections and instantiated
5778 as if they had been part of the same translation unit.
5779
5780 To use the link-timer optimizer, -flto needs to be specified at
5781 compile time and during the final link. For example,
5782
5783 gcc -c -O2 -flto foo.c
5784 gcc -c -O2 -flto bar.c
5785 gcc -o myprog -flto -O2 foo.o bar.o
5786
5787 The first two invocations to GCC will save a bytecode
5788 representation of GIMPLE into special ELF sections inside foo.o and
5789 bar.o. The final invocation will read the GIMPLE bytecode from
5790 foo.o and bar.o, merge the two files into a single internal image,
5791 and compile the result as usual. Since both foo.o and bar.o are
5792 merged into a single image, this causes all the inter-procedural
5793 analyses and optimizations in GCC to work across the two files as
5794 if they were a single one. This means, for example, that the
5795 inliner will be able to inline functions in bar.o into functions in
5796 foo.o and vice-versa.
5797
5798 Another (simpler) way to enable link-time optimization is,
5799
5800 gcc -o myprog -flto -O2 foo.c bar.c
5801
5802 The above will generate bytecode for foo.c and bar.c, merge them
5803 together into a single GIMPLE representation and optimize them as
5804 usual to produce myprog.
5805
5806 The only important thing to keep in mind is that to enable link-
5807 time optimizations the -flto flag needs to be passed to both the
5808 compile and the link commands.
5809
5810 Note that when a file is compiled with -flto, the generated object
5811 file will be larger than a regular object file because it will
5812 contain GIMPLE bytecodes and the usual final code. This means that
5813 object files with LTO information can be linked as a normal object
5814 file. So, in the previous example, if the final link is done with
5815
5816 gcc -o myprog foo.o bar.o
5817
5818 The only difference will be that no inter-procedural optimizations
5819 will be applied to produce myprog. The two object files foo.o and
5820 bar.o will be simply sent to the regular linker.
5821
5822 Additionally, the optimization flags used to compile individual
5823 files are not necessarily related to those used at link-time. For
5824 instance,
5825
5826 gcc -c -O0 -flto foo.c
5827 gcc -c -O0 -flto bar.c
5828 gcc -o myprog -flto -O3 foo.o bar.o
5829
5830 This will produce individual object files with unoptimized
5831 assembler code, but the resulting binary myprog will be optimized
5832 at -O3. Now, if the final binary is generated without -flto, then
5833 myprog will not be optimized.
5834
5835 When producing the final binary with -flto, GCC will only apply
5836 link-time optimizations to those files that contain bytecode.
5837 Therefore, you can mix and match object files and libraries with
5838 GIMPLE bytecodes and final object code. GCC will automatically
5839 select which files to optimize in LTO mode and which files to link
5840 without further processing.
5841
5842 There are some code generation flags that GCC will preserve when
5843 generating bytecodes, as they need to be used during the final link
5844 stage. Currently, the following options are saved into the GIMPLE
5845 bytecode files: -fPIC, -fcommon and all the -m target flags.
5846
5847 At link time, these options are read-in and reapplied. Note that
5848 the current implementation makes no attempt at recognizing
5849 conflicting values for these options. If two or more files have a
5850 conflicting value (e.g., one file is compiled with -fPIC and
5851 another isn't), the compiler will simply use the last value read
5852 from the bytecode files. It is recommended, then, that all the
5853 files participating in the same link be compiled with the same
5854 options.
5855
5856 Another feature of LTO is that it is possible to apply
5857 interprocedural optimizations on files written in different
5858 languages. This requires some support in the language front end.
5859 Currently, the C, C++ and Fortran front ends are capable of
5860 emitting GIMPLE bytecodes, so something like this should work
5861
5862 gcc -c -flto foo.c
5863 g++ -c -flto bar.cc
5864 gfortran -c -flto baz.f90
5865 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
5866
5867 Notice that the final link is done with g++ to get the C++ runtime
5868 libraries and -lgfortran is added to get the Fortran runtime
5869 libraries. In general, when mixing languages in LTO mode, you
5870 should use the same link command used when mixing languages in a
5871 regular (non-LTO) compilation. This means that if your build
5872 process was mixing languages before, all you need to add is -flto
5873 to all the compile and link commands.
5874
5875 If LTO encounters objects with C linkage declared with incompatible
5876 types in separate translation units to be linked together
5877 (undefined behavior according to ISO C99 6.2.7), a non-fatal
5878 diagnostic may be issued. The behavior is still undefined at
5879 runtime.
5880
5881 If object files containing GIMPLE bytecode are stored in a library
5882 archive, say libfoo.a, it is possible to extract and use them in an
5883 LTO link if you are using gold as the linker (which, in turn
5884 requires GCC to be configured with --enable-gold). To enable this
5885 feature, use the flag -fuse-linker-plugin at link-time:
5886
5887 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
5888
5889 With the linker plugin enabled, gold will extract the needed GIMPLE
5890 files from libfoo.a and pass them on to the running GCC to make
5891 them part of the aggregated GIMPLE image to be optimized.
5892
5893 If you are not using gold and/or do not specify -fuse-linker-plugin
5894 then the objects inside libfoo.a will be extracted and linked as
5895 usual, but they will not participate in the LTO optimization
5896 process.
5897
5898 Link time optimizations do not require the presence of the whole
5899 program to operate. If the program does not require any symbols to
5900 be exported, it is possible to combine -flto and -fwhopr with
5901 -fwhole-program to allow the interprocedural optimizers to use more
5902 aggressive assumptions which may lead to improved optimization
5903 opportunities.
5904
5905 Regarding portability: the current implementation of LTO makes no
5906 attempt at generating bytecode that can be ported between different
5907 types of hosts. The bytecode files are versioned and there is a
5908 strict version check, so bytecode files generated in one version of
5909 GCC will not work with an older/newer version of GCC.
5910
5911 Link time optimization does not play well with generating debugging
5912 information. Combining -flto or -fwhopr with -g is experimental.
5913
5914 This option is disabled by default.
5915
5916 -fwhopr
5917 This option is identical in functionality to -flto but it differs
5918 in how the final link stage is executed. Instead of loading all
5919 the function bodies in memory, the callgraph is analyzed and
5920 optimization decisions are made (whole program analysis or WPA).
5921 Once optimization decisions are made, the callgraph is partitioned
5922 and the different sections are compiled separately (local
5923 transformations or LTRANS). This process allows optimizations on
5924 very large programs that otherwise would not fit in memory. This
5925 option enables -fwpa and -fltrans automatically.
5926
5927 Disabled by default.
5928
5929 This option is experimental.
5930
5931 -fwpa
5932 This is an internal option used by GCC when compiling with -fwhopr.
5933 You should never need to use it.
5934
5935 This option runs the link-time optimizer in the whole-program-
5936 analysis (WPA) mode, which reads in summary information from all
5937 inputs and performs a whole-program analysis based on summary
5938 information only. It generates object files for subsequent runs of
5939 the link-time optimizer where individual object files are optimized
5940 using both summary information from the WPA mode and the actual
5941 function bodies. It then drives the LTRANS phase.
5942
5943 Disabled by default.
5944
5945 -fltrans
5946 This is an internal option used by GCC when compiling with -fwhopr.
5947 You should never need to use it.
5948
5949 This option runs the link-time optimizer in the local-
5950 transformation (LTRANS) mode, which reads in output from a previous
5951 run of the LTO in WPA mode. In the LTRANS mode, LTO optimizes an
5952 object and produces the final assembly.
5953
5954 Disabled by default.
5955
5956 -fltrans-output-list=file
5957 This is an internal option used by GCC when compiling with -fwhopr.
5958 You should never need to use it.
5959
5960 This option specifies a file to which the names of LTRANS output
5961 files are written. This option is only meaningful in conjunction
5962 with -fwpa.
5963
5964 Disabled by default.
5965
5966 -flto-compression-level=n
5967 This option specifies the level of compression used for
5968 intermediate language written to LTO object files, and is only
5969 meaningful in conjunction with LTO mode (-fwhopr, -flto). Valid
5970 values are 0 (no compression) to 9 (maximum compression). Values
5971 outside this range are clamped to either 0 or 9. If the option is
5972 not given, a default balanced compression setting is used.
5973
5974 -flto-report
5975 Prints a report with internal details on the workings of the link-
5976 time optimizer. The contents of this report vary from version to
5977 version, it is meant to be useful to GCC developers when processing
5978 object files in LTO mode (via -fwhopr or -flto).
5979
5980 Disabled by default.
5981
5982 -fuse-linker-plugin
5983 Enables the extraction of objects with GIMPLE bytecode information
5984 from library archives. This option relies on features available
5985 only in gold, so to use this you must configure GCC with
5986 --enable-gold. See -flto for a description on the effect of this
5987 flag and how to use it.
5988
5989 Disabled by default.
5990
5991 -fcprop-registers
5992 After register allocation and post-register allocation instruction
5993 splitting, we perform a copy-propagation pass to try to reduce
5994 scheduling dependencies and occasionally eliminate the copy.
5995
5996 Enabled at levels -O, -O2, -O3, -Os.
5997
5998 -fprofile-correction
5999 Profiles collected using an instrumented binary for multi-threaded
6000 programs may be inconsistent due to missed counter updates. When
6001 this option is specified, GCC will use heuristics to correct or
6002 smooth out such inconsistencies. By default, GCC will emit an error
6003 message when an inconsistent profile is detected.
6004
6005 -fprofile-dir=path
6006 Set the directory to search the profile data files in to path.
6007 This option affects only the profile data generated by
6008 -fprofile-generate, -ftest-coverage, -fprofile-arcs and used by
6009 -fprofile-use and -fbranch-probabilities and its related options.
6010 By default, GCC will use the current directory as path thus the
6011 profile data file will appear in the same directory as the object
6012 file.
6013
6014 -fprofile-generate
6015 -fprofile-generate=path
6016 Enable options usually used for instrumenting application to
6017 produce profile useful for later recompilation with profile
6018 feedback based optimization. You must use -fprofile-generate both
6019 when compiling and when linking your program.
6020
6021 The following options are enabled: "-fprofile-arcs",
6022 "-fprofile-values", "-fvpt".
6023
6024 If path is specified, GCC will look at the path to find the profile
6025 feedback data files. See -fprofile-dir.
6026
6027 -fprofile-use
6028 -fprofile-use=path
6029 Enable profile feedback directed optimizations, and optimizations
6030 generally profitable only with profile feedback available.
6031
6032 The following options are enabled: "-fbranch-probabilities",
6033 "-fvpt", "-funroll-loops", "-fpeel-loops", "-ftracer"
6034
6035 By default, GCC emits an error message if the feedback profiles do
6036 not match the source code. This error can be turned into a warning
6037 by using -Wcoverage-mismatch. Note this may result in poorly
6038 optimized code.
6039
6040 If path is specified, GCC will look at the path to find the profile
6041 feedback data files. See -fprofile-dir.
6042
6043 The following options control compiler behavior regarding floating
6044 point arithmetic. These options trade off between speed and
6045 correctness. All must be specifically enabled.
6046
6047 -ffloat-store
6048 Do not store floating point variables in registers, and inhibit
6049 other options that might change whether a floating point value is
6050 taken from a register or memory.
6051
6052 This option prevents undesirable excess precision on machines such
6053 as the 68000 where the floating registers (of the 68881) keep more
6054 precision than a "double" is supposed to have. Similarly for the
6055 x86 architecture. For most programs, the excess precision does
6056 only good, but a few programs rely on the precise definition of
6057 IEEE floating point. Use -ffloat-store for such programs, after
6058 modifying them to store all pertinent intermediate computations
6059 into variables.
6060
6061 -fexcess-precision=style
6062 This option allows further control over excess precision on
6063 machines where floating-point registers have more precision than
6064 the IEEE "float" and "double" types and the processor does not
6065 support operations rounding to those types. By default,
6066 -fexcess-precision=fast is in effect; this means that operations
6067 are carried out in the precision of the registers and that it is
6068 unpredictable when rounding to the types specified in the source
6069 code takes place. When compiling C, if -fexcess-precision=standard
6070 is specified then excess precision will follow the rules specified
6071 in ISO C99; in particular, both casts and assignments cause values
6072 to be rounded to their semantic types (whereas -ffloat-store only
6073 affects assignments). This option is enabled by default for C if a
6074 strict conformance option such as -std=c99 is used.
6075
6076 -fexcess-precision=standard is not implemented for languages other
6077 than C, and has no effect if -funsafe-math-optimizations or
6078 -ffast-math is specified. On the x86, it also has no effect if
6079 -mfpmath=sse or -mfpmath=sse+387 is specified; in the former case,
6080 IEEE semantics apply without excess precision, and in the latter,
6081 rounding is unpredictable.
6082
6083 -ffast-math
6084 Sets -fno-math-errno, -funsafe-math-optimizations,
6085 -ffinite-math-only, -fno-rounding-math, -fno-signaling-nans and
6086 -fcx-limited-range.
6087
6088 This option causes the preprocessor macro "__FAST_MATH__" to be
6089 defined.
6090
6091 This option is not turned on by any -O option since it can result
6092 in incorrect output for programs which depend on an exact
6093 implementation of IEEE or ISO rules/specifications for math
6094 functions. It may, however, yield faster code for programs that do
6095 not require the guarantees of these specifications.
6096
6097 -fno-math-errno
6098 Do not set ERRNO after calling math functions that are executed
6099 with a single instruction, e.g., sqrt. A program that relies on
6100 IEEE exceptions for math error handling may want to use this flag
6101 for speed while maintaining IEEE arithmetic compatibility.
6102
6103 This option is not turned on by any -O option since it can result
6104 in incorrect output for programs which depend on an exact
6105 implementation of IEEE or ISO rules/specifications for math
6106 functions. It may, however, yield faster code for programs that do
6107 not require the guarantees of these specifications.
6108
6109 The default is -fmath-errno.
6110
6111 On Darwin systems, the math library never sets "errno". There is
6112 therefore no reason for the compiler to consider the possibility
6113 that it might, and -fno-math-errno is the default.
6114
6115 -funsafe-math-optimizations
6116 Allow optimizations for floating-point arithmetic that (a) assume
6117 that arguments and results are valid and (b) may violate IEEE or
6118 ANSI standards. When used at link-time, it may include libraries
6119 or startup files that change the default FPU control word or other
6120 similar optimizations.
6121
6122 This option is not turned on by any -O option since it can result
6123 in incorrect output for programs which depend on an exact
6124 implementation of IEEE or ISO rules/specifications for math
6125 functions. It may, however, yield faster code for programs that do
6126 not require the guarantees of these specifications. Enables
6127 -fno-signed-zeros, -fno-trapping-math, -fassociative-math and
6128 -freciprocal-math.
6129
6130 The default is -fno-unsafe-math-optimizations.
6131
6132 -fassociative-math
6133 Allow re-association of operands in series of floating-point
6134 operations. This violates the ISO C and C++ language standard by
6135 possibly changing computation result. NOTE: re-ordering may change
6136 the sign of zero as well as ignore NaNs and inhibit or create
6137 underflow or overflow (and thus cannot be used on a code which
6138 relies on rounding behavior like "(x + 2**52) - 2**52)". May also
6139 reorder floating-point comparisons and thus may not be used when
6140 ordered comparisons are required. This option requires that both
6141 -fno-signed-zeros and -fno-trapping-math be in effect. Moreover,
6142 it doesn't make much sense with -frounding-math. For Fortran the
6143 option is automatically enabled when both -fno-signed-zeros and
6144 -fno-trapping-math are in effect.
6145
6146 The default is -fno-associative-math.
6147
6148 -freciprocal-math
6149 Allow the reciprocal of a value to be used instead of dividing by
6150 the value if this enables optimizations. For example "x / y" can
6151 be replaced with "x * (1/y)" which is useful if "(1/y)" is subject
6152 to common subexpression elimination. Note that this loses
6153 precision and increases the number of flops operating on the value.
6154
6155 The default is -fno-reciprocal-math.
6156
6157 -ffinite-math-only
6158 Allow optimizations for floating-point arithmetic that assume that
6159 arguments and results are not NaNs or +-Infs.
6160
6161 This option is not turned on by any -O option since it can result
6162 in incorrect output for programs which depend on an exact
6163 implementation of IEEE or ISO rules/specifications for math
6164 functions. It may, however, yield faster code for programs that do
6165 not require the guarantees of these specifications.
6166
6167 The default is -fno-finite-math-only.
6168
6169 -fno-signed-zeros
6170 Allow optimizations for floating point arithmetic that ignore the
6171 signedness of zero. IEEE arithmetic specifies the behavior of
6172 distinct +0.0 and -0.0 values, which then prohibits simplification
6173 of expressions such as x+0.0 or 0.0*x (even with
6174 -ffinite-math-only). This option implies that the sign of a zero
6175 result isn't significant.
6176
6177 The default is -fsigned-zeros.
6178
6179 -fno-trapping-math
6180 Compile code assuming that floating-point operations cannot
6181 generate user-visible traps. These traps include division by zero,
6182 overflow, underflow, inexact result and invalid operation. This
6183 option requires that -fno-signaling-nans be in effect. Setting
6184 this option may allow faster code if one relies on "non-stop" IEEE
6185 arithmetic, for example.
6186
6187 This option should never be turned on by any -O option since it can
6188 result in incorrect output for programs which depend on an exact
6189 implementation of IEEE or ISO rules/specifications for math
6190 functions.
6191
6192 The default is -ftrapping-math.
6193
6194 -frounding-math
6195 Disable transformations and optimizations that assume default
6196 floating point rounding behavior. This is round-to-zero for all
6197 floating point to integer conversions, and round-to-nearest for all
6198 other arithmetic truncations. This option should be specified for
6199 programs that change the FP rounding mode dynamically, or that may
6200 be executed with a non-default rounding mode. This option disables
6201 constant folding of floating point expressions at compile-time
6202 (which may be affected by rounding mode) and arithmetic
6203 transformations that are unsafe in the presence of sign-dependent
6204 rounding modes.
6205
6206 The default is -fno-rounding-math.
6207
6208 This option is experimental and does not currently guarantee to
6209 disable all GCC optimizations that are affected by rounding mode.
6210 Future versions of GCC may provide finer control of this setting
6211 using C99's "FENV_ACCESS" pragma. This command line option will be
6212 used to specify the default state for "FENV_ACCESS".
6213
6214 -fsignaling-nans
6215 Compile code assuming that IEEE signaling NaNs may generate user-
6216 visible traps during floating-point operations. Setting this
6217 option disables optimizations that may change the number of
6218 exceptions visible with signaling NaNs. This option implies
6219 -ftrapping-math.
6220
6221 This option causes the preprocessor macro "__SUPPORT_SNAN__" to be
6222 defined.
6223
6224 The default is -fno-signaling-nans.
6225
6226 This option is experimental and does not currently guarantee to
6227 disable all GCC optimizations that affect signaling NaN behavior.
6228
6229 -fsingle-precision-constant
6230 Treat floating point constant as single precision constant instead
6231 of implicitly converting it to double precision constant.
6232
6233 -fcx-limited-range
6234 When enabled, this option states that a range reduction step is not
6235 needed when performing complex division. Also, there is no
6236 checking whether the result of a complex multiplication or division
6237 is "NaN + I*NaN", with an attempt to rescue the situation in that
6238 case. The default is -fno-cx-limited-range, but is enabled by
6239 -ffast-math.
6240
6241 This option controls the default setting of the ISO C99
6242 "CX_LIMITED_RANGE" pragma. Nevertheless, the option applies to all
6243 languages.
6244
6245 -fcx-fortran-rules
6246 Complex multiplication and division follow Fortran rules. Range
6247 reduction is done as part of complex division, but there is no
6248 checking whether the result of a complex multiplication or division
6249 is "NaN + I*NaN", with an attempt to rescue the situation in that
6250 case.
6251
6252 The default is -fno-cx-fortran-rules.
6253
6254 The following options control optimizations that may improve
6255 performance, but are not enabled by any -O options. This section
6256 includes experimental options that may produce broken code.
6257
6258 -fbranch-probabilities
6259 After running a program compiled with -fprofile-arcs, you can
6260 compile it a second time using -fbranch-probabilities, to improve
6261 optimizations based on the number of times each branch was taken.
6262 When the program compiled with -fprofile-arcs exits it saves arc
6263 execution counts to a file called sourcename.gcda for each source
6264 file. The information in this data file is very dependent on the
6265 structure of the generated code, so you must use the same source
6266 code and the same optimization options for both compilations.
6267
6268 With -fbranch-probabilities, GCC puts a REG_BR_PROB note on each
6269 JUMP_INSN and CALL_INSN. These can be used to improve
6270 optimization. Currently, they are only used in one place: in
6271 reorg.c, instead of guessing which path a branch is mostly to take,
6272 the REG_BR_PROB values are used to exactly determine which path is
6273 taken more often.
6274
6275 -fprofile-values
6276 If combined with -fprofile-arcs, it adds code so that some data
6277 about values of expressions in the program is gathered.
6278
6279 With -fbranch-probabilities, it reads back the data gathered from
6280 profiling values of expressions and adds REG_VALUE_PROFILE notes to
6281 instructions for their later usage in optimizations.
6282
6283 Enabled with -fprofile-generate and -fprofile-use.
6284
6285 -fvpt
6286 If combined with -fprofile-arcs, it instructs the compiler to add a
6287 code to gather information about values of expressions.
6288
6289 With -fbranch-probabilities, it reads back the data gathered and
6290 actually performs the optimizations based on them. Currently the
6291 optimizations include specialization of division operation using
6292 the knowledge about the value of the denominator.
6293
6294 -frename-registers
6295 Attempt to avoid false dependencies in scheduled code by making use
6296 of registers left over after register allocation. This
6297 optimization will most benefit processors with lots of registers.
6298 Depending on the debug information format adopted by the target,
6299 however, it can make debugging impossible, since variables will no
6300 longer stay in a "home register".
6301
6302 Enabled by default with -funroll-loops and -fpeel-loops.
6303
6304 -ftracer
6305 Perform tail duplication to enlarge superblock size. This
6306 transformation simplifies the control flow of the function allowing
6307 other optimizations to do better job.
6308
6309 Enabled with -fprofile-use.
6310
6311 -funroll-loops
6312 Unroll loops whose number of iterations can be determined at
6313 compile time or upon entry to the loop. -funroll-loops implies
6314 -frerun-cse-after-loop, -fweb and -frename-registers. It also
6315 turns on complete loop peeling (i.e. complete removal of loops with
6316 small constant number of iterations). This option makes code
6317 larger, and may or may not make it run faster.
6318
6319 Enabled with -fprofile-use.
6320
6321 -funroll-all-loops
6322 Unroll all loops, even if their number of iterations is uncertain
6323 when the loop is entered. This usually makes programs run more
6324 slowly. -funroll-all-loops implies the same options as
6325 -funroll-loops.
6326
6327 -fpeel-loops
6328 Peels the loops for that there is enough information that they do
6329 not roll much (from profile feedback). It also turns on complete
6330 loop peeling (i.e. complete removal of loops with small constant
6331 number of iterations).
6332
6333 Enabled with -fprofile-use.
6334
6335 -fmove-loop-invariants
6336 Enables the loop invariant motion pass in the RTL loop optimizer.
6337 Enabled at level -O1
6338
6339 -funswitch-loops
6340 Move branches with loop invariant conditions out of the loop, with
6341 duplicates of the loop on both branches (modified according to
6342 result of the condition).
6343
6344 -ffunction-sections
6345 -fdata-sections
6346 Place each function or data item into its own section in the output
6347 file if the target supports arbitrary sections. The name of the
6348 function or the name of the data item determines the section's name
6349 in the output file.
6350
6351 Use these options on systems where the linker can perform
6352 optimizations to improve locality of reference in the instruction
6353 space. Most systems using the ELF object format and SPARC
6354 processors running Solaris 2 have linkers with such optimizations.
6355 AIX may have these optimizations in the future.
6356
6357 Only use these options when there are significant benefits from
6358 doing so. When you specify these options, the assembler and linker
6359 will create larger object and executable files and will also be
6360 slower. You will not be able to use "gprof" on all systems if you
6361 specify this option and you may have problems with debugging if you
6362 specify both this option and -g.
6363
6364 -fbranch-target-load-optimize
6365 Perform branch target register load optimization before prologue /
6366 epilogue threading. The use of target registers can typically be
6367 exposed only during reload, thus hoisting loads out of loops and
6368 doing inter-block scheduling needs a separate optimization pass.
6369
6370 -fbranch-target-load-optimize2
6371 Perform branch target register load optimization after prologue /
6372 epilogue threading.
6373
6374 -fbtr-bb-exclusive
6375 When performing branch target register load optimization, don't
6376 reuse branch target registers in within any basic block.
6377
6378 -fstack-protector
6379 Emit extra code to check for buffer overflows, such as stack
6380 smashing attacks. This is done by adding a guard variable to
6381 functions with vulnerable objects. This includes functions that
6382 call alloca, and functions with buffers larger than 8 bytes. The
6383 guards are initialized when a function is entered and then checked
6384 when the function exits. If a guard check fails, an error message
6385 is printed and the program exits.
6386
6387 -fstack-protector-all
6388 Like -fstack-protector except that all functions are protected.
6389
6390 -fsection-anchors
6391 Try to reduce the number of symbolic address calculations by using
6392 shared "anchor" symbols to address nearby objects. This
6393 transformation can help to reduce the number of GOT entries and GOT
6394 accesses on some targets.
6395
6396 For example, the implementation of the following function "foo":
6397
6398 static int a, b, c;
6399 int foo (void) { return a + b + c; }
6400
6401 would usually calculate the addresses of all three variables, but
6402 if you compile it with -fsection-anchors, it will access the
6403 variables from a common anchor point instead. The effect is
6404 similar to the following pseudocode (which isn't valid C):
6405
6406 int foo (void)
6407 {
6408 register int *xr = &x;
6409 return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6410 }
6411
6412 Not all targets support this option.
6413
6414 --param name=value
6415 In some places, GCC uses various constants to control the amount of
6416 optimization that is done. For example, GCC will not inline
6417 functions that contain more that a certain number of instructions.
6418 You can control some of these constants on the command-line using
6419 the --param option.
6420
6421 The names of specific parameters, and the meaning of the values,
6422 are tied to the internals of the compiler, and are subject to
6423 change without notice in future releases.
6424
6425 In each case, the value is an integer. The allowable choices for
6426 name are given in the following table:
6427
6428 struct-reorg-cold-struct-ratio
6429 The threshold ratio (as a percentage) between a structure
6430 frequency and the frequency of the hottest structure in the
6431 program. This parameter is used by struct-reorg optimization
6432 enabled by -fipa-struct-reorg. We say that if the ratio of a
6433 structure frequency, calculated by profiling, to the hottest
6434 structure frequency in the program is less than this parameter,
6435 then structure reorganization is not applied to this structure.
6436 The default is 10.
6437
6438 predictable-branch-outcome
6439 When branch is predicted to be taken with probability lower
6440 than this threshold (in percent), then it is considered well
6441 predictable. The default is 10.
6442
6443 max-crossjump-edges
6444 The maximum number of incoming edges to consider for
6445 crossjumping. The algorithm used by -fcrossjumping is O(N^2)
6446 in the number of edges incoming to each block. Increasing
6447 values mean more aggressive optimization, making the compile
6448 time increase with probably small improvement in executable
6449 size.
6450
6451 min-crossjump-insns
6452 The minimum number of instructions which must be matched at the
6453 end of two blocks before crossjumping will be performed on
6454 them. This value is ignored in the case where all instructions
6455 in the block being crossjumped from are matched. The default
6456 value is 5.
6457
6458 max-grow-copy-bb-insns
6459 The maximum code size expansion factor when copying basic
6460 blocks instead of jumping. The expansion is relative to a jump
6461 instruction. The default value is 8.
6462
6463 max-goto-duplication-insns
6464 The maximum number of instructions to duplicate to a block that
6465 jumps to a computed goto. To avoid O(N^2) behavior in a number
6466 of passes, GCC factors computed gotos early in the compilation
6467 process, and unfactors them as late as possible. Only computed
6468 jumps at the end of a basic blocks with no more than max-goto-
6469 duplication-insns are unfactored. The default value is 8.
6470
6471 max-delay-slot-insn-search
6472 The maximum number of instructions to consider when looking for
6473 an instruction to fill a delay slot. If more than this
6474 arbitrary number of instructions is searched, the time savings
6475 from filling the delay slot will be minimal so stop searching.
6476 Increasing values mean more aggressive optimization, making the
6477 compile time increase with probably small improvement in
6478 executable run time.
6479
6480 max-delay-slot-live-search
6481 When trying to fill delay slots, the maximum number of
6482 instructions to consider when searching for a block with valid
6483 live register information. Increasing this arbitrarily chosen
6484 value means more aggressive optimization, increasing the
6485 compile time. This parameter should be removed when the delay
6486 slot code is rewritten to maintain the control-flow graph.
6487
6488 max-gcse-memory
6489 The approximate maximum amount of memory that will be allocated
6490 in order to perform the global common subexpression elimination
6491 optimization. If more memory than specified is required, the
6492 optimization will not be done.
6493
6494 max-pending-list-length
6495 The maximum number of pending dependencies scheduling will
6496 allow before flushing the current state and starting over.
6497 Large functions with few branches or calls can create
6498 excessively large lists which needlessly consume memory and
6499 resources.
6500
6501 max-inline-insns-single
6502 Several parameters control the tree inliner used in gcc. This
6503 number sets the maximum number of instructions (counted in
6504 GCC's internal representation) in a single function that the
6505 tree inliner will consider for inlining. This only affects
6506 functions declared inline and methods implemented in a class
6507 declaration (C++). The default value is 300.
6508
6509 max-inline-insns-auto
6510 When you use -finline-functions (included in -O3), a lot of
6511 functions that would otherwise not be considered for inlining
6512 by the compiler will be investigated. To those functions, a
6513 different (more restrictive) limit compared to functions
6514 declared inline can be applied. The default value is 50.
6515
6516 large-function-insns
6517 The limit specifying really large functions. For functions
6518 larger than this limit after inlining, inlining is constrained
6519 by --param large-function-growth. This parameter is useful
6520 primarily to avoid extreme compilation time caused by non-
6521 linear algorithms used by the backend. The default value is
6522 2700.
6523
6524 large-function-growth
6525 Specifies maximal growth of large function caused by inlining
6526 in percents. The default value is 100 which limits large
6527 function growth to 2.0 times the original size.
6528
6529 large-unit-insns
6530 The limit specifying large translation unit. Growth caused by
6531 inlining of units larger than this limit is limited by --param
6532 inline-unit-growth. For small units this might be too tight
6533 (consider unit consisting of function A that is inline and B
6534 that just calls A three time. If B is small relative to A, the
6535 growth of unit is 300\% and yet such inlining is very sane.
6536 For very large units consisting of small inlineable functions
6537 however the overall unit growth limit is needed to avoid
6538 exponential explosion of code size. Thus for smaller units,
6539 the size is increased to --param large-unit-insns before
6540 applying --param inline-unit-growth. The default is 10000
6541
6542 inline-unit-growth
6543 Specifies maximal overall growth of the compilation unit caused
6544 by inlining. The default value is 30 which limits unit growth
6545 to 1.3 times the original size.
6546
6547 ipcp-unit-growth
6548 Specifies maximal overall growth of the compilation unit caused
6549 by interprocedural constant propagation. The default value is
6550 10 which limits unit growth to 1.1 times the original size.
6551
6552 large-stack-frame
6553 The limit specifying large stack frames. While inlining the
6554 algorithm is trying to not grow past this limit too much.
6555 Default value is 256 bytes.
6556
6557 large-stack-frame-growth
6558 Specifies maximal growth of large stack frames caused by
6559 inlining in percents. The default value is 1000 which limits
6560 large stack frame growth to 11 times the original size.
6561
6562 max-inline-insns-recursive
6563 max-inline-insns-recursive-auto
6564 Specifies maximum number of instructions out-of-line copy of
6565 self recursive inline function can grow into by performing
6566 recursive inlining.
6567
6568 For functions declared inline --param max-inline-insns-
6569 recursive is taken into account. For function not declared
6570 inline, recursive inlining happens only when -finline-functions
6571 (included in -O3) is enabled and --param max-inline-insns-
6572 recursive-auto is used. The default value is 450.
6573
6574 max-inline-recursive-depth
6575 max-inline-recursive-depth-auto
6576 Specifies maximum recursion depth used by the recursive
6577 inlining.
6578
6579 For functions declared inline --param max-inline-recursive-
6580 depth is taken into account. For function not declared inline,
6581 recursive inlining happens only when -finline-functions
6582 (included in -O3) is enabled and --param max-inline-recursive-
6583 depth-auto is used. The default value is 8.
6584
6585 min-inline-recursive-probability
6586 Recursive inlining is profitable only for function having deep
6587 recursion in average and can hurt for function having little
6588 recursion depth by increasing the prologue size or complexity
6589 of function body to other optimizers.
6590
6591 When profile feedback is available (see -fprofile-generate) the
6592 actual recursion depth can be guessed from probability that
6593 function will recurse via given call expression. This
6594 parameter limits inlining only to call expression whose
6595 probability exceeds given threshold (in percents). The default
6596 value is 10.
6597
6598 early-inlining-insns
6599 Specify growth that early inliner can make. In effect it
6600 increases amount of inlining for code having large abstraction
6601 penalty. The default value is 8.
6602
6603 max-early-inliner-iterations
6604 max-early-inliner-iterations
6605 Limit of iterations of early inliner. This basically bounds
6606 number of nested indirect calls early inliner can resolve.
6607 Deeper chains are still handled by late inlining.
6608
6609 min-vect-loop-bound
6610 The minimum number of iterations under which a loop will not
6611 get vectorized when -ftree-vectorize is used. The number of
6612 iterations after vectorization needs to be greater than the
6613 value specified by this option to allow vectorization. The
6614 default value is 0.
6615
6616 max-unrolled-insns
6617 The maximum number of instructions that a loop should have if
6618 that loop is unrolled, and if the loop is unrolled, it
6619 determines how many times the loop code is unrolled.
6620
6621 max-average-unrolled-insns
6622 The maximum number of instructions biased by probabilities of
6623 their execution that a loop should have if that loop is
6624 unrolled, and if the loop is unrolled, it determines how many
6625 times the loop code is unrolled.
6626
6627 max-unroll-times
6628 The maximum number of unrollings of a single loop.
6629
6630 max-peeled-insns
6631 The maximum number of instructions that a loop should have if
6632 that loop is peeled, and if the loop is peeled, it determines
6633 how many times the loop code is peeled.
6634
6635 max-peel-times
6636 The maximum number of peelings of a single loop.
6637
6638 max-completely-peeled-insns
6639 The maximum number of insns of a completely peeled loop.
6640
6641 max-completely-peel-times
6642 The maximum number of iterations of a loop to be suitable for
6643 complete peeling.
6644
6645 max-completely-peel-loop-nest-depth
6646 The maximum depth of a loop nest suitable for complete peeling.
6647
6648 max-unswitch-insns
6649 The maximum number of insns of an unswitched loop.
6650
6651 max-unswitch-level
6652 The maximum number of branches unswitched in a single loop.
6653
6654 lim-expensive
6655 The minimum cost of an expensive expression in the loop
6656 invariant motion.
6657
6658 iv-consider-all-candidates-bound
6659 Bound on number of candidates for induction variables below
6660 that all candidates are considered for each use in induction
6661 variable optimizations. Only the most relevant candidates are
6662 considered if there are more candidates, to avoid quadratic
6663 time complexity.
6664
6665 iv-max-considered-uses
6666 The induction variable optimizations give up on loops that
6667 contain more induction variable uses.
6668
6669 iv-always-prune-cand-set-bound
6670 If number of candidates in the set is smaller than this value,
6671 we always try to remove unnecessary ivs from the set during its
6672 optimization when a new iv is added to the set.
6673
6674 scev-max-expr-size
6675 Bound on size of expressions used in the scalar evolutions
6676 analyzer. Large expressions slow the analyzer.
6677
6678 omega-max-vars
6679 The maximum number of variables in an Omega constraint system.
6680 The default value is 128.
6681
6682 omega-max-geqs
6683 The maximum number of inequalities in an Omega constraint
6684 system. The default value is 256.
6685
6686 omega-max-eqs
6687 The maximum number of equalities in an Omega constraint system.
6688 The default value is 128.
6689
6690 omega-max-wild-cards
6691 The maximum number of wildcard variables that the Omega solver
6692 will be able to insert. The default value is 18.
6693
6694 omega-hash-table-size
6695 The size of the hash table in the Omega solver. The default
6696 value is 550.
6697
6698 omega-max-keys
6699 The maximal number of keys used by the Omega solver. The
6700 default value is 500.
6701
6702 omega-eliminate-redundant-constraints
6703 When set to 1, use expensive methods to eliminate all redundant
6704 constraints. The default value is 0.
6705
6706 vect-max-version-for-alignment-checks
6707 The maximum number of runtime checks that can be performed when
6708 doing loop versioning for alignment in the vectorizer. See
6709 option ftree-vect-loop-version for more information.
6710
6711 vect-max-version-for-alias-checks
6712 The maximum number of runtime checks that can be performed when
6713 doing loop versioning for alias in the vectorizer. See option
6714 ftree-vect-loop-version for more information.
6715
6716 max-iterations-to-track
6717 The maximum number of iterations of a loop the brute force
6718 algorithm for analysis of # of iterations of the loop tries to
6719 evaluate.
6720
6721 hot-bb-count-fraction
6722 Select fraction of the maximal count of repetitions of basic
6723 block in program given basic block needs to have to be
6724 considered hot.
6725
6726 hot-bb-frequency-fraction
6727 Select fraction of the maximal frequency of executions of basic
6728 block in function given basic block needs to have to be
6729 considered hot
6730
6731 max-predicted-iterations
6732 The maximum number of loop iterations we predict statically.
6733 This is useful in cases where function contain single loop with
6734 known bound and other loop with unknown. We predict the known
6735 number of iterations correctly, while the unknown number of
6736 iterations average to roughly 10. This means that the loop
6737 without bounds would appear artificially cold relative to the
6738 other one.
6739
6740 align-threshold
6741 Select fraction of the maximal frequency of executions of basic
6742 block in function given basic block will get aligned.
6743
6744 align-loop-iterations
6745 A loop expected to iterate at lest the selected number of
6746 iterations will get aligned.
6747
6748 tracer-dynamic-coverage
6749 tracer-dynamic-coverage-feedback
6750 This value is used to limit superblock formation once the given
6751 percentage of executed instructions is covered. This limits
6752 unnecessary code size expansion.
6753
6754 The tracer-dynamic-coverage-feedback is used only when profile
6755 feedback is available. The real profiles (as opposed to
6756 statically estimated ones) are much less balanced allowing the
6757 threshold to be larger value.
6758
6759 tracer-max-code-growth
6760 Stop tail duplication once code growth has reached given
6761 percentage. This is rather hokey argument, as most of the
6762 duplicates will be eliminated later in cross jumping, so it may
6763 be set to much higher values than is the desired code growth.
6764
6765 tracer-min-branch-ratio
6766 Stop reverse growth when the reverse probability of best edge
6767 is less than this threshold (in percent).
6768
6769 tracer-min-branch-ratio
6770 tracer-min-branch-ratio-feedback
6771 Stop forward growth if the best edge do have probability lower
6772 than this threshold.
6773
6774 Similarly to tracer-dynamic-coverage two values are present,
6775 one for compilation for profile feedback and one for
6776 compilation without. The value for compilation with profile
6777 feedback needs to be more conservative (higher) in order to
6778 make tracer effective.
6779
6780 max-cse-path-length
6781 Maximum number of basic blocks on path that cse considers. The
6782 default is 10.
6783
6784 max-cse-insns
6785 The maximum instructions CSE process before flushing. The
6786 default is 1000.
6787
6788 ggc-min-expand
6789 GCC uses a garbage collector to manage its own memory
6790 allocation. This parameter specifies the minimum percentage by
6791 which the garbage collector's heap should be allowed to expand
6792 between collections. Tuning this may improve compilation
6793 speed; it has no effect on code generation.
6794
6795 The default is 30% + 70% * (RAM/1GB) with an upper bound of
6796 100% when RAM >= 1GB. If "getrlimit" is available, the notion
6797 of "RAM" is the smallest of actual RAM and "RLIMIT_DATA" or
6798 "RLIMIT_AS". If GCC is not able to calculate RAM on a
6799 particular platform, the lower bound of 30% is used. Setting
6800 this parameter and ggc-min-heapsize to zero causes a full
6801 collection to occur at every opportunity. This is extremely
6802 slow, but can be useful for debugging.
6803
6804 ggc-min-heapsize
6805 Minimum size of the garbage collector's heap before it begins
6806 bothering to collect garbage. The first collection occurs
6807 after the heap expands by ggc-min-expand% beyond ggc-min-
6808 heapsize. Again, tuning this may improve compilation speed,
6809 and has no effect on code generation.
6810
6811 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit
6812 which tries to ensure that RLIMIT_DATA or RLIMIT_AS are not
6813 exceeded, but with a lower bound of 4096 (four megabytes) and
6814 an upper bound of 131072 (128 megabytes). If GCC is not able
6815 to calculate RAM on a particular platform, the lower bound is
6816 used. Setting this parameter very large effectively disables
6817 garbage collection. Setting this parameter and ggc-min-expand
6818 to zero causes a full collection to occur at every opportunity.
6819
6820 max-reload-search-insns
6821 The maximum number of instruction reload should look backward
6822 for equivalent register. Increasing values mean more
6823 aggressive optimization, making the compile time increase with
6824 probably slightly better performance. The default value is
6825 100.
6826
6827 max-cselib-memory-locations
6828 The maximum number of memory locations cselib should take into
6829 account. Increasing values mean more aggressive optimization,
6830 making the compile time increase with probably slightly better
6831 performance. The default value is 500.
6832
6833 reorder-blocks-duplicate
6834 reorder-blocks-duplicate-feedback
6835 Used by basic block reordering pass to decide whether to use
6836 unconditional branch or duplicate the code on its destination.
6837 Code is duplicated when its estimated size is smaller than this
6838 value multiplied by the estimated size of unconditional jump in
6839 the hot spots of the program.
6840
6841 The reorder-block-duplicate-feedback is used only when profile
6842 feedback is available and may be set to higher values than
6843 reorder-block-duplicate since information about the hot spots
6844 is more accurate.
6845
6846 max-sched-ready-insns
6847 The maximum number of instructions ready to be issued the
6848 scheduler should consider at any given time during the first
6849 scheduling pass. Increasing values mean more thorough
6850 searches, making the compilation time increase with probably
6851 little benefit. The default value is 100.
6852
6853 max-sched-region-blocks
6854 The maximum number of blocks in a region to be considered for
6855 interblock scheduling. The default value is 10.
6856
6857 max-pipeline-region-blocks
6858 The maximum number of blocks in a region to be considered for
6859 pipelining in the selective scheduler. The default value is
6860 15.
6861
6862 max-sched-region-insns
6863 The maximum number of insns in a region to be considered for
6864 interblock scheduling. The default value is 100.
6865
6866 max-pipeline-region-insns
6867 The maximum number of insns in a region to be considered for
6868 pipelining in the selective scheduler. The default value is
6869 200.
6870
6871 min-spec-prob
6872 The minimum probability (in percents) of reaching a source
6873 block for interblock speculative scheduling. The default value
6874 is 40.
6875
6876 max-sched-extend-regions-iters
6877 The maximum number of iterations through CFG to extend regions.
6878 0 - disable region extension, N - do at most N iterations. The
6879 default value is 0.
6880
6881 max-sched-insn-conflict-delay
6882 The maximum conflict delay for an insn to be considered for
6883 speculative motion. The default value is 3.
6884
6885 sched-spec-prob-cutoff
6886 The minimal probability of speculation success (in percents),
6887 so that speculative insn will be scheduled. The default value
6888 is 40.
6889
6890 sched-mem-true-dep-cost
6891 Minimal distance (in CPU cycles) between store and load
6892 targeting same memory locations. The default value is 1.
6893
6894 selsched-max-lookahead
6895 The maximum size of the lookahead window of selective
6896 scheduling. It is a depth of search for available
6897 instructions. The default value is 50.
6898
6899 selsched-max-sched-times
6900 The maximum number of times that an instruction will be
6901 scheduled during selective scheduling. This is the limit on
6902 the number of iterations through which the instruction may be
6903 pipelined. The default value is 2.
6904
6905 selsched-max-insns-to-rename
6906 The maximum number of best instructions in the ready list that
6907 are considered for renaming in the selective scheduler. The
6908 default value is 2.
6909
6910 max-last-value-rtl
6911 The maximum size measured as number of RTLs that can be
6912 recorded in an expression in combiner for a pseudo register as
6913 last known value of that register. The default is 10000.
6914
6915 integer-share-limit
6916 Small integer constants can use a shared data structure,
6917 reducing the compiler's memory usage and increasing its speed.
6918 This sets the maximum value of a shared integer constant. The
6919 default value is 256.
6920
6921 min-virtual-mappings
6922 Specifies the minimum number of virtual mappings in the
6923 incremental SSA updater that should be registered to trigger
6924 the virtual mappings heuristic defined by virtual-mappings-
6925 ratio. The default value is 100.
6926
6927 virtual-mappings-ratio
6928 If the number of virtual mappings is virtual-mappings-ratio
6929 bigger than the number of virtual symbols to be updated, then
6930 the incremental SSA updater switches to a full update for those
6931 symbols. The default ratio is 3.
6932
6933 ssp-buffer-size
6934 The minimum size of buffers (i.e. arrays) that will receive
6935 stack smashing protection when -fstack-protection is used.
6936
6937 max-jump-thread-duplication-stmts
6938 Maximum number of statements allowed in a block that needs to
6939 be duplicated when threading jumps.
6940
6941 max-fields-for-field-sensitive
6942 Maximum number of fields in a structure we will treat in a
6943 field sensitive manner during pointer analysis. The default is
6944 zero for -O0, and -O1 and 100 for -Os, -O2, and -O3.
6945
6946 prefetch-latency
6947 Estimate on average number of instructions that are executed
6948 before prefetch finishes. The distance we prefetch ahead is
6949 proportional to this constant. Increasing this number may also
6950 lead to less streams being prefetched (see simultaneous-
6951 prefetches).
6952
6953 simultaneous-prefetches
6954 Maximum number of prefetches that can run at the same time.
6955
6956 l1-cache-line-size
6957 The size of cache line in L1 cache, in bytes.
6958
6959 l1-cache-size
6960 The size of L1 cache, in kilobytes.
6961
6962 l2-cache-size
6963 The size of L2 cache, in kilobytes.
6964
6965 min-insn-to-prefetch-ratio
6966 The minimum ratio between the number of instructions and the
6967 number of prefetches to enable prefetching in a loop with an
6968 unknown trip count.
6969
6970 prefetch-min-insn-to-mem-ratio
6971 The minimum ratio between the number of instructions and the
6972 number of memory references to enable prefetching in a loop.
6973
6974 use-canonical-types
6975 Whether the compiler should use the "canonical" type system.
6976 By default, this should always be 1, which uses a more
6977 efficient internal mechanism for comparing types in C++ and
6978 Objective-C++. However, if bugs in the canonical type system
6979 are causing compilation failures, set this value to 0 to
6980 disable canonical types.
6981
6982 switch-conversion-max-branch-ratio
6983 Switch initialization conversion will refuse to create arrays
6984 that are bigger than switch-conversion-max-branch-ratio times
6985 the number of branches in the switch.
6986
6987 max-partial-antic-length
6988 Maximum length of the partial antic set computed during the
6989 tree partial redundancy elimination optimization (-ftree-pre)
6990 when optimizing at -O3 and above. For some sorts of source
6991 code the enhanced partial redundancy elimination optimization
6992 can run away, consuming all of the memory available on the host
6993 machine. This parameter sets a limit on the length of the sets
6994 that are computed, which prevents the runaway behavior.
6995 Setting a value of 0 for this parameter will allow an unlimited
6996 set length.
6997
6998 sccvn-max-scc-size
6999 Maximum size of a strongly connected component (SCC) during
7000 SCCVN processing. If this limit is hit, SCCVN processing for
7001 the whole function will not be done and optimizations depending
7002 on it will be disabled. The default maximum SCC size is 10000.
7003
7004 ira-max-loops-num
7005 IRA uses a regional register allocation by default. If a
7006 function contains loops more than number given by the
7007 parameter, only at most given number of the most frequently
7008 executed loops will form regions for the regional register
7009 allocation. The default value of the parameter is 100.
7010
7011 ira-max-conflict-table-size
7012 Although IRA uses a sophisticated algorithm of compression
7013 conflict table, the table can be still big for huge functions.
7014 If the conflict table for a function could be more than size in
7015 MB given by the parameter, the conflict table is not built and
7016 faster, simpler, and lower quality register allocation
7017 algorithm will be used. The algorithm do not use pseudo-
7018 register conflicts. The default value of the parameter is
7019 2000.
7020
7021 ira-loop-reserved-regs
7022 IRA can be used to evaluate more accurate register pressure in
7023 loops for decision to move loop invariants (see -O3). The
7024 number of available registers reserved for some other purposes
7025 is described by this parameter. The default value of the
7026 parameter is 2 which is minimal number of registers needed for
7027 execution of typical instruction. This value is the best found
7028 from numerous experiments.
7029
7030 loop-invariant-max-bbs-in-loop
7031 Loop invariant motion can be very expensive, both in compile
7032 time and in amount of needed compile time memory, with very
7033 large loops. Loops with more basic blocks than this parameter
7034 won't have loop invariant motion optimization performed on
7035 them. The default value of the parameter is 1000 for -O1 and
7036 10000 for -O2 and above.
7037
7038 max-vartrack-size
7039 Sets a maximum number of hash table slots to use during
7040 variable tracking dataflow analysis of any function. If this
7041 limit is exceeded with variable tracking at assignments
7042 enabled, analysis for that function is retried without it,
7043 after removing all debug insns from the function. If the limit
7044 is exceeded even without debug insns, var tracking analysis is
7045 completely disabled for the function. Setting the parameter to
7046 zero makes it unlimited.
7047
7048 min-nondebug-insn-uid
7049 Use uids starting at this parameter for nondebug insns. The
7050 range below the parameter is reserved exclusively for debug
7051 insns created by -fvar-tracking-assignments, but debug insns
7052 may get (non-overlapping) uids above it if the reserved range
7053 is exhausted.
7054
7055 ipa-sra-ptr-growth-factor
7056 IPA-SRA will replace a pointer to an aggregate with one or more
7057 new parameters only when their cumulative size is less or equal
7058 to ipa-sra-ptr-growth-factor times the size of the original
7059 pointer parameter.
7060
7061 graphite-max-nb-scop-params
7062 To avoid exponential effects in the Graphite loop transforms,
7063 the number of parameters in a Static Control Part (SCoP) is
7064 bounded. The default value is 10 parameters. A variable whose
7065 value is unknown at compile time and defined outside a SCoP is
7066 a parameter of the SCoP.
7067
7068 graphite-max-bbs-per-function
7069 To avoid exponential effects in the detection of SCoPs, the
7070 size of the functions analyzed by Graphite is bounded. The
7071 default value is 100 basic blocks.
7072
7073 loop-block-tile-size
7074 Loop blocking or strip mining transforms, enabled with
7075 -floop-block or -floop-strip-mine, strip mine each loop in the
7076 loop nest by a given number of iterations. The strip length
7077 can be changed using the loop-block-tile-size parameter. The
7078 default value is 51 iterations.
7079
7080 Options Controlling the Preprocessor
7081 These options control the C preprocessor, which is run on each C source
7082 file before actual compilation.
7083
7084 If you use the -E option, nothing is done except preprocessing. Some
7085 of these options make sense only together with -E because they cause
7086 the preprocessor output to be unsuitable for actual compilation.
7087
7088 -Wp,option
7089 You can use -Wp,option to bypass the compiler driver and pass
7090 option directly through to the preprocessor. If option contains
7091 commas, it is split into multiple options at the commas. However,
7092 many options are modified, translated or interpreted by the
7093 compiler driver before being passed to the preprocessor, and -Wp
7094 forcibly bypasses this phase. The preprocessor's direct interface
7095 is undocumented and subject to change, so whenever possible you
7096 should avoid using -Wp and let the driver handle the options
7097 instead.
7098
7099 -Xpreprocessor option
7100 Pass option as an option to the preprocessor. You can use this to
7101 supply system-specific preprocessor options which GCC does not know
7102 how to recognize.
7103
7104 If you want to pass an option that takes an argument, you must use
7105 -Xpreprocessor twice, once for the option and once for the
7106 argument.
7107
7108 -D name
7109 Predefine name as a macro, with definition 1.
7110
7111 -D name=definition
7112 The contents of definition are tokenized and processed as if they
7113 appeared during translation phase three in a #define directive. In
7114 particular, the definition will be truncated by embedded newline
7115 characters.
7116
7117 If you are invoking the preprocessor from a shell or shell-like
7118 program you may need to use the shell's quoting syntax to protect
7119 characters such as spaces that have a meaning in the shell syntax.
7120
7121 If you wish to define a function-like macro on the command line,
7122 write its argument list with surrounding parentheses before the
7123 equals sign (if any). Parentheses are meaningful to most shells,
7124 so you will need to quote the option. With sh and csh,
7125 -D'name(args...)=definition' works.
7126
7127 -D and -U options are processed in the order they are given on the
7128 command line. All -imacros file and -include file options are
7129 processed after all -D and -U options.
7130
7131 -U name
7132 Cancel any previous definition of name, either built in or provided
7133 with a -D option.
7134
7135 -undef
7136 Do not predefine any system-specific or GCC-specific macros. The
7137 standard predefined macros remain defined.
7138
7139 -I dir
7140 Add the directory dir to the list of directories to be searched for
7141 header files. Directories named by -I are searched before the
7142 standard system include directories. If the directory dir is a
7143 standard system include directory, the option is ignored to ensure
7144 that the default search order for system directories and the
7145 special treatment of system headers are not defeated . If dir
7146 begins with "=", then the "=" will be replaced by the sysroot
7147 prefix; see --sysroot and -isysroot.
7148
7149 -o file
7150 Write output to file. This is the same as specifying file as the
7151 second non-option argument to cpp. gcc has a different
7152 interpretation of a second non-option argument, so you must use -o
7153 to specify the output file.
7154
7155 -Wall
7156 Turns on all optional warnings which are desirable for normal code.
7157 At present this is -Wcomment, -Wtrigraphs, -Wmultichar and a
7158 warning about integer promotion causing a change of sign in "#if"
7159 expressions. Note that many of the preprocessor's warnings are on
7160 by default and have no options to control them.
7161
7162 -Wcomment
7163 -Wcomments
7164 Warn whenever a comment-start sequence /* appears in a /* comment,
7165 or whenever a backslash-newline appears in a // comment. (Both
7166 forms have the same effect.)
7167
7168 -Wtrigraphs
7169 Most trigraphs in comments cannot affect the meaning of the
7170 program. However, a trigraph that would form an escaped newline
7171 (??/ at the end of a line) can, by changing where the comment
7172 begins or ends. Therefore, only trigraphs that would form escaped
7173 newlines produce warnings inside a comment.
7174
7175 This option is implied by -Wall. If -Wall is not given, this
7176 option is still enabled unless trigraphs are enabled. To get
7177 trigraph conversion without warnings, but get the other -Wall
7178 warnings, use -trigraphs -Wall -Wno-trigraphs.
7179
7180 -Wtraditional
7181 Warn about certain constructs that behave differently in
7182 traditional and ISO C. Also warn about ISO C constructs that have
7183 no traditional C equivalent, and problematic constructs which
7184 should be avoided.
7185
7186 -Wundef
7187 Warn whenever an identifier which is not a macro is encountered in
7188 an #if directive, outside of defined. Such identifiers are
7189 replaced with zero.
7190
7191 -Wunused-macros
7192 Warn about macros defined in the main file that are unused. A
7193 macro is used if it is expanded or tested for existence at least
7194 once. The preprocessor will also warn if the macro has not been
7195 used at the time it is redefined or undefined.
7196
7197 Built-in macros, macros defined on the command line, and macros
7198 defined in include files are not warned about.
7199
7200 Note: If a macro is actually used, but only used in skipped
7201 conditional blocks, then CPP will report it as unused. To avoid
7202 the warning in such a case, you might improve the scope of the
7203 macro's definition by, for example, moving it into the first
7204 skipped block. Alternatively, you could provide a dummy use with
7205 something like:
7206
7207 #if defined the_macro_causing_the_warning
7208 #endif
7209
7210 -Wendif-labels
7211 Warn whenever an #else or an #endif are followed by text. This
7212 usually happens in code of the form
7213
7214 #if FOO
7215 ...
7216 #else FOO
7217 ...
7218 #endif FOO
7219
7220 The second and third "FOO" should be in comments, but often are not
7221 in older programs. This warning is on by default.
7222
7223 -Werror
7224 Make all warnings into hard errors. Source code which triggers
7225 warnings will be rejected.
7226
7227 -Wsystem-headers
7228 Issue warnings for code in system headers. These are normally
7229 unhelpful in finding bugs in your own code, therefore suppressed.
7230 If you are responsible for the system library, you may want to see
7231 them.
7232
7233 -w Suppress all warnings, including those which GNU CPP issues by
7234 default.
7235
7236 -pedantic
7237 Issue all the mandatory diagnostics listed in the C standard. Some
7238 of them are left out by default, since they trigger frequently on
7239 harmless code.
7240
7241 -pedantic-errors
7242 Issue all the mandatory diagnostics, and make all mandatory
7243 diagnostics into errors. This includes mandatory diagnostics that
7244 GCC issues without -pedantic but treats as warnings.
7245
7246 -M Instead of outputting the result of preprocessing, output a rule
7247 suitable for make describing the dependencies of the main source
7248 file. The preprocessor outputs one make rule containing the object
7249 file name for that source file, a colon, and the names of all the
7250 included files, including those coming from -include or -imacros
7251 command line options.
7252
7253 Unless specified explicitly (with -MT or -MQ), the object file name
7254 consists of the name of the source file with any suffix replaced
7255 with object file suffix and with any leading directory parts
7256 removed. If there are many included files then the rule is split
7257 into several lines using \-newline. The rule has no commands.
7258
7259 This option does not suppress the preprocessor's debug output, such
7260 as -dM. To avoid mixing such debug output with the dependency
7261 rules you should explicitly specify the dependency output file with
7262 -MF, or use an environment variable like DEPENDENCIES_OUTPUT.
7263 Debug output will still be sent to the regular output stream as
7264 normal.
7265
7266 Passing -M to the driver implies -E, and suppresses warnings with
7267 an implicit -w.
7268
7269 -MM Like -M but do not mention header files that are found in system
7270 header directories, nor header files that are included, directly or
7271 indirectly, from such a header.
7272
7273 This implies that the choice of angle brackets or double quotes in
7274 an #include directive does not in itself determine whether that
7275 header will appear in -MM dependency output. This is a slight
7276 change in semantics from GCC versions 3.0 and earlier.
7277
7278 -MF file
7279 When used with -M or -MM, specifies a file to write the
7280 dependencies to. If no -MF switch is given the preprocessor sends
7281 the rules to the same place it would have sent preprocessed output.
7282
7283 When used with the driver options -MD or -MMD, -MF overrides the
7284 default dependency output file.
7285
7286 -MG In conjunction with an option such as -M requesting dependency
7287 generation, -MG assumes missing header files are generated files
7288 and adds them to the dependency list without raising an error. The
7289 dependency filename is taken directly from the "#include" directive
7290 without prepending any path. -MG also suppresses preprocessed
7291 output, as a missing header file renders this useless.
7292
7293 This feature is used in automatic updating of makefiles.
7294
7295 -MP This option instructs CPP to add a phony target for each dependency
7296 other than the main file, causing each to depend on nothing. These
7297 dummy rules work around errors make gives if you remove header
7298 files without updating the Makefile to match.
7299
7300 This is typical output:
7301
7302 test.o: test.c test.h
7303
7304 test.h:
7305
7306 -MT target
7307 Change the target of the rule emitted by dependency generation. By
7308 default CPP takes the name of the main input file, deletes any
7309 directory components and any file suffix such as .c, and appends
7310 the platform's usual object suffix. The result is the target.
7311
7312 An -MT option will set the target to be exactly the string you
7313 specify. If you want multiple targets, you can specify them as a
7314 single argument to -MT, or use multiple -MT options.
7315
7316 For example, -MT '$(objpfx)foo.o' might give
7317
7318 $(objpfx)foo.o: foo.c
7319
7320 -MQ target
7321 Same as -MT, but it quotes any characters which are special to
7322 Make. -MQ '$(objpfx)foo.o' gives
7323
7324 $$(objpfx)foo.o: foo.c
7325
7326 The default target is automatically quoted, as if it were given
7327 with -MQ.
7328
7329 -MD -MD is equivalent to -M -MF file, except that -E is not implied.
7330 The driver determines file based on whether an -o option is given.
7331 If it is, the driver uses its argument but with a suffix of .d,
7332 otherwise it takes the name of the input file, removes any
7333 directory components and suffix, and applies a .d suffix.
7334
7335 If -MD is used in conjunction with -E, any -o switch is understood
7336 to specify the dependency output file, but if used without -E, each
7337 -o is understood to specify a target object file.
7338
7339 Since -E is not implied, -MD can be used to generate a dependency
7340 output file as a side-effect of the compilation process.
7341
7342 -MMD
7343 Like -MD except mention only user header files, not system header
7344 files.
7345
7346 -fpch-deps
7347 When using precompiled headers, this flag will cause the
7348 dependency-output flags to also list the files from the precompiled
7349 header's dependencies. If not specified only the precompiled
7350 header would be listed and not the files that were used to create
7351 it because those files are not consulted when a precompiled header
7352 is used.
7353
7354 -fpch-preprocess
7355 This option allows use of a precompiled header together with -E.
7356 It inserts a special "#pragma", "#pragma GCC pch_preprocess
7357 "<filename>"" in the output to mark the place where the precompiled
7358 header was found, and its filename. When -fpreprocessed is in use,
7359 GCC recognizes this "#pragma" and loads the PCH.
7360
7361 This option is off by default, because the resulting preprocessed
7362 output is only really suitable as input to GCC. It is switched on
7363 by -save-temps.
7364
7365 You should not write this "#pragma" in your own code, but it is
7366 safe to edit the filename if the PCH file is available in a
7367 different location. The filename may be absolute or it may be
7368 relative to GCC's current directory.
7369
7370 -x c
7371 -x c++
7372 -x objective-c
7373 -x assembler-with-cpp
7374 Specify the source language: C, C++, Objective-C, or assembly.
7375 This has nothing to do with standards conformance or extensions; it
7376 merely selects which base syntax to expect. If you give none of
7377 these options, cpp will deduce the language from the extension of
7378 the source file: .c, .cc, .m, or .S. Some other common extensions
7379 for C++ and assembly are also recognized. If cpp does not
7380 recognize the extension, it will treat the file as C; this is the
7381 most generic mode.
7382
7383 Note: Previous versions of cpp accepted a -lang option which
7384 selected both the language and the standards conformance level.
7385 This option has been removed, because it conflicts with the -l
7386 option.
7387
7388 -std=standard
7389 -ansi
7390 Specify the standard to which the code should conform. Currently
7391 CPP knows about C and C++ standards; others may be added in the
7392 future.
7393
7394 standard may be one of:
7395
7396 "c90"
7397 "c89"
7398 "iso9899:1990"
7399 The ISO C standard from 1990. c90 is the customary shorthand
7400 for this version of the standard.
7401
7402 The -ansi option is equivalent to -std=c90.
7403
7404 "iso9899:199409"
7405 The 1990 C standard, as amended in 1994.
7406
7407 "iso9899:1999"
7408 "c99"
7409 "iso9899:199x"
7410 "c9x"
7411 The revised ISO C standard, published in December 1999. Before
7412 publication, this was known as C9X.
7413
7414 "gnu90"
7415 "gnu89"
7416 The 1990 C standard plus GNU extensions. This is the default.
7417
7418 "gnu99"
7419 "gnu9x"
7420 The 1999 C standard plus GNU extensions.
7421
7422 "c++98"
7423 The 1998 ISO C++ standard plus amendments.
7424
7425 "gnu++98"
7426 The same as -std=c++98 plus GNU extensions. This is the
7427 default for C++ code.
7428
7429 -I- Split the include path. Any directories specified with -I options
7430 before -I- are searched only for headers requested with
7431 "#include "file""; they are not searched for "#include <file>". If
7432 additional directories are specified with -I options after the -I-,
7433 those directories are searched for all #include directives.
7434
7435 In addition, -I- inhibits the use of the directory of the current
7436 file directory as the first search directory for "#include "file"".
7437 This option has been deprecated.
7438
7439 -nostdinc
7440 Do not search the standard system directories for header files.
7441 Only the directories you have specified with -I options (and the
7442 directory of the current file, if appropriate) are searched.
7443
7444 -nostdinc++
7445 Do not search for header files in the C++-specific standard
7446 directories, but do still search the other standard directories.
7447 (This option is used when building the C++ library.)
7448
7449 -include file
7450 Process file as if "#include "file"" appeared as the first line of
7451 the primary source file. However, the first directory searched for
7452 file is the preprocessor's working directory instead of the
7453 directory containing the main source file. If not found there, it
7454 is searched for in the remainder of the "#include "..."" search
7455 chain as normal.
7456
7457 If multiple -include options are given, the files are included in
7458 the order they appear on the command line.
7459
7460 -imacros file
7461 Exactly like -include, except that any output produced by scanning
7462 file is thrown away. Macros it defines remain defined. This
7463 allows you to acquire all the macros from a header without also
7464 processing its declarations.
7465
7466 All files specified by -imacros are processed before all files
7467 specified by -include.
7468
7469 -idirafter dir
7470 Search dir for header files, but do it after all directories
7471 specified with -I and the standard system directories have been
7472 exhausted. dir is treated as a system include directory. If dir
7473 begins with "=", then the "=" will be replaced by the sysroot
7474 prefix; see --sysroot and -isysroot.
7475
7476 -iprefix prefix
7477 Specify prefix as the prefix for subsequent -iwithprefix options.
7478 If the prefix represents a directory, you should include the final
7479 /.
7480
7481 -iwithprefix dir
7482 -iwithprefixbefore dir
7483 Append dir to the prefix specified previously with -iprefix, and
7484 add the resulting directory to the include search path.
7485 -iwithprefixbefore puts it in the same place -I would; -iwithprefix
7486 puts it where -idirafter would.
7487
7488 -isysroot dir
7489 This option is like the --sysroot option, but applies only to
7490 header files. See the --sysroot option for more information.
7491
7492 -imultilib dir
7493 Use dir as a subdirectory of the directory containing target-
7494 specific C++ headers.
7495
7496 -isystem dir
7497 Search dir for header files, after all directories specified by -I
7498 but before the standard system directories. Mark it as a system
7499 directory, so that it gets the same special treatment as is applied
7500 to the standard system directories. If dir begins with "=", then
7501 the "=" will be replaced by the sysroot prefix; see --sysroot and
7502 -isysroot.
7503
7504 -iquote dir
7505 Search dir only for header files requested with "#include "file"";
7506 they are not searched for "#include <file>", before all directories
7507 specified by -I and before the standard system directories. If dir
7508 begins with "=", then the "=" will be replaced by the sysroot
7509 prefix; see --sysroot and -isysroot.
7510
7511 -fdirectives-only
7512 When preprocessing, handle directives, but do not expand macros.
7513
7514 The option's behavior depends on the -E and -fpreprocessed options.
7515
7516 With -E, preprocessing is limited to the handling of directives
7517 such as "#define", "#ifdef", and "#error". Other preprocessor
7518 operations, such as macro expansion and trigraph conversion are not
7519 performed. In addition, the -dD option is implicitly enabled.
7520
7521 With -fpreprocessed, predefinition of command line and most builtin
7522 macros is disabled. Macros such as "__LINE__", which are
7523 contextually dependent, are handled normally. This enables
7524 compilation of files previously preprocessed with "-E
7525 -fdirectives-only".
7526
7527 With both -E and -fpreprocessed, the rules for -fpreprocessed take
7528 precedence. This enables full preprocessing of files previously
7529 preprocessed with "-E -fdirectives-only".
7530
7531 -fdollars-in-identifiers
7532 Accept $ in identifiers.
7533
7534 -fextended-identifiers
7535 Accept universal character names in identifiers. This option is
7536 experimental; in a future version of GCC, it will be enabled by
7537 default for C99 and C++.
7538
7539 -fpreprocessed
7540 Indicate to the preprocessor that the input file has already been
7541 preprocessed. This suppresses things like macro expansion,
7542 trigraph conversion, escaped newline splicing, and processing of
7543 most directives. The preprocessor still recognizes and removes
7544 comments, so that you can pass a file preprocessed with -C to the
7545 compiler without problems. In this mode the integrated
7546 preprocessor is little more than a tokenizer for the front ends.
7547
7548 -fpreprocessed is implicit if the input file has one of the
7549 extensions .i, .ii or .mi. These are the extensions that GCC uses
7550 for preprocessed files created by -save-temps.
7551
7552 -ftabstop=width
7553 Set the distance between tab stops. This helps the preprocessor
7554 report correct column numbers in warnings or errors, even if tabs
7555 appear on the line. If the value is less than 1 or greater than
7556 100, the option is ignored. The default is 8.
7557
7558 -fexec-charset=charset
7559 Set the execution character set, used for string and character
7560 constants. The default is UTF-8. charset can be any encoding
7561 supported by the system's "iconv" library routine.
7562
7563 -fwide-exec-charset=charset
7564 Set the wide execution character set, used for wide string and
7565 character constants. The default is UTF-32 or UTF-16, whichever
7566 corresponds to the width of "wchar_t". As with -fexec-charset,
7567 charset can be any encoding supported by the system's "iconv"
7568 library routine; however, you will have problems with encodings
7569 that do not fit exactly in "wchar_t".
7570
7571 -finput-charset=charset
7572 Set the input character set, used for translation from the
7573 character set of the input file to the source character set used by
7574 GCC. If the locale does not specify, or GCC cannot get this
7575 information from the locale, the default is UTF-8. This can be
7576 overridden by either the locale or this command line option.
7577 Currently the command line option takes precedence if there's a
7578 conflict. charset can be any encoding supported by the system's
7579 "iconv" library routine.
7580
7581 -fworking-directory
7582 Enable generation of linemarkers in the preprocessor output that
7583 will let the compiler know the current working directory at the
7584 time of preprocessing. When this option is enabled, the
7585 preprocessor will emit, after the initial linemarker, a second
7586 linemarker with the current working directory followed by two
7587 slashes. GCC will use this directory, when it's present in the
7588 preprocessed input, as the directory emitted as the current working
7589 directory in some debugging information formats. This option is
7590 implicitly enabled if debugging information is enabled, but this
7591 can be inhibited with the negated form -fno-working-directory. If
7592 the -P flag is present in the command line, this option has no
7593 effect, since no "#line" directives are emitted whatsoever.
7594
7595 -fno-show-column
7596 Do not print column numbers in diagnostics. This may be necessary
7597 if diagnostics are being scanned by a program that does not
7598 understand the column numbers, such as dejagnu.
7599
7600 -A predicate=answer
7601 Make an assertion with the predicate predicate and answer answer.
7602 This form is preferred to the older form -A predicate(answer),
7603 which is still supported, because it does not use shell special
7604 characters.
7605
7606 -A -predicate=answer
7607 Cancel an assertion with the predicate predicate and answer answer.
7608
7609 -dCHARS
7610 CHARS is a sequence of one or more of the following characters, and
7611 must not be preceded by a space. Other characters are interpreted
7612 by the compiler proper, or reserved for future versions of GCC, and
7613 so are silently ignored. If you specify characters whose behavior
7614 conflicts, the result is undefined.
7615
7616 M Instead of the normal output, generate a list of #define
7617 directives for all the macros defined during the execution of
7618 the preprocessor, including predefined macros. This gives you
7619 a way of finding out what is predefined in your version of the
7620 preprocessor. Assuming you have no file foo.h, the command
7621
7622 touch foo.h; cpp -dM foo.h
7623
7624 will show all the predefined macros.
7625
7626 If you use -dM without the -E option, -dM is interpreted as a
7627 synonym for -fdump-rtl-mach.
7628
7629 D Like M except in two respects: it does not include the
7630 predefined macros, and it outputs both the #define directives
7631 and the result of preprocessing. Both kinds of output go to
7632 the standard output file.
7633
7634 N Like D, but emit only the macro names, not their expansions.
7635
7636 I Output #include directives in addition to the result of
7637 preprocessing.
7638
7639 U Like D except that only macros that are expanded, or whose
7640 definedness is tested in preprocessor directives, are output;
7641 the output is delayed until the use or test of the macro; and
7642 #undef directives are also output for macros tested but
7643 undefined at the time.
7644
7645 -P Inhibit generation of linemarkers in the output from the
7646 preprocessor. This might be useful when running the preprocessor
7647 on something that is not C code, and will be sent to a program
7648 which might be confused by the linemarkers.
7649
7650 -C Do not discard comments. All comments are passed through to the
7651 output file, except for comments in processed directives, which are
7652 deleted along with the directive.
7653
7654 You should be prepared for side effects when using -C; it causes
7655 the preprocessor to treat comments as tokens in their own right.
7656 For example, comments appearing at the start of what would be a
7657 directive line have the effect of turning that line into an
7658 ordinary source line, since the first token on the line is no
7659 longer a #.
7660
7661 -CC Do not discard comments, including during macro expansion. This is
7662 like -C, except that comments contained within macros are also
7663 passed through to the output file where the macro is expanded.
7664
7665 In addition to the side-effects of the -C option, the -CC option
7666 causes all C++-style comments inside a macro to be converted to
7667 C-style comments. This is to prevent later use of that macro from
7668 inadvertently commenting out the remainder of the source line.
7669
7670 The -CC option is generally used to support lint comments.
7671
7672 -traditional-cpp
7673 Try to imitate the behavior of old-fashioned C preprocessors, as
7674 opposed to ISO C preprocessors.
7675
7676 -trigraphs
7677 Process trigraph sequences. These are three-character sequences,
7678 all starting with ??, that are defined by ISO C to stand for single
7679 characters. For example, ??/ stands for \, so '??/n' is a
7680 character constant for a newline. By default, GCC ignores
7681 trigraphs, but in standard-conforming modes it converts them. See
7682 the -std and -ansi options.
7683
7684 The nine trigraphs and their replacements are
7685
7686 Trigraph: ??( ??) ??< ??> ??= ??/ ??' ??! ??-
7687 Replacement: [ ] { } # \ ^ | ~
7688
7689 -remap
7690 Enable special code to work around file systems which only permit
7691 very short file names, such as MS-DOS.
7692
7693 --help
7694 --target-help
7695 Print text describing all the command line options instead of
7696 preprocessing anything.
7697
7698 -v Verbose mode. Print out GNU CPP's version number at the beginning
7699 of execution, and report the final form of the include path.
7700
7701 -H Print the name of each header file used, in addition to other
7702 normal activities. Each name is indented to show how deep in the
7703 #include stack it is. Precompiled header files are also printed,
7704 even if they are found to be invalid; an invalid precompiled header
7705 file is printed with ...x and a valid one with ...! .
7706
7707 -version
7708 --version
7709 Print out GNU CPP's version number. With one dash, proceed to
7710 preprocess as normal. With two dashes, exit immediately.
7711
7712 Passing Options to the Assembler
7713 You can pass options to the assembler.
7714
7715 -Wa,option
7716 Pass option as an option to the assembler. If option contains
7717 commas, it is split into multiple options at the commas.
7718
7719 -Xassembler option
7720 Pass option as an option to the assembler. You can use this to
7721 supply system-specific assembler options which GCC does not know
7722 how to recognize.
7723
7724 If you want to pass an option that takes an argument, you must use
7725 -Xassembler twice, once for the option and once for the argument.
7726
7727 Options for Linking
7728 These options come into play when the compiler links object files into
7729 an executable output file. They are meaningless if the compiler is not
7730 doing a link step.
7731
7732 object-file-name
7733 A file name that does not end in a special recognized suffix is
7734 considered to name an object file or library. (Object files are
7735 distinguished from libraries by the linker according to the file
7736 contents.) If linking is done, these object files are used as
7737 input to the linker.
7738
7739 -c
7740 -S
7741 -E If any of these options is used, then the linker is not run, and
7742 object file names should not be used as arguments.
7743
7744 -llibrary
7745 -l library
7746 Search the library named library when linking. (The second
7747 alternative with the library as a separate argument is only for
7748 POSIX compliance and is not recommended.)
7749
7750 It makes a difference where in the command you write this option;
7751 the linker searches and processes libraries and object files in the
7752 order they are specified. Thus, foo.o -lz bar.o searches library z
7753 after file foo.o but before bar.o. If bar.o refers to functions in
7754 z, those functions may not be loaded.
7755
7756 The linker searches a standard list of directories for the library,
7757 which is actually a file named liblibrary.a. The linker then uses
7758 this file as if it had been specified precisely by name.
7759
7760 The directories searched include several standard system
7761 directories plus any that you specify with -L.
7762
7763 Normally the files found this way are library files---archive files
7764 whose members are object files. The linker handles an archive file
7765 by scanning through it for members which define symbols that have
7766 so far been referenced but not defined. But if the file that is
7767 found is an ordinary object file, it is linked in the usual
7768 fashion. The only difference between using an -l option and
7769 specifying a file name is that -l surrounds library with lib and .a
7770 and searches several directories.
7771
7772 -lobjc
7773 You need this special case of the -l option in order to link an
7774 Objective-C or Objective-C++ program.
7775
7776 -nostartfiles
7777 Do not use the standard system startup files when linking. The
7778 standard system libraries are used normally, unless -nostdlib or
7779 -nodefaultlibs is used.
7780
7781 -nodefaultlibs
7782 Do not use the standard system libraries when linking. Only the
7783 libraries you specify will be passed to the linker, options
7784 specifying linkage of the system libraries, such as
7785 "-static-libgcc" or "-shared-libgcc", will be ignored. The
7786 standard startup files are used normally, unless -nostartfiles is
7787 used. The compiler may generate calls to "memcmp", "memset",
7788 "memcpy" and "memmove". These entries are usually resolved by
7789 entries in libc. These entry points should be supplied through
7790 some other mechanism when this option is specified.
7791
7792 -nostdlib
7793 Do not use the standard system startup files or libraries when
7794 linking. No startup files and only the libraries you specify will
7795 be passed to the linker, options specifying linkage of the system
7796 libraries, such as "-static-libgcc" or "-shared-libgcc", will be
7797 ignored. The compiler may generate calls to "memcmp", "memset",
7798 "memcpy" and "memmove". These entries are usually resolved by
7799 entries in libc. These entry points should be supplied through
7800 some other mechanism when this option is specified.
7801
7802 One of the standard libraries bypassed by -nostdlib and
7803 -nodefaultlibs is libgcc.a, a library of internal subroutines that
7804 GCC uses to overcome shortcomings of particular machines, or
7805 special needs for some languages.
7806
7807 In most cases, you need libgcc.a even when you want to avoid other
7808 standard libraries. In other words, when you specify -nostdlib or
7809 -nodefaultlibs you should usually specify -lgcc as well. This
7810 ensures that you have no unresolved references to internal GCC
7811 library subroutines. (For example, __main, used to ensure C++
7812 constructors will be called.)
7813
7814 -pie
7815 Produce a position independent executable on targets which support
7816 it. For predictable results, you must also specify the same set of
7817 options that were used to generate code (-fpie, -fPIE, or model
7818 suboptions) when you specify this option.
7819
7820 -rdynamic
7821 Pass the flag -export-dynamic to the ELF linker, on targets that
7822 support it. This instructs the linker to add all symbols, not only
7823 used ones, to the dynamic symbol table. This option is needed for
7824 some uses of "dlopen" or to allow obtaining backtraces from within
7825 a program.
7826
7827 -s Remove all symbol table and relocation information from the
7828 executable.
7829
7830 -static
7831 On systems that support dynamic linking, this prevents linking with
7832 the shared libraries. On other systems, this option has no effect.
7833
7834 -shared
7835 Produce a shared object which can then be linked with other objects
7836 to form an executable. Not all systems support this option. For
7837 predictable results, you must also specify the same set of options
7838 that were used to generate code (-fpic, -fPIC, or model suboptions)
7839 when you specify this option.[1]
7840
7841 -shared-libgcc
7842 -static-libgcc
7843 On systems that provide libgcc as a shared library, these options
7844 force the use of either the shared or static version respectively.
7845 If no shared version of libgcc was built when the compiler was
7846 configured, these options have no effect.
7847
7848 There are several situations in which an application should use the
7849 shared libgcc instead of the static version. The most common of
7850 these is when the application wishes to throw and catch exceptions
7851 across different shared libraries. In that case, each of the
7852 libraries as well as the application itself should use the shared
7853 libgcc.
7854
7855 Therefore, the G++ and GCJ drivers automatically add -shared-libgcc
7856 whenever you build a shared library or a main executable, because
7857 C++ and Java programs typically use exceptions, so this is the
7858 right thing to do.
7859
7860 If, instead, you use the GCC driver to create shared libraries, you
7861 may find that they will not always be linked with the shared
7862 libgcc. If GCC finds, at its configuration time, that you have a
7863 non-GNU linker or a GNU linker that does not support option
7864 --eh-frame-hdr, it will link the shared version of libgcc into
7865 shared libraries by default. Otherwise, it will take advantage of
7866 the linker and optimize away the linking with the shared version of
7867 libgcc, linking with the static version of libgcc by default. This
7868 allows exceptions to propagate through such shared libraries,
7869 without incurring relocation costs at library load time.
7870
7871 However, if a library or main executable is supposed to throw or
7872 catch exceptions, you must link it using the G++ or GCJ driver, as
7873 appropriate for the languages used in the program, or using the
7874 option -shared-libgcc, such that it is linked with the shared
7875 libgcc.
7876
7877 -static-libstdc++
7878 When the g++ program is used to link a C++ program, it will
7879 normally automatically link against libstdc++. If libstdc++ is
7880 available as a shared library, and the -static option is not used,
7881 then this will link against the shared version of libstdc++. That
7882 is normally fine. However, it is sometimes useful to freeze the
7883 version of libstdc++ used by the program without going all the way
7884 to a fully static link. The -static-libstdc++ option directs the
7885 g++ driver to link libstdc++ statically, without necessarily
7886 linking other libraries statically.
7887
7888 -symbolic
7889 Bind references to global symbols when building a shared object.
7890 Warn about any unresolved references (unless overridden by the link
7891 editor option -Xlinker -z -Xlinker defs). Only a few systems
7892 support this option.
7893
7894 -T script
7895 Use script as the linker script. This option is supported by most
7896 systems using the GNU linker. On some targets, such as bare-board
7897 targets without an operating system, the -T option may be required
7898 when linking to avoid references to undefined symbols.
7899
7900 -Xlinker option
7901 Pass option as an option to the linker. You can use this to supply
7902 system-specific linker options which GCC does not know how to
7903 recognize.
7904
7905 If you want to pass an option that takes a separate argument, you
7906 must use -Xlinker twice, once for the option and once for the
7907 argument. For example, to pass -assert definitions, you must write
7908 -Xlinker -assert -Xlinker definitions. It does not work to write
7909 -Xlinker "-assert definitions", because this passes the entire
7910 string as a single argument, which is not what the linker expects.
7911
7912 When using the GNU linker, it is usually more convenient to pass
7913 arguments to linker options using the option=value syntax than as
7914 separate arguments. For example, you can specify -Xlinker
7915 -Map=output.map rather than -Xlinker -Map -Xlinker output.map.
7916 Other linkers may not support this syntax for command-line options.
7917
7918 -Wl,option
7919 Pass option as an option to the linker. If option contains commas,
7920 it is split into multiple options at the commas. You can use this
7921 syntax to pass an argument to the option. For example,
7922 -Wl,-Map,output.map passes -Map output.map to the linker. When
7923 using the GNU linker, you can also get the same effect with
7924 -Wl,-Map=output.map.
7925
7926 -u symbol
7927 Pretend the symbol symbol is undefined, to force linking of library
7928 modules to define it. You can use -u multiple times with different
7929 symbols to force loading of additional library modules.
7930
7931 Options for Directory Search
7932 These options specify directories to search for header files, for
7933 libraries and for parts of the compiler:
7934
7935 -Idir
7936 Add the directory dir to the head of the list of directories to be
7937 searched for header files. This can be used to override a system
7938 header file, substituting your own version, since these directories
7939 are searched before the system header file directories. However,
7940 you should not use this option to add directories that contain
7941 vendor-supplied system header files (use -isystem for that). If
7942 you use more than one -I option, the directories are scanned in
7943 left-to-right order; the standard system directories come after.
7944
7945 If a standard system include directory, or a directory specified
7946 with -isystem, is also specified with -I, the -I option will be
7947 ignored. The directory will still be searched but as a system
7948 directory at its normal position in the system include chain. This
7949 is to ensure that GCC's procedure to fix buggy system headers and
7950 the ordering for the include_next directive are not inadvertently
7951 changed. If you really need to change the search order for system
7952 directories, use the -nostdinc and/or -isystem options.
7953
7954 -iquotedir
7955 Add the directory dir to the head of the list of directories to be
7956 searched for header files only for the case of #include "file";
7957 they are not searched for #include <file>, otherwise just like -I.
7958
7959 -Ldir
7960 Add directory dir to the list of directories to be searched for -l.
7961
7962 -Bprefix
7963 This option specifies where to find the executables, libraries,
7964 include files, and data files of the compiler itself.
7965
7966 The compiler driver program runs one or more of the subprograms
7967 cpp, cc1, as and ld. It tries prefix as a prefix for each program
7968 it tries to run, both with and without machine/version/.
7969
7970 For each subprogram to be run, the compiler driver first tries the
7971 -B prefix, if any. If that name is not found, or if -B was not
7972 specified, the driver tries two standard prefixes, which are
7973 /usr/lib/gcc/ and /usr/local/lib/gcc/. If neither of those results
7974 in a file name that is found, the unmodified program name is
7975 searched for using the directories specified in your PATH
7976 environment variable.
7977
7978 The compiler will check to see if the path provided by the -B
7979 refers to a directory, and if necessary it will add a directory
7980 separator character at the end of the path.
7981
7982 -B prefixes that effectively specify directory names also apply to
7983 libraries in the linker, because the compiler translates these
7984 options into -L options for the linker. They also apply to
7985 includes files in the preprocessor, because the compiler translates
7986 these options into -isystem options for the preprocessor. In this
7987 case, the compiler appends include to the prefix.
7988
7989 The run-time support file libgcc.a can also be searched for using
7990 the -B prefix, if needed. If it is not found there, the two
7991 standard prefixes above are tried, and that is all. The file is
7992 left out of the link if it is not found by those means.
7993
7994 Another way to specify a prefix much like the -B prefix is to use
7995 the environment variable GCC_EXEC_PREFIX.
7996
7997 As a special kludge, if the path provided by -B is [dir/]stageN/,
7998 where N is a number in the range 0 to 9, then it will be replaced
7999 by [dir/]include. This is to help with boot-strapping the
8000 compiler.
8001
8002 -specs=file
8003 Process file after the compiler reads in the standard specs file,
8004 in order to override the defaults that the gcc driver program uses
8005 when determining what switches to pass to cc1, cc1plus, as, ld,
8006 etc. More than one -specs=file can be specified on the command
8007 line, and they are processed in order, from left to right.
8008
8009 --sysroot=dir
8010 Use dir as the logical root directory for headers and libraries.
8011 For example, if the compiler would normally search for headers in
8012 /usr/include and libraries in /usr/lib, it will instead search
8013 dir/usr/include and dir/usr/lib.
8014
8015 If you use both this option and the -isysroot option, then the
8016 --sysroot option will apply to libraries, but the -isysroot option
8017 will apply to header files.
8018
8019 The GNU linker (beginning with version 2.16) has the necessary
8020 support for this option. If your linker does not support this
8021 option, the header file aspect of --sysroot will still work, but
8022 the library aspect will not.
8023
8024 -I- This option has been deprecated. Please use -iquote instead for -I
8025 directories before the -I- and remove the -I-. Any directories you
8026 specify with -I options before the -I- option are searched only for
8027 the case of #include "file"; they are not searched for #include
8028 <file>.
8029
8030 If additional directories are specified with -I options after the
8031 -I-, these directories are searched for all #include directives.
8032 (Ordinarily all -I directories are used this way.)
8033
8034 In addition, the -I- option inhibits the use of the current
8035 directory (where the current input file came from) as the first
8036 search directory for #include "file". There is no way to override
8037 this effect of -I-. With -I. you can specify searching the
8038 directory which was current when the compiler was invoked. That is
8039 not exactly the same as what the preprocessor does by default, but
8040 it is often satisfactory.
8041
8042 -I- does not inhibit the use of the standard system directories for
8043 header files. Thus, -I- and -nostdinc are independent.
8044
8045 Specifying Target Machine and Compiler Version
8046 The usual way to run GCC is to run the executable called gcc, or
8047 <machine>-gcc when cross-compiling, or <machine>-gcc-<version> to run a
8048 version other than the one that was installed last. Sometimes this is
8049 inconvenient, so GCC provides options that will switch to another
8050 cross-compiler or version.
8051
8052 -b machine
8053 The argument machine specifies the target machine for compilation.
8054
8055 The value to use for machine is the same as was specified as the
8056 machine type when configuring GCC as a cross-compiler. For
8057 example, if a cross-compiler was configured with configure arm-elf,
8058 meaning to compile for an arm processor with elf binaries, then you
8059 would specify -b arm-elf to run that cross compiler. Because there
8060 are other options beginning with -b, the configuration must contain
8061 a hyphen, or -b alone should be one argument followed by the
8062 configuration in the next argument.
8063
8064 -V version
8065 The argument version specifies which version of GCC to run. This
8066 is useful when multiple versions are installed. For example,
8067 version might be 4.0, meaning to run GCC version 4.0.
8068
8069 The -V and -b options work by running the <machine>-gcc-<version>
8070 executable, so there's no real reason to use them if you can just run
8071 that directly.
8072
8073 Hardware Models and Configurations
8074 Earlier we discussed the standard option -b which chooses among
8075 different installed compilers for completely different target machines,
8076 such as VAX vs. 68000 vs. 80386.
8077
8078 In addition, each of these target machine types can have its own
8079 special options, starting with -m, to choose among various hardware
8080 models or configurations---for example, 68010 vs 68020, floating
8081 coprocessor or none. A single installed version of the compiler can
8082 compile for any model or configuration, according to the options
8083 specified.
8084
8085 Some configurations of the compiler also support additional special
8086 options, usually for compatibility with other compilers on the same
8087 platform.
8088
8089 ARC Options
8090
8091 These options are defined for ARC implementations:
8092
8093 -EL Compile code for little endian mode. This is the default.
8094
8095 -EB Compile code for big endian mode.
8096
8097 -mmangle-cpu
8098 Prepend the name of the cpu to all public symbol names. In
8099 multiple-processor systems, there are many ARC variants with
8100 different instruction and register set characteristics. This flag
8101 prevents code compiled for one cpu to be linked with code compiled
8102 for another. No facility exists for handling variants that are
8103 "almost identical". This is an all or nothing option.
8104
8105 -mcpu=cpu
8106 Compile code for ARC variant cpu. Which variants are supported
8107 depend on the configuration. All variants support -mcpu=base, this
8108 is the default.
8109
8110 -mtext=text-section
8111 -mdata=data-section
8112 -mrodata=readonly-data-section
8113 Put functions, data, and readonly data in text-section, data-
8114 section, and readonly-data-section respectively by default. This
8115 can be overridden with the "section" attribute.
8116
8117 -mfix-cortex-m3-ldrd
8118 Some Cortex-M3 cores can cause data corruption when "ldrd"
8119 instructions with overlapping destination and base registers are
8120 used. This option avoids generating these instructions. This
8121 option is enabled by default when -mcpu=cortex-m3 is specified.
8122
8123 ARM Options
8124
8125 These -m options are defined for Advanced RISC Machines (ARM)
8126 architectures:
8127
8128 -mabi=name
8129 Generate code for the specified ABI. Permissible values are: apcs-
8130 gnu, atpcs, aapcs, aapcs-linux and iwmmxt.
8131
8132 -mapcs-frame
8133 Generate a stack frame that is compliant with the ARM Procedure
8134 Call Standard for all functions, even if this is not strictly
8135 necessary for correct execution of the code. Specifying
8136 -fomit-frame-pointer with this option will cause the stack frames
8137 not to be generated for leaf functions. The default is
8138 -mno-apcs-frame.
8139
8140 -mapcs
8141 This is a synonym for -mapcs-frame.
8142
8143 -mthumb-interwork
8144 Generate code which supports calling between the ARM and Thumb
8145 instruction sets. Without this option the two instruction sets
8146 cannot be reliably used inside one program. The default is
8147 -mno-thumb-interwork, since slightly larger code is generated when
8148 -mthumb-interwork is specified.
8149
8150 -mno-sched-prolog
8151 Prevent the reordering of instructions in the function prolog, or
8152 the merging of those instruction with the instructions in the
8153 function's body. This means that all functions will start with a
8154 recognizable set of instructions (or in fact one of a choice from a
8155 small set of different function prologues), and this information
8156 can be used to locate the start if functions inside an executable
8157 piece of code. The default is -msched-prolog.
8158
8159 -mfloat-abi=name
8160 Specifies which floating-point ABI to use. Permissible values are:
8161 soft, softfp and hard.
8162
8163 Specifying soft causes GCC to generate output containing library
8164 calls for floating-point operations. softfp allows the generation
8165 of code using hardware floating-point instructions, but still uses
8166 the soft-float calling conventions. hard allows generation of
8167 floating-point instructions and uses FPU-specific calling
8168 conventions.
8169
8170 The default depends on the specific target configuration. Note
8171 that the hard-float and soft-float ABIs are not link-compatible;
8172 you must compile your entire program with the same ABI, and link
8173 with a compatible set of libraries.
8174
8175 -mhard-float
8176 Equivalent to -mfloat-abi=hard.
8177
8178 -msoft-float
8179 Equivalent to -mfloat-abi=soft.
8180
8181 -mlittle-endian
8182 Generate code for a processor running in little-endian mode. This
8183 is the default for all standard configurations.
8184
8185 -mbig-endian
8186 Generate code for a processor running in big-endian mode; the
8187 default is to compile code for a little-endian processor.
8188
8189 -mwords-little-endian
8190 This option only applies when generating code for big-endian
8191 processors. Generate code for a little-endian word order but a
8192 big-endian byte order. That is, a byte order of the form 32107654.
8193 Note: this option should only be used if you require compatibility
8194 with code for big-endian ARM processors generated by versions of
8195 the compiler prior to 2.8.
8196
8197 -mcpu=name
8198 This specifies the name of the target ARM processor. GCC uses this
8199 name to determine what kind of instructions it can emit when
8200 generating assembly code. Permissible names are: arm2, arm250,
8201 arm3, arm6, arm60, arm600, arm610, arm620, arm7, arm7m, arm7d,
8202 arm7dm, arm7di, arm7dmi, arm70, arm700, arm700i, arm710, arm710c,
8203 arm7100, arm720, arm7500, arm7500fe, arm7tdmi, arm7tdmi-s, arm710t,
8204 arm720t, arm740t, strongarm, strongarm110, strongarm1100,
8205 strongarm1110, arm8, arm810, arm9, arm9e, arm920, arm920t, arm922t,
8206 arm946e-s, arm966e-s, arm968e-s, arm926ej-s, arm940t, arm9tdmi,
8207 arm10tdmi, arm1020t, arm1026ej-s, arm10e, arm1020e, arm1022e,
8208 arm1136j-s, arm1136jf-s, mpcore, mpcorenovfp, arm1156t2-s,
8209 arm1156t2f-s, arm1176jz-s, arm1176jzf-s, cortex-a5, cortex-a8,
8210 cortex-a9, cortex-r4, cortex-r4f, cortex-m3, cortex-m1, cortex-m0,
8211 xscale, iwmmxt, iwmmxt2, ep9312.
8212
8213 -mtune=name
8214 This option is very similar to the -mcpu= option, except that
8215 instead of specifying the actual target processor type, and hence
8216 restricting which instructions can be used, it specifies that GCC
8217 should tune the performance of the code as if the target were of
8218 the type specified in this option, but still choosing the
8219 instructions that it will generate based on the cpu specified by a
8220 -mcpu= option. For some ARM implementations better performance can
8221 be obtained by using this option.
8222
8223 -march=name
8224 This specifies the name of the target ARM architecture. GCC uses
8225 this name to determine what kind of instructions it can emit when
8226 generating assembly code. This option can be used in conjunction
8227 with or instead of the -mcpu= option. Permissible names are:
8228 armv2, armv2a, armv3, armv3m, armv4, armv4t, armv5, armv5t, armv5e,
8229 armv5te, armv6, armv6j, armv6t2, armv6z, armv6zk, armv6-m, armv7,
8230 armv7-a, armv7-r, armv7-m, iwmmxt, iwmmxt2, ep9312.
8231
8232 -mfpu=name
8233 -mfpe=number
8234 -mfp=number
8235 This specifies what floating point hardware (or hardware emulation)
8236 is available on the target. Permissible names are: fpa, fpe2,
8237 fpe3, maverick, vfp, vfpv3, vfpv3-fp16, vfpv3-d16, vfpv3-d16-fp16,
8238 vfpv3xd, vfpv3xd-fp16, neon, neon-fp16, vfpv4, vfpv4-d16,
8239 fpv4-sp-d16 and neon-vfpv4. -mfp and -mfpe are synonyms for
8240 -mfpu=fpenumber, for compatibility with older versions of GCC.
8241
8242 If -msoft-float is specified this specifies the format of floating
8243 point values.
8244
8245 -mfp16-format=name
8246 Specify the format of the "__fp16" half-precision floating-point
8247 type. Permissible names are none, ieee, and alternative; the
8248 default is none, in which case the "__fp16" type is not defined.
8249
8250 -mstructure-size-boundary=n
8251 The size of all structures and unions will be rounded up to a
8252 multiple of the number of bits set by this option. Permissible
8253 values are 8, 32 and 64. The default value varies for different
8254 toolchains. For the COFF targeted toolchain the default value is
8255 8. A value of 64 is only allowed if the underlying ABI supports
8256 it.
8257
8258 Specifying the larger number can produce faster, more efficient
8259 code, but can also increase the size of the program. Different
8260 values are potentially incompatible. Code compiled with one value
8261 cannot necessarily expect to work with code or libraries compiled
8262 with another value, if they exchange information using structures
8263 or unions.
8264
8265 -mabort-on-noreturn
8266 Generate a call to the function "abort" at the end of a "noreturn"
8267 function. It will be executed if the function tries to return.
8268
8269 -mlong-calls
8270 -mno-long-calls
8271 Tells the compiler to perform function calls by first loading the
8272 address of the function into a register and then performing a
8273 subroutine call on this register. This switch is needed if the
8274 target function will lie outside of the 64 megabyte addressing
8275 range of the offset based version of subroutine call instruction.
8276
8277 Even if this switch is enabled, not all function calls will be
8278 turned into long calls. The heuristic is that static functions,
8279 functions which have the short-call attribute, functions that are
8280 inside the scope of a #pragma no_long_calls directive and functions
8281 whose definitions have already been compiled within the current
8282 compilation unit, will not be turned into long calls. The
8283 exception to this rule is that weak function definitions, functions
8284 with the long-call attribute or the section attribute, and
8285 functions that are within the scope of a #pragma long_calls
8286 directive, will always be turned into long calls.
8287
8288 This feature is not enabled by default. Specifying -mno-long-calls
8289 will restore the default behavior, as will placing the function
8290 calls within the scope of a #pragma long_calls_off directive. Note
8291 these switches have no effect on how the compiler generates code to
8292 handle function calls via function pointers.
8293
8294 -msingle-pic-base
8295 Treat the register used for PIC addressing as read-only, rather
8296 than loading it in the prologue for each function. The run-time
8297 system is responsible for initializing this register with an
8298 appropriate value before execution begins.
8299
8300 -mpic-register=reg
8301 Specify the register to be used for PIC addressing. The default is
8302 R10 unless stack-checking is enabled, when R9 is used.
8303
8304 -mcirrus-fix-invalid-insns
8305 Insert NOPs into the instruction stream to in order to work around
8306 problems with invalid Maverick instruction combinations. This
8307 option is only valid if the -mcpu=ep9312 option has been used to
8308 enable generation of instructions for the Cirrus Maverick floating
8309 point co-processor. This option is not enabled by default, since
8310 the problem is only present in older Maverick implementations. The
8311 default can be re-enabled by use of the
8312 -mno-cirrus-fix-invalid-insns switch.
8313
8314 -mpoke-function-name
8315 Write the name of each function into the text section, directly
8316 preceding the function prologue. The generated code is similar to
8317 this:
8318
8319 t0
8320 .ascii "arm_poke_function_name", 0
8321 .align
8322 t1
8323 .word 0xff000000 + (t1 - t0)
8324 arm_poke_function_name
8325 mov ip, sp
8326 stmfd sp!, {fp, ip, lr, pc}
8327 sub fp, ip, #4
8328
8329 When performing a stack backtrace, code can inspect the value of
8330 "pc" stored at "fp + 0". If the trace function then looks at
8331 location "pc - 12" and the top 8 bits are set, then we know that
8332 there is a function name embedded immediately preceding this
8333 location and has length "((pc[-3]) & 0xff000000)".
8334
8335 -mthumb
8336 Generate code for the Thumb instruction set. The default is to use
8337 the 32-bit ARM instruction set. This option automatically enables
8338 either 16-bit Thumb-1 or mixed 16/32-bit Thumb-2 instructions based
8339 on the -mcpu=name and -march=name options. This option is not
8340 passed to the assembler. If you want to force assembler files to be
8341 interpreted as Thumb code, either add a .thumb directive to the
8342 source or pass the -mthumb option directly to the assembler by
8343 prefixing it with -Wa.
8344
8345 -mtpcs-frame
8346 Generate a stack frame that is compliant with the Thumb Procedure
8347 Call Standard for all non-leaf functions. (A leaf function is one
8348 that does not call any other functions.) The default is
8349 -mno-tpcs-frame.
8350
8351 -mtpcs-leaf-frame
8352 Generate a stack frame that is compliant with the Thumb Procedure
8353 Call Standard for all leaf functions. (A leaf function is one that
8354 does not call any other functions.) The default is
8355 -mno-apcs-leaf-frame.
8356
8357 -mcallee-super-interworking
8358 Gives all externally visible functions in the file being compiled
8359 an ARM instruction set header which switches to Thumb mode before
8360 executing the rest of the function. This allows these functions to
8361 be called from non-interworking code. This option is not valid in
8362 AAPCS configurations because interworking is enabled by default.
8363
8364 -mcaller-super-interworking
8365 Allows calls via function pointers (including virtual functions) to
8366 execute correctly regardless of whether the target code has been
8367 compiled for interworking or not. There is a small overhead in the
8368 cost of executing a function pointer if this option is enabled.
8369 This option is not valid in AAPCS configurations because
8370 interworking is enabled by default.
8371
8372 -mtp=name
8373 Specify the access model for the thread local storage pointer. The
8374 valid models are soft, which generates calls to "__aeabi_read_tp",
8375 cp15, which fetches the thread pointer from "cp15" directly
8376 (supported in the arm6k architecture), and auto, which uses the
8377 best available method for the selected processor. The default
8378 setting is auto.
8379
8380 -mword-relocations
8381 Only generate absolute relocations on word sized values (i.e.
8382 R_ARM_ABS32). This is enabled by default on targets (uClinux,
8383 SymbianOS) where the runtime loader imposes this restriction, and
8384 when -fpic or -fPIC is specified.
8385
8386 AVR Options
8387
8388 These options are defined for AVR implementations:
8389
8390 -mmcu=mcu
8391 Specify ATMEL AVR instruction set or MCU type.
8392
8393 Instruction set avr1 is for the minimal AVR core, not supported by
8394 the C compiler, only for assembler programs (MCU types: at90s1200,
8395 attiny10, attiny11, attiny12, attiny15, attiny28).
8396
8397 Instruction set avr2 (default) is for the classic AVR core with up
8398 to 8K program memory space (MCU types: at90s2313, at90s2323,
8399 attiny22, at90s2333, at90s2343, at90s4414, at90s4433, at90s4434,
8400 at90s8515, at90c8534, at90s8535).
8401
8402 Instruction set avr3 is for the classic AVR core with up to 128K
8403 program memory space (MCU types: atmega103, atmega603, at43usb320,
8404 at76c711).
8405
8406 Instruction set avr4 is for the enhanced AVR core with up to 8K
8407 program memory space (MCU types: atmega8, atmega83, atmega85).
8408
8409 Instruction set avr5 is for the enhanced AVR core with up to 128K
8410 program memory space (MCU types: atmega16, atmega161, atmega163,
8411 atmega32, atmega323, atmega64, atmega128, at43usb355, at94k).
8412
8413 -mno-interrupts
8414 Generated code is not compatible with hardware interrupts. Code
8415 size will be smaller.
8416
8417 -mcall-prologues
8418 Functions prologues/epilogues expanded as call to appropriate
8419 subroutines. Code size will be smaller.
8420
8421 -mtiny-stack
8422 Change only the low 8 bits of the stack pointer.
8423
8424 -mint8
8425 Assume int to be 8 bit integer. This affects the sizes of all
8426 types: A char will be 1 byte, an int will be 1 byte, a long will be
8427 2 bytes and long long will be 4 bytes. Please note that this
8428 option does not comply to the C standards, but it will provide you
8429 with smaller code size.
8430
8431 Blackfin Options
8432
8433 -mcpu=cpu[-sirevision]
8434 Specifies the name of the target Blackfin processor. Currently,
8435 cpu can be one of bf512, bf514, bf516, bf518, bf522, bf523, bf524,
8436 bf525, bf526, bf527, bf531, bf532, bf533, bf534, bf536, bf537,
8437 bf538, bf539, bf542, bf544, bf547, bf548, bf549, bf542m, bf544m,
8438 bf547m, bf548m, bf549m, bf561. The optional sirevision specifies
8439 the silicon revision of the target Blackfin processor. Any
8440 workarounds available for the targeted silicon revision will be
8441 enabled. If sirevision is none, no workarounds are enabled. If
8442 sirevision is any, all workarounds for the targeted processor will
8443 be enabled. The "__SILICON_REVISION__" macro is defined to two
8444 hexadecimal digits representing the major and minor numbers in the
8445 silicon revision. If sirevision is none, the
8446 "__SILICON_REVISION__" is not defined. If sirevision is any, the
8447 "__SILICON_REVISION__" is defined to be 0xffff. If this optional
8448 sirevision is not used, GCC assumes the latest known silicon
8449 revision of the targeted Blackfin processor.
8450
8451 Support for bf561 is incomplete. For bf561, Only the processor
8452 macro is defined. Without this option, bf532 is used as the
8453 processor by default. The corresponding predefined processor
8454 macros for cpu is to be defined. And for bfin-elf toolchain, this
8455 causes the hardware BSP provided by libgloss to be linked in if
8456 -msim is not given.
8457
8458 -msim
8459 Specifies that the program will be run on the simulator. This
8460 causes the simulator BSP provided by libgloss to be linked in.
8461 This option has effect only for bfin-elf toolchain. Certain other
8462 options, such as -mid-shared-library and -mfdpic, imply -msim.
8463
8464 -momit-leaf-frame-pointer
8465 Don't keep the frame pointer in a register for leaf functions.
8466 This avoids the instructions to save, set up and restore frame
8467 pointers and makes an extra register available in leaf functions.
8468 The option -fomit-frame-pointer removes the frame pointer for all
8469 functions which might make debugging harder.
8470
8471 -mspecld-anomaly
8472 When enabled, the compiler will ensure that the generated code does
8473 not contain speculative loads after jump instructions. If this
8474 option is used, "__WORKAROUND_SPECULATIVE_LOADS" is defined.
8475
8476 -mno-specld-anomaly
8477 Don't generate extra code to prevent speculative loads from
8478 occurring.
8479
8480 -mcsync-anomaly
8481 When enabled, the compiler will ensure that the generated code does
8482 not contain CSYNC or SSYNC instructions too soon after conditional
8483 branches. If this option is used, "__WORKAROUND_SPECULATIVE_SYNCS"
8484 is defined.
8485
8486 -mno-csync-anomaly
8487 Don't generate extra code to prevent CSYNC or SSYNC instructions
8488 from occurring too soon after a conditional branch.
8489
8490 -mlow-64k
8491 When enabled, the compiler is free to take advantage of the
8492 knowledge that the entire program fits into the low 64k of memory.
8493
8494 -mno-low-64k
8495 Assume that the program is arbitrarily large. This is the default.
8496
8497 -mstack-check-l1
8498 Do stack checking using information placed into L1 scratchpad
8499 memory by the uClinux kernel.
8500
8501 -mid-shared-library
8502 Generate code that supports shared libraries via the library ID
8503 method. This allows for execute in place and shared libraries in
8504 an environment without virtual memory management. This option
8505 implies -fPIC. With a bfin-elf target, this option implies -msim.
8506
8507 -mno-id-shared-library
8508 Generate code that doesn't assume ID based shared libraries are
8509 being used. This is the default.
8510
8511 -mleaf-id-shared-library
8512 Generate code that supports shared libraries via the library ID
8513 method, but assumes that this library or executable won't link
8514 against any other ID shared libraries. That allows the compiler to
8515 use faster code for jumps and calls.
8516
8517 -mno-leaf-id-shared-library
8518 Do not assume that the code being compiled won't link against any
8519 ID shared libraries. Slower code will be generated for jump and
8520 call insns.
8521
8522 -mshared-library-id=n
8523 Specified the identification number of the ID based shared library
8524 being compiled. Specifying a value of 0 will generate more compact
8525 code, specifying other values will force the allocation of that
8526 number to the current library but is no more space or time
8527 efficient than omitting this option.
8528
8529 -msep-data
8530 Generate code that allows the data segment to be located in a
8531 different area of memory from the text segment. This allows for
8532 execute in place in an environment without virtual memory
8533 management by eliminating relocations against the text section.
8534
8535 -mno-sep-data
8536 Generate code that assumes that the data segment follows the text
8537 segment. This is the default.
8538
8539 -mlong-calls
8540 -mno-long-calls
8541 Tells the compiler to perform function calls by first loading the
8542 address of the function into a register and then performing a
8543 subroutine call on this register. This switch is needed if the
8544 target function will lie outside of the 24 bit addressing range of
8545 the offset based version of subroutine call instruction.
8546
8547 This feature is not enabled by default. Specifying -mno-long-calls
8548 will restore the default behavior. Note these switches have no
8549 effect on how the compiler generates code to handle function calls
8550 via function pointers.
8551
8552 -mfast-fp
8553 Link with the fast floating-point library. This library relaxes
8554 some of the IEEE floating-point standard's rules for checking
8555 inputs against Not-a-Number (NAN), in the interest of performance.
8556
8557 -minline-plt
8558 Enable inlining of PLT entries in function calls to functions that
8559 are not known to bind locally. It has no effect without -mfdpic.
8560
8561 -mmulticore
8562 Build standalone application for multicore Blackfin processor.
8563 Proper start files and link scripts will be used to support
8564 multicore. This option defines "__BFIN_MULTICORE". It can only be
8565 used with -mcpu=bf561[-sirevision]. It can be used with -mcorea or
8566 -mcoreb. If it's used without -mcorea or -mcoreb, single
8567 application/dual core programming model is used. In this model, the
8568 main function of Core B should be named as coreb_main. If it's used
8569 with -mcorea or -mcoreb, one application per core programming model
8570 is used. If this option is not used, single core application
8571 programming model is used.
8572
8573 -mcorea
8574 Build standalone application for Core A of BF561 when using one
8575 application per core programming model. Proper start files and link
8576 scripts will be used to support Core A. This option defines
8577 "__BFIN_COREA". It must be used with -mmulticore.
8578
8579 -mcoreb
8580 Build standalone application for Core B of BF561 when using one
8581 application per core programming model. Proper start files and link
8582 scripts will be used to support Core B. This option defines
8583 "__BFIN_COREB". When this option is used, coreb_main should be used
8584 instead of main. It must be used with -mmulticore.
8585
8586 -msdram
8587 Build standalone application for SDRAM. Proper start files and link
8588 scripts will be used to put the application into SDRAM. Loader
8589 should initialize SDRAM before loading the application into SDRAM.
8590 This option defines "__BFIN_SDRAM".
8591
8592 -micplb
8593 Assume that ICPLBs are enabled at runtime. This has an effect on
8594 certain anomaly workarounds. For Linux targets, the default is to
8595 assume ICPLBs are enabled; for standalone applications the default
8596 is off.
8597
8598 CRIS Options
8599
8600 These options are defined specifically for the CRIS ports.
8601
8602 -march=architecture-type
8603 -mcpu=architecture-type
8604 Generate code for the specified architecture. The choices for
8605 architecture-type are v3, v8 and v10 for respectively ETRAX 4,
8606 ETRAX 100, and ETRAX 100 LX. Default is v0 except for cris-axis-
8607 linux-gnu, where the default is v10.
8608
8609 -mtune=architecture-type
8610 Tune to architecture-type everything applicable about the generated
8611 code, except for the ABI and the set of available instructions.
8612 The choices for architecture-type are the same as for
8613 -march=architecture-type.
8614
8615 -mmax-stack-frame=n
8616 Warn when the stack frame of a function exceeds n bytes.
8617
8618 -metrax4
8619 -metrax100
8620 The options -metrax4 and -metrax100 are synonyms for -march=v3 and
8621 -march=v8 respectively.
8622
8623 -mmul-bug-workaround
8624 -mno-mul-bug-workaround
8625 Work around a bug in the "muls" and "mulu" instructions for CPU
8626 models where it applies. This option is active by default.
8627
8628 -mpdebug
8629 Enable CRIS-specific verbose debug-related information in the
8630 assembly code. This option also has the effect to turn off the
8631 #NO_APP formatted-code indicator to the assembler at the beginning
8632 of the assembly file.
8633
8634 -mcc-init
8635 Do not use condition-code results from previous instruction; always
8636 emit compare and test instructions before use of condition codes.
8637
8638 -mno-side-effects
8639 Do not emit instructions with side-effects in addressing modes
8640 other than post-increment.
8641
8642 -mstack-align
8643 -mno-stack-align
8644 -mdata-align
8645 -mno-data-align
8646 -mconst-align
8647 -mno-const-align
8648 These options (no-options) arranges (eliminate arrangements) for
8649 the stack-frame, individual data and constants to be aligned for
8650 the maximum single data access size for the chosen CPU model. The
8651 default is to arrange for 32-bit alignment. ABI details such as
8652 structure layout are not affected by these options.
8653
8654 -m32-bit
8655 -m16-bit
8656 -m8-bit
8657 Similar to the stack- data- and const-align options above, these
8658 options arrange for stack-frame, writable data and constants to all
8659 be 32-bit, 16-bit or 8-bit aligned. The default is 32-bit
8660 alignment.
8661
8662 -mno-prologue-epilogue
8663 -mprologue-epilogue
8664 With -mno-prologue-epilogue, the normal function prologue and
8665 epilogue that sets up the stack-frame are omitted and no return
8666 instructions or return sequences are generated in the code. Use
8667 this option only together with visual inspection of the compiled
8668 code: no warnings or errors are generated when call-saved registers
8669 must be saved, or storage for local variable needs to be allocated.
8670
8671 -mno-gotplt
8672 -mgotplt
8673 With -fpic and -fPIC, don't generate (do generate) instruction
8674 sequences that load addresses for functions from the PLT part of
8675 the GOT rather than (traditional on other architectures) calls to
8676 the PLT. The default is -mgotplt.
8677
8678 -melf
8679 Legacy no-op option only recognized with the cris-axis-elf and
8680 cris-axis-linux-gnu targets.
8681
8682 -mlinux
8683 Legacy no-op option only recognized with the cris-axis-linux-gnu
8684 target.
8685
8686 -sim
8687 This option, recognized for the cris-axis-elf arranges to link with
8688 input-output functions from a simulator library. Code, initialized
8689 data and zero-initialized data are allocated consecutively.
8690
8691 -sim2
8692 Like -sim, but pass linker options to locate initialized data at
8693 0x40000000 and zero-initialized data at 0x80000000.
8694
8695 CRX Options
8696
8697 These options are defined specifically for the CRX ports.
8698
8699 -mmac
8700 Enable the use of multiply-accumulate instructions. Disabled by
8701 default.
8702
8703 -mpush-args
8704 Push instructions will be used to pass outgoing arguments when
8705 functions are called. Enabled by default.
8706
8707 Darwin Options
8708
8709 These options are defined for all architectures running the Darwin
8710 operating system.
8711
8712 FSF GCC on Darwin does not create "fat" object files; it will create an
8713 object file for the single architecture that it was built to target.
8714 Apple's GCC on Darwin does create "fat" files if multiple -arch options
8715 are used; it does so by running the compiler or linker multiple times
8716 and joining the results together with lipo.
8717
8718 The subtype of the file created (like ppc7400 or ppc970 or i686) is
8719 determined by the flags that specify the ISA that GCC is targetting,
8720 like -mcpu or -march. The -force_cpusubtype_ALL option can be used to
8721 override this.
8722
8723 The Darwin tools vary in their behavior when presented with an ISA
8724 mismatch. The assembler, as, will only permit instructions to be used
8725 that are valid for the subtype of the file it is generating, so you
8726 cannot put 64-bit instructions in a ppc750 object file. The linker for
8727 shared libraries, /usr/bin/libtool, will fail and print an error if
8728 asked to create a shared library with a less restrictive subtype than
8729 its input files (for instance, trying to put a ppc970 object file in a
8730 ppc7400 library). The linker for executables, ld, will quietly give
8731 the executable the most restrictive subtype of any of its input files.
8732
8733 -Fdir
8734 Add the framework directory dir to the head of the list of
8735 directories to be searched for header files. These directories are
8736 interleaved with those specified by -I options and are scanned in a
8737 left-to-right order.
8738
8739 A framework directory is a directory with frameworks in it. A
8740 framework is a directory with a "Headers" and/or "PrivateHeaders"
8741 directory contained directly in it that ends in ".framework". The
8742 name of a framework is the name of this directory excluding the
8743 ".framework". Headers associated with the framework are found in
8744 one of those two directories, with "Headers" being searched first.
8745 A subframework is a framework directory that is in a framework's
8746 "Frameworks" directory. Includes of subframework headers can only
8747 appear in a header of a framework that contains the subframework,
8748 or in a sibling subframework header. Two subframeworks are
8749 siblings if they occur in the same framework. A subframework
8750 should not have the same name as a framework, a warning will be
8751 issued if this is violated. Currently a subframework cannot have
8752 subframeworks, in the future, the mechanism may be extended to
8753 support this. The standard frameworks can be found in
8754 "/System/Library/Frameworks" and "/Library/Frameworks". An example
8755 include looks like "#include <Framework/header.h>", where Framework
8756 denotes the name of the framework and header.h is found in the
8757 "PrivateHeaders" or "Headers" directory.
8758
8759 -iframeworkdir
8760 Like -F except the directory is a treated as a system directory.
8761 The main difference between this -iframework and -F is that with
8762 -iframework the compiler does not warn about constructs contained
8763 within header files found via dir. This option is valid only for
8764 the C family of languages.
8765
8766 -gused
8767 Emit debugging information for symbols that are used. For STABS
8768 debugging format, this enables -feliminate-unused-debug-symbols.
8769 This is by default ON.
8770
8771 -gfull
8772 Emit debugging information for all symbols and types.
8773
8774 -mmacosx-version-min=version
8775 The earliest version of MacOS X that this executable will run on is
8776 version. Typical values of version include 10.1, 10.2, and 10.3.9.
8777
8778 If the compiler was built to use the system's headers by default,
8779 then the default for this option is the system version on which the
8780 compiler is running, otherwise the default is to make choices which
8781 are compatible with as many systems and code bases as possible.
8782
8783 -mkernel
8784 Enable kernel development mode. The -mkernel option sets -static,
8785 -fno-common, -fno-cxa-atexit, -fno-exceptions,
8786 -fno-non-call-exceptions, -fapple-kext, -fno-weak and -fno-rtti
8787 where applicable. This mode also sets -mno-altivec, -msoft-float,
8788 -fno-builtin and -mlong-branch for PowerPC targets.
8789
8790 -mone-byte-bool
8791 Override the defaults for bool so that sizeof(bool)==1. By default
8792 sizeof(bool) is 4 when compiling for Darwin/PowerPC and 1 when
8793 compiling for Darwin/x86, so this option has no effect on x86.
8794
8795 Warning: The -mone-byte-bool switch causes GCC to generate code
8796 that is not binary compatible with code generated without that
8797 switch. Using this switch may require recompiling all other
8798 modules in a program, including system libraries. Use this switch
8799 to conform to a non-default data model.
8800
8801 -mfix-and-continue
8802 -ffix-and-continue
8803 -findirect-data
8804 Generate code suitable for fast turn around development. Needed to
8805 enable gdb to dynamically load ".o" files into already running
8806 programs. -findirect-data and -ffix-and-continue are provided for
8807 backwards compatibility.
8808
8809 -all_load
8810 Loads all members of static archive libraries. See man ld(1) for
8811 more information.
8812
8813 -arch_errors_fatal
8814 Cause the errors having to do with files that have the wrong
8815 architecture to be fatal.
8816
8817 -bind_at_load
8818 Causes the output file to be marked such that the dynamic linker
8819 will bind all undefined references when the file is loaded or
8820 launched.
8821
8822 -bundle
8823 Produce a Mach-o bundle format file. See man ld(1) for more
8824 information.
8825
8826 -bundle_loader executable
8827 This option specifies the executable that will be loading the build
8828 output file being linked. See man ld(1) for more information.
8829
8830 -dynamiclib
8831 When passed this option, GCC will produce a dynamic library instead
8832 of an executable when linking, using the Darwin libtool command.
8833
8834 -force_cpusubtype_ALL
8835 This causes GCC's output file to have the ALL subtype, instead of
8836 one controlled by the -mcpu or -march option.
8837
8838 -allowable_client client_name
8839 -client_name
8840 -compatibility_version
8841 -current_version
8842 -dead_strip
8843 -dependency-file
8844 -dylib_file
8845 -dylinker_install_name
8846 -dynamic
8847 -exported_symbols_list
8848 -filelist
8849 -flat_namespace
8850 -force_flat_namespace
8851 -headerpad_max_install_names
8852 -image_base
8853 -init
8854 -install_name
8855 -keep_private_externs
8856 -multi_module
8857 -multiply_defined
8858 -multiply_defined_unused
8859 -noall_load
8860 -no_dead_strip_inits_and_terms
8861 -nofixprebinding
8862 -nomultidefs
8863 -noprebind
8864 -noseglinkedit
8865 -pagezero_size
8866 -prebind
8867 -prebind_all_twolevel_modules
8868 -private_bundle
8869 -read_only_relocs
8870 -sectalign
8871 -sectobjectsymbols
8872 -whyload
8873 -seg1addr
8874 -sectcreate
8875 -sectobjectsymbols
8876 -sectorder
8877 -segaddr
8878 -segs_read_only_addr
8879 -segs_read_write_addr
8880 -seg_addr_table
8881 -seg_addr_table_filename
8882 -seglinkedit
8883 -segprot
8884 -segs_read_only_addr
8885 -segs_read_write_addr
8886 -single_module
8887 -static
8888 -sub_library
8889 -sub_umbrella
8890 -twolevel_namespace
8891 -umbrella
8892 -undefined
8893 -unexported_symbols_list
8894 -weak_reference_mismatches
8895 -whatsloaded
8896 These options are passed to the Darwin linker. The Darwin linker
8897 man page describes them in detail.
8898
8899 DEC Alpha Options
8900
8901 These -m options are defined for the DEC Alpha implementations:
8902
8903 -mno-soft-float
8904 -msoft-float
8905 Use (do not use) the hardware floating-point instructions for
8906 floating-point operations. When -msoft-float is specified,
8907 functions in libgcc.a will be used to perform floating-point
8908 operations. Unless they are replaced by routines that emulate the
8909 floating-point operations, or compiled in such a way as to call
8910 such emulations routines, these routines will issue floating-point
8911 operations. If you are compiling for an Alpha without floating-
8912 point operations, you must ensure that the library is built so as
8913 not to call them.
8914
8915 Note that Alpha implementations without floating-point operations
8916 are required to have floating-point registers.
8917
8918 -mfp-reg
8919 -mno-fp-regs
8920 Generate code that uses (does not use) the floating-point register
8921 set. -mno-fp-regs implies -msoft-float. If the floating-point
8922 register set is not used, floating point operands are passed in
8923 integer registers as if they were integers and floating-point
8924 results are passed in $0 instead of $f0. This is a non-standard
8925 calling sequence, so any function with a floating-point argument or
8926 return value called by code compiled with -mno-fp-regs must also be
8927 compiled with that option.
8928
8929 A typical use of this option is building a kernel that does not
8930 use, and hence need not save and restore, any floating-point
8931 registers.
8932
8933 -mieee
8934 The Alpha architecture implements floating-point hardware optimized
8935 for maximum performance. It is mostly compliant with the IEEE
8936 floating point standard. However, for full compliance, software
8937 assistance is required. This option generates code fully IEEE
8938 compliant code except that the inexact-flag is not maintained (see
8939 below). If this option is turned on, the preprocessor macro
8940 "_IEEE_FP" is defined during compilation. The resulting code is
8941 less efficient but is able to correctly support denormalized
8942 numbers and exceptional IEEE values such as not-a-number and
8943 plus/minus infinity. Other Alpha compilers call this option
8944 -ieee_with_no_inexact.
8945
8946 -mieee-with-inexact
8947 This is like -mieee except the generated code also maintains the
8948 IEEE inexact-flag. Turning on this option causes the generated
8949 code to implement fully-compliant IEEE math. In addition to
8950 "_IEEE_FP", "_IEEE_FP_EXACT" is defined as a preprocessor macro.
8951 On some Alpha implementations the resulting code may execute
8952 significantly slower than the code generated by default. Since
8953 there is very little code that depends on the inexact-flag, you
8954 should normally not specify this option. Other Alpha compilers
8955 call this option -ieee_with_inexact.
8956
8957 -mfp-trap-mode=trap-mode
8958 This option controls what floating-point related traps are enabled.
8959 Other Alpha compilers call this option -fptm trap-mode. The trap
8960 mode can be set to one of four values:
8961
8962 n This is the default (normal) setting. The only traps that are
8963 enabled are the ones that cannot be disabled in software (e.g.,
8964 division by zero trap).
8965
8966 u In addition to the traps enabled by n, underflow traps are
8967 enabled as well.
8968
8969 su Like u, but the instructions are marked to be safe for software
8970 completion (see Alpha architecture manual for details).
8971
8972 sui Like su, but inexact traps are enabled as well.
8973
8974 -mfp-rounding-mode=rounding-mode
8975 Selects the IEEE rounding mode. Other Alpha compilers call this
8976 option -fprm rounding-mode. The rounding-mode can be one of:
8977
8978 n Normal IEEE rounding mode. Floating point numbers are rounded
8979 towards the nearest machine number or towards the even machine
8980 number in case of a tie.
8981
8982 m Round towards minus infinity.
8983
8984 c Chopped rounding mode. Floating point numbers are rounded
8985 towards zero.
8986
8987 d Dynamic rounding mode. A field in the floating point control
8988 register (fpcr, see Alpha architecture reference manual)
8989 controls the rounding mode in effect. The C library
8990 initializes this register for rounding towards plus infinity.
8991 Thus, unless your program modifies the fpcr, d corresponds to
8992 round towards plus infinity.
8993
8994 -mtrap-precision=trap-precision
8995 In the Alpha architecture, floating point traps are imprecise.
8996 This means without software assistance it is impossible to recover
8997 from a floating trap and program execution normally needs to be
8998 terminated. GCC can generate code that can assist operating system
8999 trap handlers in determining the exact location that caused a
9000 floating point trap. Depending on the requirements of an
9001 application, different levels of precisions can be selected:
9002
9003 p Program precision. This option is the default and means a trap
9004 handler can only identify which program caused a floating point
9005 exception.
9006
9007 f Function precision. The trap handler can determine the
9008 function that caused a floating point exception.
9009
9010 i Instruction precision. The trap handler can determine the
9011 exact instruction that caused a floating point exception.
9012
9013 Other Alpha compilers provide the equivalent options called
9014 -scope_safe and -resumption_safe.
9015
9016 -mieee-conformant
9017 This option marks the generated code as IEEE conformant. You must
9018 not use this option unless you also specify -mtrap-precision=i and
9019 either -mfp-trap-mode=su or -mfp-trap-mode=sui. Its only effect is
9020 to emit the line .eflag 48 in the function prologue of the
9021 generated assembly file. Under DEC Unix, this has the effect that
9022 IEEE-conformant math library routines will be linked in.
9023
9024 -mbuild-constants
9025 Normally GCC examines a 32- or 64-bit integer constant to see if it
9026 can construct it from smaller constants in two or three
9027 instructions. If it cannot, it will output the constant as a
9028 literal and generate code to load it from the data segment at
9029 runtime.
9030
9031 Use this option to require GCC to construct all integer constants
9032 using code, even if it takes more instructions (the maximum is
9033 six).
9034
9035 You would typically use this option to build a shared library
9036 dynamic loader. Itself a shared library, it must relocate itself
9037 in memory before it can find the variables and constants in its own
9038 data segment.
9039
9040 -malpha-as
9041 -mgas
9042 Select whether to generate code to be assembled by the vendor-
9043 supplied assembler (-malpha-as) or by the GNU assembler -mgas.
9044
9045 -mbwx
9046 -mno-bwx
9047 -mcix
9048 -mno-cix
9049 -mfix
9050 -mno-fix
9051 -mmax
9052 -mno-max
9053 Indicate whether GCC should generate code to use the optional BWX,
9054 CIX, FIX and MAX instruction sets. The default is to use the
9055 instruction sets supported by the CPU type specified via -mcpu=
9056 option or that of the CPU on which GCC was built if none was
9057 specified.
9058
9059 -mfloat-vax
9060 -mfloat-ieee
9061 Generate code that uses (does not use) VAX F and G floating point
9062 arithmetic instead of IEEE single and double precision.
9063
9064 -mexplicit-relocs
9065 -mno-explicit-relocs
9066 Older Alpha assemblers provided no way to generate symbol
9067 relocations except via assembler macros. Use of these macros does
9068 not allow optimal instruction scheduling. GNU binutils as of
9069 version 2.12 supports a new syntax that allows the compiler to
9070 explicitly mark which relocations should apply to which
9071 instructions. This option is mostly useful for debugging, as GCC
9072 detects the capabilities of the assembler when it is built and sets
9073 the default accordingly.
9074
9075 -msmall-data
9076 -mlarge-data
9077 When -mexplicit-relocs is in effect, static data is accessed via
9078 gp-relative relocations. When -msmall-data is used, objects 8
9079 bytes long or smaller are placed in a small data area (the ".sdata"
9080 and ".sbss" sections) and are accessed via 16-bit relocations off
9081 of the $gp register. This limits the size of the small data area
9082 to 64KB, but allows the variables to be directly accessed via a
9083 single instruction.
9084
9085 The default is -mlarge-data. With this option the data area is
9086 limited to just below 2GB. Programs that require more than 2GB of
9087 data must use "malloc" or "mmap" to allocate the data in the heap
9088 instead of in the program's data segment.
9089
9090 When generating code for shared libraries, -fpic implies
9091 -msmall-data and -fPIC implies -mlarge-data.
9092
9093 -msmall-text
9094 -mlarge-text
9095 When -msmall-text is used, the compiler assumes that the code of
9096 the entire program (or shared library) fits in 4MB, and is thus
9097 reachable with a branch instruction. When -msmall-data is used,
9098 the compiler can assume that all local symbols share the same $gp
9099 value, and thus reduce the number of instructions required for a
9100 function call from 4 to 1.
9101
9102 The default is -mlarge-text.
9103
9104 -mcpu=cpu_type
9105 Set the instruction set and instruction scheduling parameters for
9106 machine type cpu_type. You can specify either the EV style name or
9107 the corresponding chip number. GCC supports scheduling parameters
9108 for the EV4, EV5 and EV6 family of processors and will choose the
9109 default values for the instruction set from the processor you
9110 specify. If you do not specify a processor type, GCC will default
9111 to the processor on which the compiler was built.
9112
9113 Supported values for cpu_type are
9114
9115 ev4
9116 ev45
9117 21064
9118 Schedules as an EV4 and has no instruction set extensions.
9119
9120 ev5
9121 21164
9122 Schedules as an EV5 and has no instruction set extensions.
9123
9124 ev56
9125 21164a
9126 Schedules as an EV5 and supports the BWX extension.
9127
9128 pca56
9129 21164pc
9130 21164PC
9131 Schedules as an EV5 and supports the BWX and MAX extensions.
9132
9133 ev6
9134 21264
9135 Schedules as an EV6 and supports the BWX, FIX, and MAX
9136 extensions.
9137
9138 ev67
9139 21264a
9140 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX
9141 extensions.
9142
9143 Native Linux/GNU toolchains also support the value native, which
9144 selects the best architecture option for the host processor.
9145 -mcpu=native has no effect if GCC does not recognize the processor.
9146
9147 -mtune=cpu_type
9148 Set only the instruction scheduling parameters for machine type
9149 cpu_type. The instruction set is not changed.
9150
9151 Native Linux/GNU toolchains also support the value native, which
9152 selects the best architecture option for the host processor.
9153 -mtune=native has no effect if GCC does not recognize the
9154 processor.
9155
9156 -mmemory-latency=time
9157 Sets the latency the scheduler should assume for typical memory
9158 references as seen by the application. This number is highly
9159 dependent on the memory access patterns used by the application and
9160 the size of the external cache on the machine.
9161
9162 Valid options for time are
9163
9164 number
9165 A decimal number representing clock cycles.
9166
9167 L1
9168 L2
9169 L3
9170 main
9171 The compiler contains estimates of the number of clock cycles
9172 for "typical" EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9173 (also called Dcache, Scache, and Bcache), as well as to main
9174 memory. Note that L3 is only valid for EV5.
9175
9176 DEC Alpha/VMS Options
9177
9178 These -m options are defined for the DEC Alpha/VMS implementations:
9179
9180 -mvms-return-codes
9181 Return VMS condition codes from main. The default is to return
9182 POSIX style condition (e.g. error) codes.
9183
9184 -mdebug-main=prefix
9185 Flag the first routine whose name starts with prefix as the main
9186 routine for the debugger.
9187
9188 -mmalloc64
9189 Default to 64bit memory allocation routines.
9190
9191 FR30 Options
9192
9193 These options are defined specifically for the FR30 port.
9194
9195 -msmall-model
9196 Use the small address space model. This can produce smaller code,
9197 but it does assume that all symbolic values and addresses will fit
9198 into a 20-bit range.
9199
9200 -mno-lsim
9201 Assume that run-time support has been provided and so there is no
9202 need to include the simulator library (libsim.a) on the linker
9203 command line.
9204
9205 FRV Options
9206
9207 -mgpr-32
9208 Only use the first 32 general purpose registers.
9209
9210 -mgpr-64
9211 Use all 64 general purpose registers.
9212
9213 -mfpr-32
9214 Use only the first 32 floating point registers.
9215
9216 -mfpr-64
9217 Use all 64 floating point registers
9218
9219 -mhard-float
9220 Use hardware instructions for floating point operations.
9221
9222 -msoft-float
9223 Use library routines for floating point operations.
9224
9225 -malloc-cc
9226 Dynamically allocate condition code registers.
9227
9228 -mfixed-cc
9229 Do not try to dynamically allocate condition code registers, only
9230 use "icc0" and "fcc0".
9231
9232 -mdword
9233 Change ABI to use double word insns.
9234
9235 -mno-dword
9236 Do not use double word instructions.
9237
9238 -mdouble
9239 Use floating point double instructions.
9240
9241 -mno-double
9242 Do not use floating point double instructions.
9243
9244 -mmedia
9245 Use media instructions.
9246
9247 -mno-media
9248 Do not use media instructions.
9249
9250 -mmuladd
9251 Use multiply and add/subtract instructions.
9252
9253 -mno-muladd
9254 Do not use multiply and add/subtract instructions.
9255
9256 -mfdpic
9257 Select the FDPIC ABI, that uses function descriptors to represent
9258 pointers to functions. Without any PIC/PIE-related options, it
9259 implies -fPIE. With -fpic or -fpie, it assumes GOT entries and
9260 small data are within a 12-bit range from the GOT base address;
9261 with -fPIC or -fPIE, GOT offsets are computed with 32 bits. With a
9262 bfin-elf target, this option implies -msim.
9263
9264 -minline-plt
9265 Enable inlining of PLT entries in function calls to functions that
9266 are not known to bind locally. It has no effect without -mfdpic.
9267 It's enabled by default if optimizing for speed and compiling for
9268 shared libraries (i.e., -fPIC or -fpic), or when an optimization
9269 option such as -O3 or above is present in the command line.
9270
9271 -mTLS
9272 Assume a large TLS segment when generating thread-local code.
9273
9274 -mtls
9275 Do not assume a large TLS segment when generating thread-local
9276 code.
9277
9278 -mgprel-ro
9279 Enable the use of "GPREL" relocations in the FDPIC ABI for data
9280 that is known to be in read-only sections. It's enabled by
9281 default, except for -fpic or -fpie: even though it may help make
9282 the global offset table smaller, it trades 1 instruction for 4.
9283 With -fPIC or -fPIE, it trades 3 instructions for 4, one of which
9284 may be shared by multiple symbols, and it avoids the need for a GOT
9285 entry for the referenced symbol, so it's more likely to be a win.
9286 If it is not, -mno-gprel-ro can be used to disable it.
9287
9288 -multilib-library-pic
9289 Link with the (library, not FD) pic libraries. It's implied by
9290 -mlibrary-pic, as well as by -fPIC and -fpic without -mfdpic. You
9291 should never have to use it explicitly.
9292
9293 -mlinked-fp
9294 Follow the EABI requirement of always creating a frame pointer
9295 whenever a stack frame is allocated. This option is enabled by
9296 default and can be disabled with -mno-linked-fp.
9297
9298 -mlong-calls
9299 Use indirect addressing to call functions outside the current
9300 compilation unit. This allows the functions to be placed anywhere
9301 within the 32-bit address space.
9302
9303 -malign-labels
9304 Try to align labels to an 8-byte boundary by inserting nops into
9305 the previous packet. This option only has an effect when VLIW
9306 packing is enabled. It doesn't create new packets; it merely adds
9307 nops to existing ones.
9308
9309 -mlibrary-pic
9310 Generate position-independent EABI code.
9311
9312 -macc-4
9313 Use only the first four media accumulator registers.
9314
9315 -macc-8
9316 Use all eight media accumulator registers.
9317
9318 -mpack
9319 Pack VLIW instructions.
9320
9321 -mno-pack
9322 Do not pack VLIW instructions.
9323
9324 -mno-eflags
9325 Do not mark ABI switches in e_flags.
9326
9327 -mcond-move
9328 Enable the use of conditional-move instructions (default).
9329
9330 This switch is mainly for debugging the compiler and will likely be
9331 removed in a future version.
9332
9333 -mno-cond-move
9334 Disable the use of conditional-move instructions.
9335
9336 This switch is mainly for debugging the compiler and will likely be
9337 removed in a future version.
9338
9339 -mscc
9340 Enable the use of conditional set instructions (default).
9341
9342 This switch is mainly for debugging the compiler and will likely be
9343 removed in a future version.
9344
9345 -mno-scc
9346 Disable the use of conditional set instructions.
9347
9348 This switch is mainly for debugging the compiler and will likely be
9349 removed in a future version.
9350
9351 -mcond-exec
9352 Enable the use of conditional execution (default).
9353
9354 This switch is mainly for debugging the compiler and will likely be
9355 removed in a future version.
9356
9357 -mno-cond-exec
9358 Disable the use of conditional execution.
9359
9360 This switch is mainly for debugging the compiler and will likely be
9361 removed in a future version.
9362
9363 -mvliw-branch
9364 Run a pass to pack branches into VLIW instructions (default).
9365
9366 This switch is mainly for debugging the compiler and will likely be
9367 removed in a future version.
9368
9369 -mno-vliw-branch
9370 Do not run a pass to pack branches into VLIW instructions.
9371
9372 This switch is mainly for debugging the compiler and will likely be
9373 removed in a future version.
9374
9375 -mmulti-cond-exec
9376 Enable optimization of "&&" and "||" in conditional execution
9377 (default).
9378
9379 This switch is mainly for debugging the compiler and will likely be
9380 removed in a future version.
9381
9382 -mno-multi-cond-exec
9383 Disable optimization of "&&" and "||" in conditional execution.
9384
9385 This switch is mainly for debugging the compiler and will likely be
9386 removed in a future version.
9387
9388 -mnested-cond-exec
9389 Enable nested conditional execution optimizations (default).
9390
9391 This switch is mainly for debugging the compiler and will likely be
9392 removed in a future version.
9393
9394 -mno-nested-cond-exec
9395 Disable nested conditional execution optimizations.
9396
9397 This switch is mainly for debugging the compiler and will likely be
9398 removed in a future version.
9399
9400 -moptimize-membar
9401 This switch removes redundant "membar" instructions from the
9402 compiler generated code. It is enabled by default.
9403
9404 -mno-optimize-membar
9405 This switch disables the automatic removal of redundant "membar"
9406 instructions from the generated code.
9407
9408 -mtomcat-stats
9409 Cause gas to print out tomcat statistics.
9410
9411 -mcpu=cpu
9412 Select the processor type for which to generate code. Possible
9413 values are frv, fr550, tomcat, fr500, fr450, fr405, fr400, fr300
9414 and simple.
9415
9416 GNU/Linux Options
9417
9418 These -m options are defined for GNU/Linux targets:
9419
9420 -mglibc
9421 Use the GNU C library instead of uClibc. This is the default
9422 except on *-*-linux-*uclibc* targets.
9423
9424 -muclibc
9425 Use uClibc instead of the GNU C library. This is the default on
9426 *-*-linux-*uclibc* targets.
9427
9428 H8/300 Options
9429
9430 These -m options are defined for the H8/300 implementations:
9431
9432 -mrelax
9433 Shorten some address references at link time, when possible; uses
9434 the linker option -relax.
9435
9436 -mh Generate code for the H8/300H.
9437
9438 -ms Generate code for the H8S.
9439
9440 -mn Generate code for the H8S and H8/300H in the normal mode. This
9441 switch must be used either with -mh or -ms.
9442
9443 -ms2600
9444 Generate code for the H8S/2600. This switch must be used with -ms.
9445
9446 -mint32
9447 Make "int" data 32 bits by default.
9448
9449 -malign-300
9450 On the H8/300H and H8S, use the same alignment rules as for the
9451 H8/300. The default for the H8/300H and H8S is to align longs and
9452 floats on 4 byte boundaries. -malign-300 causes them to be aligned
9453 on 2 byte boundaries. This option has no effect on the H8/300.
9454
9455 HPPA Options
9456
9457 These -m options are defined for the HPPA family of computers:
9458
9459 -march=architecture-type
9460 Generate code for the specified architecture. The choices for
9461 architecture-type are 1.0 for PA 1.0, 1.1 for PA 1.1, and 2.0 for
9462 PA 2.0 processors. Refer to /usr/lib/sched.models on an HP-UX
9463 system to determine the proper architecture option for your
9464 machine. Code compiled for lower numbered architectures will run
9465 on higher numbered architectures, but not the other way around.
9466
9467 -mpa-risc-1-0
9468 -mpa-risc-1-1
9469 -mpa-risc-2-0
9470 Synonyms for -march=1.0, -march=1.1, and -march=2.0 respectively.
9471
9472 -mbig-switch
9473 Generate code suitable for big switch tables. Use this option only
9474 if the assembler/linker complain about out of range branches within
9475 a switch table.
9476
9477 -mjump-in-delay
9478 Fill delay slots of function calls with unconditional jump
9479 instructions by modifying the return pointer for the function call
9480 to be the target of the conditional jump.
9481
9482 -mdisable-fpregs
9483 Prevent floating point registers from being used in any manner.
9484 This is necessary for compiling kernels which perform lazy context
9485 switching of floating point registers. If you use this option and
9486 attempt to perform floating point operations, the compiler will
9487 abort.
9488
9489 -mdisable-indexing
9490 Prevent the compiler from using indexing address modes. This
9491 avoids some rather obscure problems when compiling MIG generated
9492 code under MACH.
9493
9494 -mno-space-regs
9495 Generate code that assumes the target has no space registers. This
9496 allows GCC to generate faster indirect calls and use unscaled index
9497 address modes.
9498
9499 Such code is suitable for level 0 PA systems and kernels.
9500
9501 -mfast-indirect-calls
9502 Generate code that assumes calls never cross space boundaries.
9503 This allows GCC to emit code which performs faster indirect calls.
9504
9505 This option will not work in the presence of shared libraries or
9506 nested functions.
9507
9508 -mfixed-range=register-range
9509 Generate code treating the given register range as fixed registers.
9510 A fixed register is one that the register allocator can not use.
9511 This is useful when compiling kernel code. A register range is
9512 specified as two registers separated by a dash. Multiple register
9513 ranges can be specified separated by a comma.
9514
9515 -mlong-load-store
9516 Generate 3-instruction load and store sequences as sometimes
9517 required by the HP-UX 10 linker. This is equivalent to the +k
9518 option to the HP compilers.
9519
9520 -mportable-runtime
9521 Use the portable calling conventions proposed by HP for ELF
9522 systems.
9523
9524 -mgas
9525 Enable the use of assembler directives only GAS understands.
9526
9527 -mschedule=cpu-type
9528 Schedule code according to the constraints for the machine type
9529 cpu-type. The choices for cpu-type are 700 7100, 7100LC, 7200,
9530 7300 and 8000. Refer to /usr/lib/sched.models on an HP-UX system
9531 to determine the proper scheduling option for your machine. The
9532 default scheduling is 8000.
9533
9534 -mlinker-opt
9535 Enable the optimization pass in the HP-UX linker. Note this makes
9536 symbolic debugging impossible. It also triggers a bug in the HP-UX
9537 8 and HP-UX 9 linkers in which they give bogus error messages when
9538 linking some programs.
9539
9540 -msoft-float
9541 Generate output containing library calls for floating point.
9542 Warning: the requisite libraries are not available for all HPPA
9543 targets. Normally the facilities of the machine's usual C compiler
9544 are used, but this cannot be done directly in cross-compilation.
9545 You must make your own arrangements to provide suitable library
9546 functions for cross-compilation.
9547
9548 -msoft-float changes the calling convention in the output file;
9549 therefore, it is only useful if you compile all of a program with
9550 this option. In particular, you need to compile libgcc.a, the
9551 library that comes with GCC, with -msoft-float in order for this to
9552 work.
9553
9554 -msio
9555 Generate the predefine, "_SIO", for server IO. The default is
9556 -mwsio. This generates the predefines, "__hp9000s700",
9557 "__hp9000s700__" and "_WSIO", for workstation IO. These options
9558 are available under HP-UX and HI-UX.
9559
9560 -mgnu-ld
9561 Use GNU ld specific options. This passes -shared to ld when
9562 building a shared library. It is the default when GCC is
9563 configured, explicitly or implicitly, with the GNU linker. This
9564 option does not have any affect on which ld is called, it only
9565 changes what parameters are passed to that ld. The ld that is
9566 called is determined by the --with-ld configure option, GCC's
9567 program search path, and finally by the user's PATH. The linker
9568 used by GCC can be printed using which `gcc -print-prog-name=ld`.
9569 This option is only available on the 64 bit HP-UX GCC, i.e.
9570 configured with hppa*64*-*-hpux*.
9571
9572 -mhp-ld
9573 Use HP ld specific options. This passes -b to ld when building a
9574 shared library and passes +Accept TypeMismatch to ld on all links.
9575 It is the default when GCC is configured, explicitly or implicitly,
9576 with the HP linker. This option does not have any affect on which
9577 ld is called, it only changes what parameters are passed to that
9578 ld. The ld that is called is determined by the --with-ld configure
9579 option, GCC's program search path, and finally by the user's PATH.
9580 The linker used by GCC can be printed using which `gcc
9581 -print-prog-name=ld`. This option is only available on the 64 bit
9582 HP-UX GCC, i.e. configured with hppa*64*-*-hpux*.
9583
9584 -mlong-calls
9585 Generate code that uses long call sequences. This ensures that a
9586 call is always able to reach linker generated stubs. The default
9587 is to generate long calls only when the distance from the call site
9588 to the beginning of the function or translation unit, as the case
9589 may be, exceeds a predefined limit set by the branch type being
9590 used. The limits for normal calls are 7,600,000 and 240,000 bytes,
9591 respectively for the PA 2.0 and PA 1.X architectures. Sibcalls are
9592 always limited at 240,000 bytes.
9593
9594 Distances are measured from the beginning of functions when using
9595 the -ffunction-sections option, or when using the -mgas and
9596 -mno-portable-runtime options together under HP-UX with the SOM
9597 linker.
9598
9599 It is normally not desirable to use this option as it will degrade
9600 performance. However, it may be useful in large applications,
9601 particularly when partial linking is used to build the application.
9602
9603 The types of long calls used depends on the capabilities of the
9604 assembler and linker, and the type of code being generated. The
9605 impact on systems that support long absolute calls, and long pic
9606 symbol-difference or pc-relative calls should be relatively small.
9607 However, an indirect call is used on 32-bit ELF systems in pic code
9608 and it is quite long.
9609
9610 -munix=unix-std
9611 Generate compiler predefines and select a startfile for the
9612 specified UNIX standard. The choices for unix-std are 93, 95 and
9613 98. 93 is supported on all HP-UX versions. 95 is available on HP-
9614 UX 10.10 and later. 98 is available on HP-UX 11.11 and later. The
9615 default values are 93 for HP-UX 10.00, 95 for HP-UX 10.10 though to
9616 11.00, and 98 for HP-UX 11.11 and later.
9617
9618 -munix=93 provides the same predefines as GCC 3.3 and 3.4.
9619 -munix=95 provides additional predefines for "XOPEN_UNIX" and
9620 "_XOPEN_SOURCE_EXTENDED", and the startfile unix95.o. -munix=98
9621 provides additional predefines for "_XOPEN_UNIX",
9622 "_XOPEN_SOURCE_EXTENDED", "_INCLUDE__STDC_A1_SOURCE" and
9623 "_INCLUDE_XOPEN_SOURCE_500", and the startfile unix98.o.
9624
9625 It is important to note that this option changes the interfaces for
9626 various library routines. It also affects the operational behavior
9627 of the C library. Thus, extreme care is needed in using this
9628 option.
9629
9630 Library code that is intended to operate with more than one UNIX
9631 standard must test, set and restore the variable
9632 __xpg4_extended_mask as appropriate. Most GNU software doesn't
9633 provide this capability.
9634
9635 -nolibdld
9636 Suppress the generation of link options to search libdld.sl when
9637 the -static option is specified on HP-UX 10 and later.
9638
9639 -static
9640 The HP-UX implementation of setlocale in libc has a dependency on
9641 libdld.sl. There isn't an archive version of libdld.sl. Thus,
9642 when the -static option is specified, special link options are
9643 needed to resolve this dependency.
9644
9645 On HP-UX 10 and later, the GCC driver adds the necessary options to
9646 link with libdld.sl when the -static option is specified. This
9647 causes the resulting binary to be dynamic. On the 64-bit port, the
9648 linkers generate dynamic binaries by default in any case. The
9649 -nolibdld option can be used to prevent the GCC driver from adding
9650 these link options.
9651
9652 -threads
9653 Add support for multithreading with the dce thread library under
9654 HP-UX. This option sets flags for both the preprocessor and
9655 linker.
9656
9657 Intel 386 and AMD x86-64 Options
9658
9659 These -m options are defined for the i386 and x86-64 family of
9660 computers:
9661
9662 -mtune=cpu-type
9663 Tune to cpu-type everything applicable about the generated code,
9664 except for the ABI and the set of available instructions. The
9665 choices for cpu-type are:
9666
9667 generic
9668 Produce code optimized for the most common IA32/AMD64/EM64T
9669 processors. If you know the CPU on which your code will run,
9670 then you should use the corresponding -mtune option instead of
9671 -mtune=generic. But, if you do not know exactly what CPU users
9672 of your application will have, then you should use this option.
9673
9674 As new processors are deployed in the marketplace, the behavior
9675 of this option will change. Therefore, if you upgrade to a
9676 newer version of GCC, the code generated option will change to
9677 reflect the processors that were most common when that version
9678 of GCC was released.
9679
9680 There is no -march=generic option because -march indicates the
9681 instruction set the compiler can use, and there is no generic
9682 instruction set applicable to all processors. In contrast,
9683 -mtune indicates the processor (or, in this case, collection of
9684 processors) for which the code is optimized.
9685
9686 native
9687 This selects the CPU to tune for at compilation time by
9688 determining the processor type of the compiling machine. Using
9689 -mtune=native will produce code optimized for the local machine
9690 under the constraints of the selected instruction set. Using
9691 -march=native will enable all instruction subsets supported by
9692 the local machine (hence the result might not run on different
9693 machines).
9694
9695 i386
9696 Original Intel's i386 CPU.
9697
9698 i486
9699 Intel's i486 CPU. (No scheduling is implemented for this
9700 chip.)
9701
9702 i586, pentium
9703 Intel Pentium CPU with no MMX support.
9704
9705 pentium-mmx
9706 Intel PentiumMMX CPU based on Pentium core with MMX instruction
9707 set support.
9708
9709 pentiumpro
9710 Intel PentiumPro CPU.
9711
9712 i686
9713 Same as "generic", but when used as "march" option, PentiumPro
9714 instruction set will be used, so the code will run on all i686
9715 family chips.
9716
9717 pentium2
9718 Intel Pentium2 CPU based on PentiumPro core with MMX
9719 instruction set support.
9720
9721 pentium3, pentium3m
9722 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE
9723 instruction set support.
9724
9725 pentium-m
9726 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2
9727 instruction set support. Used by Centrino notebooks.
9728
9729 pentium4, pentium4m
9730 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set
9731 support.
9732
9733 prescott
9734 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and
9735 SSE3 instruction set support.
9736
9737 nocona
9738 Improved version of Intel Pentium4 CPU with 64-bit extensions,
9739 MMX, SSE, SSE2 and SSE3 instruction set support.
9740
9741 core2
9742 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3
9743 and SSSE3 instruction set support.
9744
9745 atom
9746 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and
9747 SSSE3 instruction set support.
9748
9749 k6 AMD K6 CPU with MMX instruction set support.
9750
9751 k6-2, k6-3
9752 Improved versions of AMD K6 CPU with MMX and 3DNow! instruction
9753 set support.
9754
9755 athlon, athlon-tbird
9756 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow! and SSE
9757 prefetch instructions support.
9758
9759 athlon-4, athlon-xp, athlon-mp
9760 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow! and
9761 full SSE instruction set support.
9762
9763 k8, opteron, athlon64, athlon-fx
9764 AMD K8 core based CPUs with x86-64 instruction set support.
9765 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow! and
9766 64-bit instruction set extensions.)
9767
9768 k8-sse3, opteron-sse3, athlon64-sse3
9769 Improved versions of k8, opteron and athlon64 with SSE3
9770 instruction set support.
9771
9772 amdfam10, barcelona
9773 AMD Family 10h core based CPUs with x86-64 instruction set
9774 support. (This supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!,
9775 enhanced 3DNow!, ABM and 64-bit instruction set extensions.)
9776
9777 winchip-c6
9778 IDT Winchip C6 CPU, dealt in same way as i486 with additional
9779 MMX instruction set support.
9780
9781 winchip2
9782 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX
9783 and 3DNow! instruction set support.
9784
9785 c3 Via C3 CPU with MMX and 3DNow! instruction set support. (No
9786 scheduling is implemented for this chip.)
9787
9788 c3-2
9789 Via C3-2 CPU with MMX and SSE instruction set support. (No
9790 scheduling is implemented for this chip.)
9791
9792 geode
9793 Embedded AMD CPU with MMX and 3DNow! instruction set support.
9794
9795 While picking a specific cpu-type will schedule things
9796 appropriately for that particular chip, the compiler will not
9797 generate any code that does not run on the i386 without the
9798 -march=cpu-type option being used.
9799
9800 -march=cpu-type
9801 Generate instructions for the machine type cpu-type. The choices
9802 for cpu-type are the same as for -mtune. Moreover, specifying
9803 -march=cpu-type implies -mtune=cpu-type.
9804
9805 -mcpu=cpu-type
9806 A deprecated synonym for -mtune.
9807
9808 -mfpmath=unit
9809 Generate floating point arithmetics for selected unit unit. The
9810 choices for unit are:
9811
9812 387 Use the standard 387 floating point coprocessor present
9813 majority of chips and emulated otherwise. Code compiled with
9814 this option will run almost everywhere. The temporary results
9815 are computed in 80bit precision instead of precision specified
9816 by the type resulting in slightly different results compared to
9817 most of other chips. See -ffloat-store for more detailed
9818 description.
9819
9820 This is the default choice for i386 compiler.
9821
9822 sse Use scalar floating point instructions present in the SSE
9823 instruction set. This instruction set is supported by Pentium3
9824 and newer chips, in the AMD line by Athlon-4, Athlon-xp and
9825 Athlon-mp chips. The earlier version of SSE instruction set
9826 supports only single precision arithmetics, thus the double and
9827 extended precision arithmetics is still done using 387. Later
9828 version, present only in Pentium4 and the future AMD x86-64
9829 chips supports double precision arithmetics too.
9830
9831 For the i386 compiler, you need to use -march=cpu-type, -msse
9832 or -msse2 switches to enable SSE extensions and make this
9833 option effective. For the x86-64 compiler, these extensions
9834 are enabled by default.
9835
9836 The resulting code should be considerably faster in the
9837 majority of cases and avoid the numerical instability problems
9838 of 387 code, but may break some existing code that expects
9839 temporaries to be 80bit.
9840
9841 This is the default choice for the x86-64 compiler.
9842
9843 sse,387
9844 sse+387
9845 both
9846 Attempt to utilize both instruction sets at once. This
9847 effectively double the amount of available registers and on
9848 chips with separate execution units for 387 and SSE the
9849 execution resources too. Use this option with care, as it is
9850 still experimental, because the GCC register allocator does not
9851 model separate functional units well resulting in instable
9852 performance.
9853
9854 -masm=dialect
9855 Output asm instructions using selected dialect. Supported choices
9856 are intel or att (the default one). Darwin does not support intel.
9857
9858 -mieee-fp
9859 -mno-ieee-fp
9860 Control whether or not the compiler uses IEEE floating point
9861 comparisons. These handle correctly the case where the result of a
9862 comparison is unordered.
9863
9864 -msoft-float
9865 Generate output containing library calls for floating point.
9866 Warning: the requisite libraries are not part of GCC. Normally the
9867 facilities of the machine's usual C compiler are used, but this
9868 can't be done directly in cross-compilation. You must make your
9869 own arrangements to provide suitable library functions for cross-
9870 compilation.
9871
9872 On machines where a function returns floating point results in the
9873 80387 register stack, some floating point opcodes may be emitted
9874 even if -msoft-float is used.
9875
9876 -mno-fp-ret-in-387
9877 Do not use the FPU registers for return values of functions.
9878
9879 The usual calling convention has functions return values of types
9880 "float" and "double" in an FPU register, even if there is no FPU.
9881 The idea is that the operating system should emulate an FPU.
9882
9883 The option -mno-fp-ret-in-387 causes such values to be returned in
9884 ordinary CPU registers instead.
9885
9886 -mno-fancy-math-387
9887 Some 387 emulators do not support the "sin", "cos" and "sqrt"
9888 instructions for the 387. Specify this option to avoid generating
9889 those instructions. This option is the default on FreeBSD, OpenBSD
9890 and NetBSD. This option is overridden when -march indicates that
9891 the target cpu will always have an FPU and so the instruction will
9892 not need emulation. As of revision 2.6.1, these instructions are
9893 not generated unless you also use the -funsafe-math-optimizations
9894 switch.
9895
9896 -malign-double
9897 -mno-align-double
9898 Control whether GCC aligns "double", "long double", and "long long"
9899 variables on a two word boundary or a one word boundary. Aligning
9900 "double" variables on a two word boundary will produce code that
9901 runs somewhat faster on a Pentium at the expense of more memory.
9902
9903 On x86-64, -malign-double is enabled by default.
9904
9905 Warning: if you use the -malign-double switch, structures
9906 containing the above types will be aligned differently than the
9907 published application binary interface specifications for the 386
9908 and will not be binary compatible with structures in code compiled
9909 without that switch.
9910
9911 -m96bit-long-double
9912 -m128bit-long-double
9913 These switches control the size of "long double" type. The i386
9914 application binary interface specifies the size to be 96 bits, so
9915 -m96bit-long-double is the default in 32 bit mode.
9916
9917 Modern architectures (Pentium and newer) would prefer "long double"
9918 to be aligned to an 8 or 16 byte boundary. In arrays or structures
9919 conforming to the ABI, this would not be possible. So specifying a
9920 -m128bit-long-double will align "long double" to a 16 byte boundary
9921 by padding the "long double" with an additional 32 bit zero.
9922
9923 In the x86-64 compiler, -m128bit-long-double is the default choice
9924 as its ABI specifies that "long double" is to be aligned on 16 byte
9925 boundary.
9926
9927 Notice that neither of these options enable any extra precision
9928 over the x87 standard of 80 bits for a "long double".
9929
9930 Warning: if you override the default value for your target ABI, the
9931 structures and arrays containing "long double" variables will
9932 change their size as well as function calling convention for
9933 function taking "long double" will be modified. Hence they will
9934 not be binary compatible with arrays or structures in code compiled
9935 without that switch.
9936
9937 -mlarge-data-threshold=number
9938 When -mcmodel=medium is specified, the data greater than threshold
9939 are placed in large data section. This value must be the same
9940 across all object linked into the binary and defaults to 65535.
9941
9942 -mrtd
9943 Use a different function-calling convention, in which functions
9944 that take a fixed number of arguments return with the "ret" num
9945 instruction, which pops their arguments while returning. This
9946 saves one instruction in the caller since there is no need to pop
9947 the arguments there.
9948
9949 You can specify that an individual function is called with this
9950 calling sequence with the function attribute stdcall. You can also
9951 override the -mrtd option by using the function attribute cdecl.
9952
9953 Warning: this calling convention is incompatible with the one
9954 normally used on Unix, so you cannot use it if you need to call
9955 libraries compiled with the Unix compiler.
9956
9957 Also, you must provide function prototypes for all functions that
9958 take variable numbers of arguments (including "printf"); otherwise
9959 incorrect code will be generated for calls to those functions.
9960
9961 In addition, seriously incorrect code will result if you call a
9962 function with too many arguments. (Normally, extra arguments are
9963 harmlessly ignored.)
9964
9965 -mregparm=num
9966 Control how many registers are used to pass integer arguments. By
9967 default, no registers are used to pass arguments, and at most 3
9968 registers can be used. You can control this behavior for a
9969 specific function by using the function attribute regparm.
9970
9971 Warning: if you use this switch, and num is nonzero, then you must
9972 build all modules with the same value, including any libraries.
9973 This includes the system libraries and startup modules.
9974
9975 -msseregparm
9976 Use SSE register passing conventions for float and double arguments
9977 and return values. You can control this behavior for a specific
9978 function by using the function attribute sseregparm.
9979
9980 Warning: if you use this switch then you must build all modules
9981 with the same value, including any libraries. This includes the
9982 system libraries and startup modules.
9983
9984 -mpc32
9985 -mpc64
9986 -mpc80
9987 Set 80387 floating-point precision to 32, 64 or 80 bits. When
9988 -mpc32 is specified, the significands of results of floating-point
9989 operations are rounded to 24 bits (single precision); -mpc64 rounds
9990 the significands of results of floating-point operations to 53 bits
9991 (double precision) and -mpc80 rounds the significands of results of
9992 floating-point operations to 64 bits (extended double precision),
9993 which is the default. When this option is used, floating-point
9994 operations in higher precisions are not available to the programmer
9995 without setting the FPU control word explicitly.
9996
9997 Setting the rounding of floating-point operations to less than the
9998 default 80 bits can speed some programs by 2% or more. Note that
9999 some mathematical libraries assume that extended precision (80 bit)
10000 floating-point operations are enabled by default; routines in such
10001 libraries could suffer significant loss of accuracy, typically
10002 through so-called "catastrophic cancellation", when this option is
10003 used to set the precision to less than extended precision.
10004
10005 -mstackrealign
10006 Realign the stack at entry. On the Intel x86, the -mstackrealign
10007 option will generate an alternate prologue and epilogue that
10008 realigns the runtime stack if necessary. This supports mixing
10009 legacy codes that keep a 4-byte aligned stack with modern codes
10010 that keep a 16-byte stack for SSE compatibility. See also the
10011 attribute "force_align_arg_pointer", applicable to individual
10012 functions.
10013
10014 -mpreferred-stack-boundary=num
10015 Attempt to keep the stack boundary aligned to a 2 raised to num
10016 byte boundary. If -mpreferred-stack-boundary is not specified, the
10017 default is 4 (16 bytes or 128 bits).
10018
10019 -mincoming-stack-boundary=num
10020 Assume the incoming stack is aligned to a 2 raised to num byte
10021 boundary. If -mincoming-stack-boundary is not specified, the one
10022 specified by -mpreferred-stack-boundary will be used.
10023
10024 On Pentium and PentiumPro, "double" and "long double" values should
10025 be aligned to an 8 byte boundary (see -malign-double) or suffer
10026 significant run time performance penalties. On Pentium III, the
10027 Streaming SIMD Extension (SSE) data type "__m128" may not work
10028 properly if it is not 16 byte aligned.
10029
10030 To ensure proper alignment of this values on the stack, the stack
10031 boundary must be as aligned as that required by any value stored on
10032 the stack. Further, every function must be generated such that it
10033 keeps the stack aligned. Thus calling a function compiled with a
10034 higher preferred stack boundary from a function compiled with a
10035 lower preferred stack boundary will most likely misalign the stack.
10036 It is recommended that libraries that use callbacks always use the
10037 default setting.
10038
10039 This extra alignment does consume extra stack space, and generally
10040 increases code size. Code that is sensitive to stack space usage,
10041 such as embedded systems and operating system kernels, may want to
10042 reduce the preferred alignment to -mpreferred-stack-boundary=2.
10043
10044 -mmmx
10045 -mno-mmx
10046 -msse
10047 -mno-sse
10048 -msse2
10049 -mno-sse2
10050 -msse3
10051 -mno-sse3
10052 -mssse3
10053 -mno-ssse3
10054 -msse4.1
10055 -mno-sse4.1
10056 -msse4.2
10057 -mno-sse4.2
10058 -msse4
10059 -mno-sse4
10060 -mavx
10061 -mno-avx
10062 -maes
10063 -mno-aes
10064 -mpclmul
10065 -mno-pclmul
10066 -msse4a
10067 -mno-sse4a
10068 -mfma4
10069 -mno-fma4
10070 -mxop
10071 -mno-xop
10072 -mlwp
10073 -mno-lwp
10074 -m3dnow
10075 -mno-3dnow
10076 -mpopcnt
10077 -mno-popcnt
10078 -mabm
10079 -mno-abm
10080 These switches enable or disable the use of instructions in the
10081 MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, FMA4,
10082 XOP, LWP, ABM or 3DNow! extended instruction sets. These
10083 extensions are also available as built-in functions: see X86 Built-
10084 in Functions, for details of the functions enabled and disabled by
10085 these switches.
10086
10087 To have SSE/SSE2 instructions generated automatically from
10088 floating-point code (as opposed to 387 instructions), see
10089 -mfpmath=sse.
10090
10091 GCC depresses SSEx instructions when -mavx is used. Instead, it
10092 generates new AVX instructions or AVX equivalence for all SSEx
10093 instructions when needed.
10094
10095 These options will enable GCC to use these extended instructions in
10096 generated code, even without -mfpmath=sse. Applications which
10097 perform runtime CPU detection must compile separate files for each
10098 supported architecture, using the appropriate flags. In
10099 particular, the file containing the CPU detection code should be
10100 compiled without these options.
10101
10102 -mfused-madd
10103 -mno-fused-madd
10104 Do (don't) generate code that uses the fused multiply/add or
10105 multiply/subtract instructions. The default is to use these
10106 instructions.
10107
10108 -mcld
10109 This option instructs GCC to emit a "cld" instruction in the
10110 prologue of functions that use string instructions. String
10111 instructions depend on the DF flag to select between autoincrement
10112 or autodecrement mode. While the ABI specifies the DF flag to be
10113 cleared on function entry, some operating systems violate this
10114 specification by not clearing the DF flag in their exception
10115 dispatchers. The exception handler can be invoked with the DF flag
10116 set which leads to wrong direction mode, when string instructions
10117 are used. This option can be enabled by default on 32-bit x86
10118 targets by configuring GCC with the --enable-cld configure option.
10119 Generation of "cld" instructions can be suppressed with the
10120 -mno-cld compiler option in this case.
10121
10122 -mcx16
10123 This option will enable GCC to use CMPXCHG16B instruction in
10124 generated code. CMPXCHG16B allows for atomic operations on 128-bit
10125 double quadword (or oword) data types. This is useful for high
10126 resolution counters that could be updated by multiple processors
10127 (or cores). This instruction is generated as part of atomic built-
10128 in functions: see Atomic Builtins for details.
10129
10130 -msahf
10131 This option will enable GCC to use SAHF instruction in generated
10132 64-bit code. Early Intel CPUs with Intel 64 lacked LAHF and SAHF
10133 instructions supported by AMD64 until introduction of Pentium 4 G1
10134 step in December 2005. LAHF and SAHF are load and store
10135 instructions, respectively, for certain status flags. In 64-bit
10136 mode, SAHF instruction is used to optimize "fmod", "drem" or
10137 "remainder" built-in functions: see Other Builtins for details.
10138
10139 -mmovbe
10140 This option will enable GCC to use movbe instruction to implement
10141 "__builtin_bswap32" and "__builtin_bswap64".
10142
10143 -mcrc32
10144 This option will enable built-in functions,
10145 "__builtin_ia32_crc32qi", "__builtin_ia32_crc32hi".
10146 "__builtin_ia32_crc32si" and "__builtin_ia32_crc32di" to generate
10147 the crc32 machine instruction.
10148
10149 -mrecip
10150 This option will enable GCC to use RCPSS and RSQRTSS instructions
10151 (and their vectorized variants RCPPS and RSQRTPS) with an
10152 additional Newton-Raphson step to increase precision instead of
10153 DIVSS and SQRTSS (and their vectorized variants) for single
10154 precision floating point arguments. These instructions are
10155 generated only when -funsafe-math-optimizations is enabled together
10156 with -finite-math-only and -fno-trapping-math. Note that while the
10157 throughput of the sequence is higher than the throughput of the
10158 non-reciprocal instruction, the precision of the sequence can be
10159 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals
10160 0.99999994).
10161
10162 Note that GCC implements 1.0f/sqrtf(x) in terms of RSQRTSS (or
10163 RSQRTPS) already with -ffast-math (or the above option
10164 combination), and doesn't need -mrecip.
10165
10166 -mveclibabi=type
10167 Specifies the ABI type to use for vectorizing intrinsics using an
10168 external library. Supported types are "svml" for the Intel short
10169 vector math library and "acml" for the AMD math core library style
10170 of interfacing. GCC will currently emit calls to "vmldExp2",
10171 "vmldLn2", "vmldLog102", "vmldLog102", "vmldPow2", "vmldTanh2",
10172 "vmldTan2", "vmldAtan2", "vmldAtanh2", "vmldCbrt2", "vmldSinh2",
10173 "vmldSin2", "vmldAsinh2", "vmldAsin2", "vmldCosh2", "vmldCos2",
10174 "vmldAcosh2", "vmldAcos2", "vmlsExp4", "vmlsLn4", "vmlsLog104",
10175 "vmlsLog104", "vmlsPow4", "vmlsTanh4", "vmlsTan4", "vmlsAtan4",
10176 "vmlsAtanh4", "vmlsCbrt4", "vmlsSinh4", "vmlsSin4", "vmlsAsinh4",
10177 "vmlsAsin4", "vmlsCosh4", "vmlsCos4", "vmlsAcosh4" and "vmlsAcos4"
10178 for corresponding function type when -mveclibabi=svml is used and
10179 "__vrd2_sin", "__vrd2_cos", "__vrd2_exp", "__vrd2_log",
10180 "__vrd2_log2", "__vrd2_log10", "__vrs4_sinf", "__vrs4_cosf",
10181 "__vrs4_expf", "__vrs4_logf", "__vrs4_log2f", "__vrs4_log10f" and
10182 "__vrs4_powf" for corresponding function type when -mveclibabi=acml
10183 is used. Both -ftree-vectorize and -funsafe-math-optimizations have
10184 to be enabled. A SVML or ACML ABI compatible library will have to
10185 be specified at link time.
10186
10187 -mabi=name
10188 Generate code for the specified calling convention. Permissible
10189 values are: sysv for the ABI used on GNU/Linux and other systems
10190 and ms for the Microsoft ABI. The default is to use the Microsoft
10191 ABI when targeting Windows. On all other systems, the default is
10192 the SYSV ABI. You can control this behavior for a specific
10193 function by using the function attribute ms_abi/sysv_abi.
10194
10195 -mpush-args
10196 -mno-push-args
10197 Use PUSH operations to store outgoing parameters. This method is
10198 shorter and usually equally fast as method using SUB/MOV operations
10199 and is enabled by default. In some cases disabling it may improve
10200 performance because of improved scheduling and reduced
10201 dependencies.
10202
10203 -maccumulate-outgoing-args
10204 If enabled, the maximum amount of space required for outgoing
10205 arguments will be computed in the function prologue. This is
10206 faster on most modern CPUs because of reduced dependencies,
10207 improved scheduling and reduced stack usage when preferred stack
10208 boundary is not equal to 2. The drawback is a notable increase in
10209 code size. This switch implies -mno-push-args.
10210
10211 -mthreads
10212 Support thread-safe exception handling on Mingw32. Code that
10213 relies on thread-safe exception handling must compile and link all
10214 code with the -mthreads option. When compiling, -mthreads defines
10215 -D_MT; when linking, it links in a special thread helper library
10216 -lmingwthrd which cleans up per thread exception handling data.
10217
10218 -mno-align-stringops
10219 Do not align destination of inlined string operations. This switch
10220 reduces code size and improves performance in case the destination
10221 is already aligned, but GCC doesn't know about it.
10222
10223 -minline-all-stringops
10224 By default GCC inlines string operations only when destination is
10225 known to be aligned at least to 4 byte boundary. This enables more
10226 inlining, increase code size, but may improve performance of code
10227 that depends on fast memcpy, strlen and memset for short lengths.
10228
10229 -minline-stringops-dynamically
10230 For string operation of unknown size, inline runtime checks so for
10231 small blocks inline code is used, while for large blocks library
10232 call is used.
10233
10234 -mstringop-strategy=alg
10235 Overwrite internal decision heuristic about particular algorithm to
10236 inline string operation with. The allowed values are "rep_byte",
10237 "rep_4byte", "rep_8byte" for expanding using i386 "rep" prefix of
10238 specified size, "byte_loop", "loop", "unrolled_loop" for expanding
10239 inline loop, "libcall" for always expanding library call.
10240
10241 -momit-leaf-frame-pointer
10242 Don't keep the frame pointer in a register for leaf functions.
10243 This avoids the instructions to save, set up and restore frame
10244 pointers and makes an extra register available in leaf functions.
10245 The option -fomit-frame-pointer removes the frame pointer for all
10246 functions which might make debugging harder.
10247
10248 -mtls-direct-seg-refs
10249 -mno-tls-direct-seg-refs
10250 Controls whether TLS variables may be accessed with offsets from
10251 the TLS segment register (%gs for 32-bit, %fs for 64-bit), or
10252 whether the thread base pointer must be added. Whether or not this
10253 is legal depends on the operating system, and whether it maps the
10254 segment to cover the entire TLS area.
10255
10256 For systems that use GNU libc, the default is on.
10257
10258 -msse2avx
10259 -mno-sse2avx
10260 Specify that the assembler should encode SSE instructions with VEX
10261 prefix. The option -mavx turns this on by default.
10262
10263 These -m switches are supported in addition to the above on AMD x86-64
10264 processors in 64-bit environments.
10265
10266 -m32
10267 -m64
10268 Generate code for a 32-bit or 64-bit environment. The 32-bit
10269 environment sets int, long and pointer to 32 bits and generates
10270 code that runs on any i386 system. The 64-bit environment sets int
10271 to 32 bits and long and pointer to 64 bits and generates code for
10272 AMD's x86-64 architecture. For darwin only the -m64 option turns
10273 off the -fno-pic and -mdynamic-no-pic options.
10274
10275 -mno-red-zone
10276 Do not use a so called red zone for x86-64 code. The red zone is
10277 mandated by the x86-64 ABI, it is a 128-byte area beyond the
10278 location of the stack pointer that will not be modified by signal
10279 or interrupt handlers and therefore can be used for temporary data
10280 without adjusting the stack pointer. The flag -mno-red-zone
10281 disables this red zone.
10282
10283 -mcmodel=small
10284 Generate code for the small code model: the program and its symbols
10285 must be linked in the lower 2 GB of the address space. Pointers
10286 are 64 bits. Programs can be statically or dynamically linked.
10287 This is the default code model.
10288
10289 -mcmodel=kernel
10290 Generate code for the kernel code model. The kernel runs in the
10291 negative 2 GB of the address space. This model has to be used for
10292 Linux kernel code.
10293
10294 -mcmodel=medium
10295 Generate code for the medium model: The program is linked in the
10296 lower 2 GB of the address space. Small symbols are also placed
10297 there. Symbols with sizes larger than -mlarge-data-threshold are
10298 put into large data or bss sections and can be located above 2GB.
10299 Programs can be statically or dynamically linked.
10300
10301 -mcmodel=large
10302 Generate code for the large model: This model makes no assumptions
10303 about addresses and sizes of sections.
10304
10305 IA-64 Options
10306
10307 These are the -m options defined for the Intel IA-64 architecture.
10308
10309 -mbig-endian
10310 Generate code for a big endian target. This is the default for HP-
10311 UX.
10312
10313 -mlittle-endian
10314 Generate code for a little endian target. This is the default for
10315 AIX5 and GNU/Linux.
10316
10317 -mgnu-as
10318 -mno-gnu-as
10319 Generate (or don't) code for the GNU assembler. This is the
10320 default.
10321
10322 -mgnu-ld
10323 -mno-gnu-ld
10324 Generate (or don't) code for the GNU linker. This is the default.
10325
10326 -mno-pic
10327 Generate code that does not use a global pointer register. The
10328 result is not position independent code, and violates the IA-64
10329 ABI.
10330
10331 -mvolatile-asm-stop
10332 -mno-volatile-asm-stop
10333 Generate (or don't) a stop bit immediately before and after
10334 volatile asm statements.
10335
10336 -mregister-names
10337 -mno-register-names
10338 Generate (or don't) in, loc, and out register names for the stacked
10339 registers. This may make assembler output more readable.
10340
10341 -mno-sdata
10342 -msdata
10343 Disable (or enable) optimizations that use the small data section.
10344 This may be useful for working around optimizer bugs.
10345
10346 -mconstant-gp
10347 Generate code that uses a single constant global pointer value.
10348 This is useful when compiling kernel code.
10349
10350 -mauto-pic
10351 Generate code that is self-relocatable. This implies
10352 -mconstant-gp. This is useful when compiling firmware code.
10353
10354 -minline-float-divide-min-latency
10355 Generate code for inline divides of floating point values using the
10356 minimum latency algorithm.
10357
10358 -minline-float-divide-max-throughput
10359 Generate code for inline divides of floating point values using the
10360 maximum throughput algorithm.
10361
10362 -mno-inline-float-divide
10363 Do not generate inline code for divides of floating point values.
10364
10365 -minline-int-divide-min-latency
10366 Generate code for inline divides of integer values using the
10367 minimum latency algorithm.
10368
10369 -minline-int-divide-max-throughput
10370 Generate code for inline divides of integer values using the
10371 maximum throughput algorithm.
10372
10373 -mno-inline-int-divide
10374 Do not generate inline code for divides of integer values.
10375
10376 -minline-sqrt-min-latency
10377 Generate code for inline square roots using the minimum latency
10378 algorithm.
10379
10380 -minline-sqrt-max-throughput
10381 Generate code for inline square roots using the maximum throughput
10382 algorithm.
10383
10384 -mno-inline-sqrt
10385 Do not generate inline code for sqrt.
10386
10387 -mfused-madd
10388 -mno-fused-madd
10389 Do (don't) generate code that uses the fused multiply/add or
10390 multiply/subtract instructions. The default is to use these
10391 instructions.
10392
10393 -mno-dwarf2-asm
10394 -mdwarf2-asm
10395 Don't (or do) generate assembler code for the DWARF2 line number
10396 debugging info. This may be useful when not using the GNU
10397 assembler.
10398
10399 -mearly-stop-bits
10400 -mno-early-stop-bits
10401 Allow stop bits to be placed earlier than immediately preceding the
10402 instruction that triggered the stop bit. This can improve
10403 instruction scheduling, but does not always do so.
10404
10405 -mfixed-range=register-range
10406 Generate code treating the given register range as fixed registers.
10407 A fixed register is one that the register allocator can not use.
10408 This is useful when compiling kernel code. A register range is
10409 specified as two registers separated by a dash. Multiple register
10410 ranges can be specified separated by a comma.
10411
10412 -mtls-size=tls-size
10413 Specify bit size of immediate TLS offsets. Valid values are 14,
10414 22, and 64.
10415
10416 -mtune=cpu-type
10417 Tune the instruction scheduling for a particular CPU, Valid values
10418 are itanium, itanium1, merced, itanium2, and mckinley.
10419
10420 -milp32
10421 -mlp64
10422 Generate code for a 32-bit or 64-bit environment. The 32-bit
10423 environment sets int, long and pointer to 32 bits. The 64-bit
10424 environment sets int to 32 bits and long and pointer to 64 bits.
10425 These are HP-UX specific flags.
10426
10427 -mno-sched-br-data-spec
10428 -msched-br-data-spec
10429 (Dis/En)able data speculative scheduling before reload. This will
10430 result in generation of the ld.a instructions and the corresponding
10431 check instructions (ld.c / chk.a). The default is 'disable'.
10432
10433 -msched-ar-data-spec
10434 -mno-sched-ar-data-spec
10435 (En/Dis)able data speculative scheduling after reload. This will
10436 result in generation of the ld.a instructions and the corresponding
10437 check instructions (ld.c / chk.a). The default is 'enable'.
10438
10439 -mno-sched-control-spec
10440 -msched-control-spec
10441 (Dis/En)able control speculative scheduling. This feature is
10442 available only during region scheduling (i.e. before reload). This
10443 will result in generation of the ld.s instructions and the
10444 corresponding check instructions chk.s . The default is 'disable'.
10445
10446 -msched-br-in-data-spec
10447 -mno-sched-br-in-data-spec
10448 (En/Dis)able speculative scheduling of the instructions that are
10449 dependent on the data speculative loads before reload. This is
10450 effective only with -msched-br-data-spec enabled. The default is
10451 'enable'.
10452
10453 -msched-ar-in-data-spec
10454 -mno-sched-ar-in-data-spec
10455 (En/Dis)able speculative scheduling of the instructions that are
10456 dependent on the data speculative loads after reload. This is
10457 effective only with -msched-ar-data-spec enabled. The default is
10458 'enable'.
10459
10460 -msched-in-control-spec
10461 -mno-sched-in-control-spec
10462 (En/Dis)able speculative scheduling of the instructions that are
10463 dependent on the control speculative loads. This is effective only
10464 with -msched-control-spec enabled. The default is 'enable'.
10465
10466 -mno-sched-prefer-non-data-spec-insns
10467 -msched-prefer-non-data-spec-insns
10468 If enabled, data speculative instructions will be chosen for
10469 schedule only if there are no other choices at the moment. This
10470 will make the use of the data speculation much more conservative.
10471 The default is 'disable'.
10472
10473 -mno-sched-prefer-non-control-spec-insns
10474 -msched-prefer-non-control-spec-insns
10475 If enabled, control speculative instructions will be chosen for
10476 schedule only if there are no other choices at the moment. This
10477 will make the use of the control speculation much more
10478 conservative. The default is 'disable'.
10479
10480 -mno-sched-count-spec-in-critical-path
10481 -msched-count-spec-in-critical-path
10482 If enabled, speculative dependencies will be considered during
10483 computation of the instructions priorities. This will make the use
10484 of the speculation a bit more conservative. The default is
10485 'disable'.
10486
10487 -msched-spec-ldc
10488 Use a simple data speculation check. This option is on by default.
10489
10490 -msched-control-spec-ldc
10491 Use a simple check for control speculation. This option is on by
10492 default.
10493
10494 -msched-stop-bits-after-every-cycle
10495 Place a stop bit after every cycle when scheduling. This option is
10496 on by default.
10497
10498 -msched-fp-mem-deps-zero-cost
10499 Assume that floating-point stores and loads are not likely to cause
10500 a conflict when placed into the same instruction group. This
10501 option is disabled by default.
10502
10503 -msel-sched-dont-check-control-spec
10504 Generate checks for control speculation in selective scheduling.
10505 This flag is disabled by default.
10506
10507 -msched-max-memory-insns=max-insns
10508 Limit on the number of memory insns per instruction group, giving
10509 lower priority to subsequent memory insns attempting to schedule in
10510 the same instruction group. Frequently useful to prevent cache bank
10511 conflicts. The default value is 1.
10512
10513 -msched-max-memory-insns-hard-limit
10514 Disallow more than `msched-max-memory-insns' in instruction group.
10515 Otherwise, limit is `soft' meaning that we would prefer non-memory
10516 operations when limit is reached but may still schedule memory
10517 operations.
10518
10519 IA-64/VMS Options
10520
10521 These -m options are defined for the IA-64/VMS implementations:
10522
10523 -mvms-return-codes
10524 Return VMS condition codes from main. The default is to return
10525 POSIX style condition (e.g. error) codes.
10526
10527 -mdebug-main=prefix
10528 Flag the first routine whose name starts with prefix as the main
10529 routine for the debugger.
10530
10531 -mmalloc64
10532 Default to 64bit memory allocation routines.
10533
10534 LM32 Options
10535
10536 These -m options are defined for the Lattice Mico32 architecture:
10537
10538 -mbarrel-shift-enabled
10539 Enable barrel-shift instructions.
10540
10541 -mdivide-enabled
10542 Enable divide and modulus instructions.
10543
10544 -mmultiply-enabled
10545 Enable multiply instructions.
10546
10547 -msign-extend-enabled
10548 Enable sign extend instructions.
10549
10550 -muser-enabled
10551 Enable user-defined instructions.
10552
10553 M32C Options
10554
10555 -mcpu=name
10556 Select the CPU for which code is generated. name may be one of r8c
10557 for the R8C/Tiny series, m16c for the M16C (up to /60) series,
10558 m32cm for the M16C/80 series, or m32c for the M32C/80 series.
10559
10560 -msim
10561 Specifies that the program will be run on the simulator. This
10562 causes an alternate runtime library to be linked in which supports,
10563 for example, file I/O. You must not use this option when
10564 generating programs that will run on real hardware; you must
10565 provide your own runtime library for whatever I/O functions are
10566 needed.
10567
10568 -memregs=number
10569 Specifies the number of memory-based pseudo-registers GCC will use
10570 during code generation. These pseudo-registers will be used like
10571 real registers, so there is a tradeoff between GCC's ability to fit
10572 the code into available registers, and the performance penalty of
10573 using memory instead of registers. Note that all modules in a
10574 program must be compiled with the same value for this option.
10575 Because of that, you must not use this option with the default
10576 runtime libraries gcc builds.
10577
10578 M32R/D Options
10579
10580 These -m options are defined for Renesas M32R/D architectures:
10581
10582 -m32r2
10583 Generate code for the M32R/2.
10584
10585 -m32rx
10586 Generate code for the M32R/X.
10587
10588 -m32r
10589 Generate code for the M32R. This is the default.
10590
10591 -mmodel=small
10592 Assume all objects live in the lower 16MB of memory (so that their
10593 addresses can be loaded with the "ld24" instruction), and assume
10594 all subroutines are reachable with the "bl" instruction. This is
10595 the default.
10596
10597 The addressability of a particular object can be set with the
10598 "model" attribute.
10599
10600 -mmodel=medium
10601 Assume objects may be anywhere in the 32-bit address space (the
10602 compiler will generate "seth/add3" instructions to load their
10603 addresses), and assume all subroutines are reachable with the "bl"
10604 instruction.
10605
10606 -mmodel=large
10607 Assume objects may be anywhere in the 32-bit address space (the
10608 compiler will generate "seth/add3" instructions to load their
10609 addresses), and assume subroutines may not be reachable with the
10610 "bl" instruction (the compiler will generate the much slower
10611 "seth/add3/jl" instruction sequence).
10612
10613 -msdata=none
10614 Disable use of the small data area. Variables will be put into one
10615 of .data, bss, or .rodata (unless the "section" attribute has been
10616 specified). This is the default.
10617
10618 The small data area consists of sections .sdata and .sbss. Objects
10619 may be explicitly put in the small data area with the "section"
10620 attribute using one of these sections.
10621
10622 -msdata=sdata
10623 Put small global and static data in the small data area, but do not
10624 generate special code to reference them.
10625
10626 -msdata=use
10627 Put small global and static data in the small data area, and
10628 generate special instructions to reference them.
10629
10630 -G num
10631 Put global and static objects less than or equal to num bytes into
10632 the small data or bss sections instead of the normal data or bss
10633 sections. The default value of num is 8. The -msdata option must
10634 be set to one of sdata or use for this option to have any effect.
10635
10636 All modules should be compiled with the same -G num value.
10637 Compiling with different values of num may or may not work; if it
10638 doesn't the linker will give an error message---incorrect code will
10639 not be generated.
10640
10641 -mdebug
10642 Makes the M32R specific code in the compiler display some
10643 statistics that might help in debugging programs.
10644
10645 -malign-loops
10646 Align all loops to a 32-byte boundary.
10647
10648 -mno-align-loops
10649 Do not enforce a 32-byte alignment for loops. This is the default.
10650
10651 -missue-rate=number
10652 Issue number instructions per cycle. number can only be 1 or 2.
10653
10654 -mbranch-cost=number
10655 number can only be 1 or 2. If it is 1 then branches will be
10656 preferred over conditional code, if it is 2, then the opposite will
10657 apply.
10658
10659 -mflush-trap=number
10660 Specifies the trap number to use to flush the cache. The default
10661 is 12. Valid numbers are between 0 and 15 inclusive.
10662
10663 -mno-flush-trap
10664 Specifies that the cache cannot be flushed by using a trap.
10665
10666 -mflush-func=name
10667 Specifies the name of the operating system function to call to
10668 flush the cache. The default is _flush_cache, but a function call
10669 will only be used if a trap is not available.
10670
10671 -mno-flush-func
10672 Indicates that there is no OS function for flushing the cache.
10673
10674 M680x0 Options
10675
10676 These are the -m options defined for M680x0 and ColdFire processors.
10677 The default settings depend on which architecture was selected when the
10678 compiler was configured; the defaults for the most common choices are
10679 given below.
10680
10681 -march=arch
10682 Generate code for a specific M680x0 or ColdFire instruction set
10683 architecture. Permissible values of arch for M680x0 architectures
10684 are: 68000, 68010, 68020, 68030, 68040, 68060 and cpu32. ColdFire
10685 architectures are selected according to Freescale's ISA
10686 classification and the permissible values are: isaa, isaaplus, isab
10687 and isac.
10688
10689 gcc defines a macro __mcfarch__ whenever it is generating code for
10690 a ColdFire target. The arch in this macro is one of the -march
10691 arguments given above.
10692
10693 When used together, -march and -mtune select code that runs on a
10694 family of similar processors but that is optimized for a particular
10695 microarchitecture.
10696
10697 -mcpu=cpu
10698 Generate code for a specific M680x0 or ColdFire processor. The
10699 M680x0 cpus are: 68000, 68010, 68020, 68030, 68040, 68060, 68302,
10700 68332 and cpu32. The ColdFire cpus are given by the table below,
10701 which also classifies the CPUs into families:
10702
10703 Family : -mcpu arguments
10704 51 : 51 51ac 51cn 51em 51qe
10705 5206 : 5202 5204 5206
10706 5206e : 5206e
10707 5208 : 5207 5208
10708 5211a : 5210a 5211a
10709 5213 : 5211 5212 5213
10710 5216 : 5214 5216
10711 52235 : 52230 52231 52232 52233 52234 52235
10712 5225 : 5224 5225
10713 52259 : 52252 52254 52255 52256 52258 52259
10714 5235 : 5232 5233 5234 5235 523x
10715 5249 : 5249
10716 5250 : 5250
10717 5271 : 5270 5271
10718 5272 : 5272
10719 5275 : 5274 5275
10720 5282 : 5280 5281 5282 528x
10721 53017 : 53011 53012 53013 53014 53015 53016 53017
10722 5307 : 5307
10723 5329 : 5327 5328 5329 532x
10724 5373 : 5372 5373 537x
10725 5407 : 5407
10726 5475 : 5470 5471 5472 5473 5474 5475 547x 5480 5481 5482 5483 5484
10727 5485
10728
10729 -mcpu=cpu overrides -march=arch if arch is compatible with cpu.
10730 Other combinations of -mcpu and -march are rejected.
10731
10732 gcc defines the macro __mcf_cpu_cpu when ColdFire target cpu is
10733 selected. It also defines __mcf_family_family, where the value of
10734 family is given by the table above.
10735
10736 -mtune=tune
10737 Tune the code for a particular microarchitecture, within the
10738 constraints set by -march and -mcpu. The M680x0 microarchitectures
10739 are: 68000, 68010, 68020, 68030, 68040, 68060 and cpu32. The
10740 ColdFire microarchitectures are: cfv1, cfv2, cfv3, cfv4 and cfv4e.
10741
10742 You can also use -mtune=68020-40 for code that needs to run
10743 relatively well on 68020, 68030 and 68040 targets. -mtune=68020-60
10744 is similar but includes 68060 targets as well. These two options
10745 select the same tuning decisions as -m68020-40 and -m68020-60
10746 respectively.
10747
10748 gcc defines the macros __mcarch and __mcarch__ when tuning for
10749 680x0 architecture arch. It also defines mcarch unless either
10750 -ansi or a non-GNU -std option is used. If gcc is tuning for a
10751 range of architectures, as selected by -mtune=68020-40 or
10752 -mtune=68020-60, it defines the macros for every architecture in
10753 the range.
10754
10755 gcc also defines the macro __muarch__ when tuning for ColdFire
10756 microarchitecture uarch, where uarch is one of the arguments given
10757 above.
10758
10759 -m68000
10760 -mc68000
10761 Generate output for a 68000. This is the default when the compiler
10762 is configured for 68000-based systems. It is equivalent to
10763 -march=68000.
10764
10765 Use this option for microcontrollers with a 68000 or EC000 core,
10766 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10767
10768 -m68010
10769 Generate output for a 68010. This is the default when the compiler
10770 is configured for 68010-based systems. It is equivalent to
10771 -march=68010.
10772
10773 -m68020
10774 -mc68020
10775 Generate output for a 68020. This is the default when the compiler
10776 is configured for 68020-based systems. It is equivalent to
10777 -march=68020.
10778
10779 -m68030
10780 Generate output for a 68030. This is the default when the compiler
10781 is configured for 68030-based systems. It is equivalent to
10782 -march=68030.
10783
10784 -m68040
10785 Generate output for a 68040. This is the default when the compiler
10786 is configured for 68040-based systems. It is equivalent to
10787 -march=68040.
10788
10789 This option inhibits the use of 68881/68882 instructions that have
10790 to be emulated by software on the 68040. Use this option if your
10791 68040 does not have code to emulate those instructions.
10792
10793 -m68060
10794 Generate output for a 68060. This is the default when the compiler
10795 is configured for 68060-based systems. It is equivalent to
10796 -march=68060.
10797
10798 This option inhibits the use of 68020 and 68881/68882 instructions
10799 that have to be emulated by software on the 68060. Use this option
10800 if your 68060 does not have code to emulate those instructions.
10801
10802 -mcpu32
10803 Generate output for a CPU32. This is the default when the compiler
10804 is configured for CPU32-based systems. It is equivalent to
10805 -march=cpu32.
10806
10807 Use this option for microcontrollers with a CPU32 or CPU32+ core,
10808 including the 68330, 68331, 68332, 68333, 68334, 68336, 68340,
10809 68341, 68349 and 68360.
10810
10811 -m5200
10812 Generate output for a 520X ColdFire CPU. This is the default when
10813 the compiler is configured for 520X-based systems. It is
10814 equivalent to -mcpu=5206, and is now deprecated in favor of that
10815 option.
10816
10817 Use this option for microcontroller with a 5200 core, including the
10818 MCF5202, MCF5203, MCF5204 and MCF5206.
10819
10820 -m5206e
10821 Generate output for a 5206e ColdFire CPU. The option is now
10822 deprecated in favor of the equivalent -mcpu=5206e.
10823
10824 -m528x
10825 Generate output for a member of the ColdFire 528X family. The
10826 option is now deprecated in favor of the equivalent -mcpu=528x.
10827
10828 -m5307
10829 Generate output for a ColdFire 5307 CPU. The option is now
10830 deprecated in favor of the equivalent -mcpu=5307.
10831
10832 -m5407
10833 Generate output for a ColdFire 5407 CPU. The option is now
10834 deprecated in favor of the equivalent -mcpu=5407.
10835
10836 -mcfv4e
10837 Generate output for a ColdFire V4e family CPU (e.g. 547x/548x).
10838 This includes use of hardware floating point instructions. The
10839 option is equivalent to -mcpu=547x, and is now deprecated in favor
10840 of that option.
10841
10842 -m68020-40
10843 Generate output for a 68040, without using any of the new
10844 instructions. This results in code which can run relatively
10845 efficiently on either a 68020/68881 or a 68030 or a 68040. The
10846 generated code does use the 68881 instructions that are emulated on
10847 the 68040.
10848
10849 The option is equivalent to -march=68020 -mtune=68020-40.
10850
10851 -m68020-60
10852 Generate output for a 68060, without using any of the new
10853 instructions. This results in code which can run relatively
10854 efficiently on either a 68020/68881 or a 68030 or a 68040. The
10855 generated code does use the 68881 instructions that are emulated on
10856 the 68060.
10857
10858 The option is equivalent to -march=68020 -mtune=68020-60.
10859
10860 -mhard-float
10861 -m68881
10862 Generate floating-point instructions. This is the default for
10863 68020 and above, and for ColdFire devices that have an FPU. It
10864 defines the macro __HAVE_68881__ on M680x0 targets and __mcffpu__
10865 on ColdFire targets.
10866
10867 -msoft-float
10868 Do not generate floating-point instructions; use library calls
10869 instead. This is the default for 68000, 68010, and 68832 targets.
10870 It is also the default for ColdFire devices that have no FPU.
10871
10872 -mdiv
10873 -mno-div
10874 Generate (do not generate) ColdFire hardware divide and remainder
10875 instructions. If -march is used without -mcpu, the default is "on"
10876 for ColdFire architectures and "off" for M680x0 architectures.
10877 Otherwise, the default is taken from the target CPU (either the
10878 default CPU, or the one specified by -mcpu). For example, the
10879 default is "off" for -mcpu=5206 and "on" for -mcpu=5206e.
10880
10881 gcc defines the macro __mcfhwdiv__ when this option is enabled.
10882
10883 -mshort
10884 Consider type "int" to be 16 bits wide, like "short int".
10885 Additionally, parameters passed on the stack are also aligned to a
10886 16-bit boundary even on targets whose API mandates promotion to
10887 32-bit.
10888
10889 -mno-short
10890 Do not consider type "int" to be 16 bits wide. This is the
10891 default.
10892
10893 -mnobitfield
10894 -mno-bitfield
10895 Do not use the bit-field instructions. The -m68000, -mcpu32 and
10896 -m5200 options imply -mnobitfield.
10897
10898 -mbitfield
10899 Do use the bit-field instructions. The -m68020 option implies
10900 -mbitfield. This is the default if you use a configuration
10901 designed for a 68020.
10902
10903 -mrtd
10904 Use a different function-calling convention, in which functions
10905 that take a fixed number of arguments return with the "rtd"
10906 instruction, which pops their arguments while returning. This
10907 saves one instruction in the caller since there is no need to pop
10908 the arguments there.
10909
10910 This calling convention is incompatible with the one normally used
10911 on Unix, so you cannot use it if you need to call libraries
10912 compiled with the Unix compiler.
10913
10914 Also, you must provide function prototypes for all functions that
10915 take variable numbers of arguments (including "printf"); otherwise
10916 incorrect code will be generated for calls to those functions.
10917
10918 In addition, seriously incorrect code will result if you call a
10919 function with too many arguments. (Normally, extra arguments are
10920 harmlessly ignored.)
10921
10922 The "rtd" instruction is supported by the 68010, 68020, 68030,
10923 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10924
10925 -mno-rtd
10926 Do not use the calling conventions selected by -mrtd. This is the
10927 default.
10928
10929 -malign-int
10930 -mno-align-int
10931 Control whether GCC aligns "int", "long", "long long", "float",
10932 "double", and "long double" variables on a 32-bit boundary
10933 (-malign-int) or a 16-bit boundary (-mno-align-int). Aligning
10934 variables on 32-bit boundaries produces code that runs somewhat
10935 faster on processors with 32-bit busses at the expense of more
10936 memory.
10937
10938 Warning: if you use the -malign-int switch, GCC will align
10939 structures containing the above types differently than most
10940 published application binary interface specifications for the m68k.
10941
10942 -mpcrel
10943 Use the pc-relative addressing mode of the 68000 directly, instead
10944 of using a global offset table. At present, this option implies
10945 -fpic, allowing at most a 16-bit offset for pc-relative addressing.
10946 -fPIC is not presently supported with -mpcrel, though this could be
10947 supported for 68020 and higher processors.
10948
10949 -mno-strict-align
10950 -mstrict-align
10951 Do not (do) assume that unaligned memory references will be handled
10952 by the system.
10953
10954 -msep-data
10955 Generate code that allows the data segment to be located in a
10956 different area of memory from the text segment. This allows for
10957 execute in place in an environment without virtual memory
10958 management. This option implies -fPIC.
10959
10960 -mno-sep-data
10961 Generate code that assumes that the data segment follows the text
10962 segment. This is the default.
10963
10964 -mid-shared-library
10965 Generate code that supports shared libraries via the library ID
10966 method. This allows for execute in place and shared libraries in
10967 an environment without virtual memory management. This option
10968 implies -fPIC.
10969
10970 -mno-id-shared-library
10971 Generate code that doesn't assume ID based shared libraries are
10972 being used. This is the default.
10973
10974 -mshared-library-id=n
10975 Specified the identification number of the ID based shared library
10976 being compiled. Specifying a value of 0 will generate more compact
10977 code, specifying other values will force the allocation of that
10978 number to the current library but is no more space or time
10979 efficient than omitting this option.
10980
10981 -mxgot
10982 -mno-xgot
10983 When generating position-independent code for ColdFire, generate
10984 code that works if the GOT has more than 8192 entries. This code
10985 is larger and slower than code generated without this option. On
10986 M680x0 processors, this option is not needed; -fPIC suffices.
10987
10988 GCC normally uses a single instruction to load values from the GOT.
10989 While this is relatively efficient, it only works if the GOT is
10990 smaller than about 64k. Anything larger causes the linker to
10991 report an error such as:
10992
10993 relocation truncated to fit: R_68K_GOT16O foobar
10994
10995 If this happens, you should recompile your code with -mxgot. It
10996 should then work with very large GOTs. However, code generated
10997 with -mxgot is less efficient, since it takes 4 instructions to
10998 fetch the value of a global symbol.
10999
11000 Note that some linkers, including newer versions of the GNU linker,
11001 can create multiple GOTs and sort GOT entries. If you have such a
11002 linker, you should only need to use -mxgot when compiling a single
11003 object file that accesses more than 8192 GOT entries. Very few do.
11004
11005 These options have no effect unless GCC is generating position-
11006 independent code.
11007
11008 M68hc1x Options
11009
11010 These are the -m options defined for the 68hc11 and 68hc12
11011 microcontrollers. The default values for these options depends on
11012 which style of microcontroller was selected when the compiler was
11013 configured; the defaults for the most common choices are given below.
11014
11015 -m6811
11016 -m68hc11
11017 Generate output for a 68HC11. This is the default when the
11018 compiler is configured for 68HC11-based systems.
11019
11020 -m6812
11021 -m68hc12
11022 Generate output for a 68HC12. This is the default when the
11023 compiler is configured for 68HC12-based systems.
11024
11025 -m68S12
11026 -m68hcs12
11027 Generate output for a 68HCS12.
11028
11029 -mauto-incdec
11030 Enable the use of 68HC12 pre and post auto-increment and auto-
11031 decrement addressing modes.
11032
11033 -minmax
11034 -mnominmax
11035 Enable the use of 68HC12 min and max instructions.
11036
11037 -mlong-calls
11038 -mno-long-calls
11039 Treat all calls as being far away (near). If calls are assumed to
11040 be far away, the compiler will use the "call" instruction to call a
11041 function and the "rtc" instruction for returning.
11042
11043 -mshort
11044 Consider type "int" to be 16 bits wide, like "short int".
11045
11046 -msoft-reg-count=count
11047 Specify the number of pseudo-soft registers which are used for the
11048 code generation. The maximum number is 32. Using more pseudo-soft
11049 register may or may not result in better code depending on the
11050 program. The default is 4 for 68HC11 and 2 for 68HC12.
11051
11052 MCore Options
11053
11054 These are the -m options defined for the Motorola M*Core processors.
11055
11056 -mhardlit
11057 -mno-hardlit
11058 Inline constants into the code stream if it can be done in two
11059 instructions or less.
11060
11061 -mdiv
11062 -mno-div
11063 Use the divide instruction. (Enabled by default).
11064
11065 -mrelax-immediate
11066 -mno-relax-immediate
11067 Allow arbitrary sized immediates in bit operations.
11068
11069 -mwide-bitfields
11070 -mno-wide-bitfields
11071 Always treat bit-fields as int-sized.
11072
11073 -m4byte-functions
11074 -mno-4byte-functions
11075 Force all functions to be aligned to a four byte boundary.
11076
11077 -mcallgraph-data
11078 -mno-callgraph-data
11079 Emit callgraph information.
11080
11081 -mslow-bytes
11082 -mno-slow-bytes
11083 Prefer word access when reading byte quantities.
11084
11085 -mlittle-endian
11086 -mbig-endian
11087 Generate code for a little endian target.
11088
11089 -m210
11090 -m340
11091 Generate code for the 210 processor.
11092
11093 -mno-lsim
11094 Assume that run-time support has been provided and so omit the
11095 simulator library (libsim.a) from the linker command line.
11096
11097 -mstack-increment=size
11098 Set the maximum amount for a single stack increment operation.
11099 Large values can increase the speed of programs which contain
11100 functions that need a large amount of stack space, but they can
11101 also trigger a segmentation fault if the stack is extended too
11102 much. The default value is 0x1000.
11103
11104 MeP Options
11105
11106 -mabsdiff
11107 Enables the "abs" instruction, which is the absolute difference
11108 between two registers.
11109
11110 -mall-opts
11111 Enables all the optional instructions - average, multiply, divide,
11112 bit operations, leading zero, absolute difference, min/max, clip,
11113 and saturation.
11114
11115 -maverage
11116 Enables the "ave" instruction, which computes the average of two
11117 registers.
11118
11119 -mbased=n
11120 Variables of size n bytes or smaller will be placed in the ".based"
11121 section by default. Based variables use the $tp register as a base
11122 register, and there is a 128 byte limit to the ".based" section.
11123
11124 -mbitops
11125 Enables the bit operation instructions - bit test ("btstm"), set
11126 ("bsetm"), clear ("bclrm"), invert ("bnotm"), and test-and-set
11127 ("tas").
11128
11129 -mc=name
11130 Selects which section constant data will be placed in. name may be
11131 "tiny", "near", or "far".
11132
11133 -mclip
11134 Enables the "clip" instruction. Note that "-mclip" is not useful
11135 unless you also provide "-mminmax".
11136
11137 -mconfig=name
11138 Selects one of the build-in core configurations. Each MeP chip has
11139 one or more modules in it; each module has a core CPU and a variety
11140 of coprocessors, optional instructions, and peripherals. The
11141 "MeP-Integrator" tool, not part of GCC, provides these
11142 configurations through this option; using this option is the same
11143 as using all the corresponding command line options. The default
11144 configuration is "default".
11145
11146 -mcop
11147 Enables the coprocessor instructions. By default, this is a 32-bit
11148 coprocessor. Note that the coprocessor is normally enabled via the
11149 "-mconfig=" option.
11150
11151 -mcop32
11152 Enables the 32-bit coprocessor's instructions.
11153
11154 -mcop64
11155 Enables the 64-bit coprocessor's instructions.
11156
11157 -mivc2
11158 Enables IVC2 scheduling. IVC2 is a 64-bit VLIW coprocessor.
11159
11160 -mdc
11161 Causes constant variables to be placed in the ".near" section.
11162
11163 -mdiv
11164 Enables the "div" and "divu" instructions.
11165
11166 -meb
11167 Generate big-endian code.
11168
11169 -mel
11170 Generate little-endian code.
11171
11172 -mio-volatile
11173 Tells the compiler that any variable marked with the "io" attribute
11174 is to be considered volatile.
11175
11176 -ml Causes variables to be assigned to the ".far" section by default.
11177
11178 -mleadz
11179 Enables the "leadz" (leading zero) instruction.
11180
11181 -mm Causes variables to be assigned to the ".near" section by default.
11182
11183 -mminmax
11184 Enables the "min" and "max" instructions.
11185
11186 -mmult
11187 Enables the multiplication and multiply-accumulate instructions.
11188
11189 -mno-opts
11190 Disables all the optional instructions enabled by "-mall-opts".
11191
11192 -mrepeat
11193 Enables the "repeat" and "erepeat" instructions, used for low-
11194 overhead looping.
11195
11196 -ms Causes all variables to default to the ".tiny" section. Note that
11197 there is a 65536 byte limit to this section. Accesses to these
11198 variables use the %gp base register.
11199
11200 -msatur
11201 Enables the saturation instructions. Note that the compiler does
11202 not currently generate these itself, but this option is included
11203 for compatibility with other tools, like "as".
11204
11205 -msdram
11206 Link the SDRAM-based runtime instead of the default ROM-based
11207 runtime.
11208
11209 -msim
11210 Link the simulator runtime libraries.
11211
11212 -msimnovec
11213 Link the simulator runtime libraries, excluding built-in support
11214 for reset and exception vectors and tables.
11215
11216 -mtf
11217 Causes all functions to default to the ".far" section. Without
11218 this option, functions default to the ".near" section.
11219
11220 -mtiny=n
11221 Variables that are n bytes or smaller will be allocated to the
11222 ".tiny" section. These variables use the $gp base register. The
11223 default for this option is 4, but note that there's a 65536 byte
11224 limit to the ".tiny" section.
11225
11226 MIPS Options
11227
11228 -EB Generate big-endian code.
11229
11230 -EL Generate little-endian code. This is the default for mips*el-*-*
11231 configurations.
11232
11233 -march=arch
11234 Generate code that will run on arch, which can be the name of a
11235 generic MIPS ISA, or the name of a particular processor. The ISA
11236 names are: mips1, mips2, mips3, mips4, mips32, mips32r2, mips64 and
11237 mips64r2. The processor names are: 4kc, 4km, 4kp, 4ksc, 4kec,
11238 4kem, 4kep, 4ksd, 5kc, 5kf, 20kc, 24kc, 24kf2_1, 24kf1_1, 24kec,
11239 24kef2_1, 24kef1_1, 34kc, 34kf2_1, 34kf1_1, 74kc, 74kf2_1, 74kf1_1,
11240 74kf3_2, 1004kc, 1004kf2_1, 1004kf1_1, loongson2e, loongson2f, m4k,
11241 octeon, orion, r2000, r3000, r3900, r4000, r4400, r4600, r4650,
11242 r6000, r8000, rm7000, rm9000, r10000, r12000, r14000, r16000, sb1,
11243 sr71000, vr4100, vr4111, vr4120, vr4130, vr4300, vr5000, vr5400,
11244 vr5500 and xlr. The special value from-abi selects the most
11245 compatible architecture for the selected ABI (that is, mips1 for
11246 32-bit ABIs and mips3 for 64-bit ABIs).
11247
11248 Native Linux/GNU toolchains also support the value native, which
11249 selects the best architecture option for the host processor.
11250 -march=native has no effect if GCC does not recognize the
11251 processor.
11252
11253 In processor names, a final 000 can be abbreviated as k (for
11254 example, -march=r2k). Prefixes are optional, and vr may be written
11255 r.
11256
11257 Names of the form nf2_1 refer to processors with FPUs clocked at
11258 half the rate of the core, names of the form nf1_1 refer to
11259 processors with FPUs clocked at the same rate as the core, and
11260 names of the form nf3_2 refer to processors with FPUs clocked a
11261 ratio of 3:2 with respect to the core. For compatibility reasons,
11262 nf is accepted as a synonym for nf2_1 while nx and bfx are accepted
11263 as synonyms for nf1_1.
11264
11265 GCC defines two macros based on the value of this option. The
11266 first is _MIPS_ARCH, which gives the name of target architecture,
11267 as a string. The second has the form _MIPS_ARCH_foo, where foo is
11268 the capitalized value of _MIPS_ARCH. For example, -march=r2000
11269 will set _MIPS_ARCH to "r2000" and define the macro
11270 _MIPS_ARCH_R2000.
11271
11272 Note that the _MIPS_ARCH macro uses the processor names given
11273 above. In other words, it will have the full prefix and will not
11274 abbreviate 000 as k. In the case of from-abi, the macro names the
11275 resolved architecture (either "mips1" or "mips3"). It names the
11276 default architecture when no -march option is given.
11277
11278 -mtune=arch
11279 Optimize for arch. Among other things, this option controls the
11280 way instructions are scheduled, and the perceived cost of
11281 arithmetic operations. The list of arch values is the same as for
11282 -march.
11283
11284 When this option is not used, GCC will optimize for the processor
11285 specified by -march. By using -march and -mtune together, it is
11286 possible to generate code that will run on a family of processors,
11287 but optimize the code for one particular member of that family.
11288
11289 -mtune defines the macros _MIPS_TUNE and _MIPS_TUNE_foo, which work
11290 in the same way as the -march ones described above.
11291
11292 -mips1
11293 Equivalent to -march=mips1.
11294
11295 -mips2
11296 Equivalent to -march=mips2.
11297
11298 -mips3
11299 Equivalent to -march=mips3.
11300
11301 -mips4
11302 Equivalent to -march=mips4.
11303
11304 -mips32
11305 Equivalent to -march=mips32.
11306
11307 -mips32r2
11308 Equivalent to -march=mips32r2.
11309
11310 -mips64
11311 Equivalent to -march=mips64.
11312
11313 -mips64r2
11314 Equivalent to -march=mips64r2.
11315
11316 -mips16
11317 -mno-mips16
11318 Generate (do not generate) MIPS16 code. If GCC is targetting a
11319 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE.
11320
11321 MIPS16 code generation can also be controlled on a per-function
11322 basis by means of "mips16" and "nomips16" attributes.
11323
11324 -mflip-mips16
11325 Generate MIPS16 code on alternating functions. This option is
11326 provided for regression testing of mixed MIPS16/non-MIPS16 code
11327 generation, and is not intended for ordinary use in compiling user
11328 code.
11329
11330 -minterlink-mips16
11331 -mno-interlink-mips16
11332 Require (do not require) that non-MIPS16 code be link-compatible
11333 with MIPS16 code.
11334
11335 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
11336 it must either use a call or an indirect jump. -minterlink-mips16
11337 therefore disables direct jumps unless GCC knows that the target of
11338 the jump is not MIPS16.
11339
11340 -mabi=32
11341 -mabi=o64
11342 -mabi=n32
11343 -mabi=64
11344 -mabi=eabi
11345 Generate code for the given ABI.
11346
11347 Note that the EABI has a 32-bit and a 64-bit variant. GCC normally
11348 generates 64-bit code when you select a 64-bit architecture, but
11349 you can use -mgp32 to get 32-bit code instead.
11350
11351 For information about the O64 ABI, see
11352 <http://gcc.gnu.org/projects/mipso64-abi.html>.
11353
11354 GCC supports a variant of the o32 ABI in which floating-point
11355 registers are 64 rather than 32 bits wide. You can select this
11356 combination with -mabi=32 -mfp64. This ABI relies on the mthc1 and
11357 mfhc1 instructions and is therefore only supported for MIPS32R2
11358 processors.
11359
11360 The register assignments for arguments and return values remain the
11361 same, but each scalar value is passed in a single 64-bit register
11362 rather than a pair of 32-bit registers. For example, scalar
11363 floating-point values are returned in $f0 only, not a $f0/$f1 pair.
11364 The set of call-saved registers also remains the same, but all 64
11365 bits are saved.
11366
11367 -mabicalls
11368 -mno-abicalls
11369 Generate (do not generate) code that is suitable for SVR4-style
11370 dynamic objects. -mabicalls is the default for SVR4-based systems.
11371
11372 -mshared
11373 -mno-shared
11374 Generate (do not generate) code that is fully position-independent,
11375 and that can therefore be linked into shared libraries. This
11376 option only affects -mabicalls.
11377
11378 All -mabicalls code has traditionally been position-independent,
11379 regardless of options like -fPIC and -fpic. However, as an
11380 extension, the GNU toolchain allows executables to use absolute
11381 accesses for locally-binding symbols. It can also use shorter GP
11382 initialization sequences and generate direct calls to locally-
11383 defined functions. This mode is selected by -mno-shared.
11384
11385 -mno-shared depends on binutils 2.16 or higher and generates
11386 objects that can only be linked by the GNU linker. However, the
11387 option does not affect the ABI of the final executable; it only
11388 affects the ABI of relocatable objects. Using -mno-shared will
11389 generally make executables both smaller and quicker.
11390
11391 -mshared is the default.
11392
11393 -mplt
11394 -mno-plt
11395 Assume (do not assume) that the static and dynamic linkers support
11396 PLTs and copy relocations. This option only affects -mno-shared
11397 -mabicalls. For the n64 ABI, this option has no effect without
11398 -msym32.
11399
11400 You can make -mplt the default by configuring GCC with
11401 --with-mips-plt. The default is -mno-plt otherwise.
11402
11403 -mxgot
11404 -mno-xgot
11405 Lift (do not lift) the usual restrictions on the size of the global
11406 offset table.
11407
11408 GCC normally uses a single instruction to load values from the GOT.
11409 While this is relatively efficient, it will only work if the GOT is
11410 smaller than about 64k. Anything larger will cause the linker to
11411 report an error such as:
11412
11413 relocation truncated to fit: R_MIPS_GOT16 foobar
11414
11415 If this happens, you should recompile your code with -mxgot. It
11416 should then work with very large GOTs, although it will also be
11417 less efficient, since it will take three instructions to fetch the
11418 value of a global symbol.
11419
11420 Note that some linkers can create multiple GOTs. If you have such
11421 a linker, you should only need to use -mxgot when a single object
11422 file accesses more than 64k's worth of GOT entries. Very few do.
11423
11424 These options have no effect unless GCC is generating position
11425 independent code.
11426
11427 -mgp32
11428 Assume that general-purpose registers are 32 bits wide.
11429
11430 -mgp64
11431 Assume that general-purpose registers are 64 bits wide.
11432
11433 -mfp32
11434 Assume that floating-point registers are 32 bits wide.
11435
11436 -mfp64
11437 Assume that floating-point registers are 64 bits wide.
11438
11439 -mhard-float
11440 Use floating-point coprocessor instructions.
11441
11442 -msoft-float
11443 Do not use floating-point coprocessor instructions. Implement
11444 floating-point calculations using library calls instead.
11445
11446 -msingle-float
11447 Assume that the floating-point coprocessor only supports single-
11448 precision operations.
11449
11450 -mdouble-float
11451 Assume that the floating-point coprocessor supports double-
11452 precision operations. This is the default.
11453
11454 -mllsc
11455 -mno-llsc
11456 Use (do not use) ll, sc, and sync instructions to implement atomic
11457 memory built-in functions. When neither option is specified, GCC
11458 will use the instructions if the target architecture supports them.
11459
11460 -mllsc is useful if the runtime environment can emulate the
11461 instructions and -mno-llsc can be useful when compiling for
11462 nonstandard ISAs. You can make either option the default by
11463 configuring GCC with --with-llsc and --without-llsc respectively.
11464 --with-llsc is the default for some configurations; see the
11465 installation documentation for details.
11466
11467 -mdsp
11468 -mno-dsp
11469 Use (do not use) revision 1 of the MIPS DSP ASE.
11470 This option defines the preprocessor macro __mips_dsp. It also
11471 defines __mips_dsp_rev to 1.
11472
11473 -mdspr2
11474 -mno-dspr2
11475 Use (do not use) revision 2 of the MIPS DSP ASE.
11476 This option defines the preprocessor macros __mips_dsp and
11477 __mips_dspr2. It also defines __mips_dsp_rev to 2.
11478
11479 -msmartmips
11480 -mno-smartmips
11481 Use (do not use) the MIPS SmartMIPS ASE.
11482
11483 -mpaired-single
11484 -mno-paired-single
11485 Use (do not use) paired-single floating-point instructions.
11486 This option requires hardware floating-point support to be
11487 enabled.
11488
11489 -mdmx
11490 -mno-mdmx
11491 Use (do not use) MIPS Digital Media Extension instructions. This
11492 option can only be used when generating 64-bit code and requires
11493 hardware floating-point support to be enabled.
11494
11495 -mips3d
11496 -mno-mips3d
11497 Use (do not use) the MIPS-3D ASE. The option -mips3d implies
11498 -mpaired-single.
11499
11500 -mmt
11501 -mno-mt
11502 Use (do not use) MT Multithreading instructions.
11503
11504 -mlong64
11505 Force "long" types to be 64 bits wide. See -mlong32 for an
11506 explanation of the default and the way that the pointer size is
11507 determined.
11508
11509 -mlong32
11510 Force "long", "int", and pointer types to be 32 bits wide.
11511
11512 The default size of "int"s, "long"s and pointers depends on the
11513 ABI. All the supported ABIs use 32-bit "int"s. The n64 ABI uses
11514 64-bit "long"s, as does the 64-bit EABI; the others use 32-bit
11515 "long"s. Pointers are the same size as "long"s, or the same size
11516 as integer registers, whichever is smaller.
11517
11518 -msym32
11519 -mno-sym32
11520 Assume (do not assume) that all symbols have 32-bit values,
11521 regardless of the selected ABI. This option is useful in
11522 combination with -mabi=64 and -mno-abicalls because it allows GCC
11523 to generate shorter and faster references to symbolic addresses.
11524
11525 -G num
11526 Put definitions of externally-visible data in a small data section
11527 if that data is no bigger than num bytes. GCC can then access the
11528 data more efficiently; see -mgpopt for details.
11529
11530 The default -G option depends on the configuration.
11531
11532 -mlocal-sdata
11533 -mno-local-sdata
11534 Extend (do not extend) the -G behavior to local data too, such as
11535 to static variables in C. -mlocal-sdata is the default for all
11536 configurations.
11537
11538 If the linker complains that an application is using too much small
11539 data, you might want to try rebuilding the less performance-
11540 critical parts with -mno-local-sdata. You might also want to build
11541 large libraries with -mno-local-sdata, so that the libraries leave
11542 more room for the main program.
11543
11544 -mextern-sdata
11545 -mno-extern-sdata
11546 Assume (do not assume) that externally-defined data will be in a
11547 small data section if that data is within the -G limit.
11548 -mextern-sdata is the default for all configurations.
11549
11550 If you compile a module Mod with -mextern-sdata -G num -mgpopt, and
11551 Mod references a variable Var that is no bigger than num bytes, you
11552 must make sure that Var is placed in a small data section. If Var
11553 is defined by another module, you must either compile that module
11554 with a high-enough -G setting or attach a "section" attribute to
11555 Var's definition. If Var is common, you must link the application
11556 with a high-enough -G setting.
11557
11558 The easiest way of satisfying these restrictions is to compile and
11559 link every module with the same -G option. However, you may wish
11560 to build a library that supports several different small data
11561 limits. You can do this by compiling the library with the highest
11562 supported -G setting and additionally using -mno-extern-sdata to
11563 stop the library from making assumptions about externally-defined
11564 data.
11565
11566 -mgpopt
11567 -mno-gpopt
11568 Use (do not use) GP-relative accesses for symbols that are known to
11569 be in a small data section; see -G, -mlocal-sdata and
11570 -mextern-sdata. -mgpopt is the default for all configurations.
11571
11572 -mno-gpopt is useful for cases where the $gp register might not
11573 hold the value of "_gp". For example, if the code is part of a
11574 library that might be used in a boot monitor, programs that call
11575 boot monitor routines will pass an unknown value in $gp. (In such
11576 situations, the boot monitor itself would usually be compiled with
11577 -G0.)
11578
11579 -mno-gpopt implies -mno-local-sdata and -mno-extern-sdata.
11580
11581 -membedded-data
11582 -mno-embedded-data
11583 Allocate variables to the read-only data section first if possible,
11584 then next in the small data section if possible, otherwise in data.
11585 This gives slightly slower code than the default, but reduces the
11586 amount of RAM required when executing, and thus may be preferred
11587 for some embedded systems.
11588
11589 -muninit-const-in-rodata
11590 -mno-uninit-const-in-rodata
11591 Put uninitialized "const" variables in the read-only data section.
11592 This option is only meaningful in conjunction with -membedded-data.
11593
11594 -mcode-readable=setting
11595 Specify whether GCC may generate code that reads from executable
11596 sections. There are three possible settings:
11597
11598 -mcode-readable=yes
11599 Instructions may freely access executable sections. This is
11600 the default setting.
11601
11602 -mcode-readable=pcrel
11603 MIPS16 PC-relative load instructions can access executable
11604 sections, but other instructions must not do so. This option
11605 is useful on 4KSc and 4KSd processors when the code TLBs have
11606 the Read Inhibit bit set. It is also useful on processors that
11607 can be configured to have a dual instruction/data SRAM
11608 interface and that, like the M4K, automatically redirect PC-
11609 relative loads to the instruction RAM.
11610
11611 -mcode-readable=no
11612 Instructions must not access executable sections. This option
11613 can be useful on targets that are configured to have a dual
11614 instruction/data SRAM interface but that (unlike the M4K) do
11615 not automatically redirect PC-relative loads to the instruction
11616 RAM.
11617
11618 -msplit-addresses
11619 -mno-split-addresses
11620 Enable (disable) use of the "%hi()" and "%lo()" assembler
11621 relocation operators. This option has been superseded by
11622 -mexplicit-relocs but is retained for backwards compatibility.
11623
11624 -mexplicit-relocs
11625 -mno-explicit-relocs
11626 Use (do not use) assembler relocation operators when dealing with
11627 symbolic addresses. The alternative, selected by
11628 -mno-explicit-relocs, is to use assembler macros instead.
11629
11630 -mexplicit-relocs is the default if GCC was configured to use an
11631 assembler that supports relocation operators.
11632
11633 -mcheck-zero-division
11634 -mno-check-zero-division
11635 Trap (do not trap) on integer division by zero.
11636
11637 The default is -mcheck-zero-division.
11638
11639 -mdivide-traps
11640 -mdivide-breaks
11641 MIPS systems check for division by zero by generating either a
11642 conditional trap or a break instruction. Using traps results in
11643 smaller code, but is only supported on MIPS II and later. Also,
11644 some versions of the Linux kernel have a bug that prevents trap
11645 from generating the proper signal ("SIGFPE"). Use -mdivide-traps
11646 to allow conditional traps on architectures that support them and
11647 -mdivide-breaks to force the use of breaks.
11648
11649 The default is usually -mdivide-traps, but this can be overridden
11650 at configure time using --with-divide=breaks. Divide-by-zero
11651 checks can be completely disabled using -mno-check-zero-division.
11652
11653 -mmemcpy
11654 -mno-memcpy
11655 Force (do not force) the use of "memcpy()" for non-trivial block
11656 moves. The default is -mno-memcpy, which allows GCC to inline most
11657 constant-sized copies.
11658
11659 -mlong-calls
11660 -mno-long-calls
11661 Disable (do not disable) use of the "jal" instruction. Calling
11662 functions using "jal" is more efficient but requires the caller and
11663 callee to be in the same 256 megabyte segment.
11664
11665 This option has no effect on abicalls code. The default is
11666 -mno-long-calls.
11667
11668 -mmad
11669 -mno-mad
11670 Enable (disable) use of the "mad", "madu" and "mul" instructions,
11671 as provided by the R4650 ISA.
11672
11673 -mfused-madd
11674 -mno-fused-madd
11675 Enable (disable) use of the floating point multiply-accumulate
11676 instructions, when they are available. The default is
11677 -mfused-madd.
11678
11679 When multiply-accumulate instructions are used, the intermediate
11680 product is calculated to infinite precision and is not subject to
11681 the FCSR Flush to Zero bit. This may be undesirable in some
11682 circumstances.
11683
11684 -nocpp
11685 Tell the MIPS assembler to not run its preprocessor over user
11686 assembler files (with a .s suffix) when assembling them.
11687
11688 -mfix-r4000
11689 -mno-fix-r4000
11690 Work around certain R4000 CPU errata:
11691
11692 - A double-word or a variable shift may give an incorrect result
11693 if executed immediately after starting an integer division.
11694
11695 - A double-word or a variable shift may give an incorrect result
11696 if executed while an integer multiplication is in progress.
11697
11698 - An integer division may give an incorrect result if started in
11699 a delay slot of a taken branch or a jump.
11700
11701 -mfix-r4400
11702 -mno-fix-r4400
11703 Work around certain R4400 CPU errata:
11704
11705 - A double-word or a variable shift may give an incorrect result
11706 if executed immediately after starting an integer division.
11707
11708 -mfix-r10000
11709 -mno-fix-r10000
11710 Work around certain R10000 errata:
11711
11712 - "ll"/"sc" sequences may not behave atomically on revisions
11713 prior to 3.0. They may deadlock on revisions 2.6 and earlier.
11714
11715 This option can only be used if the target architecture supports
11716 branch-likely instructions. -mfix-r10000 is the default when
11717 -march=r10000 is used; -mno-fix-r10000 is the default otherwise.
11718
11719 -mfix-vr4120
11720 -mno-fix-vr4120
11721 Work around certain VR4120 errata:
11722
11723 - "dmultu" does not always produce the correct result.
11724
11725 - "div" and "ddiv" do not always produce the correct result if
11726 one of the operands is negative.
11727
11728 The workarounds for the division errata rely on special functions
11729 in libgcc.a. At present, these functions are only provided by the
11730 "mips64vr*-elf" configurations.
11731
11732 Other VR4120 errata require a nop to be inserted between certain
11733 pairs of instructions. These errata are handled by the assembler,
11734 not by GCC itself.
11735
11736 -mfix-vr4130
11737 Work around the VR4130 "mflo"/"mfhi" errata. The workarounds are
11738 implemented by the assembler rather than by GCC, although GCC will
11739 avoid using "mflo" and "mfhi" if the VR4130 "macc", "macchi",
11740 "dmacc" and "dmacchi" instructions are available instead.
11741
11742 -mfix-sb1
11743 -mno-fix-sb1
11744 Work around certain SB-1 CPU core errata. (This flag currently
11745 works around the SB-1 revision 2 "F1" and "F2" floating point
11746 errata.)
11747
11748 -mr10k-cache-barrier=setting
11749 Specify whether GCC should insert cache barriers to avoid the side-
11750 effects of speculation on R10K processors.
11751
11752 In common with many processors, the R10K tries to predict the
11753 outcome of a conditional branch and speculatively executes
11754 instructions from the "taken" branch. It later aborts these
11755 instructions if the predicted outcome was wrong. However, on the
11756 R10K, even aborted instructions can have side effects.
11757
11758 This problem only affects kernel stores and, depending on the
11759 system, kernel loads. As an example, a speculatively-executed
11760 store may load the target memory into cache and mark the cache line
11761 as dirty, even if the store itself is later aborted. If a DMA
11762 operation writes to the same area of memory before the "dirty" line
11763 is flushed, the cached data will overwrite the DMA-ed data. See
11764 the R10K processor manual for a full description, including other
11765 potential problems.
11766
11767 One workaround is to insert cache barrier instructions before every
11768 memory access that might be speculatively executed and that might
11769 have side effects even if aborted. -mr10k-cache-barrier=setting
11770 controls GCC's implementation of this workaround. It assumes that
11771 aborted accesses to any byte in the following regions will not have
11772 side effects:
11773
11774 1. the memory occupied by the current function's stack frame;
11775
11776 2. the memory occupied by an incoming stack argument;
11777
11778 3. the memory occupied by an object with a link-time-constant
11779 address.
11780
11781 It is the kernel's responsibility to ensure that speculative
11782 accesses to these regions are indeed safe.
11783
11784 If the input program contains a function declaration such as:
11785
11786 void foo (void);
11787
11788 then the implementation of "foo" must allow "j foo" and "jal foo"
11789 to be executed speculatively. GCC honors this restriction for
11790 functions it compiles itself. It expects non-GCC functions (such
11791 as hand-written assembly code) to do the same.
11792
11793 The option has three forms:
11794
11795 -mr10k-cache-barrier=load-store
11796 Insert a cache barrier before a load or store that might be
11797 speculatively executed and that might have side effects even if
11798 aborted.
11799
11800 -mr10k-cache-barrier=store
11801 Insert a cache barrier before a store that might be
11802 speculatively executed and that might have side effects even if
11803 aborted.
11804
11805 -mr10k-cache-barrier=none
11806 Disable the insertion of cache barriers. This is the default
11807 setting.
11808
11809 -mflush-func=func
11810 -mno-flush-func
11811 Specifies the function to call to flush the I and D caches, or to
11812 not call any such function. If called, the function must take the
11813 same arguments as the common "_flush_func()", that is, the address
11814 of the memory range for which the cache is being flushed, the size
11815 of the memory range, and the number 3 (to flush both caches). The
11816 default depends on the target GCC was configured for, but commonly
11817 is either _flush_func or __cpu_flush.
11818
11819 mbranch-cost=num
11820 Set the cost of branches to roughly num "simple" instructions.
11821 This cost is only a heuristic and is not guaranteed to produce
11822 consistent results across releases. A zero cost redundantly
11823 selects the default, which is based on the -mtune setting.
11824
11825 -mbranch-likely
11826 -mno-branch-likely
11827 Enable or disable use of Branch Likely instructions, regardless of
11828 the default for the selected architecture. By default, Branch
11829 Likely instructions may be generated if they are supported by the
11830 selected architecture. An exception is for the MIPS32 and MIPS64
11831 architectures and processors which implement those architectures;
11832 for those, Branch Likely instructions will not be generated by
11833 default because the MIPS32 and MIPS64 architectures specifically
11834 deprecate their use.
11835
11836 -mfp-exceptions
11837 -mno-fp-exceptions
11838 Specifies whether FP exceptions are enabled. This affects how we
11839 schedule FP instructions for some processors. The default is that
11840 FP exceptions are enabled.
11841
11842 For instance, on the SB-1, if FP exceptions are disabled, and we
11843 are emitting 64-bit code, then we can use both FP pipes.
11844 Otherwise, we can only use one FP pipe.
11845
11846 -mvr4130-align
11847 -mno-vr4130-align
11848 The VR4130 pipeline is two-way superscalar, but can only issue two
11849 instructions together if the first one is 8-byte aligned. When
11850 this option is enabled, GCC will align pairs of instructions that
11851 it thinks should execute in parallel.
11852
11853 This option only has an effect when optimizing for the VR4130. It
11854 normally makes code faster, but at the expense of making it bigger.
11855 It is enabled by default at optimization level -O3.
11856
11857 -msynci
11858 -mno-synci
11859 Enable (disable) generation of "synci" instructions on
11860 architectures that support it. The "synci" instructions (if
11861 enabled) will be generated when "__builtin___clear_cache()" is
11862 compiled.
11863
11864 This option defaults to "-mno-synci", but the default can be
11865 overridden by configuring with "--with-synci".
11866
11867 When compiling code for single processor systems, it is generally
11868 safe to use "synci". However, on many multi-core (SMP) systems, it
11869 will not invalidate the instruction caches on all cores and may
11870 lead to undefined behavior.
11871
11872 -mrelax-pic-calls
11873 -mno-relax-pic-calls
11874 Try to turn PIC calls that are normally dispatched via register $25
11875 into direct calls. This is only possible if the linker can resolve
11876 the destination at link-time and if the destination is within range
11877 for a direct call.
11878
11879 -mrelax-pic-calls is the default if GCC was configured to use an
11880 assembler and a linker that supports the ".reloc" assembly
11881 directive and "-mexplicit-relocs" is in effect. With
11882 "-mno-explicit-relocs", this optimization can be performed by the
11883 assembler and the linker alone without help from the compiler.
11884
11885 -mmcount-ra-address
11886 -mno-mcount-ra-address
11887 Emit (do not emit) code that allows "_mcount" to modify the calling
11888 function's return address. When enabled, this option extends the
11889 usual "_mcount" interface with a new ra-address parameter, which
11890 has type "intptr_t *" and is passed in register $12. "_mcount" can
11891 then modify the return address by doing both of the following:
11892
11893 · Returning the new address in register $31.
11894
11895 · Storing the new address in "*ra-address", if ra-address is
11896 nonnull.
11897
11898 The default is -mno-mcount-ra-address.
11899
11900 MMIX Options
11901
11902 These options are defined for the MMIX:
11903
11904 -mlibfuncs
11905 -mno-libfuncs
11906 Specify that intrinsic library functions are being compiled,
11907 passing all values in registers, no matter the size.
11908
11909 -mepsilon
11910 -mno-epsilon
11911 Generate floating-point comparison instructions that compare with
11912 respect to the "rE" epsilon register.
11913
11914 -mabi=mmixware
11915 -mabi=gnu
11916 Generate code that passes function parameters and return values
11917 that (in the called function) are seen as registers $0 and up, as
11918 opposed to the GNU ABI which uses global registers $231 and up.
11919
11920 -mzero-extend
11921 -mno-zero-extend
11922 When reading data from memory in sizes shorter than 64 bits, use
11923 (do not use) zero-extending load instructions by default, rather
11924 than sign-extending ones.
11925
11926 -mknuthdiv
11927 -mno-knuthdiv
11928 Make the result of a division yielding a remainder have the same
11929 sign as the divisor. With the default, -mno-knuthdiv, the sign of
11930 the remainder follows the sign of the dividend. Both methods are
11931 arithmetically valid, the latter being almost exclusively used.
11932
11933 -mtoplevel-symbols
11934 -mno-toplevel-symbols
11935 Prepend (do not prepend) a : to all global symbols, so the assembly
11936 code can be used with the "PREFIX" assembly directive.
11937
11938 -melf
11939 Generate an executable in the ELF format, rather than the default
11940 mmo format used by the mmix simulator.
11941
11942 -mbranch-predict
11943 -mno-branch-predict
11944 Use (do not use) the probable-branch instructions, when static
11945 branch prediction indicates a probable branch.
11946
11947 -mbase-addresses
11948 -mno-base-addresses
11949 Generate (do not generate) code that uses base addresses. Using a
11950 base address automatically generates a request (handled by the
11951 assembler and the linker) for a constant to be set up in a global
11952 register. The register is used for one or more base address
11953 requests within the range 0 to 255 from the value held in the
11954 register. The generally leads to short and fast code, but the
11955 number of different data items that can be addressed is limited.
11956 This means that a program that uses lots of static data may require
11957 -mno-base-addresses.
11958
11959 -msingle-exit
11960 -mno-single-exit
11961 Force (do not force) generated code to have a single exit point in
11962 each function.
11963
11964 MN10300 Options
11965
11966 These -m options are defined for Matsushita MN10300 architectures:
11967
11968 -mmult-bug
11969 Generate code to avoid bugs in the multiply instructions for the
11970 MN10300 processors. This is the default.
11971
11972 -mno-mult-bug
11973 Do not generate code to avoid bugs in the multiply instructions for
11974 the MN10300 processors.
11975
11976 -mam33
11977 Generate code which uses features specific to the AM33 processor.
11978
11979 -mno-am33
11980 Do not generate code which uses features specific to the AM33
11981 processor. This is the default.
11982
11983 -mreturn-pointer-on-d0
11984 When generating a function which returns a pointer, return the
11985 pointer in both "a0" and "d0". Otherwise, the pointer is returned
11986 only in a0, and attempts to call such functions without a prototype
11987 would result in errors. Note that this option is on by default;
11988 use -mno-return-pointer-on-d0 to disable it.
11989
11990 -mno-crt0
11991 Do not link in the C run-time initialization object file.
11992
11993 -mrelax
11994 Indicate to the linker that it should perform a relaxation
11995 optimization pass to shorten branches, calls and absolute memory
11996 addresses. This option only has an effect when used on the command
11997 line for the final link step.
11998
11999 This option makes symbolic debugging impossible.
12000
12001 PDP-11 Options
12002
12003 These options are defined for the PDP-11:
12004
12005 -mfpu
12006 Use hardware FPP floating point. This is the default. (FIS
12007 floating point on the PDP-11/40 is not supported.)
12008
12009 -msoft-float
12010 Do not use hardware floating point.
12011
12012 -mac0
12013 Return floating-point results in ac0 (fr0 in Unix assembler
12014 syntax).
12015
12016 -mno-ac0
12017 Return floating-point results in memory. This is the default.
12018
12019 -m40
12020 Generate code for a PDP-11/40.
12021
12022 -m45
12023 Generate code for a PDP-11/45. This is the default.
12024
12025 -m10
12026 Generate code for a PDP-11/10.
12027
12028 -mbcopy-builtin
12029 Use inline "movmemhi" patterns for copying memory. This is the
12030 default.
12031
12032 -mbcopy
12033 Do not use inline "movmemhi" patterns for copying memory.
12034
12035 -mint16
12036 -mno-int32
12037 Use 16-bit "int". This is the default.
12038
12039 -mint32
12040 -mno-int16
12041 Use 32-bit "int".
12042
12043 -mfloat64
12044 -mno-float32
12045 Use 64-bit "float". This is the default.
12046
12047 -mfloat32
12048 -mno-float64
12049 Use 32-bit "float".
12050
12051 -mabshi
12052 Use "abshi2" pattern. This is the default.
12053
12054 -mno-abshi
12055 Do not use "abshi2" pattern.
12056
12057 -mbranch-expensive
12058 Pretend that branches are expensive. This is for experimenting
12059 with code generation only.
12060
12061 -mbranch-cheap
12062 Do not pretend that branches are expensive. This is the default.
12063
12064 -msplit
12065 Generate code for a system with split I&D.
12066
12067 -mno-split
12068 Generate code for a system without split I&D. This is the default.
12069
12070 -munix-asm
12071 Use Unix assembler syntax. This is the default when configured for
12072 pdp11-*-bsd.
12073
12074 -mdec-asm
12075 Use DEC assembler syntax. This is the default when configured for
12076 any PDP-11 target other than pdp11-*-bsd.
12077
12078 picoChip Options
12079
12080 These -m options are defined for picoChip implementations:
12081
12082 -mae=ae_type
12083 Set the instruction set, register set, and instruction scheduling
12084 parameters for array element type ae_type. Supported values for
12085 ae_type are ANY, MUL, and MAC.
12086
12087 -mae=ANY selects a completely generic AE type. Code generated with
12088 this option will run on any of the other AE types. The code will
12089 not be as efficient as it would be if compiled for a specific AE
12090 type, and some types of operation (e.g., multiplication) will not
12091 work properly on all types of AE.
12092
12093 -mae=MUL selects a MUL AE type. This is the most useful AE type
12094 for compiled code, and is the default.
12095
12096 -mae=MAC selects a DSP-style MAC AE. Code compiled with this
12097 option may suffer from poor performance of byte (char)
12098 manipulation, since the DSP AE does not provide hardware support
12099 for byte load/stores.
12100
12101 -msymbol-as-address
12102 Enable the compiler to directly use a symbol name as an address in
12103 a load/store instruction, without first loading it into a register.
12104 Typically, the use of this option will generate larger programs,
12105 which run faster than when the option isn't used. However, the
12106 results vary from program to program, so it is left as a user
12107 option, rather than being permanently enabled.
12108
12109 -mno-inefficient-warnings
12110 Disables warnings about the generation of inefficient code. These
12111 warnings can be generated, for example, when compiling code which
12112 performs byte-level memory operations on the MAC AE type. The MAC
12113 AE has no hardware support for byte-level memory operations, so all
12114 byte load/stores must be synthesized from word load/store
12115 operations. This is inefficient and a warning will be generated
12116 indicating to the programmer that they should rewrite the code to
12117 avoid byte operations, or to target an AE type which has the
12118 necessary hardware support. This option enables the warning to be
12119 turned off.
12120
12121 PowerPC Options
12122
12123 These are listed under
12124
12125 IBM RS/6000 and PowerPC Options
12126
12127 These -m options are defined for the IBM RS/6000 and PowerPC:
12128
12129 -mpower
12130 -mno-power
12131 -mpower2
12132 -mno-power2
12133 -mpowerpc
12134 -mno-powerpc
12135 -mpowerpc-gpopt
12136 -mno-powerpc-gpopt
12137 -mpowerpc-gfxopt
12138 -mno-powerpc-gfxopt
12139 -mpowerpc64
12140 -mno-powerpc64
12141 -mmfcrf
12142 -mno-mfcrf
12143 -mpopcntb
12144 -mno-popcntb
12145 -mpopcntd
12146 -mno-popcntd
12147 -mfprnd
12148 -mno-fprnd
12149 -mcmpb
12150 -mno-cmpb
12151 -mmfpgpr
12152 -mno-mfpgpr
12153 -mhard-dfp
12154 -mno-hard-dfp
12155 GCC supports two related instruction set architectures for the
12156 RS/6000 and PowerPC. The POWER instruction set are those
12157 instructions supported by the rios chip set used in the original
12158 RS/6000 systems and the PowerPC instruction set is the architecture
12159 of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and the
12160 IBM 4xx, 6xx, and follow-on microprocessors.
12161
12162 Neither architecture is a subset of the other. However there is a
12163 large common subset of instructions supported by both. An MQ
12164 register is included in processors supporting the POWER
12165 architecture.
12166
12167 You use these options to specify which instructions are available
12168 on the processor you are using. The default value of these options
12169 is determined when configuring GCC. Specifying the -mcpu=cpu_type
12170 overrides the specification of these options. We recommend you use
12171 the -mcpu=cpu_type option rather than the options listed above.
12172
12173 The -mpower option allows GCC to generate instructions that are
12174 found only in the POWER architecture and to use the MQ register.
12175 Specifying -mpower2 implies -power and also allows GCC to generate
12176 instructions that are present in the POWER2 architecture but not
12177 the original POWER architecture.
12178
12179 The -mpowerpc option allows GCC to generate instructions that are
12180 found only in the 32-bit subset of the PowerPC architecture.
12181 Specifying -mpowerpc-gpopt implies -mpowerpc and also allows GCC to
12182 use the optional PowerPC architecture instructions in the General
12183 Purpose group, including floating-point square root. Specifying
12184 -mpowerpc-gfxopt implies -mpowerpc and also allows GCC to use the
12185 optional PowerPC architecture instructions in the Graphics group,
12186 including floating-point select.
12187
12188 The -mmfcrf option allows GCC to generate the move from condition
12189 register field instruction implemented on the POWER4 processor and
12190 other processors that support the PowerPC V2.01 architecture. The
12191 -mpopcntb option allows GCC to generate the popcount and double
12192 precision FP reciprocal estimate instruction implemented on the
12193 POWER5 processor and other processors that support the PowerPC
12194 V2.02 architecture. The -mpopcntd option allows GCC to generate
12195 the popcount instruction implemented on the POWER7 processor and
12196 other processors that support the PowerPC V2.06 architecture. The
12197 -mfprnd option allows GCC to generate the FP round to integer
12198 instructions implemented on the POWER5+ processor and other
12199 processors that support the PowerPC V2.03 architecture. The -mcmpb
12200 option allows GCC to generate the compare bytes instruction
12201 implemented on the POWER6 processor and other processors that
12202 support the PowerPC V2.05 architecture. The -mmfpgpr option allows
12203 GCC to generate the FP move to/from general purpose register
12204 instructions implemented on the POWER6X processor and other
12205 processors that support the extended PowerPC V2.05 architecture.
12206 The -mhard-dfp option allows GCC to generate the decimal floating
12207 point instructions implemented on some POWER processors.
12208
12209 The -mpowerpc64 option allows GCC to generate the additional 64-bit
12210 instructions that are found in the full PowerPC64 architecture and
12211 to treat GPRs as 64-bit, doubleword quantities. GCC defaults to
12212 -mno-powerpc64.
12213
12214 If you specify both -mno-power and -mno-powerpc, GCC will use only
12215 the instructions in the common subset of both architectures plus
12216 some special AIX common-mode calls, and will not use the MQ
12217 register. Specifying both -mpower and -mpowerpc permits GCC to use
12218 any instruction from either architecture and to allow use of the MQ
12219 register; specify this for the Motorola MPC601.
12220
12221 -mnew-mnemonics
12222 -mold-mnemonics
12223 Select which mnemonics to use in the generated assembler code.
12224 With -mnew-mnemonics, GCC uses the assembler mnemonics defined for
12225 the PowerPC architecture. With -mold-mnemonics it uses the
12226 assembler mnemonics defined for the POWER architecture.
12227 Instructions defined in only one architecture have only one
12228 mnemonic; GCC uses that mnemonic irrespective of which of these
12229 options is specified.
12230
12231 GCC defaults to the mnemonics appropriate for the architecture in
12232 use. Specifying -mcpu=cpu_type sometimes overrides the value of
12233 these option. Unless you are building a cross-compiler, you should
12234 normally not specify either -mnew-mnemonics or -mold-mnemonics, but
12235 should instead accept the default.
12236
12237 -mcpu=cpu_type
12238 Set architecture type, register usage, choice of mnemonics, and
12239 instruction scheduling parameters for machine type cpu_type.
12240 Supported values for cpu_type are 401, 403, 405, 405fp, 440, 440fp,
12241 464, 464fp, 476, 476fp, 505, 601, 602, 603, 603e, 604, 604e, 620,
12242 630, 740, 7400, 7450, 750, 801, 821, 823, 860, 970, 8540, a2,
12243 e300c2, e300c3, e500mc, e500mc64, ec603e, G3, G4, G5, power,
12244 power2, power3, power4, power5, power5+, power6, power6x, power7,
12245 common, powerpc, powerpc64, rios, rios1, rios2, rsc, and rs64.
12246
12247 -mcpu=common selects a completely generic processor. Code
12248 generated under this option will run on any POWER or PowerPC
12249 processor. GCC will use only the instructions in the common subset
12250 of both architectures, and will not use the MQ register. GCC
12251 assumes a generic processor model for scheduling purposes.
12252
12253 -mcpu=power, -mcpu=power2, -mcpu=powerpc, and -mcpu=powerpc64
12254 specify generic POWER, POWER2, pure 32-bit PowerPC (i.e., not
12255 MPC601), and 64-bit PowerPC architecture machine types, with an
12256 appropriate, generic processor model assumed for scheduling
12257 purposes.
12258
12259 The other options specify a specific processor. Code generated
12260 under those options will run best on that processor, and may not
12261 run at all on others.
12262
12263 The -mcpu options automatically enable or disable the following
12264 options:
12265
12266 -maltivec -mfprnd -mhard-float -mmfcrf -mmultiple
12267 -mnew-mnemonics -mpopcntb -mpopcntd -mpower -mpower2
12268 -mpowerpc64 -mpowerpc-gpopt -mpowerpc-gfxopt -msingle-float
12269 -mdouble-float -msimple-fpu -mstring -mmulhw -mdlmzb -mmfpgpr
12270 -mvsx
12271
12272 The particular options set for any particular CPU will vary between
12273 compiler versions, depending on what setting seems to produce
12274 optimal code for that CPU; it doesn't necessarily reflect the
12275 actual hardware's capabilities. If you wish to set an individual
12276 option to a particular value, you may specify it after the -mcpu
12277 option, like -mcpu=970 -mno-altivec.
12278
12279 On AIX, the -maltivec and -mpowerpc64 options are not enabled or
12280 disabled by the -mcpu option at present because AIX does not have
12281 full support for these options. You may still enable or disable
12282 them individually if you're sure it'll work in your environment.
12283
12284 -mtune=cpu_type
12285 Set the instruction scheduling parameters for machine type
12286 cpu_type, but do not set the architecture type, register usage, or
12287 choice of mnemonics, as -mcpu=cpu_type would. The same values for
12288 cpu_type are used for -mtune as for -mcpu. If both are specified,
12289 the code generated will use the architecture, registers, and
12290 mnemonics set by -mcpu, but the scheduling parameters set by
12291 -mtune.
12292
12293 -mswdiv
12294 -mno-swdiv
12295 Generate code to compute division as reciprocal estimate and
12296 iterative refinement, creating opportunities for increased
12297 throughput. This feature requires: optional PowerPC Graphics
12298 instruction set for single precision and FRE instruction for double
12299 precision, assuming divides cannot generate user-visible traps, and
12300 the domain values not include Infinities, denormals or zero
12301 denominator.
12302
12303 -maltivec
12304 -mno-altivec
12305 Generate code that uses (does not use) AltiVec instructions, and
12306 also enable the use of built-in functions that allow more direct
12307 access to the AltiVec instruction set. You may also need to set
12308 -mabi=altivec to adjust the current ABI with AltiVec ABI
12309 enhancements.
12310
12311 -mvrsave
12312 -mno-vrsave
12313 Generate VRSAVE instructions when generating AltiVec code.
12314
12315 -mgen-cell-microcode
12316 Generate Cell microcode instructions
12317
12318 -mwarn-cell-microcode
12319 Warning when a Cell microcode instruction is going to emitted. An
12320 example of a Cell microcode instruction is a variable shift.
12321
12322 -msecure-plt
12323 Generate code that allows ld and ld.so to build executables and
12324 shared libraries with non-exec .plt and .got sections. This is a
12325 PowerPC 32-bit SYSV ABI option.
12326
12327 -mbss-plt
12328 Generate code that uses a BSS .plt section that ld.so fills in, and
12329 requires .plt and .got sections that are both writable and
12330 executable. This is a PowerPC 32-bit SYSV ABI option.
12331
12332 -misel
12333 -mno-isel
12334 This switch enables or disables the generation of ISEL
12335 instructions.
12336
12337 -misel=yes/no
12338 This switch has been deprecated. Use -misel and -mno-isel instead.
12339
12340 -mspe
12341 -mno-spe
12342 This switch enables or disables the generation of SPE simd
12343 instructions.
12344
12345 -mpaired
12346 -mno-paired
12347 This switch enables or disables the generation of PAIRED simd
12348 instructions.
12349
12350 -mspe=yes/no
12351 This option has been deprecated. Use -mspe and -mno-spe instead.
12352
12353 -mvsx
12354 -mno-vsx
12355 Generate code that uses (does not use) vector/scalar (VSX)
12356 instructions, and also enable the use of built-in functions that
12357 allow more direct access to the VSX instruction set.
12358
12359 -mfloat-gprs=yes/single/double/no
12360 -mfloat-gprs
12361 This switch enables or disables the generation of floating point
12362 operations on the general purpose registers for architectures that
12363 support it.
12364
12365 The argument yes or single enables the use of single-precision
12366 floating point operations.
12367
12368 The argument double enables the use of single and double-precision
12369 floating point operations.
12370
12371 The argument no disables floating point operations on the general
12372 purpose registers.
12373
12374 This option is currently only available on the MPC854x.
12375
12376 -m32
12377 -m64
12378 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
12379 targets (including GNU/Linux). The 32-bit environment sets int,
12380 long and pointer to 32 bits and generates code that runs on any
12381 PowerPC variant. The 64-bit environment sets int to 32 bits and
12382 long and pointer to 64 bits, and generates code for PowerPC64, as
12383 for -mpowerpc64.
12384
12385 -mfull-toc
12386 -mno-fp-in-toc
12387 -mno-sum-in-toc
12388 -mminimal-toc
12389 Modify generation of the TOC (Table Of Contents), which is created
12390 for every executable file. The -mfull-toc option is selected by
12391 default. In that case, GCC will allocate at least one TOC entry
12392 for each unique non-automatic variable reference in your program.
12393 GCC will also place floating-point constants in the TOC. However,
12394 only 16,384 entries are available in the TOC.
12395
12396 If you receive a linker error message that saying you have
12397 overflowed the available TOC space, you can reduce the amount of
12398 TOC space used with the -mno-fp-in-toc and -mno-sum-in-toc options.
12399 -mno-fp-in-toc prevents GCC from putting floating-point constants
12400 in the TOC and -mno-sum-in-toc forces GCC to generate code to
12401 calculate the sum of an address and a constant at run-time instead
12402 of putting that sum into the TOC. You may specify one or both of
12403 these options. Each causes GCC to produce very slightly slower and
12404 larger code at the expense of conserving TOC space.
12405
12406 If you still run out of space in the TOC even when you specify both
12407 of these options, specify -mminimal-toc instead. This option
12408 causes GCC to make only one TOC entry for every file. When you
12409 specify this option, GCC will produce code that is slower and
12410 larger but which uses extremely little TOC space. You may wish to
12411 use this option only on files that contain less frequently executed
12412 code.
12413
12414 -maix64
12415 -maix32
12416 Enable 64-bit AIX ABI and calling convention: 64-bit pointers,
12417 64-bit "long" type, and the infrastructure needed to support them.
12418 Specifying -maix64 implies -mpowerpc64 and -mpowerpc, while -maix32
12419 disables the 64-bit ABI and implies -mno-powerpc64. GCC defaults
12420 to -maix32.
12421
12422 -mxl-compat
12423 -mno-xl-compat
12424 Produce code that conforms more closely to IBM XL compiler
12425 semantics when using AIX-compatible ABI. Pass floating-point
12426 arguments to prototyped functions beyond the register save area
12427 (RSA) on the stack in addition to argument FPRs. Do not assume
12428 that most significant double in 128-bit long double value is
12429 properly rounded when comparing values and converting to double.
12430 Use XL symbol names for long double support routines.
12431
12432 The AIX calling convention was extended but not initially
12433 documented to handle an obscure K&R C case of calling a function
12434 that takes the address of its arguments with fewer arguments than
12435 declared. IBM XL compilers access floating point arguments which
12436 do not fit in the RSA from the stack when a subroutine is compiled
12437 without optimization. Because always storing floating-point
12438 arguments on the stack is inefficient and rarely needed, this
12439 option is not enabled by default and only is necessary when calling
12440 subroutines compiled by IBM XL compilers without optimization.
12441
12442 -mpe
12443 Support IBM RS/6000 SP Parallel Environment (PE). Link an
12444 application written to use message passing with special startup
12445 code to enable the application to run. The system must have PE
12446 installed in the standard location (/usr/lpp/ppe.poe/), or the
12447 specs file must be overridden with the -specs= option to specify
12448 the appropriate directory location. The Parallel Environment does
12449 not support threads, so the -mpe option and the -pthread option are
12450 incompatible.
12451
12452 -malign-natural
12453 -malign-power
12454 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
12455 -malign-natural overrides the ABI-defined alignment of larger
12456 types, such as floating-point doubles, on their natural size-based
12457 boundary. The option -malign-power instructs GCC to follow the
12458 ABI-specified alignment rules. GCC defaults to the standard
12459 alignment defined in the ABI.
12460
12461 On 64-bit Darwin, natural alignment is the default, and
12462 -malign-power is not supported.
12463
12464 -msoft-float
12465 -mhard-float
12466 Generate code that does not use (uses) the floating-point register
12467 set. Software floating point emulation is provided if you use the
12468 -msoft-float option, and pass the option to GCC when linking.
12469
12470 -msingle-float
12471 -mdouble-float
12472 Generate code for single or double-precision floating point
12473 operations. -mdouble-float implies -msingle-float.
12474
12475 -msimple-fpu
12476 Do not generate sqrt and div instructions for hardware floating
12477 point unit.
12478
12479 -mfpu
12480 Specify type of floating point unit. Valid values are sp_lite
12481 (equivalent to -msingle-float -msimple-fpu), dp_lite (equivalent to
12482 -mdouble-float -msimple-fpu), sp_full (equivalent to
12483 -msingle-float), and dp_full (equivalent to -mdouble-float).
12484
12485 -mxilinx-fpu
12486 Perform optimizations for floating point unit on Xilinx PPC
12487 405/440.
12488
12489 -mmultiple
12490 -mno-multiple
12491 Generate code that uses (does not use) the load multiple word
12492 instructions and the store multiple word instructions. These
12493 instructions are generated by default on POWER systems, and not
12494 generated on PowerPC systems. Do not use -mmultiple on little
12495 endian PowerPC systems, since those instructions do not work when
12496 the processor is in little endian mode. The exceptions are PPC740
12497 and PPC750 which permit the instructions usage in little endian
12498 mode.
12499
12500 -mstring
12501 -mno-string
12502 Generate code that uses (does not use) the load string instructions
12503 and the store string word instructions to save multiple registers
12504 and do small block moves. These instructions are generated by
12505 default on POWER systems, and not generated on PowerPC systems. Do
12506 not use -mstring on little endian PowerPC systems, since those
12507 instructions do not work when the processor is in little endian
12508 mode. The exceptions are PPC740 and PPC750 which permit the
12509 instructions usage in little endian mode.
12510
12511 -mupdate
12512 -mno-update
12513 Generate code that uses (does not use) the load or store
12514 instructions that update the base register to the address of the
12515 calculated memory location. These instructions are generated by
12516 default. If you use -mno-update, there is a small window between
12517 the time that the stack pointer is updated and the address of the
12518 previous frame is stored, which means code that walks the stack
12519 frame across interrupts or signals may get corrupted data.
12520
12521 -mavoid-indexed-addresses
12522 -mno-avoid-indexed-addresses
12523 Generate code that tries to avoid (not avoid) the use of indexed
12524 load or store instructions. These instructions can incur a
12525 performance penalty on Power6 processors in certain situations,
12526 such as when stepping through large arrays that cross a 16M
12527 boundary. This option is enabled by default when targetting Power6
12528 and disabled otherwise.
12529
12530 -mfused-madd
12531 -mno-fused-madd
12532 Generate code that uses (does not use) the floating point multiply
12533 and accumulate instructions. These instructions are generated by
12534 default if hardware floating is used.
12535
12536 -mmulhw
12537 -mno-mulhw
12538 Generate code that uses (does not use) the half-word multiply and
12539 multiply-accumulate instructions on the IBM 405, 440, 464 and 476
12540 processors. These instructions are generated by default when
12541 targetting those processors.
12542
12543 -mdlmzb
12544 -mno-dlmzb
12545 Generate code that uses (does not use) the string-search dlmzb
12546 instruction on the IBM 405, 440, 464 and 476 processors. This
12547 instruction is generated by default when targetting those
12548 processors.
12549
12550 -mno-bit-align
12551 -mbit-align
12552 On System V.4 and embedded PowerPC systems do not (do) force
12553 structures and unions that contain bit-fields to be aligned to the
12554 base type of the bit-field.
12555
12556 For example, by default a structure containing nothing but 8
12557 "unsigned" bit-fields of length 1 would be aligned to a 4 byte
12558 boundary and have a size of 4 bytes. By using -mno-bit-align, the
12559 structure would be aligned to a 1 byte boundary and be one byte in
12560 size.
12561
12562 -mno-strict-align
12563 -mstrict-align
12564 On System V.4 and embedded PowerPC systems do not (do) assume that
12565 unaligned memory references will be handled by the system.
12566
12567 -mrelocatable
12568 -mno-relocatable
12569 On embedded PowerPC systems generate code that allows (does not
12570 allow) the program to be relocated to a different address at
12571 runtime. If you use -mrelocatable on any module, all objects
12572 linked together must be compiled with -mrelocatable or
12573 -mrelocatable-lib.
12574
12575 -mrelocatable-lib
12576 -mno-relocatable-lib
12577 On embedded PowerPC systems generate code that allows (does not
12578 allow) the program to be relocated to a different address at
12579 runtime. Modules compiled with -mrelocatable-lib can be linked
12580 with either modules compiled without -mrelocatable and
12581 -mrelocatable-lib or with modules compiled with the -mrelocatable
12582 options.
12583
12584 -mno-toc
12585 -mtoc
12586 On System V.4 and embedded PowerPC systems do not (do) assume that
12587 register 2 contains a pointer to a global area pointing to the
12588 addresses used in the program.
12589
12590 -mlittle
12591 -mlittle-endian
12592 On System V.4 and embedded PowerPC systems compile code for the
12593 processor in little endian mode. The -mlittle-endian option is the
12594 same as -mlittle.
12595
12596 -mbig
12597 -mbig-endian
12598 On System V.4 and embedded PowerPC systems compile code for the
12599 processor in big endian mode. The -mbig-endian option is the same
12600 as -mbig.
12601
12602 -mdynamic-no-pic
12603 On Darwin and Mac OS X systems, compile code so that it is not
12604 relocatable, but that its external references are relocatable. The
12605 resulting code is suitable for applications, but not shared
12606 libraries.
12607
12608 -mprioritize-restricted-insns=priority
12609 This option controls the priority that is assigned to dispatch-slot
12610 restricted instructions during the second scheduling pass. The
12611 argument priority takes the value 0/1/2 to assign
12612 no/highest/second-highest priority to dispatch slot restricted
12613 instructions.
12614
12615 -msched-costly-dep=dependence_type
12616 This option controls which dependences are considered costly by the
12617 target during instruction scheduling. The argument dependence_type
12618 takes one of the following values: no: no dependence is costly,
12619 all: all dependences are costly, true_store_to_load: a true
12620 dependence from store to load is costly, store_to_load: any
12621 dependence from store to load is costly, number: any dependence
12622 which latency >= number is costly.
12623
12624 -minsert-sched-nops=scheme
12625 This option controls which nop insertion scheme will be used during
12626 the second scheduling pass. The argument scheme takes one of the
12627 following values: no: Don't insert nops. pad: Pad with nops any
12628 dispatch group which has vacant issue slots, according to the
12629 scheduler's grouping. regroup_exact: Insert nops to force costly
12630 dependent insns into separate groups. Insert exactly as many nops
12631 as needed to force an insn to a new group, according to the
12632 estimated processor grouping. number: Insert nops to force costly
12633 dependent insns into separate groups. Insert number nops to force
12634 an insn to a new group.
12635
12636 -mcall-sysv
12637 On System V.4 and embedded PowerPC systems compile code using
12638 calling conventions that adheres to the March 1995 draft of the
12639 System V Application Binary Interface, PowerPC processor
12640 supplement. This is the default unless you configured GCC using
12641 powerpc-*-eabiaix.
12642
12643 -mcall-sysv-eabi
12644 -mcall-eabi
12645 Specify both -mcall-sysv and -meabi options.
12646
12647 -mcall-sysv-noeabi
12648 Specify both -mcall-sysv and -mno-eabi options.
12649
12650 -mcall-aixdesc
12651 On System V.4 and embedded PowerPC systems compile code for the AIX
12652 operating system.
12653
12654 -mcall-linux
12655 On System V.4 and embedded PowerPC systems compile code for the
12656 Linux-based GNU system.
12657
12658 -mcall-gnu
12659 On System V.4 and embedded PowerPC systems compile code for the
12660 Hurd-based GNU system.
12661
12662 -mcall-freebsd
12663 On System V.4 and embedded PowerPC systems compile code for the
12664 FreeBSD operating system.
12665
12666 -mcall-netbsd
12667 On System V.4 and embedded PowerPC systems compile code for the
12668 NetBSD operating system.
12669
12670 -mcall-openbsd
12671 On System V.4 and embedded PowerPC systems compile code for the
12672 OpenBSD operating system.
12673
12674 -maix-struct-return
12675 Return all structures in memory (as specified by the AIX ABI).
12676
12677 -msvr4-struct-return
12678 Return structures smaller than 8 bytes in registers (as specified
12679 by the SVR4 ABI).
12680
12681 -mabi=abi-type
12682 Extend the current ABI with a particular extension, or remove such
12683 extension. Valid values are altivec, no-altivec, spe, no-spe,
12684 ibmlongdouble, ieeelongdouble.
12685
12686 -mabi=spe
12687 Extend the current ABI with SPE ABI extensions. This does not
12688 change the default ABI, instead it adds the SPE ABI extensions to
12689 the current ABI.
12690
12691 -mabi=no-spe
12692 Disable Booke SPE ABI extensions for the current ABI.
12693
12694 -mabi=ibmlongdouble
12695 Change the current ABI to use IBM extended precision long double.
12696 This is a PowerPC 32-bit SYSV ABI option.
12697
12698 -mabi=ieeelongdouble
12699 Change the current ABI to use IEEE extended precision long double.
12700 This is a PowerPC 32-bit Linux ABI option.
12701
12702 -mprototype
12703 -mno-prototype
12704 On System V.4 and embedded PowerPC systems assume that all calls to
12705 variable argument functions are properly prototyped. Otherwise,
12706 the compiler must insert an instruction before every non prototyped
12707 call to set or clear bit 6 of the condition code register (CR) to
12708 indicate whether floating point values were passed in the floating
12709 point registers in case the function takes a variable arguments.
12710 With -mprototype, only calls to prototyped variable argument
12711 functions will set or clear the bit.
12712
12713 -msim
12714 On embedded PowerPC systems, assume that the startup module is
12715 called sim-crt0.o and that the standard C libraries are libsim.a
12716 and libc.a. This is the default for powerpc-*-eabisim
12717 configurations.
12718
12719 -mmvme
12720 On embedded PowerPC systems, assume that the startup module is
12721 called crt0.o and the standard C libraries are libmvme.a and
12722 libc.a.
12723
12724 -mads
12725 On embedded PowerPC systems, assume that the startup module is
12726 called crt0.o and the standard C libraries are libads.a and libc.a.
12727
12728 -myellowknife
12729 On embedded PowerPC systems, assume that the startup module is
12730 called crt0.o and the standard C libraries are libyk.a and libc.a.
12731
12732 -mvxworks
12733 On System V.4 and embedded PowerPC systems, specify that you are
12734 compiling for a VxWorks system.
12735
12736 -memb
12737 On embedded PowerPC systems, set the PPC_EMB bit in the ELF flags
12738 header to indicate that eabi extended relocations are used.
12739
12740 -meabi
12741 -mno-eabi
12742 On System V.4 and embedded PowerPC systems do (do not) adhere to
12743 the Embedded Applications Binary Interface (eabi) which is a set of
12744 modifications to the System V.4 specifications. Selecting -meabi
12745 means that the stack is aligned to an 8 byte boundary, a function
12746 "__eabi" is called to from "main" to set up the eabi environment,
12747 and the -msdata option can use both "r2" and "r13" to point to two
12748 separate small data areas. Selecting -mno-eabi means that the
12749 stack is aligned to a 16 byte boundary, do not call an
12750 initialization function from "main", and the -msdata option will
12751 only use "r13" to point to a single small data area. The -meabi
12752 option is on by default if you configured GCC using one of the
12753 powerpc*-*-eabi* options.
12754
12755 -msdata=eabi
12756 On System V.4 and embedded PowerPC systems, put small initialized
12757 "const" global and static data in the .sdata2 section, which is
12758 pointed to by register "r2". Put small initialized non-"const"
12759 global and static data in the .sdata section, which is pointed to
12760 by register "r13". Put small uninitialized global and static data
12761 in the .sbss section, which is adjacent to the .sdata section. The
12762 -msdata=eabi option is incompatible with the -mrelocatable option.
12763 The -msdata=eabi option also sets the -memb option.
12764
12765 -msdata=sysv
12766 On System V.4 and embedded PowerPC systems, put small global and
12767 static data in the .sdata section, which is pointed to by register
12768 "r13". Put small uninitialized global and static data in the .sbss
12769 section, which is adjacent to the .sdata section. The -msdata=sysv
12770 option is incompatible with the -mrelocatable option.
12771
12772 -msdata=default
12773 -msdata
12774 On System V.4 and embedded PowerPC systems, if -meabi is used,
12775 compile code the same as -msdata=eabi, otherwise compile code the
12776 same as -msdata=sysv.
12777
12778 -msdata=data
12779 On System V.4 and embedded PowerPC systems, put small global data
12780 in the .sdata section. Put small uninitialized global data in the
12781 .sbss section. Do not use register "r13" to address small data
12782 however. This is the default behavior unless other -msdata options
12783 are used.
12784
12785 -msdata=none
12786 -mno-sdata
12787 On embedded PowerPC systems, put all initialized global and static
12788 data in the .data section, and all uninitialized data in the .bss
12789 section.
12790
12791 -G num
12792 On embedded PowerPC systems, put global and static items less than
12793 or equal to num bytes into the small data or bss sections instead
12794 of the normal data or bss section. By default, num is 8. The -G
12795 num switch is also passed to the linker. All modules should be
12796 compiled with the same -G num value.
12797
12798 -mregnames
12799 -mno-regnames
12800 On System V.4 and embedded PowerPC systems do (do not) emit
12801 register names in the assembly language output using symbolic
12802 forms.
12803
12804 -mlongcall
12805 -mno-longcall
12806 By default assume that all calls are far away so that a longer more
12807 expensive calling sequence is required. This is required for calls
12808 further than 32 megabytes (33,554,432 bytes) from the current
12809 location. A short call will be generated if the compiler knows the
12810 call cannot be that far away. This setting can be overridden by
12811 the "shortcall" function attribute, or by "#pragma longcall(0)".
12812
12813 Some linkers are capable of detecting out-of-range calls and
12814 generating glue code on the fly. On these systems, long calls are
12815 unnecessary and generate slower code. As of this writing, the AIX
12816 linker can do this, as can the GNU linker for PowerPC/64. It is
12817 planned to add this feature to the GNU linker for 32-bit PowerPC
12818 systems as well.
12819
12820 On Darwin/PPC systems, "#pragma longcall" will generate "jbsr
12821 callee, L42", plus a "branch island" (glue code). The two target
12822 addresses represent the callee and the "branch island". The
12823 Darwin/PPC linker will prefer the first address and generate a "bl
12824 callee" if the PPC "bl" instruction will reach the callee directly;
12825 otherwise, the linker will generate "bl L42" to call the "branch
12826 island". The "branch island" is appended to the body of the
12827 calling function; it computes the full 32-bit address of the callee
12828 and jumps to it.
12829
12830 On Mach-O (Darwin) systems, this option directs the compiler emit
12831 to the glue for every direct call, and the Darwin linker decides
12832 whether to use or discard it.
12833
12834 In the future, we may cause GCC to ignore all longcall
12835 specifications when the linker is known to generate glue.
12836
12837 -mtls-markers
12838 -mno-tls-markers
12839 Mark (do not mark) calls to "__tls_get_addr" with a relocation
12840 specifying the function argument. The relocation allows ld to
12841 reliably associate function call with argument setup instructions
12842 for TLS optimization, which in turn allows gcc to better schedule
12843 the sequence.
12844
12845 -pthread
12846 Adds support for multithreading with the pthreads library. This
12847 option sets flags for both the preprocessor and linker.
12848
12849 RX Options
12850
12851 These command line options are defined for RX targets:
12852
12853 -m64bit-doubles
12854 -m32bit-doubles
12855 Make the "double" data type be 64-bits (-m64bit-doubles) or 32-bits
12856 (-m32bit-doubles) in size. The default is -m32bit-doubles. Note
12857 RX floating point hardware only works on 32-bit values, which is
12858 why the default is -m32bit-doubles.
12859
12860 -fpu
12861 -nofpu
12862 Enables (-fpu) or disables (-nofpu) the use of RX floating point
12863 hardware. The default is enabled for the RX600 series and disabled
12864 for the RX200 series.
12865
12866 Floating point instructions will only be generated for 32-bit
12867 floating point values however, so if the -m64bit-doubles option is
12868 in use then the FPU hardware will not be used for doubles.
12869
12870 Note If the -fpu option is enabled then -funsafe-math-optimizations
12871 is also enabled automatically. This is because the RX FPU
12872 instructions are themselves unsafe.
12873
12874 -mcpu=name
12875 -patch=name
12876 Selects the type of RX CPU to be targeted. Currently three types
12877 are supported, the generic RX600 and RX200 series hardware and the
12878 specific RX610 cpu. The default is RX600.
12879
12880 The only difference between RX600 and RX610 is that the RX610 does
12881 not support the "MVTIPL" instruction.
12882
12883 The RX200 series does not have a hardware floating point unit and
12884 so -nofpu is enabled by default when this type is selected.
12885
12886 -mbig-endian-data
12887 -mlittle-endian-data
12888 Store data (but not code) in the big-endian format. The default is
12889 -mlittle-endian-data, ie to store data in the little endian format.
12890
12891 -msmall-data-limit=N
12892 Specifies the maximum size in bytes of global and static variables
12893 which can be placed into the small data area. Using the small data
12894 area can lead to smaller and faster code, but the size of area is
12895 limited and it is up to the programmer to ensure that the area does
12896 not overflow. Also when the small data area is used one of the
12897 RX's registers ("r13") is reserved for use pointing to this area,
12898 so it is no longer available for use by the compiler. This could
12899 result in slower and/or larger code if variables which once could
12900 have been held in "r13" are now pushed onto the stack.
12901
12902 Note, common variables (variables which have not been initialised)
12903 and constants are not placed into the small data area as they are
12904 assigned to other sections in the output executable.
12905
12906 The default value is zero, which disables this feature. Note, this
12907 feature is not enabled by default with higher optimization levels
12908 (-O2 etc) because of the potentially detrimental effects of
12909 reserving register "r13". It is up to the programmer to experiment
12910 and discover whether this feature is of benefit to their program.
12911
12912 -msim
12913 -mno-sim
12914 Use the simulator runtime. The default is to use the libgloss
12915 board specific runtime.
12916
12917 -mas100-syntax
12918 -mno-as100-syntax
12919 When generating assembler output use a syntax that is compatible
12920 with Renesas's AS100 assembler. This syntax can also be handled by
12921 the GAS assembler but it has some restrictions so generating it is
12922 not the default option.
12923
12924 -mmax-constant-size=N
12925 Specifies the maximum size, in bytes, of a constant that can be
12926 used as an operand in a RX instruction. Although the RX
12927 instruction set does allow constants of up to 4 bytes in length to
12928 be used in instructions, a longer value equates to a longer
12929 instruction. Thus in some circumstances it can be beneficial to
12930 restrict the size of constants that are used in instructions.
12931 Constants that are too big are instead placed into a constant pool
12932 and referenced via register indirection.
12933
12934 The value N can be between 0 and 4. A value of 0 (the default) or
12935 4 means that constants of any size are allowed.
12936
12937 -mrelax
12938 Enable linker relaxation. Linker relaxation is a process whereby
12939 the linker will attempt to reduce the size of a program by finding
12940 shorter versions of various instructions. Disabled by default.
12941
12942 -mint-register=N
12943 Specify the number of registers to reserve for fast interrupt
12944 handler functions. The value N can be between 0 and 4. A value of
12945 1 means that register "r13" will be reserved for the exclusive use
12946 of fast interrupt handlers. A value of 2 reserves "r13" and "r12".
12947 A value of 3 reserves "r13", "r12" and "r11", and a value of 4
12948 reserves "r13" through "r10". A value of 0, the default, does not
12949 reserve any registers.
12950
12951 -msave-acc-in-interrupts
12952 Specifies that interrupt handler functions should preserve the
12953 accumulator register. This is only necessary if normal code might
12954 use the accumulator register, for example because it performs
12955 64-bit multiplications. The default is to ignore the accumulator
12956 as this makes the interrupt handlers faster.
12957
12958 Note: The generic GCC command line -ffixed-reg has special significance
12959 to the RX port when used with the "interrupt" function attribute. This
12960 attribute indicates a function intended to process fast interrupts.
12961 GCC will will ensure that it only uses the registers "r10", "r11",
12962 "r12" and/or "r13" and only provided that the normal use of the
12963 corresponding registers have been restricted via the -ffixed-reg or
12964 -mint-register command line options.
12965
12966 S/390 and zSeries Options
12967
12968 These are the -m options defined for the S/390 and zSeries
12969 architecture.
12970
12971 -mhard-float
12972 -msoft-float
12973 Use (do not use) the hardware floating-point instructions and
12974 registers for floating-point operations. When -msoft-float is
12975 specified, functions in libgcc.a will be used to perform floating-
12976 point operations. When -mhard-float is specified, the compiler
12977 generates IEEE floating-point instructions. This is the default.
12978
12979 -mhard-dfp
12980 -mno-hard-dfp
12981 Use (do not use) the hardware decimal-floating-point instructions
12982 for decimal-floating-point operations. When -mno-hard-dfp is
12983 specified, functions in libgcc.a will be used to perform decimal-
12984 floating-point operations. When -mhard-dfp is specified, the
12985 compiler generates decimal-floating-point hardware instructions.
12986 This is the default for -march=z9-ec or higher.
12987
12988 -mlong-double-64
12989 -mlong-double-128
12990 These switches control the size of "long double" type. A size of
12991 64bit makes the "long double" type equivalent to the "double" type.
12992 This is the default.
12993
12994 -mbackchain
12995 -mno-backchain
12996 Store (do not store) the address of the caller's frame as backchain
12997 pointer into the callee's stack frame. A backchain may be needed
12998 to allow debugging using tools that do not understand DWARF-2 call
12999 frame information. When -mno-packed-stack is in effect, the
13000 backchain pointer is stored at the bottom of the stack frame; when
13001 -mpacked-stack is in effect, the backchain is placed into the
13002 topmost word of the 96/160 byte register save area.
13003
13004 In general, code compiled with -mbackchain is call-compatible with
13005 code compiled with -mmo-backchain; however, use of the backchain
13006 for debugging purposes usually requires that the whole binary is
13007 built with -mbackchain. Note that the combination of -mbackchain,
13008 -mpacked-stack and -mhard-float is not supported. In order to
13009 build a linux kernel use -msoft-float.
13010
13011 The default is to not maintain the backchain.
13012
13013 -mpacked-stack
13014 -mno-packed-stack
13015 Use (do not use) the packed stack layout. When -mno-packed-stack
13016 is specified, the compiler uses the all fields of the 96/160 byte
13017 register save area only for their default purpose; unused fields
13018 still take up stack space. When -mpacked-stack is specified,
13019 register save slots are densely packed at the top of the register
13020 save area; unused space is reused for other purposes, allowing for
13021 more efficient use of the available stack space. However, when
13022 -mbackchain is also in effect, the topmost word of the save area is
13023 always used to store the backchain, and the return address register
13024 is always saved two words below the backchain.
13025
13026 As long as the stack frame backchain is not used, code generated
13027 with -mpacked-stack is call-compatible with code generated with
13028 -mno-packed-stack. Note that some non-FSF releases of GCC 2.95 for
13029 S/390 or zSeries generated code that uses the stack frame backchain
13030 at run time, not just for debugging purposes. Such code is not
13031 call-compatible with code compiled with -mpacked-stack. Also, note
13032 that the combination of -mbackchain, -mpacked-stack and
13033 -mhard-float is not supported. In order to build a linux kernel
13034 use -msoft-float.
13035
13036 The default is to not use the packed stack layout.
13037
13038 -msmall-exec
13039 -mno-small-exec
13040 Generate (or do not generate) code using the "bras" instruction to
13041 do subroutine calls. This only works reliably if the total
13042 executable size does not exceed 64k. The default is to use the
13043 "basr" instruction instead, which does not have this limitation.
13044
13045 -m64
13046 -m31
13047 When -m31 is specified, generate code compliant to the GNU/Linux
13048 for S/390 ABI. When -m64 is specified, generate code compliant to
13049 the GNU/Linux for zSeries ABI. This allows GCC in particular to
13050 generate 64-bit instructions. For the s390 targets, the default is
13051 -m31, while the s390x targets default to -m64.
13052
13053 -mzarch
13054 -mesa
13055 When -mzarch is specified, generate code using the instructions
13056 available on z/Architecture. When -mesa is specified, generate
13057 code using the instructions available on ESA/390. Note that -mesa
13058 is not possible with -m64. When generating code compliant to the
13059 GNU/Linux for S/390 ABI, the default is -mesa. When generating
13060 code compliant to the GNU/Linux for zSeries ABI, the default is
13061 -mzarch.
13062
13063 -mmvcle
13064 -mno-mvcle
13065 Generate (or do not generate) code using the "mvcle" instruction to
13066 perform block moves. When -mno-mvcle is specified, use a "mvc"
13067 loop instead. This is the default unless optimizing for size.
13068
13069 -mdebug
13070 -mno-debug
13071 Print (or do not print) additional debug information when
13072 compiling. The default is to not print debug information.
13073
13074 -march=cpu-type
13075 Generate code that will run on cpu-type, which is the name of a
13076 system representing a certain processor type. Possible values for
13077 cpu-type are g5, g6, z900, z990, z9-109, z9-ec and z10. When
13078 generating code using the instructions available on z/Architecture,
13079 the default is -march=z900. Otherwise, the default is -march=g5.
13080
13081 -mtune=cpu-type
13082 Tune to cpu-type everything applicable about the generated code,
13083 except for the ABI and the set of available instructions. The list
13084 of cpu-type values is the same as for -march. The default is the
13085 value used for -march.
13086
13087 -mtpf-trace
13088 -mno-tpf-trace
13089 Generate code that adds (does not add) in TPF OS specific branches
13090 to trace routines in the operating system. This option is off by
13091 default, even when compiling for the TPF OS.
13092
13093 -mfused-madd
13094 -mno-fused-madd
13095 Generate code that uses (does not use) the floating point multiply
13096 and accumulate instructions. These instructions are generated by
13097 default if hardware floating point is used.
13098
13099 -mwarn-framesize=framesize
13100 Emit a warning if the current function exceeds the given frame
13101 size. Because this is a compile time check it doesn't need to be a
13102 real problem when the program runs. It is intended to identify
13103 functions which most probably cause a stack overflow. It is useful
13104 to be used in an environment with limited stack size e.g. the linux
13105 kernel.
13106
13107 -mwarn-dynamicstack
13108 Emit a warning if the function calls alloca or uses dynamically
13109 sized arrays. This is generally a bad idea with a limited stack
13110 size.
13111
13112 -mstack-guard=stack-guard
13113 -mstack-size=stack-size
13114 If these options are provided the s390 back end emits additional
13115 instructions in the function prologue which trigger a trap if the
13116 stack size is stack-guard bytes above the stack-size (remember that
13117 the stack on s390 grows downward). If the stack-guard option is
13118 omitted the smallest power of 2 larger than the frame size of the
13119 compiled function is chosen. These options are intended to be used
13120 to help debugging stack overflow problems. The additionally
13121 emitted code causes only little overhead and hence can also be used
13122 in production like systems without greater performance degradation.
13123 The given values have to be exact powers of 2 and stack-size has to
13124 be greater than stack-guard without exceeding 64k. In order to be
13125 efficient the extra code makes the assumption that the stack starts
13126 at an address aligned to the value given by stack-size. The stack-
13127 guard option can only be used in conjunction with stack-size.
13128
13129 Score Options
13130
13131 These options are defined for Score implementations:
13132
13133 -meb
13134 Compile code for big endian mode. This is the default.
13135
13136 -mel
13137 Compile code for little endian mode.
13138
13139 -mnhwloop
13140 Disable generate bcnz instruction.
13141
13142 -muls
13143 Enable generate unaligned load and store instruction.
13144
13145 -mmac
13146 Enable the use of multiply-accumulate instructions. Disabled by
13147 default.
13148
13149 -mscore5
13150 Specify the SCORE5 as the target architecture.
13151
13152 -mscore5u
13153 Specify the SCORE5U of the target architecture.
13154
13155 -mscore7
13156 Specify the SCORE7 as the target architecture. This is the default.
13157
13158 -mscore7d
13159 Specify the SCORE7D as the target architecture.
13160
13161 SH Options
13162
13163 These -m options are defined for the SH implementations:
13164
13165 -m1 Generate code for the SH1.
13166
13167 -m2 Generate code for the SH2.
13168
13169 -m2e
13170 Generate code for the SH2e.
13171
13172 -m2a-nofpu
13173 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a
13174 way that the floating-point unit is not used.
13175
13176 -m2a-single-only
13177 Generate code for the SH2a-FPU, in such a way that no double-
13178 precision floating point operations are used.
13179
13180 -m2a-single
13181 Generate code for the SH2a-FPU assuming the floating-point unit is
13182 in single-precision mode by default.
13183
13184 -m2a
13185 Generate code for the SH2a-FPU assuming the floating-point unit is
13186 in double-precision mode by default.
13187
13188 -m3 Generate code for the SH3.
13189
13190 -m3e
13191 Generate code for the SH3e.
13192
13193 -m4-nofpu
13194 Generate code for the SH4 without a floating-point unit.
13195
13196 -m4-single-only
13197 Generate code for the SH4 with a floating-point unit that only
13198 supports single-precision arithmetic.
13199
13200 -m4-single
13201 Generate code for the SH4 assuming the floating-point unit is in
13202 single-precision mode by default.
13203
13204 -m4 Generate code for the SH4.
13205
13206 -m4a-nofpu
13207 Generate code for the SH4al-dsp, or for a SH4a in such a way that
13208 the floating-point unit is not used.
13209
13210 -m4a-single-only
13211 Generate code for the SH4a, in such a way that no double-precision
13212 floating point operations are used.
13213
13214 -m4a-single
13215 Generate code for the SH4a assuming the floating-point unit is in
13216 single-precision mode by default.
13217
13218 -m4a
13219 Generate code for the SH4a.
13220
13221 -m4al
13222 Same as -m4a-nofpu, except that it implicitly passes -dsp to the
13223 assembler. GCC doesn't generate any DSP instructions at the
13224 moment.
13225
13226 -mb Compile code for the processor in big endian mode.
13227
13228 -ml Compile code for the processor in little endian mode.
13229
13230 -mdalign
13231 Align doubles at 64-bit boundaries. Note that this changes the
13232 calling conventions, and thus some functions from the standard C
13233 library will not work unless you recompile it first with -mdalign.
13234
13235 -mrelax
13236 Shorten some address references at link time, when possible; uses
13237 the linker option -relax.
13238
13239 -mbigtable
13240 Use 32-bit offsets in "switch" tables. The default is to use
13241 16-bit offsets.
13242
13243 -mbitops
13244 Enable the use of bit manipulation instructions on SH2A.
13245
13246 -mfmovd
13247 Enable the use of the instruction "fmovd". Check -mdalign for
13248 alignment constraints.
13249
13250 -mhitachi
13251 Comply with the calling conventions defined by Renesas.
13252
13253 -mrenesas
13254 Comply with the calling conventions defined by Renesas.
13255
13256 -mno-renesas
13257 Comply with the calling conventions defined for GCC before the
13258 Renesas conventions were available. This option is the default for
13259 all targets of the SH toolchain except for sh-symbianelf.
13260
13261 -mnomacsave
13262 Mark the "MAC" register as call-clobbered, even if -mhitachi is
13263 given.
13264
13265 -mieee
13266 Increase IEEE-compliance of floating-point code. At the moment,
13267 this is equivalent to -fno-finite-math-only. When generating 16
13268 bit SH opcodes, getting IEEE-conforming results for comparisons of
13269 NANs / infinities incurs extra overhead in every floating point
13270 comparison, therefore the default is set to -ffinite-math-only.
13271
13272 -minline-ic_invalidate
13273 Inline code to invalidate instruction cache entries after setting
13274 up nested function trampolines. This option has no effect if
13275 -musermode is in effect and the selected code generation option
13276 (e.g. -m4) does not allow the use of the icbi instruction. If the
13277 selected code generation option does not allow the use of the icbi
13278 instruction, and -musermode is not in effect, the inlined code will
13279 manipulate the instruction cache address array directly with an
13280 associative write. This not only requires privileged mode, but it
13281 will also fail if the cache line had been mapped via the TLB and
13282 has become unmapped.
13283
13284 -misize
13285 Dump instruction size and location in the assembly code.
13286
13287 -mpadstruct
13288 This option is deprecated. It pads structures to multiple of 4
13289 bytes, which is incompatible with the SH ABI.
13290
13291 -mspace
13292 Optimize for space instead of speed. Implied by -Os.
13293
13294 -mprefergot
13295 When generating position-independent code, emit function calls
13296 using the Global Offset Table instead of the Procedure Linkage
13297 Table.
13298
13299 -musermode
13300 Don't generate privileged mode only code; implies
13301 -mno-inline-ic_invalidate if the inlined code would not work in
13302 user mode. This is the default when the target is "sh-*-linux*".
13303
13304 -multcost=number
13305 Set the cost to assume for a multiply insn.
13306
13307 -mdiv=strategy
13308 Set the division strategy to use for SHmedia code. strategy must
13309 be one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l,
13310 inv:call, inv:call2, inv:fp . "fp" performs the operation in
13311 floating point. This has a very high latency, but needs only a few
13312 instructions, so it might be a good choice if your code has enough
13313 easily exploitable ILP to allow the compiler to schedule the
13314 floating point instructions together with other instructions.
13315 Division by zero causes a floating point exception. "inv" uses
13316 integer operations to calculate the inverse of the divisor, and
13317 then multiplies the dividend with the inverse. This strategy
13318 allows cse and hoisting of the inverse calculation. Division by
13319 zero calculates an unspecified result, but does not trap.
13320 "inv:minlat" is a variant of "inv" where if no cse / hoisting
13321 opportunities have been found, or if the entire operation has been
13322 hoisted to the same place, the last stages of the inverse
13323 calculation are intertwined with the final multiply to reduce the
13324 overall latency, at the expense of using a few more instructions,
13325 and thus offering fewer scheduling opportunities with other code.
13326 "call" calls a library function that usually implements the
13327 inv:minlat strategy. This gives high code density for
13328 m5-*media-nofpu compilations. "call2" uses a different entry point
13329 of the same library function, where it assumes that a pointer to a
13330 lookup table has already been set up, which exposes the pointer
13331 load to cse / code hoisting optimizations. "inv:call", "inv:call2"
13332 and "inv:fp" all use the "inv" algorithm for initial code
13333 generation, but if the code stays unoptimized, revert to the
13334 "call", "call2", or "fp" strategies, respectively. Note that the
13335 potentially-trapping side effect of division by zero is carried by
13336 a separate instruction, so it is possible that all the integer
13337 instructions are hoisted out, but the marker for the side effect
13338 stays where it is. A recombination to fp operations or a call is
13339 not possible in that case. "inv20u" and "inv20l" are variants of
13340 the "inv:minlat" strategy. In the case that the inverse
13341 calculation was nor separated from the multiply, they speed up
13342 division where the dividend fits into 20 bits (plus sign where
13343 applicable), by inserting a test to skip a number of operations in
13344 this case; this test slows down the case of larger dividends.
13345 inv20u assumes the case of a such a small dividend to be unlikely,
13346 and inv20l assumes it to be likely.
13347
13348 -mdivsi3_libfunc=name
13349 Set the name of the library function used for 32 bit signed
13350 division to name. This only affect the name used in the call and
13351 inv:call division strategies, and the compiler will still expect
13352 the same sets of input/output/clobbered registers as if this option
13353 was not present.
13354
13355 -mfixed-range=register-range
13356 Generate code treating the given register range as fixed registers.
13357 A fixed register is one that the register allocator can not use.
13358 This is useful when compiling kernel code. A register range is
13359 specified as two registers separated by a dash. Multiple register
13360 ranges can be specified separated by a comma.
13361
13362 -madjust-unroll
13363 Throttle unrolling to avoid thrashing target registers. This
13364 option only has an effect if the gcc code base supports the
13365 TARGET_ADJUST_UNROLL_MAX target hook.
13366
13367 -mindexed-addressing
13368 Enable the use of the indexed addressing mode for
13369 SHmedia32/SHcompact. This is only safe if the hardware and/or OS
13370 implement 32 bit wrap-around semantics for the indexed addressing
13371 mode. The architecture allows the implementation of processors
13372 with 64 bit MMU, which the OS could use to get 32 bit addressing,
13373 but since no current hardware implementation supports this or any
13374 other way to make the indexed addressing mode safe to use in the 32
13375 bit ABI, the default is -mno-indexed-addressing.
13376
13377 -mgettrcost=number
13378 Set the cost assumed for the gettr instruction to number. The
13379 default is 2 if -mpt-fixed is in effect, 100 otherwise.
13380
13381 -mpt-fixed
13382 Assume pt* instructions won't trap. This will generally generate
13383 better scheduled code, but is unsafe on current hardware. The
13384 current architecture definition says that ptabs and ptrel trap when
13385 the target anded with 3 is 3. This has the unintentional effect of
13386 making it unsafe to schedule ptabs / ptrel before a branch, or
13387 hoist it out of a loop. For example, __do_global_ctors, a part of
13388 libgcc that runs constructors at program startup, calls functions
13389 in a list which is delimited by -1. With the -mpt-fixed option,
13390 the ptabs will be done before testing against -1. That means that
13391 all the constructors will be run a bit quicker, but when the loop
13392 comes to the end of the list, the program crashes because ptabs
13393 loads -1 into a target register. Since this option is unsafe for
13394 any hardware implementing the current architecture specification,
13395 the default is -mno-pt-fixed. Unless the user specifies a specific
13396 cost with -mgettrcost, -mno-pt-fixed also implies -mgettrcost=100;
13397 this deters register allocation using target registers for storing
13398 ordinary integers.
13399
13400 -minvalid-symbols
13401 Assume symbols might be invalid. Ordinary function symbols
13402 generated by the compiler will always be valid to load with
13403 movi/shori/ptabs or movi/shori/ptrel, but with assembler and/or
13404 linker tricks it is possible to generate symbols that will cause
13405 ptabs / ptrel to trap. This option is only meaningful when
13406 -mno-pt-fixed is in effect. It will then prevent cross-basic-block
13407 cse, hoisting and most scheduling of symbol loads. The default is
13408 -mno-invalid-symbols.
13409
13410 SPARC Options
13411
13412 These -m options are supported on the SPARC:
13413
13414 -mno-app-regs
13415 -mapp-regs
13416 Specify -mapp-regs to generate output using the global registers 2
13417 through 4, which the SPARC SVR4 ABI reserves for applications.
13418 This is the default.
13419
13420 To be fully SVR4 ABI compliant at the cost of some performance
13421 loss, specify -mno-app-regs. You should compile libraries and
13422 system software with this option.
13423
13424 -mfpu
13425 -mhard-float
13426 Generate output containing floating point instructions. This is
13427 the default.
13428
13429 -mno-fpu
13430 -msoft-float
13431 Generate output containing library calls for floating point.
13432 Warning: the requisite libraries are not available for all SPARC
13433 targets. Normally the facilities of the machine's usual C compiler
13434 are used, but this cannot be done directly in cross-compilation.
13435 You must make your own arrangements to provide suitable library
13436 functions for cross-compilation. The embedded targets sparc-*-aout
13437 and sparclite-*-* do provide software floating point support.
13438
13439 -msoft-float changes the calling convention in the output file;
13440 therefore, it is only useful if you compile all of a program with
13441 this option. In particular, you need to compile libgcc.a, the
13442 library that comes with GCC, with -msoft-float in order for this to
13443 work.
13444
13445 -mhard-quad-float
13446 Generate output containing quad-word (long double) floating point
13447 instructions.
13448
13449 -msoft-quad-float
13450 Generate output containing library calls for quad-word (long
13451 double) floating point instructions. The functions called are
13452 those specified in the SPARC ABI. This is the default.
13453
13454 As of this writing, there are no SPARC implementations that have
13455 hardware support for the quad-word floating point instructions.
13456 They all invoke a trap handler for one of these instructions, and
13457 then the trap handler emulates the effect of the instruction.
13458 Because of the trap handler overhead, this is much slower than
13459 calling the ABI library routines. Thus the -msoft-quad-float
13460 option is the default.
13461
13462 -mno-unaligned-doubles
13463 -munaligned-doubles
13464 Assume that doubles have 8 byte alignment. This is the default.
13465
13466 With -munaligned-doubles, GCC assumes that doubles have 8 byte
13467 alignment only if they are contained in another type, or if they
13468 have an absolute address. Otherwise, it assumes they have 4 byte
13469 alignment. Specifying this option avoids some rare compatibility
13470 problems with code generated by other compilers. It is not the
13471 default because it results in a performance loss, especially for
13472 floating point code.
13473
13474 -mno-faster-structs
13475 -mfaster-structs
13476 With -mfaster-structs, the compiler assumes that structures should
13477 have 8 byte alignment. This enables the use of pairs of "ldd" and
13478 "std" instructions for copies in structure assignment, in place of
13479 twice as many "ld" and "st" pairs. However, the use of this
13480 changed alignment directly violates the SPARC ABI. Thus, it's
13481 intended only for use on targets where the developer acknowledges
13482 that their resulting code will not be directly in line with the
13483 rules of the ABI.
13484
13485 -mimpure-text
13486 -mimpure-text, used in addition to -shared, tells the compiler to
13487 not pass -z text to the linker when linking a shared object. Using
13488 this option, you can link position-dependent code into a shared
13489 object.
13490
13491 -mimpure-text suppresses the "relocations remain against
13492 allocatable but non-writable sections" linker error message.
13493 However, the necessary relocations will trigger copy-on-write, and
13494 the shared object is not actually shared across processes. Instead
13495 of using -mimpure-text, you should compile all source code with
13496 -fpic or -fPIC.
13497
13498 This option is only available on SunOS and Solaris.
13499
13500 -mcpu=cpu_type
13501 Set the instruction set, register set, and instruction scheduling
13502 parameters for machine type cpu_type. Supported values for
13503 cpu_type are v7, cypress, v8, supersparc, sparclite, f930, f934,
13504 hypersparc, sparclite86x, sparclet, tsc701, v9, ultrasparc,
13505 ultrasparc3, niagara and niagara2.
13506
13507 Default instruction scheduling parameters are used for values that
13508 select an architecture and not an implementation. These are v7,
13509 v8, sparclite, sparclet, v9.
13510
13511 Here is a list of each supported architecture and their supported
13512 implementations.
13513
13514 v7: cypress
13515 v8: supersparc, hypersparc
13516 sparclite: f930, f934, sparclite86x
13517 sparclet: tsc701
13518 v9: ultrasparc, ultrasparc3, niagara, niagara2
13519
13520 By default (unless configured otherwise), GCC generates code for
13521 the V7 variant of the SPARC architecture. With -mcpu=cypress, the
13522 compiler additionally optimizes it for the Cypress CY7C602 chip, as
13523 used in the SPARCStation/SPARCServer 3xx series. This is also
13524 appropriate for the older SPARCStation 1, 2, IPX etc.
13525
13526 With -mcpu=v8, GCC generates code for the V8 variant of the SPARC
13527 architecture. The only difference from V7 code is that the
13528 compiler emits the integer multiply and integer divide instructions
13529 which exist in SPARC-V8 but not in SPARC-V7. With
13530 -mcpu=supersparc, the compiler additionally optimizes it for the
13531 SuperSPARC chip, as used in the SPARCStation 10, 1000 and 2000
13532 series.
13533
13534 With -mcpu=sparclite, GCC generates code for the SPARClite variant
13535 of the SPARC architecture. This adds the integer multiply, integer
13536 divide step and scan ("ffs") instructions which exist in SPARClite
13537 but not in SPARC-V7. With -mcpu=f930, the compiler additionally
13538 optimizes it for the Fujitsu MB86930 chip, which is the original
13539 SPARClite, with no FPU. With -mcpu=f934, the compiler additionally
13540 optimizes it for the Fujitsu MB86934 chip, which is the more recent
13541 SPARClite with FPU.
13542
13543 With -mcpu=sparclet, GCC generates code for the SPARClet variant of
13544 the SPARC architecture. This adds the integer multiply,
13545 multiply/accumulate, integer divide step and scan ("ffs")
13546 instructions which exist in SPARClet but not in SPARC-V7. With
13547 -mcpu=tsc701, the compiler additionally optimizes it for the TEMIC
13548 SPARClet chip.
13549
13550 With -mcpu=v9, GCC generates code for the V9 variant of the SPARC
13551 architecture. This adds 64-bit integer and floating-point move
13552 instructions, 3 additional floating-point condition code registers
13553 and conditional move instructions. With -mcpu=ultrasparc, the
13554 compiler additionally optimizes it for the Sun UltraSPARC I/II/IIi
13555 chips. With -mcpu=ultrasparc3, the compiler additionally optimizes
13556 it for the Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips. With
13557 -mcpu=niagara, the compiler additionally optimizes it for Sun
13558 UltraSPARC T1 chips. With -mcpu=niagara2, the compiler
13559 additionally optimizes it for Sun UltraSPARC T2 chips.
13560
13561 -mtune=cpu_type
13562 Set the instruction scheduling parameters for machine type
13563 cpu_type, but do not set the instruction set or register set that
13564 the option -mcpu=cpu_type would.
13565
13566 The same values for -mcpu=cpu_type can be used for -mtune=cpu_type,
13567 but the only useful values are those that select a particular cpu
13568 implementation. Those are cypress, supersparc, hypersparc, f930,
13569 f934, sparclite86x, tsc701, ultrasparc, ultrasparc3, niagara, and
13570 niagara2.
13571
13572 -mv8plus
13573 -mno-v8plus
13574 With -mv8plus, GCC generates code for the SPARC-V8+ ABI. The
13575 difference from the V8 ABI is that the global and out registers are
13576 considered 64-bit wide. This is enabled by default on Solaris in
13577 32-bit mode for all SPARC-V9 processors.
13578
13579 -mvis
13580 -mno-vis
13581 With -mvis, GCC generates code that takes advantage of the
13582 UltraSPARC Visual Instruction Set extensions. The default is
13583 -mno-vis.
13584
13585 These -m options are supported in addition to the above on SPARC-V9
13586 processors in 64-bit environments:
13587
13588 -mlittle-endian
13589 Generate code for a processor running in little-endian mode. It is
13590 only available for a few configurations and most notably not on
13591 Solaris and Linux.
13592
13593 -m32
13594 -m64
13595 Generate code for a 32-bit or 64-bit environment. The 32-bit
13596 environment sets int, long and pointer to 32 bits. The 64-bit
13597 environment sets int to 32 bits and long and pointer to 64 bits.
13598
13599 -mcmodel=medlow
13600 Generate code for the Medium/Low code model: 64-bit addresses,
13601 programs must be linked in the low 32 bits of memory. Programs can
13602 be statically or dynamically linked.
13603
13604 -mcmodel=medmid
13605 Generate code for the Medium/Middle code model: 64-bit addresses,
13606 programs must be linked in the low 44 bits of memory, the text and
13607 data segments must be less than 2GB in size and the data segment
13608 must be located within 2GB of the text segment.
13609
13610 -mcmodel=medany
13611 Generate code for the Medium/Anywhere code model: 64-bit addresses,
13612 programs may be linked anywhere in memory, the text and data
13613 segments must be less than 2GB in size and the data segment must be
13614 located within 2GB of the text segment.
13615
13616 -mcmodel=embmedany
13617 Generate code for the Medium/Anywhere code model for embedded
13618 systems: 64-bit addresses, the text and data segments must be less
13619 than 2GB in size, both starting anywhere in memory (determined at
13620 link time). The global register %g4 points to the base of the data
13621 segment. Programs are statically linked and PIC is not supported.
13622
13623 -mstack-bias
13624 -mno-stack-bias
13625 With -mstack-bias, GCC assumes that the stack pointer, and frame
13626 pointer if present, are offset by -2047 which must be added back
13627 when making stack frame references. This is the default in 64-bit
13628 mode. Otherwise, assume no such offset is present.
13629
13630 These switches are supported in addition to the above on Solaris:
13631
13632 -threads
13633 Add support for multithreading using the Solaris threads library.
13634 This option sets flags for both the preprocessor and linker. This
13635 option does not affect the thread safety of object code produced by
13636 the compiler or that of libraries supplied with it.
13637
13638 -pthreads
13639 Add support for multithreading using the POSIX threads library.
13640 This option sets flags for both the preprocessor and linker. This
13641 option does not affect the thread safety of object code produced
13642 by the compiler or that of libraries supplied with it.
13643
13644 -pthread
13645 This is a synonym for -pthreads.
13646
13647 SPU Options
13648
13649 These -m options are supported on the SPU:
13650
13651 -mwarn-reloc
13652 -merror-reloc
13653 The loader for SPU does not handle dynamic relocations. By
13654 default, GCC will give an error when it generates code that
13655 requires a dynamic relocation. -mno-error-reloc disables the
13656 error, -mwarn-reloc will generate a warning instead.
13657
13658 -msafe-dma
13659 -munsafe-dma
13660 Instructions which initiate or test completion of DMA must not be
13661 reordered with respect to loads and stores of the memory which is
13662 being accessed. Users typically address this problem using the
13663 volatile keyword, but that can lead to inefficient code in places
13664 where the memory is known to not change. Rather than mark the
13665 memory as volatile we treat the DMA instructions as potentially
13666 effecting all memory. With -munsafe-dma users must use the
13667 volatile keyword to protect memory accesses.
13668
13669 -mbranch-hints
13670 By default, GCC will generate a branch hint instruction to avoid
13671 pipeline stalls for always taken or probably taken branches. A
13672 hint will not be generated closer than 8 instructions away from its
13673 branch. There is little reason to disable them, except for
13674 debugging purposes, or to make an object a little bit smaller.
13675
13676 -msmall-mem
13677 -mlarge-mem
13678 By default, GCC generates code assuming that addresses are never
13679 larger than 18 bits. With -mlarge-mem code is generated that
13680 assumes a full 32 bit address.
13681
13682 -mstdmain
13683 By default, GCC links against startup code that assumes the SPU-
13684 style main function interface (which has an unconventional
13685 parameter list). With -mstdmain, GCC will link your program
13686 against startup code that assumes a C99-style interface to "main",
13687 including a local copy of "argv" strings.
13688
13689 -mfixed-range=register-range
13690 Generate code treating the given register range as fixed registers.
13691 A fixed register is one that the register allocator can not use.
13692 This is useful when compiling kernel code. A register range is
13693 specified as two registers separated by a dash. Multiple register
13694 ranges can be specified separated by a comma.
13695
13696 -mea32
13697 -mea64
13698 Compile code assuming that pointers to the PPU address space
13699 accessed via the "__ea" named address space qualifier are either 32
13700 or 64 bits wide. The default is 32 bits. As this is an ABI
13701 changing option, all object code in an executable must be compiled
13702 with the same setting.
13703
13704 -maddress-space-conversion
13705 -mno-address-space-conversion
13706 Allow/disallow treating the "__ea" address space as superset of the
13707 generic address space. This enables explicit type casts between
13708 "__ea" and generic pointer as well as implicit conversions of
13709 generic pointers to "__ea" pointers. The default is to allow
13710 address space pointer conversions.
13711
13712 -mcache-size=cache-size
13713 This option controls the version of libgcc that the compiler links
13714 to an executable and selects a software-managed cache for accessing
13715 variables in the "__ea" address space with a particular cache size.
13716 Possible options for cache-size are 8, 16, 32, 64 and 128. The
13717 default cache size is 64KB.
13718
13719 -matomic-updates
13720 -mno-atomic-updates
13721 This option controls the version of libgcc that the compiler links
13722 to an executable and selects whether atomic updates to the
13723 software-managed cache of PPU-side variables are used. If you use
13724 atomic updates, changes to a PPU variable from SPU code using the
13725 "__ea" named address space qualifier will not interfere with
13726 changes to other PPU variables residing in the same cache line from
13727 PPU code. If you do not use atomic updates, such interference may
13728 occur; however, writing back cache lines will be more efficient.
13729 The default behavior is to use atomic updates.
13730
13731 -mdual-nops
13732 -mdual-nops=n
13733 By default, GCC will insert nops to increase dual issue when it
13734 expects it to increase performance. n can be a value from 0 to 10.
13735 A smaller n will insert fewer nops. 10 is the default, 0 is the
13736 same as -mno-dual-nops. Disabled with -Os.
13737
13738 -mhint-max-nops=n
13739 Maximum number of nops to insert for a branch hint. A branch hint
13740 must be at least 8 instructions away from the branch it is
13741 effecting. GCC will insert up to n nops to enforce this, otherwise
13742 it will not generate the branch hint.
13743
13744 -mhint-max-distance=n
13745 The encoding of the branch hint instruction limits the hint to be
13746 within 256 instructions of the branch it is effecting. By default,
13747 GCC makes sure it is within 125.
13748
13749 -msafe-hints
13750 Work around a hardware bug which causes the SPU to stall
13751 indefinitely. By default, GCC will insert the "hbrp" instruction
13752 to make sure this stall won't happen.
13753
13754 Options for System V
13755
13756 These additional options are available on System V Release 4 for
13757 compatibility with other compilers on those systems:
13758
13759 -G Create a shared object. It is recommended that -symbolic or
13760 -shared be used instead.
13761
13762 -Qy Identify the versions of each tool used by the compiler, in a
13763 ".ident" assembler directive in the output.
13764
13765 -Qn Refrain from adding ".ident" directives to the output file (this is
13766 the default).
13767
13768 -YP,dirs
13769 Search the directories dirs, and no others, for libraries specified
13770 with -l.
13771
13772 -Ym,dir
13773 Look in the directory dir to find the M4 preprocessor. The
13774 assembler uses this option.
13775
13776 V850 Options
13777
13778 These -m options are defined for V850 implementations:
13779
13780 -mlong-calls
13781 -mno-long-calls
13782 Treat all calls as being far away (near). If calls are assumed to
13783 be far away, the compiler will always load the functions address up
13784 into a register, and call indirect through the pointer.
13785
13786 -mno-ep
13787 -mep
13788 Do not optimize (do optimize) basic blocks that use the same index
13789 pointer 4 or more times to copy pointer into the "ep" register, and
13790 use the shorter "sld" and "sst" instructions. The -mep option is
13791 on by default if you optimize.
13792
13793 -mno-prolog-function
13794 -mprolog-function
13795 Do not use (do use) external functions to save and restore
13796 registers at the prologue and epilogue of a function. The external
13797 functions are slower, but use less code space if more than one
13798 function saves the same number of registers. The -mprolog-function
13799 option is on by default if you optimize.
13800
13801 -mspace
13802 Try to make the code as small as possible. At present, this just
13803 turns on the -mep and -mprolog-function options.
13804
13805 -mtda=n
13806 Put static or global variables whose size is n bytes or less into
13807 the tiny data area that register "ep" points to. The tiny data
13808 area can hold up to 256 bytes in total (128 bytes for byte
13809 references).
13810
13811 -msda=n
13812 Put static or global variables whose size is n bytes or less into
13813 the small data area that register "gp" points to. The small data
13814 area can hold up to 64 kilobytes.
13815
13816 -mzda=n
13817 Put static or global variables whose size is n bytes or less into
13818 the first 32 kilobytes of memory.
13819
13820 -mv850
13821 Specify that the target processor is the V850.
13822
13823 -mbig-switch
13824 Generate code suitable for big switch tables. Use this option only
13825 if the assembler/linker complain about out of range branches within
13826 a switch table.
13827
13828 -mapp-regs
13829 This option will cause r2 and r5 to be used in the code generated
13830 by the compiler. This setting is the default.
13831
13832 -mno-app-regs
13833 This option will cause r2 and r5 to be treated as fixed registers.
13834
13835 -mv850e1
13836 Specify that the target processor is the V850E1. The preprocessor
13837 constants __v850e1__ and __v850e__ will be defined if this option
13838 is used.
13839
13840 -mv850e
13841 Specify that the target processor is the V850E. The preprocessor
13842 constant __v850e__ will be defined if this option is used.
13843
13844 If neither -mv850 nor -mv850e nor -mv850e1 are defined then a
13845 default target processor will be chosen and the relevant __v850*__
13846 preprocessor constant will be defined.
13847
13848 The preprocessor constants __v850 and __v851__ are always defined,
13849 regardless of which processor variant is the target.
13850
13851 -mdisable-callt
13852 This option will suppress generation of the CALLT instruction for
13853 the v850e and v850e1 flavors of the v850 architecture. The default
13854 is -mno-disable-callt which allows the CALLT instruction to be
13855 used.
13856
13857 VAX Options
13858
13859 These -m options are defined for the VAX:
13860
13861 -munix
13862 Do not output certain jump instructions ("aobleq" and so on) that
13863 the Unix assembler for the VAX cannot handle across long ranges.
13864
13865 -mgnu
13866 Do output those jump instructions, on the assumption that you will
13867 assemble with the GNU assembler.
13868
13869 -mg Output code for g-format floating point numbers instead of
13870 d-format.
13871
13872 VxWorks Options
13873
13874 The options in this section are defined for all VxWorks targets.
13875 Options specific to the target hardware are listed with the other
13876 options for that target.
13877
13878 -mrtp
13879 GCC can generate code for both VxWorks kernels and real time
13880 processes (RTPs). This option switches from the former to the
13881 latter. It also defines the preprocessor macro "__RTP__".
13882
13883 -non-static
13884 Link an RTP executable against shared libraries rather than static
13885 libraries. The options -static and -shared can also be used for
13886 RTPs; -static is the default.
13887
13888 -Bstatic
13889 -Bdynamic
13890 These options are passed down to the linker. They are defined for
13891 compatibility with Diab.
13892
13893 -Xbind-lazy
13894 Enable lazy binding of function calls. This option is equivalent
13895 to -Wl,-z,now and is defined for compatibility with Diab.
13896
13897 -Xbind-now
13898 Disable lazy binding of function calls. This option is the default
13899 and is defined for compatibility with Diab.
13900
13901 x86-64 Options
13902
13903 These are listed under
13904
13905 i386 and x86-64 Windows Options
13906
13907 These additional options are available for Windows targets:
13908
13909 -mconsole
13910 This option is available for Cygwin and MinGW targets. It
13911 specifies that a console application is to be generated, by
13912 instructing the linker to set the PE header subsystem type required
13913 for console applications. This is the default behavior for Cygwin
13914 and MinGW targets.
13915
13916 -mcygwin
13917 This option is available for Cygwin targets. It specifies that the
13918 Cygwin internal interface is to be used for predefined preprocessor
13919 macros, C runtime libraries and related linker paths and options.
13920 For Cygwin targets this is the default behavior. This option is
13921 deprecated and will be removed in a future release.
13922
13923 -mno-cygwin
13924 This option is available for Cygwin targets. It specifies that the
13925 MinGW internal interface is to be used instead of Cygwin's, by
13926 setting MinGW-related predefined macros and linker paths and
13927 default library options. This option is deprecated and will be
13928 removed in a future release.
13929
13930 -mdll
13931 This option is available for Cygwin and MinGW targets. It
13932 specifies that a DLL - a dynamic link library - is to be generated,
13933 enabling the selection of the required runtime startup object and
13934 entry point.
13935
13936 -mnop-fun-dllimport
13937 This option is available for Cygwin and MinGW targets. It
13938 specifies that the dllimport attribute should be ignored.
13939
13940 -mthread
13941 This option is available for MinGW targets. It specifies that
13942 MinGW-specific thread support is to be used.
13943
13944 -municode
13945 This option is available for mingw-w64 targets. It specifies that
13946 the UNICODE macro is getting pre-defined and that the unicode
13947 capable runtime startup code is chosen.
13948
13949 -mwin32
13950 This option is available for Cygwin and MinGW targets. It
13951 specifies that the typical Windows pre-defined macros are to be set
13952 in the pre-processor, but does not influence the choice of runtime
13953 library/startup code.
13954
13955 -mwindows
13956 This option is available for Cygwin and MinGW targets. It
13957 specifies that a GUI application is to be generated by instructing
13958 the linker to set the PE header subsystem type appropriately.
13959
13960 -fno-set-stack-executable
13961 This option is available for MinGW targets. It specifies that the
13962 executable flag for stack used by nested functions isn't set. This
13963 is necessary for binaries running in kernel mode of Windows, as
13964 there the user32 API, which is used to set executable privileges,
13965 isn't available.
13966
13967 -mpe-aligned-commons
13968 This option is available for Cygwin and MinGW targets. It
13969 specifies that the GNU extension to the PE file format that permits
13970 the correct alignment of COMMON variables should be used when
13971 generating code. It will be enabled by default if GCC detects that
13972 the target assembler found during configuration supports the
13973 feature.
13974
13975 See also under i386 and x86-64 Options for standard options.
13976
13977 Xstormy16 Options
13978
13979 These options are defined for Xstormy16:
13980
13981 -msim
13982 Choose startup files and linker script suitable for the simulator.
13983
13984 Xtensa Options
13985
13986 These options are supported for Xtensa targets:
13987
13988 -mconst16
13989 -mno-const16
13990 Enable or disable use of "CONST16" instructions for loading
13991 constant values. The "CONST16" instruction is currently not a
13992 standard option from Tensilica. When enabled, "CONST16"
13993 instructions are always used in place of the standard "L32R"
13994 instructions. The use of "CONST16" is enabled by default only if
13995 the "L32R" instruction is not available.
13996
13997 -mfused-madd
13998 -mno-fused-madd
13999 Enable or disable use of fused multiply/add and multiply/subtract
14000 instructions in the floating-point option. This has no effect if
14001 the floating-point option is not also enabled. Disabling fused
14002 multiply/add and multiply/subtract instructions forces the compiler
14003 to use separate instructions for the multiply and add/subtract
14004 operations. This may be desirable in some cases where strict IEEE
14005 754-compliant results are required: the fused multiply add/subtract
14006 instructions do not round the intermediate result, thereby
14007 producing results with more bits of precision than specified by the
14008 IEEE standard. Disabling fused multiply add/subtract instructions
14009 also ensures that the program output is not sensitive to the
14010 compiler's ability to combine multiply and add/subtract operations.
14011
14012 -mserialize-volatile
14013 -mno-serialize-volatile
14014 When this option is enabled, GCC inserts "MEMW" instructions before
14015 "volatile" memory references to guarantee sequential consistency.
14016 The default is -mserialize-volatile. Use -mno-serialize-volatile
14017 to omit the "MEMW" instructions.
14018
14019 -mtext-section-literals
14020 -mno-text-section-literals
14021 Control the treatment of literal pools. The default is
14022 -mno-text-section-literals, which places literals in a separate
14023 section in the output file. This allows the literal pool to be
14024 placed in a data RAM/ROM, and it also allows the linker to combine
14025 literal pools from separate object files to remove redundant
14026 literals and improve code size. With -mtext-section-literals, the
14027 literals are interspersed in the text section in order to keep them
14028 as close as possible to their references. This may be necessary
14029 for large assembly files.
14030
14031 -mtarget-align
14032 -mno-target-align
14033 When this option is enabled, GCC instructs the assembler to
14034 automatically align instructions to reduce branch penalties at the
14035 expense of some code density. The assembler attempts to widen
14036 density instructions to align branch targets and the instructions
14037 following call instructions. If there are not enough preceding
14038 safe density instructions to align a target, no widening will be
14039 performed. The default is -mtarget-align. These options do not
14040 affect the treatment of auto-aligned instructions like "LOOP",
14041 which the assembler will always align, either by widening density
14042 instructions or by inserting no-op instructions.
14043
14044 -mlongcalls
14045 -mno-longcalls
14046 When this option is enabled, GCC instructs the assembler to
14047 translate direct calls to indirect calls unless it can determine
14048 that the target of a direct call is in the range allowed by the
14049 call instruction. This translation typically occurs for calls to
14050 functions in other source files. Specifically, the assembler
14051 translates a direct "CALL" instruction into an "L32R" followed by a
14052 "CALLX" instruction. The default is -mno-longcalls. This option
14053 should be used in programs where the call target can potentially be
14054 out of range. This option is implemented in the assembler, not the
14055 compiler, so the assembly code generated by GCC will still show
14056 direct call instructions---look at the disassembled object code to
14057 see the actual instructions. Note that the assembler will use an
14058 indirect call for every cross-file call, not just those that really
14059 will be out of range.
14060
14061 zSeries Options
14062
14063 These are listed under
14064
14065 Options for Code Generation Conventions
14066 These machine-independent options control the interface conventions
14067 used in code generation.
14068
14069 Most of them have both positive and negative forms; the negative form
14070 of -ffoo would be -fno-foo. In the table below, only one of the forms
14071 is listed---the one which is not the default. You can figure out the
14072 other form by either removing no- or adding it.
14073
14074 -fbounds-check
14075 For front-ends that support it, generate additional code to check
14076 that indices used to access arrays are within the declared range.
14077 This is currently only supported by the Java and Fortran front-
14078 ends, where this option defaults to true and false respectively.
14079
14080 -ftrapv
14081 This option generates traps for signed overflow on addition,
14082 subtraction, multiplication operations.
14083
14084 -fwrapv
14085 This option instructs the compiler to assume that signed arithmetic
14086 overflow of addition, subtraction and multiplication wraps around
14087 using twos-complement representation. This flag enables some
14088 optimizations and disables others. This option is enabled by
14089 default for the Java front-end, as required by the Java language
14090 specification.
14091
14092 -fexceptions
14093 Enable exception handling. Generates extra code needed to
14094 propagate exceptions. For some targets, this implies GCC will
14095 generate frame unwind information for all functions, which can
14096 produce significant data size overhead, although it does not affect
14097 execution. If you do not specify this option, GCC will enable it
14098 by default for languages like C++ which normally require exception
14099 handling, and disable it for languages like C that do not normally
14100 require it. However, you may need to enable this option when
14101 compiling C code that needs to interoperate properly with exception
14102 handlers written in C++. You may also wish to disable this option
14103 if you are compiling older C++ programs that don't use exception
14104 handling.
14105
14106 -fnon-call-exceptions
14107 Generate code that allows trapping instructions to throw
14108 exceptions. Note that this requires platform-specific runtime
14109 support that does not exist everywhere. Moreover, it only allows
14110 trapping instructions to throw exceptions, i.e. memory references
14111 or floating point instructions. It does not allow exceptions to be
14112 thrown from arbitrary signal handlers such as "SIGALRM".
14113
14114 -funwind-tables
14115 Similar to -fexceptions, except that it will just generate any
14116 needed static data, but will not affect the generated code in any
14117 other way. You will normally not enable this option; instead, a
14118 language processor that needs this handling would enable it on your
14119 behalf.
14120
14121 -fasynchronous-unwind-tables
14122 Generate unwind table in dwarf2 format, if supported by target
14123 machine. The table is exact at each instruction boundary, so it
14124 can be used for stack unwinding from asynchronous events (such as
14125 debugger or garbage collector).
14126
14127 -fpcc-struct-return
14128 Return "short" "struct" and "union" values in memory like longer
14129 ones, rather than in registers. This convention is less efficient,
14130 but it has the advantage of allowing intercallability between GCC-
14131 compiled files and files compiled with other compilers,
14132 particularly the Portable C Compiler (pcc).
14133
14134 The precise convention for returning structures in memory depends
14135 on the target configuration macros.
14136
14137 Short structures and unions are those whose size and alignment
14138 match that of some integer type.
14139
14140 Warning: code compiled with the -fpcc-struct-return switch is not
14141 binary compatible with code compiled with the -freg-struct-return
14142 switch. Use it to conform to a non-default application binary
14143 interface.
14144
14145 -freg-struct-return
14146 Return "struct" and "union" values in registers when possible.
14147 This is more efficient for small structures than
14148 -fpcc-struct-return.
14149
14150 If you specify neither -fpcc-struct-return nor -freg-struct-return,
14151 GCC defaults to whichever convention is standard for the target.
14152 If there is no standard convention, GCC defaults to
14153 -fpcc-struct-return, except on targets where GCC is the principal
14154 compiler. In those cases, we can choose the standard, and we chose
14155 the more efficient register return alternative.
14156
14157 Warning: code compiled with the -freg-struct-return switch is not
14158 binary compatible with code compiled with the -fpcc-struct-return
14159 switch. Use it to conform to a non-default application binary
14160 interface.
14161
14162 -fshort-enums
14163 Allocate to an "enum" type only as many bytes as it needs for the
14164 declared range of possible values. Specifically, the "enum" type
14165 will be equivalent to the smallest integer type which has enough
14166 room.
14167
14168 Warning: the -fshort-enums switch causes GCC to generate code that
14169 is not binary compatible with code generated without that switch.
14170 Use it to conform to a non-default application binary interface.
14171
14172 -fshort-double
14173 Use the same size for "double" as for "float".
14174
14175 Warning: the -fshort-double switch causes GCC to generate code that
14176 is not binary compatible with code generated without that switch.
14177 Use it to conform to a non-default application binary interface.
14178
14179 -fshort-wchar
14180 Override the underlying type for wchar_t to be short unsigned int
14181 instead of the default for the target. This option is useful for
14182 building programs to run under WINE.
14183
14184 Warning: the -fshort-wchar switch causes GCC to generate code that
14185 is not binary compatible with code generated without that switch.
14186 Use it to conform to a non-default application binary interface.
14187
14188 -fno-common
14189 In C code, controls the placement of uninitialized global
14190 variables. Unix C compilers have traditionally permitted multiple
14191 definitions of such variables in different compilation units by
14192 placing the variables in a common block. This is the behavior
14193 specified by -fcommon, and is the default for GCC on most targets.
14194 On the other hand, this behavior is not required by ISO C, and on
14195 some targets may carry a speed or code size penalty on variable
14196 references. The -fno-common option specifies that the compiler
14197 should place uninitialized global variables in the data section of
14198 the object file, rather than generating them as common blocks.
14199 This has the effect that if the same variable is declared (without
14200 "extern") in two different compilations, you will get a multiple-
14201 definition error when you link them. In this case, you must
14202 compile with -fcommon instead. Compiling with -fno-common is
14203 useful on targets for which it provides better performance, or if
14204 you wish to verify that the program will work on other systems
14205 which always treat uninitialized variable declarations this way.
14206
14207 -fno-ident
14208 Ignore the #ident directive.
14209
14210 -finhibit-size-directive
14211 Don't output a ".size" assembler directive, or anything else that
14212 would cause trouble if the function is split in the middle, and the
14213 two halves are placed at locations far apart in memory. This
14214 option is used when compiling crtstuff.c; you should not need to
14215 use it for anything else.
14216
14217 -fverbose-asm
14218 Put extra commentary information in the generated assembly code to
14219 make it more readable. This option is generally only of use to
14220 those who actually need to read the generated assembly code
14221 (perhaps while debugging the compiler itself).
14222
14223 -fno-verbose-asm, the default, causes the extra information to be
14224 omitted and is useful when comparing two assembler files.
14225
14226 -frecord-gcc-switches
14227 This switch causes the command line that was used to invoke the
14228 compiler to be recorded into the object file that is being created.
14229 This switch is only implemented on some targets and the exact
14230 format of the recording is target and binary file format dependent,
14231 but it usually takes the form of a section containing ASCII text.
14232 This switch is related to the -fverbose-asm switch, but that switch
14233 only records information in the assembler output file as comments,
14234 so it never reaches the object file.
14235
14236 -fpic
14237 Generate position-independent code (PIC) suitable for use in a
14238 shared library, if supported for the target machine. Such code
14239 accesses all constant addresses through a global offset table
14240 (GOT). The dynamic loader resolves the GOT entries when the
14241 program starts (the dynamic loader is not part of GCC; it is part
14242 of the operating system). If the GOT size for the linked
14243 executable exceeds a machine-specific maximum size, you get an
14244 error message from the linker indicating that -fpic does not work;
14245 in that case, recompile with -fPIC instead. (These maximums are 8k
14246 on the SPARC and 32k on the m68k and RS/6000. The 386 has no such
14247 limit.)
14248
14249 Position-independent code requires special support, and therefore
14250 works only on certain machines. For the 386, GCC supports PIC for
14251 System V but not for the Sun 386i. Code generated for the IBM
14252 RS/6000 is always position-independent.
14253
14254 When this flag is set, the macros "__pic__" and "__PIC__" are
14255 defined to 1.
14256
14257 -fPIC
14258 If supported for the target machine, emit position-independent
14259 code, suitable for dynamic linking and avoiding any limit on the
14260 size of the global offset table. This option makes a difference on
14261 the m68k, PowerPC and SPARC.
14262
14263 Position-independent code requires special support, and therefore
14264 works only on certain machines.
14265
14266 When this flag is set, the macros "__pic__" and "__PIC__" are
14267 defined to 2.
14268
14269 -fpie
14270 -fPIE
14271 These options are similar to -fpic and -fPIC, but generated
14272 position independent code can be only linked into executables.
14273 Usually these options are used when -pie GCC option will be used
14274 during linking.
14275
14276 -fpie and -fPIE both define the macros "__pie__" and "__PIE__".
14277 The macros have the value 1 for -fpie and 2 for -fPIE.
14278
14279 -fno-jump-tables
14280 Do not use jump tables for switch statements even where it would be
14281 more efficient than other code generation strategies. This option
14282 is of use in conjunction with -fpic or -fPIC for building code
14283 which forms part of a dynamic linker and cannot reference the
14284 address of a jump table. On some targets, jump tables do not
14285 require a GOT and this option is not needed.
14286
14287 -ffixed-reg
14288 Treat the register named reg as a fixed register; generated code
14289 should never refer to it (except perhaps as a stack pointer, frame
14290 pointer or in some other fixed role).
14291
14292 reg must be the name of a register. The register names accepted
14293 are machine-specific and are defined in the "REGISTER_NAMES" macro
14294 in the machine description macro file.
14295
14296 This flag does not have a negative form, because it specifies a
14297 three-way choice.
14298
14299 -fcall-used-reg
14300 Treat the register named reg as an allocable register that is
14301 clobbered by function calls. It may be allocated for temporaries
14302 or variables that do not live across a call. Functions compiled
14303 this way will not save and restore the register reg.
14304
14305 It is an error to used this flag with the frame pointer or stack
14306 pointer. Use of this flag for other registers that have fixed
14307 pervasive roles in the machine's execution model will produce
14308 disastrous results.
14309
14310 This flag does not have a negative form, because it specifies a
14311 three-way choice.
14312
14313 -fcall-saved-reg
14314 Treat the register named reg as an allocable register saved by
14315 functions. It may be allocated even for temporaries or variables
14316 that live across a call. Functions compiled this way will save and
14317 restore the register reg if they use it.
14318
14319 It is an error to used this flag with the frame pointer or stack
14320 pointer. Use of this flag for other registers that have fixed
14321 pervasive roles in the machine's execution model will produce
14322 disastrous results.
14323
14324 A different sort of disaster will result from the use of this flag
14325 for a register in which function values may be returned.
14326
14327 This flag does not have a negative form, because it specifies a
14328 three-way choice.
14329
14330 -fpack-struct[=n]
14331 Without a value specified, pack all structure members together
14332 without holes. When a value is specified (which must be a small
14333 power of two), pack structure members according to this value,
14334 representing the maximum alignment (that is, objects with default
14335 alignment requirements larger than this will be output potentially
14336 unaligned at the next fitting location.
14337
14338 Warning: the -fpack-struct switch causes GCC to generate code that
14339 is not binary compatible with code generated without that switch.
14340 Additionally, it makes the code suboptimal. Use it to conform to a
14341 non-default application binary interface.
14342
14343 -finstrument-functions
14344 Generate instrumentation calls for entry and exit to functions.
14345 Just after function entry and just before function exit, the
14346 following profiling functions will be called with the address of
14347 the current function and its call site. (On some platforms,
14348 "__builtin_return_address" does not work beyond the current
14349 function, so the call site information may not be available to the
14350 profiling functions otherwise.)
14351
14352 void __cyg_profile_func_enter (void *this_fn,
14353 void *call_site);
14354 void __cyg_profile_func_exit (void *this_fn,
14355 void *call_site);
14356
14357 The first argument is the address of the start of the current
14358 function, which may be looked up exactly in the symbol table.
14359
14360 This instrumentation is also done for functions expanded inline in
14361 other functions. The profiling calls will indicate where,
14362 conceptually, the inline function is entered and exited. This
14363 means that addressable versions of such functions must be
14364 available. If all your uses of a function are expanded inline,
14365 this may mean an additional expansion of code size. If you use
14366 extern inline in your C code, an addressable version of such
14367 functions must be provided. (This is normally the case anyways,
14368 but if you get lucky and the optimizer always expands the functions
14369 inline, you might have gotten away without providing static
14370 copies.)
14371
14372 A function may be given the attribute "no_instrument_function", in
14373 which case this instrumentation will not be done. This can be
14374 used, for example, for the profiling functions listed above, high-
14375 priority interrupt routines, and any functions from which the
14376 profiling functions cannot safely be called (perhaps signal
14377 handlers, if the profiling routines generate output or allocate
14378 memory).
14379
14380 -finstrument-functions-exclude-file-list=file,file,...
14381 Set the list of functions that are excluded from instrumentation
14382 (see the description of "-finstrument-functions"). If the file
14383 that contains a function definition matches with one of file, then
14384 that function is not instrumented. The match is done on
14385 substrings: if the file parameter is a substring of the file name,
14386 it is considered to be a match.
14387
14388 For example,
14389 "-finstrument-functions-exclude-file-list=/bits/stl,include/sys"
14390 will exclude any inline function defined in files whose pathnames
14391 contain "/bits/stl" or "include/sys".
14392
14393 If, for some reason, you want to include letter ',' in one of sym,
14394 write ','. For example,
14395 "-finstrument-functions-exclude-file-list=',,tmp'" (note the single
14396 quote surrounding the option).
14397
14398 -finstrument-functions-exclude-function-list=sym,sym,...
14399 This is similar to "-finstrument-functions-exclude-file-list", but
14400 this option sets the list of function names to be excluded from
14401 instrumentation. The function name to be matched is its user-
14402 visible name, such as "vector<int> blah(const vector<int> &)", not
14403 the internal mangled name (e.g., "_Z4blahRSt6vectorIiSaIiEE"). The
14404 match is done on substrings: if the sym parameter is a substring of
14405 the function name, it is considered to be a match. For C99 and C++
14406 extended identifiers, the function name must be given in UTF-8, not
14407 using universal character names.
14408
14409 -fstack-check
14410 Generate code to verify that you do not go beyond the boundary of
14411 the stack. You should specify this flag if you are running in an
14412 environment with multiple threads, but only rarely need to specify
14413 it in a single-threaded environment since stack overflow is
14414 automatically detected on nearly all systems if there is only one
14415 stack.
14416
14417 Note that this switch does not actually cause checking to be done;
14418 the operating system or the language runtime must do that. The
14419 switch causes generation of code to ensure that they see the stack
14420 being extended.
14421
14422 You can additionally specify a string parameter: "no" means no
14423 checking, "generic" means force the use of old-style checking,
14424 "specific" means use the best checking method and is equivalent to
14425 bare -fstack-check.
14426
14427 Old-style checking is a generic mechanism that requires no specific
14428 target support in the compiler but comes with the following
14429 drawbacks:
14430
14431 1. Modified allocation strategy for large objects: they will
14432 always be allocated dynamically if their size exceeds a fixed
14433 threshold.
14434
14435 2. Fixed limit on the size of the static frame of functions: when
14436 it is topped by a particular function, stack checking is not
14437 reliable and a warning is issued by the compiler.
14438
14439 3. Inefficiency: because of both the modified allocation strategy
14440 and the generic implementation, the performances of the code
14441 are hampered.
14442
14443 Note that old-style stack checking is also the fallback method for
14444 "specific" if no target support has been added in the compiler.
14445
14446 -fstack-limit-register=reg
14447 -fstack-limit-symbol=sym
14448 -fno-stack-limit
14449 Generate code to ensure that the stack does not grow beyond a
14450 certain value, either the value of a register or the address of a
14451 symbol. If the stack would grow beyond the value, a signal is
14452 raised. For most targets, the signal is raised before the stack
14453 overruns the boundary, so it is possible to catch the signal
14454 without taking special precautions.
14455
14456 For instance, if the stack starts at absolute address 0x80000000
14457 and grows downwards, you can use the flags
14458 -fstack-limit-symbol=__stack_limit and
14459 -Wl,--defsym,__stack_limit=0x7ffe0000 to enforce a stack limit of
14460 128KB. Note that this may only work with the GNU linker.
14461
14462 -fargument-alias
14463 -fargument-noalias
14464 -fargument-noalias-global
14465 -fargument-noalias-anything
14466 Specify the possible relationships among parameters and between
14467 parameters and global data.
14468
14469 -fargument-alias specifies that arguments (parameters) may alias
14470 each other and may alias global storage.-fargument-noalias
14471 specifies that arguments do not alias each other, but may alias
14472 global storage.-fargument-noalias-global specifies that arguments
14473 do not alias each other and do not alias global storage.
14474 -fargument-noalias-anything specifies that arguments do not alias
14475 any other storage.
14476
14477 Each language will automatically use whatever option is required by
14478 the language standard. You should not need to use these options
14479 yourself.
14480
14481 -fleading-underscore
14482 This option and its counterpart, -fno-leading-underscore, forcibly
14483 change the way C symbols are represented in the object file. One
14484 use is to help link with legacy assembly code.
14485
14486 Warning: the -fleading-underscore switch causes GCC to generate
14487 code that is not binary compatible with code generated without that
14488 switch. Use it to conform to a non-default application binary
14489 interface. Not all targets provide complete support for this
14490 switch.
14491
14492 -ftls-model=model
14493 Alter the thread-local storage model to be used. The model
14494 argument should be one of "global-dynamic", "local-dynamic",
14495 "initial-exec" or "local-exec".
14496
14497 The default without -fpic is "initial-exec"; with -fpic the default
14498 is "global-dynamic".
14499
14500 -fvisibility=default|internal|hidden|protected
14501 Set the default ELF image symbol visibility to the specified
14502 option---all symbols will be marked with this unless overridden
14503 within the code. Using this feature can very substantially improve
14504 linking and load times of shared object libraries, produce more
14505 optimized code, provide near-perfect API export and prevent symbol
14506 clashes. It is strongly recommended that you use this in any
14507 shared objects you distribute.
14508
14509 Despite the nomenclature, "default" always means public ie;
14510 available to be linked against from outside the shared object.
14511 "protected" and "internal" are pretty useless in real-world usage
14512 so the only other commonly used option will be "hidden". The
14513 default if -fvisibility isn't specified is "default", i.e., make
14514 every symbol public---this causes the same behavior as previous
14515 versions of GCC.
14516
14517 A good explanation of the benefits offered by ensuring ELF symbols
14518 have the correct visibility is given by "How To Write Shared
14519 Libraries" by Ulrich Drepper (which can be found at
14520 <http://people.redhat.com/~drepper/>)---however a superior solution
14521 made possible by this option to marking things hidden when the
14522 default is public is to make the default hidden and mark things
14523 public. This is the norm with DLL's on Windows and with
14524 -fvisibility=hidden and "__attribute__ ((visibility("default")))"
14525 instead of "__declspec(dllexport)" you get almost identical
14526 semantics with identical syntax. This is a great boon to those
14527 working with cross-platform projects.
14528
14529 For those adding visibility support to existing code, you may find
14530 #pragma GCC visibility of use. This works by you enclosing the
14531 declarations you wish to set visibility for with (for example)
14532 #pragma GCC visibility push(hidden) and #pragma GCC visibility pop.
14533 Bear in mind that symbol visibility should be viewed as part of the
14534 API interface contract and thus all new code should always specify
14535 visibility when it is not the default ie; declarations only for use
14536 within the local DSO should always be marked explicitly as hidden
14537 as so to avoid PLT indirection overheads---making this abundantly
14538 clear also aids readability and self-documentation of the code.
14539 Note that due to ISO C++ specification requirements, operator new
14540 and operator delete must always be of default visibility.
14541
14542 Be aware that headers from outside your project, in particular
14543 system headers and headers from any other library you use, may not
14544 be expecting to be compiled with visibility other than the default.
14545 You may need to explicitly say #pragma GCC visibility push(default)
14546 before including any such headers.
14547
14548 extern declarations are not affected by -fvisibility, so a lot of
14549 code can be recompiled with -fvisibility=hidden with no
14550 modifications. However, this means that calls to extern functions
14551 with no explicit visibility will use the PLT, so it is more
14552 effective to use __attribute ((visibility)) and/or #pragma GCC
14553 visibility to tell the compiler which extern declarations should be
14554 treated as hidden.
14555
14556 Note that -fvisibility does affect C++ vague linkage entities. This
14557 means that, for instance, an exception class that will be thrown
14558 between DSOs must be explicitly marked with default visibility so
14559 that the type_info nodes will be unified between the DSOs.
14560
14561 An overview of these techniques, their benefits and how to use them
14562 is at <http://gcc.gnu.org/wiki/Visibility>.
14563
14565 This section describes several environment variables that affect how
14566 GCC operates. Some of them work by specifying directories or prefixes
14567 to use when searching for various kinds of files. Some are used to
14568 specify other aspects of the compilation environment.
14569
14570 Note that you can also specify places to search using options such as
14571 -B, -I and -L. These take precedence over places specified using
14572 environment variables, which in turn take precedence over those
14573 specified by the configuration of GCC.
14574
14575 LANG
14576 LC_CTYPE
14577 LC_MESSAGES
14578 LC_ALL
14579 These environment variables control the way that GCC uses
14580 localization information that allow GCC to work with different
14581 national conventions. GCC inspects the locale categories LC_CTYPE
14582 and LC_MESSAGES if it has been configured to do so. These locale
14583 categories can be set to any value supported by your installation.
14584 A typical value is en_GB.UTF-8 for English in the United Kingdom
14585 encoded in UTF-8.
14586
14587 The LC_CTYPE environment variable specifies character
14588 classification. GCC uses it to determine the character boundaries
14589 in a string; this is needed for some multibyte encodings that
14590 contain quote and escape characters that would otherwise be
14591 interpreted as a string end or escape.
14592
14593 The LC_MESSAGES environment variable specifies the language to use
14594 in diagnostic messages.
14595
14596 If the LC_ALL environment variable is set, it overrides the value
14597 of LC_CTYPE and LC_MESSAGES; otherwise, LC_CTYPE and LC_MESSAGES
14598 default to the value of the LANG environment variable. If none of
14599 these variables are set, GCC defaults to traditional C English
14600 behavior.
14601
14602 TMPDIR
14603 If TMPDIR is set, it specifies the directory to use for temporary
14604 files. GCC uses temporary files to hold the output of one stage of
14605 compilation which is to be used as input to the next stage: for
14606 example, the output of the preprocessor, which is the input to the
14607 compiler proper.
14608
14609 GCC_EXEC_PREFIX
14610 If GCC_EXEC_PREFIX is set, it specifies a prefix to use in the
14611 names of the subprograms executed by the compiler. No slash is
14612 added when this prefix is combined with the name of a subprogram,
14613 but you can specify a prefix that ends with a slash if you wish.
14614
14615 If GCC_EXEC_PREFIX is not set, GCC will attempt to figure out an
14616 appropriate prefix to use based on the pathname it was invoked
14617 with.
14618
14619 If GCC cannot find the subprogram using the specified prefix, it
14620 tries looking in the usual places for the subprogram.
14621
14622 The default value of GCC_EXEC_PREFIX is prefix/lib/gcc/ where
14623 prefix is the prefix to the installed compiler. In many cases
14624 prefix is the value of "prefix" when you ran the configure script.
14625
14626 Other prefixes specified with -B take precedence over this prefix.
14627
14628 This prefix is also used for finding files such as crt0.o that are
14629 used for linking.
14630
14631 In addition, the prefix is used in an unusual way in finding the
14632 directories to search for header files. For each of the standard
14633 directories whose name normally begins with /usr/local/lib/gcc
14634 (more precisely, with the value of GCC_INCLUDE_DIR), GCC tries
14635 replacing that beginning with the specified prefix to produce an
14636 alternate directory name. Thus, with -Bfoo/, GCC will search
14637 foo/bar where it would normally search /usr/local/lib/bar. These
14638 alternate directories are searched first; the standard directories
14639 come next. If a standard directory begins with the configured
14640 prefix then the value of prefix is replaced by GCC_EXEC_PREFIX when
14641 looking for header files.
14642
14643 COMPILER_PATH
14644 The value of COMPILER_PATH is a colon-separated list of
14645 directories, much like PATH. GCC tries the directories thus
14646 specified when searching for subprograms, if it can't find the
14647 subprograms using GCC_EXEC_PREFIX.
14648
14649 LIBRARY_PATH
14650 The value of LIBRARY_PATH is a colon-separated list of directories,
14651 much like PATH. When configured as a native compiler, GCC tries
14652 the directories thus specified when searching for special linker
14653 files, if it can't find them using GCC_EXEC_PREFIX. Linking using
14654 GCC also uses these directories when searching for ordinary
14655 libraries for the -l option (but directories specified with -L come
14656 first).
14657
14658 LANG
14659 This variable is used to pass locale information to the compiler.
14660 One way in which this information is used is to determine the
14661 character set to be used when character literals, string literals
14662 and comments are parsed in C and C++. When the compiler is
14663 configured to allow multibyte characters, the following values for
14664 LANG are recognized:
14665
14666 C-JIS
14667 Recognize JIS characters.
14668
14669 C-SJIS
14670 Recognize SJIS characters.
14671
14672 C-EUCJP
14673 Recognize EUCJP characters.
14674
14675 If LANG is not defined, or if it has some other value, then the
14676 compiler will use mblen and mbtowc as defined by the default locale
14677 to recognize and translate multibyte characters.
14678
14679 Some additional environments variables affect the behavior of the
14680 preprocessor.
14681
14682 CPATH
14683 C_INCLUDE_PATH
14684 CPLUS_INCLUDE_PATH
14685 OBJC_INCLUDE_PATH
14686 Each variable's value is a list of directories separated by a
14687 special character, much like PATH, in which to look for header
14688 files. The special character, "PATH_SEPARATOR", is target-
14689 dependent and determined at GCC build time. For Microsoft Windows-
14690 based targets it is a semicolon, and for almost all other targets
14691 it is a colon.
14692
14693 CPATH specifies a list of directories to be searched as if
14694 specified with -I, but after any paths given with -I options on the
14695 command line. This environment variable is used regardless of
14696 which language is being preprocessed.
14697
14698 The remaining environment variables apply only when preprocessing
14699 the particular language indicated. Each specifies a list of
14700 directories to be searched as if specified with -isystem, but after
14701 any paths given with -isystem options on the command line.
14702
14703 In all these variables, an empty element instructs the compiler to
14704 search its current working directory. Empty elements can appear at
14705 the beginning or end of a path. For instance, if the value of
14706 CPATH is ":/special/include", that has the same effect as
14707 -I. -I/special/include.
14708
14709 DEPENDENCIES_OUTPUT
14710 If this variable is set, its value specifies how to output
14711 dependencies for Make based on the non-system header files
14712 processed by the compiler. System header files are ignored in the
14713 dependency output.
14714
14715 The value of DEPENDENCIES_OUTPUT can be just a file name, in which
14716 case the Make rules are written to that file, guessing the target
14717 name from the source file name. Or the value can have the form
14718 file target, in which case the rules are written to file file using
14719 target as the target name.
14720
14721 In other words, this environment variable is equivalent to
14722 combining the options -MM and -MF, with an optional -MT switch too.
14723
14724 SUNPRO_DEPENDENCIES
14725 This variable is the same as DEPENDENCIES_OUTPUT (see above),
14726 except that system header files are not ignored, so it implies -M
14727 rather than -MM. However, the dependence on the main input file is
14728 omitted.
14729
14731 For instructions on reporting bugs, see
14732 <http://bugzilla.redhat.com/bugzilla>.
14733
14735 1. On some systems, gcc -shared needs to build supplementary stub code
14736 for constructors to work. On multi-libbed systems, gcc -shared
14737 must select the correct support libraries to link against. Failing
14738 to supply the correct flags may lead to subtle defects. Supplying
14739 them in cases where they are not necessary is innocuous.
14740
14742 gpl(7), gfdl(7), fsf-funding(7), cpp(1), gcov(1), as(1), ld(1), gdb(1),
14743 adb(1), dbx(1), sdb(1) and the Info entries for gcc, cpp, as, ld,
14744 binutils and gdb.
14745
14747 See the Info entry for gcc, or
14748 <http://gcc.gnu.org/onlinedocs/gcc/Contributors.html>, for contributors
14749 to GCC.
14750
14752 Copyright (c) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14753 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
14754 Free Software Foundation, Inc.
14755
14756 Permission is granted to copy, distribute and/or modify this document
14757 under the terms of the GNU Free Documentation License, Version 1.2 or
14758 any later version published by the Free Software Foundation; with the
14759 Invariant Sections being "GNU General Public License" and "Funding Free
14760 Software", the Front-Cover texts being (a) (see below), and with the
14761 Back-Cover Texts being (b) (see below). A copy of the license is
14762 included in the gfdl(7) man page.
14763
14764 (a) The FSF's Front-Cover Text is:
14765
14766 A GNU Manual
14767
14768 (b) The FSF's Back-Cover Text is:
14769
14770 You have freedom to copy and modify this GNU Manual, like GNU
14771 software. Copies published by the Free Software Foundation raise
14772 funds for GNU development.
14773
14774
14775
14776gcc-4.5.0 2010-05-13 GCC(1)