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 -Wunused-but-set-parameter -Wunused-but-set-variable
132 -Wvariadic-macros -Wvla -Wvolatile-register-var -Wwrite-strings
133
134 C and Objective-C-only Warning Options
135 -Wbad-function-cast -Wmissing-declarations
136 -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs
137 -Wold-style-declaration -Wold-style-definition -Wstrict-prototypes
138 -Wtraditional -Wtraditional-conversion
139 -Wdeclaration-after-statement -Wpointer-sign
140
141 Debugging Options
142 -dletters -dumpspecs -dumpmachine -dumpversion -fdbg-cnt-list
143 -fdbg-cnt=counter-value-list -fdump-noaddr -fdump-unnumbered
144 -fdump-unnumbered-links -fdump-translation-unit[-n]
145 -fdump-class-hierarchy[-n] -fdump-ipa-all -fdump-ipa-cgraph
146 -fdump-ipa-inline -fdump-statistics -fdump-tree-all
147 -fdump-tree-original[-n] -fdump-tree-optimized[-n] -fdump-tree-cfg
148 -fdump-tree-vcg -fdump-tree-alias -fdump-tree-ch
149 -fdump-tree-ssa[-n] -fdump-tree-pre[-n] -fdump-tree-ccp[-n]
150 -fdump-tree-dce[-n] -fdump-tree-gimple[-raw]
151 -fdump-tree-mudflap[-n] -fdump-tree-dom[-n] -fdump-tree-dse[-n]
152 -fdump-tree-phiprop[-n] -fdump-tree-phiopt[-n]
153 -fdump-tree-forwprop[-n] -fdump-tree-copyrename[-n] -fdump-tree-nrv
154 -fdump-tree-vect -fdump-tree-sink -fdump-tree-sra[-n]
155 -fdump-tree-forwprop[-n] -fdump-tree-fre[-n] -fdump-tree-vrp[-n]
156 -ftree-vectorizer-verbose=n -fdump-tree-storeccp[-n]
157 -fdump-final-insns=file -fcompare-debug[=opts]
158 -fcompare-debug-second -feliminate-dwarf2-dups
159 -feliminate-unused-debug-types -feliminate-unused-debug-symbols
160 -femit-class-debug-always -fenable-icf-debug -fmem-report
161 -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs
162 -frandom-seed=string -fsched-verbose=n -fsel-sched-verbose
163 -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose -ftest-coverage
164 -ftime-report -fvar-tracking -fvar-tracking-assignments
165 -fvar-tracking-assignments-toggle -g -glevel -gtoggle -gcoff
166 -gdwarf-version -ggdb -gstabs -gstabs+ -gstrict-dwarf
167 -gno-strict-dwarf -gvms -gxcoff -gxcoff+ -fno-merge-debug-strings
168 -fno-dwarf2-cfi-asm -fdebug-prefix-map=old=new
169 -femit-struct-debug-baseonly -femit-struct-debug-reduced
170 -femit-struct-debug-detailed[=spec-list] -p -pg
171 -print-file-name=library -print-libgcc-file-name
172 -print-multi-directory -print-multi-lib -print-multi-os-directory
173 -print-prog-name=program -print-search-dirs -Q -print-sysroot
174 -print-sysroot-headers-suffix -save-temps -save-temps=cwd
175 -save-temps=obj -time[=file]
176
177 Optimization Options
178 -falign-functions[=n] -falign-jumps[=n] -falign-labels[=n]
179 -falign-loops[=n] -fassociative-math -fauto-inc-dec
180 -fbranch-probabilities -fbranch-target-load-optimize
181 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves
182 -fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping
183 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules
184 -fcx-limited-range -fdata-sections -fdce -fdce -fdelayed-branch
185 -fdelete-null-pointer-checks -fdse -fdse -fearly-inlining -fipa-sra
186 -fexpensive-optimizations -ffast-math -ffinite-math-only
187 -ffloat-store -fexcess-precision=style -fforward-propagate
188 -ffunction-sections -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm
189 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining
190 -finline-functions -finline-functions-called-once -finline-limit=n
191 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg
192 -fipa-pta -fipa-pure-const -fipa-reference -fipa-struct-reorg
193 -fipa-type-escape -fira-algorithm=algorithm -fira-region=region
194 -fira-coalesce -fira-loop-pressure -fno-ira-share-save-slots
195 -fno-ira-share-spill-slots -fira-verbose=n -fivopts
196 -fkeep-inline-functions -fkeep-static-consts -floop-block
197 -floop-interchange -floop-strip-mine -fgraphite-identity
198 -floop-parallelize-all -flto -flto-compression-level -flto-report
199 -fltrans -fltrans-output-list -fmerge-all-constants
200 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves
201 -fmove-loop-invariants -fmudflap -fmudflapir -fmudflapth
202 -fno-branch-count-reg -fno-default-inline -fno-defer-pop
203 -fno-function-cse -fno-guess-branch-probability -fno-inline
204 -fno-math-errno -fno-peephole -fno-peephole2 -fno-sched-interblock
205 -fno-sched-spec -fno-signed-zeros -fno-toplevel-reorder
206 -fno-trapping-math -fno-zero-initialized-in-bss
207 -fomit-frame-pointer -foptimize-register-move
208 -foptimize-sibling-calls -fpeel-loops -fpredictive-commoning
209 -fprefetch-loop-arrays -fprofile-correction -fprofile-dir=path
210 -fprofile-generate -fprofile-generate=path -fprofile-use
211 -fprofile-use=path -fprofile-values -freciprocal-math -fregmove
212 -frename-registers -freorder-blocks -freorder-blocks-and-partition
213 -freorder-functions -frerun-cse-after-loop
214 -freschedule-modulo-scheduled-loops -frounding-math
215 -fsched2-use-superblocks -fsched-pressure -fsched-spec-load
216 -fsched-spec-load-dangerous -fsched-stalled-insns-dep[=n]
217 -fsched-stalled-insns[=n] -fsched-group-heuristic
218 -fsched-critical-path-heuristic -fsched-spec-insn-heuristic
219 -fsched-rank-heuristic -fsched-last-insn-heuristic
220 -fsched-dep-count-heuristic -fschedule-insns -fschedule-insns2
221 -fsection-anchors -fselective-scheduling -fselective-scheduling2
222 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops
223 -fsignaling-nans -fsingle-precision-constant
224 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector
225 -fstack-protector-all -fstrict-aliasing -fstrict-overflow
226 -fthread-jumps -ftracer -ftree-builtin-call-dce -ftree-ccp
227 -ftree-ch -ftree-copy-prop -ftree-copyrename -ftree-dce
228 -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre
229 -ftree-loop-im -ftree-phiprop -ftree-loop-distribution
230 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize
231 -ftree-parallelize-loops=n -ftree-pre -ftree-pta -ftree-reassoc
232 -ftree-sink -ftree-sra -ftree-switch-conversion -ftree-ter
233 -ftree-vect-loop-version -ftree-vectorize -ftree-vrp
234 -funit-at-a-time -funroll-all-loops -funroll-loops
235 -funsafe-loop-optimizations -funsafe-math-optimizations
236 -funswitch-loops -fvariable-expansion-in-unroller -fvect-cost-model
237 -fvpt -fweb -fwhole-program -fwhopr -fwpa -fuse-linker-plugin
238 --param name=value -O -O0 -O1 -O2 -O3 -Os
239
240 Preprocessor Options
241 -Aquestion=answer -A-question[=answer] -C -dD -dI -dM -dN
242 -Dmacro[=defn] -E -H -idirafter dir -include file -imacros file
243 -iprefix file -iwithprefix dir -iwithprefixbefore dir -isystem
244 dir -imultilib dir -isysroot dir -M -MM -MF -MG -MP -MQ -MT
245 -nostdinc -P -fworking-directory -remap -trigraphs -undef
246 -Umacro -Wp,option -Xpreprocessor option
247
248 Assembler Option
249 -Wa,option -Xassembler option
250
251 Linker Options
252 object-file-name -llibrary -nostartfiles -nodefaultlibs
253 -nostdlib -pie -rdynamic -s -static -static-libgcc
254 -static-libstdc++ -shared -shared-libgcc -symbolic -T script
255 -Wl,option -Xlinker option -u symbol
256
257 Directory Options
258 -Bprefix -Idir -iquotedir -Ldir -specs=file -I- --sysroot=dir
259
260 Target Options
261 -V version -b machine
262
263 Machine Dependent Options
264 ARC Options -EB -EL -mmangle-cpu -mcpu=cpu -mtext=text-section
265 -mdata=data-section -mrodata=readonly-data-section
266
267 ARM Options -mapcs-frame -mno-apcs-frame -mabi=name
268 -mapcs-stack-check -mno-apcs-stack-check -mapcs-float
269 -mno-apcs-float -mapcs-reentrant -mno-apcs-reentrant
270 -msched-prolog -mno-sched-prolog -mlittle-endian -mbig-endian
271 -mwords-little-endian -mfloat-abi=name -msoft-float -mhard-float
272 -mfpe -mfp16-format=name -mthumb-interwork -mno-thumb-interwork
273 -mcpu=name -march=name -mfpu=name -mstructure-size-boundary=n
274 -mabort-on-noreturn -mlong-calls -mno-long-calls -msingle-pic-base
275 -mno-single-pic-base -mpic-register=reg -mnop-fun-dllimport
276 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns
277 -mpoke-function-name -mthumb -marm -mtpcs-frame -mtpcs-leaf-frame
278 -mcaller-super-interworking -mcallee-super-interworking -mtp=name
279 -mword-relocations -mfix-cortex-m3-ldrd
280
281 AVR Options -mmcu=mcu -mno-interrupts -mcall-prologues
282 -mtiny-stack -mint8
283
284 Blackfin Options -mcpu=cpu[-sirevision] -msim
285 -momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer
286 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly
287 -mno-csync-anomaly -mlow-64k -mno-low64k -mstack-check-l1
288 -mid-shared-library -mno-id-shared-library -mshared-library-id=n
289 -mleaf-id-shared-library -mno-leaf-id-shared-library -msep-data
290 -mno-sep-data -mlong-calls -mno-long-calls -mfast-fp -minline-plt
291 -mmulticore -mcorea -mcoreb -msdram -micplb
292
293 CRIS Options -mcpu=cpu -march=cpu -mtune=cpu -mmax-stack-frame=n
294 -melinux-stacksize=n -metrax4 -metrax100 -mpdebug -mcc-init
295 -mno-side-effects -mstack-align -mdata-align -mconst-align
296 -m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt
297 -melf -maout -melinux -mlinux -sim -sim2 -mmul-bug-workaround
298 -mno-mul-bug-workaround
299
300 CRX Options -mmac -mpush-args
301
302 Darwin Options -all_load -allowable_client -arch
303 -arch_errors_fatal -arch_only -bind_at_load -bundle
304 -bundle_loader -client_name -compatibility_version
305 -current_version -dead_strip -dependency-file -dylib_file
306 -dylinker_install_name -dynamic -dynamiclib
307 -exported_symbols_list -filelist -flat_namespace
308 -force_cpusubtype_ALL -force_flat_namespace
309 -headerpad_max_install_names -iframework -image_base -init
310 -install_name -keep_private_externs -multi_module
311 -multiply_defined -multiply_defined_unused -noall_load
312 -no_dead_strip_inits_and_terms -nofixprebinding -nomultidefs
313 -noprebind -noseglinkedit -pagezero_size -prebind
314 -prebind_all_twolevel_modules -private_bundle -read_only_relocs
315 -sectalign -sectobjectsymbols -whyload -seg1addr -sectcreate
316 -sectobjectsymbols -sectorder -segaddr -segs_read_only_addr
317 -segs_read_write_addr -seg_addr_table -seg_addr_table_filename
318 -seglinkedit -segprot -segs_read_only_addr -segs_read_write_addr
319 -single_module -static -sub_library -sub_umbrella
320 -twolevel_namespace -umbrella -undefined -unexported_symbols_list
321 -weak_reference_mismatches -whatsloaded -F -gused -gfull
322 -mmacosx-version-min=version -mkernel -mone-byte-bool
323
324 DEC Alpha Options -mno-fp-regs -msoft-float -malpha-as -mgas
325 -mieee -mieee-with-inexact -mieee-conformant -mfp-trap-mode=mode
326 -mfp-rounding-mode=mode -mtrap-precision=mode -mbuild-constants
327 -mcpu=cpu-type -mtune=cpu-type -mbwx -mmax -mfix -mcix
328 -mfloat-vax -mfloat-ieee -mexplicit-relocs -msmall-data
329 -mlarge-data -msmall-text -mlarge-text -mmemory-latency=time
330
331 DEC Alpha/VMS Options -mvms-return-codes -mdebug-main=prefix
332 -mmalloc64
333
334 FR30 Options -msmall-model -mno-lsim
335
336 FRV Options -mgpr-32 -mgpr-64 -mfpr-32 -mfpr-64 -mhard-float
337 -msoft-float -malloc-cc -mfixed-cc -mdword -mno-dword -mdouble
338 -mno-double -mmedia -mno-media -mmuladd -mno-muladd -mfdpic
339 -minline-plt -mgprel-ro -multilib-library-pic -mlinked-fp
340 -mlong-calls -malign-labels -mlibrary-pic -macc-4 -macc-8 -mpack
341 -mno-pack -mno-eflags -mcond-move -mno-cond-move
342 -moptimize-membar -mno-optimize-membar -mscc -mno-scc -mcond-exec
343 -mno-cond-exec -mvliw-branch -mno-vliw-branch -mmulti-cond-exec
344 -mno-multi-cond-exec -mnested-cond-exec -mno-nested-cond-exec
345 -mtomcat-stats -mTLS -mtls -mcpu=cpu
346
347 GNU/Linux Options -muclibc
348
349 H8/300 Options -mrelax -mh -ms -mn -mint32 -malign-300
350
351 HPPA Options -march=architecture-type -mbig-switch
352 -mdisable-fpregs -mdisable-indexing -mfast-indirect-calls -mgas
353 -mgnu-ld -mhp-ld -mfixed-range=register-range -mjump-in-delay
354 -mlinker-opt -mlong-calls -mlong-load-store -mno-big-switch
355 -mno-disable-fpregs -mno-disable-indexing -mno-fast-indirect-calls
356 -mno-gas -mno-jump-in-delay -mno-long-load-store
357 -mno-portable-runtime -mno-soft-float -mno-space-regs
358 -msoft-float -mpa-risc-1-0 -mpa-risc-1-1 -mpa-risc-2-0
359 -mportable-runtime -mschedule=cpu-type -mspace-regs -msio -mwsio
360 -munix=unix-std -nolibdld -static -threads
361
362 i386 and x86-64 Options -mtune=cpu-type -march=cpu-type
363 -mfpmath=unit -masm=dialect -mno-fancy-math-387 -mno-fp-ret-in-387
364 -msoft-float -mno-wide-multiply -mrtd -malign-double
365 -mpreferred-stack-boundary=num -mincoming-stack-boundary=num -mcld
366 -mcx16 -msahf -mmovbe -mcrc32 -mrecip -mmmx -msse -msse2 -msse3
367 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx -maes -mpclmul -mfused-madd
368 -msse4a -m3dnow -mpopcnt -mabm -mfma4 -mxop -mlwp -mthreads
369 -mno-align-stringops -minline-all-stringops
370 -minline-stringops-dynamically -mstringop-strategy=alg -mpush-args
371 -maccumulate-outgoing-args -m128bit-long-double
372 -m96bit-long-double -mregparm=num -msseregparm -mveclibabi=type
373 -mpc32 -mpc64 -mpc80 -mstackrealign -momit-leaf-frame-pointer
374 -mno-red-zone -mno-tls-direct-seg-refs -mcmodel=code-model
375 -mabi=name -m32 -m64 -mlarge-data-threshold=num -msse2avx
376
377 IA-64 Options -mbig-endian -mlittle-endian -mgnu-as -mgnu-ld
378 -mno-pic -mvolatile-asm-stop -mregister-names -msdata -mno-sdata
379 -mconstant-gp -mauto-pic -mfused-madd
380 -minline-float-divide-min-latency
381 -minline-float-divide-max-throughput -mno-inline-float-divide
382 -minline-int-divide-min-latency -minline-int-divide-max-throughput
383 -mno-inline-int-divide -minline-sqrt-min-latency
384 -minline-sqrt-max-throughput -mno-inline-sqrt -mdwarf2-asm
385 -mearly-stop-bits -mfixed-range=register-range -mtls-size=tls-size
386 -mtune=cpu-type -milp32 -mlp64 -msched-br-data-spec
387 -msched-ar-data-spec -msched-control-spec -msched-br-in-data-spec
388 -msched-ar-in-data-spec -msched-in-control-spec -msched-spec-ldc
389 -msched-spec-control-ldc -msched-prefer-non-data-spec-insns
390 -msched-prefer-non-control-spec-insns
391 -msched-stop-bits-after-every-cycle
392 -msched-count-spec-in-critical-path
393 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost
394 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=max-
395 insns
396
397 IA-64/VMS Options -mvms-return-codes -mdebug-main=prefix -mmalloc64
398
399 LM32 Options -mbarrel-shift-enabled -mdivide-enabled
400 -mmultiply-enabled -msign-extend-enabled -muser-enabled
401
402 M32R/D Options -m32r2 -m32rx -m32r -mdebug -malign-loops
403 -mno-align-loops -missue-rate=number -mbranch-cost=number
404 -mmodel=code-size-model-type -msdata=sdata-type -mno-flush-func
405 -mflush-func=name -mno-flush-trap -mflush-trap=number -G num
406
407 M32C Options -mcpu=cpu -msim -memregs=number
408
409 M680x0 Options -march=arch -mcpu=cpu -mtune=tune -m68000 -m68020
410 -m68020-40 -m68020-60 -m68030 -m68040 -m68060 -mcpu32 -m5200
411 -m5206e -m528x -m5307 -m5407 -mcfv4e -mbitfield -mno-bitfield
412 -mc68000 -mc68020 -mnobitfield -mrtd -mno-rtd -mdiv -mno-div
413 -mshort -mno-short -mhard-float -m68881 -msoft-float -mpcrel
414 -malign-int -mstrict-align -msep-data -mno-sep-data
415 -mshared-library-id=n -mid-shared-library -mno-id-shared-library
416 -mxgot -mno-xgot
417
418 M68hc1x Options -m6811 -m6812 -m68hc11 -m68hc12 -m68hcs12
419 -mauto-incdec -minmax -mlong-calls -mshort
420 -msoft-reg-count=count
421
422 MCore Options -mhardlit -mno-hardlit -mdiv -mno-div
423 -mrelax-immediates -mno-relax-immediates -mwide-bitfields
424 -mno-wide-bitfields -m4byte-functions -mno-4byte-functions
425 -mcallgraph-data -mno-callgraph-data -mslow-bytes -mno-slow-bytes
426 -mno-lsim -mlittle-endian -mbig-endian -m210 -m340
427 -mstack-increment
428
429 MeP Options -mabsdiff -mall-opts -maverage -mbased=n -mbitops -mc=n
430 -mclip -mconfig=name -mcop -mcop32 -mcop64 -mivc2 -mdc -mdiv -meb
431 -mel -mio-volatile -ml -mleadz -mm -mminmax -mmult -mno-opts
432 -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf -mtiny=n
433
434 MIPS Options -EL -EB -march=arch -mtune=arch -mips1 -mips2
435 -mips3 -mips4 -mips32 -mips32r2 -mips64 -mips64r2 -mips16
436 -mno-mips16 -mflip-mips16 -minterlink-mips16
437 -mno-interlink-mips16 -mabi=abi -mabicalls -mno-abicalls -mshared
438 -mno-shared -mplt -mno-plt -mxgot -mno-xgot -mgp32 -mgp64
439 -mfp32 -mfp64 -mhard-float -msoft-float -msingle-float
440 -mdouble-float -mdsp -mno-dsp -mdspr2 -mno-dspr2 -mfpu=fpu-type
441 -msmartmips -mno-smartmips -mpaired-single -mno-paired-single
442 -mdmx -mno-mdmx -mips3d -mno-mips3d -mmt -mno-mt -mllsc
443 -mno-llsc -mlong64 -mlong32 -msym32 -mno-sym32 -Gnum
444 -mlocal-sdata -mno-local-sdata -mextern-sdata -mno-extern-sdata
445 -mgpopt -mno-gopt -membedded-data -mno-embedded-data
446 -muninit-const-in-rodata -mno-uninit-const-in-rodata
447 -mcode-readable=setting -msplit-addresses -mno-split-addresses
448 -mexplicit-relocs -mno-explicit-relocs -mcheck-zero-division
449 -mno-check-zero-division -mdivide-traps -mdivide-breaks -mmemcpy
450 -mno-memcpy -mlong-calls -mno-long-calls -mmad -mno-mad
451 -mfused-madd -mno-fused-madd -nocpp -mfix-r4000 -mno-fix-r4000
452 -mfix-r4400 -mno-fix-r4400 -mfix-r10000 -mno-fix-r10000
453 -mfix-vr4120 -mno-fix-vr4120 -mfix-vr4130 -mno-fix-vr4130
454 -mfix-sb1 -mno-fix-sb1 -mflush-func=func -mno-flush-func
455 -mbranch-cost=num -mbranch-likely -mno-branch-likely
456 -mfp-exceptions -mno-fp-exceptions -mvr4130-align -mno-vr4130-align
457 -msynci -mno-synci -mrelax-pic-calls -mno-relax-pic-calls
458 -mmcount-ra-address
459
460 MMIX Options -mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon
461 -mabi=gnu -mabi=mmixware -mzero-extend -mknuthdiv
462 -mtoplevel-symbols -melf -mbranch-predict -mno-branch-predict
463 -mbase-addresses -mno-base-addresses -msingle-exit
464 -mno-single-exit
465
466 MN10300 Options -mmult-bug -mno-mult-bug -mam33 -mno-am33
467 -mam33-2 -mno-am33-2 -mreturn-pointer-on-d0 -mno-crt0 -mrelax
468
469 PDP-11 Options -mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45
470 -m10 -mbcopy -mbcopy-builtin -mint32 -mno-int16 -mint16
471 -mno-int32 -mfloat32 -mno-float64 -mfloat64 -mno-float32
472 -mabshi -mno-abshi -mbranch-expensive -mbranch-cheap -msplit
473 -mno-split -munix-asm -mdec-asm
474
475 picoChip Options -mae=ae_type -mvliw-lookahead=N
476 -msymbol-as-address -mno-inefficient-warnings
477
478 PowerPC Options See RS/6000 and PowerPC Options.
479
480 RS/6000 and PowerPC Options -mcpu=cpu-type -mtune=cpu-type -mpower
481 -mno-power -mpower2 -mno-power2 -mpowerpc -mpowerpc64
482 -mno-powerpc -maltivec -mno-altivec -mpowerpc-gpopt
483 -mno-powerpc-gpopt -mpowerpc-gfxopt -mno-powerpc-gfxopt -mmfcrf
484 -mno-mfcrf -mpopcntb -mno-popcntb -mpopcntd -mno-popcntd -mfprnd
485 -mno-fprnd -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp
486 -mno-hard-dfp -mnew-mnemonics -mold-mnemonics -mfull-toc
487 -mminimal-toc -mno-fp-in-toc -mno-sum-in-toc -m64 -m32
488 -mxl-compat -mno-xl-compat -mpe -malign-power -malign-natural
489 -msoft-float -mhard-float -mmultiple -mno-multiple
490 -msingle-float -mdouble-float -msimple-fpu -mstring -mno-string
491 -mupdate -mno-update -mavoid-indexed-addresses
492 -mno-avoid-indexed-addresses -mfused-madd -mno-fused-madd
493 -mbit-align -mno-bit-align -mstrict-align -mno-strict-align
494 -mrelocatable -mno-relocatable -mrelocatable-lib
495 -mno-relocatable-lib -mtoc -mno-toc -mlittle -mlittle-endian
496 -mbig -mbig-endian -mdynamic-no-pic -maltivec -mswdiv
497 -mprioritize-restricted-insns=priority
498 -msched-costly-dep=dependence_type -minsert-sched-nops=scheme
499 -mcall-sysv -mcall-netbsd -maix-struct-return
500 -msvr4-struct-return -mabi=abi-type -msecure-plt -mbss-plt -misel
501 -mno-isel -misel=yes -misel=no -mspe -mno-spe -mspe=yes -mspe=no
502 -mpaired -mgen-cell-microcode -mwarn-cell-microcode -mvrsave
503 -mno-vrsave -mmulhw -mno-mulhw -mdlmzb -mno-dlmzb -mfloat-gprs=yes
504 -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double -mprototype
505 -mno-prototype -msim -mmvme -mads -myellowknife -memb -msdata
506 -msdata=opt -mvxworks -G num -pthread
507
508 RX Options -m64bit-doubles -m32bit-doubles -fpu -nofpu -mcpu=
509 -patch= -mbig-endian-data -mlittle-endian-data -msmall-data -msim
510 -mno-sim -mas100-syntax -mno-as100-syntax -mrelax
511 -mmax-constant-size= -mint-register= -msave-acc-in-interrupts
512
513 S/390 and zSeries Options -mtune=cpu-type -march=cpu-type
514 -mhard-float -msoft-float -mhard-dfp -mno-hard-dfp
515 -mlong-double-64 -mlong-double-128 -mbackchain -mno-backchain
516 -mpacked-stack -mno-packed-stack -msmall-exec -mno-small-exec
517 -mmvcle -mno-mvcle -m64 -m31 -mdebug -mno-debug -mesa -mzarch
518 -mtpf-trace -mno-tpf-trace -mfused-madd -mno-fused-madd
519 -mwarn-framesize -mwarn-dynamicstack -mstack-size -mstack-guard
520
521 Score Options -meb -mel -mnhwloop -muls -mmac -mscore5 -mscore5u
522 -mscore7 -mscore7d
523
524 SH Options -m1 -m2 -m2e -m2a-nofpu -m2a-single-only -m2a-single
525 -m2a -m3 -m3e -m4-nofpu -m4-single-only -m4-single -m4
526 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al -m5-64media
527 -m5-64media-nofpu -m5-32media -m5-32media-nofpu -m5-compact
528 -m5-compact-nofpu -mb -ml -mdalign -mrelax -mbigtable -mfmovd
529 -mhitachi -mrenesas -mno-renesas -mnomacsave -mieee -mbitops
530 -misize -minline-ic_invalidate -mpadstruct -mspace -mprefergot
531 -musermode -multcost=number -mdiv=strategy -mdivsi3_libfunc=name
532 -mfixed-range=register-range -madjust-unroll -mindexed-addressing
533 -mgettrcost=number -mpt-fixed -minvalid-symbols
534
535 SPARC Options -mcpu=cpu-type -mtune=cpu-type -mcmodel=code-model
536 -m32 -m64 -mapp-regs -mno-app-regs -mfaster-structs
537 -mno-faster-structs -mfpu -mno-fpu -mhard-float -msoft-float
538 -mhard-quad-float -msoft-quad-float -mimpure-text
539 -mno-impure-text -mlittle-endian -mstack-bias -mno-stack-bias
540 -munaligned-doubles -mno-unaligned-doubles -mv8plus -mno-v8plus
541 -mvis -mno-vis -threads -pthreads -pthread
542
543 SPU Options -mwarn-reloc -merror-reloc -msafe-dma -munsafe-dma
544 -mbranch-hints -msmall-mem -mlarge-mem -mstdmain
545 -mfixed-range=register-range -mea32 -mea64
546 -maddress-space-conversion -mno-address-space-conversion
547 -mcache-size=cache-size -matomic-updates -mno-atomic-updates
548
549 System V Options -Qy -Qn -YP,paths -Ym,dir
550
551 V850 Options -mlong-calls -mno-long-calls -mep -mno-ep
552 -mprolog-function -mno-prolog-function -mspace -mtda=n -msda=n
553 -mzda=n -mapp-regs -mno-app-regs -mdisable-callt
554 -mno-disable-callt -mv850e1 -mv850e -mv850 -mbig-switch
555
556 VAX Options -mg -mgnu -munix
557
558 VxWorks Options -mrtp -non-static -Bstatic -Bdynamic -Xbind-lazy
559 -Xbind-now
560
561 x86-64 Options See i386 and x86-64 Options.
562
563 i386 and x86-64 Windows Options -mconsole -mcygwin -mno-cygwin
564 -mdll -mnop-fun-dllimport -mthread -municode -mwin32 -mwindows
565 -fno-set-stack-executable
566
567 Xstormy16 Options -msim
568
569 Xtensa Options -mconst16 -mno-const16 -mfused-madd -mno-fused-madd
570 -mserialize-volatile -mno-serialize-volatile
571 -mtext-section-literals -mno-text-section-literals -mtarget-align
572 -mno-target-align -mlongcalls -mno-longcalls
573
574 zSeries Options See S/390 and zSeries Options.
575
576 Code Generation Options
577 -fcall-saved-reg -fcall-used-reg -ffixed-reg -fexceptions
578 -fnon-call-exceptions -funwind-tables -fasynchronous-unwind-tables
579 -finhibit-size-directive -finstrument-functions
580 -finstrument-functions-exclude-function-list=sym,sym,...
581 -finstrument-functions-exclude-file-list=file,file,... -fno-common
582 -fno-ident -fpcc-struct-return -fpic -fPIC -fpie -fPIE
583 -fno-jump-tables -frecord-gcc-switches -freg-struct-return
584 -fshort-enums -fshort-double -fshort-wchar -fverbose-asm
585 -fpack-struct[=n] -fstack-check -fstack-limit-register=reg
586 -fstack-limit-symbol=sym -fno-stack-limit -fargument-alias
587 -fargument-noalias -fargument-noalias-global
588 -fargument-noalias-anything -fleading-underscore -ftls-model=model
589 -ftrapv -fwrapv -fbounds-check -fvisibility
590
591 Options Controlling the Kind of Output
592 Compilation can involve up to four stages: preprocessing, compilation
593 proper, assembly and linking, always in that order. GCC is capable of
594 preprocessing and compiling several files either into several assembler
595 input files, or into one assembler input file; then each assembler
596 input file produces an object file, and linking combines all the object
597 files (those newly compiled, and those specified as input) into an
598 executable file.
599
600 For any given input file, the file name suffix determines what kind of
601 compilation is done:
602
603 file.c
604 C source code which must be preprocessed.
605
606 file.i
607 C source code which should not be preprocessed.
608
609 file.ii
610 C++ source code which should not be preprocessed.
611
612 file.m
613 Objective-C source code. Note that you must link with the libobjc
614 library to make an Objective-C program work.
615
616 file.mi
617 Objective-C source code which should not be preprocessed.
618
619 file.mm
620 file.M
621 Objective-C++ source code. Note that you must link with the
622 libobjc library to make an Objective-C++ program work. Note that
623 .M refers to a literal capital M.
624
625 file.mii
626 Objective-C++ source code which should not be preprocessed.
627
628 file.h
629 C, C++, Objective-C or Objective-C++ header file to be turned into
630 a precompiled header.
631
632 file.cc
633 file.cp
634 file.cxx
635 file.cpp
636 file.CPP
637 file.c++
638 file.C
639 C++ source code which must be preprocessed. Note that in .cxx, the
640 last two letters must both be literally x. Likewise, .C refers to
641 a literal capital C.
642
643 file.mm
644 file.M
645 Objective-C++ source code which must be preprocessed.
646
647 file.mii
648 Objective-C++ source code which should not be preprocessed.
649
650 file.hh
651 file.H
652 file.hp
653 file.hxx
654 file.hpp
655 file.HPP
656 file.h++
657 file.tcc
658 C++ header file to be turned into a precompiled header.
659
660 file.f
661 file.for
662 file.ftn
663 Fixed form Fortran source code which should not be preprocessed.
664
665 file.F
666 file.FOR
667 file.fpp
668 file.FPP
669 file.FTN
670 Fixed form Fortran source code which must be preprocessed (with the
671 traditional preprocessor).
672
673 file.f90
674 file.f95
675 file.f03
676 file.f08
677 Free form Fortran source code which should not be preprocessed.
678
679 file.F90
680 file.F95
681 file.F03
682 file.F08
683 Free form Fortran source code which must be preprocessed (with the
684 traditional preprocessor).
685
686 file.ads
687 Ada source code file which contains a library unit declaration (a
688 declaration of a package, subprogram, or generic, or a generic
689 instantiation), or a library unit renaming declaration (a package,
690 generic, or subprogram renaming declaration). Such files are also
691 called specs.
692
693 file.adb
694 Ada source code file containing a library unit body (a subprogram
695 or package body). Such files are also called bodies.
696
697 file.s
698 Assembler code.
699
700 file.S
701 file.sx
702 Assembler code which must be preprocessed.
703
704 other
705 An object file to be fed straight into linking. Any file name with
706 no recognized suffix is treated this way.
707
708 You can specify the input language explicitly with the -x option:
709
710 -x language
711 Specify explicitly the language for the following input files
712 (rather than letting the compiler choose a default based on the
713 file name suffix). This option applies to all following input
714 files until the next -x option. Possible values for language are:
715
716 c c-header c-cpp-output
717 c++ c++-header c++-cpp-output
718 objective-c objective-c-header objective-c-cpp-output
719 objective-c++ objective-c++-header objective-c++-cpp-output
720 assembler assembler-with-cpp
721 ada
722 f77 f77-cpp-input f95 f95-cpp-input
723 java
724
725 -x none
726 Turn off any specification of a language, so that subsequent files
727 are handled according to their file name suffixes (as they are if
728 -x has not been used at all).
729
730 -pass-exit-codes
731 Normally the gcc program will exit with the code of 1 if any phase
732 of the compiler returns a non-success return code. If you specify
733 -pass-exit-codes, the gcc program will instead return with
734 numerically highest error produced by any phase that returned an
735 error indication. The C, C++, and Fortran frontends return 4, if
736 an internal compiler error is encountered.
737
738 If you only want some of the stages of compilation, you can use -x (or
739 filename suffixes) to tell gcc where to start, and one of the options
740 -c, -S, or -E to say where gcc is to stop. Note that some combinations
741 (for example, -x cpp-output -E) instruct gcc to do nothing at all.
742
743 -c Compile or assemble the source files, but do not link. The linking
744 stage simply is not done. The ultimate output is in the form of an
745 object file for each source file.
746
747 By default, the object file name for a source file is made by
748 replacing the suffix .c, .i, .s, etc., with .o.
749
750 Unrecognized input files, not requiring compilation or assembly,
751 are ignored.
752
753 -S Stop after the stage of compilation proper; do not assemble. The
754 output is in the form of an assembler code file for each non-
755 assembler input file specified.
756
757 By default, the assembler file name for a source file is made by
758 replacing the suffix .c, .i, etc., with .s.
759
760 Input files that don't require compilation are ignored.
761
762 -E Stop after the preprocessing stage; do not run the compiler proper.
763 The output is in the form of preprocessed source code, which is
764 sent to the standard output.
765
766 Input files which don't require preprocessing are ignored.
767
768 -o file
769 Place output in file file. This applies regardless to whatever
770 sort of output is being produced, whether it be an executable file,
771 an object file, an assembler file or preprocessed C code.
772
773 If -o is not specified, the default is to put an executable file in
774 a.out, the object file for source.suffix in source.o, its assembler
775 file in source.s, a precompiled header file in source.suffix.gch,
776 and all preprocessed C source on standard output.
777
778 -v Print (on standard error output) the commands executed to run the
779 stages of compilation. Also print the version number of the
780 compiler driver program and of the preprocessor and the compiler
781 proper.
782
783 -###
784 Like -v except the commands are not executed and all command
785 arguments are quoted. This is useful for shell scripts to capture
786 the driver-generated command lines.
787
788 -pipe
789 Use pipes rather than temporary files for communication between the
790 various stages of compilation. This fails to work on some systems
791 where the assembler is unable to read from a pipe; but the GNU
792 assembler has no trouble.
793
794 -combine
795 If you are compiling multiple source files, this option tells the
796 driver to pass all the source files to the compiler at once (for
797 those languages for which the compiler can handle this). This will
798 allow intermodule analysis (IMA) to be performed by the compiler.
799 Currently the only language for which this is supported is C. If
800 you pass source files for multiple languages to the driver, using
801 this option, the driver will invoke the compiler(s) that support
802 IMA once each, passing each compiler all the source files
803 appropriate for it. For those languages that do not support IMA
804 this option will be ignored, and the compiler will be invoked once
805 for each source file in that language. If you use this option in
806 conjunction with -save-temps, the compiler will generate multiple
807 pre-processed files (one for each source file), but only one
808 (combined) .o or .s file.
809
810 --help
811 Print (on the standard output) a description of the command line
812 options understood by gcc. If the -v option is also specified then
813 --help will also be passed on to the various processes invoked by
814 gcc, so that they can display the command line options they accept.
815 If the -Wextra option has also been specified (prior to the --help
816 option), then command line options which have no documentation
817 associated with them will also be displayed.
818
819 --target-help
820 Print (on the standard output) a description of target-specific
821 command line options for each tool. For some targets extra target-
822 specific information may also be printed.
823
824 --help={class|[^]qualifier}[,...]
825 Print (on the standard output) a description of the command line
826 options understood by the compiler that fit into all specified
827 classes and qualifiers. These are the supported classes:
828
829 optimizers
830 This will display all of the optimization options supported by
831 the compiler.
832
833 warnings
834 This will display all of the options controlling warning
835 messages produced by the compiler.
836
837 target
838 This will display target-specific options. Unlike the
839 --target-help option however, target-specific options of the
840 linker and assembler will not be displayed. This is because
841 those tools do not currently support the extended --help=
842 syntax.
843
844 params
845 This will display the values recognized by the --param option.
846
847 language
848 This will display the options supported for language, where
849 language is the name of one of the languages supported in this
850 version of GCC.
851
852 common
853 This will display the options that are common to all languages.
854
855 These are the supported qualifiers:
856
857 undocumented
858 Display only those options which are undocumented.
859
860 joined
861 Display options which take an argument that appears after an
862 equal sign in the same continuous piece of text, such as:
863 --help=target.
864
865 separate
866 Display options which take an argument that appears as a
867 separate word following the original option, such as: -o
868 output-file.
869
870 Thus for example to display all the undocumented target-specific
871 switches supported by the compiler the following can be used:
872
873 --help=target,undocumented
874
875 The sense of a qualifier can be inverted by prefixing it with the ^
876 character, so for example to display all binary warning options
877 (i.e., ones that are either on or off and that do not take an
878 argument), which have a description the following can be used:
879
880 --help=warnings,^joined,^undocumented
881
882 The argument to --help= should not consist solely of inverted
883 qualifiers.
884
885 Combining several classes is possible, although this usually
886 restricts the output by so much that there is nothing to display.
887 One case where it does work however is when one of the classes is
888 target. So for example to display all the target-specific
889 optimization options the following can be used:
890
891 --help=target,optimizers
892
893 The --help= option can be repeated on the command line. Each
894 successive use will display its requested class of options,
895 skipping those that have already been displayed.
896
897 If the -Q option appears on the command line before the --help=
898 option, then the descriptive text displayed by --help= is changed.
899 Instead of describing the displayed options, an indication is given
900 as to whether the option is enabled, disabled or set to a specific
901 value (assuming that the compiler knows this at the point where the
902 --help= option is used).
903
904 Here is a truncated example from the ARM port of gcc:
905
906 % gcc -Q -mabi=2 --help=target -c
907 The following options are target specific:
908 -mabi= 2
909 -mabort-on-noreturn [disabled]
910 -mapcs [disabled]
911
912 The output is sensitive to the effects of previous command line
913 options, so for example it is possible to find out which
914 optimizations are enabled at -O2 by using:
915
916 -Q -O2 --help=optimizers
917
918 Alternatively you can discover which binary optimizations are
919 enabled by -O3 by using:
920
921 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
922 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
923 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
924
925 -no-canonical-prefixes
926 Do not expand any symbolic links, resolve references to /../ or
927 /./, or make the path absolute when generating a relative prefix.
928
929 --version
930 Display the version number and copyrights of the invoked GCC.
931
932 -wrapper
933 Invoke all subcommands under a wrapper program. It takes a single
934 comma separated list as an argument, which will be used to invoke
935 the wrapper:
936
937 gcc -c t.c -wrapper gdb,--args
938
939 This will invoke all subprograms of gcc under "gdb --args", thus
940 cc1 invocation will be "gdb --args cc1 ...".
941
942 -fplugin=name.so
943 Load the plugin code in file name.so, assumed to be a shared object
944 to be dlopen'd by the compiler. The base name of the shared object
945 file is used to identify the plugin for the purposes of argument
946 parsing (See -fplugin-arg-name-key=value below). Each plugin
947 should define the callback functions specified in the Plugins API.
948
949 -fplugin-arg-name-key=value
950 Define an argument called key with a value of value for the plugin
951 called name.
952
953 @file
954 Read command-line options from file. The options read are inserted
955 in place of the original @file option. If file does not exist, or
956 cannot be read, then the option will be treated literally, and not
957 removed.
958
959 Options in file are separated by whitespace. A whitespace
960 character may be included in an option by surrounding the entire
961 option in either single or double quotes. Any character (including
962 a backslash) may be included by prefixing the character to be
963 included with a backslash. The file may itself contain additional
964 @file options; any such options will be processed recursively.
965
966 Compiling C++ Programs
967 C++ source files conventionally use one of the suffixes .C, .cc, .cpp,
968 .CPP, .c++, .cp, or .cxx; C++ header files often use .hh, .hpp, .H, or
969 (for shared template code) .tcc; and preprocessed C++ files use the
970 suffix .ii. GCC recognizes files with these names and compiles them as
971 C++ programs even if you call the compiler the same way as for
972 compiling C programs (usually with the name gcc).
973
974 However, the use of gcc does not add the C++ library. g++ is a program
975 that calls GCC and treats .c, .h and .i files as C++ source files
976 instead of C source files unless -x is used, and automatically
977 specifies linking against the C++ library. This program is also useful
978 when precompiling a C header file with a .h extension for use in C++
979 compilations. On many systems, g++ is also installed with the name
980 c++.
981
982 When you compile C++ programs, you may specify many of the same
983 command-line options that you use for compiling programs in any
984 language; or command-line options meaningful for C and related
985 languages; or options that are meaningful only for C++ programs.
986
987 Options Controlling C Dialect
988 The following options control the dialect of C (or languages derived
989 from C, such as C++, Objective-C and Objective-C++) that the compiler
990 accepts:
991
992 -ansi
993 In C mode, this is equivalent to -std=c90. In C++ mode, it is
994 equivalent to -std=c++98.
995
996 This turns off certain features of GCC that are incompatible with
997 ISO C90 (when compiling C code), or of standard C++ (when compiling
998 C++ code), such as the "asm" and "typeof" keywords, and predefined
999 macros such as "unix" and "vax" that identify the type of system
1000 you are using. It also enables the undesirable and rarely used ISO
1001 trigraph feature. For the C compiler, it disables recognition of
1002 C++ style // comments as well as the "inline" keyword.
1003
1004 The alternate keywords "__asm__", "__extension__", "__inline__" and
1005 "__typeof__" continue to work despite -ansi. You would not want to
1006 use them in an ISO C program, of course, but it is useful to put
1007 them in header files that might be included in compilations done
1008 with -ansi. Alternate predefined macros such as "__unix__" and
1009 "__vax__" are also available, with or without -ansi.
1010
1011 The -ansi option does not cause non-ISO programs to be rejected
1012 gratuitously. For that, -pedantic is required in addition to
1013 -ansi.
1014
1015 The macro "__STRICT_ANSI__" is predefined when the -ansi option is
1016 used. Some header files may notice this macro and refrain from
1017 declaring certain functions or defining certain macros that the ISO
1018 standard doesn't call for; this is to avoid interfering with any
1019 programs that might use these names for other things.
1020
1021 Functions that would normally be built in but do not have semantics
1022 defined by ISO C (such as "alloca" and "ffs") are not built-in
1023 functions when -ansi is used.
1024
1025 -std=
1026 Determine the language standard. This option is currently only
1027 supported when compiling C or C++.
1028
1029 The compiler can accept several base standards, such as c90 or
1030 c++98, and GNU dialects of those standards, such as gnu90 or
1031 gnu++98. By specifying a base standard, the compiler will accept
1032 all programs following that standard and those using GNU extensions
1033 that do not contradict it. For example, -std=c90 turns off certain
1034 features of GCC that are incompatible with ISO C90, such as the
1035 "asm" and "typeof" keywords, but not other GNU extensions that do
1036 not have a meaning in ISO C90, such as omitting the middle term of
1037 a "?:" expression. On the other hand, by specifying a GNU dialect
1038 of a standard, all features the compiler support are enabled, even
1039 when those features change the meaning of the base standard and
1040 some strict-conforming programs may be rejected. The particular
1041 standard is used by -pedantic to identify which features are GNU
1042 extensions given that version of the standard. For example
1043 -std=gnu90 -pedantic would warn about C++ style // comments, while
1044 -std=gnu99 -pedantic would not.
1045
1046 A value for this option must be provided; possible values are
1047
1048 c90
1049 c89
1050 iso9899:1990
1051 Support all ISO C90 programs (certain GNU extensions that
1052 conflict with ISO C90 are disabled). Same as -ansi for C code.
1053
1054 iso9899:199409
1055 ISO C90 as modified in amendment 1.
1056
1057 c99
1058 c9x
1059 iso9899:1999
1060 iso9899:199x
1061 ISO C99. Note that this standard is not yet fully supported;
1062 see <http://gcc.gnu.org/gcc-4.5/c99status.html> for more
1063 information. The names c9x and iso9899:199x are deprecated.
1064
1065 gnu90
1066 gnu89
1067 GNU dialect of ISO C90 (including some C99 features). This is
1068 the default for C code.
1069
1070 gnu99
1071 gnu9x
1072 GNU dialect of ISO C99. When ISO C99 is fully implemented in
1073 GCC, this will become the default. The name gnu9x is
1074 deprecated.
1075
1076 c++98
1077 The 1998 ISO C++ standard plus amendments. Same as -ansi for
1078 C++ code.
1079
1080 gnu++98
1081 GNU dialect of -std=c++98. This is the default for C++ code.
1082
1083 c++0x
1084 The working draft of the upcoming ISO C++0x standard. This
1085 option enables experimental features that are likely to be
1086 included in C++0x. The working draft is constantly changing,
1087 and any feature that is enabled by this flag may be removed
1088 from future versions of GCC if it is not part of the C++0x
1089 standard.
1090
1091 gnu++0x
1092 GNU dialect of -std=c++0x. This option enables experimental
1093 features that may be removed in future versions of GCC.
1094
1095 -fgnu89-inline
1096 The option -fgnu89-inline tells GCC to use the traditional GNU
1097 semantics for "inline" functions when in C99 mode.
1098 This option is accepted and ignored by GCC versions 4.1.3 up to
1099 but not including 4.3. In GCC versions 4.3 and later it changes
1100 the behavior of GCC in C99 mode. Using this option is roughly
1101 equivalent to adding the "gnu_inline" function attribute to all
1102 inline functions.
1103
1104 The option -fno-gnu89-inline explicitly tells GCC to use the C99
1105 semantics for "inline" when in C99 or gnu99 mode (i.e., it
1106 specifies the default behavior). This option was first supported
1107 in GCC 4.3. This option is not supported in -std=c90 or -std=gnu90
1108 mode.
1109
1110 The preprocessor macros "__GNUC_GNU_INLINE__" and
1111 "__GNUC_STDC_INLINE__" may be used to check which semantics are in
1112 effect for "inline" functions.
1113
1114 -aux-info filename
1115 Output to the given filename prototyped declarations for all
1116 functions declared and/or defined in a translation unit, including
1117 those in header files. This option is silently ignored in any
1118 language other than C.
1119
1120 Besides declarations, the file indicates, in comments, the origin
1121 of each declaration (source file and line), whether the declaration
1122 was implicit, prototyped or unprototyped (I, N for new or O for
1123 old, respectively, in the first character after the line number and
1124 the colon), and whether it came from a declaration or a definition
1125 (C or F, respectively, in the following character). In the case of
1126 function definitions, a K&R-style list of arguments followed by
1127 their declarations is also provided, inside comments, after the
1128 declaration.
1129
1130 -fno-asm
1131 Do not recognize "asm", "inline" or "typeof" as a keyword, so that
1132 code can use these words as identifiers. You can use the keywords
1133 "__asm__", "__inline__" and "__typeof__" instead. -ansi implies
1134 -fno-asm.
1135
1136 In C++, this switch only affects the "typeof" keyword, since "asm"
1137 and "inline" are standard keywords. You may want to use the
1138 -fno-gnu-keywords flag instead, which has the same effect. In C99
1139 mode (-std=c99 or -std=gnu99), this switch only affects the "asm"
1140 and "typeof" keywords, since "inline" is a standard keyword in ISO
1141 C99.
1142
1143 -fno-builtin
1144 -fno-builtin-function
1145 Don't recognize built-in functions that do not begin with
1146 __builtin_ as prefix.
1147
1148 GCC normally generates special code to handle certain built-in
1149 functions more efficiently; for instance, calls to "alloca" may
1150 become single instructions that adjust the stack directly, and
1151 calls to "memcpy" may become inline copy loops. The resulting code
1152 is often both smaller and faster, but since the function calls no
1153 longer appear as such, you cannot set a breakpoint on those calls,
1154 nor can you change the behavior of the functions by linking with a
1155 different library. In addition, when a function is recognized as a
1156 built-in function, GCC may use information about that function to
1157 warn about problems with calls to that function, or to generate
1158 more efficient code, even if the resulting code still contains
1159 calls to that function. For example, warnings are given with
1160 -Wformat for bad calls to "printf", when "printf" is built in, and
1161 "strlen" is known not to modify global memory.
1162
1163 With the -fno-builtin-function option only the built-in function
1164 function is disabled. function must not begin with __builtin_. If
1165 a function is named that is not built-in in this version of GCC,
1166 this option is ignored. There is no corresponding
1167 -fbuiltin-function option; if you wish to enable built-in functions
1168 selectively when using -fno-builtin or -ffreestanding, you may
1169 define macros such as:
1170
1171 #define abs(n) __builtin_abs ((n))
1172 #define strcpy(d, s) __builtin_strcpy ((d), (s))
1173
1174 -fhosted
1175 Assert that compilation takes place in a hosted environment. This
1176 implies -fbuiltin. A hosted environment is one in which the entire
1177 standard library is available, and in which "main" has a return
1178 type of "int". Examples are nearly everything except a kernel.
1179 This is equivalent to -fno-freestanding.
1180
1181 -ffreestanding
1182 Assert that compilation takes place in a freestanding environment.
1183 This implies -fno-builtin. A freestanding environment is one in
1184 which the standard library may not exist, and program startup may
1185 not necessarily be at "main". The most obvious example is an OS
1186 kernel. This is equivalent to -fno-hosted.
1187
1188 -fopenmp
1189 Enable handling of OpenMP directives "#pragma omp" in C/C++ and
1190 "!$omp" in Fortran. When -fopenmp is specified, the compiler
1191 generates parallel code according to the OpenMP Application Program
1192 Interface v3.0 <http://www.openmp.org/>. This option implies
1193 -pthread, and thus is only supported on targets that have support
1194 for -pthread.
1195
1196 -fms-extensions
1197 Accept some non-standard constructs used in Microsoft header files.
1198
1199 Some cases of unnamed fields in structures and unions are only
1200 accepted with this option.
1201
1202 -trigraphs
1203 Support ISO C trigraphs. The -ansi option (and -std options for
1204 strict ISO C conformance) implies -trigraphs.
1205
1206 -no-integrated-cpp
1207 Performs a compilation in two passes: preprocessing and compiling.
1208 This option allows a user supplied "cc1", "cc1plus", or "cc1obj"
1209 via the -B option. The user supplied compilation step can then add
1210 in an additional preprocessing step after normal preprocessing but
1211 before compiling. The default is to use the integrated cpp
1212 (internal cpp)
1213
1214 The semantics of this option will change if "cc1", "cc1plus", and
1215 "cc1obj" are merged.
1216
1217 -traditional
1218 -traditional-cpp
1219 Formerly, these options caused GCC to attempt to emulate a pre-
1220 standard C compiler. They are now only supported with the -E
1221 switch. The preprocessor continues to support a pre-standard mode.
1222 See the GNU CPP manual for details.
1223
1224 -fcond-mismatch
1225 Allow conditional expressions with mismatched types in the second
1226 and third arguments. The value of such an expression is void.
1227 This option is not supported for C++.
1228
1229 -flax-vector-conversions
1230 Allow implicit conversions between vectors with differing numbers
1231 of elements and/or incompatible element types. This option should
1232 not be used for new code.
1233
1234 -funsigned-char
1235 Let the type "char" be unsigned, like "unsigned char".
1236
1237 Each kind of machine has a default for what "char" should be. It
1238 is either like "unsigned char" by default or like "signed char" by
1239 default.
1240
1241 Ideally, a portable program should always use "signed char" or
1242 "unsigned char" when it depends on the signedness of an object.
1243 But many programs have been written to use plain "char" and expect
1244 it to be signed, or expect it to be unsigned, depending on the
1245 machines they were written for. This option, and its inverse, let
1246 you make such a program work with the opposite default.
1247
1248 The type "char" is always a distinct type from each of "signed
1249 char" or "unsigned char", even though its behavior is always just
1250 like one of those two.
1251
1252 -fsigned-char
1253 Let the type "char" be signed, like "signed char".
1254
1255 Note that this is equivalent to -fno-unsigned-char, which is the
1256 negative form of -funsigned-char. Likewise, the option
1257 -fno-signed-char is equivalent to -funsigned-char.
1258
1259 -fsigned-bitfields
1260 -funsigned-bitfields
1261 -fno-signed-bitfields
1262 -fno-unsigned-bitfields
1263 These options control whether a bit-field is signed or unsigned,
1264 when the declaration does not use either "signed" or "unsigned".
1265 By default, such a bit-field is signed, because this is consistent:
1266 the basic integer types such as "int" are signed types.
1267
1268 Options Controlling C++ Dialect
1269 This section describes the command-line options that are only
1270 meaningful for C++ programs; but you can also use most of the GNU
1271 compiler options regardless of what language your program is in. For
1272 example, you might compile a file "firstClass.C" like this:
1273
1274 g++ -g -frepo -O -c firstClass.C
1275
1276 In this example, only -frepo is an option meant only for C++ programs;
1277 you can use the other options with any language supported by GCC.
1278
1279 Here is a list of options that are only for compiling C++ programs:
1280
1281 -fabi-version=n
1282 Use version n of the C++ ABI. Version 2 is the version of the C++
1283 ABI that first appeared in G++ 3.4. Version 1 is the version of
1284 the C++ ABI that first appeared in G++ 3.2. Version 0 will always
1285 be the version that conforms most closely to the C++ ABI
1286 specification. Therefore, the ABI obtained using version 0 will
1287 change as ABI bugs are fixed.
1288
1289 The default is version 2.
1290
1291 Version 3 corrects an error in mangling a constant address as a
1292 template argument.
1293
1294 Version 4 implements a standard mangling for vector types.
1295
1296 See also -Wabi.
1297
1298 -fno-access-control
1299 Turn off all access checking. This switch is mainly useful for
1300 working around bugs in the access control code.
1301
1302 -fcheck-new
1303 Check that the pointer returned by "operator new" is non-null
1304 before attempting to modify the storage allocated. This check is
1305 normally unnecessary because the C++ standard specifies that
1306 "operator new" will only return 0 if it is declared throw(), in
1307 which case the compiler will always check the return value even
1308 without this option. In all other cases, when "operator new" has a
1309 non-empty exception specification, memory exhaustion is signalled
1310 by throwing "std::bad_alloc". See also new (nothrow).
1311
1312 -fconserve-space
1313 Put uninitialized or runtime-initialized global variables into the
1314 common segment, as C does. This saves space in the executable at
1315 the cost of not diagnosing duplicate definitions. If you compile
1316 with this flag and your program mysteriously crashes after "main()"
1317 has completed, you may have an object that is being destroyed twice
1318 because two definitions were merged.
1319
1320 This option is no longer useful on most targets, now that support
1321 has been added for putting variables into BSS without making them
1322 common.
1323
1324 -fno-deduce-init-list
1325 Disable deduction of a template type parameter as
1326 std::initializer_list from a brace-enclosed initializer list, i.e.
1327
1328 template <class T> auto forward(T t) -> decltype (realfn (t))
1329 {
1330 return realfn (t);
1331 }
1332
1333 void f()
1334 {
1335 forward({1,2}); // call forward<std::initializer_list<int>>
1336 }
1337
1338 This option is present because this deduction is an extension to
1339 the current specification in the C++0x working draft, and there was
1340 some concern about potential overload resolution problems.
1341
1342 -ffriend-injection
1343 Inject friend functions into the enclosing namespace, so that they
1344 are visible outside the scope of the class in which they are
1345 declared. Friend functions were documented to work this way in the
1346 old Annotated C++ Reference Manual, and versions of G++ before 4.1
1347 always worked that way. However, in ISO C++ a friend function
1348 which is not declared in an enclosing scope can only be found using
1349 argument dependent lookup. This option causes friends to be
1350 injected as they were in earlier releases.
1351
1352 This option is for compatibility, and may be removed in a future
1353 release of G++.
1354
1355 -fno-elide-constructors
1356 The C++ standard allows an implementation to omit creating a
1357 temporary which is only used to initialize another object of the
1358 same type. Specifying this option disables that optimization, and
1359 forces G++ to call the copy constructor in all cases.
1360
1361 -fno-enforce-eh-specs
1362 Don't generate code to check for violation of exception
1363 specifications at runtime. This option violates the C++ standard,
1364 but may be useful for reducing code size in production builds, much
1365 like defining NDEBUG. This does not give user code permission to
1366 throw exceptions in violation of the exception specifications; the
1367 compiler will still optimize based on the specifications, so
1368 throwing an unexpected exception will result in undefined behavior.
1369
1370 -ffor-scope
1371 -fno-for-scope
1372 If -ffor-scope is specified, the scope of variables declared in a
1373 for-init-statement is limited to the for loop itself, as specified
1374 by the C++ standard. If -fno-for-scope is specified, the scope of
1375 variables declared in a for-init-statement extends to the end of
1376 the enclosing scope, as was the case in old versions of G++, and
1377 other (traditional) implementations of C++.
1378
1379 The default if neither flag is given to follow the standard, but to
1380 allow and give a warning for old-style code that would otherwise be
1381 invalid, or have different behavior.
1382
1383 -fno-gnu-keywords
1384 Do not recognize "typeof" as a keyword, so that code can use this
1385 word as an identifier. You can use the keyword "__typeof__"
1386 instead. -ansi implies -fno-gnu-keywords.
1387
1388 -fno-implicit-templates
1389 Never emit code for non-inline templates which are instantiated
1390 implicitly (i.e. by use); only emit code for explicit
1391 instantiations.
1392
1393 -fno-implicit-inline-templates
1394 Don't emit code for implicit instantiations of inline templates,
1395 either. The default is to handle inlines differently so that
1396 compiles with and without optimization will need the same set of
1397 explicit instantiations.
1398
1399 -fno-implement-inlines
1400 To save space, do not emit out-of-line copies of inline functions
1401 controlled by #pragma implementation. This will cause linker
1402 errors if these functions are not inlined everywhere they are
1403 called.
1404
1405 -fms-extensions
1406 Disable pedantic warnings about constructs used in MFC, such as
1407 implicit int and getting a pointer to member function via non-
1408 standard syntax.
1409
1410 -fno-nonansi-builtins
1411 Disable built-in declarations of functions that are not mandated by
1412 ANSI/ISO C. These include "ffs", "alloca", "_exit", "index",
1413 "bzero", "conjf", and other related functions.
1414
1415 -fno-operator-names
1416 Do not treat the operator name keywords "and", "bitand", "bitor",
1417 "compl", "not", "or" and "xor" as synonyms as keywords.
1418
1419 -fno-optional-diags
1420 Disable diagnostics that the standard says a compiler does not need
1421 to issue. Currently, the only such diagnostic issued by G++ is the
1422 one for a name having multiple meanings within a class.
1423
1424 -fpermissive
1425 Downgrade some diagnostics about nonconformant code from errors to
1426 warnings. Thus, using -fpermissive will allow some nonconforming
1427 code to compile.
1428
1429 -fno-pretty-templates
1430 When an error message refers to a specialization of a function
1431 template, the compiler will normally print the signature of the
1432 template followed by the template arguments and any typedefs or
1433 typenames in the signature (e.g. "void f(T) [with T = int]" rather
1434 than "void f(int)") so that it's clear which template is involved.
1435 When an error message refers to a specialization of a class
1436 template, the compiler will omit any template arguments which match
1437 the default template arguments for that template. If either of
1438 these behaviors make it harder to understand the error message
1439 rather than easier, using -fno-pretty-templates will disable them.
1440
1441 -frepo
1442 Enable automatic template instantiation at link time. This option
1443 also implies -fno-implicit-templates.
1444
1445 -fno-rtti
1446 Disable generation of information about every class with virtual
1447 functions for use by the C++ runtime type identification features
1448 (dynamic_cast and typeid). If you don't use those parts of the
1449 language, you can save some space by using this flag. Note that
1450 exception handling uses the same information, but it will generate
1451 it as needed. The dynamic_cast operator can still be used for casts
1452 that do not require runtime type information, i.e. casts to "void
1453 *" or to unambiguous base classes.
1454
1455 -fstats
1456 Emit statistics about front-end processing at the end of the
1457 compilation. This information is generally only useful to the G++
1458 development team.
1459
1460 -ftemplate-depth=n
1461 Set the maximum instantiation depth for template classes to n. A
1462 limit on the template instantiation depth is needed to detect
1463 endless recursions during template class instantiation. ANSI/ISO
1464 C++ conforming programs must not rely on a maximum depth greater
1465 than 17 (changed to 1024 in C++0x).
1466
1467 -fno-threadsafe-statics
1468 Do not emit the extra code to use the routines specified in the C++
1469 ABI for thread-safe initialization of local statics. You can use
1470 this option to reduce code size slightly in code that doesn't need
1471 to be thread-safe.
1472
1473 -fuse-cxa-atexit
1474 Register destructors for objects with static storage duration with
1475 the "__cxa_atexit" function rather than the "atexit" function.
1476 This option is required for fully standards-compliant handling of
1477 static destructors, but will only work if your C library supports
1478 "__cxa_atexit".
1479
1480 -fno-use-cxa-get-exception-ptr
1481 Don't use the "__cxa_get_exception_ptr" runtime routine. This will
1482 cause "std::uncaught_exception" to be incorrect, but is necessary
1483 if the runtime routine is not available.
1484
1485 -fvisibility-inlines-hidden
1486 This switch declares that the user does not attempt to compare
1487 pointers to inline methods where the addresses of the two functions
1488 were taken in different shared objects.
1489
1490 The effect of this is that GCC may, effectively, mark inline
1491 methods with "__attribute__ ((visibility ("hidden")))" so that they
1492 do not appear in the export table of a DSO and do not require a PLT
1493 indirection when used within the DSO. Enabling this option can
1494 have a dramatic effect on load and link times of a DSO as it
1495 massively reduces the size of the dynamic export table when the
1496 library makes heavy use of templates.
1497
1498 The behavior of this switch is not quite the same as marking the
1499 methods as hidden directly, because it does not affect static
1500 variables local to the function or cause the compiler to deduce
1501 that the function is defined in only one shared object.
1502
1503 You may mark a method as having a visibility explicitly to negate
1504 the effect of the switch for that method. For example, if you do
1505 want to compare pointers to a particular inline method, you might
1506 mark it as having default visibility. Marking the enclosing class
1507 with explicit visibility will have no effect.
1508
1509 Explicitly instantiated inline methods are unaffected by this
1510 option as their linkage might otherwise cross a shared library
1511 boundary.
1512
1513 -fvisibility-ms-compat
1514 This flag attempts to use visibility settings to make GCC's C++
1515 linkage model compatible with that of Microsoft Visual Studio.
1516
1517 The flag makes these changes to GCC's linkage model:
1518
1519 1. It sets the default visibility to "hidden", like
1520 -fvisibility=hidden.
1521
1522 2. Types, but not their members, are not hidden by default.
1523
1524 3. The One Definition Rule is relaxed for types without explicit
1525 visibility specifications which are defined in more than one
1526 different shared object: those declarations are permitted if
1527 they would have been permitted when this option was not used.
1528
1529 In new code it is better to use -fvisibility=hidden and export
1530 those classes which are intended to be externally visible.
1531 Unfortunately it is possible for code to rely, perhaps
1532 accidentally, on the Visual Studio behavior.
1533
1534 Among the consequences of these changes are that static data
1535 members of the same type with the same name but defined in
1536 different shared objects will be different, so changing one will
1537 not change the other; and that pointers to function members defined
1538 in different shared objects may not compare equal. When this flag
1539 is given, it is a violation of the ODR to define types with the
1540 same name differently.
1541
1542 -fno-weak
1543 Do not use weak symbol support, even if it is provided by the
1544 linker. By default, G++ will use weak symbols if they are
1545 available. This option exists only for testing, and should not be
1546 used by end-users; it will result in inferior code and has no
1547 benefits. This option may be removed in a future release of G++.
1548
1549 -nostdinc++
1550 Do not search for header files in the standard directories specific
1551 to C++, but do still search the other standard directories. (This
1552 option is used when building the C++ library.)
1553
1554 In addition, these optimization, warning, and code generation options
1555 have meanings only for C++ programs:
1556
1557 -fno-default-inline
1558 Do not assume inline for functions defined inside a class scope.
1559 Note that these functions will have linkage like inline
1560 functions; they just won't be inlined by default.
1561
1562 -Wabi (C, Objective-C, C++ and Objective-C++ only)
1563 Warn when G++ generates code that is probably not compatible with
1564 the vendor-neutral C++ ABI. Although an effort has been made to
1565 warn about all such cases, there are probably some cases that are
1566 not warned about, even though G++ is generating incompatible code.
1567 There may also be cases where warnings are emitted even though the
1568 code that is generated will be compatible.
1569
1570 You should rewrite your code to avoid these warnings if you are
1571 concerned about the fact that code generated by G++ may not be
1572 binary compatible with code generated by other compilers.
1573
1574 The known incompatibilities in -fabi-version=2 (the default)
1575 include:
1576
1577 · A template with a non-type template parameter of reference type
1578 is mangled incorrectly:
1579
1580 extern int N;
1581 template <int &> struct S {};
1582 void n (S<N>) {2}
1583
1584 This is fixed in -fabi-version=3.
1585
1586 · SIMD vector types declared using "__attribute ((vector_size))"
1587 are mangled in a non-standard way that does not allow for
1588 overloading of functions taking vectors of different sizes.
1589
1590 The mangling is changed in -fabi-version=4.
1591
1592 The known incompatibilities in -fabi-version=1 include:
1593
1594 · Incorrect handling of tail-padding for bit-fields. G++ may
1595 attempt to pack data into the same byte as a base class. For
1596 example:
1597
1598 struct A { virtual void f(); int f1 : 1; };
1599 struct B : public A { int f2 : 1; };
1600
1601 In this case, G++ will place "B::f2" into the same byte
1602 as"A::f1"; other compilers will not. You can avoid this
1603 problem by explicitly padding "A" so that its size is a
1604 multiple of the byte size on your platform; that will cause G++
1605 and other compilers to layout "B" identically.
1606
1607 · Incorrect handling of tail-padding for virtual bases. G++ does
1608 not use tail padding when laying out virtual bases. For
1609 example:
1610
1611 struct A { virtual void f(); char c1; };
1612 struct B { B(); char c2; };
1613 struct C : public A, public virtual B {};
1614
1615 In this case, G++ will not place "B" into the tail-padding for
1616 "A"; other compilers will. You can avoid this problem by
1617 explicitly padding "A" so that its size is a multiple of its
1618 alignment (ignoring virtual base classes); that will cause G++
1619 and other compilers to layout "C" identically.
1620
1621 · Incorrect handling of bit-fields with declared widths greater
1622 than that of their underlying types, when the bit-fields appear
1623 in a union. For example:
1624
1625 union U { int i : 4096; };
1626
1627 Assuming that an "int" does not have 4096 bits, G++ will make
1628 the union too small by the number of bits in an "int".
1629
1630 · Empty classes can be placed at incorrect offsets. For example:
1631
1632 struct A {};
1633
1634 struct B {
1635 A a;
1636 virtual void f ();
1637 };
1638
1639 struct C : public B, public A {};
1640
1641 G++ will place the "A" base class of "C" at a nonzero offset;
1642 it should be placed at offset zero. G++ mistakenly believes
1643 that the "A" data member of "B" is already at offset zero.
1644
1645 · Names of template functions whose types involve "typename" or
1646 template template parameters can be mangled incorrectly.
1647
1648 template <typename Q>
1649 void f(typename Q::X) {}
1650
1651 template <template <typename> class Q>
1652 void f(typename Q<int>::X) {}
1653
1654 Instantiations of these templates may be mangled incorrectly.
1655
1656 It also warns psABI related changes. The known psABI changes at
1657 this point include:
1658
1659 · For SYSV/x86-64, when passing union with long double, it is
1660 changed to pass in memory as specified in psABI. For example:
1661
1662 union U {
1663 long double ld;
1664 int i;
1665 };
1666
1667 "union U" will always be passed in memory.
1668
1669 -Wctor-dtor-privacy (C++ and Objective-C++ only)
1670 Warn when a class seems unusable because all the constructors or
1671 destructors in that class are private, and it has neither friends
1672 nor public static member functions.
1673
1674 -Wnon-virtual-dtor (C++ and Objective-C++ only)
1675 Warn when a class has virtual functions and accessible non-virtual
1676 destructor, in which case it would be possible but unsafe to delete
1677 an instance of a derived class through a pointer to the base class.
1678 This warning is also enabled if -Weffc++ is specified.
1679
1680 -Wreorder (C++ and Objective-C++ only)
1681 Warn when the order of member initializers given in the code does
1682 not match the order in which they must be executed. For instance:
1683
1684 struct A {
1685 int i;
1686 int j;
1687 A(): j (0), i (1) { }
1688 };
1689
1690 The compiler will rearrange the member initializers for i and j to
1691 match the declaration order of the members, emitting a warning to
1692 that effect. This warning is enabled by -Wall.
1693
1694 The following -W... options are not affected by -Wall.
1695
1696 -Weffc++ (C++ and Objective-C++ only)
1697 Warn about violations of the following style guidelines from Scott
1698 Meyers' Effective C++ book:
1699
1700 · Item 11: Define a copy constructor and an assignment operator
1701 for classes with dynamically allocated memory.
1702
1703 · Item 12: Prefer initialization to assignment in constructors.
1704
1705 · Item 14: Make destructors virtual in base classes.
1706
1707 · Item 15: Have "operator=" return a reference to *this.
1708
1709 · Item 23: Don't try to return a reference when you must return
1710 an object.
1711
1712 Also warn about violations of the following style guidelines from
1713 Scott Meyers' More Effective C++ book:
1714
1715 · Item 6: Distinguish between prefix and postfix forms of
1716 increment and decrement operators.
1717
1718 · Item 7: Never overload "&&", "||", or ",".
1719
1720 When selecting this option, be aware that the standard library
1721 headers do not obey all of these guidelines; use grep -v to filter
1722 out those warnings.
1723
1724 -Wstrict-null-sentinel (C++ and Objective-C++ only)
1725 Warn also about the use of an uncasted "NULL" as sentinel. When
1726 compiling only with GCC this is a valid sentinel, as "NULL" is
1727 defined to "__null". Although it is a null pointer constant not a
1728 null pointer, it is guaranteed to be of the same size as a pointer.
1729 But this use is not portable across different compilers.
1730
1731 -Wno-non-template-friend (C++ and Objective-C++ only)
1732 Disable warnings when non-templatized friend functions are declared
1733 within a template. Since the advent of explicit template
1734 specification support in G++, if the name of the friend is an
1735 unqualified-id (i.e., friend foo(int)), the C++ language
1736 specification demands that the friend declare or define an
1737 ordinary, nontemplate function. (Section 14.5.3). Before G++
1738 implemented explicit specification, unqualified-ids could be
1739 interpreted as a particular specialization of a templatized
1740 function. Because this non-conforming behavior is no longer the
1741 default behavior for G++, -Wnon-template-friend allows the compiler
1742 to check existing code for potential trouble spots and is on by
1743 default. This new compiler behavior can be turned off with
1744 -Wno-non-template-friend which keeps the conformant compiler code
1745 but disables the helpful warning.
1746
1747 -Wold-style-cast (C++ and Objective-C++ only)
1748 Warn if an old-style (C-style) cast to a non-void type is used
1749 within a C++ program. The new-style casts (dynamic_cast,
1750 static_cast, reinterpret_cast, and const_cast) are less vulnerable
1751 to unintended effects and much easier to search for.
1752
1753 -Woverloaded-virtual (C++ and Objective-C++ only)
1754 Warn when a function declaration hides virtual functions from a
1755 base class. For example, in:
1756
1757 struct A {
1758 virtual void f();
1759 };
1760
1761 struct B: public A {
1762 void f(int);
1763 };
1764
1765 the "A" class version of "f" is hidden in "B", and code like:
1766
1767 B* b;
1768 b->f();
1769
1770 will fail to compile.
1771
1772 -Wno-pmf-conversions (C++ and Objective-C++ only)
1773 Disable the diagnostic for converting a bound pointer to member
1774 function to a plain pointer.
1775
1776 -Wsign-promo (C++ and Objective-C++ only)
1777 Warn when overload resolution chooses a promotion from unsigned or
1778 enumerated type to a signed type, over a conversion to an unsigned
1779 type of the same size. Previous versions of G++ would try to
1780 preserve unsignedness, but the standard mandates the current
1781 behavior.
1782
1783 struct A {
1784 operator int ();
1785 A& operator = (int);
1786 };
1787
1788 main ()
1789 {
1790 A a,b;
1791 a = b;
1792 }
1793
1794 In this example, G++ will synthesize a default A& operator = (const
1795 A&);, while cfront will use the user-defined operator =.
1796
1797 Options Controlling Objective-C and Objective-C++ Dialects
1798 (NOTE: This manual does not describe the Objective-C and Objective-C++
1799 languages themselves. See
1800
1801 This section describes the command-line options that are only
1802 meaningful for Objective-C and Objective-C++ programs, but you can also
1803 use most of the language-independent GNU compiler options. For
1804 example, you might compile a file "some_class.m" like this:
1805
1806 gcc -g -fgnu-runtime -O -c some_class.m
1807
1808 In this example, -fgnu-runtime is an option meant only for Objective-C
1809 and Objective-C++ programs; you can use the other options with any
1810 language supported by GCC.
1811
1812 Note that since Objective-C is an extension of the C language,
1813 Objective-C compilations may also use options specific to the C front-
1814 end (e.g., -Wtraditional). Similarly, Objective-C++ compilations may
1815 use C++-specific options (e.g., -Wabi).
1816
1817 Here is a list of options that are only for compiling Objective-C and
1818 Objective-C++ programs:
1819
1820 -fconstant-string-class=class-name
1821 Use class-name as the name of the class to instantiate for each
1822 literal string specified with the syntax "@"..."". The default
1823 class name is "NXConstantString" if the GNU runtime is being used,
1824 and "NSConstantString" if the NeXT runtime is being used (see
1825 below). The -fconstant-cfstrings option, if also present, will
1826 override the -fconstant-string-class setting and cause "@"...""
1827 literals to be laid out as constant CoreFoundation strings.
1828
1829 -fgnu-runtime
1830 Generate object code compatible with the standard GNU Objective-C
1831 runtime. This is the default for most types of systems.
1832
1833 -fnext-runtime
1834 Generate output compatible with the NeXT runtime. This is the
1835 default for NeXT-based systems, including Darwin and Mac OS X. The
1836 macro "__NEXT_RUNTIME__" is predefined if (and only if) this option
1837 is used.
1838
1839 -fno-nil-receivers
1840 Assume that all Objective-C message dispatches (e.g., "[receiver
1841 message:arg]") in this translation unit ensure that the receiver is
1842 not "nil". This allows for more efficient entry points in the
1843 runtime to be used. Currently, this option is only available in
1844 conjunction with the NeXT runtime on Mac OS X 10.3 and later.
1845
1846 -fobjc-call-cxx-cdtors
1847 For each Objective-C class, check if any of its instance variables
1848 is a C++ object with a non-trivial default constructor. If so,
1849 synthesize a special "- (id) .cxx_construct" instance method that
1850 will run non-trivial default constructors on any such instance
1851 variables, in order, and then return "self". Similarly, check if
1852 any instance variable is a C++ object with a non-trivial
1853 destructor, and if so, synthesize a special "- (void)
1854 .cxx_destruct" method that will run all such default destructors,
1855 in reverse order.
1856
1857 The "- (id) .cxx_construct" and/or "- (void) .cxx_destruct" methods
1858 thusly generated will only operate on instance variables declared
1859 in the current Objective-C class, and not those inherited from
1860 superclasses. It is the responsibility of the Objective-C runtime
1861 to invoke all such methods in an object's inheritance hierarchy.
1862 The "- (id) .cxx_construct" methods will be invoked by the runtime
1863 immediately after a new object instance is allocated; the "- (void)
1864 .cxx_destruct" methods will be invoked immediately before the
1865 runtime deallocates an object instance.
1866
1867 As of this writing, only the NeXT runtime on Mac OS X 10.4 and
1868 later has support for invoking the "- (id) .cxx_construct" and "-
1869 (void) .cxx_destruct" methods.
1870
1871 -fobjc-direct-dispatch
1872 Allow fast jumps to the message dispatcher. On Darwin this is
1873 accomplished via the comm page.
1874
1875 -fobjc-exceptions
1876 Enable syntactic support for structured exception handling in
1877 Objective-C, similar to what is offered by C++ and Java. This
1878 option is unavailable in conjunction with the NeXT runtime on Mac
1879 OS X 10.2 and earlier.
1880
1881 @try {
1882 ...
1883 @throw expr;
1884 ...
1885 }
1886 @catch (AnObjCClass *exc) {
1887 ...
1888 @throw expr;
1889 ...
1890 @throw;
1891 ...
1892 }
1893 @catch (AnotherClass *exc) {
1894 ...
1895 }
1896 @catch (id allOthers) {
1897 ...
1898 }
1899 @finally {
1900 ...
1901 @throw expr;
1902 ...
1903 }
1904
1905 The @throw statement may appear anywhere in an Objective-C or
1906 Objective-C++ program; when used inside of a @catch block, the
1907 @throw may appear without an argument (as shown above), in which
1908 case the object caught by the @catch will be rethrown.
1909
1910 Note that only (pointers to) Objective-C objects may be thrown and
1911 caught using this scheme. When an object is thrown, it will be
1912 caught by the nearest @catch clause capable of handling objects of
1913 that type, analogously to how "catch" blocks work in C++ and Java.
1914 A "@catch(id ...)" clause (as shown above) may also be provided to
1915 catch any and all Objective-C exceptions not caught by previous
1916 @catch clauses (if any).
1917
1918 The @finally clause, if present, will be executed upon exit from
1919 the immediately preceding "@try ... @catch" section. This will
1920 happen regardless of whether any exceptions are thrown, caught or
1921 rethrown inside the "@try ... @catch" section, analogously to the
1922 behavior of the "finally" clause in Java.
1923
1924 There are several caveats to using the new exception mechanism:
1925
1926 · Although currently designed to be binary compatible with
1927 "NS_HANDLER"-style idioms provided by the "NSException" class,
1928 the new exceptions can only be used on Mac OS X 10.3 (Panther)
1929 and later systems, due to additional functionality needed in
1930 the (NeXT) Objective-C runtime.
1931
1932 · As mentioned above, the new exceptions do not support handling
1933 types other than Objective-C objects. Furthermore, when used
1934 from Objective-C++, the Objective-C exception model does not
1935 interoperate with C++ exceptions at this time. This means you
1936 cannot @throw an exception from Objective-C and "catch" it in
1937 C++, or vice versa (i.e., "throw ... @catch").
1938
1939 The -fobjc-exceptions switch also enables the use of
1940 synchronization blocks for thread-safe execution:
1941
1942 @synchronized (ObjCClass *guard) {
1943 ...
1944 }
1945
1946 Upon entering the @synchronized block, a thread of execution shall
1947 first check whether a lock has been placed on the corresponding
1948 "guard" object by another thread. If it has, the current thread
1949 shall wait until the other thread relinquishes its lock. Once
1950 "guard" becomes available, the current thread will place its own
1951 lock on it, execute the code contained in the @synchronized block,
1952 and finally relinquish the lock (thereby making "guard" available
1953 to other threads).
1954
1955 Unlike Java, Objective-C does not allow for entire methods to be
1956 marked @synchronized. Note that throwing exceptions out of
1957 @synchronized blocks is allowed, and will cause the guarding object
1958 to be unlocked properly.
1959
1960 -fobjc-gc
1961 Enable garbage collection (GC) in Objective-C and Objective-C++
1962 programs.
1963
1964 -freplace-objc-classes
1965 Emit a special marker instructing ld(1) not to statically link in
1966 the resulting object file, and allow dyld(1) to load it in at run
1967 time instead. This is used in conjunction with the Fix-and-
1968 Continue debugging mode, where the object file in question may be
1969 recompiled and dynamically reloaded in the course of program
1970 execution, without the need to restart the program itself.
1971 Currently, Fix-and-Continue functionality is only available in
1972 conjunction with the NeXT runtime on Mac OS X 10.3 and later.
1973
1974 -fzero-link
1975 When compiling for the NeXT runtime, the compiler ordinarily
1976 replaces calls to "objc_getClass("...")" (when the name of the
1977 class is known at compile time) with static class references that
1978 get initialized at load time, which improves run-time performance.
1979 Specifying the -fzero-link flag suppresses this behavior and causes
1980 calls to "objc_getClass("...")" to be retained. This is useful in
1981 Zero-Link debugging mode, since it allows for individual class
1982 implementations to be modified during program execution.
1983
1984 -gen-decls
1985 Dump interface declarations for all classes seen in the source file
1986 to a file named sourcename.decl.
1987
1988 -Wassign-intercept (Objective-C and Objective-C++ only)
1989 Warn whenever an Objective-C assignment is being intercepted by the
1990 garbage collector.
1991
1992 -Wno-protocol (Objective-C and Objective-C++ only)
1993 If a class is declared to implement a protocol, a warning is issued
1994 for every method in the protocol that is not implemented by the
1995 class. The default behavior is to issue a warning for every method
1996 not explicitly implemented in the class, even if a method
1997 implementation is inherited from the superclass. If you use the
1998 -Wno-protocol option, then methods inherited from the superclass
1999 are considered to be implemented, and no warning is issued for
2000 them.
2001
2002 -Wselector (Objective-C and Objective-C++ only)
2003 Warn if multiple methods of different types for the same selector
2004 are found during compilation. The check is performed on the list
2005 of methods in the final stage of compilation. Additionally, a
2006 check is performed for each selector appearing in a
2007 "@selector(...)" expression, and a corresponding method for that
2008 selector has been found during compilation. Because these checks
2009 scan the method table only at the end of compilation, these
2010 warnings are not produced if the final stage of compilation is not
2011 reached, for example because an error is found during compilation,
2012 or because the -fsyntax-only option is being used.
2013
2014 -Wstrict-selector-match (Objective-C and Objective-C++ only)
2015 Warn if multiple methods with differing argument and/or return
2016 types are found for a given selector when attempting to send a
2017 message using this selector to a receiver of type "id" or "Class".
2018 When this flag is off (which is the default behavior), the compiler
2019 will omit such warnings if any differences found are confined to
2020 types which share the same size and alignment.
2021
2022 -Wundeclared-selector (Objective-C and Objective-C++ only)
2023 Warn if a "@selector(...)" expression referring to an undeclared
2024 selector is found. A selector is considered undeclared if no
2025 method with that name has been declared before the "@selector(...)"
2026 expression, either explicitly in an @interface or @protocol
2027 declaration, or implicitly in an @implementation section. This
2028 option always performs its checks as soon as a "@selector(...)"
2029 expression is found, while -Wselector only performs its checks in
2030 the final stage of compilation. This also enforces the coding
2031 style convention that methods and selectors must be declared before
2032 being used.
2033
2034 -print-objc-runtime-info
2035 Generate C header describing the largest structure that is passed
2036 by value, if any.
2037
2038 Options to Control Diagnostic Messages Formatting
2039 Traditionally, diagnostic messages have been formatted irrespective of
2040 the output device's aspect (e.g. its width, ...). The options
2041 described below can be used to control the diagnostic messages
2042 formatting algorithm, e.g. how many characters per line, how often
2043 source location information should be reported. Right now, only the
2044 C++ front end can honor these options. However it is expected, in the
2045 near future, that the remaining front ends would be able to digest them
2046 correctly.
2047
2048 -fmessage-length=n
2049 Try to format error messages so that they fit on lines of about n
2050 characters. The default is 72 characters for g++ and 0 for the
2051 rest of the front ends supported by GCC. If n is zero, then no
2052 line-wrapping will be done; each error message will appear on a
2053 single line.
2054
2055 -fdiagnostics-show-location=once
2056 Only meaningful in line-wrapping mode. Instructs the diagnostic
2057 messages reporter to emit once source location information; that
2058 is, in case the message is too long to fit on a single physical
2059 line and has to be wrapped, the source location won't be emitted
2060 (as prefix) again, over and over, in subsequent continuation lines.
2061 This is the default behavior.
2062
2063 -fdiagnostics-show-location=every-line
2064 Only meaningful in line-wrapping mode. Instructs the diagnostic
2065 messages reporter to emit the same source location information (as
2066 prefix) for physical lines that result from the process of breaking
2067 a message which is too long to fit on a single line.
2068
2069 -fdiagnostics-show-option
2070 This option instructs the diagnostic machinery to add text to each
2071 diagnostic emitted, which indicates which command line option
2072 directly controls that diagnostic, when such an option is known to
2073 the diagnostic machinery.
2074
2075 -Wcoverage-mismatch
2076 Warn if feedback profiles do not match when using the -fprofile-use
2077 option. If a source file was changed between -fprofile-gen and
2078 -fprofile-use, the files with the profile feedback can fail to
2079 match the source file and GCC can not use the profile feedback
2080 information. By default, GCC emits an error message in this case.
2081 The option -Wcoverage-mismatch emits a warning instead of an error.
2082 GCC does not use appropriate feedback profiles, so using this
2083 option can result in poorly optimized code. This option is useful
2084 only in the case of very minor changes such as bug fixes to an
2085 existing code-base.
2086
2087 Options to Request or Suppress Warnings
2088 Warnings are diagnostic messages that report constructions which are
2089 not inherently erroneous but which are risky or suggest there may have
2090 been an error.
2091
2092 The following language-independent options do not enable specific
2093 warnings but control the kinds of diagnostics produced by GCC.
2094
2095 -fsyntax-only
2096 Check the code for syntax errors, but don't do anything beyond
2097 that.
2098
2099 -w Inhibit all warning messages.
2100
2101 -Werror
2102 Make all warnings into errors.
2103
2104 -Werror=
2105 Make the specified warning into an error. The specifier for a
2106 warning is appended, for example -Werror=switch turns the warnings
2107 controlled by -Wswitch into errors. This switch takes a negative
2108 form, to be used to negate -Werror for specific warnings, for
2109 example -Wno-error=switch makes -Wswitch warnings not be errors,
2110 even when -Werror is in effect. You can use the
2111 -fdiagnostics-show-option option to have each controllable warning
2112 amended with the option which controls it, to determine what to use
2113 with this option.
2114
2115 Note that specifying -Werror=foo automatically implies -Wfoo.
2116 However, -Wno-error=foo does not imply anything.
2117
2118 -Wfatal-errors
2119 This option causes the compiler to abort compilation on the first
2120 error occurred rather than trying to keep going and printing
2121 further error messages.
2122
2123 You can request many specific warnings with options beginning -W, for
2124 example -Wimplicit to request warnings on implicit declarations. Each
2125 of these specific warning options also has a negative form beginning
2126 -Wno- to turn off warnings; for example, -Wno-implicit. This manual
2127 lists only one of the two forms, whichever is not the default. For
2128 further, language-specific options also refer to C++ Dialect Options
2129 and Objective-C and Objective-C++ Dialect Options.
2130
2131 -pedantic
2132 Issue all the warnings demanded by strict ISO C and ISO C++; reject
2133 all programs that use forbidden extensions, and some other programs
2134 that do not follow ISO C and ISO C++. For ISO C, follows the
2135 version of the ISO C standard specified by any -std option used.
2136
2137 Valid ISO C and ISO C++ programs should compile properly with or
2138 without this option (though a rare few will require -ansi or a -std
2139 option specifying the required version of ISO C). However, without
2140 this option, certain GNU extensions and traditional C and C++
2141 features are supported as well. With this option, they are
2142 rejected.
2143
2144 -pedantic does not cause warning messages for use of the alternate
2145 keywords whose names begin and end with __. Pedantic warnings are
2146 also disabled in the expression that follows "__extension__".
2147 However, only system header files should use these escape routes;
2148 application programs should avoid them.
2149
2150 Some users try to use -pedantic to check programs for strict ISO C
2151 conformance. They soon find that it does not do quite what they
2152 want: it finds some non-ISO practices, but not all---only those for
2153 which ISO C requires a diagnostic, and some others for which
2154 diagnostics have been added.
2155
2156 A feature to report any failure to conform to ISO C might be useful
2157 in some instances, but would require considerable additional work
2158 and would be quite different from -pedantic. We don't have plans
2159 to support such a feature in the near future.
2160
2161 Where the standard specified with -std represents a GNU extended
2162 dialect of C, such as gnu90 or gnu99, there is a corresponding base
2163 standard, the version of ISO C on which the GNU extended dialect is
2164 based. Warnings from -pedantic are given where they are required
2165 by the base standard. (It would not make sense for such warnings
2166 to be given only for features not in the specified GNU C dialect,
2167 since by definition the GNU dialects of C include all features the
2168 compiler supports with the given option, and there would be nothing
2169 to warn about.)
2170
2171 -pedantic-errors
2172 Like -pedantic, except that errors are produced rather than
2173 warnings.
2174
2175 -Wall
2176 This enables all the warnings about constructions that some users
2177 consider questionable, and that are easy to avoid (or modify to
2178 prevent the warning), even in conjunction with macros. This also
2179 enables some language-specific warnings described in C++ Dialect
2180 Options and Objective-C and Objective-C++ Dialect Options.
2181
2182 -Wall turns on the following warning flags:
2183
2184 -Waddress -Warray-bounds (only with -O2) -Wc++0x-compat
2185 -Wchar-subscripts -Wenum-compare (in C/Objc; this is on by default
2186 in C++) -Wimplicit-int -Wimplicit-function-declaration -Wcomment
2187 -Wformat -Wmain (only for C/ObjC and unless -ffreestanding)
2188 -Wmissing-braces -Wnonnull -Wparentheses -Wpointer-sign -Wreorder
2189 -Wreturn-type -Wsequence-point -Wsign-compare (only in C++)
2190 -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch -Wtrigraphs
2191 -Wuninitialized -Wunknown-pragmas -Wunused-function -Wunused-label
2192 -Wunused-value -Wunused-variable -Wvolatile-register-var
2193
2194 Note that some warning flags are not implied by -Wall. Some of
2195 them warn about constructions that users generally do not consider
2196 questionable, but which occasionally you might wish to check for;
2197 others warn about constructions that are necessary or hard to avoid
2198 in some cases, and there is no simple way to modify the code to
2199 suppress the warning. Some of them are enabled by -Wextra but many
2200 of them must be enabled individually.
2201
2202 -Wextra
2203 This enables some extra warning flags that are not enabled by
2204 -Wall. (This option used to be called -W. The older name is still
2205 supported, but the newer name is more descriptive.)
2206
2207 -Wclobbered -Wempty-body -Wignored-qualifiers
2208 -Wmissing-field-initializers -Wmissing-parameter-type (C only)
2209 -Wold-style-declaration (C only) -Woverride-init -Wsign-compare
2210 -Wtype-limits -Wuninitialized -Wunused-parameter (only with
2211 -Wunused or -Wall)
2212
2213 The option -Wextra also prints warning messages for the following
2214 cases:
2215
2216 · A pointer is compared against integer zero with <, <=, >, or
2217 >=.
2218
2219 · (C++ only) An enumerator and a non-enumerator both appear in a
2220 conditional expression.
2221
2222 · (C++ only) Ambiguous virtual bases.
2223
2224 · (C++ only) Subscripting an array which has been declared
2225 register.
2226
2227 · (C++ only) Taking the address of a variable which has been
2228 declared register.
2229
2230 · (C++ only) A base class is not initialized in a derived class'
2231 copy constructor.
2232
2233 -Wchar-subscripts
2234 Warn if an array subscript has type "char". This is a common cause
2235 of error, as programmers often forget that this type is signed on
2236 some machines. This warning is enabled by -Wall.
2237
2238 -Wcomment
2239 Warn whenever a comment-start sequence /* appears in a /* comment,
2240 or whenever a Backslash-Newline appears in a // comment. This
2241 warning is enabled by -Wall.
2242
2243 -Wformat
2244 Check calls to "printf" and "scanf", etc., to make sure that the
2245 arguments supplied have types appropriate to the format string
2246 specified, and that the conversions specified in the format string
2247 make sense. This includes standard functions, and others specified
2248 by format attributes, in the "printf", "scanf", "strftime" and
2249 "strfmon" (an X/Open extension, not in the C standard) families (or
2250 other target-specific families). Which functions are checked
2251 without format attributes having been specified depends on the
2252 standard version selected, and such checks of functions without the
2253 attribute specified are disabled by -ffreestanding or -fno-builtin.
2254
2255 The formats are checked against the format features supported by
2256 GNU libc version 2.2. These include all ISO C90 and C99 features,
2257 as well as features from the Single Unix Specification and some BSD
2258 and GNU extensions. Other library implementations may not support
2259 all these features; GCC does not support warning about features
2260 that go beyond a particular library's limitations. However, if
2261 -pedantic is used with -Wformat, warnings will be given about
2262 format features not in the selected standard version (but not for
2263 "strfmon" formats, since those are not in any version of the C
2264 standard).
2265
2266 Since -Wformat also checks for null format arguments for several
2267 functions, -Wformat also implies -Wnonnull.
2268
2269 -Wformat is included in -Wall. For more control over some aspects
2270 of format checking, the options -Wformat-y2k,
2271 -Wno-format-extra-args, -Wno-format-zero-length,
2272 -Wformat-nonliteral, -Wformat-security, and -Wformat=2 are
2273 available, but are not included in -Wall.
2274
2275 -Wformat-y2k
2276 If -Wformat is specified, also warn about "strftime" formats which
2277 may yield only a two-digit year.
2278
2279 -Wno-format-contains-nul
2280 If -Wformat is specified, do not warn about format strings that
2281 contain NUL bytes.
2282
2283 -Wno-format-extra-args
2284 If -Wformat is specified, do not warn about excess arguments to a
2285 "printf" or "scanf" format function. The C standard specifies that
2286 such arguments are ignored.
2287
2288 Where the unused arguments lie between used arguments that are
2289 specified with $ operand number specifications, normally warnings
2290 are still given, since the implementation could not know what type
2291 to pass to "va_arg" to skip the unused arguments. However, in the
2292 case of "scanf" formats, this option will suppress the warning if
2293 the unused arguments are all pointers, since the Single Unix
2294 Specification says that such unused arguments are allowed.
2295
2296 -Wno-format-zero-length (C and Objective-C only)
2297 If -Wformat is specified, do not warn about zero-length formats.
2298 The C standard specifies that zero-length formats are allowed.
2299
2300 -Wformat-nonliteral
2301 If -Wformat is specified, also warn if the format string is not a
2302 string literal and so cannot be checked, unless the format function
2303 takes its format arguments as a "va_list".
2304
2305 -Wformat-security
2306 If -Wformat is specified, also warn about uses of format functions
2307 that represent possible security problems. At present, this warns
2308 about calls to "printf" and "scanf" functions where the format
2309 string is not a string literal and there are no format arguments,
2310 as in "printf (foo);". This may be a security hole if the format
2311 string came from untrusted input and contains %n. (This is
2312 currently a subset of what -Wformat-nonliteral warns about, but in
2313 future warnings may be added to -Wformat-security that are not
2314 included in -Wformat-nonliteral.)
2315
2316 -Wformat=2
2317 Enable -Wformat plus format checks not included in -Wformat.
2318 Currently equivalent to -Wformat -Wformat-nonliteral
2319 -Wformat-security -Wformat-y2k.
2320
2321 -Wnonnull (C and Objective-C only)
2322 Warn about passing a null pointer for arguments marked as requiring
2323 a non-null value by the "nonnull" function attribute.
2324
2325 -Wnonnull is included in -Wall and -Wformat. It can be disabled
2326 with the -Wno-nonnull option.
2327
2328 -Winit-self (C, C++, Objective-C and Objective-C++ only)
2329 Warn about uninitialized variables which are initialized with
2330 themselves. Note this option can only be used with the
2331 -Wuninitialized option.
2332
2333 For example, GCC will warn about "i" being uninitialized in the
2334 following snippet only when -Winit-self has been specified:
2335
2336 int f()
2337 {
2338 int i = i;
2339 return i;
2340 }
2341
2342 -Wimplicit-int (C and Objective-C only)
2343 Warn when a declaration does not specify a type. This warning is
2344 enabled by -Wall.
2345
2346 -Wimplicit-function-declaration (C and Objective-C only)
2347 Give a warning whenever a function is used before being declared.
2348 In C99 mode (-std=c99 or -std=gnu99), this warning is enabled by
2349 default and it is made into an error by -pedantic-errors. This
2350 warning is also enabled by -Wall.
2351
2352 -Wimplicit
2353 Same as -Wimplicit-int and -Wimplicit-function-declaration. This
2354 warning is enabled by -Wall.
2355
2356 -Wignored-qualifiers (C and C++ only)
2357 Warn if the return type of a function has a type qualifier such as
2358 "const". For ISO C such a type qualifier has no effect, since the
2359 value returned by a function is not an lvalue. For C++, the
2360 warning is only emitted for scalar types or "void". ISO C
2361 prohibits qualified "void" return types on function definitions, so
2362 such return types always receive a warning even without this
2363 option.
2364
2365 This warning is also enabled by -Wextra.
2366
2367 -Wmain
2368 Warn if the type of main is suspicious. main should be a function
2369 with external linkage, returning int, taking either zero arguments,
2370 two, or three arguments of appropriate types. This warning is
2371 enabled by default in C++ and is enabled by either -Wall or
2372 -pedantic.
2373
2374 -Wmissing-braces
2375 Warn if an aggregate or union initializer is not fully bracketed.
2376 In the following example, the initializer for a is not fully
2377 bracketed, but that for b is fully bracketed.
2378
2379 int a[2][2] = { 0, 1, 2, 3 };
2380 int b[2][2] = { { 0, 1 }, { 2, 3 } };
2381
2382 This warning is enabled by -Wall.
2383
2384 -Wmissing-include-dirs (C, C++, Objective-C and Objective-C++ only)
2385 Warn if a user-supplied include directory does not exist.
2386
2387 -Wparentheses
2388 Warn if parentheses are omitted in certain contexts, such as when
2389 there is an assignment in a context where a truth value is
2390 expected, or when operators are nested whose precedence people
2391 often get confused about.
2392
2393 Also warn if a comparison like x<=y<=z appears; this is equivalent
2394 to (x<=y ? 1 : 0) <= z, which is a different interpretation from
2395 that of ordinary mathematical notation.
2396
2397 Also warn about constructions where there may be confusion to which
2398 "if" statement an "else" branch belongs. Here is an example of
2399 such a case:
2400
2401 {
2402 if (a)
2403 if (b)
2404 foo ();
2405 else
2406 bar ();
2407 }
2408
2409 In C/C++, every "else" branch belongs to the innermost possible
2410 "if" statement, which in this example is "if (b)". This is often
2411 not what the programmer expected, as illustrated in the above
2412 example by indentation the programmer chose. When there is the
2413 potential for this confusion, GCC will issue a warning when this
2414 flag is specified. To eliminate the warning, add explicit braces
2415 around the innermost "if" statement so there is no way the "else"
2416 could belong to the enclosing "if". The resulting code would look
2417 like this:
2418
2419 {
2420 if (a)
2421 {
2422 if (b)
2423 foo ();
2424 else
2425 bar ();
2426 }
2427 }
2428
2429 This warning is enabled by -Wall.
2430
2431 -Wsequence-point
2432 Warn about code that may have undefined semantics because of
2433 violations of sequence point rules in the C and C++ standards.
2434
2435 The C and C++ standards defines the order in which expressions in a
2436 C/C++ program are evaluated in terms of sequence points, which
2437 represent a partial ordering between the execution of parts of the
2438 program: those executed before the sequence point, and those
2439 executed after it. These occur after the evaluation of a full
2440 expression (one which is not part of a larger expression), after
2441 the evaluation of the first operand of a "&&", "||", "? :" or ","
2442 (comma) operator, before a function is called (but after the
2443 evaluation of its arguments and the expression denoting the called
2444 function), and in certain other places. Other than as expressed by
2445 the sequence point rules, the order of evaluation of subexpressions
2446 of an expression is not specified. All these rules describe only a
2447 partial order rather than a total order, since, for example, if two
2448 functions are called within one expression with no sequence point
2449 between them, the order in which the functions are called is not
2450 specified. However, the standards committee have ruled that
2451 function calls do not overlap.
2452
2453 It is not specified when between sequence points modifications to
2454 the values of objects take effect. Programs whose behavior depends
2455 on this have undefined behavior; the C and C++ standards specify
2456 that "Between the previous and next sequence point an object shall
2457 have its stored value modified at most once by the evaluation of an
2458 expression. Furthermore, the prior value shall be read only to
2459 determine the value to be stored.". If a program breaks these
2460 rules, the results on any particular implementation are entirely
2461 unpredictable.
2462
2463 Examples of code with undefined behavior are "a = a++;", "a[n] =
2464 b[n++]" and "a[i++] = i;". Some more complicated cases are not
2465 diagnosed by this option, and it may give an occasional false
2466 positive result, but in general it has been found fairly effective
2467 at detecting this sort of problem in programs.
2468
2469 The standard is worded confusingly, therefore there is some debate
2470 over the precise meaning of the sequence point rules in subtle
2471 cases. Links to discussions of the problem, including proposed
2472 formal definitions, may be found on the GCC readings page, at
2473 <http://gcc.gnu.org/readings.html>.
2474
2475 This warning is enabled by -Wall for C and C++.
2476
2477 -Wreturn-type
2478 Warn whenever a function is defined with a return-type that
2479 defaults to "int". Also warn about any "return" statement with no
2480 return-value in a function whose return-type is not "void" (falling
2481 off the end of the function body is considered returning without a
2482 value), and about a "return" statement with an expression in a
2483 function whose return-type is "void".
2484
2485 For C++, a function without return type always produces a
2486 diagnostic message, even when -Wno-return-type is specified. The
2487 only exceptions are main and functions defined in system headers.
2488
2489 This warning is enabled by -Wall.
2490
2491 -Wswitch
2492 Warn whenever a "switch" statement has an index of enumerated type
2493 and lacks a "case" for one or more of the named codes of that
2494 enumeration. (The presence of a "default" label prevents this
2495 warning.) "case" labels outside the enumeration range also provoke
2496 warnings when this option is used (even if there is a "default"
2497 label). This warning is enabled by -Wall.
2498
2499 -Wswitch-default
2500 Warn whenever a "switch" statement does not have a "default" case.
2501
2502 -Wswitch-enum
2503 Warn whenever a "switch" statement has an index of enumerated type
2504 and lacks a "case" for one or more of the named codes of that
2505 enumeration. "case" labels outside the enumeration range also
2506 provoke warnings when this option is used. The only difference
2507 between -Wswitch and this option is that this option gives a
2508 warning about an omitted enumeration code even if there is a
2509 "default" label.
2510
2511 -Wsync-nand (C and C++ only)
2512 Warn when "__sync_fetch_and_nand" and "__sync_nand_and_fetch"
2513 built-in functions are used. These functions changed semantics in
2514 GCC 4.4.
2515
2516 -Wtrigraphs
2517 Warn if any trigraphs are encountered that might change the meaning
2518 of the program (trigraphs within comments are not warned about).
2519 This warning is enabled by -Wall.
2520
2521 -Wunused-but-set-parameter
2522 Warn whenever a function parameter is assigned to, but otherwise
2523 unused (aside from its declaration).
2524
2525 To suppress this warning use the unused attribute.
2526
2527 -Wunused-but-set-variable
2528 Warn whenever a local variable is assigned to, but otherwise unused
2529 (aside from its declaration).
2530
2531 To suppress this warning use the unused attribute.
2532
2533 -Wunused-function
2534 Warn whenever a static function is declared but not defined or a
2535 non-inline static function is unused. This warning is enabled by
2536 -Wall.
2537
2538 -Wunused-label
2539 Warn whenever a label is declared but not used. This warning is
2540 enabled by -Wall.
2541
2542 To suppress this warning use the unused attribute.
2543
2544 -Wunused-parameter
2545 Warn whenever a function parameter is unused aside from its
2546 declaration.
2547
2548 To suppress this warning use the unused attribute.
2549
2550 -Wno-unused-result
2551 Do not warn if a caller of a function marked with attribute
2552 "warn_unused_result" does not use its return value. The default is
2553 -Wunused-result.
2554
2555 -Wunused-variable
2556 Warn whenever a local variable or non-constant static variable is
2557 unused aside from its declaration. This warning is enabled by
2558 -Wall.
2559
2560 To suppress this warning use the unused attribute.
2561
2562 -Wunused-value
2563 Warn whenever a statement computes a result that is explicitly not
2564 used. To suppress this warning cast the unused expression to void.
2565 This includes an expression-statement or the left-hand side of a
2566 comma expression that contains no side effects. For example, an
2567 expression such as x[i,j] will cause a warning, while x[(void)i,j]
2568 will not.
2569
2570 This warning is enabled by -Wall.
2571
2572 -Wunused
2573 All the above -Wunused options combined.
2574
2575 In order to get a warning about an unused function parameter, you
2576 must either specify -Wextra -Wunused (note that -Wall implies
2577 -Wunused), or separately specify -Wunused-parameter.
2578
2579 -Wuninitialized
2580 Warn if an automatic variable is used without first being
2581 initialized or if a variable may be clobbered by a "setjmp" call.
2582 In C++, warn if a non-static reference or non-static const member
2583 appears in a class without constructors.
2584
2585 If you want to warn about code which uses the uninitialized value
2586 of the variable in its own initializer, use the -Winit-self option.
2587
2588 These warnings occur for individual uninitialized or clobbered
2589 elements of structure, union or array variables as well as for
2590 variables which are uninitialized or clobbered as a whole. They do
2591 not occur for variables or elements declared "volatile". Because
2592 these warnings depend on optimization, the exact variables or
2593 elements for which there are warnings will depend on the precise
2594 optimization options and version of GCC used.
2595
2596 Note that there may be no warning about a variable that is used
2597 only to compute a value that itself is never used, because such
2598 computations may be deleted by data flow analysis before the
2599 warnings are printed.
2600
2601 These warnings are made optional because GCC is not smart enough to
2602 see all the reasons why the code might be correct despite appearing
2603 to have an error. Here is one example of how this can happen:
2604
2605 {
2606 int x;
2607 switch (y)
2608 {
2609 case 1: x = 1;
2610 break;
2611 case 2: x = 4;
2612 break;
2613 case 3: x = 5;
2614 }
2615 foo (x);
2616 }
2617
2618 If the value of "y" is always 1, 2 or 3, then "x" is always
2619 initialized, but GCC doesn't know this. Here is another common
2620 case:
2621
2622 {
2623 int save_y;
2624 if (change_y) save_y = y, y = new_y;
2625 ...
2626 if (change_y) y = save_y;
2627 }
2628
2629 This has no bug because "save_y" is used only if it is set.
2630
2631 This option also warns when a non-volatile automatic variable might
2632 be changed by a call to "longjmp". These warnings as well are
2633 possible only in optimizing compilation.
2634
2635 The compiler sees only the calls to "setjmp". It cannot know where
2636 "longjmp" will be called; in fact, a signal handler could call it
2637 at any point in the code. As a result, you may get a warning even
2638 when there is in fact no problem because "longjmp" cannot in fact
2639 be called at the place which would cause a problem.
2640
2641 Some spurious warnings can be avoided if you declare all the
2642 functions you use that never return as "noreturn".
2643
2644 This warning is enabled by -Wall or -Wextra.
2645
2646 -Wunknown-pragmas
2647 Warn when a #pragma directive is encountered which is not
2648 understood by GCC. If this command line option is used, warnings
2649 will even be issued for unknown pragmas in system header files.
2650 This is not the case if the warnings were only enabled by the -Wall
2651 command line option.
2652
2653 -Wno-pragmas
2654 Do not warn about misuses of pragmas, such as incorrect parameters,
2655 invalid syntax, or conflicts between pragmas. See also
2656 -Wunknown-pragmas.
2657
2658 -Wstrict-aliasing
2659 This option is only active when -fstrict-aliasing is active. It
2660 warns about code which might break the strict aliasing rules that
2661 the compiler is using for optimization. The warning does not catch
2662 all cases, but does attempt to catch the more common pitfalls. It
2663 is included in -Wall. It is equivalent to -Wstrict-aliasing=3
2664
2665 -Wstrict-aliasing=n
2666 This option is only active when -fstrict-aliasing is active. It
2667 warns about code which might break the strict aliasing rules that
2668 the compiler is using for optimization. Higher levels correspond
2669 to higher accuracy (fewer false positives). Higher levels also
2670 correspond to more effort, similar to the way -O works.
2671 -Wstrict-aliasing is equivalent to -Wstrict-aliasing=n, with n=3.
2672
2673 Level 1: Most aggressive, quick, least accurate. Possibly useful
2674 when higher levels do not warn but -fstrict-aliasing still breaks
2675 the code, as it has very few false negatives. However, it has many
2676 false positives. Warns for all pointer conversions between
2677 possibly incompatible types, even if never dereferenced. Runs in
2678 the frontend only.
2679
2680 Level 2: Aggressive, quick, not too precise. May still have many
2681 false positives (not as many as level 1 though), and few false
2682 negatives (but possibly more than level 1). Unlike level 1, it
2683 only warns when an address is taken. Warns about incomplete types.
2684 Runs in the frontend only.
2685
2686 Level 3 (default for -Wstrict-aliasing): Should have very few false
2687 positives and few false negatives. Slightly slower than levels 1
2688 or 2 when optimization is enabled. Takes care of the common
2689 pun+dereference pattern in the frontend: "*(int*)&some_float". If
2690 optimization is enabled, it also runs in the backend, where it
2691 deals with multiple statement cases using flow-sensitive points-to
2692 information. Only warns when the converted pointer is
2693 dereferenced. Does not warn about incomplete types.
2694
2695 -Wstrict-overflow
2696 -Wstrict-overflow=n
2697 This option is only active when -fstrict-overflow is active. It
2698 warns about cases where the compiler optimizes based on the
2699 assumption that signed overflow does not occur. Note that it does
2700 not warn about all cases where the code might overflow: it only
2701 warns about cases where the compiler implements some optimization.
2702 Thus this warning depends on the optimization level.
2703
2704 An optimization which assumes that signed overflow does not occur
2705 is perfectly safe if the values of the variables involved are such
2706 that overflow never does, in fact, occur. Therefore this warning
2707 can easily give a false positive: a warning about code which is not
2708 actually a problem. To help focus on important issues, several
2709 warning levels are defined. No warnings are issued for the use of
2710 undefined signed overflow when estimating how many iterations a
2711 loop will require, in particular when determining whether a loop
2712 will be executed at all.
2713
2714 -Wstrict-overflow=1
2715 Warn about cases which are both questionable and easy to avoid.
2716 For example: "x + 1 > x"; with -fstrict-overflow, the compiler
2717 will simplify this to 1. This level of -Wstrict-overflow is
2718 enabled by -Wall; higher levels are not, and must be explicitly
2719 requested.
2720
2721 -Wstrict-overflow=2
2722 Also warn about other cases where a comparison is simplified to
2723 a constant. For example: "abs (x) >= 0". This can only be
2724 simplified when -fstrict-overflow is in effect, because "abs
2725 (INT_MIN)" overflows to "INT_MIN", which is less than zero.
2726 -Wstrict-overflow (with no level) is the same as
2727 -Wstrict-overflow=2.
2728
2729 -Wstrict-overflow=3
2730 Also warn about other cases where a comparison is simplified.
2731 For example: "x + 1 > 1" will be simplified to "x > 0".
2732
2733 -Wstrict-overflow=4
2734 Also warn about other simplifications not covered by the above
2735 cases. For example: "(x * 10) / 5" will be simplified to "x *
2736 2".
2737
2738 -Wstrict-overflow=5
2739 Also warn about cases where the compiler reduces the magnitude
2740 of a constant involved in a comparison. For example: "x + 2 >
2741 y" will be simplified to "x + 1 >= y". This is reported only
2742 at the highest warning level because this simplification
2743 applies to many comparisons, so this warning level will give a
2744 very large number of false positives.
2745
2746 -Warray-bounds
2747 This option is only active when -ftree-vrp is active (default for
2748 -O2 and above). It warns about subscripts to arrays that are always
2749 out of bounds. This warning is enabled by -Wall.
2750
2751 -Wno-div-by-zero
2752 Do not warn about compile-time integer division by zero. Floating
2753 point division by zero is not warned about, as it can be a
2754 legitimate way of obtaining infinities and NaNs.
2755
2756 -Wsystem-headers
2757 Print warning messages for constructs found in system header files.
2758 Warnings from system headers are normally suppressed, on the
2759 assumption that they usually do not indicate real problems and
2760 would only make the compiler output harder to read. Using this
2761 command line option tells GCC to emit warnings from system headers
2762 as if they occurred in user code. However, note that using -Wall
2763 in conjunction with this option will not warn about unknown pragmas
2764 in system headers---for that, -Wunknown-pragmas must also be used.
2765
2766 -Wfloat-equal
2767 Warn if floating point values are used in equality comparisons.
2768
2769 The idea behind this is that sometimes it is convenient (for the
2770 programmer) to consider floating-point values as approximations to
2771 infinitely precise real numbers. If you are doing this, then you
2772 need to compute (by analyzing the code, or in some other way) the
2773 maximum or likely maximum error that the computation introduces,
2774 and allow for it when performing comparisons (and when producing
2775 output, but that's a different problem). In particular, instead of
2776 testing for equality, you would check to see whether the two values
2777 have ranges that overlap; and this is done with the relational
2778 operators, so equality comparisons are probably mistaken.
2779
2780 -Wtraditional (C and Objective-C only)
2781 Warn about certain constructs that behave differently in
2782 traditional and ISO C. Also warn about ISO C constructs that have
2783 no traditional C equivalent, and/or problematic constructs which
2784 should be avoided.
2785
2786 · Macro parameters that appear within string literals in the
2787 macro body. In traditional C macro replacement takes place
2788 within string literals, but does not in ISO C.
2789
2790 · In traditional C, some preprocessor directives did not exist.
2791 Traditional preprocessors would only consider a line to be a
2792 directive if the # appeared in column 1 on the line. Therefore
2793 -Wtraditional warns about directives that traditional C
2794 understands but would ignore because the # does not appear as
2795 the first character on the line. It also suggests you hide
2796 directives like #pragma not understood by traditional C by
2797 indenting them. Some traditional implementations would not
2798 recognize #elif, so it suggests avoiding it altogether.
2799
2800 · A function-like macro that appears without arguments.
2801
2802 · The unary plus operator.
2803
2804 · The U integer constant suffix, or the F or L floating point
2805 constant suffixes. (Traditional C does support the L suffix on
2806 integer constants.) Note, these suffixes appear in macros
2807 defined in the system headers of most modern systems, e.g. the
2808 _MIN/_MAX macros in "<limits.h>". Use of these macros in user
2809 code might normally lead to spurious warnings, however GCC's
2810 integrated preprocessor has enough context to avoid warning in
2811 these cases.
2812
2813 · A function declared external in one block and then used after
2814 the end of the block.
2815
2816 · A "switch" statement has an operand of type "long".
2817
2818 · A non-"static" function declaration follows a "static" one.
2819 This construct is not accepted by some traditional C compilers.
2820
2821 · The ISO type of an integer constant has a different width or
2822 signedness from its traditional type. This warning is only
2823 issued if the base of the constant is ten. I.e. hexadecimal or
2824 octal values, which typically represent bit patterns, are not
2825 warned about.
2826
2827 · Usage of ISO string concatenation is detected.
2828
2829 · Initialization of automatic aggregates.
2830
2831 · Identifier conflicts with labels. Traditional C lacks a
2832 separate namespace for labels.
2833
2834 · Initialization of unions. If the initializer is zero, the
2835 warning is omitted. This is done under the assumption that the
2836 zero initializer in user code appears conditioned on e.g.
2837 "__STDC__" to avoid missing initializer warnings and relies on
2838 default initialization to zero in the traditional C case.
2839
2840 · Conversions by prototypes between fixed/floating point values
2841 and vice versa. The absence of these prototypes when compiling
2842 with traditional C would cause serious problems. This is a
2843 subset of the possible conversion warnings, for the full set
2844 use -Wtraditional-conversion.
2845
2846 · Use of ISO C style function definitions. This warning
2847 intentionally is not issued for prototype declarations or
2848 variadic functions because these ISO C features will appear in
2849 your code when using libiberty's traditional C compatibility
2850 macros, "PARAMS" and "VPARAMS". This warning is also bypassed
2851 for nested functions because that feature is already a GCC
2852 extension and thus not relevant to traditional C compatibility.
2853
2854 -Wtraditional-conversion (C and Objective-C only)
2855 Warn if a prototype causes a type conversion that is different from
2856 what would happen to the same argument in the absence of a
2857 prototype. This includes conversions of fixed point to floating
2858 and vice versa, and conversions changing the width or signedness of
2859 a fixed point argument except when the same as the default
2860 promotion.
2861
2862 -Wdeclaration-after-statement (C and Objective-C only)
2863 Warn when a declaration is found after a statement in a block.
2864 This construct, known from C++, was introduced with ISO C99 and is
2865 by default allowed in GCC. It is not supported by ISO C90 and was
2866 not supported by GCC versions before GCC 3.0.
2867
2868 -Wundef
2869 Warn if an undefined identifier is evaluated in an #if directive.
2870
2871 -Wno-endif-labels
2872 Do not warn whenever an #else or an #endif are followed by text.
2873
2874 -Wshadow
2875 Warn whenever a local variable shadows another local variable,
2876 parameter or global variable or whenever a built-in function is
2877 shadowed.
2878
2879 -Wlarger-than=len
2880 Warn whenever an object of larger than len bytes is defined.
2881
2882 -Wframe-larger-than=len
2883 Warn if the size of a function frame is larger than len bytes. The
2884 computation done to determine the stack frame size is approximate
2885 and not conservative. The actual requirements may be somewhat
2886 greater than len even if you do not get a warning. In addition,
2887 any space allocated via "alloca", variable-length arrays, or
2888 related constructs is not included by the compiler when determining
2889 whether or not to issue a warning.
2890
2891 -Wunsafe-loop-optimizations
2892 Warn if the loop cannot be optimized because the compiler could not
2893 assume anything on the bounds of the loop indices. With
2894 -funsafe-loop-optimizations warn if the compiler made such
2895 assumptions.
2896
2897 -Wno-pedantic-ms-format (MinGW targets only)
2898 Disables the warnings about non-ISO "printf" / "scanf" format width
2899 specifiers "I32", "I64", and "I" used on Windows targets depending
2900 on the MS runtime, when you are using the options -Wformat and
2901 -pedantic without gnu-extensions.
2902
2903 -Wpointer-arith
2904 Warn about anything that depends on the "size of" a function type
2905 or of "void". GNU C assigns these types a size of 1, for
2906 convenience in calculations with "void *" pointers and pointers to
2907 functions. In C++, warn also when an arithmetic operation involves
2908 "NULL". This warning is also enabled by -pedantic.
2909
2910 -Wtype-limits
2911 Warn if a comparison is always true or always false due to the
2912 limited range of the data type, but do not warn for constant
2913 expressions. For example, warn if an unsigned variable is compared
2914 against zero with < or >=. This warning is also enabled by
2915 -Wextra.
2916
2917 -Wbad-function-cast (C and Objective-C only)
2918 Warn whenever a function call is cast to a non-matching type. For
2919 example, warn if "int malloc()" is cast to "anything *".
2920
2921 -Wc++-compat (C and Objective-C only)
2922 Warn about ISO C constructs that are outside of the common subset
2923 of ISO C and ISO C++, e.g. request for implicit conversion from
2924 "void *" to a pointer to non-"void" type.
2925
2926 -Wc++0x-compat (C++ and Objective-C++ only)
2927 Warn about C++ constructs whose meaning differs between ISO C++
2928 1998 and ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will
2929 become keywords in ISO C++ 200x. This warning is enabled by -Wall.
2930
2931 -Wcast-qual
2932 Warn whenever a pointer is cast so as to remove a type qualifier
2933 from the target type. For example, warn if a "const char *" is
2934 cast to an ordinary "char *".
2935
2936 Also warn when making a cast which introduces a type qualifier in
2937 an unsafe way. For example, casting "char **" to "const char **"
2938 is unsafe, as in this example:
2939
2940 /* p is char ** value. */
2941 const char **q = (const char **) p;
2942 /* Assignment of readonly string to const char * is OK. */
2943 *q = "string";
2944 /* Now char** pointer points to read-only memory. */
2945 **p = 'b';
2946
2947 -Wcast-align
2948 Warn whenever a pointer is cast such that the required alignment of
2949 the target is increased. For example, warn if a "char *" is cast
2950 to an "int *" on machines where integers can only be accessed at
2951 two- or four-byte boundaries.
2952
2953 -Wwrite-strings
2954 When compiling C, give string constants the type "const
2955 char[length]" so that copying the address of one into a non-"const"
2956 "char *" pointer will get a warning. These warnings will help you
2957 find at compile time code that can try to write into a string
2958 constant, but only if you have been very careful about using
2959 "const" in declarations and prototypes. Otherwise, it will just be
2960 a nuisance. This is why we did not make -Wall request these
2961 warnings.
2962
2963 When compiling C++, warn about the deprecated conversion from
2964 string literals to "char *". This warning is enabled by default
2965 for C++ programs.
2966
2967 -Wclobbered
2968 Warn for variables that might be changed by longjmp or vfork. This
2969 warning is also enabled by -Wextra.
2970
2971 -Wconversion
2972 Warn for implicit conversions that may alter a value. This includes
2973 conversions between real and integer, like "abs (x)" when "x" is
2974 "double"; conversions between signed and unsigned, like "unsigned
2975 ui = -1"; and conversions to smaller types, like "sqrtf (M_PI)". Do
2976 not warn for explicit casts like "abs ((int) x)" and "ui =
2977 (unsigned) -1", or if the value is not changed by the conversion
2978 like in "abs (2.0)". Warnings about conversions between signed and
2979 unsigned integers can be disabled by using -Wno-sign-conversion.
2980
2981 For C++, also warn for confusing overload resolution for user-
2982 defined conversions; and conversions that will never use a type
2983 conversion operator: conversions to "void", the same type, a base
2984 class or a reference to them. Warnings about conversions between
2985 signed and unsigned integers are disabled by default in C++ unless
2986 -Wsign-conversion is explicitly enabled.
2987
2988 -Wno-conversion-null (C++ and Objective-C++ only)
2989 Do not warn for conversions between "NULL" and non-pointer types.
2990 -Wconversion-null is enabled by default.
2991
2992 -Wempty-body
2993 Warn if an empty body occurs in an if, else or do while statement.
2994 This warning is also enabled by -Wextra.
2995
2996 -Wenum-compare
2997 Warn about a comparison between values of different enum types. In
2998 C++ this warning is enabled by default. In C this warning is
2999 enabled by -Wall.
3000
3001 -Wjump-misses-init (C, Objective-C only)
3002 Warn if a "goto" statement or a "switch" statement jumps forward
3003 across the initialization of a variable, or jumps backward to a
3004 label after the variable has been initialized. This only warns
3005 about variables which are initialized when they are declared. This
3006 warning is only supported for C and Objective C; in C++ this sort
3007 of branch is an error in any case.
3008
3009 -Wjump-misses-init is included in -Wc++-compat. It can be disabled
3010 with the -Wno-jump-misses-init option.
3011
3012 -Wsign-compare
3013 Warn when a comparison between signed and unsigned values could
3014 produce an incorrect result when the signed value is converted to
3015 unsigned. This warning is also enabled by -Wextra; to get the
3016 other warnings of -Wextra without this warning, use -Wextra
3017 -Wno-sign-compare.
3018
3019 -Wsign-conversion
3020 Warn for implicit conversions that may change the sign of an
3021 integer value, like assigning a signed integer expression to an
3022 unsigned integer variable. An explicit cast silences the warning.
3023 In C, this option is enabled also by -Wconversion.
3024
3025 -Waddress
3026 Warn about suspicious uses of memory addresses. These include using
3027 the address of a function in a conditional expression, such as
3028 "void func(void); if (func)", and comparisons against the memory
3029 address of a string literal, such as "if (x == "abc")". Such uses
3030 typically indicate a programmer error: the address of a function
3031 always evaluates to true, so their use in a conditional usually
3032 indicate that the programmer forgot the parentheses in a function
3033 call; and comparisons against string literals result in unspecified
3034 behavior and are not portable in C, so they usually indicate that
3035 the programmer intended to use "strcmp". This warning is enabled
3036 by -Wall.
3037
3038 -Wlogical-op
3039 Warn about suspicious uses of logical operators in expressions.
3040 This includes using logical operators in contexts where a bit-wise
3041 operator is likely to be expected.
3042
3043 -Waggregate-return
3044 Warn if any functions that return structures or unions are defined
3045 or called. (In languages where you can return an array, this also
3046 elicits a warning.)
3047
3048 -Wno-attributes
3049 Do not warn if an unexpected "__attribute__" is used, such as
3050 unrecognized attributes, function attributes applied to variables,
3051 etc. This will not stop errors for incorrect use of supported
3052 attributes.
3053
3054 -Wno-builtin-macro-redefined
3055 Do not warn if certain built-in macros are redefined. This
3056 suppresses warnings for redefinition of "__TIMESTAMP__",
3057 "__TIME__", "__DATE__", "__FILE__", and "__BASE_FILE__".
3058
3059 -Wstrict-prototypes (C and Objective-C only)
3060 Warn if a function is declared or defined without specifying the
3061 argument types. (An old-style function definition is permitted
3062 without a warning if preceded by a declaration which specifies the
3063 argument types.)
3064
3065 -Wold-style-declaration (C and Objective-C only)
3066 Warn for obsolescent usages, according to the C Standard, in a
3067 declaration. For example, warn if storage-class specifiers like
3068 "static" are not the first things in a declaration. This warning
3069 is also enabled by -Wextra.
3070
3071 -Wold-style-definition (C and Objective-C only)
3072 Warn if an old-style function definition is used. A warning is
3073 given even if there is a previous prototype.
3074
3075 -Wmissing-parameter-type (C and Objective-C only)
3076 A function parameter is declared without a type specifier in
3077 K&R-style functions:
3078
3079 void foo(bar) { }
3080
3081 This warning is also enabled by -Wextra.
3082
3083 -Wmissing-prototypes (C and Objective-C only)
3084 Warn if a global function is defined without a previous prototype
3085 declaration. This warning is issued even if the definition itself
3086 provides a prototype. The aim is to detect global functions that
3087 fail to be declared in header files.
3088
3089 -Wmissing-declarations
3090 Warn if a global function is defined without a previous
3091 declaration. Do so even if the definition itself provides a
3092 prototype. Use this option to detect global functions that are not
3093 declared in header files. In C++, no warnings are issued for
3094 function templates, or for inline functions, or for functions in
3095 anonymous namespaces.
3096
3097 -Wmissing-field-initializers
3098 Warn if a structure's initializer has some fields missing. For
3099 example, the following code would cause such a warning, because
3100 "x.h" is implicitly zero:
3101
3102 struct s { int f, g, h; };
3103 struct s x = { 3, 4 };
3104
3105 This option does not warn about designated initializers, so the
3106 following modification would not trigger a warning:
3107
3108 struct s { int f, g, h; };
3109 struct s x = { .f = 3, .g = 4 };
3110
3111 This warning is included in -Wextra. To get other -Wextra warnings
3112 without this one, use -Wextra -Wno-missing-field-initializers.
3113
3114 -Wmissing-noreturn
3115 Warn about functions which might be candidates for attribute
3116 "noreturn". Note these are only possible candidates, not absolute
3117 ones. Care should be taken to manually verify functions actually
3118 do not ever return before adding the "noreturn" attribute,
3119 otherwise subtle code generation bugs could be introduced. You
3120 will not get a warning for "main" in hosted C environments.
3121
3122 -Wmissing-format-attribute
3123 Warn about function pointers which might be candidates for "format"
3124 attributes. Note these are only possible candidates, not absolute
3125 ones. GCC will guess that function pointers with "format"
3126 attributes that are used in assignment, initialization, parameter
3127 passing or return statements should have a corresponding "format"
3128 attribute in the resulting type. I.e. the left-hand side of the
3129 assignment or initialization, the type of the parameter variable,
3130 or the return type of the containing function respectively should
3131 also have a "format" attribute to avoid the warning.
3132
3133 GCC will also warn about function definitions which might be
3134 candidates for "format" attributes. Again, these are only possible
3135 candidates. GCC will guess that "format" attributes might be
3136 appropriate for any function that calls a function like "vprintf"
3137 or "vscanf", but this might not always be the case, and some
3138 functions for which "format" attributes are appropriate may not be
3139 detected.
3140
3141 -Wno-multichar
3142 Do not warn if a multicharacter constant ('FOOF') is used. Usually
3143 they indicate a typo in the user's code, as they have
3144 implementation-defined values, and should not be used in portable
3145 code.
3146
3147 -Wnormalized=<none|id|nfc|nfkc>
3148 In ISO C and ISO C++, two identifiers are different if they are
3149 different sequences of characters. However, sometimes when
3150 characters outside the basic ASCII character set are used, you can
3151 have two different character sequences that look the same. To
3152 avoid confusion, the ISO 10646 standard sets out some normalization
3153 rules which when applied ensure that two sequences that look the
3154 same are turned into the same sequence. GCC can warn you if you
3155 are using identifiers which have not been normalized; this option
3156 controls that warning.
3157
3158 There are four levels of warning that GCC supports. The default is
3159 -Wnormalized=nfc, which warns about any identifier which is not in
3160 the ISO 10646 "C" normalized form, NFC. NFC is the recommended
3161 form for most uses.
3162
3163 Unfortunately, there are some characters which ISO C and ISO C++
3164 allow in identifiers that when turned into NFC aren't allowable as
3165 identifiers. That is, there's no way to use these symbols in
3166 portable ISO C or C++ and have all your identifiers in NFC.
3167 -Wnormalized=id suppresses the warning for these characters. It is
3168 hoped that future versions of the standards involved will correct
3169 this, which is why this option is not the default.
3170
3171 You can switch the warning off for all characters by writing
3172 -Wnormalized=none. You would only want to do this if you were
3173 using some other normalization scheme (like "D"), because otherwise
3174 you can easily create bugs that are literally impossible to see.
3175
3176 Some characters in ISO 10646 have distinct meanings but look
3177 identical in some fonts or display methodologies, especially once
3178 formatting has been applied. For instance "\u207F", "SUPERSCRIPT
3179 LATIN SMALL LETTER N", will display just like a regular "n" which
3180 has been placed in a superscript. ISO 10646 defines the NFKC
3181 normalization scheme to convert all these into a standard form as
3182 well, and GCC will warn if your code is not in NFKC if you use
3183 -Wnormalized=nfkc. This warning is comparable to warning about
3184 every identifier that contains the letter O because it might be
3185 confused with the digit 0, and so is not the default, but may be
3186 useful as a local coding convention if the programming environment
3187 is unable to be fixed to display these characters distinctly.
3188
3189 -Wno-deprecated
3190 Do not warn about usage of deprecated features.
3191
3192 -Wno-deprecated-declarations
3193 Do not warn about uses of functions, variables, and types marked as
3194 deprecated by using the "deprecated" attribute.
3195
3196 -Wno-overflow
3197 Do not warn about compile-time overflow in constant expressions.
3198
3199 -Woverride-init (C and Objective-C only)
3200 Warn if an initialized field without side effects is overridden
3201 when using designated initializers.
3202
3203 This warning is included in -Wextra. To get other -Wextra warnings
3204 without this one, use -Wextra -Wno-override-init.
3205
3206 -Wpacked
3207 Warn if a structure is given the packed attribute, but the packed
3208 attribute has no effect on the layout or size of the structure.
3209 Such structures may be mis-aligned for little benefit. For
3210 instance, in this code, the variable "f.x" in "struct bar" will be
3211 misaligned even though "struct bar" does not itself have the packed
3212 attribute:
3213
3214 struct foo {
3215 int x;
3216 char a, b, c, d;
3217 } __attribute__((packed));
3218 struct bar {
3219 char z;
3220 struct foo f;
3221 };
3222
3223 -Wpacked-bitfield-compat
3224 The 4.1, 4.2 and 4.3 series of GCC ignore the "packed" attribute on
3225 bit-fields of type "char". This has been fixed in GCC 4.4 but the
3226 change can lead to differences in the structure layout. GCC
3227 informs you when the offset of such a field has changed in GCC 4.4.
3228 For example there is no longer a 4-bit padding between field "a"
3229 and "b" in this structure:
3230
3231 struct foo
3232 {
3233 char a:4;
3234 char b:8;
3235 } __attribute__ ((packed));
3236
3237 This warning is enabled by default. Use
3238 -Wno-packed-bitfield-compat to disable this warning.
3239
3240 -Wpadded
3241 Warn if padding is included in a structure, either to align an
3242 element of the structure or to align the whole structure.
3243 Sometimes when this happens it is possible to rearrange the fields
3244 of the structure to reduce the padding and so make the structure
3245 smaller.
3246
3247 -Wredundant-decls
3248 Warn if anything is declared more than once in the same scope, even
3249 in cases where multiple declaration is valid and changes nothing.
3250
3251 -Wnested-externs (C and Objective-C only)
3252 Warn if an "extern" declaration is encountered within a function.
3253
3254 -Winline
3255 Warn if a function can not be inlined and it was declared as
3256 inline. Even with this option, the compiler will not warn about
3257 failures to inline functions declared in system headers.
3258
3259 The compiler uses a variety of heuristics to determine whether or
3260 not to inline a function. For example, the compiler takes into
3261 account the size of the function being inlined and the amount of
3262 inlining that has already been done in the current function.
3263 Therefore, seemingly insignificant changes in the source program
3264 can cause the warnings produced by -Winline to appear or disappear.
3265
3266 -Wno-invalid-offsetof (C++ and Objective-C++ only)
3267 Suppress warnings from applying the offsetof macro to a non-POD
3268 type. According to the 1998 ISO C++ standard, applying offsetof to
3269 a non-POD type is undefined. In existing C++ implementations,
3270 however, offsetof typically gives meaningful results even when
3271 applied to certain kinds of non-POD types. (Such as a simple struct
3272 that fails to be a POD type only by virtue of having a
3273 constructor.) This flag is for users who are aware that they are
3274 writing nonportable code and who have deliberately chosen to ignore
3275 the warning about it.
3276
3277 The restrictions on offsetof may be relaxed in a future version of
3278 the C++ standard.
3279
3280 -Wno-int-to-pointer-cast (C and Objective-C only)
3281 Suppress warnings from casts to pointer type of an integer of a
3282 different size.
3283
3284 -Wno-pointer-to-int-cast (C and Objective-C only)
3285 Suppress warnings from casts from a pointer to an integer type of a
3286 different size.
3287
3288 -Winvalid-pch
3289 Warn if a precompiled header is found in the search path but can't
3290 be used.
3291
3292 -Wlong-long
3293 Warn if long long type is used. This is enabled by either
3294 -pedantic or -Wtraditional in ISO C90 and C++98 modes. To inhibit
3295 the warning messages, use -Wno-long-long.
3296
3297 -Wvariadic-macros
3298 Warn if variadic macros are used in pedantic ISO C90 mode, or the
3299 GNU alternate syntax when in pedantic ISO C99 mode. This is
3300 default. To inhibit the warning messages, use
3301 -Wno-variadic-macros.
3302
3303 -Wvla
3304 Warn if variable length array is used in the code. -Wno-vla will
3305 prevent the -pedantic warning of the variable length array.
3306
3307 -Wvolatile-register-var
3308 Warn if a register variable is declared volatile. The volatile
3309 modifier does not inhibit all optimizations that may eliminate
3310 reads and/or writes to register variables. This warning is enabled
3311 by -Wall.
3312
3313 -Wdisabled-optimization
3314 Warn if a requested optimization pass is disabled. This warning
3315 does not generally indicate that there is anything wrong with your
3316 code; it merely indicates that GCC's optimizers were unable to
3317 handle the code effectively. Often, the problem is that your code
3318 is too big or too complex; GCC will refuse to optimize programs
3319 when the optimization itself is likely to take inordinate amounts
3320 of time.
3321
3322 -Wpointer-sign (C and Objective-C only)
3323 Warn for pointer argument passing or assignment with different
3324 signedness. This option is only supported for C and Objective-C.
3325 It is implied by -Wall and by -pedantic, which can be disabled with
3326 -Wno-pointer-sign.
3327
3328 -Wstack-protector
3329 This option is only active when -fstack-protector is active. It
3330 warns about functions that will not be protected against stack
3331 smashing.
3332
3333 -Wno-mudflap
3334 Suppress warnings about constructs that cannot be instrumented by
3335 -fmudflap.
3336
3337 -Woverlength-strings
3338 Warn about string constants which are longer than the "minimum
3339 maximum" length specified in the C standard. Modern compilers
3340 generally allow string constants which are much longer than the
3341 standard's minimum limit, but very portable programs should avoid
3342 using longer strings.
3343
3344 The limit applies after string constant concatenation, and does not
3345 count the trailing NUL. In C90, the limit was 509 characters; in
3346 C99, it was raised to 4095. C++98 does not specify a normative
3347 minimum maximum, so we do not diagnose overlength strings in C++.
3348
3349 This option is implied by -pedantic, and can be disabled with
3350 -Wno-overlength-strings.
3351
3352 -Wunsuffixed-float-constants (C and Objective-C only)
3353 GCC will issue a warning for any floating constant that does not
3354 have a suffix. When used together with -Wsystem-headers it will
3355 warn about such constants in system header files. This can be
3356 useful when preparing code to use with the "FLOAT_CONST_DECIMAL64"
3357 pragma from the decimal floating-point extension to C99.
3358
3359 Options for Debugging Your Program or GCC
3360 GCC has various special options that are used for debugging either your
3361 program or GCC:
3362
3363 -g Produce debugging information in the operating system's native
3364 format (stabs, COFF, XCOFF, or DWARF 2). GDB can work with this
3365 debugging information.
3366
3367 On most systems that use stabs format, -g enables use of extra
3368 debugging information that only GDB can use; this extra information
3369 makes debugging work better in GDB but will probably make other
3370 debuggers crash or refuse to read the program. If you want to
3371 control for certain whether to generate the extra information, use
3372 -gstabs+, -gstabs, -gxcoff+, -gxcoff, or -gvms (see below).
3373
3374 GCC allows you to use -g with -O. The shortcuts taken by optimized
3375 code may occasionally produce surprising results: some variables
3376 you declared may not exist at all; flow of control may briefly move
3377 where you did not expect it; some statements may not be executed
3378 because they compute constant results or their values were already
3379 at hand; some statements may execute in different places because
3380 they were moved out of loops.
3381
3382 Nevertheless it proves possible to debug optimized output. This
3383 makes it reasonable to use the optimizer for programs that might
3384 have bugs.
3385
3386 The following options are useful when GCC is generated with the
3387 capability for more than one debugging format.
3388
3389 -ggdb
3390 Produce debugging information for use by GDB. This means to use
3391 the most expressive format available (DWARF 2, stabs, or the native
3392 format if neither of those are supported), including GDB extensions
3393 if at all possible.
3394
3395 -gstabs
3396 Produce debugging information in stabs format (if that is
3397 supported), without GDB extensions. This is the format used by DBX
3398 on most BSD systems. On MIPS, Alpha and System V Release 4 systems
3399 this option produces stabs debugging output which is not understood
3400 by DBX or SDB. On System V Release 4 systems this option requires
3401 the GNU assembler.
3402
3403 -feliminate-unused-debug-symbols
3404 Produce debugging information in stabs format (if that is
3405 supported), for only symbols that are actually used.
3406
3407 -femit-class-debug-always
3408 Instead of emitting debugging information for a C++ class in only
3409 one object file, emit it in all object files using the class. This
3410 option should be used only with debuggers that are unable to handle
3411 the way GCC normally emits debugging information for classes
3412 because using this option will increase the size of debugging
3413 information by as much as a factor of two.
3414
3415 -gstabs+
3416 Produce debugging information in stabs format (if that is
3417 supported), using GNU extensions understood only by the GNU
3418 debugger (GDB). The use of these extensions is likely to make
3419 other debuggers crash or refuse to read the program.
3420
3421 -gcoff
3422 Produce debugging information in COFF format (if that is
3423 supported). This is the format used by SDB on most System V
3424 systems prior to System V Release 4.
3425
3426 -gxcoff
3427 Produce debugging information in XCOFF format (if that is
3428 supported). This is the format used by the DBX debugger on IBM
3429 RS/6000 systems.
3430
3431 -gxcoff+
3432 Produce debugging information in XCOFF format (if that is
3433 supported), using GNU extensions understood only by the GNU
3434 debugger (GDB). The use of these extensions is likely to make
3435 other debuggers crash or refuse to read the program, and may cause
3436 assemblers other than the GNU assembler (GAS) to fail with an
3437 error.
3438
3439 -gdwarf-version
3440 Produce debugging information in DWARF format (if that is
3441 supported). This is the format used by DBX on IRIX 6. The value
3442 of version may be either 2, 3 or 4; the default version is 3.
3443
3444 Note that with DWARF version 2 some ports require, and will always
3445 use, some non-conflicting DWARF 3 extensions in the unwind tables.
3446
3447 Version 4 may require GDB 7.0 and -fvar-tracking-assignments for
3448 maximum benefit.
3449
3450 -gstrict-dwarf
3451 Disallow using extensions of later DWARF standard version than
3452 selected with -gdwarf-version. On most targets using non-
3453 conflicting DWARF extensions from later standard versions is
3454 allowed.
3455
3456 -gno-strict-dwarf
3457 Allow using extensions of later DWARF standard version than
3458 selected with -gdwarf-version.
3459
3460 -gvms
3461 Produce debugging information in VMS debug format (if that is
3462 supported). This is the format used by DEBUG on VMS systems.
3463
3464 -glevel
3465 -ggdblevel
3466 -gstabslevel
3467 -gcofflevel
3468 -gxcofflevel
3469 -gvmslevel
3470 Request debugging information and also use level to specify how
3471 much information. The default level is 2.
3472
3473 Level 0 produces no debug information at all. Thus, -g0 negates
3474 -g.
3475
3476 Level 1 produces minimal information, enough for making backtraces
3477 in parts of the program that you don't plan to debug. This
3478 includes descriptions of functions and external variables, but no
3479 information about local variables and no line numbers.
3480
3481 Level 3 includes extra information, such as all the macro
3482 definitions present in the program. Some debuggers support macro
3483 expansion when you use -g3.
3484
3485 -gdwarf-2 does not accept a concatenated debug level, because GCC
3486 used to support an option -gdwarf that meant to generate debug
3487 information in version 1 of the DWARF format (which is very
3488 different from version 2), and it would have been too confusing.
3489 That debug format is long obsolete, but the option cannot be
3490 changed now. Instead use an additional -glevel option to change
3491 the debug level for DWARF.
3492
3493 -gtoggle
3494 Turn off generation of debug info, if leaving out this option would
3495 have generated it, or turn it on at level 2 otherwise. The
3496 position of this argument in the command line does not matter, it
3497 takes effect after all other options are processed, and it does so
3498 only once, no matter how many times it is given. This is mainly
3499 intended to be used with -fcompare-debug.
3500
3501 -fdump-final-insns[=file]
3502 Dump the final internal representation (RTL) to file. If the
3503 optional argument is omitted (or if file is "."), the name of the
3504 dump file will be determined by appending ".gkd" to the compilation
3505 output file name.
3506
3507 -fcompare-debug[=opts]
3508 If no error occurs during compilation, run the compiler a second
3509 time, adding opts and -fcompare-debug-second to the arguments
3510 passed to the second compilation. Dump the final internal
3511 representation in both compilations, and print an error if they
3512 differ.
3513
3514 If the equal sign is omitted, the default -gtoggle is used.
3515
3516 The environment variable GCC_COMPARE_DEBUG, if defined, non-empty
3517 and nonzero, implicitly enables -fcompare-debug. If
3518 GCC_COMPARE_DEBUG is defined to a string starting with a dash, then
3519 it is used for opts, otherwise the default -gtoggle is used.
3520
3521 -fcompare-debug=, with the equal sign but without opts, is
3522 equivalent to -fno-compare-debug, which disables the dumping of the
3523 final representation and the second compilation, preventing even
3524 GCC_COMPARE_DEBUG from taking effect.
3525
3526 To verify full coverage during -fcompare-debug testing, set
3527 GCC_COMPARE_DEBUG to say -fcompare-debug-not-overridden, which GCC
3528 will reject as an invalid option in any actual compilation (rather
3529 than preprocessing, assembly or linking). To get just a warning,
3530 setting GCC_COMPARE_DEBUG to -w%n-fcompare-debug not overridden
3531 will do.
3532
3533 -fcompare-debug-second
3534 This option is implicitly passed to the compiler for the second
3535 compilation requested by -fcompare-debug, along with options to
3536 silence warnings, and omitting other options that would cause side-
3537 effect compiler outputs to files or to the standard output. Dump
3538 files and preserved temporary files are renamed so as to contain
3539 the ".gk" additional extension during the second compilation, to
3540 avoid overwriting those generated by the first.
3541
3542 When this option is passed to the compiler driver, it causes the
3543 first compilation to be skipped, which makes it useful for little
3544 other than debugging the compiler proper.
3545
3546 -feliminate-dwarf2-dups
3547 Compress DWARF2 debugging information by eliminating duplicated
3548 information about each symbol. This option only makes sense when
3549 generating DWARF2 debugging information with -gdwarf-2.
3550
3551 -femit-struct-debug-baseonly
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 struct was defined.
3555
3556 This option substantially reduces the size of debugging
3557 information, but at significant potential loss in type information
3558 to the debugger. See -femit-struct-debug-reduced for a less
3559 aggressive option. See -femit-struct-debug-detailed for more
3560 detailed control.
3561
3562 This option works only with DWARF 2.
3563
3564 -femit-struct-debug-reduced
3565 Emit debug information for struct-like types only when the base
3566 name of the compilation source file matches the base name of file
3567 in which the type was defined, unless the struct is a template or
3568 defined in a system header.
3569
3570 This option significantly reduces the size of debugging
3571 information, with some potential loss in type information to the
3572 debugger. See -femit-struct-debug-baseonly for a more aggressive
3573 option. See -femit-struct-debug-detailed for more detailed
3574 control.
3575
3576 This option works only with DWARF 2.
3577
3578 -femit-struct-debug-detailed[=spec-list]
3579 Specify the struct-like types for which the compiler will generate
3580 debug information. The intent is to reduce duplicate struct debug
3581 information between different object files within the same program.
3582
3583 This option is a detailed version of -femit-struct-debug-reduced
3584 and -femit-struct-debug-baseonly, which will serve for most needs.
3585
3586 A specification has the syntax
3587 [dir:|ind:][ord:|gen:](any|sys|base|none)
3588
3589 The optional first word limits the specification to structs that
3590 are used directly (dir:) or used indirectly (ind:). A struct type
3591 is used directly when it is the type of a variable, member.
3592 Indirect uses arise through pointers to structs. That is, when use
3593 of an incomplete struct would be legal, the use is indirect. An
3594 example is struct one direct; struct two * indirect;.
3595
3596 The optional second word limits the specification to ordinary
3597 structs (ord:) or generic structs (gen:). Generic structs are a
3598 bit complicated to explain. For C++, these are non-explicit
3599 specializations of template classes, or non-template classes within
3600 the above. Other programming languages have generics, but
3601 -femit-struct-debug-detailed does not yet implement them.
3602
3603 The third word specifies the source files for those structs for
3604 which the compiler will emit debug information. The values none
3605 and any have the normal meaning. The value base means that the
3606 base of name of the file in which the type declaration appears must
3607 match the base of the name of the main compilation file. In
3608 practice, this means that types declared in foo.c and foo.h will
3609 have debug information, but types declared in other header will
3610 not. The value sys means those types satisfying base or declared
3611 in system or compiler headers.
3612
3613 You may need to experiment to determine the best settings for your
3614 application.
3615
3616 The default is -femit-struct-debug-detailed=all.
3617
3618 This option works only with DWARF 2.
3619
3620 -fenable-icf-debug
3621 Generate additional debug information to support identical code
3622 folding (ICF). This option only works with DWARF version 2 or
3623 higher.
3624
3625 -fno-merge-debug-strings
3626 Direct the linker to not merge together strings in the debugging
3627 information which are identical in different object files. Merging
3628 is not supported by all assemblers or linkers. Merging decreases
3629 the size of the debug information in the output file at the cost of
3630 increasing link processing time. Merging is enabled by default.
3631
3632 -fdebug-prefix-map=old=new
3633 When compiling files in directory old, record debugging information
3634 describing them as in new instead.
3635
3636 -fno-dwarf2-cfi-asm
3637 Emit DWARF 2 unwind info as compiler generated ".eh_frame" section
3638 instead of using GAS ".cfi_*" directives.
3639
3640 -p Generate extra code to write profile information suitable for the
3641 analysis program prof. You must use this option when compiling the
3642 source files you want data about, and you must also use it when
3643 linking.
3644
3645 -pg Generate extra code to write profile information suitable for the
3646 analysis program gprof. You must use this option when compiling
3647 the source files you want data about, and you must also use it when
3648 linking.
3649
3650 -Q Makes the compiler print out each function name as it is compiled,
3651 and print some statistics about each pass when it finishes.
3652
3653 -ftime-report
3654 Makes the compiler print some statistics about the time consumed by
3655 each pass when it finishes.
3656
3657 -fmem-report
3658 Makes the compiler print some statistics about permanent memory
3659 allocation when it finishes.
3660
3661 -fpre-ipa-mem-report
3662 -fpost-ipa-mem-report
3663 Makes the compiler print some statistics about permanent memory
3664 allocation before or after interprocedural optimization.
3665
3666 -fprofile-arcs
3667 Add code so that program flow arcs are instrumented. During
3668 execution the program records how many times each branch and call
3669 is executed and how many times it is taken or returns. When the
3670 compiled program exits it saves this data to a file called
3671 auxname.gcda for each source file. The data may be used for
3672 profile-directed optimizations (-fbranch-probabilities), or for
3673 test coverage analysis (-ftest-coverage). Each object file's
3674 auxname is generated from the name of the output file, if
3675 explicitly specified and it is not the final executable, otherwise
3676 it is the basename of the source file. In both cases any suffix is
3677 removed (e.g. foo.gcda for input file dir/foo.c, or dir/foo.gcda
3678 for output file specified as -o dir/foo.o).
3679
3680 --coverage
3681 This option is used to compile and link code instrumented for
3682 coverage analysis. The option is a synonym for -fprofile-arcs
3683 -ftest-coverage (when compiling) and -lgcov (when linking). See
3684 the documentation for those options for more details.
3685
3686 · Compile the source files with -fprofile-arcs plus optimization
3687 and code generation options. For test coverage analysis, use
3688 the additional -ftest-coverage option. You do not need to
3689 profile every source file in a program.
3690
3691 · Link your object files with -lgcov or -fprofile-arcs (the
3692 latter implies the former).
3693
3694 · Run the program on a representative workload to generate the
3695 arc profile information. This may be repeated any number of
3696 times. You can run concurrent instances of your program, and
3697 provided that the file system supports locking, the data files
3698 will be correctly updated. Also "fork" calls are detected and
3699 correctly handled (double counting will not happen).
3700
3701 · For profile-directed optimizations, compile the source files
3702 again with the same optimization and code generation options
3703 plus -fbranch-probabilities.
3704
3705 · For test coverage analysis, use gcov to produce human readable
3706 information from the .gcno and .gcda files. Refer to the gcov
3707 documentation for further information.
3708
3709 With -fprofile-arcs, for each function of your program GCC creates
3710 a program flow graph, then finds a spanning tree for the graph.
3711 Only arcs that are not on the spanning tree have to be
3712 instrumented: the compiler adds code to count the number of times
3713 that these arcs are executed. When an arc is the only exit or only
3714 entrance to a block, the instrumentation code can be added to the
3715 block; otherwise, a new basic block must be created to hold the
3716 instrumentation code.
3717
3718 -ftest-coverage
3719 Produce a notes file that the gcov code-coverage utility can use to
3720 show program coverage. Each source file's note file is called
3721 auxname.gcno. Refer to the -fprofile-arcs option above for a
3722 description of auxname and instructions on how to generate test
3723 coverage data. Coverage data will match the source files more
3724 closely, if you do not optimize.
3725
3726 -fdbg-cnt-list
3727 Print the name and the counter upperbound for all debug counters.
3728
3729 -fdbg-cnt=counter-value-list
3730 Set the internal debug counter upperbound. counter-value-list is a
3731 comma-separated list of name:value pairs which sets the upperbound
3732 of each debug counter name to value. All debug counters have the
3733 initial upperbound of UINT_MAX, thus dbg_cnt() returns true always
3734 unless the upperbound is set by this option. e.g. With
3735 -fdbg-cnt=dce:10,tail_call:0 dbg_cnt(dce) will return true only for
3736 first 10 invocations and dbg_cnt(tail_call) will return false
3737 always.
3738
3739 -dletters
3740 -fdump-rtl-pass
3741 Says to make debugging dumps during compilation at times specified
3742 by letters. This is used for debugging the RTL-based passes of the
3743 compiler. The file names for most of the dumps are made by
3744 appending a pass number and a word to the dumpname, and the files
3745 are created in the directory of the output file. dumpname is
3746 generated from the name of the output file, if explicitly specified
3747 and it is not an executable, otherwise it is the basename of the
3748 source file. These switches may have different effects when -E is
3749 used for preprocessing.
3750
3751 Debug dumps can be enabled with a -fdump-rtl switch or some -d
3752 option letters. Here are the possible letters for use in pass and
3753 letters, and their meanings:
3754
3755 -fdump-rtl-alignments
3756 Dump after branch alignments have been computed.
3757
3758 -fdump-rtl-asmcons
3759 Dump after fixing rtl statements that have unsatisfied in/out
3760 constraints.
3761
3762 -fdump-rtl-auto_inc_dec
3763 Dump after auto-inc-dec discovery. This pass is only run on
3764 architectures that have auto inc or auto dec instructions.
3765
3766 -fdump-rtl-barriers
3767 Dump after cleaning up the barrier instructions.
3768
3769 -fdump-rtl-bbpart
3770 Dump after partitioning hot and cold basic blocks.
3771
3772 -fdump-rtl-bbro
3773 Dump after block reordering.
3774
3775 -fdump-rtl-btl1
3776 -fdump-rtl-btl2
3777 -fdump-rtl-btl1 and -fdump-rtl-btl2 enable dumping after the
3778 two branch target load optimization passes.
3779
3780 -fdump-rtl-bypass
3781 Dump after jump bypassing and control flow optimizations.
3782
3783 -fdump-rtl-combine
3784 Dump after the RTL instruction combination pass.
3785
3786 -fdump-rtl-compgotos
3787 Dump after duplicating the computed gotos.
3788
3789 -fdump-rtl-ce1
3790 -fdump-rtl-ce2
3791 -fdump-rtl-ce3
3792 -fdump-rtl-ce1, -fdump-rtl-ce2, and -fdump-rtl-ce3 enable
3793 dumping after the three if conversion passes.
3794
3795 -fdump-rtl-cprop_hardreg
3796 Dump after hard register copy propagation.
3797
3798 -fdump-rtl-csa
3799 Dump after combining stack adjustments.
3800
3801 -fdump-rtl-cse1
3802 -fdump-rtl-cse2
3803 -fdump-rtl-cse1 and -fdump-rtl-cse2 enable dumping after the
3804 two common sub-expression elimination passes.
3805
3806 -fdump-rtl-dce
3807 Dump after the standalone dead code elimination passes.
3808
3809 -fdump-rtl-dbr
3810 Dump after delayed branch scheduling.
3811
3812 -fdump-rtl-dce1
3813 -fdump-rtl-dce2
3814 -fdump-rtl-dce1 and -fdump-rtl-dce2 enable dumping after the
3815 two dead store elimination passes.
3816
3817 -fdump-rtl-eh
3818 Dump after finalization of EH handling code.
3819
3820 -fdump-rtl-eh_ranges
3821 Dump after conversion of EH handling range regions.
3822
3823 -fdump-rtl-expand
3824 Dump after RTL generation.
3825
3826 -fdump-rtl-fwprop1
3827 -fdump-rtl-fwprop2
3828 -fdump-rtl-fwprop1 and -fdump-rtl-fwprop2 enable dumping after
3829 the two forward propagation passes.
3830
3831 -fdump-rtl-gcse1
3832 -fdump-rtl-gcse2
3833 -fdump-rtl-gcse1 and -fdump-rtl-gcse2 enable dumping after
3834 global common subexpression elimination.
3835
3836 -fdump-rtl-init-regs
3837 Dump after the initialization of the registers.
3838
3839 -fdump-rtl-initvals
3840 Dump after the computation of the initial value sets.
3841
3842 -fdump-rtl-into_cfglayout
3843 Dump after converting to cfglayout mode.
3844
3845 -fdump-rtl-ira
3846 Dump after iterated register allocation.
3847
3848 -fdump-rtl-jump
3849 Dump after the second jump optimization.
3850
3851 -fdump-rtl-loop2
3852 -fdump-rtl-loop2 enables dumping after the rtl loop
3853 optimization passes.
3854
3855 -fdump-rtl-mach
3856 Dump after performing the machine dependent reorganization
3857 pass, if that pass exists.
3858
3859 -fdump-rtl-mode_sw
3860 Dump after removing redundant mode switches.
3861
3862 -fdump-rtl-rnreg
3863 Dump after register renumbering.
3864
3865 -fdump-rtl-outof_cfglayout
3866 Dump after converting from cfglayout mode.
3867
3868 -fdump-rtl-peephole2
3869 Dump after the peephole pass.
3870
3871 -fdump-rtl-postreload
3872 Dump after post-reload optimizations.
3873
3874 -fdump-rtl-pro_and_epilogue
3875 Dump after generating the function pro and epilogues.
3876
3877 -fdump-rtl-regmove
3878 Dump after the register move pass.
3879
3880 -fdump-rtl-sched1
3881 -fdump-rtl-sched2
3882 -fdump-rtl-sched1 and -fdump-rtl-sched2 enable dumping after
3883 the basic block scheduling passes.
3884
3885 -fdump-rtl-see
3886 Dump after sign extension elimination.
3887
3888 -fdump-rtl-seqabstr
3889 Dump after common sequence discovery.
3890
3891 -fdump-rtl-shorten
3892 Dump after shortening branches.
3893
3894 -fdump-rtl-sibling
3895 Dump after sibling call optimizations.
3896
3897 -fdump-rtl-split1
3898 -fdump-rtl-split2
3899 -fdump-rtl-split3
3900 -fdump-rtl-split4
3901 -fdump-rtl-split5
3902 -fdump-rtl-split1, -fdump-rtl-split2, -fdump-rtl-split3,
3903 -fdump-rtl-split4 and -fdump-rtl-split5 enable dumping after
3904 five rounds of instruction splitting.
3905
3906 -fdump-rtl-sms
3907 Dump after modulo scheduling. This pass is only run on some
3908 architectures.
3909
3910 -fdump-rtl-stack
3911 Dump after conversion from GCC's "flat register file" registers
3912 to the x87's stack-like registers. This pass is only run on
3913 x86 variants.
3914
3915 -fdump-rtl-subreg1
3916 -fdump-rtl-subreg2
3917 -fdump-rtl-subreg1 and -fdump-rtl-subreg2 enable dumping after
3918 the two subreg expansion passes.
3919
3920 -fdump-rtl-unshare
3921 Dump after all rtl has been unshared.
3922
3923 -fdump-rtl-vartrack
3924 Dump after variable tracking.
3925
3926 -fdump-rtl-vregs
3927 Dump after converting virtual registers to hard registers.
3928
3929 -fdump-rtl-web
3930 Dump after live range splitting.
3931
3932 -fdump-rtl-regclass
3933 -fdump-rtl-subregs_of_mode_init
3934 -fdump-rtl-subregs_of_mode_finish
3935 -fdump-rtl-dfinit
3936 -fdump-rtl-dfinish
3937 These dumps are defined but always produce empty files.
3938
3939 -fdump-rtl-all
3940 Produce all the dumps listed above.
3941
3942 -dA Annotate the assembler output with miscellaneous debugging
3943 information.
3944
3945 -dD Dump all macro definitions, at the end of preprocessing, in
3946 addition to normal output.
3947
3948 -dH Produce a core dump whenever an error occurs.
3949
3950 -dm Print statistics on memory usage, at the end of the run, to
3951 standard error.
3952
3953 -dp Annotate the assembler output with a comment indicating which
3954 pattern and alternative was used. The length of each
3955 instruction is also printed.
3956
3957 -dP Dump the RTL in the assembler output as a comment before each
3958 instruction. Also turns on -dp annotation.
3959
3960 -dv For each of the other indicated dump files (-fdump-rtl-pass),
3961 dump a representation of the control flow graph suitable for
3962 viewing with VCG to file.pass.vcg.
3963
3964 -dx Just generate RTL for a function instead of compiling it.
3965 Usually used with -fdump-rtl-expand.
3966
3967 -dy Dump debugging information during parsing, to standard error.
3968
3969 -fdump-noaddr
3970 When doing debugging dumps, suppress address output. This makes it
3971 more feasible to use diff on debugging dumps for compiler
3972 invocations with different compiler binaries and/or different text
3973 / bss / data / heap / stack / dso start locations.
3974
3975 -fdump-unnumbered
3976 When doing debugging dumps, suppress instruction numbers and
3977 address output. This makes it more feasible to use diff on
3978 debugging dumps for compiler invocations with different options, in
3979 particular with and without -g.
3980
3981 -fdump-unnumbered-links
3982 When doing debugging dumps (see -d option above), suppress
3983 instruction numbers for the links to the previous and next
3984 instructions in a sequence.
3985
3986 -fdump-translation-unit (C++ only)
3987 -fdump-translation-unit-options (C++ only)
3988 Dump a representation of the tree structure for the entire
3989 translation unit to a file. The file name is made by appending .tu
3990 to the source file name, and the file is created in the same
3991 directory as the output file. If the -options form is used,
3992 options controls the details of the dump as described for the
3993 -fdump-tree options.
3994
3995 -fdump-class-hierarchy (C++ only)
3996 -fdump-class-hierarchy-options (C++ only)
3997 Dump a representation of each class's hierarchy and virtual
3998 function table layout to a file. The file name is made by
3999 appending .class to the source file name, and the file is created
4000 in the same directory as the output file. If the -options form is
4001 used, options controls the details of the dump as described for the
4002 -fdump-tree options.
4003
4004 -fdump-ipa-switch
4005 Control the dumping at various stages of inter-procedural analysis
4006 language tree to a file. The file name is generated by appending a
4007 switch specific suffix to the source file name, and the file is
4008 created in the same directory as the output file. The following
4009 dumps are possible:
4010
4011 all Enables all inter-procedural analysis dumps.
4012
4013 cgraph
4014 Dumps information about call-graph optimization, unused
4015 function removal, and inlining decisions.
4016
4017 inline
4018 Dump after function inlining.
4019
4020 -fdump-statistics-option
4021 Enable and control dumping of pass statistics in a separate file.
4022 The file name is generated by appending a suffix ending in
4023 .statistics to the source file name, and the file is created in the
4024 same directory as the output file. If the -option form is used,
4025 -stats will cause counters to be summed over the whole compilation
4026 unit while -details will dump every event as the passes generate
4027 them. The default with no option is to sum counters for each
4028 function compiled.
4029
4030 -fdump-tree-switch
4031 -fdump-tree-switch-options
4032 Control the dumping at various stages of processing the
4033 intermediate language tree to a file. The file name is generated
4034 by appending a switch specific suffix to the source file name, and
4035 the file is created in the same directory as the output file. If
4036 the -options form is used, options is a list of - separated options
4037 that control the details of the dump. Not all options are
4038 applicable to all dumps, those which are not meaningful will be
4039 ignored. The following options are available
4040
4041 address
4042 Print the address of each node. Usually this is not meaningful
4043 as it changes according to the environment and source file.
4044 Its primary use is for tying up a dump file with a debug
4045 environment.
4046
4047 asmname
4048 If "DECL_ASSEMBLER_NAME" has been set for a given decl, use
4049 that in the dump instead of "DECL_NAME". Its primary use is
4050 ease of use working backward from mangled names in the assembly
4051 file.
4052
4053 slim
4054 Inhibit dumping of members of a scope or body of a function
4055 merely because that scope has been reached. Only dump such
4056 items when they are directly reachable by some other path.
4057 When dumping pretty-printed trees, this option inhibits dumping
4058 the bodies of control structures.
4059
4060 raw Print a raw representation of the tree. By default, trees are
4061 pretty-printed into a C-like representation.
4062
4063 details
4064 Enable more detailed dumps (not honored by every dump option).
4065
4066 stats
4067 Enable dumping various statistics about the pass (not honored
4068 by every dump option).
4069
4070 blocks
4071 Enable showing basic block boundaries (disabled in raw dumps).
4072
4073 vops
4074 Enable showing virtual operands for every statement.
4075
4076 lineno
4077 Enable showing line numbers for statements.
4078
4079 uid Enable showing the unique ID ("DECL_UID") for each variable.
4080
4081 verbose
4082 Enable showing the tree dump for each statement.
4083
4084 eh Enable showing the EH region number holding each statement.
4085
4086 all Turn on all options, except raw, slim, verbose and lineno.
4087
4088 The following tree dumps are possible:
4089
4090 original
4091 Dump before any tree based optimization, to file.original.
4092
4093 optimized
4094 Dump after all tree based optimization, to file.optimized.
4095
4096 gimple
4097 Dump each function before and after the gimplification pass to
4098 a file. The file name is made by appending .gimple to the
4099 source file name.
4100
4101 cfg Dump the control flow graph of each function to a file. The
4102 file name is made by appending .cfg to the source file name.
4103
4104 vcg Dump the control flow graph of each function to a file in VCG
4105 format. The file name is made by appending .vcg to the source
4106 file name. Note that if the file contains more than one
4107 function, the generated file cannot be used directly by VCG.
4108 You will need to cut and paste each function's graph into its
4109 own separate file first.
4110
4111 ch Dump each function after copying loop headers. The file name
4112 is made by appending .ch to the source file name.
4113
4114 ssa Dump SSA related information to a file. The file name is made
4115 by appending .ssa to the source file name.
4116
4117 alias
4118 Dump aliasing information for each function. The file name is
4119 made by appending .alias to the source file name.
4120
4121 ccp Dump each function after CCP. The file name is made by
4122 appending .ccp to the source file name.
4123
4124 storeccp
4125 Dump each function after STORE-CCP. The file name is made by
4126 appending .storeccp to the source file name.
4127
4128 pre Dump trees after partial redundancy elimination. The file name
4129 is made by appending .pre to the source file name.
4130
4131 fre Dump trees after full redundancy elimination. The file name is
4132 made by appending .fre to the source file name.
4133
4134 copyprop
4135 Dump trees after copy propagation. The file name is made by
4136 appending .copyprop to the source file name.
4137
4138 store_copyprop
4139 Dump trees after store copy-propagation. The file name is made
4140 by appending .store_copyprop to the source file name.
4141
4142 dce Dump each function after dead code elimination. The file name
4143 is made by appending .dce to the source file name.
4144
4145 mudflap
4146 Dump each function after adding mudflap instrumentation. The
4147 file name is made by appending .mudflap to the source file
4148 name.
4149
4150 sra Dump each function after performing scalar replacement of
4151 aggregates. The file name is made by appending .sra to the
4152 source file name.
4153
4154 sink
4155 Dump each function after performing code sinking. The file
4156 name is made by appending .sink to the source file name.
4157
4158 dom Dump each function after applying dominator tree optimizations.
4159 The file name is made by appending .dom to the source file
4160 name.
4161
4162 dse Dump each function after applying dead store elimination. The
4163 file name is made by appending .dse to the source file name.
4164
4165 phiopt
4166 Dump each function after optimizing PHI nodes into straightline
4167 code. The file name is made by appending .phiopt to the source
4168 file name.
4169
4170 forwprop
4171 Dump each function after forward propagating single use
4172 variables. The file name is made by appending .forwprop to the
4173 source file name.
4174
4175 copyrename
4176 Dump each function after applying the copy rename optimization.
4177 The file name is made by appending .copyrename to the source
4178 file name.
4179
4180 nrv Dump each function after applying the named return value
4181 optimization on generic trees. The file name is made by
4182 appending .nrv to the source file name.
4183
4184 vect
4185 Dump each function after applying vectorization of loops. The
4186 file name is made by appending .vect to the source file name.
4187
4188 slp Dump each function after applying vectorization of basic
4189 blocks. The file name is made by appending .slp to the source
4190 file name.
4191
4192 vrp Dump each function after Value Range Propagation (VRP). The
4193 file name is made by appending .vrp to the source file name.
4194
4195 all Enable all the available tree dumps with the flags provided in
4196 this option.
4197
4198 -ftree-vectorizer-verbose=n
4199 This option controls the amount of debugging output the vectorizer
4200 prints. This information is written to standard error, unless
4201 -fdump-tree-all or -fdump-tree-vect is specified, in which case it
4202 is output to the usual dump listing file, .vect. For n=0 no
4203 diagnostic information is reported. If n=1 the vectorizer reports
4204 each loop that got vectorized, and the total number of loops that
4205 got vectorized. If n=2 the vectorizer also reports non-vectorized
4206 loops that passed the first analysis phase (vect_analyze_loop_form)
4207 - i.e. countable, inner-most, single-bb, single-entry/exit loops.
4208 This is the same verbosity level that -fdump-tree-vect-stats uses.
4209 Higher verbosity levels mean either more information dumped for
4210 each reported loop, or same amount of information reported for more
4211 loops: if n=3, vectorizer cost model information is reported. If
4212 n=4, alignment related information is added to the reports. If
4213 n=5, data-references related information (e.g. memory dependences,
4214 memory access-patterns) is added to the reports. If n=6, the
4215 vectorizer reports also non-vectorized inner-most loops that did
4216 not pass the first analysis phase (i.e., may not be countable, or
4217 may have complicated control-flow). If n=7, the vectorizer reports
4218 also non-vectorized nested loops. If n=8, SLP related information
4219 is added to the reports. For n=9, all the information the
4220 vectorizer generates during its analysis and transformation is
4221 reported. This is the same verbosity level that
4222 -fdump-tree-vect-details uses.
4223
4224 -frandom-seed=string
4225 This option provides a seed that GCC uses when it would otherwise
4226 use random numbers. It is used to generate certain symbol names
4227 that have to be different in every compiled file. It is also used
4228 to place unique stamps in coverage data files and the object files
4229 that produce them. You can use the -frandom-seed option to produce
4230 reproducibly identical object files.
4231
4232 The string should be different for every file you compile.
4233
4234 -fsched-verbose=n
4235 On targets that use instruction scheduling, this option controls
4236 the amount of debugging output the scheduler prints. This
4237 information is written to standard error, unless -fdump-rtl-sched1
4238 or -fdump-rtl-sched2 is specified, in which case it is output to
4239 the usual dump listing file, .sched1 or .sched2 respectively.
4240 However for n greater than nine, the output is always printed to
4241 standard error.
4242
4243 For n greater than zero, -fsched-verbose outputs the same
4244 information as -fdump-rtl-sched1 and -fdump-rtl-sched2. For n
4245 greater than one, it also output basic block probabilities,
4246 detailed ready list information and unit/insn info. For n greater
4247 than two, it includes RTL at abort point, control-flow and regions
4248 info. And for n over four, -fsched-verbose also includes
4249 dependence info.
4250
4251 -save-temps
4252 -save-temps=cwd
4253 Store the usual "temporary" intermediate files permanently; place
4254 them in the current directory and name them based on the source
4255 file. Thus, compiling foo.c with -c -save-temps would produce
4256 files foo.i and foo.s, as well as foo.o. This creates a
4257 preprocessed foo.i output file even though the compiler now
4258 normally uses an integrated preprocessor.
4259
4260 When used in combination with the -x command line option,
4261 -save-temps is sensible enough to avoid over writing an input
4262 source file with the same extension as an intermediate file. The
4263 corresponding intermediate file may be obtained by renaming the
4264 source file before using -save-temps.
4265
4266 If you invoke GCC in parallel, compiling several different source
4267 files that share a common base name in different subdirectories or
4268 the same source file compiled for multiple output destinations, it
4269 is likely that the different parallel compilers will interfere with
4270 each other, and overwrite the temporary files. For instance:
4271
4272 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
4273 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
4274
4275 may result in foo.i and foo.o being written to simultaneously by
4276 both compilers.
4277
4278 -save-temps=obj
4279 Store the usual "temporary" intermediate files permanently. If the
4280 -o option is used, the temporary files are based on the object
4281 file. If the -o option is not used, the -save-temps=obj switch
4282 behaves like -save-temps.
4283
4284 For example:
4285
4286 gcc -save-temps=obj -c foo.c
4287 gcc -save-temps=obj -c bar.c -o dir/xbar.o
4288 gcc -save-temps=obj foobar.c -o dir2/yfoobar
4289
4290 would create foo.i, foo.s, dir/xbar.i, dir/xbar.s, dir2/yfoobar.i,
4291 dir2/yfoobar.s, and dir2/yfoobar.o.
4292
4293 -time[=file]
4294 Report the CPU time taken by each subprocess in the compilation
4295 sequence. For C source files, this is the compiler proper and
4296 assembler (plus the linker if linking is done).
4297
4298 Without the specification of an output file, the output looks like
4299 this:
4300
4301 # cc1 0.12 0.01
4302 # as 0.00 0.01
4303
4304 The first number on each line is the "user time", that is time
4305 spent executing the program itself. The second number is "system
4306 time", time spent executing operating system routines on behalf of
4307 the program. Both numbers are in seconds.
4308
4309 With the specification of an output file, the output is appended to
4310 the named file, and it looks like this:
4311
4312 0.12 0.01 cc1 <options>
4313 0.00 0.01 as <options>
4314
4315 The "user time" and the "system time" are moved before the program
4316 name, and the options passed to the program are displayed, so that
4317 one can later tell what file was being compiled, and with which
4318 options.
4319
4320 -fvar-tracking
4321 Run variable tracking pass. It computes where variables are stored
4322 at each position in code. Better debugging information is then
4323 generated (if the debugging information format supports this
4324 information).
4325
4326 It is enabled by default when compiling with optimization (-Os, -O,
4327 -O2, ...), debugging information (-g) and the debug info format
4328 supports it.
4329
4330 -fvar-tracking-assignments
4331 Annotate assignments to user variables early in the compilation and
4332 attempt to carry the annotations over throughout the compilation
4333 all the way to the end, in an attempt to improve debug information
4334 while optimizing. Use of -gdwarf-4 is recommended along with it.
4335
4336 It can be enabled even if var-tracking is disabled, in which case
4337 annotations will be created and maintained, but discarded at the
4338 end.
4339
4340 -fvar-tracking-assignments-toggle
4341 Toggle -fvar-tracking-assignments, in the same way that -gtoggle
4342 toggles -g.
4343
4344 -print-file-name=library
4345 Print the full absolute name of the library file library that would
4346 be used when linking---and don't do anything else. With this
4347 option, GCC does not compile or link anything; it just prints the
4348 file name.
4349
4350 -print-multi-directory
4351 Print the directory name corresponding to the multilib selected by
4352 any other switches present in the command line. This directory is
4353 supposed to exist in GCC_EXEC_PREFIX.
4354
4355 -print-multi-lib
4356 Print the mapping from multilib directory names to compiler
4357 switches that enable them. The directory name is separated from
4358 the switches by ;, and each switch starts with an @} instead of the
4359 @samp{-, without spaces between multiple switches. This is
4360 supposed to ease shell-processing.
4361
4362 -print-multi-os-directory
4363 Print the path to OS libraries for the selected multilib, relative
4364 to some lib subdirectory. If OS libraries are present in the lib
4365 subdirectory and no multilibs are used, this is usually just ., if
4366 OS libraries are present in libsuffix sibling directories this
4367 prints e.g. ../lib64, ../lib or ../lib32, or if OS libraries are
4368 present in lib/subdir subdirectories it prints e.g. amd64, sparcv9
4369 or ev6.
4370
4371 -print-prog-name=program
4372 Like -print-file-name, but searches for a program such as cpp.
4373
4374 -print-libgcc-file-name
4375 Same as -print-file-name=libgcc.a.
4376
4377 This is useful when you use -nostdlib or -nodefaultlibs but you do
4378 want to link with libgcc.a. You can do
4379
4380 gcc -nostdlib <files>... `gcc -print-libgcc-file-name`
4381
4382 -print-search-dirs
4383 Print the name of the configured installation directory and a list
4384 of program and library directories gcc will search---and don't do
4385 anything else.
4386
4387 This is useful when gcc prints the error message installation
4388 problem, cannot exec cpp0: No such file or directory. To resolve
4389 this you either need to put cpp0 and the other compiler components
4390 where gcc expects to find them, or you can set the environment
4391 variable GCC_EXEC_PREFIX to the directory where you installed them.
4392 Don't forget the trailing /.
4393
4394 -print-sysroot
4395 Print the target sysroot directory that will be used during
4396 compilation. This is the target sysroot specified either at
4397 configure time or using the --sysroot option, possibly with an
4398 extra suffix that depends on compilation options. If no target
4399 sysroot is specified, the option prints nothing.
4400
4401 -print-sysroot-headers-suffix
4402 Print the suffix added to the target sysroot when searching for
4403 headers, or give an error if the compiler is not configured with
4404 such a suffix---and don't do anything else.
4405
4406 -dumpmachine
4407 Print the compiler's target machine (for example,
4408 i686-pc-linux-gnu)---and don't do anything else.
4409
4410 -dumpversion
4411 Print the compiler version (for example, 3.0)---and don't do
4412 anything else.
4413
4414 -dumpspecs
4415 Print the compiler's built-in specs---and don't do anything else.
4416 (This is used when GCC itself is being built.)
4417
4418 -feliminate-unused-debug-types
4419 Normally, when producing DWARF2 output, GCC will emit debugging
4420 information for all types declared in a compilation unit,
4421 regardless of whether or not they are actually used in that
4422 compilation unit. Sometimes this is useful, such as if, in the
4423 debugger, you want to cast a value to a type that is not actually
4424 used in your program (but is declared). More often, however, this
4425 results in a significant amount of wasted space. With this option,
4426 GCC will avoid producing debug symbol output for types that are
4427 nowhere used in the source file being compiled.
4428
4429 Options That Control Optimization
4430 These options control various sorts of optimizations.
4431
4432 Without any optimization option, the compiler's goal is to reduce the
4433 cost of compilation and to make debugging produce the expected results.
4434 Statements are independent: if you stop the program with a breakpoint
4435 between statements, you can then assign a new value to any variable or
4436 change the program counter to any other statement in the function and
4437 get exactly the results you would expect from the source code.
4438
4439 Turning on optimization flags makes the compiler attempt to improve the
4440 performance and/or code size at the expense of compilation time and
4441 possibly the ability to debug the program.
4442
4443 The compiler performs optimization based on the knowledge it has of the
4444 program. Compiling multiple files at once to a single output file mode
4445 allows the compiler to use information gained from all of the files
4446 when compiling each of them.
4447
4448 Not all optimizations are controlled directly by a flag. Only
4449 optimizations that have a flag are listed in this section.
4450
4451 Most optimizations are only enabled if an -O level is set on the
4452 command line. Otherwise they are disabled, even if individual
4453 optimization flags are specified.
4454
4455 Depending on the target and how GCC was configured, a slightly
4456 different set of optimizations may be enabled at each -O level than
4457 those listed here. You can invoke GCC with -Q --help=optimizers to
4458 find out the exact set of optimizations that are enabled at each level.
4459
4460 -O
4461 -O1 Optimize. Optimizing compilation takes somewhat more time, and a
4462 lot more memory for a large function.
4463
4464 With -O, the compiler tries to reduce code size and execution time,
4465 without performing any optimizations that take a great deal of
4466 compilation time.
4467
4468 -O turns on the following optimization flags:
4469
4470 -fauto-inc-dec -fcprop-registers -fdce -fdefer-pop -fdelayed-branch
4471 -fdse -fguess-branch-probability -fif-conversion2 -fif-conversion
4472 -fipa-pure-const -fipa-reference -fmerge-constants
4473 -fsplit-wide-types -ftree-builtin-call-dce -ftree-ccp -ftree-ch
4474 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse
4475 -ftree-forwprop -ftree-fre -ftree-phiprop -ftree-sra -ftree-pta
4476 -ftree-ter -funit-at-a-time
4477
4478 -O also turns on -fomit-frame-pointer on machines where doing so
4479 does not interfere with debugging.
4480
4481 -O2 Optimize even more. GCC performs nearly all supported
4482 optimizations that do not involve a space-speed tradeoff. As
4483 compared to -O, this option increases both compilation time and the
4484 performance of the generated code.
4485
4486 -O2 turns on all optimization flags specified by -O. It also turns
4487 on the following optimization flags: -fthread-jumps
4488 -falign-functions -falign-jumps -falign-loops -falign-labels
4489 -fcaller-saves -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks
4490 -fdelete-null-pointer-checks -fexpensive-optimizations -fgcse
4491 -fgcse-lm -finline-small-functions -findirect-inlining -fipa-sra
4492 -foptimize-sibling-calls -fpeephole2 -fregmove -freorder-blocks
4493 -freorder-functions -frerun-cse-after-loop -fsched-interblock
4494 -fsched-spec -fschedule-insns -fschedule-insns2 -fstrict-aliasing
4495 -fstrict-overflow -ftree-switch-conversion -ftree-pre -ftree-vrp
4496
4497 Please note the warning under -fgcse about invoking -O2 on programs
4498 that use computed gotos.
4499
4500 -O3 Optimize yet more. -O3 turns on all optimizations specified by -O2
4501 and also turns on the -finline-functions, -funswitch-loops,
4502 -fpredictive-commoning, -fgcse-after-reload, -ftree-vectorize and
4503 -fipa-cp-clone options.
4504
4505 -O0 Reduce compilation time and make debugging produce the expected
4506 results. This is the default.
4507
4508 -Os Optimize for size. -Os enables all -O2 optimizations that do not
4509 typically increase code size. It also performs further
4510 optimizations designed to reduce code size.
4511
4512 -Os disables the following optimization flags: -falign-functions
4513 -falign-jumps -falign-loops -falign-labels -freorder-blocks
4514 -freorder-blocks-and-partition -fprefetch-loop-arrays
4515 -ftree-vect-loop-version
4516
4517 If you use multiple -O options, with or without level numbers, the
4518 last such option is the one that is effective.
4519
4520 Options of the form -fflag specify machine-independent flags. Most
4521 flags have both positive and negative forms; the negative form of -ffoo
4522 would be -fno-foo. In the table below, only one of the forms is
4523 listed---the one you typically will use. You can figure out the other
4524 form by either removing no- or adding it.
4525
4526 The following options control specific optimizations. They are either
4527 activated by -O options or are related to ones that are. You can use
4528 the following flags in the rare cases when "fine-tuning" of
4529 optimizations to be performed is desired.
4530
4531 -fno-default-inline
4532 Do not make member functions inline by default merely because they
4533 are defined inside the class scope (C++ only). Otherwise, when you
4534 specify -O, member functions defined inside class scope are
4535 compiled inline by default; i.e., you don't need to add inline in
4536 front of the member function name.
4537
4538 -fno-defer-pop
4539 Always pop the arguments to each function call as soon as that
4540 function returns. For machines which must pop arguments after a
4541 function call, the compiler normally lets arguments accumulate on
4542 the stack for several function calls and pops them all at once.
4543
4544 Disabled at levels -O, -O2, -O3, -Os.
4545
4546 -fforward-propagate
4547 Perform a forward propagation pass on RTL. The pass tries to
4548 combine two instructions and checks if the result can be
4549 simplified. If loop unrolling is active, two passes are performed
4550 and the second is scheduled after loop unrolling.
4551
4552 This option is enabled by default at optimization levels -O, -O2,
4553 -O3, -Os.
4554
4555 -fomit-frame-pointer
4556 Don't keep the frame pointer in a register for functions that don't
4557 need one. This avoids the instructions to save, set up and restore
4558 frame pointers; it also makes an extra register available in many
4559 functions. It also makes debugging impossible on some machines.
4560
4561 On some machines, such as the VAX, this flag has no effect, because
4562 the standard calling sequence automatically handles the frame
4563 pointer and nothing is saved by pretending it doesn't exist. The
4564 machine-description macro "FRAME_POINTER_REQUIRED" controls whether
4565 a target machine supports this flag.
4566
4567 Enabled at levels -O, -O2, -O3, -Os.
4568
4569 -foptimize-sibling-calls
4570 Optimize sibling and tail recursive calls.
4571
4572 Enabled at levels -O2, -O3, -Os.
4573
4574 -fno-inline
4575 Don't pay attention to the "inline" keyword. Normally this option
4576 is used to keep the compiler from expanding any functions inline.
4577 Note that if you are not optimizing, no functions can be expanded
4578 inline.
4579
4580 -finline-small-functions
4581 Integrate functions into their callers when their body is smaller
4582 than expected function call code (so overall size of program gets
4583 smaller). The compiler heuristically decides which functions are
4584 simple enough to be worth integrating in this way.
4585
4586 Enabled at level -O2.
4587
4588 -findirect-inlining
4589 Inline also indirect calls that are discovered to be known at
4590 compile time thanks to previous inlining. This option has any
4591 effect only when inlining itself is turned on by the
4592 -finline-functions or -finline-small-functions options.
4593
4594 Enabled at level -O2.
4595
4596 -finline-functions
4597 Integrate all simple functions into their callers. The compiler
4598 heuristically decides which functions are simple enough to be worth
4599 integrating in this way.
4600
4601 If all calls to a given function are integrated, and the function
4602 is declared "static", then the function is normally not output as
4603 assembler code in its own right.
4604
4605 Enabled at level -O3.
4606
4607 -finline-functions-called-once
4608 Consider all "static" functions called once for inlining into their
4609 caller even if they are not marked "inline". If a call to a given
4610 function is integrated, then the function is not output as
4611 assembler code in its own right.
4612
4613 Enabled at levels -O1, -O2, -O3 and -Os.
4614
4615 -fearly-inlining
4616 Inline functions marked by "always_inline" and functions whose body
4617 seems smaller than the function call overhead early before doing
4618 -fprofile-generate instrumentation and real inlining pass. Doing
4619 so makes profiling significantly cheaper and usually inlining
4620 faster on programs having large chains of nested wrapper functions.
4621
4622 Enabled by default.
4623
4624 -fipa-sra
4625 Perform interprocedural scalar replacement of aggregates, removal
4626 of unused parameters and replacement of parameters passed by
4627 reference by parameters passed by value.
4628
4629 Enabled at levels -O2, -O3 and -Os.
4630
4631 -finline-limit=n
4632 By default, GCC limits the size of functions that can be inlined.
4633 This flag allows coarse control of this limit. n is the size of
4634 functions that can be inlined in number of pseudo instructions.
4635
4636 Inlining is actually controlled by a number of parameters, which
4637 may be specified individually by using --param name=value. The
4638 -finline-limit=n option sets some of these parameters as follows:
4639
4640 max-inline-insns-single
4641 is set to n/2.
4642
4643 max-inline-insns-auto
4644 is set to n/2.
4645
4646 See below for a documentation of the individual parameters
4647 controlling inlining and for the defaults of these parameters.
4648
4649 Note: there may be no value to -finline-limit that results in
4650 default behavior.
4651
4652 Note: pseudo instruction represents, in this particular context, an
4653 abstract measurement of function's size. In no way does it
4654 represent a count of assembly instructions and as such its exact
4655 meaning might change from one release to an another.
4656
4657 -fkeep-inline-functions
4658 In C, emit "static" functions that are declared "inline" into the
4659 object file, even if the function has been inlined into all of its
4660 callers. This switch does not affect functions using the "extern
4661 inline" extension in GNU C90. In C++, emit any and all inline
4662 functions into the object file.
4663
4664 -fkeep-static-consts
4665 Emit variables declared "static const" when optimization isn't
4666 turned on, even if the variables aren't referenced.
4667
4668 GCC enables this option by default. If you want to force the
4669 compiler to check if the variable was referenced, regardless of
4670 whether or not optimization is turned on, use the
4671 -fno-keep-static-consts option.
4672
4673 -fmerge-constants
4674 Attempt to merge identical constants (string constants and floating
4675 point constants) across compilation units.
4676
4677 This option is the default for optimized compilation if the
4678 assembler and linker support it. Use -fno-merge-constants to
4679 inhibit this behavior.
4680
4681 Enabled at levels -O, -O2, -O3, -Os.
4682
4683 -fmerge-all-constants
4684 Attempt to merge identical constants and identical variables.
4685
4686 This option implies -fmerge-constants. In addition to
4687 -fmerge-constants this considers e.g. even constant initialized
4688 arrays or initialized constant variables with integral or floating
4689 point types. Languages like C or C++ require each variable,
4690 including multiple instances of the same variable in recursive
4691 calls, to have distinct locations, so using this option will result
4692 in non-conforming behavior.
4693
4694 -fmodulo-sched
4695 Perform swing modulo scheduling immediately before the first
4696 scheduling pass. This pass looks at innermost loops and reorders
4697 their instructions by overlapping different iterations.
4698
4699 -fmodulo-sched-allow-regmoves
4700 Perform more aggressive SMS based modulo scheduling with register
4701 moves allowed. By setting this flag certain anti-dependences edges
4702 will be deleted which will trigger the generation of reg-moves
4703 based on the life-range analysis. This option is effective only
4704 with -fmodulo-sched enabled.
4705
4706 -fno-branch-count-reg
4707 Do not use "decrement and branch" instructions on a count register,
4708 but instead generate a sequence of instructions that decrement a
4709 register, compare it against zero, then branch based upon the
4710 result. This option is only meaningful on architectures that
4711 support such instructions, which include x86, PowerPC, IA-64 and
4712 S/390.
4713
4714 The default is -fbranch-count-reg.
4715
4716 -fno-function-cse
4717 Do not put function addresses in registers; make each instruction
4718 that calls a constant function contain the function's address
4719 explicitly.
4720
4721 This option results in less efficient code, but some strange hacks
4722 that alter the assembler output may be confused by the
4723 optimizations performed when this option is not used.
4724
4725 The default is -ffunction-cse
4726
4727 -fno-zero-initialized-in-bss
4728 If the target supports a BSS section, GCC by default puts variables
4729 that are initialized to zero into BSS. This can save space in the
4730 resulting code.
4731
4732 This option turns off this behavior because some programs
4733 explicitly rely on variables going to the data section. E.g., so
4734 that the resulting executable can find the beginning of that
4735 section and/or make assumptions based on that.
4736
4737 The default is -fzero-initialized-in-bss.
4738
4739 -fmudflap -fmudflapth -fmudflapir
4740 For front-ends that support it (C and C++), instrument all risky
4741 pointer/array dereferencing operations, some standard library
4742 string/heap functions, and some other associated constructs with
4743 range/validity tests. Modules so instrumented should be immune to
4744 buffer overflows, invalid heap use, and some other classes of C/C++
4745 programming errors. The instrumentation relies on a separate
4746 runtime library (libmudflap), which will be linked into a program
4747 if -fmudflap is given at link time. Run-time behavior of the
4748 instrumented program is controlled by the MUDFLAP_OPTIONS
4749 environment variable. See "env MUDFLAP_OPTIONS=-help a.out" for
4750 its options.
4751
4752 Use -fmudflapth instead of -fmudflap to compile and to link if your
4753 program is multi-threaded. Use -fmudflapir, in addition to
4754 -fmudflap or -fmudflapth, if instrumentation should ignore pointer
4755 reads. This produces less instrumentation (and therefore faster
4756 execution) and still provides some protection against outright
4757 memory corrupting writes, but allows erroneously read data to
4758 propagate within a program.
4759
4760 -fthread-jumps
4761 Perform optimizations where we check to see if a jump branches to a
4762 location where another comparison subsumed by the first is found.
4763 If so, the first branch is redirected to either the destination of
4764 the second branch or a point immediately following it, depending on
4765 whether the condition is known to be true or false.
4766
4767 Enabled at levels -O2, -O3, -Os.
4768
4769 -fsplit-wide-types
4770 When using a type that occupies multiple registers, such as "long
4771 long" on a 32-bit system, split the registers apart and allocate
4772 them independently. This normally generates better code for those
4773 types, but may make debugging more difficult.
4774
4775 Enabled at levels -O, -O2, -O3, -Os.
4776
4777 -fcse-follow-jumps
4778 In common subexpression elimination (CSE), scan through jump
4779 instructions when the target of the jump is not reached by any
4780 other path. For example, when CSE encounters an "if" statement
4781 with an "else" clause, CSE will follow the jump when the condition
4782 tested is false.
4783
4784 Enabled at levels -O2, -O3, -Os.
4785
4786 -fcse-skip-blocks
4787 This is similar to -fcse-follow-jumps, but causes CSE to follow
4788 jumps which conditionally skip over blocks. When CSE encounters a
4789 simple "if" statement with no else clause, -fcse-skip-blocks causes
4790 CSE to follow the jump around the body of the "if".
4791
4792 Enabled at levels -O2, -O3, -Os.
4793
4794 -frerun-cse-after-loop
4795 Re-run common subexpression elimination after loop optimizations
4796 has been performed.
4797
4798 Enabled at levels -O2, -O3, -Os.
4799
4800 -fgcse
4801 Perform a global common subexpression elimination pass. This pass
4802 also performs global constant and copy propagation.
4803
4804 Note: When compiling a program using computed gotos, a GCC
4805 extension, you may get better runtime performance if you disable
4806 the global common subexpression elimination pass by adding
4807 -fno-gcse to the command line.
4808
4809 Enabled at levels -O2, -O3, -Os.
4810
4811 -fgcse-lm
4812 When -fgcse-lm is enabled, global common subexpression elimination
4813 will attempt to move loads which are only killed by stores into
4814 themselves. This allows a loop containing a load/store sequence to
4815 be changed to a load outside the loop, and a copy/store within the
4816 loop.
4817
4818 Enabled by default when gcse is enabled.
4819
4820 -fgcse-sm
4821 When -fgcse-sm is enabled, a store motion pass is run after global
4822 common subexpression elimination. This pass will attempt to move
4823 stores out of loops. When used in conjunction with -fgcse-lm,
4824 loops containing a load/store sequence can be changed to a load
4825 before the loop and a store after the loop.
4826
4827 Not enabled at any optimization level.
4828
4829 -fgcse-las
4830 When -fgcse-las is enabled, the global common subexpression
4831 elimination pass eliminates redundant loads that come after stores
4832 to the same memory location (both partial and full redundancies).
4833
4834 Not enabled at any optimization level.
4835
4836 -fgcse-after-reload
4837 When -fgcse-after-reload is enabled, a redundant load elimination
4838 pass is performed after reload. The purpose of this pass is to
4839 cleanup redundant spilling.
4840
4841 -funsafe-loop-optimizations
4842 If given, the loop optimizer will assume that loop indices do not
4843 overflow, and that the loops with nontrivial exit condition are not
4844 infinite. This enables a wider range of loop optimizations even if
4845 the loop optimizer itself cannot prove that these assumptions are
4846 valid. Using -Wunsafe-loop-optimizations, the compiler will warn
4847 you if it finds this kind of loop.
4848
4849 -fcrossjumping
4850 Perform cross-jumping transformation. This transformation unifies
4851 equivalent code and save code size. The resulting code may or may
4852 not perform better than without cross-jumping.
4853
4854 Enabled at levels -O2, -O3, -Os.
4855
4856 -fauto-inc-dec
4857 Combine increments or decrements of addresses with memory accesses.
4858 This pass is always skipped on architectures that do not have
4859 instructions to support this. Enabled by default at -O and higher
4860 on architectures that support this.
4861
4862 -fdce
4863 Perform dead code elimination (DCE) on RTL. Enabled by default at
4864 -O and higher.
4865
4866 -fdse
4867 Perform dead store elimination (DSE) on RTL. Enabled by default at
4868 -O and higher.
4869
4870 -fif-conversion
4871 Attempt to transform conditional jumps into branch-less
4872 equivalents. This include use of conditional moves, min, max, set
4873 flags and abs instructions, and some tricks doable by standard
4874 arithmetics. The use of conditional execution on chips where it is
4875 available is controlled by "if-conversion2".
4876
4877 Enabled at levels -O, -O2, -O3, -Os.
4878
4879 -fif-conversion2
4880 Use conditional execution (where available) to transform
4881 conditional jumps into branch-less equivalents.
4882
4883 Enabled at levels -O, -O2, -O3, -Os.
4884
4885 -fdelete-null-pointer-checks
4886 Assume that programs cannot safely dereference null pointers, and
4887 that no code or data element resides there. This enables simple
4888 constant folding optimizations at all optimization levels. In
4889 addition, other optimization passes in GCC use this flag to control
4890 global dataflow analyses that eliminate useless checks for null
4891 pointers; these assume that if a pointer is checked after it has
4892 already been dereferenced, it cannot be null.
4893
4894 Note however that in some environments this assumption is not true.
4895 Use -fno-delete-null-pointer-checks to disable this optimization
4896 for programs which depend on that behavior.
4897
4898 Some targets, especially embedded ones, disable this option at all
4899 levels. Otherwise it is enabled at all levels: -O0, -O1, -O2, -O3,
4900 -Os. Passes that use the information are enabled independently at
4901 different optimization levels.
4902
4903 -fexpensive-optimizations
4904 Perform a number of minor optimizations that are relatively
4905 expensive.
4906
4907 Enabled at levels -O2, -O3, -Os.
4908
4909 -foptimize-register-move
4910 -fregmove
4911 Attempt to reassign register numbers in move instructions and as
4912 operands of other simple instructions in order to maximize the
4913 amount of register tying. This is especially helpful on machines
4914 with two-operand instructions.
4915
4916 Note -fregmove and -foptimize-register-move are the same
4917 optimization.
4918
4919 Enabled at levels -O2, -O3, -Os.
4920
4921 -fira-algorithm=algorithm
4922 Use specified coloring algorithm for the integrated register
4923 allocator. The algorithm argument should be "priority" or "CB".
4924 The first algorithm specifies Chow's priority coloring, the second
4925 one specifies Chaitin-Briggs coloring. The second algorithm can be
4926 unimplemented for some architectures. If it is implemented, it is
4927 the default because Chaitin-Briggs coloring as a rule generates a
4928 better code.
4929
4930 -fira-region=region
4931 Use specified regions for the integrated register allocator. The
4932 region argument should be one of "all", "mixed", or "one". The
4933 first value means using all loops as register allocation regions,
4934 the second value which is the default means using all loops except
4935 for loops with small register pressure as the regions, and third
4936 one means using all function as a single region. The first value
4937 can give best result for machines with small size and irregular
4938 register set, the third one results in faster and generates decent
4939 code and the smallest size code, and the default value usually give
4940 the best results in most cases and for most architectures.
4941
4942 -fira-coalesce
4943 Do optimistic register coalescing. This option might be profitable
4944 for architectures with big regular register files.
4945
4946 -fira-loop-pressure
4947 Use IRA to evaluate register pressure in loops for decision to move
4948 loop invariants. Usage of this option usually results in
4949 generation of faster and smaller code on machines with big register
4950 files (>= 32 registers) but it can slow compiler down.
4951
4952 This option is enabled at level -O3 for some targets.
4953
4954 -fno-ira-share-save-slots
4955 Switch off sharing stack slots used for saving call used hard
4956 registers living through a call. Each hard register will get a
4957 separate stack slot and as a result function stack frame will be
4958 bigger.
4959
4960 -fno-ira-share-spill-slots
4961 Switch off sharing stack slots allocated for pseudo-registers.
4962 Each pseudo-register which did not get a hard register will get a
4963 separate stack slot and as a result function stack frame will be
4964 bigger.
4965
4966 -fira-verbose=n
4967 Set up how verbose dump file for the integrated register allocator
4968 will be. Default value is 5. If the value is greater or equal to
4969 10, the dump file will be stderr as if the value were n minus 10.
4970
4971 -fdelayed-branch
4972 If supported for the target machine, attempt to reorder
4973 instructions to exploit instruction slots available after delayed
4974 branch instructions.
4975
4976 Enabled at levels -O, -O2, -O3, -Os.
4977
4978 -fschedule-insns
4979 If supported for the target machine, attempt to reorder
4980 instructions to eliminate execution stalls due to required data
4981 being unavailable. This helps machines that have slow floating
4982 point or memory load instructions by allowing other instructions to
4983 be issued until the result of the load or floating point
4984 instruction is required.
4985
4986 Enabled at levels -O2, -O3.
4987
4988 -fschedule-insns2
4989 Similar to -fschedule-insns, but requests an additional pass of
4990 instruction scheduling after register allocation has been done.
4991 This is especially useful on machines with a relatively small
4992 number of registers and where memory load instructions take more
4993 than one cycle.
4994
4995 Enabled at levels -O2, -O3, -Os.
4996
4997 -fno-sched-interblock
4998 Don't schedule instructions across basic blocks. This is normally
4999 enabled by default when scheduling before register allocation, i.e.
5000 with -fschedule-insns or at -O2 or higher.
5001
5002 -fno-sched-spec
5003 Don't allow speculative motion of non-load instructions. This is
5004 normally enabled by default when scheduling before register
5005 allocation, i.e. with -fschedule-insns or at -O2 or higher.
5006
5007 -fsched-pressure
5008 Enable register pressure sensitive insn scheduling before the
5009 register allocation. This only makes sense when scheduling before
5010 register allocation is enabled, i.e. with -fschedule-insns or at
5011 -O2 or higher. Usage of this option can improve the generated code
5012 and decrease its size by preventing register pressure increase
5013 above the number of available hard registers and as a consequence
5014 register spills in the register allocation.
5015
5016 -fsched-spec-load
5017 Allow speculative motion of some load instructions. This only
5018 makes sense when scheduling before register allocation, i.e. with
5019 -fschedule-insns or at -O2 or higher.
5020
5021 -fsched-spec-load-dangerous
5022 Allow speculative motion of more load instructions. This only
5023 makes sense when scheduling before register allocation, i.e. with
5024 -fschedule-insns or at -O2 or higher.
5025
5026 -fsched-stalled-insns
5027 -fsched-stalled-insns=n
5028 Define how many insns (if any) can be moved prematurely from the
5029 queue of stalled insns into the ready list, during the second
5030 scheduling pass. -fno-sched-stalled-insns means that no insns will
5031 be moved prematurely, -fsched-stalled-insns=0 means there is no
5032 limit on how many queued insns can be moved prematurely.
5033 -fsched-stalled-insns without a value is equivalent to
5034 -fsched-stalled-insns=1.
5035
5036 -fsched-stalled-insns-dep
5037 -fsched-stalled-insns-dep=n
5038 Define how many insn groups (cycles) will be examined for a
5039 dependency on a stalled insn that is candidate for premature
5040 removal from the queue of stalled insns. This has an effect only
5041 during the second scheduling pass, and only if
5042 -fsched-stalled-insns is used. -fno-sched-stalled-insns-dep is
5043 equivalent to -fsched-stalled-insns-dep=0.
5044 -fsched-stalled-insns-dep without a value is equivalent to
5045 -fsched-stalled-insns-dep=1.
5046
5047 -fsched2-use-superblocks
5048 When scheduling after register allocation, do use superblock
5049 scheduling algorithm. Superblock scheduling allows motion across
5050 basic block boundaries resulting on faster schedules. This option
5051 is experimental, as not all machine descriptions used by GCC model
5052 the CPU closely enough to avoid unreliable results from the
5053 algorithm.
5054
5055 This only makes sense when scheduling after register allocation,
5056 i.e. with -fschedule-insns2 or at -O2 or higher.
5057
5058 -fsched-group-heuristic
5059 Enable the group heuristic in the scheduler. This heuristic favors
5060 the instruction that belongs to a schedule group. This is enabled
5061 by default when scheduling is enabled, i.e. with -fschedule-insns
5062 or -fschedule-insns2 or at -O2 or higher.
5063
5064 -fsched-critical-path-heuristic
5065 Enable the critical-path heuristic in the scheduler. This
5066 heuristic favors instructions on the critical path. This is
5067 enabled by default when scheduling is enabled, i.e. with
5068 -fschedule-insns or -fschedule-insns2 or at -O2 or higher.
5069
5070 -fsched-spec-insn-heuristic
5071 Enable the speculative instruction heuristic in the scheduler.
5072 This heuristic favors speculative instructions with greater
5073 dependency weakness. This is enabled by default when scheduling is
5074 enabled, i.e. with -fschedule-insns or -fschedule-insns2 or at -O2
5075 or higher.
5076
5077 -fsched-rank-heuristic
5078 Enable the rank heuristic in the scheduler. This heuristic favors
5079 the instruction belonging to a basic block with greater size or
5080 frequency. This is enabled by default when scheduling is enabled,
5081 i.e. with -fschedule-insns or -fschedule-insns2 or at -O2 or
5082 higher.
5083
5084 -fsched-last-insn-heuristic
5085 Enable the last-instruction heuristic in the scheduler. This
5086 heuristic favors the instruction that is less dependent on the last
5087 instruction scheduled. This is enabled by default when scheduling
5088 is enabled, i.e. with -fschedule-insns or -fschedule-insns2 or at
5089 -O2 or higher.
5090
5091 -fsched-dep-count-heuristic
5092 Enable the dependent-count heuristic in the scheduler. This
5093 heuristic favors the instruction that has more instructions
5094 depending on it. This is enabled by default when scheduling is
5095 enabled, i.e. with -fschedule-insns or -fschedule-insns2 or at -O2
5096 or higher.
5097
5098 -freschedule-modulo-scheduled-loops
5099 The modulo scheduling comes before the traditional scheduling, if a
5100 loop was modulo scheduled we may want to prevent the later
5101 scheduling passes from changing its schedule, we use this option to
5102 control that.
5103
5104 -fselective-scheduling
5105 Schedule instructions using selective scheduling algorithm.
5106 Selective scheduling runs instead of the first scheduler pass.
5107
5108 -fselective-scheduling2
5109 Schedule instructions using selective scheduling algorithm.
5110 Selective scheduling runs instead of the second scheduler pass.
5111
5112 -fsel-sched-pipelining
5113 Enable software pipelining of innermost loops during selective
5114 scheduling. This option has no effect until one of
5115 -fselective-scheduling or -fselective-scheduling2 is turned on.
5116
5117 -fsel-sched-pipelining-outer-loops
5118 When pipelining loops during selective scheduling, also pipeline
5119 outer loops. This option has no effect until
5120 -fsel-sched-pipelining is turned on.
5121
5122 -fcaller-saves
5123 Enable values to be allocated in registers that will be clobbered
5124 by function calls, by emitting extra instructions to save and
5125 restore the registers around such calls. Such allocation is done
5126 only when it seems to result in better code than would otherwise be
5127 produced.
5128
5129 This option is always enabled by default on certain machines,
5130 usually those which have no call-preserved registers to use
5131 instead.
5132
5133 Enabled at levels -O2, -O3, -Os.
5134
5135 -fconserve-stack
5136 Attempt to minimize stack usage. The compiler will attempt to use
5137 less stack space, even if that makes the program slower. This
5138 option implies setting the large-stack-frame parameter to 100 and
5139 the large-stack-frame-growth parameter to 400.
5140
5141 -ftree-reassoc
5142 Perform reassociation on trees. This flag is enabled by default at
5143 -O and higher.
5144
5145 -ftree-pre
5146 Perform partial redundancy elimination (PRE) on trees. This flag
5147 is enabled by default at -O2 and -O3.
5148
5149 -ftree-forwprop
5150 Perform forward propagation on trees. This flag is enabled by
5151 default at -O and higher.
5152
5153 -ftree-fre
5154 Perform full redundancy elimination (FRE) on trees. The difference
5155 between FRE and PRE is that FRE only considers expressions that are
5156 computed on all paths leading to the redundant computation. This
5157 analysis is faster than PRE, though it exposes fewer redundancies.
5158 This flag is enabled by default at -O and higher.
5159
5160 -ftree-phiprop
5161 Perform hoisting of loads from conditional pointers on trees. This
5162 pass is enabled by default at -O and higher.
5163
5164 -ftree-copy-prop
5165 Perform copy propagation on trees. This pass eliminates
5166 unnecessary copy operations. This flag is enabled by default at -O
5167 and higher.
5168
5169 -fipa-pure-const
5170 Discover which functions are pure or constant. Enabled by default
5171 at -O and higher.
5172
5173 -fipa-reference
5174 Discover which static variables do not escape cannot escape the
5175 compilation unit. Enabled by default at -O and higher.
5176
5177 -fipa-struct-reorg
5178 Perform structure reorganization optimization, that change C-like
5179 structures layout in order to better utilize spatial locality.
5180 This transformation is affective for programs containing arrays of
5181 structures. Available in two compilation modes: profile-based
5182 (enabled with -fprofile-generate) or static (which uses built-in
5183 heuristics). Require -fipa-type-escape to provide the safety of
5184 this transformation. It works only in whole program mode, so it
5185 requires -fwhole-program and -combine to be enabled. Structures
5186 considered cold by this transformation are not affected (see
5187 --param struct-reorg-cold-struct-ratio=value).
5188
5189 With this flag, the program debug info reflects a new structure
5190 layout.
5191
5192 -fipa-pta
5193 Perform interprocedural pointer analysis. This option is
5194 experimental and does not affect generated code.
5195
5196 -fipa-cp
5197 Perform interprocedural constant propagation. This optimization
5198 analyzes the program to determine when values passed to functions
5199 are constants and then optimizes accordingly. This optimization
5200 can substantially increase performance if the application has
5201 constants passed to functions. This flag is enabled by default at
5202 -O2, -Os and -O3.
5203
5204 -fipa-cp-clone
5205 Perform function cloning to make interprocedural constant
5206 propagation stronger. When enabled, interprocedural constant
5207 propagation will perform function cloning when externally visible
5208 function can be called with constant arguments. Because this
5209 optimization can create multiple copies of functions, it may
5210 significantly increase code size (see --param
5211 ipcp-unit-growth=value). This flag is enabled by default at -O3.
5212
5213 -fipa-matrix-reorg
5214 Perform matrix flattening and transposing. Matrix flattening tries
5215 to replace an m-dimensional matrix with its equivalent
5216 n-dimensional matrix, where n < m. This reduces the level of
5217 indirection needed for accessing the elements of the matrix. The
5218 second optimization is matrix transposing that attempts to change
5219 the order of the matrix's dimensions in order to improve cache
5220 locality. Both optimizations need the -fwhole-program flag.
5221 Transposing is enabled only if profiling information is available.
5222
5223 -ftree-sink
5224 Perform forward store motion on trees. This flag is enabled by
5225 default at -O and higher.
5226
5227 -ftree-ccp
5228 Perform sparse conditional constant propagation (CCP) on trees.
5229 This pass only operates on local scalar variables and is enabled by
5230 default at -O and higher.
5231
5232 -ftree-switch-conversion
5233 Perform conversion of simple initializations in a switch to
5234 initializations from a scalar array. This flag is enabled by
5235 default at -O2 and higher.
5236
5237 -ftree-dce
5238 Perform dead code elimination (DCE) on trees. This flag is enabled
5239 by default at -O and higher.
5240
5241 -ftree-builtin-call-dce
5242 Perform conditional dead code elimination (DCE) for calls to
5243 builtin functions that may set "errno" but are otherwise side-
5244 effect free. This flag is enabled by default at -O2 and higher if
5245 -Os is not also specified.
5246
5247 -ftree-dominator-opts
5248 Perform a variety of simple scalar cleanups (constant/copy
5249 propagation, redundancy elimination, range propagation and
5250 expression simplification) based on a dominator tree traversal.
5251 This also performs jump threading (to reduce jumps to jumps). This
5252 flag is enabled by default at -O and higher.
5253
5254 -ftree-dse
5255 Perform dead store elimination (DSE) on trees. A dead store is a
5256 store into a memory location which will later be overwritten by
5257 another store without any intervening loads. In this case the
5258 earlier store can be deleted. This flag is enabled by default at
5259 -O and higher.
5260
5261 -ftree-ch
5262 Perform loop header copying on trees. This is beneficial since it
5263 increases effectiveness of code motion optimizations. It also
5264 saves one jump. This flag is enabled by default at -O and higher.
5265 It is not enabled for -Os, since it usually increases code size.
5266
5267 -ftree-loop-optimize
5268 Perform loop optimizations on trees. This flag is enabled by
5269 default at -O and higher.
5270
5271 -ftree-loop-linear
5272 Perform linear loop transformations on tree. This flag can improve
5273 cache performance and allow further loop optimizations to take
5274 place.
5275
5276 -floop-interchange
5277 Perform loop interchange transformations on loops. Interchanging
5278 two nested loops switches the inner and outer loops. For example,
5279 given a loop like:
5280
5281 DO J = 1, M
5282 DO I = 1, N
5283 A(J, I) = A(J, I) * C
5284 ENDDO
5285 ENDDO
5286
5287 loop interchange will transform the loop as if the user had
5288 written:
5289
5290 DO I = 1, N
5291 DO J = 1, M
5292 A(J, I) = A(J, I) * C
5293 ENDDO
5294 ENDDO
5295
5296 which can be beneficial when "N" is larger than the caches, because
5297 in Fortran, the elements of an array are stored in memory
5298 contiguously by column, and the original loop iterates over rows,
5299 potentially creating at each access a cache miss. This
5300 optimization applies to all the languages supported by GCC and is
5301 not limited to Fortran. To use this code transformation, GCC has
5302 to be configured with --with-ppl and --with-cloog to enable the
5303 Graphite loop transformation infrastructure.
5304
5305 -floop-strip-mine
5306 Perform loop strip mining transformations on loops. Strip mining
5307 splits a loop into two nested loops. The outer loop has strides
5308 equal to the strip size and the inner loop has strides of the
5309 original loop within a strip. The strip length can be changed
5310 using the loop-block-tile-size parameter. For example, given a
5311 loop like:
5312
5313 DO I = 1, N
5314 A(I) = A(I) + C
5315 ENDDO
5316
5317 loop strip mining will transform the loop as if the user had
5318 written:
5319
5320 DO II = 1, N, 51
5321 DO I = II, min (II + 50, N)
5322 A(I) = A(I) + C
5323 ENDDO
5324 ENDDO
5325
5326 This optimization applies to all the languages supported by GCC and
5327 is not limited to Fortran. To use this code transformation, GCC
5328 has to be configured with --with-ppl and --with-cloog to enable the
5329 Graphite loop transformation infrastructure.
5330
5331 -floop-block
5332 Perform loop blocking transformations on loops. Blocking strip
5333 mines each loop in the loop nest such that the memory accesses of
5334 the element loops fit inside caches. The strip length can be
5335 changed using the loop-block-tile-size parameter. For example,
5336 given a loop like:
5337
5338 DO I = 1, N
5339 DO J = 1, M
5340 A(J, I) = B(I) + C(J)
5341 ENDDO
5342 ENDDO
5343
5344 loop blocking will transform the loop as if the user had written:
5345
5346 DO II = 1, N, 51
5347 DO JJ = 1, M, 51
5348 DO I = II, min (II + 50, N)
5349 DO J = JJ, min (JJ + 50, M)
5350 A(J, I) = B(I) + C(J)
5351 ENDDO
5352 ENDDO
5353 ENDDO
5354 ENDDO
5355
5356 which can be beneficial when "M" is larger than the caches, because
5357 the innermost loop will iterate over a smaller amount of data that
5358 can be kept in the caches. This optimization applies to all the
5359 languages supported by GCC and is not limited to Fortran. To use
5360 this code transformation, GCC has to be configured with --with-ppl
5361 and --with-cloog to enable the Graphite loop transformation
5362 infrastructure.
5363
5364 -fgraphite-identity
5365 Enable the identity transformation for graphite. For every SCoP we
5366 generate the polyhedral representation and transform it back to
5367 gimple. Using -fgraphite-identity we can check the costs or
5368 benefits of the GIMPLE -> GRAPHITE -> GIMPLE transformation. Some
5369 minimal optimizations are also performed by the code generator
5370 CLooG, like index splitting and dead code elimination in loops.
5371
5372 -floop-parallelize-all
5373 Use the Graphite data dependence analysis to identify loops that
5374 can be parallelized. Parallelize all the loops that can be
5375 analyzed to not contain loop carried dependences without checking
5376 that it is profitable to parallelize the loops.
5377
5378 -fcheck-data-deps
5379 Compare the results of several data dependence analyzers. This
5380 option is used for debugging the data dependence analyzers.
5381
5382 -ftree-loop-distribution
5383 Perform loop distribution. This flag can improve cache performance
5384 on big loop bodies and allow further loop optimizations, like
5385 parallelization or vectorization, to take place. For example, the
5386 loop
5387
5388 DO I = 1, N
5389 A(I) = B(I) + C
5390 D(I) = E(I) * F
5391 ENDDO
5392
5393 is transformed to
5394
5395 DO I = 1, N
5396 A(I) = B(I) + C
5397 ENDDO
5398 DO I = 1, N
5399 D(I) = E(I) * F
5400 ENDDO
5401
5402 -ftree-loop-im
5403 Perform loop invariant motion on trees. This pass moves only
5404 invariants that would be hard to handle at RTL level (function
5405 calls, operations that expand to nontrivial sequences of insns).
5406 With -funswitch-loops it also moves operands of conditions that are
5407 invariant out of the loop, so that we can use just trivial
5408 invariantness analysis in loop unswitching. The pass also includes
5409 store motion.
5410
5411 -ftree-loop-ivcanon
5412 Create a canonical counter for number of iterations in the loop for
5413 that determining number of iterations requires complicated
5414 analysis. Later optimizations then may determine the number
5415 easily. Useful especially in connection with unrolling.
5416
5417 -fivopts
5418 Perform induction variable optimizations (strength reduction,
5419 induction variable merging and induction variable elimination) on
5420 trees.
5421
5422 -ftree-parallelize-loops=n
5423 Parallelize loops, i.e., split their iteration space to run in n
5424 threads. This is only possible for loops whose iterations are
5425 independent and can be arbitrarily reordered. The optimization is
5426 only profitable on multiprocessor machines, for loops that are CPU-
5427 intensive, rather than constrained e.g. by memory bandwidth. This
5428 option implies -pthread, and thus is only supported on targets that
5429 have support for -pthread.
5430
5431 -ftree-pta
5432 Perform function-local points-to analysis on trees. This flag is
5433 enabled by default at -O and higher.
5434
5435 -ftree-sra
5436 Perform scalar replacement of aggregates. This pass replaces
5437 structure references with scalars to prevent committing structures
5438 to memory too early. This flag is enabled by default at -O and
5439 higher.
5440
5441 -ftree-copyrename
5442 Perform copy renaming on trees. This pass attempts to rename
5443 compiler temporaries to other variables at copy locations, usually
5444 resulting in variable names which more closely resemble the
5445 original variables. This flag is enabled by default at -O and
5446 higher.
5447
5448 -ftree-ter
5449 Perform temporary expression replacement during the SSA->normal
5450 phase. Single use/single def temporaries are replaced at their use
5451 location with their defining expression. This results in non-
5452 GIMPLE code, but gives the expanders much more complex trees to
5453 work on resulting in better RTL generation. This is enabled by
5454 default at -O and higher.
5455
5456 -ftree-vectorize
5457 Perform loop vectorization on trees. This flag is enabled by
5458 default at -O3.
5459
5460 -ftree-slp-vectorize
5461 Perform basic block vectorization on trees. This flag is enabled by
5462 default at -O3 and when -ftree-vectorize is enabled.
5463
5464 -ftree-vect-loop-version
5465 Perform loop versioning when doing loop vectorization on trees.
5466 When a loop appears to be vectorizable except that data alignment
5467 or data dependence cannot be determined at compile time then
5468 vectorized and non-vectorized versions of the loop are generated
5469 along with runtime checks for alignment or dependence to control
5470 which version is executed. This option is enabled by default
5471 except at level -Os where it is disabled.
5472
5473 -fvect-cost-model
5474 Enable cost model for vectorization.
5475
5476 -ftree-vrp
5477 Perform Value Range Propagation on trees. This is similar to the
5478 constant propagation pass, but instead of values, ranges of values
5479 are propagated. This allows the optimizers to remove unnecessary
5480 range checks like array bound checks and null pointer checks. This
5481 is enabled by default at -O2 and higher. Null pointer check
5482 elimination is only done if -fdelete-null-pointer-checks is
5483 enabled.
5484
5485 -ftracer
5486 Perform tail duplication to enlarge superblock size. This
5487 transformation simplifies the control flow of the function allowing
5488 other optimizations to do better job.
5489
5490 -funroll-loops
5491 Unroll loops whose number of iterations can be determined at
5492 compile time or upon entry to the loop. -funroll-loops implies
5493 -frerun-cse-after-loop. This option makes code larger, and may or
5494 may not make it run faster.
5495
5496 -funroll-all-loops
5497 Unroll all loops, even if their number of iterations is uncertain
5498 when the loop is entered. This usually makes programs run more
5499 slowly. -funroll-all-loops implies the same options as
5500 -funroll-loops,
5501
5502 -fsplit-ivs-in-unroller
5503 Enables expressing of values of induction variables in later
5504 iterations of the unrolled loop using the value in the first
5505 iteration. This breaks long dependency chains, thus improving
5506 efficiency of the scheduling passes.
5507
5508 Combination of -fweb and CSE is often sufficient to obtain the same
5509 effect. However in cases the loop body is more complicated than a
5510 single basic block, this is not reliable. It also does not work at
5511 all on some of the architectures due to restrictions in the CSE
5512 pass.
5513
5514 This optimization is enabled by default.
5515
5516 -fvariable-expansion-in-unroller
5517 With this option, the compiler will create multiple copies of some
5518 local variables when unrolling a loop which can result in superior
5519 code.
5520
5521 -fpredictive-commoning
5522 Perform predictive commoning optimization, i.e., reusing
5523 computations (especially memory loads and stores) performed in
5524 previous iterations of loops.
5525
5526 This option is enabled at level -O3.
5527
5528 -fprefetch-loop-arrays
5529 If supported by the target machine, generate instructions to
5530 prefetch memory to improve the performance of loops that access
5531 large arrays.
5532
5533 This option may generate better or worse code; results are highly
5534 dependent on the structure of loops within the source code.
5535
5536 Disabled at level -Os.
5537
5538 -fno-peephole
5539 -fno-peephole2
5540 Disable any machine-specific peephole optimizations. The
5541 difference between -fno-peephole and -fno-peephole2 is in how they
5542 are implemented in the compiler; some targets use one, some use the
5543 other, a few use both.
5544
5545 -fpeephole is enabled by default. -fpeephole2 enabled at levels
5546 -O2, -O3, -Os.
5547
5548 -fno-guess-branch-probability
5549 Do not guess branch probabilities using heuristics.
5550
5551 GCC will use heuristics to guess branch probabilities if they are
5552 not provided by profiling feedback (-fprofile-arcs). These
5553 heuristics are based on the control flow graph. If some branch
5554 probabilities are specified by __builtin_expect, then the
5555 heuristics will be used to guess branch probabilities for the rest
5556 of the control flow graph, taking the __builtin_expect info into
5557 account. The interactions between the heuristics and
5558 __builtin_expect can be complex, and in some cases, it may be
5559 useful to disable the heuristics so that the effects of
5560 __builtin_expect are easier to understand.
5561
5562 The default is -fguess-branch-probability at levels -O, -O2, -O3,
5563 -Os.
5564
5565 -freorder-blocks
5566 Reorder basic blocks in the compiled function in order to reduce
5567 number of taken branches and improve code locality.
5568
5569 Enabled at levels -O2, -O3.
5570
5571 -freorder-blocks-and-partition
5572 In addition to reordering basic blocks in the compiled function, in
5573 order to reduce number of taken branches, partitions hot and cold
5574 basic blocks into separate sections of the assembly and .o files,
5575 to improve paging and cache locality performance.
5576
5577 This optimization is automatically turned off in the presence of
5578 exception handling, for linkonce sections, for functions with a
5579 user-defined section attribute and on any architecture that does
5580 not support named sections.
5581
5582 -freorder-functions
5583 Reorder functions in the object file in order to improve code
5584 locality. This is implemented by using special subsections
5585 ".text.hot" for most frequently executed functions and
5586 ".text.unlikely" for unlikely executed functions. Reordering is
5587 done by the linker so object file format must support named
5588 sections and linker must place them in a reasonable way.
5589
5590 Also profile feedback must be available in to make this option
5591 effective. See -fprofile-arcs for details.
5592
5593 Enabled at levels -O2, -O3, -Os.
5594
5595 -fstrict-aliasing
5596 Allow the compiler to assume the strictest aliasing rules
5597 applicable to the language being compiled. For C (and C++), this
5598 activates optimizations based on the type of expressions. In
5599 particular, an object of one type is assumed never to reside at the
5600 same address as an object of a different type, unless the types are
5601 almost the same. For example, an "unsigned int" can alias an
5602 "int", but not a "void*" or a "double". A character type may alias
5603 any other type.
5604
5605 Pay special attention to code like this:
5606
5607 union a_union {
5608 int i;
5609 double d;
5610 };
5611
5612 int f() {
5613 union a_union t;
5614 t.d = 3.0;
5615 return t.i;
5616 }
5617
5618 The practice of reading from a different union member than the one
5619 most recently written to (called "type-punning") is common. Even
5620 with -fstrict-aliasing, type-punning is allowed, provided the
5621 memory is accessed through the union type. So, the code above will
5622 work as expected. However, this code might not:
5623
5624 int f() {
5625 union a_union t;
5626 int* ip;
5627 t.d = 3.0;
5628 ip = &t.i;
5629 return *ip;
5630 }
5631
5632 Similarly, access by taking the address, casting the resulting
5633 pointer and dereferencing the result has undefined behavior, even
5634 if the cast uses a union type, e.g.:
5635
5636 int f() {
5637 double d = 3.0;
5638 return ((union a_union *) &d)->i;
5639 }
5640
5641 The -fstrict-aliasing option is enabled at levels -O2, -O3, -Os.
5642
5643 -fstrict-overflow
5644 Allow the compiler to assume strict signed overflow rules,
5645 depending on the language being compiled. For C (and C++) this
5646 means that overflow when doing arithmetic with signed numbers is
5647 undefined, which means that the compiler may assume that it will
5648 not happen. This permits various optimizations. For example, the
5649 compiler will assume that an expression like "i + 10 > i" will
5650 always be true for signed "i". This assumption is only valid if
5651 signed overflow is undefined, as the expression is false if "i +
5652 10" overflows when using twos complement arithmetic. When this
5653 option is in effect any attempt to determine whether an operation
5654 on signed numbers will overflow must be written carefully to not
5655 actually involve overflow.
5656
5657 This option also allows the compiler to assume strict pointer
5658 semantics: given a pointer to an object, if adding an offset to
5659 that pointer does not produce a pointer to the same object, the
5660 addition is undefined. This permits the compiler to conclude that
5661 "p + u > p" is always true for a pointer "p" and unsigned integer
5662 "u". This assumption is only valid because pointer wraparound is
5663 undefined, as the expression is false if "p + u" overflows using
5664 twos complement arithmetic.
5665
5666 See also the -fwrapv option. Using -fwrapv means that integer
5667 signed overflow is fully defined: it wraps. When -fwrapv is used,
5668 there is no difference between -fstrict-overflow and
5669 -fno-strict-overflow for integers. With -fwrapv certain types of
5670 overflow are permitted. For example, if the compiler gets an
5671 overflow when doing arithmetic on constants, the overflowed value
5672 can still be used with -fwrapv, but not otherwise.
5673
5674 The -fstrict-overflow option is enabled at levels -O2, -O3, -Os.
5675
5676 -falign-functions
5677 -falign-functions=n
5678 Align the start of functions to the next power-of-two greater than
5679 n, skipping up to n bytes. For instance, -falign-functions=32
5680 aligns functions to the next 32-byte boundary, but
5681 -falign-functions=24 would align to the next 32-byte boundary only
5682 if this can be done by skipping 23 bytes or less.
5683
5684 -fno-align-functions and -falign-functions=1 are equivalent and
5685 mean that functions will not be aligned.
5686
5687 Some assemblers only support this flag when n is a power of two; in
5688 that case, it is rounded up.
5689
5690 If n is not specified or is zero, use a machine-dependent default.
5691
5692 Enabled at levels -O2, -O3.
5693
5694 -falign-labels
5695 -falign-labels=n
5696 Align all branch targets to a power-of-two boundary, skipping up to
5697 n bytes like -falign-functions. This option can easily make code
5698 slower, because it must insert dummy operations for when the branch
5699 target is reached in the usual flow of the code.
5700
5701 -fno-align-labels and -falign-labels=1 are equivalent and mean that
5702 labels will not be aligned.
5703
5704 If -falign-loops or -falign-jumps are applicable and are greater
5705 than this value, then their values are used instead.
5706
5707 If n is not specified or is zero, use a machine-dependent default
5708 which is very likely to be 1, meaning no alignment.
5709
5710 Enabled at levels -O2, -O3.
5711
5712 -falign-loops
5713 -falign-loops=n
5714 Align loops to a power-of-two boundary, skipping up to n bytes like
5715 -falign-functions. The hope is that the loop will be executed many
5716 times, which will make up for any execution of the dummy
5717 operations.
5718
5719 -fno-align-loops and -falign-loops=1 are equivalent and mean that
5720 loops will not be aligned.
5721
5722 If n is not specified or is zero, use a machine-dependent default.
5723
5724 Enabled at levels -O2, -O3.
5725
5726 -falign-jumps
5727 -falign-jumps=n
5728 Align branch targets to a power-of-two boundary, for branch targets
5729 where the targets can only be reached by jumping, skipping up to n
5730 bytes like -falign-functions. In this case, no dummy operations
5731 need be executed.
5732
5733 -fno-align-jumps and -falign-jumps=1 are equivalent and mean that
5734 loops will not be aligned.
5735
5736 If n is not specified or is zero, use a machine-dependent default.
5737
5738 Enabled at levels -O2, -O3.
5739
5740 -funit-at-a-time
5741 This option is left for compatibility reasons. -funit-at-a-time has
5742 no effect, while -fno-unit-at-a-time implies -fno-toplevel-reorder
5743 and -fno-section-anchors.
5744
5745 Enabled by default.
5746
5747 -fno-toplevel-reorder
5748 Do not reorder top-level functions, variables, and "asm"
5749 statements. Output them in the same order that they appear in the
5750 input file. When this option is used, unreferenced static
5751 variables will not be removed. This option is intended to support
5752 existing code which relies on a particular ordering. For new code,
5753 it is better to use attributes.
5754
5755 Enabled at level -O0. When disabled explicitly, it also imply
5756 -fno-section-anchors that is otherwise enabled at -O0 on some
5757 targets.
5758
5759 -fweb
5760 Constructs webs as commonly used for register allocation purposes
5761 and assign each web individual pseudo register. This allows the
5762 register allocation pass to operate on pseudos directly, but also
5763 strengthens several other optimization passes, such as CSE, loop
5764 optimizer and trivial dead code remover. It can, however, make
5765 debugging impossible, since variables will no longer stay in a
5766 "home register".
5767
5768 Enabled by default with -funroll-loops.
5769
5770 -fwhole-program
5771 Assume that the current compilation unit represents the whole
5772 program being compiled. All public functions and variables with
5773 the exception of "main" and those merged by attribute
5774 "externally_visible" become static functions and in effect are
5775 optimized more aggressively by interprocedural optimizers. While
5776 this option is equivalent to proper use of the "static" keyword for
5777 programs consisting of a single file, in combination with option
5778 -combine, -flto or -fwhopr this flag can be used to compile many
5779 smaller scale programs since the functions and variables become
5780 local for the whole combined compilation unit, not for the single
5781 source file itself.
5782
5783 This option implies -fwhole-file for Fortran programs.
5784
5785 -flto
5786 This option runs the standard link-time optimizer. When invoked
5787 with source code, it generates GIMPLE (one of GCC's internal
5788 representations) and writes it to special ELF sections in the
5789 object file. When the object files are linked together, all the
5790 function bodies are read from these ELF sections and instantiated
5791 as if they had been part of the same translation unit.
5792
5793 To use the link-timer optimizer, -flto needs to be specified at
5794 compile time and during the final link. For example,
5795
5796 gcc -c -O2 -flto foo.c
5797 gcc -c -O2 -flto bar.c
5798 gcc -o myprog -flto -O2 foo.o bar.o
5799
5800 The first two invocations to GCC will save a bytecode
5801 representation of GIMPLE into special ELF sections inside foo.o and
5802 bar.o. The final invocation will read the GIMPLE bytecode from
5803 foo.o and bar.o, merge the two files into a single internal image,
5804 and compile the result as usual. Since both foo.o and bar.o are
5805 merged into a single image, this causes all the inter-procedural
5806 analyses and optimizations in GCC to work across the two files as
5807 if they were a single one. This means, for example, that the
5808 inliner will be able to inline functions in bar.o into functions in
5809 foo.o and vice-versa.
5810
5811 Another (simpler) way to enable link-time optimization is,
5812
5813 gcc -o myprog -flto -O2 foo.c bar.c
5814
5815 The above will generate bytecode for foo.c and bar.c, merge them
5816 together into a single GIMPLE representation and optimize them as
5817 usual to produce myprog.
5818
5819 The only important thing to keep in mind is that to enable link-
5820 time optimizations the -flto flag needs to be passed to both the
5821 compile and the link commands.
5822
5823 Note that when a file is compiled with -flto, the generated object
5824 file will be larger than a regular object file because it will
5825 contain GIMPLE bytecodes and the usual final code. This means that
5826 object files with LTO information can be linked as a normal object
5827 file. So, in the previous example, if the final link is done with
5828
5829 gcc -o myprog foo.o bar.o
5830
5831 The only difference will be that no inter-procedural optimizations
5832 will be applied to produce myprog. The two object files foo.o and
5833 bar.o will be simply sent to the regular linker.
5834
5835 Additionally, the optimization flags used to compile individual
5836 files are not necessarily related to those used at link-time. For
5837 instance,
5838
5839 gcc -c -O0 -flto foo.c
5840 gcc -c -O0 -flto bar.c
5841 gcc -o myprog -flto -O3 foo.o bar.o
5842
5843 This will produce individual object files with unoptimized
5844 assembler code, but the resulting binary myprog will be optimized
5845 at -O3. Now, if the final binary is generated without -flto, then
5846 myprog will not be optimized.
5847
5848 When producing the final binary with -flto, GCC will only apply
5849 link-time optimizations to those files that contain bytecode.
5850 Therefore, you can mix and match object files and libraries with
5851 GIMPLE bytecodes and final object code. GCC will automatically
5852 select which files to optimize in LTO mode and which files to link
5853 without further processing.
5854
5855 There are some code generation flags that GCC will preserve when
5856 generating bytecodes, as they need to be used during the final link
5857 stage. Currently, the following options are saved into the GIMPLE
5858 bytecode files: -fPIC, -fcommon and all the -m target flags.
5859
5860 At link time, these options are read-in and reapplied. Note that
5861 the current implementation makes no attempt at recognizing
5862 conflicting values for these options. If two or more files have a
5863 conflicting value (e.g., one file is compiled with -fPIC and
5864 another isn't), the compiler will simply use the last value read
5865 from the bytecode files. It is recommended, then, that all the
5866 files participating in the same link be compiled with the same
5867 options.
5868
5869 Another feature of LTO is that it is possible to apply
5870 interprocedural optimizations on files written in different
5871 languages. This requires some support in the language front end.
5872 Currently, the C, C++ and Fortran front ends are capable of
5873 emitting GIMPLE bytecodes, so something like this should work
5874
5875 gcc -c -flto foo.c
5876 g++ -c -flto bar.cc
5877 gfortran -c -flto baz.f90
5878 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
5879
5880 Notice that the final link is done with g++ to get the C++ runtime
5881 libraries and -lgfortran is added to get the Fortran runtime
5882 libraries. In general, when mixing languages in LTO mode, you
5883 should use the same link command used when mixing languages in a
5884 regular (non-LTO) compilation. This means that if your build
5885 process was mixing languages before, all you need to add is -flto
5886 to all the compile and link commands.
5887
5888 If LTO encounters objects with C linkage declared with incompatible
5889 types in separate translation units to be linked together
5890 (undefined behavior according to ISO C99 6.2.7), a non-fatal
5891 diagnostic may be issued. The behavior is still undefined at
5892 runtime.
5893
5894 If object files containing GIMPLE bytecode are stored in a library
5895 archive, say libfoo.a, it is possible to extract and use them in an
5896 LTO link if you are using gold as the linker (which, in turn
5897 requires GCC to be configured with --enable-gold). To enable this
5898 feature, use the flag -fuse-linker-plugin at link-time:
5899
5900 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
5901
5902 With the linker plugin enabled, gold will extract the needed GIMPLE
5903 files from libfoo.a and pass them on to the running GCC to make
5904 them part of the aggregated GIMPLE image to be optimized.
5905
5906 If you are not using gold and/or do not specify -fuse-linker-plugin
5907 then the objects inside libfoo.a will be extracted and linked as
5908 usual, but they will not participate in the LTO optimization
5909 process.
5910
5911 Link time optimizations do not require the presence of the whole
5912 program to operate. If the program does not require any symbols to
5913 be exported, it is possible to combine -flto and -fwhopr with
5914 -fwhole-program to allow the interprocedural optimizers to use more
5915 aggressive assumptions which may lead to improved optimization
5916 opportunities.
5917
5918 Regarding portability: the current implementation of LTO makes no
5919 attempt at generating bytecode that can be ported between different
5920 types of hosts. The bytecode files are versioned and there is a
5921 strict version check, so bytecode files generated in one version of
5922 GCC will not work with an older/newer version of GCC.
5923
5924 Link time optimization does not play well with generating debugging
5925 information. Combining -flto or -fwhopr with -g is experimental.
5926
5927 This option is disabled by default.
5928
5929 -fwhopr
5930 This option is identical in functionality to -flto but it differs
5931 in how the final link stage is executed. Instead of loading all
5932 the function bodies in memory, the callgraph is analyzed and
5933 optimization decisions are made (whole program analysis or WPA).
5934 Once optimization decisions are made, the callgraph is partitioned
5935 and the different sections are compiled separately (local
5936 transformations or LTRANS). This process allows optimizations on
5937 very large programs that otherwise would not fit in memory. This
5938 option enables -fwpa and -fltrans automatically.
5939
5940 Disabled by default.
5941
5942 This option is experimental.
5943
5944 -fwpa
5945 This is an internal option used by GCC when compiling with -fwhopr.
5946 You should never need to use it.
5947
5948 This option runs the link-time optimizer in the whole-program-
5949 analysis (WPA) mode, which reads in summary information from all
5950 inputs and performs a whole-program analysis based on summary
5951 information only. It generates object files for subsequent runs of
5952 the link-time optimizer where individual object files are optimized
5953 using both summary information from the WPA mode and the actual
5954 function bodies. It then drives the LTRANS phase.
5955
5956 Disabled by default.
5957
5958 -fltrans
5959 This is an internal option used by GCC when compiling with -fwhopr.
5960 You should never need to use it.
5961
5962 This option runs the link-time optimizer in the local-
5963 transformation (LTRANS) mode, which reads in output from a previous
5964 run of the LTO in WPA mode. In the LTRANS mode, LTO optimizes an
5965 object and produces the final assembly.
5966
5967 Disabled by default.
5968
5969 -fltrans-output-list=file
5970 This is an internal option used by GCC when compiling with -fwhopr.
5971 You should never need to use it.
5972
5973 This option specifies a file to which the names of LTRANS output
5974 files are written. This option is only meaningful in conjunction
5975 with -fwpa.
5976
5977 Disabled by default.
5978
5979 -flto-compression-level=n
5980 This option specifies the level of compression used for
5981 intermediate language written to LTO object files, and is only
5982 meaningful in conjunction with LTO mode (-fwhopr, -flto). Valid
5983 values are 0 (no compression) to 9 (maximum compression). Values
5984 outside this range are clamped to either 0 or 9. If the option is
5985 not given, a default balanced compression setting is used.
5986
5987 -flto-report
5988 Prints a report with internal details on the workings of the link-
5989 time optimizer. The contents of this report vary from version to
5990 version, it is meant to be useful to GCC developers when processing
5991 object files in LTO mode (via -fwhopr or -flto).
5992
5993 Disabled by default.
5994
5995 -fuse-linker-plugin
5996 Enables the extraction of objects with GIMPLE bytecode information
5997 from library archives. This option relies on features available
5998 only in gold, so to use this you must configure GCC with
5999 --enable-gold. See -flto for a description on the effect of this
6000 flag and how to use it.
6001
6002 Disabled by default.
6003
6004 -fcprop-registers
6005 After register allocation and post-register allocation instruction
6006 splitting, we perform a copy-propagation pass to try to reduce
6007 scheduling dependencies and occasionally eliminate the copy.
6008
6009 Enabled at levels -O, -O2, -O3, -Os.
6010
6011 -fprofile-correction
6012 Profiles collected using an instrumented binary for multi-threaded
6013 programs may be inconsistent due to missed counter updates. When
6014 this option is specified, GCC will use heuristics to correct or
6015 smooth out such inconsistencies. By default, GCC will emit an error
6016 message when an inconsistent profile is detected.
6017
6018 -fprofile-dir=path
6019 Set the directory to search the profile data files in to path.
6020 This option affects only the profile data generated by
6021 -fprofile-generate, -ftest-coverage, -fprofile-arcs and used by
6022 -fprofile-use and -fbranch-probabilities and its related options.
6023 By default, GCC will use the current directory as path thus the
6024 profile data file will appear in the same directory as the object
6025 file.
6026
6027 -fprofile-generate
6028 -fprofile-generate=path
6029 Enable options usually used for instrumenting application to
6030 produce profile useful for later recompilation with profile
6031 feedback based optimization. You must use -fprofile-generate both
6032 when compiling and when linking your program.
6033
6034 The following options are enabled: "-fprofile-arcs",
6035 "-fprofile-values", "-fvpt".
6036
6037 If path is specified, GCC will look at the path to find the profile
6038 feedback data files. See -fprofile-dir.
6039
6040 -fprofile-use
6041 -fprofile-use=path
6042 Enable profile feedback directed optimizations, and optimizations
6043 generally profitable only with profile feedback available.
6044
6045 The following options are enabled: "-fbranch-probabilities",
6046 "-fvpt", "-funroll-loops", "-fpeel-loops", "-ftracer"
6047
6048 By default, GCC emits an error message if the feedback profiles do
6049 not match the source code. This error can be turned into a warning
6050 by using -Wcoverage-mismatch. Note this may result in poorly
6051 optimized code.
6052
6053 If path is specified, GCC will look at the path to find the profile
6054 feedback data files. See -fprofile-dir.
6055
6056 The following options control compiler behavior regarding floating
6057 point arithmetic. These options trade off between speed and
6058 correctness. All must be specifically enabled.
6059
6060 -ffloat-store
6061 Do not store floating point variables in registers, and inhibit
6062 other options that might change whether a floating point value is
6063 taken from a register or memory.
6064
6065 This option prevents undesirable excess precision on machines such
6066 as the 68000 where the floating registers (of the 68881) keep more
6067 precision than a "double" is supposed to have. Similarly for the
6068 x86 architecture. For most programs, the excess precision does
6069 only good, but a few programs rely on the precise definition of
6070 IEEE floating point. Use -ffloat-store for such programs, after
6071 modifying them to store all pertinent intermediate computations
6072 into variables.
6073
6074 -fexcess-precision=style
6075 This option allows further control over excess precision on
6076 machines where floating-point registers have more precision than
6077 the IEEE "float" and "double" types and the processor does not
6078 support operations rounding to those types. By default,
6079 -fexcess-precision=fast is in effect; this means that operations
6080 are carried out in the precision of the registers and that it is
6081 unpredictable when rounding to the types specified in the source
6082 code takes place. When compiling C, if -fexcess-precision=standard
6083 is specified then excess precision will follow the rules specified
6084 in ISO C99; in particular, both casts and assignments cause values
6085 to be rounded to their semantic types (whereas -ffloat-store only
6086 affects assignments). This option is enabled by default for C if a
6087 strict conformance option such as -std=c99 is used.
6088
6089 -fexcess-precision=standard is not implemented for languages other
6090 than C, and has no effect if -funsafe-math-optimizations or
6091 -ffast-math is specified. On the x86, it also has no effect if
6092 -mfpmath=sse or -mfpmath=sse+387 is specified; in the former case,
6093 IEEE semantics apply without excess precision, and in the latter,
6094 rounding is unpredictable.
6095
6096 -ffast-math
6097 Sets -fno-math-errno, -funsafe-math-optimizations,
6098 -ffinite-math-only, -fno-rounding-math, -fno-signaling-nans and
6099 -fcx-limited-range.
6100
6101 This option causes the preprocessor macro "__FAST_MATH__" to be
6102 defined.
6103
6104 This option is not turned on by any -O option since it can result
6105 in incorrect output for programs which depend on an exact
6106 implementation of IEEE or ISO rules/specifications for math
6107 functions. It may, however, yield faster code for programs that do
6108 not require the guarantees of these specifications.
6109
6110 -fno-math-errno
6111 Do not set ERRNO after calling math functions that are executed
6112 with a single instruction, e.g., sqrt. A program that relies on
6113 IEEE exceptions for math error handling may want to use this flag
6114 for speed while maintaining IEEE arithmetic compatibility.
6115
6116 This option is not turned on by any -O option since it can result
6117 in incorrect output for programs which depend on an exact
6118 implementation of IEEE or ISO rules/specifications for math
6119 functions. It may, however, yield faster code for programs that do
6120 not require the guarantees of these specifications.
6121
6122 The default is -fmath-errno.
6123
6124 On Darwin systems, the math library never sets "errno". There is
6125 therefore no reason for the compiler to consider the possibility
6126 that it might, and -fno-math-errno is the default.
6127
6128 -funsafe-math-optimizations
6129 Allow optimizations for floating-point arithmetic that (a) assume
6130 that arguments and results are valid and (b) may violate IEEE or
6131 ANSI standards. When used at link-time, it may include libraries
6132 or startup files that change the default FPU control word or other
6133 similar optimizations.
6134
6135 This option is not turned on by any -O option since it can result
6136 in incorrect output for programs which depend on an exact
6137 implementation of IEEE or ISO rules/specifications for math
6138 functions. It may, however, yield faster code for programs that do
6139 not require the guarantees of these specifications. Enables
6140 -fno-signed-zeros, -fno-trapping-math, -fassociative-math and
6141 -freciprocal-math.
6142
6143 The default is -fno-unsafe-math-optimizations.
6144
6145 -fassociative-math
6146 Allow re-association of operands in series of floating-point
6147 operations. This violates the ISO C and C++ language standard by
6148 possibly changing computation result. NOTE: re-ordering may change
6149 the sign of zero as well as ignore NaNs and inhibit or create
6150 underflow or overflow (and thus cannot be used on a code which
6151 relies on rounding behavior like "(x + 2**52) - 2**52)". May also
6152 reorder floating-point comparisons and thus may not be used when
6153 ordered comparisons are required. This option requires that both
6154 -fno-signed-zeros and -fno-trapping-math be in effect. Moreover,
6155 it doesn't make much sense with -frounding-math. For Fortran the
6156 option is automatically enabled when both -fno-signed-zeros and
6157 -fno-trapping-math are in effect.
6158
6159 The default is -fno-associative-math.
6160
6161 -freciprocal-math
6162 Allow the reciprocal of a value to be used instead of dividing by
6163 the value if this enables optimizations. For example "x / y" can
6164 be replaced with "x * (1/y)" which is useful if "(1/y)" is subject
6165 to common subexpression elimination. Note that this loses
6166 precision and increases the number of flops operating on the value.
6167
6168 The default is -fno-reciprocal-math.
6169
6170 -ffinite-math-only
6171 Allow optimizations for floating-point arithmetic that assume that
6172 arguments and results are not NaNs or +-Infs.
6173
6174 This option is not turned on by any -O option since it can result
6175 in incorrect output for programs which depend on an exact
6176 implementation of IEEE or ISO rules/specifications for math
6177 functions. It may, however, yield faster code for programs that do
6178 not require the guarantees of these specifications.
6179
6180 The default is -fno-finite-math-only.
6181
6182 -fno-signed-zeros
6183 Allow optimizations for floating point arithmetic that ignore the
6184 signedness of zero. IEEE arithmetic specifies the behavior of
6185 distinct +0.0 and -0.0 values, which then prohibits simplification
6186 of expressions such as x+0.0 or 0.0*x (even with
6187 -ffinite-math-only). This option implies that the sign of a zero
6188 result isn't significant.
6189
6190 The default is -fsigned-zeros.
6191
6192 -fno-trapping-math
6193 Compile code assuming that floating-point operations cannot
6194 generate user-visible traps. These traps include division by zero,
6195 overflow, underflow, inexact result and invalid operation. This
6196 option requires that -fno-signaling-nans be in effect. Setting
6197 this option may allow faster code if one relies on "non-stop" IEEE
6198 arithmetic, for example.
6199
6200 This option should never be turned on by any -O option since it can
6201 result in incorrect output for programs which depend on an exact
6202 implementation of IEEE or ISO rules/specifications for math
6203 functions.
6204
6205 The default is -ftrapping-math.
6206
6207 -frounding-math
6208 Disable transformations and optimizations that assume default
6209 floating point rounding behavior. This is round-to-zero for all
6210 floating point to integer conversions, and round-to-nearest for all
6211 other arithmetic truncations. This option should be specified for
6212 programs that change the FP rounding mode dynamically, or that may
6213 be executed with a non-default rounding mode. This option disables
6214 constant folding of floating point expressions at compile-time
6215 (which may be affected by rounding mode) and arithmetic
6216 transformations that are unsafe in the presence of sign-dependent
6217 rounding modes.
6218
6219 The default is -fno-rounding-math.
6220
6221 This option is experimental and does not currently guarantee to
6222 disable all GCC optimizations that are affected by rounding mode.
6223 Future versions of GCC may provide finer control of this setting
6224 using C99's "FENV_ACCESS" pragma. This command line option will be
6225 used to specify the default state for "FENV_ACCESS".
6226
6227 -fsignaling-nans
6228 Compile code assuming that IEEE signaling NaNs may generate user-
6229 visible traps during floating-point operations. Setting this
6230 option disables optimizations that may change the number of
6231 exceptions visible with signaling NaNs. This option implies
6232 -ftrapping-math.
6233
6234 This option causes the preprocessor macro "__SUPPORT_SNAN__" to be
6235 defined.
6236
6237 The default is -fno-signaling-nans.
6238
6239 This option is experimental and does not currently guarantee to
6240 disable all GCC optimizations that affect signaling NaN behavior.
6241
6242 -fsingle-precision-constant
6243 Treat floating point constant as single precision constant instead
6244 of implicitly converting it to double precision constant.
6245
6246 -fcx-limited-range
6247 When enabled, this option states that a range reduction step is not
6248 needed when performing complex division. Also, there is no
6249 checking whether the result of a complex multiplication or division
6250 is "NaN + I*NaN", with an attempt to rescue the situation in that
6251 case. The default is -fno-cx-limited-range, but is enabled by
6252 -ffast-math.
6253
6254 This option controls the default setting of the ISO C99
6255 "CX_LIMITED_RANGE" pragma. Nevertheless, the option applies to all
6256 languages.
6257
6258 -fcx-fortran-rules
6259 Complex multiplication and division follow Fortran rules. Range
6260 reduction is done as part of complex division, but there is no
6261 checking whether the result of a complex multiplication or division
6262 is "NaN + I*NaN", with an attempt to rescue the situation in that
6263 case.
6264
6265 The default is -fno-cx-fortran-rules.
6266
6267 The following options control optimizations that may improve
6268 performance, but are not enabled by any -O options. This section
6269 includes experimental options that may produce broken code.
6270
6271 -fbranch-probabilities
6272 After running a program compiled with -fprofile-arcs, you can
6273 compile it a second time using -fbranch-probabilities, to improve
6274 optimizations based on the number of times each branch was taken.
6275 When the program compiled with -fprofile-arcs exits it saves arc
6276 execution counts to a file called sourcename.gcda for each source
6277 file. The information in this data file is very dependent on the
6278 structure of the generated code, so you must use the same source
6279 code and the same optimization options for both compilations.
6280
6281 With -fbranch-probabilities, GCC puts a REG_BR_PROB note on each
6282 JUMP_INSN and CALL_INSN. These can be used to improve
6283 optimization. Currently, they are only used in one place: in
6284 reorg.c, instead of guessing which path a branch is mostly to take,
6285 the REG_BR_PROB values are used to exactly determine which path is
6286 taken more often.
6287
6288 -fprofile-values
6289 If combined with -fprofile-arcs, it adds code so that some data
6290 about values of expressions in the program is gathered.
6291
6292 With -fbranch-probabilities, it reads back the data gathered from
6293 profiling values of expressions and adds REG_VALUE_PROFILE notes to
6294 instructions for their later usage in optimizations.
6295
6296 Enabled with -fprofile-generate and -fprofile-use.
6297
6298 -fvpt
6299 If combined with -fprofile-arcs, it instructs the compiler to add a
6300 code to gather information about values of expressions.
6301
6302 With -fbranch-probabilities, it reads back the data gathered and
6303 actually performs the optimizations based on them. Currently the
6304 optimizations include specialization of division operation using
6305 the knowledge about the value of the denominator.
6306
6307 -frename-registers
6308 Attempt to avoid false dependencies in scheduled code by making use
6309 of registers left over after register allocation. This
6310 optimization will most benefit processors with lots of registers.
6311 Depending on the debug information format adopted by the target,
6312 however, it can make debugging impossible, since variables will no
6313 longer stay in a "home register".
6314
6315 Enabled by default with -funroll-loops and -fpeel-loops.
6316
6317 -ftracer
6318 Perform tail duplication to enlarge superblock size. This
6319 transformation simplifies the control flow of the function allowing
6320 other optimizations to do better job.
6321
6322 Enabled with -fprofile-use.
6323
6324 -funroll-loops
6325 Unroll loops whose number of iterations can be determined at
6326 compile time or upon entry to the loop. -funroll-loops implies
6327 -frerun-cse-after-loop, -fweb and -frename-registers. It also
6328 turns on complete loop peeling (i.e. complete removal of loops with
6329 small constant number of iterations). This option makes code
6330 larger, and may or may not make it run faster.
6331
6332 Enabled with -fprofile-use.
6333
6334 -funroll-all-loops
6335 Unroll all loops, even if their number of iterations is uncertain
6336 when the loop is entered. This usually makes programs run more
6337 slowly. -funroll-all-loops implies the same options as
6338 -funroll-loops.
6339
6340 -fpeel-loops
6341 Peels the loops for that there is enough information that they do
6342 not roll much (from profile feedback). It also turns on complete
6343 loop peeling (i.e. complete removal of loops with small constant
6344 number of iterations).
6345
6346 Enabled with -fprofile-use.
6347
6348 -fmove-loop-invariants
6349 Enables the loop invariant motion pass in the RTL loop optimizer.
6350 Enabled at level -O1
6351
6352 -funswitch-loops
6353 Move branches with loop invariant conditions out of the loop, with
6354 duplicates of the loop on both branches (modified according to
6355 result of the condition).
6356
6357 -ffunction-sections
6358 -fdata-sections
6359 Place each function or data item into its own section in the output
6360 file if the target supports arbitrary sections. The name of the
6361 function or the name of the data item determines the section's name
6362 in the output file.
6363
6364 Use these options on systems where the linker can perform
6365 optimizations to improve locality of reference in the instruction
6366 space. Most systems using the ELF object format and SPARC
6367 processors running Solaris 2 have linkers with such optimizations.
6368 AIX may have these optimizations in the future.
6369
6370 Only use these options when there are significant benefits from
6371 doing so. When you specify these options, the assembler and linker
6372 will create larger object and executable files and will also be
6373 slower. You will not be able to use "gprof" on all systems if you
6374 specify this option and you may have problems with debugging if you
6375 specify both this option and -g.
6376
6377 -fbranch-target-load-optimize
6378 Perform branch target register load optimization before prologue /
6379 epilogue threading. The use of target registers can typically be
6380 exposed only during reload, thus hoisting loads out of loops and
6381 doing inter-block scheduling needs a separate optimization pass.
6382
6383 -fbranch-target-load-optimize2
6384 Perform branch target register load optimization after prologue /
6385 epilogue threading.
6386
6387 -fbtr-bb-exclusive
6388 When performing branch target register load optimization, don't
6389 reuse branch target registers in within any basic block.
6390
6391 -fstack-protector
6392 Emit extra code to check for buffer overflows, such as stack
6393 smashing attacks. This is done by adding a guard variable to
6394 functions with vulnerable objects. This includes functions that
6395 call alloca, and functions with buffers larger than 8 bytes. The
6396 guards are initialized when a function is entered and then checked
6397 when the function exits. If a guard check fails, an error message
6398 is printed and the program exits.
6399
6400 -fstack-protector-all
6401 Like -fstack-protector except that all functions are protected.
6402
6403 -fsection-anchors
6404 Try to reduce the number of symbolic address calculations by using
6405 shared "anchor" symbols to address nearby objects. This
6406 transformation can help to reduce the number of GOT entries and GOT
6407 accesses on some targets.
6408
6409 For example, the implementation of the following function "foo":
6410
6411 static int a, b, c;
6412 int foo (void) { return a + b + c; }
6413
6414 would usually calculate the addresses of all three variables, but
6415 if you compile it with -fsection-anchors, it will access the
6416 variables from a common anchor point instead. The effect is
6417 similar to the following pseudocode (which isn't valid C):
6418
6419 int foo (void)
6420 {
6421 register int *xr = &x;
6422 return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6423 }
6424
6425 Not all targets support this option.
6426
6427 --param name=value
6428 In some places, GCC uses various constants to control the amount of
6429 optimization that is done. For example, GCC will not inline
6430 functions that contain more that a certain number of instructions.
6431 You can control some of these constants on the command-line using
6432 the --param option.
6433
6434 The names of specific parameters, and the meaning of the values,
6435 are tied to the internals of the compiler, and are subject to
6436 change without notice in future releases.
6437
6438 In each case, the value is an integer. The allowable choices for
6439 name are given in the following table:
6440
6441 struct-reorg-cold-struct-ratio
6442 The threshold ratio (as a percentage) between a structure
6443 frequency and the frequency of the hottest structure in the
6444 program. This parameter is used by struct-reorg optimization
6445 enabled by -fipa-struct-reorg. We say that if the ratio of a
6446 structure frequency, calculated by profiling, to the hottest
6447 structure frequency in the program is less than this parameter,
6448 then structure reorganization is not applied to this structure.
6449 The default is 10.
6450
6451 predictable-branch-outcome
6452 When branch is predicted to be taken with probability lower
6453 than this threshold (in percent), then it is considered well
6454 predictable. The default is 10.
6455
6456 max-crossjump-edges
6457 The maximum number of incoming edges to consider for
6458 crossjumping. The algorithm used by -fcrossjumping is O(N^2)
6459 in the number of edges incoming to each block. Increasing
6460 values mean more aggressive optimization, making the compile
6461 time increase with probably small improvement in executable
6462 size.
6463
6464 min-crossjump-insns
6465 The minimum number of instructions which must be matched at the
6466 end of two blocks before crossjumping will be performed on
6467 them. This value is ignored in the case where all instructions
6468 in the block being crossjumped from are matched. The default
6469 value is 5.
6470
6471 max-grow-copy-bb-insns
6472 The maximum code size expansion factor when copying basic
6473 blocks instead of jumping. The expansion is relative to a jump
6474 instruction. The default value is 8.
6475
6476 max-goto-duplication-insns
6477 The maximum number of instructions to duplicate to a block that
6478 jumps to a computed goto. To avoid O(N^2) behavior in a number
6479 of passes, GCC factors computed gotos early in the compilation
6480 process, and unfactors them as late as possible. Only computed
6481 jumps at the end of a basic blocks with no more than max-goto-
6482 duplication-insns are unfactored. The default value is 8.
6483
6484 max-delay-slot-insn-search
6485 The maximum number of instructions to consider when looking for
6486 an instruction to fill a delay slot. If more than this
6487 arbitrary number of instructions is searched, the time savings
6488 from filling the delay slot will be minimal so stop searching.
6489 Increasing values mean more aggressive optimization, making the
6490 compile time increase with probably small improvement in
6491 executable run time.
6492
6493 max-delay-slot-live-search
6494 When trying to fill delay slots, the maximum number of
6495 instructions to consider when searching for a block with valid
6496 live register information. Increasing this arbitrarily chosen
6497 value means more aggressive optimization, increasing the
6498 compile time. This parameter should be removed when the delay
6499 slot code is rewritten to maintain the control-flow graph.
6500
6501 max-gcse-memory
6502 The approximate maximum amount of memory that will be allocated
6503 in order to perform the global common subexpression elimination
6504 optimization. If more memory than specified is required, the
6505 optimization will not be done.
6506
6507 max-pending-list-length
6508 The maximum number of pending dependencies scheduling will
6509 allow before flushing the current state and starting over.
6510 Large functions with few branches or calls can create
6511 excessively large lists which needlessly consume memory and
6512 resources.
6513
6514 max-inline-insns-single
6515 Several parameters control the tree inliner used in gcc. This
6516 number sets the maximum number of instructions (counted in
6517 GCC's internal representation) in a single function that the
6518 tree inliner will consider for inlining. This only affects
6519 functions declared inline and methods implemented in a class
6520 declaration (C++). The default value is 300.
6521
6522 max-inline-insns-auto
6523 When you use -finline-functions (included in -O3), a lot of
6524 functions that would otherwise not be considered for inlining
6525 by the compiler will be investigated. To those functions, a
6526 different (more restrictive) limit compared to functions
6527 declared inline can be applied. The default value is 50.
6528
6529 large-function-insns
6530 The limit specifying really large functions. For functions
6531 larger than this limit after inlining, inlining is constrained
6532 by --param large-function-growth. This parameter is useful
6533 primarily to avoid extreme compilation time caused by non-
6534 linear algorithms used by the backend. The default value is
6535 2700.
6536
6537 large-function-growth
6538 Specifies maximal growth of large function caused by inlining
6539 in percents. The default value is 100 which limits large
6540 function growth to 2.0 times the original size.
6541
6542 large-unit-insns
6543 The limit specifying large translation unit. Growth caused by
6544 inlining of units larger than this limit is limited by --param
6545 inline-unit-growth. For small units this might be too tight
6546 (consider unit consisting of function A that is inline and B
6547 that just calls A three time. If B is small relative to A, the
6548 growth of unit is 300\% and yet such inlining is very sane.
6549 For very large units consisting of small inlineable functions
6550 however the overall unit growth limit is needed to avoid
6551 exponential explosion of code size. Thus for smaller units,
6552 the size is increased to --param large-unit-insns before
6553 applying --param inline-unit-growth. The default is 10000
6554
6555 inline-unit-growth
6556 Specifies maximal overall growth of the compilation unit caused
6557 by inlining. The default value is 30 which limits unit growth
6558 to 1.3 times the original size.
6559
6560 ipcp-unit-growth
6561 Specifies maximal overall growth of the compilation unit caused
6562 by interprocedural constant propagation. The default value is
6563 10 which limits unit growth to 1.1 times the original size.
6564
6565 large-stack-frame
6566 The limit specifying large stack frames. While inlining the
6567 algorithm is trying to not grow past this limit too much.
6568 Default value is 256 bytes.
6569
6570 large-stack-frame-growth
6571 Specifies maximal growth of large stack frames caused by
6572 inlining in percents. The default value is 1000 which limits
6573 large stack frame growth to 11 times the original size.
6574
6575 max-inline-insns-recursive
6576 max-inline-insns-recursive-auto
6577 Specifies maximum number of instructions out-of-line copy of
6578 self recursive inline function can grow into by performing
6579 recursive inlining.
6580
6581 For functions declared inline --param max-inline-insns-
6582 recursive is taken into account. For function not declared
6583 inline, recursive inlining happens only when -finline-functions
6584 (included in -O3) is enabled and --param max-inline-insns-
6585 recursive-auto is used. The default value is 450.
6586
6587 max-inline-recursive-depth
6588 max-inline-recursive-depth-auto
6589 Specifies maximum recursion depth used by the recursive
6590 inlining.
6591
6592 For functions declared inline --param max-inline-recursive-
6593 depth is taken into account. For function not declared inline,
6594 recursive inlining happens only when -finline-functions
6595 (included in -O3) is enabled and --param max-inline-recursive-
6596 depth-auto is used. The default value is 8.
6597
6598 min-inline-recursive-probability
6599 Recursive inlining is profitable only for function having deep
6600 recursion in average and can hurt for function having little
6601 recursion depth by increasing the prologue size or complexity
6602 of function body to other optimizers.
6603
6604 When profile feedback is available (see -fprofile-generate) the
6605 actual recursion depth can be guessed from probability that
6606 function will recurse via given call expression. This
6607 parameter limits inlining only to call expression whose
6608 probability exceeds given threshold (in percents). The default
6609 value is 10.
6610
6611 early-inlining-insns
6612 Specify growth that early inliner can make. In effect it
6613 increases amount of inlining for code having large abstraction
6614 penalty. The default value is 8.
6615
6616 max-early-inliner-iterations
6617 max-early-inliner-iterations
6618 Limit of iterations of early inliner. This basically bounds
6619 number of nested indirect calls early inliner can resolve.
6620 Deeper chains are still handled by late inlining.
6621
6622 min-vect-loop-bound
6623 The minimum number of iterations under which a loop will not
6624 get vectorized when -ftree-vectorize is used. The number of
6625 iterations after vectorization needs to be greater than the
6626 value specified by this option to allow vectorization. The
6627 default value is 0.
6628
6629 max-unrolled-insns
6630 The maximum number of instructions that a loop should have if
6631 that loop is unrolled, and if the loop is unrolled, it
6632 determines how many times the loop code is unrolled.
6633
6634 max-average-unrolled-insns
6635 The maximum number of instructions biased by probabilities of
6636 their execution that a loop should have if that loop is
6637 unrolled, and if the loop is unrolled, it determines how many
6638 times the loop code is unrolled.
6639
6640 max-unroll-times
6641 The maximum number of unrollings of a single loop.
6642
6643 max-peeled-insns
6644 The maximum number of instructions that a loop should have if
6645 that loop is peeled, and if the loop is peeled, it determines
6646 how many times the loop code is peeled.
6647
6648 max-peel-times
6649 The maximum number of peelings of a single loop.
6650
6651 max-completely-peeled-insns
6652 The maximum number of insns of a completely peeled loop.
6653
6654 max-completely-peel-times
6655 The maximum number of iterations of a loop to be suitable for
6656 complete peeling.
6657
6658 max-completely-peel-loop-nest-depth
6659 The maximum depth of a loop nest suitable for complete peeling.
6660
6661 max-unswitch-insns
6662 The maximum number of insns of an unswitched loop.
6663
6664 max-unswitch-level
6665 The maximum number of branches unswitched in a single loop.
6666
6667 lim-expensive
6668 The minimum cost of an expensive expression in the loop
6669 invariant motion.
6670
6671 iv-consider-all-candidates-bound
6672 Bound on number of candidates for induction variables below
6673 that all candidates are considered for each use in induction
6674 variable optimizations. Only the most relevant candidates are
6675 considered if there are more candidates, to avoid quadratic
6676 time complexity.
6677
6678 iv-max-considered-uses
6679 The induction variable optimizations give up on loops that
6680 contain more induction variable uses.
6681
6682 iv-always-prune-cand-set-bound
6683 If number of candidates in the set is smaller than this value,
6684 we always try to remove unnecessary ivs from the set during its
6685 optimization when a new iv is added to the set.
6686
6687 scev-max-expr-size
6688 Bound on size of expressions used in the scalar evolutions
6689 analyzer. Large expressions slow the analyzer.
6690
6691 omega-max-vars
6692 The maximum number of variables in an Omega constraint system.
6693 The default value is 128.
6694
6695 omega-max-geqs
6696 The maximum number of inequalities in an Omega constraint
6697 system. The default value is 256.
6698
6699 omega-max-eqs
6700 The maximum number of equalities in an Omega constraint system.
6701 The default value is 128.
6702
6703 omega-max-wild-cards
6704 The maximum number of wildcard variables that the Omega solver
6705 will be able to insert. The default value is 18.
6706
6707 omega-hash-table-size
6708 The size of the hash table in the Omega solver. The default
6709 value is 550.
6710
6711 omega-max-keys
6712 The maximal number of keys used by the Omega solver. The
6713 default value is 500.
6714
6715 omega-eliminate-redundant-constraints
6716 When set to 1, use expensive methods to eliminate all redundant
6717 constraints. The default value is 0.
6718
6719 vect-max-version-for-alignment-checks
6720 The maximum number of runtime checks that can be performed when
6721 doing loop versioning for alignment in the vectorizer. See
6722 option ftree-vect-loop-version for more information.
6723
6724 vect-max-version-for-alias-checks
6725 The maximum number of runtime checks that can be performed when
6726 doing loop versioning for alias in the vectorizer. See option
6727 ftree-vect-loop-version for more information.
6728
6729 max-iterations-to-track
6730 The maximum number of iterations of a loop the brute force
6731 algorithm for analysis of # of iterations of the loop tries to
6732 evaluate.
6733
6734 hot-bb-count-fraction
6735 Select fraction of the maximal count of repetitions of basic
6736 block in program given basic block needs to have to be
6737 considered hot.
6738
6739 hot-bb-frequency-fraction
6740 Select fraction of the maximal frequency of executions of basic
6741 block in function given basic block needs to have to be
6742 considered hot
6743
6744 max-predicted-iterations
6745 The maximum number of loop iterations we predict statically.
6746 This is useful in cases where function contain single loop with
6747 known bound and other loop with unknown. We predict the known
6748 number of iterations correctly, while the unknown number of
6749 iterations average to roughly 10. This means that the loop
6750 without bounds would appear artificially cold relative to the
6751 other one.
6752
6753 align-threshold
6754 Select fraction of the maximal frequency of executions of basic
6755 block in function given basic block will get aligned.
6756
6757 align-loop-iterations
6758 A loop expected to iterate at lest the selected number of
6759 iterations will get aligned.
6760
6761 tracer-dynamic-coverage
6762 tracer-dynamic-coverage-feedback
6763 This value is used to limit superblock formation once the given
6764 percentage of executed instructions is covered. This limits
6765 unnecessary code size expansion.
6766
6767 The tracer-dynamic-coverage-feedback is used only when profile
6768 feedback is available. The real profiles (as opposed to
6769 statically estimated ones) are much less balanced allowing the
6770 threshold to be larger value.
6771
6772 tracer-max-code-growth
6773 Stop tail duplication once code growth has reached given
6774 percentage. This is rather hokey argument, as most of the
6775 duplicates will be eliminated later in cross jumping, so it may
6776 be set to much higher values than is the desired code growth.
6777
6778 tracer-min-branch-ratio
6779 Stop reverse growth when the reverse probability of best edge
6780 is less than this threshold (in percent).
6781
6782 tracer-min-branch-ratio
6783 tracer-min-branch-ratio-feedback
6784 Stop forward growth if the best edge do have probability lower
6785 than this threshold.
6786
6787 Similarly to tracer-dynamic-coverage two values are present,
6788 one for compilation for profile feedback and one for
6789 compilation without. The value for compilation with profile
6790 feedback needs to be more conservative (higher) in order to
6791 make tracer effective.
6792
6793 max-cse-path-length
6794 Maximum number of basic blocks on path that cse considers. The
6795 default is 10.
6796
6797 max-cse-insns
6798 The maximum instructions CSE process before flushing. The
6799 default is 1000.
6800
6801 ggc-min-expand
6802 GCC uses a garbage collector to manage its own memory
6803 allocation. This parameter specifies the minimum percentage by
6804 which the garbage collector's heap should be allowed to expand
6805 between collections. Tuning this may improve compilation
6806 speed; it has no effect on code generation.
6807
6808 The default is 30% + 70% * (RAM/1GB) with an upper bound of
6809 100% when RAM >= 1GB. If "getrlimit" is available, the notion
6810 of "RAM" is the smallest of actual RAM and "RLIMIT_DATA" or
6811 "RLIMIT_AS". If GCC is not able to calculate RAM on a
6812 particular platform, the lower bound of 30% is used. Setting
6813 this parameter and ggc-min-heapsize to zero causes a full
6814 collection to occur at every opportunity. This is extremely
6815 slow, but can be useful for debugging.
6816
6817 ggc-min-heapsize
6818 Minimum size of the garbage collector's heap before it begins
6819 bothering to collect garbage. The first collection occurs
6820 after the heap expands by ggc-min-expand% beyond ggc-min-
6821 heapsize. Again, tuning this may improve compilation speed,
6822 and has no effect on code generation.
6823
6824 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit
6825 which tries to ensure that RLIMIT_DATA or RLIMIT_AS are not
6826 exceeded, but with a lower bound of 4096 (four megabytes) and
6827 an upper bound of 131072 (128 megabytes). If GCC is not able
6828 to calculate RAM on a particular platform, the lower bound is
6829 used. Setting this parameter very large effectively disables
6830 garbage collection. Setting this parameter and ggc-min-expand
6831 to zero causes a full collection to occur at every opportunity.
6832
6833 max-reload-search-insns
6834 The maximum number of instruction reload should look backward
6835 for equivalent register. Increasing values mean more
6836 aggressive optimization, making the compile time increase with
6837 probably slightly better performance. The default value is
6838 100.
6839
6840 max-cselib-memory-locations
6841 The maximum number of memory locations cselib should take into
6842 account. Increasing values mean more aggressive optimization,
6843 making the compile time increase with probably slightly better
6844 performance. The default value is 500.
6845
6846 reorder-blocks-duplicate
6847 reorder-blocks-duplicate-feedback
6848 Used by basic block reordering pass to decide whether to use
6849 unconditional branch or duplicate the code on its destination.
6850 Code is duplicated when its estimated size is smaller than this
6851 value multiplied by the estimated size of unconditional jump in
6852 the hot spots of the program.
6853
6854 The reorder-block-duplicate-feedback is used only when profile
6855 feedback is available and may be set to higher values than
6856 reorder-block-duplicate since information about the hot spots
6857 is more accurate.
6858
6859 max-sched-ready-insns
6860 The maximum number of instructions ready to be issued the
6861 scheduler should consider at any given time during the first
6862 scheduling pass. Increasing values mean more thorough
6863 searches, making the compilation time increase with probably
6864 little benefit. The default value is 100.
6865
6866 max-sched-region-blocks
6867 The maximum number of blocks in a region to be considered for
6868 interblock scheduling. The default value is 10.
6869
6870 max-pipeline-region-blocks
6871 The maximum number of blocks in a region to be considered for
6872 pipelining in the selective scheduler. The default value is
6873 15.
6874
6875 max-sched-region-insns
6876 The maximum number of insns in a region to be considered for
6877 interblock scheduling. The default value is 100.
6878
6879 max-pipeline-region-insns
6880 The maximum number of insns in a region to be considered for
6881 pipelining in the selective scheduler. The default value is
6882 200.
6883
6884 min-spec-prob
6885 The minimum probability (in percents) of reaching a source
6886 block for interblock speculative scheduling. The default value
6887 is 40.
6888
6889 max-sched-extend-regions-iters
6890 The maximum number of iterations through CFG to extend regions.
6891 0 - disable region extension, N - do at most N iterations. The
6892 default value is 0.
6893
6894 max-sched-insn-conflict-delay
6895 The maximum conflict delay for an insn to be considered for
6896 speculative motion. The default value is 3.
6897
6898 sched-spec-prob-cutoff
6899 The minimal probability of speculation success (in percents),
6900 so that speculative insn will be scheduled. The default value
6901 is 40.
6902
6903 sched-mem-true-dep-cost
6904 Minimal distance (in CPU cycles) between store and load
6905 targeting same memory locations. The default value is 1.
6906
6907 selsched-max-lookahead
6908 The maximum size of the lookahead window of selective
6909 scheduling. It is a depth of search for available
6910 instructions. The default value is 50.
6911
6912 selsched-max-sched-times
6913 The maximum number of times that an instruction will be
6914 scheduled during selective scheduling. This is the limit on
6915 the number of iterations through which the instruction may be
6916 pipelined. The default value is 2.
6917
6918 selsched-max-insns-to-rename
6919 The maximum number of best instructions in the ready list that
6920 are considered for renaming in the selective scheduler. The
6921 default value is 2.
6922
6923 max-last-value-rtl
6924 The maximum size measured as number of RTLs that can be
6925 recorded in an expression in combiner for a pseudo register as
6926 last known value of that register. The default is 10000.
6927
6928 integer-share-limit
6929 Small integer constants can use a shared data structure,
6930 reducing the compiler's memory usage and increasing its speed.
6931 This sets the maximum value of a shared integer constant. The
6932 default value is 256.
6933
6934 min-virtual-mappings
6935 Specifies the minimum number of virtual mappings in the
6936 incremental SSA updater that should be registered to trigger
6937 the virtual mappings heuristic defined by virtual-mappings-
6938 ratio. The default value is 100.
6939
6940 virtual-mappings-ratio
6941 If the number of virtual mappings is virtual-mappings-ratio
6942 bigger than the number of virtual symbols to be updated, then
6943 the incremental SSA updater switches to a full update for those
6944 symbols. The default ratio is 3.
6945
6946 ssp-buffer-size
6947 The minimum size of buffers (i.e. arrays) that will receive
6948 stack smashing protection when -fstack-protection is used.
6949
6950 max-jump-thread-duplication-stmts
6951 Maximum number of statements allowed in a block that needs to
6952 be duplicated when threading jumps.
6953
6954 max-fields-for-field-sensitive
6955 Maximum number of fields in a structure we will treat in a
6956 field sensitive manner during pointer analysis. The default is
6957 zero for -O0, and -O1 and 100 for -Os, -O2, and -O3.
6958
6959 prefetch-latency
6960 Estimate on average number of instructions that are executed
6961 before prefetch finishes. The distance we prefetch ahead is
6962 proportional to this constant. Increasing this number may also
6963 lead to less streams being prefetched (see simultaneous-
6964 prefetches).
6965
6966 simultaneous-prefetches
6967 Maximum number of prefetches that can run at the same time.
6968
6969 l1-cache-line-size
6970 The size of cache line in L1 cache, in bytes.
6971
6972 l1-cache-size
6973 The size of L1 cache, in kilobytes.
6974
6975 l2-cache-size
6976 The size of L2 cache, in kilobytes.
6977
6978 min-insn-to-prefetch-ratio
6979 The minimum ratio between the number of instructions and the
6980 number of prefetches to enable prefetching in a loop with an
6981 unknown trip count.
6982
6983 prefetch-min-insn-to-mem-ratio
6984 The minimum ratio between the number of instructions and the
6985 number of memory references to enable prefetching in a loop.
6986
6987 use-canonical-types
6988 Whether the compiler should use the "canonical" type system.
6989 By default, this should always be 1, which uses a more
6990 efficient internal mechanism for comparing types in C++ and
6991 Objective-C++. However, if bugs in the canonical type system
6992 are causing compilation failures, set this value to 0 to
6993 disable canonical types.
6994
6995 switch-conversion-max-branch-ratio
6996 Switch initialization conversion will refuse to create arrays
6997 that are bigger than switch-conversion-max-branch-ratio times
6998 the number of branches in the switch.
6999
7000 max-partial-antic-length
7001 Maximum length of the partial antic set computed during the
7002 tree partial redundancy elimination optimization (-ftree-pre)
7003 when optimizing at -O3 and above. For some sorts of source
7004 code the enhanced partial redundancy elimination optimization
7005 can run away, consuming all of the memory available on the host
7006 machine. This parameter sets a limit on the length of the sets
7007 that are computed, which prevents the runaway behavior.
7008 Setting a value of 0 for this parameter will allow an unlimited
7009 set length.
7010
7011 sccvn-max-scc-size
7012 Maximum size of a strongly connected component (SCC) during
7013 SCCVN processing. If this limit is hit, SCCVN processing for
7014 the whole function will not be done and optimizations depending
7015 on it will be disabled. The default maximum SCC size is 10000.
7016
7017 ira-max-loops-num
7018 IRA uses a regional register allocation by default. If a
7019 function contains loops more than number given by the
7020 parameter, only at most given number of the most frequently
7021 executed loops will form regions for the regional register
7022 allocation. The default value of the parameter is 100.
7023
7024 ira-max-conflict-table-size
7025 Although IRA uses a sophisticated algorithm of compression
7026 conflict table, the table can be still big for huge functions.
7027 If the conflict table for a function could be more than size in
7028 MB given by the parameter, the conflict table is not built and
7029 faster, simpler, and lower quality register allocation
7030 algorithm will be used. The algorithm do not use pseudo-
7031 register conflicts. The default value of the parameter is
7032 2000.
7033
7034 ira-loop-reserved-regs
7035 IRA can be used to evaluate more accurate register pressure in
7036 loops for decision to move loop invariants (see -O3). The
7037 number of available registers reserved for some other purposes
7038 is described by this parameter. The default value of the
7039 parameter is 2 which is minimal number of registers needed for
7040 execution of typical instruction. This value is the best found
7041 from numerous experiments.
7042
7043 loop-invariant-max-bbs-in-loop
7044 Loop invariant motion can be very expensive, both in compile
7045 time and in amount of needed compile time memory, with very
7046 large loops. Loops with more basic blocks than this parameter
7047 won't have loop invariant motion optimization performed on
7048 them. The default value of the parameter is 1000 for -O1 and
7049 10000 for -O2 and above.
7050
7051 max-vartrack-size
7052 Sets a maximum number of hash table slots to use during
7053 variable tracking dataflow analysis of any function. If this
7054 limit is exceeded with variable tracking at assignments
7055 enabled, analysis for that function is retried without it,
7056 after removing all debug insns from the function. If the limit
7057 is exceeded even without debug insns, var tracking analysis is
7058 completely disabled for the function. Setting the parameter to
7059 zero makes it unlimited.
7060
7061 min-nondebug-insn-uid
7062 Use uids starting at this parameter for nondebug insns. The
7063 range below the parameter is reserved exclusively for debug
7064 insns created by -fvar-tracking-assignments, but debug insns
7065 may get (non-overlapping) uids above it if the reserved range
7066 is exhausted.
7067
7068 ipa-sra-ptr-growth-factor
7069 IPA-SRA will replace a pointer to an aggregate with one or more
7070 new parameters only when their cumulative size is less or equal
7071 to ipa-sra-ptr-growth-factor times the size of the original
7072 pointer parameter.
7073
7074 graphite-max-nb-scop-params
7075 To avoid exponential effects in the Graphite loop transforms,
7076 the number of parameters in a Static Control Part (SCoP) is
7077 bounded. The default value is 10 parameters. A variable whose
7078 value is unknown at compile time and defined outside a SCoP is
7079 a parameter of the SCoP.
7080
7081 graphite-max-bbs-per-function
7082 To avoid exponential effects in the detection of SCoPs, the
7083 size of the functions analyzed by Graphite is bounded. The
7084 default value is 100 basic blocks.
7085
7086 loop-block-tile-size
7087 Loop blocking or strip mining transforms, enabled with
7088 -floop-block or -floop-strip-mine, strip mine each loop in the
7089 loop nest by a given number of iterations. The strip length
7090 can be changed using the loop-block-tile-size parameter. The
7091 default value is 51 iterations.
7092
7093 Options Controlling the Preprocessor
7094 These options control the C preprocessor, which is run on each C source
7095 file before actual compilation.
7096
7097 If you use the -E option, nothing is done except preprocessing. Some
7098 of these options make sense only together with -E because they cause
7099 the preprocessor output to be unsuitable for actual compilation.
7100
7101 -Wp,option
7102 You can use -Wp,option to bypass the compiler driver and pass
7103 option directly through to the preprocessor. If option contains
7104 commas, it is split into multiple options at the commas. However,
7105 many options are modified, translated or interpreted by the
7106 compiler driver before being passed to the preprocessor, and -Wp
7107 forcibly bypasses this phase. The preprocessor's direct interface
7108 is undocumented and subject to change, so whenever possible you
7109 should avoid using -Wp and let the driver handle the options
7110 instead.
7111
7112 -Xpreprocessor option
7113 Pass option as an option to the preprocessor. You can use this to
7114 supply system-specific preprocessor options which GCC does not know
7115 how to recognize.
7116
7117 If you want to pass an option that takes an argument, you must use
7118 -Xpreprocessor twice, once for the option and once for the
7119 argument.
7120
7121 -D name
7122 Predefine name as a macro, with definition 1.
7123
7124 -D name=definition
7125 The contents of definition are tokenized and processed as if they
7126 appeared during translation phase three in a #define directive. In
7127 particular, the definition will be truncated by embedded newline
7128 characters.
7129
7130 If you are invoking the preprocessor from a shell or shell-like
7131 program you may need to use the shell's quoting syntax to protect
7132 characters such as spaces that have a meaning in the shell syntax.
7133
7134 If you wish to define a function-like macro on the command line,
7135 write its argument list with surrounding parentheses before the
7136 equals sign (if any). Parentheses are meaningful to most shells,
7137 so you will need to quote the option. With sh and csh,
7138 -D'name(args...)=definition' works.
7139
7140 -D and -U options are processed in the order they are given on the
7141 command line. All -imacros file and -include file options are
7142 processed after all -D and -U options.
7143
7144 -U name
7145 Cancel any previous definition of name, either built in or provided
7146 with a -D option.
7147
7148 -undef
7149 Do not predefine any system-specific or GCC-specific macros. The
7150 standard predefined macros remain defined.
7151
7152 -I dir
7153 Add the directory dir to the list of directories to be searched for
7154 header files. Directories named by -I are searched before the
7155 standard system include directories. If the directory dir is a
7156 standard system include directory, the option is ignored to ensure
7157 that the default search order for system directories and the
7158 special treatment of system headers are not defeated . If dir
7159 begins with "=", then the "=" will be replaced by the sysroot
7160 prefix; see --sysroot and -isysroot.
7161
7162 -o file
7163 Write output to file. This is the same as specifying file as the
7164 second non-option argument to cpp. gcc has a different
7165 interpretation of a second non-option argument, so you must use -o
7166 to specify the output file.
7167
7168 -Wall
7169 Turns on all optional warnings which are desirable for normal code.
7170 At present this is -Wcomment, -Wtrigraphs, -Wmultichar and a
7171 warning about integer promotion causing a change of sign in "#if"
7172 expressions. Note that many of the preprocessor's warnings are on
7173 by default and have no options to control them.
7174
7175 -Wcomment
7176 -Wcomments
7177 Warn whenever a comment-start sequence /* appears in a /* comment,
7178 or whenever a backslash-newline appears in a // comment. (Both
7179 forms have the same effect.)
7180
7181 -Wtrigraphs
7182 Most trigraphs in comments cannot affect the meaning of the
7183 program. However, a trigraph that would form an escaped newline
7184 (??/ at the end of a line) can, by changing where the comment
7185 begins or ends. Therefore, only trigraphs that would form escaped
7186 newlines produce warnings inside a comment.
7187
7188 This option is implied by -Wall. If -Wall is not given, this
7189 option is still enabled unless trigraphs are enabled. To get
7190 trigraph conversion without warnings, but get the other -Wall
7191 warnings, use -trigraphs -Wall -Wno-trigraphs.
7192
7193 -Wtraditional
7194 Warn about certain constructs that behave differently in
7195 traditional and ISO C. Also warn about ISO C constructs that have
7196 no traditional C equivalent, and problematic constructs which
7197 should be avoided.
7198
7199 -Wundef
7200 Warn whenever an identifier which is not a macro is encountered in
7201 an #if directive, outside of defined. Such identifiers are
7202 replaced with zero.
7203
7204 -Wunused-macros
7205 Warn about macros defined in the main file that are unused. A
7206 macro is used if it is expanded or tested for existence at least
7207 once. The preprocessor will also warn if the macro has not been
7208 used at the time it is redefined or undefined.
7209
7210 Built-in macros, macros defined on the command line, and macros
7211 defined in include files are not warned about.
7212
7213 Note: If a macro is actually used, but only used in skipped
7214 conditional blocks, then CPP will report it as unused. To avoid
7215 the warning in such a case, you might improve the scope of the
7216 macro's definition by, for example, moving it into the first
7217 skipped block. Alternatively, you could provide a dummy use with
7218 something like:
7219
7220 #if defined the_macro_causing_the_warning
7221 #endif
7222
7223 -Wendif-labels
7224 Warn whenever an #else or an #endif are followed by text. This
7225 usually happens in code of the form
7226
7227 #if FOO
7228 ...
7229 #else FOO
7230 ...
7231 #endif FOO
7232
7233 The second and third "FOO" should be in comments, but often are not
7234 in older programs. This warning is on by default.
7235
7236 -Werror
7237 Make all warnings into hard errors. Source code which triggers
7238 warnings will be rejected.
7239
7240 -Wsystem-headers
7241 Issue warnings for code in system headers. These are normally
7242 unhelpful in finding bugs in your own code, therefore suppressed.
7243 If you are responsible for the system library, you may want to see
7244 them.
7245
7246 -w Suppress all warnings, including those which GNU CPP issues by
7247 default.
7248
7249 -pedantic
7250 Issue all the mandatory diagnostics listed in the C standard. Some
7251 of them are left out by default, since they trigger frequently on
7252 harmless code.
7253
7254 -pedantic-errors
7255 Issue all the mandatory diagnostics, and make all mandatory
7256 diagnostics into errors. This includes mandatory diagnostics that
7257 GCC issues without -pedantic but treats as warnings.
7258
7259 -M Instead of outputting the result of preprocessing, output a rule
7260 suitable for make describing the dependencies of the main source
7261 file. The preprocessor outputs one make rule containing the object
7262 file name for that source file, a colon, and the names of all the
7263 included files, including those coming from -include or -imacros
7264 command line options.
7265
7266 Unless specified explicitly (with -MT or -MQ), the object file name
7267 consists of the name of the source file with any suffix replaced
7268 with object file suffix and with any leading directory parts
7269 removed. If there are many included files then the rule is split
7270 into several lines using \-newline. The rule has no commands.
7271
7272 This option does not suppress the preprocessor's debug output, such
7273 as -dM. To avoid mixing such debug output with the dependency
7274 rules you should explicitly specify the dependency output file with
7275 -MF, or use an environment variable like DEPENDENCIES_OUTPUT.
7276 Debug output will still be sent to the regular output stream as
7277 normal.
7278
7279 Passing -M to the driver implies -E, and suppresses warnings with
7280 an implicit -w.
7281
7282 -MM Like -M but do not mention header files that are found in system
7283 header directories, nor header files that are included, directly or
7284 indirectly, from such a header.
7285
7286 This implies that the choice of angle brackets or double quotes in
7287 an #include directive does not in itself determine whether that
7288 header will appear in -MM dependency output. This is a slight
7289 change in semantics from GCC versions 3.0 and earlier.
7290
7291 -MF file
7292 When used with -M or -MM, specifies a file to write the
7293 dependencies to. If no -MF switch is given the preprocessor sends
7294 the rules to the same place it would have sent preprocessed output.
7295
7296 When used with the driver options -MD or -MMD, -MF overrides the
7297 default dependency output file.
7298
7299 -MG In conjunction with an option such as -M requesting dependency
7300 generation, -MG assumes missing header files are generated files
7301 and adds them to the dependency list without raising an error. The
7302 dependency filename is taken directly from the "#include" directive
7303 without prepending any path. -MG also suppresses preprocessed
7304 output, as a missing header file renders this useless.
7305
7306 This feature is used in automatic updating of makefiles.
7307
7308 -MP This option instructs CPP to add a phony target for each dependency
7309 other than the main file, causing each to depend on nothing. These
7310 dummy rules work around errors make gives if you remove header
7311 files without updating the Makefile to match.
7312
7313 This is typical output:
7314
7315 test.o: test.c test.h
7316
7317 test.h:
7318
7319 -MT target
7320 Change the target of the rule emitted by dependency generation. By
7321 default CPP takes the name of the main input file, deletes any
7322 directory components and any file suffix such as .c, and appends
7323 the platform's usual object suffix. The result is the target.
7324
7325 An -MT option will set the target to be exactly the string you
7326 specify. If you want multiple targets, you can specify them as a
7327 single argument to -MT, or use multiple -MT options.
7328
7329 For example, -MT '$(objpfx)foo.o' might give
7330
7331 $(objpfx)foo.o: foo.c
7332
7333 -MQ target
7334 Same as -MT, but it quotes any characters which are special to
7335 Make. -MQ '$(objpfx)foo.o' gives
7336
7337 $$(objpfx)foo.o: foo.c
7338
7339 The default target is automatically quoted, as if it were given
7340 with -MQ.
7341
7342 -MD -MD is equivalent to -M -MF file, except that -E is not implied.
7343 The driver determines file based on whether an -o option is given.
7344 If it is, the driver uses its argument but with a suffix of .d,
7345 otherwise it takes the name of the input file, removes any
7346 directory components and suffix, and applies a .d suffix.
7347
7348 If -MD is used in conjunction with -E, any -o switch is understood
7349 to specify the dependency output file, but if used without -E, each
7350 -o is understood to specify a target object file.
7351
7352 Since -E is not implied, -MD can be used to generate a dependency
7353 output file as a side-effect of the compilation process.
7354
7355 -MMD
7356 Like -MD except mention only user header files, not system header
7357 files.
7358
7359 -fpch-deps
7360 When using precompiled headers, this flag will cause the
7361 dependency-output flags to also list the files from the precompiled
7362 header's dependencies. If not specified only the precompiled
7363 header would be listed and not the files that were used to create
7364 it because those files are not consulted when a precompiled header
7365 is used.
7366
7367 -fpch-preprocess
7368 This option allows use of a precompiled header together with -E.
7369 It inserts a special "#pragma", "#pragma GCC pch_preprocess
7370 "<filename>"" in the output to mark the place where the precompiled
7371 header was found, and its filename. When -fpreprocessed is in use,
7372 GCC recognizes this "#pragma" and loads the PCH.
7373
7374 This option is off by default, because the resulting preprocessed
7375 output is only really suitable as input to GCC. It is switched on
7376 by -save-temps.
7377
7378 You should not write this "#pragma" in your own code, but it is
7379 safe to edit the filename if the PCH file is available in a
7380 different location. The filename may be absolute or it may be
7381 relative to GCC's current directory.
7382
7383 -x c
7384 -x c++
7385 -x objective-c
7386 -x assembler-with-cpp
7387 Specify the source language: C, C++, Objective-C, or assembly.
7388 This has nothing to do with standards conformance or extensions; it
7389 merely selects which base syntax to expect. If you give none of
7390 these options, cpp will deduce the language from the extension of
7391 the source file: .c, .cc, .m, or .S. Some other common extensions
7392 for C++ and assembly are also recognized. If cpp does not
7393 recognize the extension, it will treat the file as C; this is the
7394 most generic mode.
7395
7396 Note: Previous versions of cpp accepted a -lang option which
7397 selected both the language and the standards conformance level.
7398 This option has been removed, because it conflicts with the -l
7399 option.
7400
7401 -std=standard
7402 -ansi
7403 Specify the standard to which the code should conform. Currently
7404 CPP knows about C and C++ standards; others may be added in the
7405 future.
7406
7407 standard may be one of:
7408
7409 "c90"
7410 "c89"
7411 "iso9899:1990"
7412 The ISO C standard from 1990. c90 is the customary shorthand
7413 for this version of the standard.
7414
7415 The -ansi option is equivalent to -std=c90.
7416
7417 "iso9899:199409"
7418 The 1990 C standard, as amended in 1994.
7419
7420 "iso9899:1999"
7421 "c99"
7422 "iso9899:199x"
7423 "c9x"
7424 The revised ISO C standard, published in December 1999. Before
7425 publication, this was known as C9X.
7426
7427 "gnu90"
7428 "gnu89"
7429 The 1990 C standard plus GNU extensions. This is the default.
7430
7431 "gnu99"
7432 "gnu9x"
7433 The 1999 C standard plus GNU extensions.
7434
7435 "c++98"
7436 The 1998 ISO C++ standard plus amendments.
7437
7438 "gnu++98"
7439 The same as -std=c++98 plus GNU extensions. This is the
7440 default for C++ code.
7441
7442 -I- Split the include path. Any directories specified with -I options
7443 before -I- are searched only for headers requested with
7444 "#include "file""; they are not searched for "#include <file>". If
7445 additional directories are specified with -I options after the -I-,
7446 those directories are searched for all #include directives.
7447
7448 In addition, -I- inhibits the use of the directory of the current
7449 file directory as the first search directory for "#include "file"".
7450 This option has been deprecated.
7451
7452 -nostdinc
7453 Do not search the standard system directories for header files.
7454 Only the directories you have specified with -I options (and the
7455 directory of the current file, if appropriate) are searched.
7456
7457 -nostdinc++
7458 Do not search for header files in the C++-specific standard
7459 directories, but do still search the other standard directories.
7460 (This option is used when building the C++ library.)
7461
7462 -include file
7463 Process file as if "#include "file"" appeared as the first line of
7464 the primary source file. However, the first directory searched for
7465 file is the preprocessor's working directory instead of the
7466 directory containing the main source file. If not found there, it
7467 is searched for in the remainder of the "#include "..."" search
7468 chain as normal.
7469
7470 If multiple -include options are given, the files are included in
7471 the order they appear on the command line.
7472
7473 -imacros file
7474 Exactly like -include, except that any output produced by scanning
7475 file is thrown away. Macros it defines remain defined. This
7476 allows you to acquire all the macros from a header without also
7477 processing its declarations.
7478
7479 All files specified by -imacros are processed before all files
7480 specified by -include.
7481
7482 -idirafter dir
7483 Search dir for header files, but do it after all directories
7484 specified with -I and the standard system directories have been
7485 exhausted. dir is treated as a system include directory. If dir
7486 begins with "=", then the "=" will be replaced by the sysroot
7487 prefix; see --sysroot and -isysroot.
7488
7489 -iprefix prefix
7490 Specify prefix as the prefix for subsequent -iwithprefix options.
7491 If the prefix represents a directory, you should include the final
7492 /.
7493
7494 -iwithprefix dir
7495 -iwithprefixbefore dir
7496 Append dir to the prefix specified previously with -iprefix, and
7497 add the resulting directory to the include search path.
7498 -iwithprefixbefore puts it in the same place -I would; -iwithprefix
7499 puts it where -idirafter would.
7500
7501 -isysroot dir
7502 This option is like the --sysroot option, but applies only to
7503 header files. See the --sysroot option for more information.
7504
7505 -imultilib dir
7506 Use dir as a subdirectory of the directory containing target-
7507 specific C++ headers.
7508
7509 -isystem dir
7510 Search dir for header files, after all directories specified by -I
7511 but before the standard system directories. Mark it as a system
7512 directory, so that it gets the same special treatment as is applied
7513 to the standard system directories. If dir begins with "=", then
7514 the "=" will be replaced by the sysroot prefix; see --sysroot and
7515 -isysroot.
7516
7517 -iquote dir
7518 Search dir only for header files requested with "#include "file"";
7519 they are not searched for "#include <file>", before all directories
7520 specified by -I and before the standard system directories. If dir
7521 begins with "=", then the "=" will be replaced by the sysroot
7522 prefix; see --sysroot and -isysroot.
7523
7524 -fdirectives-only
7525 When preprocessing, handle directives, but do not expand macros.
7526
7527 The option's behavior depends on the -E and -fpreprocessed options.
7528
7529 With -E, preprocessing is limited to the handling of directives
7530 such as "#define", "#ifdef", and "#error". Other preprocessor
7531 operations, such as macro expansion and trigraph conversion are not
7532 performed. In addition, the -dD option is implicitly enabled.
7533
7534 With -fpreprocessed, predefinition of command line and most builtin
7535 macros is disabled. Macros such as "__LINE__", which are
7536 contextually dependent, are handled normally. This enables
7537 compilation of files previously preprocessed with "-E
7538 -fdirectives-only".
7539
7540 With both -E and -fpreprocessed, the rules for -fpreprocessed take
7541 precedence. This enables full preprocessing of files previously
7542 preprocessed with "-E -fdirectives-only".
7543
7544 -fdollars-in-identifiers
7545 Accept $ in identifiers.
7546
7547 -fextended-identifiers
7548 Accept universal character names in identifiers. This option is
7549 experimental; in a future version of GCC, it will be enabled by
7550 default for C99 and C++.
7551
7552 -fpreprocessed
7553 Indicate to the preprocessor that the input file has already been
7554 preprocessed. This suppresses things like macro expansion,
7555 trigraph conversion, escaped newline splicing, and processing of
7556 most directives. The preprocessor still recognizes and removes
7557 comments, so that you can pass a file preprocessed with -C to the
7558 compiler without problems. In this mode the integrated
7559 preprocessor is little more than a tokenizer for the front ends.
7560
7561 -fpreprocessed is implicit if the input file has one of the
7562 extensions .i, .ii or .mi. These are the extensions that GCC uses
7563 for preprocessed files created by -save-temps.
7564
7565 -ftabstop=width
7566 Set the distance between tab stops. This helps the preprocessor
7567 report correct column numbers in warnings or errors, even if tabs
7568 appear on the line. If the value is less than 1 or greater than
7569 100, the option is ignored. The default is 8.
7570
7571 -fexec-charset=charset
7572 Set the execution character set, used for string and character
7573 constants. The default is UTF-8. charset can be any encoding
7574 supported by the system's "iconv" library routine.
7575
7576 -fwide-exec-charset=charset
7577 Set the wide execution character set, used for wide string and
7578 character constants. The default is UTF-32 or UTF-16, whichever
7579 corresponds to the width of "wchar_t". As with -fexec-charset,
7580 charset can be any encoding supported by the system's "iconv"
7581 library routine; however, you will have problems with encodings
7582 that do not fit exactly in "wchar_t".
7583
7584 -finput-charset=charset
7585 Set the input character set, used for translation from the
7586 character set of the input file to the source character set used by
7587 GCC. If the locale does not specify, or GCC cannot get this
7588 information from the locale, the default is UTF-8. This can be
7589 overridden by either the locale or this command line option.
7590 Currently the command line option takes precedence if there's a
7591 conflict. charset can be any encoding supported by the system's
7592 "iconv" library routine.
7593
7594 -fworking-directory
7595 Enable generation of linemarkers in the preprocessor output that
7596 will let the compiler know the current working directory at the
7597 time of preprocessing. When this option is enabled, the
7598 preprocessor will emit, after the initial linemarker, a second
7599 linemarker with the current working directory followed by two
7600 slashes. GCC will use this directory, when it's present in the
7601 preprocessed input, as the directory emitted as the current working
7602 directory in some debugging information formats. This option is
7603 implicitly enabled if debugging information is enabled, but this
7604 can be inhibited with the negated form -fno-working-directory. If
7605 the -P flag is present in the command line, this option has no
7606 effect, since no "#line" directives are emitted whatsoever.
7607
7608 -fno-show-column
7609 Do not print column numbers in diagnostics. This may be necessary
7610 if diagnostics are being scanned by a program that does not
7611 understand the column numbers, such as dejagnu.
7612
7613 -A predicate=answer
7614 Make an assertion with the predicate predicate and answer answer.
7615 This form is preferred to the older form -A predicate(answer),
7616 which is still supported, because it does not use shell special
7617 characters.
7618
7619 -A -predicate=answer
7620 Cancel an assertion with the predicate predicate and answer answer.
7621
7622 -dCHARS
7623 CHARS is a sequence of one or more of the following characters, and
7624 must not be preceded by a space. Other characters are interpreted
7625 by the compiler proper, or reserved for future versions of GCC, and
7626 so are silently ignored. If you specify characters whose behavior
7627 conflicts, the result is undefined.
7628
7629 M Instead of the normal output, generate a list of #define
7630 directives for all the macros defined during the execution of
7631 the preprocessor, including predefined macros. This gives you
7632 a way of finding out what is predefined in your version of the
7633 preprocessor. Assuming you have no file foo.h, the command
7634
7635 touch foo.h; cpp -dM foo.h
7636
7637 will show all the predefined macros.
7638
7639 If you use -dM without the -E option, -dM is interpreted as a
7640 synonym for -fdump-rtl-mach.
7641
7642 D Like M except in two respects: it does not include the
7643 predefined macros, and it outputs both the #define directives
7644 and the result of preprocessing. Both kinds of output go to
7645 the standard output file.
7646
7647 N Like D, but emit only the macro names, not their expansions.
7648
7649 I Output #include directives in addition to the result of
7650 preprocessing.
7651
7652 U Like D except that only macros that are expanded, or whose
7653 definedness is tested in preprocessor directives, are output;
7654 the output is delayed until the use or test of the macro; and
7655 #undef directives are also output for macros tested but
7656 undefined at the time.
7657
7658 -P Inhibit generation of linemarkers in the output from the
7659 preprocessor. This might be useful when running the preprocessor
7660 on something that is not C code, and will be sent to a program
7661 which might be confused by the linemarkers.
7662
7663 -C Do not discard comments. All comments are passed through to the
7664 output file, except for comments in processed directives, which are
7665 deleted along with the directive.
7666
7667 You should be prepared for side effects when using -C; it causes
7668 the preprocessor to treat comments as tokens in their own right.
7669 For example, comments appearing at the start of what would be a
7670 directive line have the effect of turning that line into an
7671 ordinary source line, since the first token on the line is no
7672 longer a #.
7673
7674 -CC Do not discard comments, including during macro expansion. This is
7675 like -C, except that comments contained within macros are also
7676 passed through to the output file where the macro is expanded.
7677
7678 In addition to the side-effects of the -C option, the -CC option
7679 causes all C++-style comments inside a macro to be converted to
7680 C-style comments. This is to prevent later use of that macro from
7681 inadvertently commenting out the remainder of the source line.
7682
7683 The -CC option is generally used to support lint comments.
7684
7685 -traditional-cpp
7686 Try to imitate the behavior of old-fashioned C preprocessors, as
7687 opposed to ISO C preprocessors.
7688
7689 -trigraphs
7690 Process trigraph sequences. These are three-character sequences,
7691 all starting with ??, that are defined by ISO C to stand for single
7692 characters. For example, ??/ stands for \, so '??/n' is a
7693 character constant for a newline. By default, GCC ignores
7694 trigraphs, but in standard-conforming modes it converts them. See
7695 the -std and -ansi options.
7696
7697 The nine trigraphs and their replacements are
7698
7699 Trigraph: ??( ??) ??< ??> ??= ??/ ??' ??! ??-
7700 Replacement: [ ] { } # \ ^ | ~
7701
7702 -remap
7703 Enable special code to work around file systems which only permit
7704 very short file names, such as MS-DOS.
7705
7706 --help
7707 --target-help
7708 Print text describing all the command line options instead of
7709 preprocessing anything.
7710
7711 -v Verbose mode. Print out GNU CPP's version number at the beginning
7712 of execution, and report the final form of the include path.
7713
7714 -H Print the name of each header file used, in addition to other
7715 normal activities. Each name is indented to show how deep in the
7716 #include stack it is. Precompiled header files are also printed,
7717 even if they are found to be invalid; an invalid precompiled header
7718 file is printed with ...x and a valid one with ...! .
7719
7720 -version
7721 --version
7722 Print out GNU CPP's version number. With one dash, proceed to
7723 preprocess as normal. With two dashes, exit immediately.
7724
7725 Passing Options to the Assembler
7726 You can pass options to the assembler.
7727
7728 -Wa,option
7729 Pass option as an option to the assembler. If option contains
7730 commas, it is split into multiple options at the commas.
7731
7732 -Xassembler option
7733 Pass option as an option to the assembler. You can use this to
7734 supply system-specific assembler options which GCC does not know
7735 how to recognize.
7736
7737 If you want to pass an option that takes an argument, you must use
7738 -Xassembler twice, once for the option and once for the argument.
7739
7740 Options for Linking
7741 These options come into play when the compiler links object files into
7742 an executable output file. They are meaningless if the compiler is not
7743 doing a link step.
7744
7745 object-file-name
7746 A file name that does not end in a special recognized suffix is
7747 considered to name an object file or library. (Object files are
7748 distinguished from libraries by the linker according to the file
7749 contents.) If linking is done, these object files are used as
7750 input to the linker.
7751
7752 -c
7753 -S
7754 -E If any of these options is used, then the linker is not run, and
7755 object file names should not be used as arguments.
7756
7757 -llibrary
7758 -l library
7759 Search the library named library when linking. (The second
7760 alternative with the library as a separate argument is only for
7761 POSIX compliance and is not recommended.)
7762
7763 It makes a difference where in the command you write this option;
7764 the linker searches and processes libraries and object files in the
7765 order they are specified. Thus, foo.o -lz bar.o searches library z
7766 after file foo.o but before bar.o. If bar.o refers to functions in
7767 z, those functions may not be loaded.
7768
7769 The linker searches a standard list of directories for the library,
7770 which is actually a file named liblibrary.a. The linker then uses
7771 this file as if it had been specified precisely by name.
7772
7773 The directories searched include several standard system
7774 directories plus any that you specify with -L.
7775
7776 Normally the files found this way are library files---archive files
7777 whose members are object files. The linker handles an archive file
7778 by scanning through it for members which define symbols that have
7779 so far been referenced but not defined. But if the file that is
7780 found is an ordinary object file, it is linked in the usual
7781 fashion. The only difference between using an -l option and
7782 specifying a file name is that -l surrounds library with lib and .a
7783 and searches several directories.
7784
7785 -lobjc
7786 You need this special case of the -l option in order to link an
7787 Objective-C or Objective-C++ program.
7788
7789 -nostartfiles
7790 Do not use the standard system startup files when linking. The
7791 standard system libraries are used normally, unless -nostdlib or
7792 -nodefaultlibs is used.
7793
7794 -nodefaultlibs
7795 Do not use the standard system libraries when linking. Only the
7796 libraries you specify will be passed to the linker, options
7797 specifying linkage of the system libraries, such as
7798 "-static-libgcc" or "-shared-libgcc", will be ignored. The
7799 standard startup files are used normally, unless -nostartfiles is
7800 used. The compiler may generate calls to "memcmp", "memset",
7801 "memcpy" and "memmove". These entries are usually resolved by
7802 entries in libc. These entry points should be supplied through
7803 some other mechanism when this option is specified.
7804
7805 -nostdlib
7806 Do not use the standard system startup files or libraries when
7807 linking. No startup files and only the libraries you specify will
7808 be passed to the linker, options specifying linkage of the system
7809 libraries, such as "-static-libgcc" or "-shared-libgcc", will be
7810 ignored. The compiler may generate calls to "memcmp", "memset",
7811 "memcpy" and "memmove". These entries are usually resolved by
7812 entries in libc. These entry points should be supplied through
7813 some other mechanism when this option is specified.
7814
7815 One of the standard libraries bypassed by -nostdlib and
7816 -nodefaultlibs is libgcc.a, a library of internal subroutines that
7817 GCC uses to overcome shortcomings of particular machines, or
7818 special needs for some languages.
7819
7820 In most cases, you need libgcc.a even when you want to avoid other
7821 standard libraries. In other words, when you specify -nostdlib or
7822 -nodefaultlibs you should usually specify -lgcc as well. This
7823 ensures that you have no unresolved references to internal GCC
7824 library subroutines. (For example, __main, used to ensure C++
7825 constructors will be called.)
7826
7827 -pie
7828 Produce a position independent executable on targets which support
7829 it. For predictable results, you must also specify the same set of
7830 options that were used to generate code (-fpie, -fPIE, or model
7831 suboptions) when you specify this option.
7832
7833 -rdynamic
7834 Pass the flag -export-dynamic to the ELF linker, on targets that
7835 support it. This instructs the linker to add all symbols, not only
7836 used ones, to the dynamic symbol table. This option is needed for
7837 some uses of "dlopen" or to allow obtaining backtraces from within
7838 a program.
7839
7840 -s Remove all symbol table and relocation information from the
7841 executable.
7842
7843 -static
7844 On systems that support dynamic linking, this prevents linking with
7845 the shared libraries. On other systems, this option has no effect.
7846
7847 -shared
7848 Produce a shared object which can then be linked with other objects
7849 to form an executable. Not all systems support this option. For
7850 predictable results, you must also specify the same set of options
7851 that were used to generate code (-fpic, -fPIC, or model suboptions)
7852 when you specify this option.[1]
7853
7854 -shared-libgcc
7855 -static-libgcc
7856 On systems that provide libgcc as a shared library, these options
7857 force the use of either the shared or static version respectively.
7858 If no shared version of libgcc was built when the compiler was
7859 configured, these options have no effect.
7860
7861 There are several situations in which an application should use the
7862 shared libgcc instead of the static version. The most common of
7863 these is when the application wishes to throw and catch exceptions
7864 across different shared libraries. In that case, each of the
7865 libraries as well as the application itself should use the shared
7866 libgcc.
7867
7868 Therefore, the G++ and GCJ drivers automatically add -shared-libgcc
7869 whenever you build a shared library or a main executable, because
7870 C++ and Java programs typically use exceptions, so this is the
7871 right thing to do.
7872
7873 If, instead, you use the GCC driver to create shared libraries, you
7874 may find that they will not always be linked with the shared
7875 libgcc. If GCC finds, at its configuration time, that you have a
7876 non-GNU linker or a GNU linker that does not support option
7877 --eh-frame-hdr, it will link the shared version of libgcc into
7878 shared libraries by default. Otherwise, it will take advantage of
7879 the linker and optimize away the linking with the shared version of
7880 libgcc, linking with the static version of libgcc by default. This
7881 allows exceptions to propagate through such shared libraries,
7882 without incurring relocation costs at library load time.
7883
7884 However, if a library or main executable is supposed to throw or
7885 catch exceptions, you must link it using the G++ or GCJ driver, as
7886 appropriate for the languages used in the program, or using the
7887 option -shared-libgcc, such that it is linked with the shared
7888 libgcc.
7889
7890 -static-libstdc++
7891 When the g++ program is used to link a C++ program, it will
7892 normally automatically link against libstdc++. If libstdc++ is
7893 available as a shared library, and the -static option is not used,
7894 then this will link against the shared version of libstdc++. That
7895 is normally fine. However, it is sometimes useful to freeze the
7896 version of libstdc++ used by the program without going all the way
7897 to a fully static link. The -static-libstdc++ option directs the
7898 g++ driver to link libstdc++ statically, without necessarily
7899 linking other libraries statically.
7900
7901 -symbolic
7902 Bind references to global symbols when building a shared object.
7903 Warn about any unresolved references (unless overridden by the link
7904 editor option -Xlinker -z -Xlinker defs). Only a few systems
7905 support this option.
7906
7907 -T script
7908 Use script as the linker script. This option is supported by most
7909 systems using the GNU linker. On some targets, such as bare-board
7910 targets without an operating system, the -T option may be required
7911 when linking to avoid references to undefined symbols.
7912
7913 -Xlinker option
7914 Pass option as an option to the linker. You can use this to supply
7915 system-specific linker options which GCC does not know how to
7916 recognize.
7917
7918 If you want to pass an option that takes a separate argument, you
7919 must use -Xlinker twice, once for the option and once for the
7920 argument. For example, to pass -assert definitions, you must write
7921 -Xlinker -assert -Xlinker definitions. It does not work to write
7922 -Xlinker "-assert definitions", because this passes the entire
7923 string as a single argument, which is not what the linker expects.
7924
7925 When using the GNU linker, it is usually more convenient to pass
7926 arguments to linker options using the option=value syntax than as
7927 separate arguments. For example, you can specify -Xlinker
7928 -Map=output.map rather than -Xlinker -Map -Xlinker output.map.
7929 Other linkers may not support this syntax for command-line options.
7930
7931 -Wl,option
7932 Pass option as an option to the linker. If option contains commas,
7933 it is split into multiple options at the commas. You can use this
7934 syntax to pass an argument to the option. For example,
7935 -Wl,-Map,output.map passes -Map output.map to the linker. When
7936 using the GNU linker, you can also get the same effect with
7937 -Wl,-Map=output.map.
7938
7939 -u symbol
7940 Pretend the symbol symbol is undefined, to force linking of library
7941 modules to define it. You can use -u multiple times with different
7942 symbols to force loading of additional library modules.
7943
7944 Options for Directory Search
7945 These options specify directories to search for header files, for
7946 libraries and for parts of the compiler:
7947
7948 -Idir
7949 Add the directory dir to the head of the list of directories to be
7950 searched for header files. This can be used to override a system
7951 header file, substituting your own version, since these directories
7952 are searched before the system header file directories. However,
7953 you should not use this option to add directories that contain
7954 vendor-supplied system header files (use -isystem for that). If
7955 you use more than one -I option, the directories are scanned in
7956 left-to-right order; the standard system directories come after.
7957
7958 If a standard system include directory, or a directory specified
7959 with -isystem, is also specified with -I, the -I option will be
7960 ignored. The directory will still be searched but as a system
7961 directory at its normal position in the system include chain. This
7962 is to ensure that GCC's procedure to fix buggy system headers and
7963 the ordering for the include_next directive are not inadvertently
7964 changed. If you really need to change the search order for system
7965 directories, use the -nostdinc and/or -isystem options.
7966
7967 -iquotedir
7968 Add the directory dir to the head of the list of directories to be
7969 searched for header files only for the case of #include "file";
7970 they are not searched for #include <file>, otherwise just like -I.
7971
7972 -Ldir
7973 Add directory dir to the list of directories to be searched for -l.
7974
7975 -Bprefix
7976 This option specifies where to find the executables, libraries,
7977 include files, and data files of the compiler itself.
7978
7979 The compiler driver program runs one or more of the subprograms
7980 cpp, cc1, as and ld. It tries prefix as a prefix for each program
7981 it tries to run, both with and without machine/version/.
7982
7983 For each subprogram to be run, the compiler driver first tries the
7984 -B prefix, if any. If that name is not found, or if -B was not
7985 specified, the driver tries two standard prefixes, which are
7986 /usr/lib/gcc/ and /usr/local/lib/gcc/. If neither of those results
7987 in a file name that is found, the unmodified program name is
7988 searched for using the directories specified in your PATH
7989 environment variable.
7990
7991 The compiler will check to see if the path provided by the -B
7992 refers to a directory, and if necessary it will add a directory
7993 separator character at the end of the path.
7994
7995 -B prefixes that effectively specify directory names also apply to
7996 libraries in the linker, because the compiler translates these
7997 options into -L options for the linker. They also apply to
7998 includes files in the preprocessor, because the compiler translates
7999 these options into -isystem options for the preprocessor. In this
8000 case, the compiler appends include to the prefix.
8001
8002 The run-time support file libgcc.a can also be searched for using
8003 the -B prefix, if needed. If it is not found there, the two
8004 standard prefixes above are tried, and that is all. The file is
8005 left out of the link if it is not found by those means.
8006
8007 Another way to specify a prefix much like the -B prefix is to use
8008 the environment variable GCC_EXEC_PREFIX.
8009
8010 As a special kludge, if the path provided by -B is [dir/]stageN/,
8011 where N is a number in the range 0 to 9, then it will be replaced
8012 by [dir/]include. This is to help with boot-strapping the
8013 compiler.
8014
8015 -specs=file
8016 Process file after the compiler reads in the standard specs file,
8017 in order to override the defaults that the gcc driver program uses
8018 when determining what switches to pass to cc1, cc1plus, as, ld,
8019 etc. More than one -specs=file can be specified on the command
8020 line, and they are processed in order, from left to right.
8021
8022 --sysroot=dir
8023 Use dir as the logical root directory for headers and libraries.
8024 For example, if the compiler would normally search for headers in
8025 /usr/include and libraries in /usr/lib, it will instead search
8026 dir/usr/include and dir/usr/lib.
8027
8028 If you use both this option and the -isysroot option, then the
8029 --sysroot option will apply to libraries, but the -isysroot option
8030 will apply to header files.
8031
8032 The GNU linker (beginning with version 2.16) has the necessary
8033 support for this option. If your linker does not support this
8034 option, the header file aspect of --sysroot will still work, but
8035 the library aspect will not.
8036
8037 -I- This option has been deprecated. Please use -iquote instead for -I
8038 directories before the -I- and remove the -I-. Any directories you
8039 specify with -I options before the -I- option are searched only for
8040 the case of #include "file"; they are not searched for #include
8041 <file>.
8042
8043 If additional directories are specified with -I options after the
8044 -I-, these directories are searched for all #include directives.
8045 (Ordinarily all -I directories are used this way.)
8046
8047 In addition, the -I- option inhibits the use of the current
8048 directory (where the current input file came from) as the first
8049 search directory for #include "file". There is no way to override
8050 this effect of -I-. With -I. you can specify searching the
8051 directory which was current when the compiler was invoked. That is
8052 not exactly the same as what the preprocessor does by default, but
8053 it is often satisfactory.
8054
8055 -I- does not inhibit the use of the standard system directories for
8056 header files. Thus, -I- and -nostdinc are independent.
8057
8058 Specifying Target Machine and Compiler Version
8059 The usual way to run GCC is to run the executable called gcc, or
8060 <machine>-gcc when cross-compiling, or <machine>-gcc-<version> to run a
8061 version other than the one that was installed last. Sometimes this is
8062 inconvenient, so GCC provides options that will switch to another
8063 cross-compiler or version.
8064
8065 -b machine
8066 The argument machine specifies the target machine for compilation.
8067
8068 The value to use for machine is the same as was specified as the
8069 machine type when configuring GCC as a cross-compiler. For
8070 example, if a cross-compiler was configured with configure arm-elf,
8071 meaning to compile for an arm processor with elf binaries, then you
8072 would specify -b arm-elf to run that cross compiler. Because there
8073 are other options beginning with -b, the configuration must contain
8074 a hyphen, or -b alone should be one argument followed by the
8075 configuration in the next argument.
8076
8077 -V version
8078 The argument version specifies which version of GCC to run. This
8079 is useful when multiple versions are installed. For example,
8080 version might be 4.0, meaning to run GCC version 4.0.
8081
8082 The -V and -b options work by running the <machine>-gcc-<version>
8083 executable, so there's no real reason to use them if you can just run
8084 that directly.
8085
8086 Hardware Models and Configurations
8087 Earlier we discussed the standard option -b which chooses among
8088 different installed compilers for completely different target machines,
8089 such as VAX vs. 68000 vs. 80386.
8090
8091 In addition, each of these target machine types can have its own
8092 special options, starting with -m, to choose among various hardware
8093 models or configurations---for example, 68010 vs 68020, floating
8094 coprocessor or none. A single installed version of the compiler can
8095 compile for any model or configuration, according to the options
8096 specified.
8097
8098 Some configurations of the compiler also support additional special
8099 options, usually for compatibility with other compilers on the same
8100 platform.
8101
8102 ARC Options
8103 These options are defined for ARC implementations:
8104
8105 -EL Compile code for little endian mode. This is the default.
8106
8107 -EB Compile code for big endian mode.
8108
8109 -mmangle-cpu
8110 Prepend the name of the cpu to all public symbol names. In
8111 multiple-processor systems, there are many ARC variants with
8112 different instruction and register set characteristics. This flag
8113 prevents code compiled for one cpu to be linked with code compiled
8114 for another. No facility exists for handling variants that are
8115 "almost identical". This is an all or nothing option.
8116
8117 -mcpu=cpu
8118 Compile code for ARC variant cpu. Which variants are supported
8119 depend on the configuration. All variants support -mcpu=base, this
8120 is the default.
8121
8122 -mtext=text-section
8123 -mdata=data-section
8124 -mrodata=readonly-data-section
8125 Put functions, data, and readonly data in text-section, data-
8126 section, and readonly-data-section respectively by default. This
8127 can be overridden with the "section" attribute.
8128
8129 -mfix-cortex-m3-ldrd
8130 Some Cortex-M3 cores can cause data corruption when "ldrd"
8131 instructions with overlapping destination and base registers are
8132 used. This option avoids generating these instructions. This
8133 option is enabled by default when -mcpu=cortex-m3 is specified.
8134
8135 ARM Options
8136 These -m options are defined for Advanced RISC Machines (ARM)
8137 architectures:
8138
8139 -mabi=name
8140 Generate code for the specified ABI. Permissible values are: apcs-
8141 gnu, atpcs, aapcs, aapcs-linux and iwmmxt.
8142
8143 -mapcs-frame
8144 Generate a stack frame that is compliant with the ARM Procedure
8145 Call Standard for all functions, even if this is not strictly
8146 necessary for correct execution of the code. Specifying
8147 -fomit-frame-pointer with this option will cause the stack frames
8148 not to be generated for leaf functions. The default is
8149 -mno-apcs-frame.
8150
8151 -mapcs
8152 This is a synonym for -mapcs-frame.
8153
8154 -mthumb-interwork
8155 Generate code which supports calling between the ARM and Thumb
8156 instruction sets. Without this option the two instruction sets
8157 cannot be reliably used inside one program. The default is
8158 -mno-thumb-interwork, since slightly larger code is generated when
8159 -mthumb-interwork is specified.
8160
8161 -mno-sched-prolog
8162 Prevent the reordering of instructions in the function prolog, or
8163 the merging of those instruction with the instructions in the
8164 function's body. This means that all functions will start with a
8165 recognizable set of instructions (or in fact one of a choice from a
8166 small set of different function prologues), and this information
8167 can be used to locate the start if functions inside an executable
8168 piece of code. The default is -msched-prolog.
8169
8170 -mfloat-abi=name
8171 Specifies which floating-point ABI to use. Permissible values are:
8172 soft, softfp and hard.
8173
8174 Specifying soft causes GCC to generate output containing library
8175 calls for floating-point operations. softfp allows the generation
8176 of code using hardware floating-point instructions, but still uses
8177 the soft-float calling conventions. hard allows generation of
8178 floating-point instructions and uses FPU-specific calling
8179 conventions.
8180
8181 The default depends on the specific target configuration. Note
8182 that the hard-float and soft-float ABIs are not link-compatible;
8183 you must compile your entire program with the same ABI, and link
8184 with a compatible set of libraries.
8185
8186 -mhard-float
8187 Equivalent to -mfloat-abi=hard.
8188
8189 -msoft-float
8190 Equivalent to -mfloat-abi=soft.
8191
8192 -mlittle-endian
8193 Generate code for a processor running in little-endian mode. This
8194 is the default for all standard configurations.
8195
8196 -mbig-endian
8197 Generate code for a processor running in big-endian mode; the
8198 default is to compile code for a little-endian processor.
8199
8200 -mwords-little-endian
8201 This option only applies when generating code for big-endian
8202 processors. Generate code for a little-endian word order but a
8203 big-endian byte order. That is, a byte order of the form 32107654.
8204 Note: this option should only be used if you require compatibility
8205 with code for big-endian ARM processors generated by versions of
8206 the compiler prior to 2.8.
8207
8208 -mcpu=name
8209 This specifies the name of the target ARM processor. GCC uses this
8210 name to determine what kind of instructions it can emit when
8211 generating assembly code. Permissible names are: arm2, arm250,
8212 arm3, arm6, arm60, arm600, arm610, arm620, arm7, arm7m, arm7d,
8213 arm7dm, arm7di, arm7dmi, arm70, arm700, arm700i, arm710, arm710c,
8214 arm7100, arm720, arm7500, arm7500fe, arm7tdmi, arm7tdmi-s, arm710t,
8215 arm720t, arm740t, strongarm, strongarm110, strongarm1100,
8216 strongarm1110, arm8, arm810, arm9, arm9e, arm920, arm920t, arm922t,
8217 arm946e-s, arm966e-s, arm968e-s, arm926ej-s, arm940t, arm9tdmi,
8218 arm10tdmi, arm1020t, arm1026ej-s, arm10e, arm1020e, arm1022e,
8219 arm1136j-s, arm1136jf-s, mpcore, mpcorenovfp, arm1156t2-s,
8220 arm1156t2f-s, arm1176jz-s, arm1176jzf-s, cortex-a5, cortex-a8,
8221 cortex-a9, cortex-r4, cortex-r4f, cortex-m3, cortex-m1, cortex-m0,
8222 xscale, iwmmxt, iwmmxt2, ep9312.
8223
8224 -mtune=name
8225 This option is very similar to the -mcpu= option, except that
8226 instead of specifying the actual target processor type, and hence
8227 restricting which instructions can be used, it specifies that GCC
8228 should tune the performance of the code as if the target were of
8229 the type specified in this option, but still choosing the
8230 instructions that it will generate based on the cpu specified by a
8231 -mcpu= option. For some ARM implementations better performance can
8232 be obtained by using this option.
8233
8234 -march=name
8235 This specifies the name of the target ARM architecture. GCC uses
8236 this name to determine what kind of instructions it can emit when
8237 generating assembly code. This option can be used in conjunction
8238 with or instead of the -mcpu= option. Permissible names are:
8239 armv2, armv2a, armv3, armv3m, armv4, armv4t, armv5, armv5t, armv5e,
8240 armv5te, armv6, armv6j, armv6t2, armv6z, armv6zk, armv6-m, armv7,
8241 armv7-a, armv7-r, armv7-m, iwmmxt, iwmmxt2, ep9312.
8242
8243 -mfpu=name
8244 -mfpe=number
8245 -mfp=number
8246 This specifies what floating point hardware (or hardware emulation)
8247 is available on the target. Permissible names are: fpa, fpe2,
8248 fpe3, maverick, vfp, vfpv3, vfpv3-fp16, vfpv3-d16, vfpv3-d16-fp16,
8249 vfpv3xd, vfpv3xd-fp16, neon, neon-fp16, vfpv4, vfpv4-d16,
8250 fpv4-sp-d16 and neon-vfpv4. -mfp and -mfpe are synonyms for
8251 -mfpu=fpenumber, for compatibility with older versions of GCC.
8252
8253 If -msoft-float is specified this specifies the format of floating
8254 point values.
8255
8256 -mfp16-format=name
8257 Specify the format of the "__fp16" half-precision floating-point
8258 type. Permissible names are none, ieee, and alternative; the
8259 default is none, in which case the "__fp16" type is not defined.
8260
8261 -mstructure-size-boundary=n
8262 The size of all structures and unions will be rounded up to a
8263 multiple of the number of bits set by this option. Permissible
8264 values are 8, 32 and 64. The default value varies for different
8265 toolchains. For the COFF targeted toolchain the default value is
8266 8. A value of 64 is only allowed if the underlying ABI supports
8267 it.
8268
8269 Specifying the larger number can produce faster, more efficient
8270 code, but can also increase the size of the program. Different
8271 values are potentially incompatible. Code compiled with one value
8272 cannot necessarily expect to work with code or libraries compiled
8273 with another value, if they exchange information using structures
8274 or unions.
8275
8276 -mabort-on-noreturn
8277 Generate a call to the function "abort" at the end of a "noreturn"
8278 function. It will be executed if the function tries to return.
8279
8280 -mlong-calls
8281 -mno-long-calls
8282 Tells the compiler to perform function calls by first loading the
8283 address of the function into a register and then performing a
8284 subroutine call on this register. This switch is needed if the
8285 target function will lie outside of the 64 megabyte addressing
8286 range of the offset based version of subroutine call instruction.
8287
8288 Even if this switch is enabled, not all function calls will be
8289 turned into long calls. The heuristic is that static functions,
8290 functions which have the short-call attribute, functions that are
8291 inside the scope of a #pragma no_long_calls directive and functions
8292 whose definitions have already been compiled within the current
8293 compilation unit, will not be turned into long calls. The
8294 exception to this rule is that weak function definitions, functions
8295 with the long-call attribute or the section attribute, and
8296 functions that are within the scope of a #pragma long_calls
8297 directive, will always be turned into long calls.
8298
8299 This feature is not enabled by default. Specifying -mno-long-calls
8300 will restore the default behavior, as will placing the function
8301 calls within the scope of a #pragma long_calls_off directive. Note
8302 these switches have no effect on how the compiler generates code to
8303 handle function calls via function pointers.
8304
8305 -msingle-pic-base
8306 Treat the register used for PIC addressing as read-only, rather
8307 than loading it in the prologue for each function. The run-time
8308 system is responsible for initializing this register with an
8309 appropriate value before execution begins.
8310
8311 -mpic-register=reg
8312 Specify the register to be used for PIC addressing. The default is
8313 R10 unless stack-checking is enabled, when R9 is used.
8314
8315 -mcirrus-fix-invalid-insns
8316 Insert NOPs into the instruction stream to in order to work around
8317 problems with invalid Maverick instruction combinations. This
8318 option is only valid if the -mcpu=ep9312 option has been used to
8319 enable generation of instructions for the Cirrus Maverick floating
8320 point co-processor. This option is not enabled by default, since
8321 the problem is only present in older Maverick implementations. The
8322 default can be re-enabled by use of the
8323 -mno-cirrus-fix-invalid-insns switch.
8324
8325 -mpoke-function-name
8326 Write the name of each function into the text section, directly
8327 preceding the function prologue. The generated code is similar to
8328 this:
8329
8330 t0
8331 .ascii "arm_poke_function_name", 0
8332 .align
8333 t1
8334 .word 0xff000000 + (t1 - t0)
8335 arm_poke_function_name
8336 mov ip, sp
8337 stmfd sp!, {fp, ip, lr, pc}
8338 sub fp, ip, #4
8339
8340 When performing a stack backtrace, code can inspect the value of
8341 "pc" stored at "fp + 0". If the trace function then looks at
8342 location "pc - 12" and the top 8 bits are set, then we know that
8343 there is a function name embedded immediately preceding this
8344 location and has length "((pc[-3]) & 0xff000000)".
8345
8346 -mthumb
8347 Generate code for the Thumb instruction set. The default is to use
8348 the 32-bit ARM instruction set. This option automatically enables
8349 either 16-bit Thumb-1 or mixed 16/32-bit Thumb-2 instructions based
8350 on the -mcpu=name and -march=name options. This option is not
8351 passed to the assembler. If you want to force assembler files to be
8352 interpreted as Thumb code, either add a .thumb directive to the
8353 source or pass the -mthumb option directly to the assembler by
8354 prefixing it with -Wa.
8355
8356 -mtpcs-frame
8357 Generate a stack frame that is compliant with the Thumb Procedure
8358 Call Standard for all non-leaf functions. (A leaf function is one
8359 that does not call any other functions.) The default is
8360 -mno-tpcs-frame.
8361
8362 -mtpcs-leaf-frame
8363 Generate a stack frame that is compliant with the Thumb Procedure
8364 Call Standard for all leaf functions. (A leaf function is one that
8365 does not call any other functions.) The default is
8366 -mno-apcs-leaf-frame.
8367
8368 -mcallee-super-interworking
8369 Gives all externally visible functions in the file being compiled
8370 an ARM instruction set header which switches to Thumb mode before
8371 executing the rest of the function. This allows these functions to
8372 be called from non-interworking code. This option is not valid in
8373 AAPCS configurations because interworking is enabled by default.
8374
8375 -mcaller-super-interworking
8376 Allows calls via function pointers (including virtual functions) to
8377 execute correctly regardless of whether the target code has been
8378 compiled for interworking or not. There is a small overhead in the
8379 cost of executing a function pointer if this option is enabled.
8380 This option is not valid in AAPCS configurations because
8381 interworking is enabled by default.
8382
8383 -mtp=name
8384 Specify the access model for the thread local storage pointer. The
8385 valid models are soft, which generates calls to "__aeabi_read_tp",
8386 cp15, which fetches the thread pointer from "cp15" directly
8387 (supported in the arm6k architecture), and auto, which uses the
8388 best available method for the selected processor. The default
8389 setting is auto.
8390
8391 -mword-relocations
8392 Only generate absolute relocations on word sized values (i.e.
8393 R_ARM_ABS32). This is enabled by default on targets (uClinux,
8394 SymbianOS) where the runtime loader imposes this restriction, and
8395 when -fpic or -fPIC is specified.
8396
8397 AVR Options
8398 These options are defined for AVR implementations:
8399
8400 -mmcu=mcu
8401 Specify ATMEL AVR instruction set or MCU type.
8402
8403 Instruction set avr1 is for the minimal AVR core, not supported by
8404 the C compiler, only for assembler programs (MCU types: at90s1200,
8405 attiny10, attiny11, attiny12, attiny15, attiny28).
8406
8407 Instruction set avr2 (default) is for the classic AVR core with up
8408 to 8K program memory space (MCU types: at90s2313, at90s2323,
8409 attiny22, at90s2333, at90s2343, at90s4414, at90s4433, at90s4434,
8410 at90s8515, at90c8534, at90s8535).
8411
8412 Instruction set avr3 is for the classic AVR core with up to 128K
8413 program memory space (MCU types: atmega103, atmega603, at43usb320,
8414 at76c711).
8415
8416 Instruction set avr4 is for the enhanced AVR core with up to 8K
8417 program memory space (MCU types: atmega8, atmega83, atmega85).
8418
8419 Instruction set avr5 is for the enhanced AVR core with up to 128K
8420 program memory space (MCU types: atmega16, atmega161, atmega163,
8421 atmega32, atmega323, atmega64, atmega128, at43usb355, at94k).
8422
8423 -mno-interrupts
8424 Generated code is not compatible with hardware interrupts. Code
8425 size will be smaller.
8426
8427 -mcall-prologues
8428 Functions prologues/epilogues expanded as call to appropriate
8429 subroutines. Code size will be smaller.
8430
8431 -mtiny-stack
8432 Change only the low 8 bits of the stack pointer.
8433
8434 -mint8
8435 Assume int to be 8 bit integer. This affects the sizes of all
8436 types: A char will be 1 byte, an int will be 1 byte, a long will be
8437 2 bytes and long long will be 4 bytes. Please note that this
8438 option does not comply to the C standards, but it will provide you
8439 with smaller code size.
8440
8441 Blackfin Options
8442 -mcpu=cpu[-sirevision]
8443 Specifies the name of the target Blackfin processor. Currently,
8444 cpu can be one of bf512, bf514, bf516, bf518, bf522, bf523, bf524,
8445 bf525, bf526, bf527, bf531, bf532, bf533, bf534, bf536, bf537,
8446 bf538, bf539, bf542, bf544, bf547, bf548, bf549, bf542m, bf544m,
8447 bf547m, bf548m, bf549m, bf561. The optional sirevision specifies
8448 the silicon revision of the target Blackfin processor. Any
8449 workarounds available for the targeted silicon revision will be
8450 enabled. If sirevision is none, no workarounds are enabled. If
8451 sirevision is any, all workarounds for the targeted processor will
8452 be enabled. The "__SILICON_REVISION__" macro is defined to two
8453 hexadecimal digits representing the major and minor numbers in the
8454 silicon revision. If sirevision is none, the
8455 "__SILICON_REVISION__" is not defined. If sirevision is any, the
8456 "__SILICON_REVISION__" is defined to be 0xffff. If this optional
8457 sirevision is not used, GCC assumes the latest known silicon
8458 revision of the targeted Blackfin processor.
8459
8460 Support for bf561 is incomplete. For bf561, Only the processor
8461 macro is defined. Without this option, bf532 is used as the
8462 processor by default. The corresponding predefined processor
8463 macros for cpu is to be defined. And for bfin-elf toolchain, this
8464 causes the hardware BSP provided by libgloss to be linked in if
8465 -msim is not given.
8466
8467 -msim
8468 Specifies that the program will be run on the simulator. This
8469 causes the simulator BSP provided by libgloss to be linked in.
8470 This option has effect only for bfin-elf toolchain. Certain other
8471 options, such as -mid-shared-library and -mfdpic, imply -msim.
8472
8473 -momit-leaf-frame-pointer
8474 Don't keep the frame pointer in a register for leaf functions.
8475 This avoids the instructions to save, set up and restore frame
8476 pointers and makes an extra register available in leaf functions.
8477 The option -fomit-frame-pointer removes the frame pointer for all
8478 functions which might make debugging harder.
8479
8480 -mspecld-anomaly
8481 When enabled, the compiler will ensure that the generated code does
8482 not contain speculative loads after jump instructions. If this
8483 option is used, "__WORKAROUND_SPECULATIVE_LOADS" is defined.
8484
8485 -mno-specld-anomaly
8486 Don't generate extra code to prevent speculative loads from
8487 occurring.
8488
8489 -mcsync-anomaly
8490 When enabled, the compiler will ensure that the generated code does
8491 not contain CSYNC or SSYNC instructions too soon after conditional
8492 branches. If this option is used, "__WORKAROUND_SPECULATIVE_SYNCS"
8493 is defined.
8494
8495 -mno-csync-anomaly
8496 Don't generate extra code to prevent CSYNC or SSYNC instructions
8497 from occurring too soon after a conditional branch.
8498
8499 -mlow-64k
8500 When enabled, the compiler is free to take advantage of the
8501 knowledge that the entire program fits into the low 64k of memory.
8502
8503 -mno-low-64k
8504 Assume that the program is arbitrarily large. This is the default.
8505
8506 -mstack-check-l1
8507 Do stack checking using information placed into L1 scratchpad
8508 memory by the uClinux kernel.
8509
8510 -mid-shared-library
8511 Generate code that supports shared libraries via the library ID
8512 method. This allows for execute in place and shared libraries in
8513 an environment without virtual memory management. This option
8514 implies -fPIC. With a bfin-elf target, this option implies -msim.
8515
8516 -mno-id-shared-library
8517 Generate code that doesn't assume ID based shared libraries are
8518 being used. This is the default.
8519
8520 -mleaf-id-shared-library
8521 Generate code that supports shared libraries via the library ID
8522 method, but assumes that this library or executable won't link
8523 against any other ID shared libraries. That allows the compiler to
8524 use faster code for jumps and calls.
8525
8526 -mno-leaf-id-shared-library
8527 Do not assume that the code being compiled won't link against any
8528 ID shared libraries. Slower code will be generated for jump and
8529 call insns.
8530
8531 -mshared-library-id=n
8532 Specified the identification number of the ID based shared library
8533 being compiled. Specifying a value of 0 will generate more compact
8534 code, specifying other values will force the allocation of that
8535 number to the current library but is no more space or time
8536 efficient than omitting this option.
8537
8538 -msep-data
8539 Generate code that allows the data segment to be located in a
8540 different area of memory from the text segment. This allows for
8541 execute in place in an environment without virtual memory
8542 management by eliminating relocations against the text section.
8543
8544 -mno-sep-data
8545 Generate code that assumes that the data segment follows the text
8546 segment. This is the default.
8547
8548 -mlong-calls
8549 -mno-long-calls
8550 Tells the compiler to perform function calls by first loading the
8551 address of the function into a register and then performing a
8552 subroutine call on this register. This switch is needed if the
8553 target function will lie outside of the 24 bit addressing range of
8554 the offset based version of subroutine call instruction.
8555
8556 This feature is not enabled by default. Specifying -mno-long-calls
8557 will restore the default behavior. Note these switches have no
8558 effect on how the compiler generates code to handle function calls
8559 via function pointers.
8560
8561 -mfast-fp
8562 Link with the fast floating-point library. This library relaxes
8563 some of the IEEE floating-point standard's rules for checking
8564 inputs against Not-a-Number (NAN), in the interest of performance.
8565
8566 -minline-plt
8567 Enable inlining of PLT entries in function calls to functions that
8568 are not known to bind locally. It has no effect without -mfdpic.
8569
8570 -mmulticore
8571 Build standalone application for multicore Blackfin processor.
8572 Proper start files and link scripts will be used to support
8573 multicore. This option defines "__BFIN_MULTICORE". It can only be
8574 used with -mcpu=bf561[-sirevision]. It can be used with -mcorea or
8575 -mcoreb. If it's used without -mcorea or -mcoreb, single
8576 application/dual core programming model is used. In this model, the
8577 main function of Core B should be named as coreb_main. If it's used
8578 with -mcorea or -mcoreb, one application per core programming model
8579 is used. If this option is not used, single core application
8580 programming model is used.
8581
8582 -mcorea
8583 Build standalone application for Core A of BF561 when using one
8584 application per core programming model. Proper start files and link
8585 scripts will be used to support Core A. This option defines
8586 "__BFIN_COREA". It must be used with -mmulticore.
8587
8588 -mcoreb
8589 Build standalone application for Core B of BF561 when using one
8590 application per core programming model. Proper start files and link
8591 scripts will be used to support Core B. This option defines
8592 "__BFIN_COREB". When this option is used, coreb_main should be used
8593 instead of main. It must be used with -mmulticore.
8594
8595 -msdram
8596 Build standalone application for SDRAM. Proper start files and link
8597 scripts will be used to put the application into SDRAM. Loader
8598 should initialize SDRAM before loading the application into SDRAM.
8599 This option defines "__BFIN_SDRAM".
8600
8601 -micplb
8602 Assume that ICPLBs are enabled at runtime. This has an effect on
8603 certain anomaly workarounds. For Linux targets, the default is to
8604 assume ICPLBs are enabled; for standalone applications the default
8605 is off.
8606
8607 CRIS Options
8608 These options are defined specifically for the CRIS ports.
8609
8610 -march=architecture-type
8611 -mcpu=architecture-type
8612 Generate code for the specified architecture. The choices for
8613 architecture-type are v3, v8 and v10 for respectively ETRAX 4,
8614 ETRAX 100, and ETRAX 100 LX. Default is v0 except for cris-axis-
8615 linux-gnu, where the default is v10.
8616
8617 -mtune=architecture-type
8618 Tune to architecture-type everything applicable about the generated
8619 code, except for the ABI and the set of available instructions.
8620 The choices for architecture-type are the same as for
8621 -march=architecture-type.
8622
8623 -mmax-stack-frame=n
8624 Warn when the stack frame of a function exceeds n bytes.
8625
8626 -metrax4
8627 -metrax100
8628 The options -metrax4 and -metrax100 are synonyms for -march=v3 and
8629 -march=v8 respectively.
8630
8631 -mmul-bug-workaround
8632 -mno-mul-bug-workaround
8633 Work around a bug in the "muls" and "mulu" instructions for CPU
8634 models where it applies. This option is active by default.
8635
8636 -mpdebug
8637 Enable CRIS-specific verbose debug-related information in the
8638 assembly code. This option also has the effect to turn off the
8639 #NO_APP formatted-code indicator to the assembler at the beginning
8640 of the assembly file.
8641
8642 -mcc-init
8643 Do not use condition-code results from previous instruction; always
8644 emit compare and test instructions before use of condition codes.
8645
8646 -mno-side-effects
8647 Do not emit instructions with side-effects in addressing modes
8648 other than post-increment.
8649
8650 -mstack-align
8651 -mno-stack-align
8652 -mdata-align
8653 -mno-data-align
8654 -mconst-align
8655 -mno-const-align
8656 These options (no-options) arranges (eliminate arrangements) for
8657 the stack-frame, individual data and constants to be aligned for
8658 the maximum single data access size for the chosen CPU model. The
8659 default is to arrange for 32-bit alignment. ABI details such as
8660 structure layout are not affected by these options.
8661
8662 -m32-bit
8663 -m16-bit
8664 -m8-bit
8665 Similar to the stack- data- and const-align options above, these
8666 options arrange for stack-frame, writable data and constants to all
8667 be 32-bit, 16-bit or 8-bit aligned. The default is 32-bit
8668 alignment.
8669
8670 -mno-prologue-epilogue
8671 -mprologue-epilogue
8672 With -mno-prologue-epilogue, the normal function prologue and
8673 epilogue that sets up the stack-frame are omitted and no return
8674 instructions or return sequences are generated in the code. Use
8675 this option only together with visual inspection of the compiled
8676 code: no warnings or errors are generated when call-saved registers
8677 must be saved, or storage for local variable needs to be allocated.
8678
8679 -mno-gotplt
8680 -mgotplt
8681 With -fpic and -fPIC, don't generate (do generate) instruction
8682 sequences that load addresses for functions from the PLT part of
8683 the GOT rather than (traditional on other architectures) calls to
8684 the PLT. The default is -mgotplt.
8685
8686 -melf
8687 Legacy no-op option only recognized with the cris-axis-elf and
8688 cris-axis-linux-gnu targets.
8689
8690 -mlinux
8691 Legacy no-op option only recognized with the cris-axis-linux-gnu
8692 target.
8693
8694 -sim
8695 This option, recognized for the cris-axis-elf arranges to link with
8696 input-output functions from a simulator library. Code, initialized
8697 data and zero-initialized data are allocated consecutively.
8698
8699 -sim2
8700 Like -sim, but pass linker options to locate initialized data at
8701 0x40000000 and zero-initialized data at 0x80000000.
8702
8703 CRX Options
8704 These options are defined specifically for the CRX ports.
8705
8706 -mmac
8707 Enable the use of multiply-accumulate instructions. Disabled by
8708 default.
8709
8710 -mpush-args
8711 Push instructions will be used to pass outgoing arguments when
8712 functions are called. Enabled by default.
8713
8714 Darwin Options
8715 These options are defined for all architectures running the Darwin
8716 operating system.
8717
8718 FSF GCC on Darwin does not create "fat" object files; it will create an
8719 object file for the single architecture that it was built to target.
8720 Apple's GCC on Darwin does create "fat" files if multiple -arch options
8721 are used; it does so by running the compiler or linker multiple times
8722 and joining the results together with lipo.
8723
8724 The subtype of the file created (like ppc7400 or ppc970 or i686) is
8725 determined by the flags that specify the ISA that GCC is targetting,
8726 like -mcpu or -march. The -force_cpusubtype_ALL option can be used to
8727 override this.
8728
8729 The Darwin tools vary in their behavior when presented with an ISA
8730 mismatch. The assembler, as, will only permit instructions to be used
8731 that are valid for the subtype of the file it is generating, so you
8732 cannot put 64-bit instructions in a ppc750 object file. The linker for
8733 shared libraries, /usr/bin/libtool, will fail and print an error if
8734 asked to create a shared library with a less restrictive subtype than
8735 its input files (for instance, trying to put a ppc970 object file in a
8736 ppc7400 library). The linker for executables, ld, will quietly give
8737 the executable the most restrictive subtype of any of its input files.
8738
8739 -Fdir
8740 Add the framework directory dir to the head of the list of
8741 directories to be searched for header files. These directories are
8742 interleaved with those specified by -I options and are scanned in a
8743 left-to-right order.
8744
8745 A framework directory is a directory with frameworks in it. A
8746 framework is a directory with a "Headers" and/or "PrivateHeaders"
8747 directory contained directly in it that ends in ".framework". The
8748 name of a framework is the name of this directory excluding the
8749 ".framework". Headers associated with the framework are found in
8750 one of those two directories, with "Headers" being searched first.
8751 A subframework is a framework directory that is in a framework's
8752 "Frameworks" directory. Includes of subframework headers can only
8753 appear in a header of a framework that contains the subframework,
8754 or in a sibling subframework header. Two subframeworks are
8755 siblings if they occur in the same framework. A subframework
8756 should not have the same name as a framework, a warning will be
8757 issued if this is violated. Currently a subframework cannot have
8758 subframeworks, in the future, the mechanism may be extended to
8759 support this. The standard frameworks can be found in
8760 "/System/Library/Frameworks" and "/Library/Frameworks". An example
8761 include looks like "#include <Framework/header.h>", where Framework
8762 denotes the name of the framework and header.h is found in the
8763 "PrivateHeaders" or "Headers" directory.
8764
8765 -iframeworkdir
8766 Like -F except the directory is a treated as a system directory.
8767 The main difference between this -iframework and -F is that with
8768 -iframework the compiler does not warn about constructs contained
8769 within header files found via dir. This option is valid only for
8770 the C family of languages.
8771
8772 -gused
8773 Emit debugging information for symbols that are used. For STABS
8774 debugging format, this enables -feliminate-unused-debug-symbols.
8775 This is by default ON.
8776
8777 -gfull
8778 Emit debugging information for all symbols and types.
8779
8780 -mmacosx-version-min=version
8781 The earliest version of MacOS X that this executable will run on is
8782 version. Typical values of version include 10.1, 10.2, and 10.3.9.
8783
8784 If the compiler was built to use the system's headers by default,
8785 then the default for this option is the system version on which the
8786 compiler is running, otherwise the default is to make choices which
8787 are compatible with as many systems and code bases as possible.
8788
8789 -mkernel
8790 Enable kernel development mode. The -mkernel option sets -static,
8791 -fno-common, -fno-cxa-atexit, -fno-exceptions,
8792 -fno-non-call-exceptions, -fapple-kext, -fno-weak and -fno-rtti
8793 where applicable. This mode also sets -mno-altivec, -msoft-float,
8794 -fno-builtin and -mlong-branch for PowerPC targets.
8795
8796 -mone-byte-bool
8797 Override the defaults for bool so that sizeof(bool)==1. By default
8798 sizeof(bool) is 4 when compiling for Darwin/PowerPC and 1 when
8799 compiling for Darwin/x86, so this option has no effect on x86.
8800
8801 Warning: The -mone-byte-bool switch causes GCC to generate code
8802 that is not binary compatible with code generated without that
8803 switch. Using this switch may require recompiling all other
8804 modules in a program, including system libraries. Use this switch
8805 to conform to a non-default data model.
8806
8807 -mfix-and-continue
8808 -ffix-and-continue
8809 -findirect-data
8810 Generate code suitable for fast turn around development. Needed to
8811 enable gdb to dynamically load ".o" files into already running
8812 programs. -findirect-data and -ffix-and-continue are provided for
8813 backwards compatibility.
8814
8815 -all_load
8816 Loads all members of static archive libraries. See man ld(1) for
8817 more information.
8818
8819 -arch_errors_fatal
8820 Cause the errors having to do with files that have the wrong
8821 architecture to be fatal.
8822
8823 -bind_at_load
8824 Causes the output file to be marked such that the dynamic linker
8825 will bind all undefined references when the file is loaded or
8826 launched.
8827
8828 -bundle
8829 Produce a Mach-o bundle format file. See man ld(1) for more
8830 information.
8831
8832 -bundle_loader executable
8833 This option specifies the executable that will be loading the build
8834 output file being linked. See man ld(1) for more information.
8835
8836 -dynamiclib
8837 When passed this option, GCC will produce a dynamic library instead
8838 of an executable when linking, using the Darwin libtool command.
8839
8840 -force_cpusubtype_ALL
8841 This causes GCC's output file to have the ALL subtype, instead of
8842 one controlled by the -mcpu or -march option.
8843
8844 -allowable_client client_name
8845 -client_name
8846 -compatibility_version
8847 -current_version
8848 -dead_strip
8849 -dependency-file
8850 -dylib_file
8851 -dylinker_install_name
8852 -dynamic
8853 -exported_symbols_list
8854 -filelist
8855 -flat_namespace
8856 -force_flat_namespace
8857 -headerpad_max_install_names
8858 -image_base
8859 -init
8860 -install_name
8861 -keep_private_externs
8862 -multi_module
8863 -multiply_defined
8864 -multiply_defined_unused
8865 -noall_load
8866 -no_dead_strip_inits_and_terms
8867 -nofixprebinding
8868 -nomultidefs
8869 -noprebind
8870 -noseglinkedit
8871 -pagezero_size
8872 -prebind
8873 -prebind_all_twolevel_modules
8874 -private_bundle
8875 -read_only_relocs
8876 -sectalign
8877 -sectobjectsymbols
8878 -whyload
8879 -seg1addr
8880 -sectcreate
8881 -sectobjectsymbols
8882 -sectorder
8883 -segaddr
8884 -segs_read_only_addr
8885 -segs_read_write_addr
8886 -seg_addr_table
8887 -seg_addr_table_filename
8888 -seglinkedit
8889 -segprot
8890 -segs_read_only_addr
8891 -segs_read_write_addr
8892 -single_module
8893 -static
8894 -sub_library
8895 -sub_umbrella
8896 -twolevel_namespace
8897 -umbrella
8898 -undefined
8899 -unexported_symbols_list
8900 -weak_reference_mismatches
8901 -whatsloaded
8902 These options are passed to the Darwin linker. The Darwin linker
8903 man page describes them in detail.
8904
8905 DEC Alpha Options
8906 These -m options are defined for the DEC Alpha implementations:
8907
8908 -mno-soft-float
8909 -msoft-float
8910 Use (do not use) the hardware floating-point instructions for
8911 floating-point operations. When -msoft-float is specified,
8912 functions in libgcc.a will be used to perform floating-point
8913 operations. Unless they are replaced by routines that emulate the
8914 floating-point operations, or compiled in such a way as to call
8915 such emulations routines, these routines will issue floating-point
8916 operations. If you are compiling for an Alpha without floating-
8917 point operations, you must ensure that the library is built so as
8918 not to call them.
8919
8920 Note that Alpha implementations without floating-point operations
8921 are required to have floating-point registers.
8922
8923 -mfp-reg
8924 -mno-fp-regs
8925 Generate code that uses (does not use) the floating-point register
8926 set. -mno-fp-regs implies -msoft-float. If the floating-point
8927 register set is not used, floating point operands are passed in
8928 integer registers as if they were integers and floating-point
8929 results are passed in $0 instead of $f0. This is a non-standard
8930 calling sequence, so any function with a floating-point argument or
8931 return value called by code compiled with -mno-fp-regs must also be
8932 compiled with that option.
8933
8934 A typical use of this option is building a kernel that does not
8935 use, and hence need not save and restore, any floating-point
8936 registers.
8937
8938 -mieee
8939 The Alpha architecture implements floating-point hardware optimized
8940 for maximum performance. It is mostly compliant with the IEEE
8941 floating point standard. However, for full compliance, software
8942 assistance is required. This option generates code fully IEEE
8943 compliant code except that the inexact-flag is not maintained (see
8944 below). If this option is turned on, the preprocessor macro
8945 "_IEEE_FP" is defined during compilation. The resulting code is
8946 less efficient but is able to correctly support denormalized
8947 numbers and exceptional IEEE values such as not-a-number and
8948 plus/minus infinity. Other Alpha compilers call this option
8949 -ieee_with_no_inexact.
8950
8951 -mieee-with-inexact
8952 This is like -mieee except the generated code also maintains the
8953 IEEE inexact-flag. Turning on this option causes the generated
8954 code to implement fully-compliant IEEE math. In addition to
8955 "_IEEE_FP", "_IEEE_FP_EXACT" is defined as a preprocessor macro.
8956 On some Alpha implementations the resulting code may execute
8957 significantly slower than the code generated by default. Since
8958 there is very little code that depends on the inexact-flag, you
8959 should normally not specify this option. Other Alpha compilers
8960 call this option -ieee_with_inexact.
8961
8962 -mfp-trap-mode=trap-mode
8963 This option controls what floating-point related traps are enabled.
8964 Other Alpha compilers call this option -fptm trap-mode. The trap
8965 mode can be set to one of four values:
8966
8967 n This is the default (normal) setting. The only traps that are
8968 enabled are the ones that cannot be disabled in software (e.g.,
8969 division by zero trap).
8970
8971 u In addition to the traps enabled by n, underflow traps are
8972 enabled as well.
8973
8974 su Like u, but the instructions are marked to be safe for software
8975 completion (see Alpha architecture manual for details).
8976
8977 sui Like su, but inexact traps are enabled as well.
8978
8979 -mfp-rounding-mode=rounding-mode
8980 Selects the IEEE rounding mode. Other Alpha compilers call this
8981 option -fprm rounding-mode. The rounding-mode can be one of:
8982
8983 n Normal IEEE rounding mode. Floating point numbers are rounded
8984 towards the nearest machine number or towards the even machine
8985 number in case of a tie.
8986
8987 m Round towards minus infinity.
8988
8989 c Chopped rounding mode. Floating point numbers are rounded
8990 towards zero.
8991
8992 d Dynamic rounding mode. A field in the floating point control
8993 register (fpcr, see Alpha architecture reference manual)
8994 controls the rounding mode in effect. The C library
8995 initializes this register for rounding towards plus infinity.
8996 Thus, unless your program modifies the fpcr, d corresponds to
8997 round towards plus infinity.
8998
8999 -mtrap-precision=trap-precision
9000 In the Alpha architecture, floating point traps are imprecise.
9001 This means without software assistance it is impossible to recover
9002 from a floating trap and program execution normally needs to be
9003 terminated. GCC can generate code that can assist operating system
9004 trap handlers in determining the exact location that caused a
9005 floating point trap. Depending on the requirements of an
9006 application, different levels of precisions can be selected:
9007
9008 p Program precision. This option is the default and means a trap
9009 handler can only identify which program caused a floating point
9010 exception.
9011
9012 f Function precision. The trap handler can determine the
9013 function that caused a floating point exception.
9014
9015 i Instruction precision. The trap handler can determine the
9016 exact instruction that caused a floating point exception.
9017
9018 Other Alpha compilers provide the equivalent options called
9019 -scope_safe and -resumption_safe.
9020
9021 -mieee-conformant
9022 This option marks the generated code as IEEE conformant. You must
9023 not use this option unless you also specify -mtrap-precision=i and
9024 either -mfp-trap-mode=su or -mfp-trap-mode=sui. Its only effect is
9025 to emit the line .eflag 48 in the function prologue of the
9026 generated assembly file. Under DEC Unix, this has the effect that
9027 IEEE-conformant math library routines will be linked in.
9028
9029 -mbuild-constants
9030 Normally GCC examines a 32- or 64-bit integer constant to see if it
9031 can construct it from smaller constants in two or three
9032 instructions. If it cannot, it will output the constant as a
9033 literal and generate code to load it from the data segment at
9034 runtime.
9035
9036 Use this option to require GCC to construct all integer constants
9037 using code, even if it takes more instructions (the maximum is
9038 six).
9039
9040 You would typically use this option to build a shared library
9041 dynamic loader. Itself a shared library, it must relocate itself
9042 in memory before it can find the variables and constants in its own
9043 data segment.
9044
9045 -malpha-as
9046 -mgas
9047 Select whether to generate code to be assembled by the vendor-
9048 supplied assembler (-malpha-as) or by the GNU assembler -mgas.
9049
9050 -mbwx
9051 -mno-bwx
9052 -mcix
9053 -mno-cix
9054 -mfix
9055 -mno-fix
9056 -mmax
9057 -mno-max
9058 Indicate whether GCC should generate code to use the optional BWX,
9059 CIX, FIX and MAX instruction sets. The default is to use the
9060 instruction sets supported by the CPU type specified via -mcpu=
9061 option or that of the CPU on which GCC was built if none was
9062 specified.
9063
9064 -mfloat-vax
9065 -mfloat-ieee
9066 Generate code that uses (does not use) VAX F and G floating point
9067 arithmetic instead of IEEE single and double precision.
9068
9069 -mexplicit-relocs
9070 -mno-explicit-relocs
9071 Older Alpha assemblers provided no way to generate symbol
9072 relocations except via assembler macros. Use of these macros does
9073 not allow optimal instruction scheduling. GNU binutils as of
9074 version 2.12 supports a new syntax that allows the compiler to
9075 explicitly mark which relocations should apply to which
9076 instructions. This option is mostly useful for debugging, as GCC
9077 detects the capabilities of the assembler when it is built and sets
9078 the default accordingly.
9079
9080 -msmall-data
9081 -mlarge-data
9082 When -mexplicit-relocs is in effect, static data is accessed via
9083 gp-relative relocations. When -msmall-data is used, objects 8
9084 bytes long or smaller are placed in a small data area (the ".sdata"
9085 and ".sbss" sections) and are accessed via 16-bit relocations off
9086 of the $gp register. This limits the size of the small data area
9087 to 64KB, but allows the variables to be directly accessed via a
9088 single instruction.
9089
9090 The default is -mlarge-data. With this option the data area is
9091 limited to just below 2GB. Programs that require more than 2GB of
9092 data must use "malloc" or "mmap" to allocate the data in the heap
9093 instead of in the program's data segment.
9094
9095 When generating code for shared libraries, -fpic implies
9096 -msmall-data and -fPIC implies -mlarge-data.
9097
9098 -msmall-text
9099 -mlarge-text
9100 When -msmall-text is used, the compiler assumes that the code of
9101 the entire program (or shared library) fits in 4MB, and is thus
9102 reachable with a branch instruction. When -msmall-data is used,
9103 the compiler can assume that all local symbols share the same $gp
9104 value, and thus reduce the number of instructions required for a
9105 function call from 4 to 1.
9106
9107 The default is -mlarge-text.
9108
9109 -mcpu=cpu_type
9110 Set the instruction set and instruction scheduling parameters for
9111 machine type cpu_type. You can specify either the EV style name or
9112 the corresponding chip number. GCC supports scheduling parameters
9113 for the EV4, EV5 and EV6 family of processors and will choose the
9114 default values for the instruction set from the processor you
9115 specify. If you do not specify a processor type, GCC will default
9116 to the processor on which the compiler was built.
9117
9118 Supported values for cpu_type are
9119
9120 ev4
9121 ev45
9122 21064
9123 Schedules as an EV4 and has no instruction set extensions.
9124
9125 ev5
9126 21164
9127 Schedules as an EV5 and has no instruction set extensions.
9128
9129 ev56
9130 21164a
9131 Schedules as an EV5 and supports the BWX extension.
9132
9133 pca56
9134 21164pc
9135 21164PC
9136 Schedules as an EV5 and supports the BWX and MAX extensions.
9137
9138 ev6
9139 21264
9140 Schedules as an EV6 and supports the BWX, FIX, and MAX
9141 extensions.
9142
9143 ev67
9144 21264a
9145 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX
9146 extensions.
9147
9148 Native Linux/GNU toolchains also support the value native, which
9149 selects the best architecture option for the host processor.
9150 -mcpu=native has no effect if GCC does not recognize the processor.
9151
9152 -mtune=cpu_type
9153 Set only the instruction scheduling parameters for machine type
9154 cpu_type. The instruction set is not changed.
9155
9156 Native Linux/GNU toolchains also support the value native, which
9157 selects the best architecture option for the host processor.
9158 -mtune=native has no effect if GCC does not recognize the
9159 processor.
9160
9161 -mmemory-latency=time
9162 Sets the latency the scheduler should assume for typical memory
9163 references as seen by the application. This number is highly
9164 dependent on the memory access patterns used by the application and
9165 the size of the external cache on the machine.
9166
9167 Valid options for time are
9168
9169 number
9170 A decimal number representing clock cycles.
9171
9172 L1
9173 L2
9174 L3
9175 main
9176 The compiler contains estimates of the number of clock cycles
9177 for "typical" EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9178 (also called Dcache, Scache, and Bcache), as well as to main
9179 memory. Note that L3 is only valid for EV5.
9180
9181 DEC Alpha/VMS Options
9182 These -m options are defined for the DEC Alpha/VMS implementations:
9183
9184 -mvms-return-codes
9185 Return VMS condition codes from main. The default is to return
9186 POSIX style condition (e.g. error) codes.
9187
9188 -mdebug-main=prefix
9189 Flag the first routine whose name starts with prefix as the main
9190 routine for the debugger.
9191
9192 -mmalloc64
9193 Default to 64bit memory allocation routines.
9194
9195 FR30 Options
9196 These options are defined specifically for the FR30 port.
9197
9198 -msmall-model
9199 Use the small address space model. This can produce smaller code,
9200 but it does assume that all symbolic values and addresses will fit
9201 into a 20-bit range.
9202
9203 -mno-lsim
9204 Assume that run-time support has been provided and so there is no
9205 need to include the simulator library (libsim.a) on the linker
9206 command line.
9207
9208 FRV Options
9209 -mgpr-32
9210 Only use the first 32 general purpose registers.
9211
9212 -mgpr-64
9213 Use all 64 general purpose registers.
9214
9215 -mfpr-32
9216 Use only the first 32 floating point registers.
9217
9218 -mfpr-64
9219 Use all 64 floating point registers
9220
9221 -mhard-float
9222 Use hardware instructions for floating point operations.
9223
9224 -msoft-float
9225 Use library routines for floating point operations.
9226
9227 -malloc-cc
9228 Dynamically allocate condition code registers.
9229
9230 -mfixed-cc
9231 Do not try to dynamically allocate condition code registers, only
9232 use "icc0" and "fcc0".
9233
9234 -mdword
9235 Change ABI to use double word insns.
9236
9237 -mno-dword
9238 Do not use double word instructions.
9239
9240 -mdouble
9241 Use floating point double instructions.
9242
9243 -mno-double
9244 Do not use floating point double instructions.
9245
9246 -mmedia
9247 Use media instructions.
9248
9249 -mno-media
9250 Do not use media instructions.
9251
9252 -mmuladd
9253 Use multiply and add/subtract instructions.
9254
9255 -mno-muladd
9256 Do not use multiply and add/subtract instructions.
9257
9258 -mfdpic
9259 Select the FDPIC ABI, that uses function descriptors to represent
9260 pointers to functions. Without any PIC/PIE-related options, it
9261 implies -fPIE. With -fpic or -fpie, it assumes GOT entries and
9262 small data are within a 12-bit range from the GOT base address;
9263 with -fPIC or -fPIE, GOT offsets are computed with 32 bits. With a
9264 bfin-elf target, this option implies -msim.
9265
9266 -minline-plt
9267 Enable inlining of PLT entries in function calls to functions that
9268 are not known to bind locally. It has no effect without -mfdpic.
9269 It's enabled by default if optimizing for speed and compiling for
9270 shared libraries (i.e., -fPIC or -fpic), or when an optimization
9271 option such as -O3 or above is present in the command line.
9272
9273 -mTLS
9274 Assume a large TLS segment when generating thread-local code.
9275
9276 -mtls
9277 Do not assume a large TLS segment when generating thread-local
9278 code.
9279
9280 -mgprel-ro
9281 Enable the use of "GPREL" relocations in the FDPIC ABI for data
9282 that is known to be in read-only sections. It's enabled by
9283 default, except for -fpic or -fpie: even though it may help make
9284 the global offset table smaller, it trades 1 instruction for 4.
9285 With -fPIC or -fPIE, it trades 3 instructions for 4, one of which
9286 may be shared by multiple symbols, and it avoids the need for a GOT
9287 entry for the referenced symbol, so it's more likely to be a win.
9288 If it is not, -mno-gprel-ro can be used to disable it.
9289
9290 -multilib-library-pic
9291 Link with the (library, not FD) pic libraries. It's implied by
9292 -mlibrary-pic, as well as by -fPIC and -fpic without -mfdpic. You
9293 should never have to use it explicitly.
9294
9295 -mlinked-fp
9296 Follow the EABI requirement of always creating a frame pointer
9297 whenever a stack frame is allocated. This option is enabled by
9298 default and can be disabled with -mno-linked-fp.
9299
9300 -mlong-calls
9301 Use indirect addressing to call functions outside the current
9302 compilation unit. This allows the functions to be placed anywhere
9303 within the 32-bit address space.
9304
9305 -malign-labels
9306 Try to align labels to an 8-byte boundary by inserting nops into
9307 the previous packet. This option only has an effect when VLIW
9308 packing is enabled. It doesn't create new packets; it merely adds
9309 nops to existing ones.
9310
9311 -mlibrary-pic
9312 Generate position-independent EABI code.
9313
9314 -macc-4
9315 Use only the first four media accumulator registers.
9316
9317 -macc-8
9318 Use all eight media accumulator registers.
9319
9320 -mpack
9321 Pack VLIW instructions.
9322
9323 -mno-pack
9324 Do not pack VLIW instructions.
9325
9326 -mno-eflags
9327 Do not mark ABI switches in e_flags.
9328
9329 -mcond-move
9330 Enable the use of conditional-move instructions (default).
9331
9332 This switch is mainly for debugging the compiler and will likely be
9333 removed in a future version.
9334
9335 -mno-cond-move
9336 Disable the use of conditional-move instructions.
9337
9338 This switch is mainly for debugging the compiler and will likely be
9339 removed in a future version.
9340
9341 -mscc
9342 Enable the use of conditional set instructions (default).
9343
9344 This switch is mainly for debugging the compiler and will likely be
9345 removed in a future version.
9346
9347 -mno-scc
9348 Disable the use of conditional set instructions.
9349
9350 This switch is mainly for debugging the compiler and will likely be
9351 removed in a future version.
9352
9353 -mcond-exec
9354 Enable the use of conditional execution (default).
9355
9356 This switch is mainly for debugging the compiler and will likely be
9357 removed in a future version.
9358
9359 -mno-cond-exec
9360 Disable the use of conditional execution.
9361
9362 This switch is mainly for debugging the compiler and will likely be
9363 removed in a future version.
9364
9365 -mvliw-branch
9366 Run a pass to pack branches into VLIW instructions (default).
9367
9368 This switch is mainly for debugging the compiler and will likely be
9369 removed in a future version.
9370
9371 -mno-vliw-branch
9372 Do not run a pass to pack branches into VLIW instructions.
9373
9374 This switch is mainly for debugging the compiler and will likely be
9375 removed in a future version.
9376
9377 -mmulti-cond-exec
9378 Enable optimization of "&&" and "||" in conditional execution
9379 (default).
9380
9381 This switch is mainly for debugging the compiler and will likely be
9382 removed in a future version.
9383
9384 -mno-multi-cond-exec
9385 Disable optimization of "&&" and "||" in conditional execution.
9386
9387 This switch is mainly for debugging the compiler and will likely be
9388 removed in a future version.
9389
9390 -mnested-cond-exec
9391 Enable nested conditional execution optimizations (default).
9392
9393 This switch is mainly for debugging the compiler and will likely be
9394 removed in a future version.
9395
9396 -mno-nested-cond-exec
9397 Disable nested conditional execution optimizations.
9398
9399 This switch is mainly for debugging the compiler and will likely be
9400 removed in a future version.
9401
9402 -moptimize-membar
9403 This switch removes redundant "membar" instructions from the
9404 compiler generated code. It is enabled by default.
9405
9406 -mno-optimize-membar
9407 This switch disables the automatic removal of redundant "membar"
9408 instructions from the generated code.
9409
9410 -mtomcat-stats
9411 Cause gas to print out tomcat statistics.
9412
9413 -mcpu=cpu
9414 Select the processor type for which to generate code. Possible
9415 values are frv, fr550, tomcat, fr500, fr450, fr405, fr400, fr300
9416 and simple.
9417
9418 GNU/Linux Options
9419 These -m options are defined for GNU/Linux targets:
9420
9421 -mglibc
9422 Use the GNU C library instead of uClibc. This is the default
9423 except on *-*-linux-*uclibc* targets.
9424
9425 -muclibc
9426 Use uClibc instead of the GNU C library. This is the default on
9427 *-*-linux-*uclibc* targets.
9428
9429 H8/300 Options
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 These -m options are defined for the HPPA family of computers:
9457
9458 -march=architecture-type
9459 Generate code for the specified architecture. The choices for
9460 architecture-type are 1.0 for PA 1.0, 1.1 for PA 1.1, and 2.0 for
9461 PA 2.0 processors. Refer to /usr/lib/sched.models on an HP-UX
9462 system to determine the proper architecture option for your
9463 machine. Code compiled for lower numbered architectures will run
9464 on higher numbered architectures, but not the other way around.
9465
9466 -mpa-risc-1-0
9467 -mpa-risc-1-1
9468 -mpa-risc-2-0
9469 Synonyms for -march=1.0, -march=1.1, and -march=2.0 respectively.
9470
9471 -mbig-switch
9472 Generate code suitable for big switch tables. Use this option only
9473 if the assembler/linker complain about out of range branches within
9474 a switch table.
9475
9476 -mjump-in-delay
9477 Fill delay slots of function calls with unconditional jump
9478 instructions by modifying the return pointer for the function call
9479 to be the target of the conditional jump.
9480
9481 -mdisable-fpregs
9482 Prevent floating point registers from being used in any manner.
9483 This is necessary for compiling kernels which perform lazy context
9484 switching of floating point registers. If you use this option and
9485 attempt to perform floating point operations, the compiler will
9486 abort.
9487
9488 -mdisable-indexing
9489 Prevent the compiler from using indexing address modes. This
9490 avoids some rather obscure problems when compiling MIG generated
9491 code under MACH.
9492
9493 -mno-space-regs
9494 Generate code that assumes the target has no space registers. This
9495 allows GCC to generate faster indirect calls and use unscaled index
9496 address modes.
9497
9498 Such code is suitable for level 0 PA systems and kernels.
9499
9500 -mfast-indirect-calls
9501 Generate code that assumes calls never cross space boundaries.
9502 This allows GCC to emit code which performs faster indirect calls.
9503
9504 This option will not work in the presence of shared libraries or
9505 nested functions.
9506
9507 -mfixed-range=register-range
9508 Generate code treating the given register range as fixed registers.
9509 A fixed register is one that the register allocator can not use.
9510 This is useful when compiling kernel code. A register range is
9511 specified as two registers separated by a dash. Multiple register
9512 ranges can be specified separated by a comma.
9513
9514 -mlong-load-store
9515 Generate 3-instruction load and store sequences as sometimes
9516 required by the HP-UX 10 linker. This is equivalent to the +k
9517 option to the HP compilers.
9518
9519 -mportable-runtime
9520 Use the portable calling conventions proposed by HP for ELF
9521 systems.
9522
9523 -mgas
9524 Enable the use of assembler directives only GAS understands.
9525
9526 -mschedule=cpu-type
9527 Schedule code according to the constraints for the machine type
9528 cpu-type. The choices for cpu-type are 700 7100, 7100LC, 7200,
9529 7300 and 8000. Refer to /usr/lib/sched.models on an HP-UX system
9530 to determine the proper scheduling option for your machine. The
9531 default scheduling is 8000.
9532
9533 -mlinker-opt
9534 Enable the optimization pass in the HP-UX linker. Note this makes
9535 symbolic debugging impossible. It also triggers a bug in the HP-UX
9536 8 and HP-UX 9 linkers in which they give bogus error messages when
9537 linking some programs.
9538
9539 -msoft-float
9540 Generate output containing library calls for floating point.
9541 Warning: the requisite libraries are not available for all HPPA
9542 targets. Normally the facilities of the machine's usual C compiler
9543 are used, but this cannot be done directly in cross-compilation.
9544 You must make your own arrangements to provide suitable library
9545 functions for cross-compilation.
9546
9547 -msoft-float changes the calling convention in the output file;
9548 therefore, it is only useful if you compile all of a program with
9549 this option. In particular, you need to compile libgcc.a, the
9550 library that comes with GCC, with -msoft-float in order for this to
9551 work.
9552
9553 -msio
9554 Generate the predefine, "_SIO", for server IO. The default is
9555 -mwsio. This generates the predefines, "__hp9000s700",
9556 "__hp9000s700__" and "_WSIO", for workstation IO. These options
9557 are available under HP-UX and HI-UX.
9558
9559 -mgnu-ld
9560 Use GNU ld specific options. This passes -shared to ld when
9561 building a shared library. It is the default when GCC is
9562 configured, explicitly or implicitly, with the GNU linker. This
9563 option does not have any affect on which ld is called, it only
9564 changes what parameters are passed to that ld. The ld that is
9565 called is determined by the --with-ld configure option, GCC's
9566 program search path, and finally by the user's PATH. The linker
9567 used by GCC can be printed using which `gcc -print-prog-name=ld`.
9568 This option is only available on the 64 bit HP-UX GCC, i.e.
9569 configured with hppa*64*-*-hpux*.
9570
9571 -mhp-ld
9572 Use HP ld specific options. This passes -b to ld when building a
9573 shared library and passes +Accept TypeMismatch to ld on all links.
9574 It is the default when GCC is configured, explicitly or implicitly,
9575 with the HP linker. This option does not have any affect on which
9576 ld is called, it only changes what parameters are passed to that
9577 ld. The ld that is called is determined by the --with-ld configure
9578 option, GCC's program search path, and finally by the user's PATH.
9579 The linker used by GCC can be printed using which `gcc
9580 -print-prog-name=ld`. This option is only available on the 64 bit
9581 HP-UX GCC, i.e. configured with hppa*64*-*-hpux*.
9582
9583 -mlong-calls
9584 Generate code that uses long call sequences. This ensures that a
9585 call is always able to reach linker generated stubs. The default
9586 is to generate long calls only when the distance from the call site
9587 to the beginning of the function or translation unit, as the case
9588 may be, exceeds a predefined limit set by the branch type being
9589 used. The limits for normal calls are 7,600,000 and 240,000 bytes,
9590 respectively for the PA 2.0 and PA 1.X architectures. Sibcalls are
9591 always limited at 240,000 bytes.
9592
9593 Distances are measured from the beginning of functions when using
9594 the -ffunction-sections option, or when using the -mgas and
9595 -mno-portable-runtime options together under HP-UX with the SOM
9596 linker.
9597
9598 It is normally not desirable to use this option as it will degrade
9599 performance. However, it may be useful in large applications,
9600 particularly when partial linking is used to build the application.
9601
9602 The types of long calls used depends on the capabilities of the
9603 assembler and linker, and the type of code being generated. The
9604 impact on systems that support long absolute calls, and long pic
9605 symbol-difference or pc-relative calls should be relatively small.
9606 However, an indirect call is used on 32-bit ELF systems in pic code
9607 and it is quite long.
9608
9609 -munix=unix-std
9610 Generate compiler predefines and select a startfile for the
9611 specified UNIX standard. The choices for unix-std are 93, 95 and
9612 98. 93 is supported on all HP-UX versions. 95 is available on HP-
9613 UX 10.10 and later. 98 is available on HP-UX 11.11 and later. The
9614 default values are 93 for HP-UX 10.00, 95 for HP-UX 10.10 though to
9615 11.00, and 98 for HP-UX 11.11 and later.
9616
9617 -munix=93 provides the same predefines as GCC 3.3 and 3.4.
9618 -munix=95 provides additional predefines for "XOPEN_UNIX" and
9619 "_XOPEN_SOURCE_EXTENDED", and the startfile unix95.o. -munix=98
9620 provides additional predefines for "_XOPEN_UNIX",
9621 "_XOPEN_SOURCE_EXTENDED", "_INCLUDE__STDC_A1_SOURCE" and
9622 "_INCLUDE_XOPEN_SOURCE_500", and the startfile unix98.o.
9623
9624 It is important to note that this option changes the interfaces for
9625 various library routines. It also affects the operational behavior
9626 of the C library. Thus, extreme care is needed in using this
9627 option.
9628
9629 Library code that is intended to operate with more than one UNIX
9630 standard must test, set and restore the variable
9631 __xpg4_extended_mask as appropriate. Most GNU software doesn't
9632 provide this capability.
9633
9634 -nolibdld
9635 Suppress the generation of link options to search libdld.sl when
9636 the -static option is specified on HP-UX 10 and later.
9637
9638 -static
9639 The HP-UX implementation of setlocale in libc has a dependency on
9640 libdld.sl. There isn't an archive version of libdld.sl. Thus,
9641 when the -static option is specified, special link options are
9642 needed to resolve this dependency.
9643
9644 On HP-UX 10 and later, the GCC driver adds the necessary options to
9645 link with libdld.sl when the -static option is specified. This
9646 causes the resulting binary to be dynamic. On the 64-bit port, the
9647 linkers generate dynamic binaries by default in any case. The
9648 -nolibdld option can be used to prevent the GCC driver from adding
9649 these link options.
9650
9651 -threads
9652 Add support for multithreading with the dce thread library under
9653 HP-UX. This option sets flags for both the preprocessor and
9654 linker.
9655
9656 Intel 386 and AMD x86-64 Options
9657 These -m options are defined for the i386 and x86-64 family of
9658 computers:
9659
9660 -mtune=cpu-type
9661 Tune to cpu-type everything applicable about the generated code,
9662 except for the ABI and the set of available instructions. The
9663 choices for cpu-type are:
9664
9665 generic
9666 Produce code optimized for the most common IA32/AMD64/EM64T
9667 processors. If you know the CPU on which your code will run,
9668 then you should use the corresponding -mtune option instead of
9669 -mtune=generic. But, if you do not know exactly what CPU users
9670 of your application will have, then you should use this option.
9671
9672 As new processors are deployed in the marketplace, the behavior
9673 of this option will change. Therefore, if you upgrade to a
9674 newer version of GCC, the code generated option will change to
9675 reflect the processors that were most common when that version
9676 of GCC was released.
9677
9678 There is no -march=generic option because -march indicates the
9679 instruction set the compiler can use, and there is no generic
9680 instruction set applicable to all processors. In contrast,
9681 -mtune indicates the processor (or, in this case, collection of
9682 processors) for which the code is optimized.
9683
9684 native
9685 This selects the CPU to tune for at compilation time by
9686 determining the processor type of the compiling machine. Using
9687 -mtune=native will produce code optimized for the local machine
9688 under the constraints of the selected instruction set. Using
9689 -march=native will enable all instruction subsets supported by
9690 the local machine (hence the result might not run on different
9691 machines).
9692
9693 i386
9694 Original Intel's i386 CPU.
9695
9696 i486
9697 Intel's i486 CPU. (No scheduling is implemented for this
9698 chip.)
9699
9700 i586, pentium
9701 Intel Pentium CPU with no MMX support.
9702
9703 pentium-mmx
9704 Intel PentiumMMX CPU based on Pentium core with MMX instruction
9705 set support.
9706
9707 pentiumpro
9708 Intel PentiumPro CPU.
9709
9710 i686
9711 Same as "generic", but when used as "march" option, PentiumPro
9712 instruction set will be used, so the code will run on all i686
9713 family chips.
9714
9715 pentium2
9716 Intel Pentium2 CPU based on PentiumPro core with MMX
9717 instruction set support.
9718
9719 pentium3, pentium3m
9720 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE
9721 instruction set support.
9722
9723 pentium-m
9724 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2
9725 instruction set support. Used by Centrino notebooks.
9726
9727 pentium4, pentium4m
9728 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set
9729 support.
9730
9731 prescott
9732 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and
9733 SSE3 instruction set support.
9734
9735 nocona
9736 Improved version of Intel Pentium4 CPU with 64-bit extensions,
9737 MMX, SSE, SSE2 and SSE3 instruction set support.
9738
9739 core2
9740 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3
9741 and SSSE3 instruction set support.
9742
9743 atom
9744 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and
9745 SSSE3 instruction set support.
9746
9747 k6 AMD K6 CPU with MMX instruction set support.
9748
9749 k6-2, k6-3
9750 Improved versions of AMD K6 CPU with MMX and 3DNow! instruction
9751 set support.
9752
9753 athlon, athlon-tbird
9754 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow! and SSE
9755 prefetch instructions support.
9756
9757 athlon-4, athlon-xp, athlon-mp
9758 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow! and
9759 full SSE instruction set support.
9760
9761 k8, opteron, athlon64, athlon-fx
9762 AMD K8 core based CPUs with x86-64 instruction set support.
9763 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow! and
9764 64-bit instruction set extensions.)
9765
9766 k8-sse3, opteron-sse3, athlon64-sse3
9767 Improved versions of k8, opteron and athlon64 with SSE3
9768 instruction set support.
9769
9770 amdfam10, barcelona
9771 AMD Family 10h core based CPUs with x86-64 instruction set
9772 support. (This supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!,
9773 enhanced 3DNow!, ABM and 64-bit instruction set extensions.)
9774
9775 winchip-c6
9776 IDT Winchip C6 CPU, dealt in same way as i486 with additional
9777 MMX instruction set support.
9778
9779 winchip2
9780 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX
9781 and 3DNow! instruction set support.
9782
9783 c3 Via C3 CPU with MMX and 3DNow! instruction set support. (No
9784 scheduling is implemented for this chip.)
9785
9786 c3-2
9787 Via C3-2 CPU with MMX and SSE instruction set support. (No
9788 scheduling is implemented for this chip.)
9789
9790 geode
9791 Embedded AMD CPU with MMX and 3DNow! instruction set support.
9792
9793 While picking a specific cpu-type will schedule things
9794 appropriately for that particular chip, the compiler will not
9795 generate any code that does not run on the i386 without the
9796 -march=cpu-type option being used.
9797
9798 -march=cpu-type
9799 Generate instructions for the machine type cpu-type. The choices
9800 for cpu-type are the same as for -mtune. Moreover, specifying
9801 -march=cpu-type implies -mtune=cpu-type.
9802
9803 -mcpu=cpu-type
9804 A deprecated synonym for -mtune.
9805
9806 -mfpmath=unit
9807 Generate floating point arithmetics for selected unit unit. The
9808 choices for unit are:
9809
9810 387 Use the standard 387 floating point coprocessor present
9811 majority of chips and emulated otherwise. Code compiled with
9812 this option will run almost everywhere. The temporary results
9813 are computed in 80bit precision instead of precision specified
9814 by the type resulting in slightly different results compared to
9815 most of other chips. See -ffloat-store for more detailed
9816 description.
9817
9818 This is the default choice for i386 compiler.
9819
9820 sse Use scalar floating point instructions present in the SSE
9821 instruction set. This instruction set is supported by Pentium3
9822 and newer chips, in the AMD line by Athlon-4, Athlon-xp and
9823 Athlon-mp chips. The earlier version of SSE instruction set
9824 supports only single precision arithmetics, thus the double and
9825 extended precision arithmetics is still done using 387. Later
9826 version, present only in Pentium4 and the future AMD x86-64
9827 chips supports double precision arithmetics too.
9828
9829 For the i386 compiler, you need to use -march=cpu-type, -msse
9830 or -msse2 switches to enable SSE extensions and make this
9831 option effective. For the x86-64 compiler, these extensions
9832 are enabled by default.
9833
9834 The resulting code should be considerably faster in the
9835 majority of cases and avoid the numerical instability problems
9836 of 387 code, but may break some existing code that expects
9837 temporaries to be 80bit.
9838
9839 This is the default choice for the x86-64 compiler.
9840
9841 sse,387
9842 sse+387
9843 both
9844 Attempt to utilize both instruction sets at once. This
9845 effectively double the amount of available registers and on
9846 chips with separate execution units for 387 and SSE the
9847 execution resources too. Use this option with care, as it is
9848 still experimental, because the GCC register allocator does not
9849 model separate functional units well resulting in instable
9850 performance.
9851
9852 -masm=dialect
9853 Output asm instructions using selected dialect. Supported choices
9854 are intel or att (the default one). Darwin does not support intel.
9855
9856 -mieee-fp
9857 -mno-ieee-fp
9858 Control whether or not the compiler uses IEEE floating point
9859 comparisons. These handle correctly the case where the result of a
9860 comparison is unordered.
9861
9862 -msoft-float
9863 Generate output containing library calls for floating point.
9864 Warning: the requisite libraries are not part of GCC. Normally the
9865 facilities of the machine's usual C compiler are used, but this
9866 can't be done directly in cross-compilation. You must make your
9867 own arrangements to provide suitable library functions for cross-
9868 compilation.
9869
9870 On machines where a function returns floating point results in the
9871 80387 register stack, some floating point opcodes may be emitted
9872 even if -msoft-float is used.
9873
9874 -mno-fp-ret-in-387
9875 Do not use the FPU registers for return values of functions.
9876
9877 The usual calling convention has functions return values of types
9878 "float" and "double" in an FPU register, even if there is no FPU.
9879 The idea is that the operating system should emulate an FPU.
9880
9881 The option -mno-fp-ret-in-387 causes such values to be returned in
9882 ordinary CPU registers instead.
9883
9884 -mno-fancy-math-387
9885 Some 387 emulators do not support the "sin", "cos" and "sqrt"
9886 instructions for the 387. Specify this option to avoid generating
9887 those instructions. This option is the default on FreeBSD, OpenBSD
9888 and NetBSD. This option is overridden when -march indicates that
9889 the target cpu will always have an FPU and so the instruction will
9890 not need emulation. As of revision 2.6.1, these instructions are
9891 not generated unless you also use the -funsafe-math-optimizations
9892 switch.
9893
9894 -malign-double
9895 -mno-align-double
9896 Control whether GCC aligns "double", "long double", and "long long"
9897 variables on a two word boundary or a one word boundary. Aligning
9898 "double" variables on a two word boundary will produce code that
9899 runs somewhat faster on a Pentium at the expense of more memory.
9900
9901 On x86-64, -malign-double is enabled by default.
9902
9903 Warning: if you use the -malign-double switch, structures
9904 containing the above types will be aligned differently than the
9905 published application binary interface specifications for the 386
9906 and will not be binary compatible with structures in code compiled
9907 without that switch.
9908
9909 -m96bit-long-double
9910 -m128bit-long-double
9911 These switches control the size of "long double" type. The i386
9912 application binary interface specifies the size to be 96 bits, so
9913 -m96bit-long-double is the default in 32 bit mode.
9914
9915 Modern architectures (Pentium and newer) would prefer "long double"
9916 to be aligned to an 8 or 16 byte boundary. In arrays or structures
9917 conforming to the ABI, this would not be possible. So specifying a
9918 -m128bit-long-double will align "long double" to a 16 byte boundary
9919 by padding the "long double" with an additional 32 bit zero.
9920
9921 In the x86-64 compiler, -m128bit-long-double is the default choice
9922 as its ABI specifies that "long double" is to be aligned on 16 byte
9923 boundary.
9924
9925 Notice that neither of these options enable any extra precision
9926 over the x87 standard of 80 bits for a "long double".
9927
9928 Warning: if you override the default value for your target ABI, the
9929 structures and arrays containing "long double" variables will
9930 change their size as well as function calling convention for
9931 function taking "long double" will be modified. Hence they will
9932 not be binary compatible with arrays or structures in code compiled
9933 without that switch.
9934
9935 -mlarge-data-threshold=number
9936 When -mcmodel=medium is specified, the data greater than threshold
9937 are placed in large data section. This value must be the same
9938 across all object linked into the binary and defaults to 65535.
9939
9940 -mrtd
9941 Use a different function-calling convention, in which functions
9942 that take a fixed number of arguments return with the "ret" num
9943 instruction, which pops their arguments while returning. This
9944 saves one instruction in the caller since there is no need to pop
9945 the arguments there.
9946
9947 You can specify that an individual function is called with this
9948 calling sequence with the function attribute stdcall. You can also
9949 override the -mrtd option by using the function attribute cdecl.
9950
9951 Warning: this calling convention is incompatible with the one
9952 normally used on Unix, so you cannot use it if you need to call
9953 libraries compiled with the Unix compiler.
9954
9955 Also, you must provide function prototypes for all functions that
9956 take variable numbers of arguments (including "printf"); otherwise
9957 incorrect code will be generated for calls to those functions.
9958
9959 In addition, seriously incorrect code will result if you call a
9960 function with too many arguments. (Normally, extra arguments are
9961 harmlessly ignored.)
9962
9963 -mregparm=num
9964 Control how many registers are used to pass integer arguments. By
9965 default, no registers are used to pass arguments, and at most 3
9966 registers can be used. You can control this behavior for a
9967 specific function by using the function attribute regparm.
9968
9969 Warning: if you use this switch, and num is nonzero, then you must
9970 build all modules with the same value, including any libraries.
9971 This includes the system libraries and startup modules.
9972
9973 -msseregparm
9974 Use SSE register passing conventions for float and double arguments
9975 and return values. You can control this behavior for a specific
9976 function by using the function attribute sseregparm.
9977
9978 Warning: if you use this switch then you must build all modules
9979 with the same value, including any libraries. This includes the
9980 system libraries and startup modules.
9981
9982 -mpc32
9983 -mpc64
9984 -mpc80
9985 Set 80387 floating-point precision to 32, 64 or 80 bits. When
9986 -mpc32 is specified, the significands of results of floating-point
9987 operations are rounded to 24 bits (single precision); -mpc64 rounds
9988 the significands of results of floating-point operations to 53 bits
9989 (double precision) and -mpc80 rounds the significands of results of
9990 floating-point operations to 64 bits (extended double precision),
9991 which is the default. When this option is used, floating-point
9992 operations in higher precisions are not available to the programmer
9993 without setting the FPU control word explicitly.
9994
9995 Setting the rounding of floating-point operations to less than the
9996 default 80 bits can speed some programs by 2% or more. Note that
9997 some mathematical libraries assume that extended precision (80 bit)
9998 floating-point operations are enabled by default; routines in such
9999 libraries could suffer significant loss of accuracy, typically
10000 through so-called "catastrophic cancellation", when this option is
10001 used to set the precision to less than extended precision.
10002
10003 -mstackrealign
10004 Realign the stack at entry. On the Intel x86, the -mstackrealign
10005 option will generate an alternate prologue and epilogue that
10006 realigns the runtime stack if necessary. This supports mixing
10007 legacy codes that keep a 4-byte aligned stack with modern codes
10008 that keep a 16-byte stack for SSE compatibility. See also the
10009 attribute "force_align_arg_pointer", applicable to individual
10010 functions.
10011
10012 -mpreferred-stack-boundary=num
10013 Attempt to keep the stack boundary aligned to a 2 raised to num
10014 byte boundary. If -mpreferred-stack-boundary is not specified, the
10015 default is 4 (16 bytes or 128 bits).
10016
10017 -mincoming-stack-boundary=num
10018 Assume the incoming stack is aligned to a 2 raised to num byte
10019 boundary. If -mincoming-stack-boundary is not specified, the one
10020 specified by -mpreferred-stack-boundary will be used.
10021
10022 On Pentium and PentiumPro, "double" and "long double" values should
10023 be aligned to an 8 byte boundary (see -malign-double) or suffer
10024 significant run time performance penalties. On Pentium III, the
10025 Streaming SIMD Extension (SSE) data type "__m128" may not work
10026 properly if it is not 16 byte aligned.
10027
10028 To ensure proper alignment of this values on the stack, the stack
10029 boundary must be as aligned as that required by any value stored on
10030 the stack. Further, every function must be generated such that it
10031 keeps the stack aligned. Thus calling a function compiled with a
10032 higher preferred stack boundary from a function compiled with a
10033 lower preferred stack boundary will most likely misalign the stack.
10034 It is recommended that libraries that use callbacks always use the
10035 default setting.
10036
10037 This extra alignment does consume extra stack space, and generally
10038 increases code size. Code that is sensitive to stack space usage,
10039 such as embedded systems and operating system kernels, may want to
10040 reduce the preferred alignment to -mpreferred-stack-boundary=2.
10041
10042 -mmmx
10043 -mno-mmx
10044 -msse
10045 -mno-sse
10046 -msse2
10047 -mno-sse2
10048 -msse3
10049 -mno-sse3
10050 -mssse3
10051 -mno-ssse3
10052 -msse4.1
10053 -mno-sse4.1
10054 -msse4.2
10055 -mno-sse4.2
10056 -msse4
10057 -mno-sse4
10058 -mavx
10059 -mno-avx
10060 -maes
10061 -mno-aes
10062 -mpclmul
10063 -mno-pclmul
10064 -msse4a
10065 -mno-sse4a
10066 -mfma4
10067 -mno-fma4
10068 -mxop
10069 -mno-xop
10070 -mlwp
10071 -mno-lwp
10072 -m3dnow
10073 -mno-3dnow
10074 -mpopcnt
10075 -mno-popcnt
10076 -mabm
10077 -mno-abm
10078 These switches enable or disable the use of instructions in the
10079 MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, FMA4,
10080 XOP, LWP, ABM or 3DNow! extended instruction sets. These
10081 extensions are also available as built-in functions: see X86 Built-
10082 in Functions, for details of the functions enabled and disabled by
10083 these switches.
10084
10085 To have SSE/SSE2 instructions generated automatically from
10086 floating-point code (as opposed to 387 instructions), see
10087 -mfpmath=sse.
10088
10089 GCC depresses SSEx instructions when -mavx is used. Instead, it
10090 generates new AVX instructions or AVX equivalence for all SSEx
10091 instructions when needed.
10092
10093 These options will enable GCC to use these extended instructions in
10094 generated code, even without -mfpmath=sse. Applications which
10095 perform runtime CPU detection must compile separate files for each
10096 supported architecture, using the appropriate flags. In
10097 particular, the file containing the CPU detection code should be
10098 compiled without these options.
10099
10100 -mfused-madd
10101 -mno-fused-madd
10102 Do (don't) generate code that uses the fused multiply/add or
10103 multiply/subtract instructions. The default is to use these
10104 instructions.
10105
10106 -mcld
10107 This option instructs GCC to emit a "cld" instruction in the
10108 prologue of functions that use string instructions. String
10109 instructions depend on the DF flag to select between autoincrement
10110 or autodecrement mode. While the ABI specifies the DF flag to be
10111 cleared on function entry, some operating systems violate this
10112 specification by not clearing the DF flag in their exception
10113 dispatchers. The exception handler can be invoked with the DF flag
10114 set which leads to wrong direction mode, when string instructions
10115 are used. This option can be enabled by default on 32-bit x86
10116 targets by configuring GCC with the --enable-cld configure option.
10117 Generation of "cld" instructions can be suppressed with the
10118 -mno-cld compiler option in this case.
10119
10120 -mcx16
10121 This option will enable GCC to use CMPXCHG16B instruction in
10122 generated code. CMPXCHG16B allows for atomic operations on 128-bit
10123 double quadword (or oword) data types. This is useful for high
10124 resolution counters that could be updated by multiple processors
10125 (or cores). This instruction is generated as part of atomic built-
10126 in functions: see Atomic Builtins for details.
10127
10128 -msahf
10129 This option will enable GCC to use SAHF instruction in generated
10130 64-bit code. Early Intel CPUs with Intel 64 lacked LAHF and SAHF
10131 instructions supported by AMD64 until introduction of Pentium 4 G1
10132 step in December 2005. LAHF and SAHF are load and store
10133 instructions, respectively, for certain status flags. In 64-bit
10134 mode, SAHF instruction is used to optimize "fmod", "drem" or
10135 "remainder" built-in functions: see Other Builtins for details.
10136
10137 -mmovbe
10138 This option will enable GCC to use movbe instruction to implement
10139 "__builtin_bswap32" and "__builtin_bswap64".
10140
10141 -mcrc32
10142 This option will enable built-in functions,
10143 "__builtin_ia32_crc32qi", "__builtin_ia32_crc32hi".
10144 "__builtin_ia32_crc32si" and "__builtin_ia32_crc32di" to generate
10145 the crc32 machine instruction.
10146
10147 -mrecip
10148 This option will enable GCC to use RCPSS and RSQRTSS instructions
10149 (and their vectorized variants RCPPS and RSQRTPS) with an
10150 additional Newton-Raphson step to increase precision instead of
10151 DIVSS and SQRTSS (and their vectorized variants) for single
10152 precision floating point arguments. These instructions are
10153 generated only when -funsafe-math-optimizations is enabled together
10154 with -finite-math-only and -fno-trapping-math. Note that while the
10155 throughput of the sequence is higher than the throughput of the
10156 non-reciprocal instruction, the precision of the sequence can be
10157 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals
10158 0.99999994).
10159
10160 Note that GCC implements 1.0f/sqrtf(x) in terms of RSQRTSS (or
10161 RSQRTPS) already with -ffast-math (or the above option
10162 combination), and doesn't need -mrecip.
10163
10164 -mveclibabi=type
10165 Specifies the ABI type to use for vectorizing intrinsics using an
10166 external library. Supported types are "svml" for the Intel short
10167 vector math library and "acml" for the AMD math core library style
10168 of interfacing. GCC will currently emit calls to "vmldExp2",
10169 "vmldLn2", "vmldLog102", "vmldLog102", "vmldPow2", "vmldTanh2",
10170 "vmldTan2", "vmldAtan2", "vmldAtanh2", "vmldCbrt2", "vmldSinh2",
10171 "vmldSin2", "vmldAsinh2", "vmldAsin2", "vmldCosh2", "vmldCos2",
10172 "vmldAcosh2", "vmldAcos2", "vmlsExp4", "vmlsLn4", "vmlsLog104",
10173 "vmlsLog104", "vmlsPow4", "vmlsTanh4", "vmlsTan4", "vmlsAtan4",
10174 "vmlsAtanh4", "vmlsCbrt4", "vmlsSinh4", "vmlsSin4", "vmlsAsinh4",
10175 "vmlsAsin4", "vmlsCosh4", "vmlsCos4", "vmlsAcosh4" and "vmlsAcos4"
10176 for corresponding function type when -mveclibabi=svml is used and
10177 "__vrd2_sin", "__vrd2_cos", "__vrd2_exp", "__vrd2_log",
10178 "__vrd2_log2", "__vrd2_log10", "__vrs4_sinf", "__vrs4_cosf",
10179 "__vrs4_expf", "__vrs4_logf", "__vrs4_log2f", "__vrs4_log10f" and
10180 "__vrs4_powf" for corresponding function type when -mveclibabi=acml
10181 is used. Both -ftree-vectorize and -funsafe-math-optimizations have
10182 to be enabled. A SVML or ACML ABI compatible library will have to
10183 be specified at link time.
10184
10185 -mabi=name
10186 Generate code for the specified calling convention. Permissible
10187 values are: sysv for the ABI used on GNU/Linux and other systems
10188 and ms for the Microsoft ABI. The default is to use the Microsoft
10189 ABI when targeting Windows. On all other systems, the default is
10190 the SYSV ABI. You can control this behavior for a specific
10191 function by using the function attribute ms_abi/sysv_abi.
10192
10193 -mpush-args
10194 -mno-push-args
10195 Use PUSH operations to store outgoing parameters. This method is
10196 shorter and usually equally fast as method using SUB/MOV operations
10197 and is enabled by default. In some cases disabling it may improve
10198 performance because of improved scheduling and reduced
10199 dependencies.
10200
10201 -maccumulate-outgoing-args
10202 If enabled, the maximum amount of space required for outgoing
10203 arguments will be computed in the function prologue. This is
10204 faster on most modern CPUs because of reduced dependencies,
10205 improved scheduling and reduced stack usage when preferred stack
10206 boundary is not equal to 2. The drawback is a notable increase in
10207 code size. This switch implies -mno-push-args.
10208
10209 -mthreads
10210 Support thread-safe exception handling on Mingw32. Code that
10211 relies on thread-safe exception handling must compile and link all
10212 code with the -mthreads option. When compiling, -mthreads defines
10213 -D_MT; when linking, it links in a special thread helper library
10214 -lmingwthrd which cleans up per thread exception handling data.
10215
10216 -mno-align-stringops
10217 Do not align destination of inlined string operations. This switch
10218 reduces code size and improves performance in case the destination
10219 is already aligned, but GCC doesn't know about it.
10220
10221 -minline-all-stringops
10222 By default GCC inlines string operations only when destination is
10223 known to be aligned at least to 4 byte boundary. This enables more
10224 inlining, increase code size, but may improve performance of code
10225 that depends on fast memcpy, strlen and memset for short lengths.
10226
10227 -minline-stringops-dynamically
10228 For string operation of unknown size, inline runtime checks so for
10229 small blocks inline code is used, while for large blocks library
10230 call is used.
10231
10232 -mstringop-strategy=alg
10233 Overwrite internal decision heuristic about particular algorithm to
10234 inline string operation with. The allowed values are "rep_byte",
10235 "rep_4byte", "rep_8byte" for expanding using i386 "rep" prefix of
10236 specified size, "byte_loop", "loop", "unrolled_loop" for expanding
10237 inline loop, "libcall" for always expanding library call.
10238
10239 -momit-leaf-frame-pointer
10240 Don't keep the frame pointer in a register for leaf functions.
10241 This avoids the instructions to save, set up and restore frame
10242 pointers and makes an extra register available in leaf functions.
10243 The option -fomit-frame-pointer removes the frame pointer for all
10244 functions which might make debugging harder.
10245
10246 -mtls-direct-seg-refs
10247 -mno-tls-direct-seg-refs
10248 Controls whether TLS variables may be accessed with offsets from
10249 the TLS segment register (%gs for 32-bit, %fs for 64-bit), or
10250 whether the thread base pointer must be added. Whether or not this
10251 is legal depends on the operating system, and whether it maps the
10252 segment to cover the entire TLS area.
10253
10254 For systems that use GNU libc, the default is on.
10255
10256 -msse2avx
10257 -mno-sse2avx
10258 Specify that the assembler should encode SSE instructions with VEX
10259 prefix. The option -mavx turns this on by default.
10260
10261 These -m switches are supported in addition to the above on AMD x86-64
10262 processors in 64-bit environments.
10263
10264 -m32
10265 -m64
10266 Generate code for a 32-bit or 64-bit environment. The 32-bit
10267 environment sets int, long and pointer to 32 bits and generates
10268 code that runs on any i386 system. The 64-bit environment sets int
10269 to 32 bits and long and pointer to 64 bits and generates code for
10270 AMD's x86-64 architecture. For darwin only the -m64 option turns
10271 off the -fno-pic and -mdynamic-no-pic options.
10272
10273 -mno-red-zone
10274 Do not use a so called red zone for x86-64 code. The red zone is
10275 mandated by the x86-64 ABI, it is a 128-byte area beyond the
10276 location of the stack pointer that will not be modified by signal
10277 or interrupt handlers and therefore can be used for temporary data
10278 without adjusting the stack pointer. The flag -mno-red-zone
10279 disables this red zone.
10280
10281 -mcmodel=small
10282 Generate code for the small code model: the program and its symbols
10283 must be linked in the lower 2 GB of the address space. Pointers
10284 are 64 bits. Programs can be statically or dynamically linked.
10285 This is the default code model.
10286
10287 -mcmodel=kernel
10288 Generate code for the kernel code model. The kernel runs in the
10289 negative 2 GB of the address space. This model has to be used for
10290 Linux kernel code.
10291
10292 -mcmodel=medium
10293 Generate code for the medium model: The program is linked in the
10294 lower 2 GB of the address space. Small symbols are also placed
10295 there. Symbols with sizes larger than -mlarge-data-threshold are
10296 put into large data or bss sections and can be located above 2GB.
10297 Programs can be statically or dynamically linked.
10298
10299 -mcmodel=large
10300 Generate code for the large model: This model makes no assumptions
10301 about addresses and sizes of sections.
10302
10303 IA-64 Options
10304 These are the -m options defined for the Intel IA-64 architecture.
10305
10306 -mbig-endian
10307 Generate code for a big endian target. This is the default for HP-
10308 UX.
10309
10310 -mlittle-endian
10311 Generate code for a little endian target. This is the default for
10312 AIX5 and GNU/Linux.
10313
10314 -mgnu-as
10315 -mno-gnu-as
10316 Generate (or don't) code for the GNU assembler. This is the
10317 default.
10318
10319 -mgnu-ld
10320 -mno-gnu-ld
10321 Generate (or don't) code for the GNU linker. This is the default.
10322
10323 -mno-pic
10324 Generate code that does not use a global pointer register. The
10325 result is not position independent code, and violates the IA-64
10326 ABI.
10327
10328 -mvolatile-asm-stop
10329 -mno-volatile-asm-stop
10330 Generate (or don't) a stop bit immediately before and after
10331 volatile asm statements.
10332
10333 -mregister-names
10334 -mno-register-names
10335 Generate (or don't) in, loc, and out register names for the stacked
10336 registers. This may make assembler output more readable.
10337
10338 -mno-sdata
10339 -msdata
10340 Disable (or enable) optimizations that use the small data section.
10341 This may be useful for working around optimizer bugs.
10342
10343 -mconstant-gp
10344 Generate code that uses a single constant global pointer value.
10345 This is useful when compiling kernel code.
10346
10347 -mauto-pic
10348 Generate code that is self-relocatable. This implies
10349 -mconstant-gp. This is useful when compiling firmware code.
10350
10351 -minline-float-divide-min-latency
10352 Generate code for inline divides of floating point values using the
10353 minimum latency algorithm.
10354
10355 -minline-float-divide-max-throughput
10356 Generate code for inline divides of floating point values using the
10357 maximum throughput algorithm.
10358
10359 -mno-inline-float-divide
10360 Do not generate inline code for divides of floating point values.
10361
10362 -minline-int-divide-min-latency
10363 Generate code for inline divides of integer values using the
10364 minimum latency algorithm.
10365
10366 -minline-int-divide-max-throughput
10367 Generate code for inline divides of integer values using the
10368 maximum throughput algorithm.
10369
10370 -mno-inline-int-divide
10371 Do not generate inline code for divides of integer values.
10372
10373 -minline-sqrt-min-latency
10374 Generate code for inline square roots using the minimum latency
10375 algorithm.
10376
10377 -minline-sqrt-max-throughput
10378 Generate code for inline square roots using the maximum throughput
10379 algorithm.
10380
10381 -mno-inline-sqrt
10382 Do not generate inline code for sqrt.
10383
10384 -mfused-madd
10385 -mno-fused-madd
10386 Do (don't) generate code that uses the fused multiply/add or
10387 multiply/subtract instructions. The default is to use these
10388 instructions.
10389
10390 -mno-dwarf2-asm
10391 -mdwarf2-asm
10392 Don't (or do) generate assembler code for the DWARF2 line number
10393 debugging info. This may be useful when not using the GNU
10394 assembler.
10395
10396 -mearly-stop-bits
10397 -mno-early-stop-bits
10398 Allow stop bits to be placed earlier than immediately preceding the
10399 instruction that triggered the stop bit. This can improve
10400 instruction scheduling, but does not always do so.
10401
10402 -mfixed-range=register-range
10403 Generate code treating the given register range as fixed registers.
10404 A fixed register is one that the register allocator can not use.
10405 This is useful when compiling kernel code. A register range is
10406 specified as two registers separated by a dash. Multiple register
10407 ranges can be specified separated by a comma.
10408
10409 -mtls-size=tls-size
10410 Specify bit size of immediate TLS offsets. Valid values are 14,
10411 22, and 64.
10412
10413 -mtune=cpu-type
10414 Tune the instruction scheduling for a particular CPU, Valid values
10415 are itanium, itanium1, merced, itanium2, and mckinley.
10416
10417 -milp32
10418 -mlp64
10419 Generate code for a 32-bit or 64-bit environment. The 32-bit
10420 environment sets int, long and pointer to 32 bits. The 64-bit
10421 environment sets int to 32 bits and long and pointer to 64 bits.
10422 These are HP-UX specific flags.
10423
10424 -mno-sched-br-data-spec
10425 -msched-br-data-spec
10426 (Dis/En)able data speculative scheduling before reload. This will
10427 result in generation of the ld.a instructions and the corresponding
10428 check instructions (ld.c / chk.a). The default is 'disable'.
10429
10430 -msched-ar-data-spec
10431 -mno-sched-ar-data-spec
10432 (En/Dis)able data speculative scheduling after reload. This will
10433 result in generation of the ld.a instructions and the corresponding
10434 check instructions (ld.c / chk.a). The default is 'enable'.
10435
10436 -mno-sched-control-spec
10437 -msched-control-spec
10438 (Dis/En)able control speculative scheduling. This feature is
10439 available only during region scheduling (i.e. before reload). This
10440 will result in generation of the ld.s instructions and the
10441 corresponding check instructions chk.s . The default is 'disable'.
10442
10443 -msched-br-in-data-spec
10444 -mno-sched-br-in-data-spec
10445 (En/Dis)able speculative scheduling of the instructions that are
10446 dependent on the data speculative loads before reload. This is
10447 effective only with -msched-br-data-spec enabled. The default is
10448 'enable'.
10449
10450 -msched-ar-in-data-spec
10451 -mno-sched-ar-in-data-spec
10452 (En/Dis)able speculative scheduling of the instructions that are
10453 dependent on the data speculative loads after reload. This is
10454 effective only with -msched-ar-data-spec enabled. The default is
10455 'enable'.
10456
10457 -msched-in-control-spec
10458 -mno-sched-in-control-spec
10459 (En/Dis)able speculative scheduling of the instructions that are
10460 dependent on the control speculative loads. This is effective only
10461 with -msched-control-spec enabled. The default is 'enable'.
10462
10463 -mno-sched-prefer-non-data-spec-insns
10464 -msched-prefer-non-data-spec-insns
10465 If enabled, data speculative instructions will be chosen for
10466 schedule only if there are no other choices at the moment. This
10467 will make the use of the data speculation much more conservative.
10468 The default is 'disable'.
10469
10470 -mno-sched-prefer-non-control-spec-insns
10471 -msched-prefer-non-control-spec-insns
10472 If enabled, control speculative instructions will be chosen for
10473 schedule only if there are no other choices at the moment. This
10474 will make the use of the control speculation much more
10475 conservative. The default is 'disable'.
10476
10477 -mno-sched-count-spec-in-critical-path
10478 -msched-count-spec-in-critical-path
10479 If enabled, speculative dependencies will be considered during
10480 computation of the instructions priorities. This will make the use
10481 of the speculation a bit more conservative. The default is
10482 'disable'.
10483
10484 -msched-spec-ldc
10485 Use a simple data speculation check. This option is on by default.
10486
10487 -msched-control-spec-ldc
10488 Use a simple check for control speculation. This option is on by
10489 default.
10490
10491 -msched-stop-bits-after-every-cycle
10492 Place a stop bit after every cycle when scheduling. This option is
10493 on by default.
10494
10495 -msched-fp-mem-deps-zero-cost
10496 Assume that floating-point stores and loads are not likely to cause
10497 a conflict when placed into the same instruction group. This
10498 option is disabled by default.
10499
10500 -msel-sched-dont-check-control-spec
10501 Generate checks for control speculation in selective scheduling.
10502 This flag is disabled by default.
10503
10504 -msched-max-memory-insns=max-insns
10505 Limit on the number of memory insns per instruction group, giving
10506 lower priority to subsequent memory insns attempting to schedule in
10507 the same instruction group. Frequently useful to prevent cache bank
10508 conflicts. The default value is 1.
10509
10510 -msched-max-memory-insns-hard-limit
10511 Disallow more than `msched-max-memory-insns' in instruction group.
10512 Otherwise, limit is `soft' meaning that we would prefer non-memory
10513 operations when limit is reached but may still schedule memory
10514 operations.
10515
10516 IA-64/VMS Options
10517 These -m options are defined for the IA-64/VMS implementations:
10518
10519 -mvms-return-codes
10520 Return VMS condition codes from main. The default is to return
10521 POSIX style condition (e.g. error) codes.
10522
10523 -mdebug-main=prefix
10524 Flag the first routine whose name starts with prefix as the main
10525 routine for the debugger.
10526
10527 -mmalloc64
10528 Default to 64bit memory allocation routines.
10529
10530 LM32 Options
10531 These -m options are defined for the Lattice Mico32 architecture:
10532
10533 -mbarrel-shift-enabled
10534 Enable barrel-shift instructions.
10535
10536 -mdivide-enabled
10537 Enable divide and modulus instructions.
10538
10539 -mmultiply-enabled
10540 Enable multiply instructions.
10541
10542 -msign-extend-enabled
10543 Enable sign extend instructions.
10544
10545 -muser-enabled
10546 Enable user-defined instructions.
10547
10548 M32C Options
10549 -mcpu=name
10550 Select the CPU for which code is generated. name may be one of r8c
10551 for the R8C/Tiny series, m16c for the M16C (up to /60) series,
10552 m32cm for the M16C/80 series, or m32c for the M32C/80 series.
10553
10554 -msim
10555 Specifies that the program will be run on the simulator. This
10556 causes an alternate runtime library to be linked in which supports,
10557 for example, file I/O. You must not use this option when
10558 generating programs that will run on real hardware; you must
10559 provide your own runtime library for whatever I/O functions are
10560 needed.
10561
10562 -memregs=number
10563 Specifies the number of memory-based pseudo-registers GCC will use
10564 during code generation. These pseudo-registers will be used like
10565 real registers, so there is a tradeoff between GCC's ability to fit
10566 the code into available registers, and the performance penalty of
10567 using memory instead of registers. Note that all modules in a
10568 program must be compiled with the same value for this option.
10569 Because of that, you must not use this option with the default
10570 runtime libraries gcc builds.
10571
10572 M32R/D Options
10573 These -m options are defined for Renesas M32R/D architectures:
10574
10575 -m32r2
10576 Generate code for the M32R/2.
10577
10578 -m32rx
10579 Generate code for the M32R/X.
10580
10581 -m32r
10582 Generate code for the M32R. This is the default.
10583
10584 -mmodel=small
10585 Assume all objects live in the lower 16MB of memory (so that their
10586 addresses can be loaded with the "ld24" instruction), and assume
10587 all subroutines are reachable with the "bl" instruction. This is
10588 the default.
10589
10590 The addressability of a particular object can be set with the
10591 "model" attribute.
10592
10593 -mmodel=medium
10594 Assume objects may be anywhere in the 32-bit address space (the
10595 compiler will generate "seth/add3" instructions to load their
10596 addresses), and assume all subroutines are reachable with the "bl"
10597 instruction.
10598
10599 -mmodel=large
10600 Assume objects may be anywhere in the 32-bit address space (the
10601 compiler will generate "seth/add3" instructions to load their
10602 addresses), and assume subroutines may not be reachable with the
10603 "bl" instruction (the compiler will generate the much slower
10604 "seth/add3/jl" instruction sequence).
10605
10606 -msdata=none
10607 Disable use of the small data area. Variables will be put into one
10608 of .data, bss, or .rodata (unless the "section" attribute has been
10609 specified). This is the default.
10610
10611 The small data area consists of sections .sdata and .sbss. Objects
10612 may be explicitly put in the small data area with the "section"
10613 attribute using one of these sections.
10614
10615 -msdata=sdata
10616 Put small global and static data in the small data area, but do not
10617 generate special code to reference them.
10618
10619 -msdata=use
10620 Put small global and static data in the small data area, and
10621 generate special instructions to reference them.
10622
10623 -G num
10624 Put global and static objects less than or equal to num bytes into
10625 the small data or bss sections instead of the normal data or bss
10626 sections. The default value of num is 8. The -msdata option must
10627 be set to one of sdata or use for this option to have any effect.
10628
10629 All modules should be compiled with the same -G num value.
10630 Compiling with different values of num may or may not work; if it
10631 doesn't the linker will give an error message---incorrect code will
10632 not be generated.
10633
10634 -mdebug
10635 Makes the M32R specific code in the compiler display some
10636 statistics that might help in debugging programs.
10637
10638 -malign-loops
10639 Align all loops to a 32-byte boundary.
10640
10641 -mno-align-loops
10642 Do not enforce a 32-byte alignment for loops. This is the default.
10643
10644 -missue-rate=number
10645 Issue number instructions per cycle. number can only be 1 or 2.
10646
10647 -mbranch-cost=number
10648 number can only be 1 or 2. If it is 1 then branches will be
10649 preferred over conditional code, if it is 2, then the opposite will
10650 apply.
10651
10652 -mflush-trap=number
10653 Specifies the trap number to use to flush the cache. The default
10654 is 12. Valid numbers are between 0 and 15 inclusive.
10655
10656 -mno-flush-trap
10657 Specifies that the cache cannot be flushed by using a trap.
10658
10659 -mflush-func=name
10660 Specifies the name of the operating system function to call to
10661 flush the cache. The default is _flush_cache, but a function call
10662 will only be used if a trap is not available.
10663
10664 -mno-flush-func
10665 Indicates that there is no OS function for flushing the cache.
10666
10667 M680x0 Options
10668 These are the -m options defined for M680x0 and ColdFire processors.
10669 The default settings depend on which architecture was selected when the
10670 compiler was configured; the defaults for the most common choices are
10671 given below.
10672
10673 -march=arch
10674 Generate code for a specific M680x0 or ColdFire instruction set
10675 architecture. Permissible values of arch for M680x0 architectures
10676 are: 68000, 68010, 68020, 68030, 68040, 68060 and cpu32. ColdFire
10677 architectures are selected according to Freescale's ISA
10678 classification and the permissible values are: isaa, isaaplus, isab
10679 and isac.
10680
10681 gcc defines a macro __mcfarch__ whenever it is generating code for
10682 a ColdFire target. The arch in this macro is one of the -march
10683 arguments given above.
10684
10685 When used together, -march and -mtune select code that runs on a
10686 family of similar processors but that is optimized for a particular
10687 microarchitecture.
10688
10689 -mcpu=cpu
10690 Generate code for a specific M680x0 or ColdFire processor. The
10691 M680x0 cpus are: 68000, 68010, 68020, 68030, 68040, 68060, 68302,
10692 68332 and cpu32. The ColdFire cpus are given by the table below,
10693 which also classifies the CPUs into families:
10694
10695 Family : -mcpu arguments
10696 51 : 51 51ac 51cn 51em 51qe
10697 5206 : 5202 5204 5206
10698 5206e : 5206e
10699 5208 : 5207 5208
10700 5211a : 5210a 5211a
10701 5213 : 5211 5212 5213
10702 5216 : 5214 5216
10703 52235 : 52230 52231 52232 52233 52234 52235
10704 5225 : 5224 5225
10705 52259 : 52252 52254 52255 52256 52258 52259
10706 5235 : 5232 5233 5234 5235 523x
10707 5249 : 5249
10708 5250 : 5250
10709 5271 : 5270 5271
10710 5272 : 5272
10711 5275 : 5274 5275
10712 5282 : 5280 5281 5282 528x
10713 53017 : 53011 53012 53013 53014 53015 53016 53017
10714 5307 : 5307
10715 5329 : 5327 5328 5329 532x
10716 5373 : 5372 5373 537x
10717 5407 : 5407
10718 5475 : 5470 5471 5472 5473 5474 5475 547x 5480 5481 5482 5483 5484
10719 5485
10720
10721 -mcpu=cpu overrides -march=arch if arch is compatible with cpu.
10722 Other combinations of -mcpu and -march are rejected.
10723
10724 gcc defines the macro __mcf_cpu_cpu when ColdFire target cpu is
10725 selected. It also defines __mcf_family_family, where the value of
10726 family is given by the table above.
10727
10728 -mtune=tune
10729 Tune the code for a particular microarchitecture, within the
10730 constraints set by -march and -mcpu. The M680x0 microarchitectures
10731 are: 68000, 68010, 68020, 68030, 68040, 68060 and cpu32. The
10732 ColdFire microarchitectures are: cfv1, cfv2, cfv3, cfv4 and cfv4e.
10733
10734 You can also use -mtune=68020-40 for code that needs to run
10735 relatively well on 68020, 68030 and 68040 targets. -mtune=68020-60
10736 is similar but includes 68060 targets as well. These two options
10737 select the same tuning decisions as -m68020-40 and -m68020-60
10738 respectively.
10739
10740 gcc defines the macros __mcarch and __mcarch__ when tuning for
10741 680x0 architecture arch. It also defines mcarch unless either
10742 -ansi or a non-GNU -std option is used. If gcc is tuning for a
10743 range of architectures, as selected by -mtune=68020-40 or
10744 -mtune=68020-60, it defines the macros for every architecture in
10745 the range.
10746
10747 gcc also defines the macro __muarch__ when tuning for ColdFire
10748 microarchitecture uarch, where uarch is one of the arguments given
10749 above.
10750
10751 -m68000
10752 -mc68000
10753 Generate output for a 68000. This is the default when the compiler
10754 is configured for 68000-based systems. It is equivalent to
10755 -march=68000.
10756
10757 Use this option for microcontrollers with a 68000 or EC000 core,
10758 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10759
10760 -m68010
10761 Generate output for a 68010. This is the default when the compiler
10762 is configured for 68010-based systems. It is equivalent to
10763 -march=68010.
10764
10765 -m68020
10766 -mc68020
10767 Generate output for a 68020. This is the default when the compiler
10768 is configured for 68020-based systems. It is equivalent to
10769 -march=68020.
10770
10771 -m68030
10772 Generate output for a 68030. This is the default when the compiler
10773 is configured for 68030-based systems. It is equivalent to
10774 -march=68030.
10775
10776 -m68040
10777 Generate output for a 68040. This is the default when the compiler
10778 is configured for 68040-based systems. It is equivalent to
10779 -march=68040.
10780
10781 This option inhibits the use of 68881/68882 instructions that have
10782 to be emulated by software on the 68040. Use this option if your
10783 68040 does not have code to emulate those instructions.
10784
10785 -m68060
10786 Generate output for a 68060. This is the default when the compiler
10787 is configured for 68060-based systems. It is equivalent to
10788 -march=68060.
10789
10790 This option inhibits the use of 68020 and 68881/68882 instructions
10791 that have to be emulated by software on the 68060. Use this option
10792 if your 68060 does not have code to emulate those instructions.
10793
10794 -mcpu32
10795 Generate output for a CPU32. This is the default when the compiler
10796 is configured for CPU32-based systems. It is equivalent to
10797 -march=cpu32.
10798
10799 Use this option for microcontrollers with a CPU32 or CPU32+ core,
10800 including the 68330, 68331, 68332, 68333, 68334, 68336, 68340,
10801 68341, 68349 and 68360.
10802
10803 -m5200
10804 Generate output for a 520X ColdFire CPU. This is the default when
10805 the compiler is configured for 520X-based systems. It is
10806 equivalent to -mcpu=5206, and is now deprecated in favor of that
10807 option.
10808
10809 Use this option for microcontroller with a 5200 core, including the
10810 MCF5202, MCF5203, MCF5204 and MCF5206.
10811
10812 -m5206e
10813 Generate output for a 5206e ColdFire CPU. The option is now
10814 deprecated in favor of the equivalent -mcpu=5206e.
10815
10816 -m528x
10817 Generate output for a member of the ColdFire 528X family. The
10818 option is now deprecated in favor of the equivalent -mcpu=528x.
10819
10820 -m5307
10821 Generate output for a ColdFire 5307 CPU. The option is now
10822 deprecated in favor of the equivalent -mcpu=5307.
10823
10824 -m5407
10825 Generate output for a ColdFire 5407 CPU. The option is now
10826 deprecated in favor of the equivalent -mcpu=5407.
10827
10828 -mcfv4e
10829 Generate output for a ColdFire V4e family CPU (e.g. 547x/548x).
10830 This includes use of hardware floating point instructions. The
10831 option is equivalent to -mcpu=547x, and is now deprecated in favor
10832 of that option.
10833
10834 -m68020-40
10835 Generate output for a 68040, without using any of the new
10836 instructions. This results in code which can run relatively
10837 efficiently on either a 68020/68881 or a 68030 or a 68040. The
10838 generated code does use the 68881 instructions that are emulated on
10839 the 68040.
10840
10841 The option is equivalent to -march=68020 -mtune=68020-40.
10842
10843 -m68020-60
10844 Generate output for a 68060, without using any of the new
10845 instructions. This results in code which can run relatively
10846 efficiently on either a 68020/68881 or a 68030 or a 68040. The
10847 generated code does use the 68881 instructions that are emulated on
10848 the 68060.
10849
10850 The option is equivalent to -march=68020 -mtune=68020-60.
10851
10852 -mhard-float
10853 -m68881
10854 Generate floating-point instructions. This is the default for
10855 68020 and above, and for ColdFire devices that have an FPU. It
10856 defines the macro __HAVE_68881__ on M680x0 targets and __mcffpu__
10857 on ColdFire targets.
10858
10859 -msoft-float
10860 Do not generate floating-point instructions; use library calls
10861 instead. This is the default for 68000, 68010, and 68832 targets.
10862 It is also the default for ColdFire devices that have no FPU.
10863
10864 -mdiv
10865 -mno-div
10866 Generate (do not generate) ColdFire hardware divide and remainder
10867 instructions. If -march is used without -mcpu, the default is "on"
10868 for ColdFire architectures and "off" for M680x0 architectures.
10869 Otherwise, the default is taken from the target CPU (either the
10870 default CPU, or the one specified by -mcpu). For example, the
10871 default is "off" for -mcpu=5206 and "on" for -mcpu=5206e.
10872
10873 gcc defines the macro __mcfhwdiv__ when this option is enabled.
10874
10875 -mshort
10876 Consider type "int" to be 16 bits wide, like "short int".
10877 Additionally, parameters passed on the stack are also aligned to a
10878 16-bit boundary even on targets whose API mandates promotion to
10879 32-bit.
10880
10881 -mno-short
10882 Do not consider type "int" to be 16 bits wide. This is the
10883 default.
10884
10885 -mnobitfield
10886 -mno-bitfield
10887 Do not use the bit-field instructions. The -m68000, -mcpu32 and
10888 -m5200 options imply -mnobitfield.
10889
10890 -mbitfield
10891 Do use the bit-field instructions. The -m68020 option implies
10892 -mbitfield. This is the default if you use a configuration
10893 designed for a 68020.
10894
10895 -mrtd
10896 Use a different function-calling convention, in which functions
10897 that take a fixed number of arguments return with the "rtd"
10898 instruction, which pops their arguments while returning. This
10899 saves one instruction in the caller since there is no need to pop
10900 the arguments there.
10901
10902 This calling convention is incompatible with the one normally used
10903 on Unix, so you cannot use it if you need to call libraries
10904 compiled with the Unix compiler.
10905
10906 Also, you must provide function prototypes for all functions that
10907 take variable numbers of arguments (including "printf"); otherwise
10908 incorrect code will be generated for calls to those functions.
10909
10910 In addition, seriously incorrect code will result if you call a
10911 function with too many arguments. (Normally, extra arguments are
10912 harmlessly ignored.)
10913
10914 The "rtd" instruction is supported by the 68010, 68020, 68030,
10915 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10916
10917 -mno-rtd
10918 Do not use the calling conventions selected by -mrtd. This is the
10919 default.
10920
10921 -malign-int
10922 -mno-align-int
10923 Control whether GCC aligns "int", "long", "long long", "float",
10924 "double", and "long double" variables on a 32-bit boundary
10925 (-malign-int) or a 16-bit boundary (-mno-align-int). Aligning
10926 variables on 32-bit boundaries produces code that runs somewhat
10927 faster on processors with 32-bit busses at the expense of more
10928 memory.
10929
10930 Warning: if you use the -malign-int switch, GCC will align
10931 structures containing the above types differently than most
10932 published application binary interface specifications for the m68k.
10933
10934 -mpcrel
10935 Use the pc-relative addressing mode of the 68000 directly, instead
10936 of using a global offset table. At present, this option implies
10937 -fpic, allowing at most a 16-bit offset for pc-relative addressing.
10938 -fPIC is not presently supported with -mpcrel, though this could be
10939 supported for 68020 and higher processors.
10940
10941 -mno-strict-align
10942 -mstrict-align
10943 Do not (do) assume that unaligned memory references will be handled
10944 by the system.
10945
10946 -msep-data
10947 Generate code that allows the data segment to be located in a
10948 different area of memory from the text segment. This allows for
10949 execute in place in an environment without virtual memory
10950 management. This option implies -fPIC.
10951
10952 -mno-sep-data
10953 Generate code that assumes that the data segment follows the text
10954 segment. This is the default.
10955
10956 -mid-shared-library
10957 Generate code that supports shared libraries via the library ID
10958 method. This allows for execute in place and shared libraries in
10959 an environment without virtual memory management. This option
10960 implies -fPIC.
10961
10962 -mno-id-shared-library
10963 Generate code that doesn't assume ID based shared libraries are
10964 being used. This is the default.
10965
10966 -mshared-library-id=n
10967 Specified the identification number of the ID based shared library
10968 being compiled. Specifying a value of 0 will generate more compact
10969 code, specifying other values will force the allocation of that
10970 number to the current library but is no more space or time
10971 efficient than omitting this option.
10972
10973 -mxgot
10974 -mno-xgot
10975 When generating position-independent code for ColdFire, generate
10976 code that works if the GOT has more than 8192 entries. This code
10977 is larger and slower than code generated without this option. On
10978 M680x0 processors, this option is not needed; -fPIC suffices.
10979
10980 GCC normally uses a single instruction to load values from the GOT.
10981 While this is relatively efficient, it only works if the GOT is
10982 smaller than about 64k. Anything larger causes the linker to
10983 report an error such as:
10984
10985 relocation truncated to fit: R_68K_GOT16O foobar
10986
10987 If this happens, you should recompile your code with -mxgot. It
10988 should then work with very large GOTs. However, code generated
10989 with -mxgot is less efficient, since it takes 4 instructions to
10990 fetch the value of a global symbol.
10991
10992 Note that some linkers, including newer versions of the GNU linker,
10993 can create multiple GOTs and sort GOT entries. If you have such a
10994 linker, you should only need to use -mxgot when compiling a single
10995 object file that accesses more than 8192 GOT entries. Very few do.
10996
10997 These options have no effect unless GCC is generating position-
10998 independent code.
10999
11000 M68hc1x Options
11001 These are the -m options defined for the 68hc11 and 68hc12
11002 microcontrollers. The default values for these options depends on
11003 which style of microcontroller was selected when the compiler was
11004 configured; the defaults for the most common choices are given below.
11005
11006 -m6811
11007 -m68hc11
11008 Generate output for a 68HC11. This is the default when the
11009 compiler is configured for 68HC11-based systems.
11010
11011 -m6812
11012 -m68hc12
11013 Generate output for a 68HC12. This is the default when the
11014 compiler is configured for 68HC12-based systems.
11015
11016 -m68S12
11017 -m68hcs12
11018 Generate output for a 68HCS12.
11019
11020 -mauto-incdec
11021 Enable the use of 68HC12 pre and post auto-increment and auto-
11022 decrement addressing modes.
11023
11024 -minmax
11025 -mnominmax
11026 Enable the use of 68HC12 min and max instructions.
11027
11028 -mlong-calls
11029 -mno-long-calls
11030 Treat all calls as being far away (near). If calls are assumed to
11031 be far away, the compiler will use the "call" instruction to call a
11032 function and the "rtc" instruction for returning.
11033
11034 -mshort
11035 Consider type "int" to be 16 bits wide, like "short int".
11036
11037 -msoft-reg-count=count
11038 Specify the number of pseudo-soft registers which are used for the
11039 code generation. The maximum number is 32. Using more pseudo-soft
11040 register may or may not result in better code depending on the
11041 program. The default is 4 for 68HC11 and 2 for 68HC12.
11042
11043 MCore Options
11044 These are the -m options defined for the Motorola M*Core processors.
11045
11046 -mhardlit
11047 -mno-hardlit
11048 Inline constants into the code stream if it can be done in two
11049 instructions or less.
11050
11051 -mdiv
11052 -mno-div
11053 Use the divide instruction. (Enabled by default).
11054
11055 -mrelax-immediate
11056 -mno-relax-immediate
11057 Allow arbitrary sized immediates in bit operations.
11058
11059 -mwide-bitfields
11060 -mno-wide-bitfields
11061 Always treat bit-fields as int-sized.
11062
11063 -m4byte-functions
11064 -mno-4byte-functions
11065 Force all functions to be aligned to a four byte boundary.
11066
11067 -mcallgraph-data
11068 -mno-callgraph-data
11069 Emit callgraph information.
11070
11071 -mslow-bytes
11072 -mno-slow-bytes
11073 Prefer word access when reading byte quantities.
11074
11075 -mlittle-endian
11076 -mbig-endian
11077 Generate code for a little endian target.
11078
11079 -m210
11080 -m340
11081 Generate code for the 210 processor.
11082
11083 -mno-lsim
11084 Assume that run-time support has been provided and so omit the
11085 simulator library (libsim.a) from the linker command line.
11086
11087 -mstack-increment=size
11088 Set the maximum amount for a single stack increment operation.
11089 Large values can increase the speed of programs which contain
11090 functions that need a large amount of stack space, but they can
11091 also trigger a segmentation fault if the stack is extended too
11092 much. The default value is 0x1000.
11093
11094 MeP Options
11095 -mabsdiff
11096 Enables the "abs" instruction, which is the absolute difference
11097 between two registers.
11098
11099 -mall-opts
11100 Enables all the optional instructions - average, multiply, divide,
11101 bit operations, leading zero, absolute difference, min/max, clip,
11102 and saturation.
11103
11104 -maverage
11105 Enables the "ave" instruction, which computes the average of two
11106 registers.
11107
11108 -mbased=n
11109 Variables of size n bytes or smaller will be placed in the ".based"
11110 section by default. Based variables use the $tp register as a base
11111 register, and there is a 128 byte limit to the ".based" section.
11112
11113 -mbitops
11114 Enables the bit operation instructions - bit test ("btstm"), set
11115 ("bsetm"), clear ("bclrm"), invert ("bnotm"), and test-and-set
11116 ("tas").
11117
11118 -mc=name
11119 Selects which section constant data will be placed in. name may be
11120 "tiny", "near", or "far".
11121
11122 -mclip
11123 Enables the "clip" instruction. Note that "-mclip" is not useful
11124 unless you also provide "-mminmax".
11125
11126 -mconfig=name
11127 Selects one of the build-in core configurations. Each MeP chip has
11128 one or more modules in it; each module has a core CPU and a variety
11129 of coprocessors, optional instructions, and peripherals. The
11130 "MeP-Integrator" tool, not part of GCC, provides these
11131 configurations through this option; using this option is the same
11132 as using all the corresponding command line options. The default
11133 configuration is "default".
11134
11135 -mcop
11136 Enables the coprocessor instructions. By default, this is a 32-bit
11137 coprocessor. Note that the coprocessor is normally enabled via the
11138 "-mconfig=" option.
11139
11140 -mcop32
11141 Enables the 32-bit coprocessor's instructions.
11142
11143 -mcop64
11144 Enables the 64-bit coprocessor's instructions.
11145
11146 -mivc2
11147 Enables IVC2 scheduling. IVC2 is a 64-bit VLIW coprocessor.
11148
11149 -mdc
11150 Causes constant variables to be placed in the ".near" section.
11151
11152 -mdiv
11153 Enables the "div" and "divu" instructions.
11154
11155 -meb
11156 Generate big-endian code.
11157
11158 -mel
11159 Generate little-endian code.
11160
11161 -mio-volatile
11162 Tells the compiler that any variable marked with the "io" attribute
11163 is to be considered volatile.
11164
11165 -ml Causes variables to be assigned to the ".far" section by default.
11166
11167 -mleadz
11168 Enables the "leadz" (leading zero) instruction.
11169
11170 -mm Causes variables to be assigned to the ".near" section by default.
11171
11172 -mminmax
11173 Enables the "min" and "max" instructions.
11174
11175 -mmult
11176 Enables the multiplication and multiply-accumulate instructions.
11177
11178 -mno-opts
11179 Disables all the optional instructions enabled by "-mall-opts".
11180
11181 -mrepeat
11182 Enables the "repeat" and "erepeat" instructions, used for low-
11183 overhead looping.
11184
11185 -ms Causes all variables to default to the ".tiny" section. Note that
11186 there is a 65536 byte limit to this section. Accesses to these
11187 variables use the %gp base register.
11188
11189 -msatur
11190 Enables the saturation instructions. Note that the compiler does
11191 not currently generate these itself, but this option is included
11192 for compatibility with other tools, like "as".
11193
11194 -msdram
11195 Link the SDRAM-based runtime instead of the default ROM-based
11196 runtime.
11197
11198 -msim
11199 Link the simulator runtime libraries.
11200
11201 -msimnovec
11202 Link the simulator runtime libraries, excluding built-in support
11203 for reset and exception vectors and tables.
11204
11205 -mtf
11206 Causes all functions to default to the ".far" section. Without
11207 this option, functions default to the ".near" section.
11208
11209 -mtiny=n
11210 Variables that are n bytes or smaller will be allocated to the
11211 ".tiny" section. These variables use the $gp base register. The
11212 default for this option is 4, but note that there's a 65536 byte
11213 limit to the ".tiny" section.
11214
11215 MIPS Options
11216 -EB Generate big-endian code.
11217
11218 -EL Generate little-endian code. This is the default for mips*el-*-*
11219 configurations.
11220
11221 -march=arch
11222 Generate code that will run on arch, which can be the name of a
11223 generic MIPS ISA, or the name of a particular processor. The ISA
11224 names are: mips1, mips2, mips3, mips4, mips32, mips32r2, mips64 and
11225 mips64r2. The processor names are: 4kc, 4km, 4kp, 4ksc, 4kec,
11226 4kem, 4kep, 4ksd, 5kc, 5kf, 20kc, 24kc, 24kf2_1, 24kf1_1, 24kec,
11227 24kef2_1, 24kef1_1, 34kc, 34kf2_1, 34kf1_1, 74kc, 74kf2_1, 74kf1_1,
11228 74kf3_2, 1004kc, 1004kf2_1, 1004kf1_1, loongson2e, loongson2f, m4k,
11229 octeon, orion, r2000, r3000, r3900, r4000, r4400, r4600, r4650,
11230 r6000, r8000, rm7000, rm9000, r10000, r12000, r14000, r16000, sb1,
11231 sr71000, vr4100, vr4111, vr4120, vr4130, vr4300, vr5000, vr5400,
11232 vr5500 and xlr. The special value from-abi selects the most
11233 compatible architecture for the selected ABI (that is, mips1 for
11234 32-bit ABIs and mips3 for 64-bit ABIs).
11235
11236 Native Linux/GNU toolchains also support the value native, which
11237 selects the best architecture option for the host processor.
11238 -march=native has no effect if GCC does not recognize the
11239 processor.
11240
11241 In processor names, a final 000 can be abbreviated as k (for
11242 example, -march=r2k). Prefixes are optional, and vr may be written
11243 r.
11244
11245 Names of the form nf2_1 refer to processors with FPUs clocked at
11246 half the rate of the core, names of the form nf1_1 refer to
11247 processors with FPUs clocked at the same rate as the core, and
11248 names of the form nf3_2 refer to processors with FPUs clocked a
11249 ratio of 3:2 with respect to the core. For compatibility reasons,
11250 nf is accepted as a synonym for nf2_1 while nx and bfx are accepted
11251 as synonyms for nf1_1.
11252
11253 GCC defines two macros based on the value of this option. The
11254 first is _MIPS_ARCH, which gives the name of target architecture,
11255 as a string. The second has the form _MIPS_ARCH_foo, where foo is
11256 the capitalized value of _MIPS_ARCH. For example, -march=r2000
11257 will set _MIPS_ARCH to "r2000" and define the macro
11258 _MIPS_ARCH_R2000.
11259
11260 Note that the _MIPS_ARCH macro uses the processor names given
11261 above. In other words, it will have the full prefix and will not
11262 abbreviate 000 as k. In the case of from-abi, the macro names the
11263 resolved architecture (either "mips1" or "mips3"). It names the
11264 default architecture when no -march option is given.
11265
11266 -mtune=arch
11267 Optimize for arch. Among other things, this option controls the
11268 way instructions are scheduled, and the perceived cost of
11269 arithmetic operations. The list of arch values is the same as for
11270 -march.
11271
11272 When this option is not used, GCC will optimize for the processor
11273 specified by -march. By using -march and -mtune together, it is
11274 possible to generate code that will run on a family of processors,
11275 but optimize the code for one particular member of that family.
11276
11277 -mtune defines the macros _MIPS_TUNE and _MIPS_TUNE_foo, which work
11278 in the same way as the -march ones described above.
11279
11280 -mips1
11281 Equivalent to -march=mips1.
11282
11283 -mips2
11284 Equivalent to -march=mips2.
11285
11286 -mips3
11287 Equivalent to -march=mips3.
11288
11289 -mips4
11290 Equivalent to -march=mips4.
11291
11292 -mips32
11293 Equivalent to -march=mips32.
11294
11295 -mips32r2
11296 Equivalent to -march=mips32r2.
11297
11298 -mips64
11299 Equivalent to -march=mips64.
11300
11301 -mips64r2
11302 Equivalent to -march=mips64r2.
11303
11304 -mips16
11305 -mno-mips16
11306 Generate (do not generate) MIPS16 code. If GCC is targetting a
11307 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE.
11308
11309 MIPS16 code generation can also be controlled on a per-function
11310 basis by means of "mips16" and "nomips16" attributes.
11311
11312 -mflip-mips16
11313 Generate MIPS16 code on alternating functions. This option is
11314 provided for regression testing of mixed MIPS16/non-MIPS16 code
11315 generation, and is not intended for ordinary use in compiling user
11316 code.
11317
11318 -minterlink-mips16
11319 -mno-interlink-mips16
11320 Require (do not require) that non-MIPS16 code be link-compatible
11321 with MIPS16 code.
11322
11323 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
11324 it must either use a call or an indirect jump. -minterlink-mips16
11325 therefore disables direct jumps unless GCC knows that the target of
11326 the jump is not MIPS16.
11327
11328 -mabi=32
11329 -mabi=o64
11330 -mabi=n32
11331 -mabi=64
11332 -mabi=eabi
11333 Generate code for the given ABI.
11334
11335 Note that the EABI has a 32-bit and a 64-bit variant. GCC normally
11336 generates 64-bit code when you select a 64-bit architecture, but
11337 you can use -mgp32 to get 32-bit code instead.
11338
11339 For information about the O64 ABI, see
11340 <http://gcc.gnu.org/projects/mipso64-abi.html>.
11341
11342 GCC supports a variant of the o32 ABI in which floating-point
11343 registers are 64 rather than 32 bits wide. You can select this
11344 combination with -mabi=32 -mfp64. This ABI relies on the mthc1 and
11345 mfhc1 instructions and is therefore only supported for MIPS32R2
11346 processors.
11347
11348 The register assignments for arguments and return values remain the
11349 same, but each scalar value is passed in a single 64-bit register
11350 rather than a pair of 32-bit registers. For example, scalar
11351 floating-point values are returned in $f0 only, not a $f0/$f1 pair.
11352 The set of call-saved registers also remains the same, but all 64
11353 bits are saved.
11354
11355 -mabicalls
11356 -mno-abicalls
11357 Generate (do not generate) code that is suitable for SVR4-style
11358 dynamic objects. -mabicalls is the default for SVR4-based systems.
11359
11360 -mshared
11361 -mno-shared
11362 Generate (do not generate) code that is fully position-independent,
11363 and that can therefore be linked into shared libraries. This
11364 option only affects -mabicalls.
11365
11366 All -mabicalls code has traditionally been position-independent,
11367 regardless of options like -fPIC and -fpic. However, as an
11368 extension, the GNU toolchain allows executables to use absolute
11369 accesses for locally-binding symbols. It can also use shorter GP
11370 initialization sequences and generate direct calls to locally-
11371 defined functions. This mode is selected by -mno-shared.
11372
11373 -mno-shared depends on binutils 2.16 or higher and generates
11374 objects that can only be linked by the GNU linker. However, the
11375 option does not affect the ABI of the final executable; it only
11376 affects the ABI of relocatable objects. Using -mno-shared will
11377 generally make executables both smaller and quicker.
11378
11379 -mshared is the default.
11380
11381 -mplt
11382 -mno-plt
11383 Assume (do not assume) that the static and dynamic linkers support
11384 PLTs and copy relocations. This option only affects -mno-shared
11385 -mabicalls. For the n64 ABI, this option has no effect without
11386 -msym32.
11387
11388 You can make -mplt the default by configuring GCC with
11389 --with-mips-plt. The default is -mno-plt otherwise.
11390
11391 -mxgot
11392 -mno-xgot
11393 Lift (do not lift) the usual restrictions on the size of the global
11394 offset table.
11395
11396 GCC normally uses a single instruction to load values from the GOT.
11397 While this is relatively efficient, it will only work if the GOT is
11398 smaller than about 64k. Anything larger will cause the linker to
11399 report an error such as:
11400
11401 relocation truncated to fit: R_MIPS_GOT16 foobar
11402
11403 If this happens, you should recompile your code with -mxgot. It
11404 should then work with very large GOTs, although it will also be
11405 less efficient, since it will take three instructions to fetch the
11406 value of a global symbol.
11407
11408 Note that some linkers can create multiple GOTs. If you have such
11409 a linker, you should only need to use -mxgot when a single object
11410 file accesses more than 64k's worth of GOT entries. Very few do.
11411
11412 These options have no effect unless GCC is generating position
11413 independent code.
11414
11415 -mgp32
11416 Assume that general-purpose registers are 32 bits wide.
11417
11418 -mgp64
11419 Assume that general-purpose registers are 64 bits wide.
11420
11421 -mfp32
11422 Assume that floating-point registers are 32 bits wide.
11423
11424 -mfp64
11425 Assume that floating-point registers are 64 bits wide.
11426
11427 -mhard-float
11428 Use floating-point coprocessor instructions.
11429
11430 -msoft-float
11431 Do not use floating-point coprocessor instructions. Implement
11432 floating-point calculations using library calls instead.
11433
11434 -msingle-float
11435 Assume that the floating-point coprocessor only supports single-
11436 precision operations.
11437
11438 -mdouble-float
11439 Assume that the floating-point coprocessor supports double-
11440 precision operations. This is the default.
11441
11442 -mllsc
11443 -mno-llsc
11444 Use (do not use) ll, sc, and sync instructions to implement atomic
11445 memory built-in functions. When neither option is specified, GCC
11446 will use the instructions if the target architecture supports them.
11447
11448 -mllsc is useful if the runtime environment can emulate the
11449 instructions and -mno-llsc can be useful when compiling for
11450 nonstandard ISAs. You can make either option the default by
11451 configuring GCC with --with-llsc and --without-llsc respectively.
11452 --with-llsc is the default for some configurations; see the
11453 installation documentation for details.
11454
11455 -mdsp
11456 -mno-dsp
11457 Use (do not use) revision 1 of the MIPS DSP ASE.
11458 This option defines the preprocessor macro __mips_dsp. It also
11459 defines __mips_dsp_rev to 1.
11460
11461 -mdspr2
11462 -mno-dspr2
11463 Use (do not use) revision 2 of the MIPS DSP ASE.
11464 This option defines the preprocessor macros __mips_dsp and
11465 __mips_dspr2. It also defines __mips_dsp_rev to 2.
11466
11467 -msmartmips
11468 -mno-smartmips
11469 Use (do not use) the MIPS SmartMIPS ASE.
11470
11471 -mpaired-single
11472 -mno-paired-single
11473 Use (do not use) paired-single floating-point instructions.
11474 This option requires hardware floating-point support to be
11475 enabled.
11476
11477 -mdmx
11478 -mno-mdmx
11479 Use (do not use) MIPS Digital Media Extension instructions. This
11480 option can only be used when generating 64-bit code and requires
11481 hardware floating-point support to be enabled.
11482
11483 -mips3d
11484 -mno-mips3d
11485 Use (do not use) the MIPS-3D ASE. The option -mips3d implies
11486 -mpaired-single.
11487
11488 -mmt
11489 -mno-mt
11490 Use (do not use) MT Multithreading instructions.
11491
11492 -mlong64
11493 Force "long" types to be 64 bits wide. See -mlong32 for an
11494 explanation of the default and the way that the pointer size is
11495 determined.
11496
11497 -mlong32
11498 Force "long", "int", and pointer types to be 32 bits wide.
11499
11500 The default size of "int"s, "long"s and pointers depends on the
11501 ABI. All the supported ABIs use 32-bit "int"s. The n64 ABI uses
11502 64-bit "long"s, as does the 64-bit EABI; the others use 32-bit
11503 "long"s. Pointers are the same size as "long"s, or the same size
11504 as integer registers, whichever is smaller.
11505
11506 -msym32
11507 -mno-sym32
11508 Assume (do not assume) that all symbols have 32-bit values,
11509 regardless of the selected ABI. This option is useful in
11510 combination with -mabi=64 and -mno-abicalls because it allows GCC
11511 to generate shorter and faster references to symbolic addresses.
11512
11513 -G num
11514 Put definitions of externally-visible data in a small data section
11515 if that data is no bigger than num bytes. GCC can then access the
11516 data more efficiently; see -mgpopt for details.
11517
11518 The default -G option depends on the configuration.
11519
11520 -mlocal-sdata
11521 -mno-local-sdata
11522 Extend (do not extend) the -G behavior to local data too, such as
11523 to static variables in C. -mlocal-sdata is the default for all
11524 configurations.
11525
11526 If the linker complains that an application is using too much small
11527 data, you might want to try rebuilding the less performance-
11528 critical parts with -mno-local-sdata. You might also want to build
11529 large libraries with -mno-local-sdata, so that the libraries leave
11530 more room for the main program.
11531
11532 -mextern-sdata
11533 -mno-extern-sdata
11534 Assume (do not assume) that externally-defined data will be in a
11535 small data section if that data is within the -G limit.
11536 -mextern-sdata is the default for all configurations.
11537
11538 If you compile a module Mod with -mextern-sdata -G num -mgpopt, and
11539 Mod references a variable Var that is no bigger than num bytes, you
11540 must make sure that Var is placed in a small data section. If Var
11541 is defined by another module, you must either compile that module
11542 with a high-enough -G setting or attach a "section" attribute to
11543 Var's definition. If Var is common, you must link the application
11544 with a high-enough -G setting.
11545
11546 The easiest way of satisfying these restrictions is to compile and
11547 link every module with the same -G option. However, you may wish
11548 to build a library that supports several different small data
11549 limits. You can do this by compiling the library with the highest
11550 supported -G setting and additionally using -mno-extern-sdata to
11551 stop the library from making assumptions about externally-defined
11552 data.
11553
11554 -mgpopt
11555 -mno-gpopt
11556 Use (do not use) GP-relative accesses for symbols that are known to
11557 be in a small data section; see -G, -mlocal-sdata and
11558 -mextern-sdata. -mgpopt is the default for all configurations.
11559
11560 -mno-gpopt is useful for cases where the $gp register might not
11561 hold the value of "_gp". For example, if the code is part of a
11562 library that might be used in a boot monitor, programs that call
11563 boot monitor routines will pass an unknown value in $gp. (In such
11564 situations, the boot monitor itself would usually be compiled with
11565 -G0.)
11566
11567 -mno-gpopt implies -mno-local-sdata and -mno-extern-sdata.
11568
11569 -membedded-data
11570 -mno-embedded-data
11571 Allocate variables to the read-only data section first if possible,
11572 then next in the small data section if possible, otherwise in data.
11573 This gives slightly slower code than the default, but reduces the
11574 amount of RAM required when executing, and thus may be preferred
11575 for some embedded systems.
11576
11577 -muninit-const-in-rodata
11578 -mno-uninit-const-in-rodata
11579 Put uninitialized "const" variables in the read-only data section.
11580 This option is only meaningful in conjunction with -membedded-data.
11581
11582 -mcode-readable=setting
11583 Specify whether GCC may generate code that reads from executable
11584 sections. There are three possible settings:
11585
11586 -mcode-readable=yes
11587 Instructions may freely access executable sections. This is
11588 the default setting.
11589
11590 -mcode-readable=pcrel
11591 MIPS16 PC-relative load instructions can access executable
11592 sections, but other instructions must not do so. This option
11593 is useful on 4KSc and 4KSd processors when the code TLBs have
11594 the Read Inhibit bit set. It is also useful on processors that
11595 can be configured to have a dual instruction/data SRAM
11596 interface and that, like the M4K, automatically redirect PC-
11597 relative loads to the instruction RAM.
11598
11599 -mcode-readable=no
11600 Instructions must not access executable sections. This option
11601 can be useful on targets that are configured to have a dual
11602 instruction/data SRAM interface but that (unlike the M4K) do
11603 not automatically redirect PC-relative loads to the instruction
11604 RAM.
11605
11606 -msplit-addresses
11607 -mno-split-addresses
11608 Enable (disable) use of the "%hi()" and "%lo()" assembler
11609 relocation operators. This option has been superseded by
11610 -mexplicit-relocs but is retained for backwards compatibility.
11611
11612 -mexplicit-relocs
11613 -mno-explicit-relocs
11614 Use (do not use) assembler relocation operators when dealing with
11615 symbolic addresses. The alternative, selected by
11616 -mno-explicit-relocs, is to use assembler macros instead.
11617
11618 -mexplicit-relocs is the default if GCC was configured to use an
11619 assembler that supports relocation operators.
11620
11621 -mcheck-zero-division
11622 -mno-check-zero-division
11623 Trap (do not trap) on integer division by zero.
11624
11625 The default is -mcheck-zero-division.
11626
11627 -mdivide-traps
11628 -mdivide-breaks
11629 MIPS systems check for division by zero by generating either a
11630 conditional trap or a break instruction. Using traps results in
11631 smaller code, but is only supported on MIPS II and later. Also,
11632 some versions of the Linux kernel have a bug that prevents trap
11633 from generating the proper signal ("SIGFPE"). Use -mdivide-traps
11634 to allow conditional traps on architectures that support them and
11635 -mdivide-breaks to force the use of breaks.
11636
11637 The default is usually -mdivide-traps, but this can be overridden
11638 at configure time using --with-divide=breaks. Divide-by-zero
11639 checks can be completely disabled using -mno-check-zero-division.
11640
11641 -mmemcpy
11642 -mno-memcpy
11643 Force (do not force) the use of "memcpy()" for non-trivial block
11644 moves. The default is -mno-memcpy, which allows GCC to inline most
11645 constant-sized copies.
11646
11647 -mlong-calls
11648 -mno-long-calls
11649 Disable (do not disable) use of the "jal" instruction. Calling
11650 functions using "jal" is more efficient but requires the caller and
11651 callee to be in the same 256 megabyte segment.
11652
11653 This option has no effect on abicalls code. The default is
11654 -mno-long-calls.
11655
11656 -mmad
11657 -mno-mad
11658 Enable (disable) use of the "mad", "madu" and "mul" instructions,
11659 as provided by the R4650 ISA.
11660
11661 -mfused-madd
11662 -mno-fused-madd
11663 Enable (disable) use of the floating point multiply-accumulate
11664 instructions, when they are available. The default is
11665 -mfused-madd.
11666
11667 When multiply-accumulate instructions are used, the intermediate
11668 product is calculated to infinite precision and is not subject to
11669 the FCSR Flush to Zero bit. This may be undesirable in some
11670 circumstances.
11671
11672 -nocpp
11673 Tell the MIPS assembler to not run its preprocessor over user
11674 assembler files (with a .s suffix) when assembling them.
11675
11676 -mfix-r4000
11677 -mno-fix-r4000
11678 Work around certain R4000 CPU errata:
11679
11680 - A double-word or a variable shift may give an incorrect result
11681 if executed immediately after starting an integer division.
11682
11683 - A double-word or a variable shift may give an incorrect result
11684 if executed while an integer multiplication is in progress.
11685
11686 - An integer division may give an incorrect result if started in
11687 a delay slot of a taken branch or a jump.
11688
11689 -mfix-r4400
11690 -mno-fix-r4400
11691 Work around certain R4400 CPU errata:
11692
11693 - A double-word or a variable shift may give an incorrect result
11694 if executed immediately after starting an integer division.
11695
11696 -mfix-r10000
11697 -mno-fix-r10000
11698 Work around certain R10000 errata:
11699
11700 - "ll"/"sc" sequences may not behave atomically on revisions
11701 prior to 3.0. They may deadlock on revisions 2.6 and earlier.
11702
11703 This option can only be used if the target architecture supports
11704 branch-likely instructions. -mfix-r10000 is the default when
11705 -march=r10000 is used; -mno-fix-r10000 is the default otherwise.
11706
11707 -mfix-vr4120
11708 -mno-fix-vr4120
11709 Work around certain VR4120 errata:
11710
11711 - "dmultu" does not always produce the correct result.
11712
11713 - "div" and "ddiv" do not always produce the correct result if
11714 one of the operands is negative.
11715
11716 The workarounds for the division errata rely on special functions
11717 in libgcc.a. At present, these functions are only provided by the
11718 "mips64vr*-elf" configurations.
11719
11720 Other VR4120 errata require a nop to be inserted between certain
11721 pairs of instructions. These errata are handled by the assembler,
11722 not by GCC itself.
11723
11724 -mfix-vr4130
11725 Work around the VR4130 "mflo"/"mfhi" errata. The workarounds are
11726 implemented by the assembler rather than by GCC, although GCC will
11727 avoid using "mflo" and "mfhi" if the VR4130 "macc", "macchi",
11728 "dmacc" and "dmacchi" instructions are available instead.
11729
11730 -mfix-sb1
11731 -mno-fix-sb1
11732 Work around certain SB-1 CPU core errata. (This flag currently
11733 works around the SB-1 revision 2 "F1" and "F2" floating point
11734 errata.)
11735
11736 -mr10k-cache-barrier=setting
11737 Specify whether GCC should insert cache barriers to avoid the side-
11738 effects of speculation on R10K processors.
11739
11740 In common with many processors, the R10K tries to predict the
11741 outcome of a conditional branch and speculatively executes
11742 instructions from the "taken" branch. It later aborts these
11743 instructions if the predicted outcome was wrong. However, on the
11744 R10K, even aborted instructions can have side effects.
11745
11746 This problem only affects kernel stores and, depending on the
11747 system, kernel loads. As an example, a speculatively-executed
11748 store may load the target memory into cache and mark the cache line
11749 as dirty, even if the store itself is later aborted. If a DMA
11750 operation writes to the same area of memory before the "dirty" line
11751 is flushed, the cached data will overwrite the DMA-ed data. See
11752 the R10K processor manual for a full description, including other
11753 potential problems.
11754
11755 One workaround is to insert cache barrier instructions before every
11756 memory access that might be speculatively executed and that might
11757 have side effects even if aborted. -mr10k-cache-barrier=setting
11758 controls GCC's implementation of this workaround. It assumes that
11759 aborted accesses to any byte in the following regions will not have
11760 side effects:
11761
11762 1. the memory occupied by the current function's stack frame;
11763
11764 2. the memory occupied by an incoming stack argument;
11765
11766 3. the memory occupied by an object with a link-time-constant
11767 address.
11768
11769 It is the kernel's responsibility to ensure that speculative
11770 accesses to these regions are indeed safe.
11771
11772 If the input program contains a function declaration such as:
11773
11774 void foo (void);
11775
11776 then the implementation of "foo" must allow "j foo" and "jal foo"
11777 to be executed speculatively. GCC honors this restriction for
11778 functions it compiles itself. It expects non-GCC functions (such
11779 as hand-written assembly code) to do the same.
11780
11781 The option has three forms:
11782
11783 -mr10k-cache-barrier=load-store
11784 Insert a cache barrier before a load or store that might be
11785 speculatively executed and that might have side effects even if
11786 aborted.
11787
11788 -mr10k-cache-barrier=store
11789 Insert a cache barrier before a store that might be
11790 speculatively executed and that might have side effects even if
11791 aborted.
11792
11793 -mr10k-cache-barrier=none
11794 Disable the insertion of cache barriers. This is the default
11795 setting.
11796
11797 -mflush-func=func
11798 -mno-flush-func
11799 Specifies the function to call to flush the I and D caches, or to
11800 not call any such function. If called, the function must take the
11801 same arguments as the common "_flush_func()", that is, the address
11802 of the memory range for which the cache is being flushed, the size
11803 of the memory range, and the number 3 (to flush both caches). The
11804 default depends on the target GCC was configured for, but commonly
11805 is either _flush_func or __cpu_flush.
11806
11807 mbranch-cost=num
11808 Set the cost of branches to roughly num "simple" instructions.
11809 This cost is only a heuristic and is not guaranteed to produce
11810 consistent results across releases. A zero cost redundantly
11811 selects the default, which is based on the -mtune setting.
11812
11813 -mbranch-likely
11814 -mno-branch-likely
11815 Enable or disable use of Branch Likely instructions, regardless of
11816 the default for the selected architecture. By default, Branch
11817 Likely instructions may be generated if they are supported by the
11818 selected architecture. An exception is for the MIPS32 and MIPS64
11819 architectures and processors which implement those architectures;
11820 for those, Branch Likely instructions will not be generated by
11821 default because the MIPS32 and MIPS64 architectures specifically
11822 deprecate their use.
11823
11824 -mfp-exceptions
11825 -mno-fp-exceptions
11826 Specifies whether FP exceptions are enabled. This affects how we
11827 schedule FP instructions for some processors. The default is that
11828 FP exceptions are enabled.
11829
11830 For instance, on the SB-1, if FP exceptions are disabled, and we
11831 are emitting 64-bit code, then we can use both FP pipes.
11832 Otherwise, we can only use one FP pipe.
11833
11834 -mvr4130-align
11835 -mno-vr4130-align
11836 The VR4130 pipeline is two-way superscalar, but can only issue two
11837 instructions together if the first one is 8-byte aligned. When
11838 this option is enabled, GCC will align pairs of instructions that
11839 it thinks should execute in parallel.
11840
11841 This option only has an effect when optimizing for the VR4130. It
11842 normally makes code faster, but at the expense of making it bigger.
11843 It is enabled by default at optimization level -O3.
11844
11845 -msynci
11846 -mno-synci
11847 Enable (disable) generation of "synci" instructions on
11848 architectures that support it. The "synci" instructions (if
11849 enabled) will be generated when "__builtin___clear_cache()" is
11850 compiled.
11851
11852 This option defaults to "-mno-synci", but the default can be
11853 overridden by configuring with "--with-synci".
11854
11855 When compiling code for single processor systems, it is generally
11856 safe to use "synci". However, on many multi-core (SMP) systems, it
11857 will not invalidate the instruction caches on all cores and may
11858 lead to undefined behavior.
11859
11860 -mrelax-pic-calls
11861 -mno-relax-pic-calls
11862 Try to turn PIC calls that are normally dispatched via register $25
11863 into direct calls. This is only possible if the linker can resolve
11864 the destination at link-time and if the destination is within range
11865 for a direct call.
11866
11867 -mrelax-pic-calls is the default if GCC was configured to use an
11868 assembler and a linker that supports the ".reloc" assembly
11869 directive and "-mexplicit-relocs" is in effect. With
11870 "-mno-explicit-relocs", this optimization can be performed by the
11871 assembler and the linker alone without help from the compiler.
11872
11873 -mmcount-ra-address
11874 -mno-mcount-ra-address
11875 Emit (do not emit) code that allows "_mcount" to modify the calling
11876 function's return address. When enabled, this option extends the
11877 usual "_mcount" interface with a new ra-address parameter, which
11878 has type "intptr_t *" and is passed in register $12. "_mcount" can
11879 then modify the return address by doing both of the following:
11880
11881 · Returning the new address in register $31.
11882
11883 · Storing the new address in "*ra-address", if ra-address is
11884 nonnull.
11885
11886 The default is -mno-mcount-ra-address.
11887
11888 MMIX Options
11889 These options are defined for the MMIX:
11890
11891 -mlibfuncs
11892 -mno-libfuncs
11893 Specify that intrinsic library functions are being compiled,
11894 passing all values in registers, no matter the size.
11895
11896 -mepsilon
11897 -mno-epsilon
11898 Generate floating-point comparison instructions that compare with
11899 respect to the "rE" epsilon register.
11900
11901 -mabi=mmixware
11902 -mabi=gnu
11903 Generate code that passes function parameters and return values
11904 that (in the called function) are seen as registers $0 and up, as
11905 opposed to the GNU ABI which uses global registers $231 and up.
11906
11907 -mzero-extend
11908 -mno-zero-extend
11909 When reading data from memory in sizes shorter than 64 bits, use
11910 (do not use) zero-extending load instructions by default, rather
11911 than sign-extending ones.
11912
11913 -mknuthdiv
11914 -mno-knuthdiv
11915 Make the result of a division yielding a remainder have the same
11916 sign as the divisor. With the default, -mno-knuthdiv, the sign of
11917 the remainder follows the sign of the dividend. Both methods are
11918 arithmetically valid, the latter being almost exclusively used.
11919
11920 -mtoplevel-symbols
11921 -mno-toplevel-symbols
11922 Prepend (do not prepend) a : to all global symbols, so the assembly
11923 code can be used with the "PREFIX" assembly directive.
11924
11925 -melf
11926 Generate an executable in the ELF format, rather than the default
11927 mmo format used by the mmix simulator.
11928
11929 -mbranch-predict
11930 -mno-branch-predict
11931 Use (do not use) the probable-branch instructions, when static
11932 branch prediction indicates a probable branch.
11933
11934 -mbase-addresses
11935 -mno-base-addresses
11936 Generate (do not generate) code that uses base addresses. Using a
11937 base address automatically generates a request (handled by the
11938 assembler and the linker) for a constant to be set up in a global
11939 register. The register is used for one or more base address
11940 requests within the range 0 to 255 from the value held in the
11941 register. The generally leads to short and fast code, but the
11942 number of different data items that can be addressed is limited.
11943 This means that a program that uses lots of static data may require
11944 -mno-base-addresses.
11945
11946 -msingle-exit
11947 -mno-single-exit
11948 Force (do not force) generated code to have a single exit point in
11949 each function.
11950
11951 MN10300 Options
11952 These -m options are defined for Matsushita MN10300 architectures:
11953
11954 -mmult-bug
11955 Generate code to avoid bugs in the multiply instructions for the
11956 MN10300 processors. This is the default.
11957
11958 -mno-mult-bug
11959 Do not generate code to avoid bugs in the multiply instructions for
11960 the MN10300 processors.
11961
11962 -mam33
11963 Generate code which uses features specific to the AM33 processor.
11964
11965 -mno-am33
11966 Do not generate code which uses features specific to the AM33
11967 processor. This is the default.
11968
11969 -mreturn-pointer-on-d0
11970 When generating a function which returns a pointer, return the
11971 pointer in both "a0" and "d0". Otherwise, the pointer is returned
11972 only in a0, and attempts to call such functions without a prototype
11973 would result in errors. Note that this option is on by default;
11974 use -mno-return-pointer-on-d0 to disable it.
11975
11976 -mno-crt0
11977 Do not link in the C run-time initialization object file.
11978
11979 -mrelax
11980 Indicate to the linker that it should perform a relaxation
11981 optimization pass to shorten branches, calls and absolute memory
11982 addresses. This option only has an effect when used on the command
11983 line for the final link step.
11984
11985 This option makes symbolic debugging impossible.
11986
11987 PDP-11 Options
11988 These options are defined for the PDP-11:
11989
11990 -mfpu
11991 Use hardware FPP floating point. This is the default. (FIS
11992 floating point on the PDP-11/40 is not supported.)
11993
11994 -msoft-float
11995 Do not use hardware floating point.
11996
11997 -mac0
11998 Return floating-point results in ac0 (fr0 in Unix assembler
11999 syntax).
12000
12001 -mno-ac0
12002 Return floating-point results in memory. This is the default.
12003
12004 -m40
12005 Generate code for a PDP-11/40.
12006
12007 -m45
12008 Generate code for a PDP-11/45. This is the default.
12009
12010 -m10
12011 Generate code for a PDP-11/10.
12012
12013 -mbcopy-builtin
12014 Use inline "movmemhi" patterns for copying memory. This is the
12015 default.
12016
12017 -mbcopy
12018 Do not use inline "movmemhi" patterns for copying memory.
12019
12020 -mint16
12021 -mno-int32
12022 Use 16-bit "int". This is the default.
12023
12024 -mint32
12025 -mno-int16
12026 Use 32-bit "int".
12027
12028 -mfloat64
12029 -mno-float32
12030 Use 64-bit "float". This is the default.
12031
12032 -mfloat32
12033 -mno-float64
12034 Use 32-bit "float".
12035
12036 -mabshi
12037 Use "abshi2" pattern. This is the default.
12038
12039 -mno-abshi
12040 Do not use "abshi2" pattern.
12041
12042 -mbranch-expensive
12043 Pretend that branches are expensive. This is for experimenting
12044 with code generation only.
12045
12046 -mbranch-cheap
12047 Do not pretend that branches are expensive. This is the default.
12048
12049 -msplit
12050 Generate code for a system with split I&D.
12051
12052 -mno-split
12053 Generate code for a system without split I&D. This is the default.
12054
12055 -munix-asm
12056 Use Unix assembler syntax. This is the default when configured for
12057 pdp11-*-bsd.
12058
12059 -mdec-asm
12060 Use DEC assembler syntax. This is the default when configured for
12061 any PDP-11 target other than pdp11-*-bsd.
12062
12063 picoChip Options
12064 These -m options are defined for picoChip implementations:
12065
12066 -mae=ae_type
12067 Set the instruction set, register set, and instruction scheduling
12068 parameters for array element type ae_type. Supported values for
12069 ae_type are ANY, MUL, and MAC.
12070
12071 -mae=ANY selects a completely generic AE type. Code generated with
12072 this option will run on any of the other AE types. The code will
12073 not be as efficient as it would be if compiled for a specific AE
12074 type, and some types of operation (e.g., multiplication) will not
12075 work properly on all types of AE.
12076
12077 -mae=MUL selects a MUL AE type. This is the most useful AE type
12078 for compiled code, and is the default.
12079
12080 -mae=MAC selects a DSP-style MAC AE. Code compiled with this
12081 option may suffer from poor performance of byte (char)
12082 manipulation, since the DSP AE does not provide hardware support
12083 for byte load/stores.
12084
12085 -msymbol-as-address
12086 Enable the compiler to directly use a symbol name as an address in
12087 a load/store instruction, without first loading it into a register.
12088 Typically, the use of this option will generate larger programs,
12089 which run faster than when the option isn't used. However, the
12090 results vary from program to program, so it is left as a user
12091 option, rather than being permanently enabled.
12092
12093 -mno-inefficient-warnings
12094 Disables warnings about the generation of inefficient code. These
12095 warnings can be generated, for example, when compiling code which
12096 performs byte-level memory operations on the MAC AE type. The MAC
12097 AE has no hardware support for byte-level memory operations, so all
12098 byte load/stores must be synthesized from word load/store
12099 operations. This is inefficient and a warning will be generated
12100 indicating to the programmer that they should rewrite the code to
12101 avoid byte operations, or to target an AE type which has the
12102 necessary hardware support. This option enables the warning to be
12103 turned off.
12104
12105 PowerPC Options
12106 These are listed under
12107
12108 IBM RS/6000 and PowerPC Options
12109 These -m options are defined for the IBM RS/6000 and PowerPC:
12110
12111 -mpower
12112 -mno-power
12113 -mpower2
12114 -mno-power2
12115 -mpowerpc
12116 -mno-powerpc
12117 -mpowerpc-gpopt
12118 -mno-powerpc-gpopt
12119 -mpowerpc-gfxopt
12120 -mno-powerpc-gfxopt
12121 -mpowerpc64
12122 -mno-powerpc64
12123 -mmfcrf
12124 -mno-mfcrf
12125 -mpopcntb
12126 -mno-popcntb
12127 -mpopcntd
12128 -mno-popcntd
12129 -mfprnd
12130 -mno-fprnd
12131 -mcmpb
12132 -mno-cmpb
12133 -mmfpgpr
12134 -mno-mfpgpr
12135 -mhard-dfp
12136 -mno-hard-dfp
12137 GCC supports two related instruction set architectures for the
12138 RS/6000 and PowerPC. The POWER instruction set are those
12139 instructions supported by the rios chip set used in the original
12140 RS/6000 systems and the PowerPC instruction set is the architecture
12141 of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and the
12142 IBM 4xx, 6xx, and follow-on microprocessors.
12143
12144 Neither architecture is a subset of the other. However there is a
12145 large common subset of instructions supported by both. An MQ
12146 register is included in processors supporting the POWER
12147 architecture.
12148
12149 You use these options to specify which instructions are available
12150 on the processor you are using. The default value of these options
12151 is determined when configuring GCC. Specifying the -mcpu=cpu_type
12152 overrides the specification of these options. We recommend you use
12153 the -mcpu=cpu_type option rather than the options listed above.
12154
12155 The -mpower option allows GCC to generate instructions that are
12156 found only in the POWER architecture and to use the MQ register.
12157 Specifying -mpower2 implies -power and also allows GCC to generate
12158 instructions that are present in the POWER2 architecture but not
12159 the original POWER architecture.
12160
12161 The -mpowerpc option allows GCC to generate instructions that are
12162 found only in the 32-bit subset of the PowerPC architecture.
12163 Specifying -mpowerpc-gpopt implies -mpowerpc and also allows GCC to
12164 use the optional PowerPC architecture instructions in the General
12165 Purpose group, including floating-point square root. Specifying
12166 -mpowerpc-gfxopt implies -mpowerpc and also allows GCC to use the
12167 optional PowerPC architecture instructions in the Graphics group,
12168 including floating-point select.
12169
12170 The -mmfcrf option allows GCC to generate the move from condition
12171 register field instruction implemented on the POWER4 processor and
12172 other processors that support the PowerPC V2.01 architecture. The
12173 -mpopcntb option allows GCC to generate the popcount and double
12174 precision FP reciprocal estimate instruction implemented on the
12175 POWER5 processor and other processors that support the PowerPC
12176 V2.02 architecture. The -mpopcntd option allows GCC to generate
12177 the popcount instruction implemented on the POWER7 processor and
12178 other processors that support the PowerPC V2.06 architecture. The
12179 -mfprnd option allows GCC to generate the FP round to integer
12180 instructions implemented on the POWER5+ processor and other
12181 processors that support the PowerPC V2.03 architecture. The -mcmpb
12182 option allows GCC to generate the compare bytes instruction
12183 implemented on the POWER6 processor and other processors that
12184 support the PowerPC V2.05 architecture. The -mmfpgpr option allows
12185 GCC to generate the FP move to/from general purpose register
12186 instructions implemented on the POWER6X processor and other
12187 processors that support the extended PowerPC V2.05 architecture.
12188 The -mhard-dfp option allows GCC to generate the decimal floating
12189 point instructions implemented on some POWER processors.
12190
12191 The -mpowerpc64 option allows GCC to generate the additional 64-bit
12192 instructions that are found in the full PowerPC64 architecture and
12193 to treat GPRs as 64-bit, doubleword quantities. GCC defaults to
12194 -mno-powerpc64.
12195
12196 If you specify both -mno-power and -mno-powerpc, GCC will use only
12197 the instructions in the common subset of both architectures plus
12198 some special AIX common-mode calls, and will not use the MQ
12199 register. Specifying both -mpower and -mpowerpc permits GCC to use
12200 any instruction from either architecture and to allow use of the MQ
12201 register; specify this for the Motorola MPC601.
12202
12203 -mnew-mnemonics
12204 -mold-mnemonics
12205 Select which mnemonics to use in the generated assembler code.
12206 With -mnew-mnemonics, GCC uses the assembler mnemonics defined for
12207 the PowerPC architecture. With -mold-mnemonics it uses the
12208 assembler mnemonics defined for the POWER architecture.
12209 Instructions defined in only one architecture have only one
12210 mnemonic; GCC uses that mnemonic irrespective of which of these
12211 options is specified.
12212
12213 GCC defaults to the mnemonics appropriate for the architecture in
12214 use. Specifying -mcpu=cpu_type sometimes overrides the value of
12215 these option. Unless you are building a cross-compiler, you should
12216 normally not specify either -mnew-mnemonics or -mold-mnemonics, but
12217 should instead accept the default.
12218
12219 -mcpu=cpu_type
12220 Set architecture type, register usage, choice of mnemonics, and
12221 instruction scheduling parameters for machine type cpu_type.
12222 Supported values for cpu_type are 401, 403, 405, 405fp, 440, 440fp,
12223 464, 464fp, 476, 476fp, 505, 601, 602, 603, 603e, 604, 604e, 620,
12224 630, 740, 7400, 7450, 750, 801, 821, 823, 860, 970, 8540, a2,
12225 e300c2, e300c3, e500mc, e500mc64, ec603e, G3, G4, G5, power,
12226 power2, power3, power4, power5, power5+, power6, power6x, power7,
12227 common, powerpc, powerpc64, rios, rios1, rios2, rsc, and rs64.
12228
12229 -mcpu=common selects a completely generic processor. Code
12230 generated under this option will run on any POWER or PowerPC
12231 processor. GCC will use only the instructions in the common subset
12232 of both architectures, and will not use the MQ register. GCC
12233 assumes a generic processor model for scheduling purposes.
12234
12235 -mcpu=power, -mcpu=power2, -mcpu=powerpc, and -mcpu=powerpc64
12236 specify generic POWER, POWER2, pure 32-bit PowerPC (i.e., not
12237 MPC601), and 64-bit PowerPC architecture machine types, with an
12238 appropriate, generic processor model assumed for scheduling
12239 purposes.
12240
12241 The other options specify a specific processor. Code generated
12242 under those options will run best on that processor, and may not
12243 run at all on others.
12244
12245 The -mcpu options automatically enable or disable the following
12246 options:
12247
12248 -maltivec -mfprnd -mhard-float -mmfcrf -mmultiple
12249 -mnew-mnemonics -mpopcntb -mpopcntd -mpower -mpower2
12250 -mpowerpc64 -mpowerpc-gpopt -mpowerpc-gfxopt -msingle-float
12251 -mdouble-float -msimple-fpu -mstring -mmulhw -mdlmzb -mmfpgpr
12252 -mvsx
12253
12254 The particular options set for any particular CPU will vary between
12255 compiler versions, depending on what setting seems to produce
12256 optimal code for that CPU; it doesn't necessarily reflect the
12257 actual hardware's capabilities. If you wish to set an individual
12258 option to a particular value, you may specify it after the -mcpu
12259 option, like -mcpu=970 -mno-altivec.
12260
12261 On AIX, the -maltivec and -mpowerpc64 options are not enabled or
12262 disabled by the -mcpu option at present because AIX does not have
12263 full support for these options. You may still enable or disable
12264 them individually if you're sure it'll work in your environment.
12265
12266 -mtune=cpu_type
12267 Set the instruction scheduling parameters for machine type
12268 cpu_type, but do not set the architecture type, register usage, or
12269 choice of mnemonics, as -mcpu=cpu_type would. The same values for
12270 cpu_type are used for -mtune as for -mcpu. If both are specified,
12271 the code generated will use the architecture, registers, and
12272 mnemonics set by -mcpu, but the scheduling parameters set by
12273 -mtune.
12274
12275 -mswdiv
12276 -mno-swdiv
12277 Generate code to compute division as reciprocal estimate and
12278 iterative refinement, creating opportunities for increased
12279 throughput. This feature requires: optional PowerPC Graphics
12280 instruction set for single precision and FRE instruction for double
12281 precision, assuming divides cannot generate user-visible traps, and
12282 the domain values not include Infinities, denormals or zero
12283 denominator.
12284
12285 -maltivec
12286 -mno-altivec
12287 Generate code that uses (does not use) AltiVec instructions, and
12288 also enable the use of built-in functions that allow more direct
12289 access to the AltiVec instruction set. You may also need to set
12290 -mabi=altivec to adjust the current ABI with AltiVec ABI
12291 enhancements.
12292
12293 -mvrsave
12294 -mno-vrsave
12295 Generate VRSAVE instructions when generating AltiVec code.
12296
12297 -mgen-cell-microcode
12298 Generate Cell microcode instructions
12299
12300 -mwarn-cell-microcode
12301 Warning when a Cell microcode instruction is going to emitted. An
12302 example of a Cell microcode instruction is a variable shift.
12303
12304 -msecure-plt
12305 Generate code that allows ld and ld.so to build executables and
12306 shared libraries with non-exec .plt and .got sections. This is a
12307 PowerPC 32-bit SYSV ABI option.
12308
12309 -mbss-plt
12310 Generate code that uses a BSS .plt section that ld.so fills in, and
12311 requires .plt and .got sections that are both writable and
12312 executable. This is a PowerPC 32-bit SYSV ABI option.
12313
12314 -misel
12315 -mno-isel
12316 This switch enables or disables the generation of ISEL
12317 instructions.
12318
12319 -misel=yes/no
12320 This switch has been deprecated. Use -misel and -mno-isel instead.
12321
12322 -mspe
12323 -mno-spe
12324 This switch enables or disables the generation of SPE simd
12325 instructions.
12326
12327 -mpaired
12328 -mno-paired
12329 This switch enables or disables the generation of PAIRED simd
12330 instructions.
12331
12332 -mspe=yes/no
12333 This option has been deprecated. Use -mspe and -mno-spe instead.
12334
12335 -mvsx
12336 -mno-vsx
12337 Generate code that uses (does not use) vector/scalar (VSX)
12338 instructions, and also enable the use of built-in functions that
12339 allow more direct access to the VSX instruction set.
12340
12341 -mfloat-gprs=yes/single/double/no
12342 -mfloat-gprs
12343 This switch enables or disables the generation of floating point
12344 operations on the general purpose registers for architectures that
12345 support it.
12346
12347 The argument yes or single enables the use of single-precision
12348 floating point operations.
12349
12350 The argument double enables the use of single and double-precision
12351 floating point operations.
12352
12353 The argument no disables floating point operations on the general
12354 purpose registers.
12355
12356 This option is currently only available on the MPC854x.
12357
12358 -m32
12359 -m64
12360 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
12361 targets (including GNU/Linux). The 32-bit environment sets int,
12362 long and pointer to 32 bits and generates code that runs on any
12363 PowerPC variant. The 64-bit environment sets int to 32 bits and
12364 long and pointer to 64 bits, and generates code for PowerPC64, as
12365 for -mpowerpc64.
12366
12367 -mfull-toc
12368 -mno-fp-in-toc
12369 -mno-sum-in-toc
12370 -mminimal-toc
12371 Modify generation of the TOC (Table Of Contents), which is created
12372 for every executable file. The -mfull-toc option is selected by
12373 default. In that case, GCC will allocate at least one TOC entry
12374 for each unique non-automatic variable reference in your program.
12375 GCC will also place floating-point constants in the TOC. However,
12376 only 16,384 entries are available in the TOC.
12377
12378 If you receive a linker error message that saying you have
12379 overflowed the available TOC space, you can reduce the amount of
12380 TOC space used with the -mno-fp-in-toc and -mno-sum-in-toc options.
12381 -mno-fp-in-toc prevents GCC from putting floating-point constants
12382 in the TOC and -mno-sum-in-toc forces GCC to generate code to
12383 calculate the sum of an address and a constant at run-time instead
12384 of putting that sum into the TOC. You may specify one or both of
12385 these options. Each causes GCC to produce very slightly slower and
12386 larger code at the expense of conserving TOC space.
12387
12388 If you still run out of space in the TOC even when you specify both
12389 of these options, specify -mminimal-toc instead. This option
12390 causes GCC to make only one TOC entry for every file. When you
12391 specify this option, GCC will produce code that is slower and
12392 larger but which uses extremely little TOC space. You may wish to
12393 use this option only on files that contain less frequently executed
12394 code.
12395
12396 -maix64
12397 -maix32
12398 Enable 64-bit AIX ABI and calling convention: 64-bit pointers,
12399 64-bit "long" type, and the infrastructure needed to support them.
12400 Specifying -maix64 implies -mpowerpc64 and -mpowerpc, while -maix32
12401 disables the 64-bit ABI and implies -mno-powerpc64. GCC defaults
12402 to -maix32.
12403
12404 -mxl-compat
12405 -mno-xl-compat
12406 Produce code that conforms more closely to IBM XL compiler
12407 semantics when using AIX-compatible ABI. Pass floating-point
12408 arguments to prototyped functions beyond the register save area
12409 (RSA) on the stack in addition to argument FPRs. Do not assume
12410 that most significant double in 128-bit long double value is
12411 properly rounded when comparing values and converting to double.
12412 Use XL symbol names for long double support routines.
12413
12414 The AIX calling convention was extended but not initially
12415 documented to handle an obscure K&R C case of calling a function
12416 that takes the address of its arguments with fewer arguments than
12417 declared. IBM XL compilers access floating point arguments which
12418 do not fit in the RSA from the stack when a subroutine is compiled
12419 without optimization. Because always storing floating-point
12420 arguments on the stack is inefficient and rarely needed, this
12421 option is not enabled by default and only is necessary when calling
12422 subroutines compiled by IBM XL compilers without optimization.
12423
12424 -mpe
12425 Support IBM RS/6000 SP Parallel Environment (PE). Link an
12426 application written to use message passing with special startup
12427 code to enable the application to run. The system must have PE
12428 installed in the standard location (/usr/lpp/ppe.poe/), or the
12429 specs file must be overridden with the -specs= option to specify
12430 the appropriate directory location. The Parallel Environment does
12431 not support threads, so the -mpe option and the -pthread option are
12432 incompatible.
12433
12434 -malign-natural
12435 -malign-power
12436 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
12437 -malign-natural overrides the ABI-defined alignment of larger
12438 types, such as floating-point doubles, on their natural size-based
12439 boundary. The option -malign-power instructs GCC to follow the
12440 ABI-specified alignment rules. GCC defaults to the standard
12441 alignment defined in the ABI.
12442
12443 On 64-bit Darwin, natural alignment is the default, and
12444 -malign-power is not supported.
12445
12446 -msoft-float
12447 -mhard-float
12448 Generate code that does not use (uses) the floating-point register
12449 set. Software floating point emulation is provided if you use the
12450 -msoft-float option, and pass the option to GCC when linking.
12451
12452 -msingle-float
12453 -mdouble-float
12454 Generate code for single or double-precision floating point
12455 operations. -mdouble-float implies -msingle-float.
12456
12457 -msimple-fpu
12458 Do not generate sqrt and div instructions for hardware floating
12459 point unit.
12460
12461 -mfpu
12462 Specify type of floating point unit. Valid values are sp_lite
12463 (equivalent to -msingle-float -msimple-fpu), dp_lite (equivalent to
12464 -mdouble-float -msimple-fpu), sp_full (equivalent to
12465 -msingle-float), and dp_full (equivalent to -mdouble-float).
12466
12467 -mxilinx-fpu
12468 Perform optimizations for floating point unit on Xilinx PPC
12469 405/440.
12470
12471 -mmultiple
12472 -mno-multiple
12473 Generate code that uses (does not use) the load multiple word
12474 instructions and the store multiple word instructions. These
12475 instructions are generated by default on POWER systems, and not
12476 generated on PowerPC systems. Do not use -mmultiple on little
12477 endian PowerPC systems, since those instructions do not work when
12478 the processor is in little endian mode. The exceptions are PPC740
12479 and PPC750 which permit the instructions usage in little endian
12480 mode.
12481
12482 -mstring
12483 -mno-string
12484 Generate code that uses (does not use) the load string instructions
12485 and the store string word instructions to save multiple registers
12486 and do small block moves. These instructions are generated by
12487 default on POWER systems, and not generated on PowerPC systems. Do
12488 not use -mstring on little endian PowerPC systems, since those
12489 instructions do not work when the processor is in little endian
12490 mode. The exceptions are PPC740 and PPC750 which permit the
12491 instructions usage in little endian mode.
12492
12493 -mupdate
12494 -mno-update
12495 Generate code that uses (does not use) the load or store
12496 instructions that update the base register to the address of the
12497 calculated memory location. These instructions are generated by
12498 default. If you use -mno-update, there is a small window between
12499 the time that the stack pointer is updated and the address of the
12500 previous frame is stored, which means code that walks the stack
12501 frame across interrupts or signals may get corrupted data.
12502
12503 -mavoid-indexed-addresses
12504 -mno-avoid-indexed-addresses
12505 Generate code that tries to avoid (not avoid) the use of indexed
12506 load or store instructions. These instructions can incur a
12507 performance penalty on Power6 processors in certain situations,
12508 such as when stepping through large arrays that cross a 16M
12509 boundary. This option is enabled by default when targetting Power6
12510 and disabled otherwise.
12511
12512 -mfused-madd
12513 -mno-fused-madd
12514 Generate code that uses (does not use) the floating point multiply
12515 and accumulate instructions. These instructions are generated by
12516 default if hardware floating is used.
12517
12518 -mmulhw
12519 -mno-mulhw
12520 Generate code that uses (does not use) the half-word multiply and
12521 multiply-accumulate instructions on the IBM 405, 440, 464 and 476
12522 processors. These instructions are generated by default when
12523 targetting those processors.
12524
12525 -mdlmzb
12526 -mno-dlmzb
12527 Generate code that uses (does not use) the string-search dlmzb
12528 instruction on the IBM 405, 440, 464 and 476 processors. This
12529 instruction is generated by default when targetting those
12530 processors.
12531
12532 -mno-bit-align
12533 -mbit-align
12534 On System V.4 and embedded PowerPC systems do not (do) force
12535 structures and unions that contain bit-fields to be aligned to the
12536 base type of the bit-field.
12537
12538 For example, by default a structure containing nothing but 8
12539 "unsigned" bit-fields of length 1 would be aligned to a 4 byte
12540 boundary and have a size of 4 bytes. By using -mno-bit-align, the
12541 structure would be aligned to a 1 byte boundary and be one byte in
12542 size.
12543
12544 -mno-strict-align
12545 -mstrict-align
12546 On System V.4 and embedded PowerPC systems do not (do) assume that
12547 unaligned memory references will be handled by the system.
12548
12549 -mrelocatable
12550 -mno-relocatable
12551 On embedded PowerPC systems generate code that allows (does not
12552 allow) the program to be relocated to a different address at
12553 runtime. If you use -mrelocatable on any module, all objects
12554 linked together must be compiled with -mrelocatable or
12555 -mrelocatable-lib.
12556
12557 -mrelocatable-lib
12558 -mno-relocatable-lib
12559 On embedded PowerPC systems generate code that allows (does not
12560 allow) the program to be relocated to a different address at
12561 runtime. Modules compiled with -mrelocatable-lib can be linked
12562 with either modules compiled without -mrelocatable and
12563 -mrelocatable-lib or with modules compiled with the -mrelocatable
12564 options.
12565
12566 -mno-toc
12567 -mtoc
12568 On System V.4 and embedded PowerPC systems do not (do) assume that
12569 register 2 contains a pointer to a global area pointing to the
12570 addresses used in the program.
12571
12572 -mlittle
12573 -mlittle-endian
12574 On System V.4 and embedded PowerPC systems compile code for the
12575 processor in little endian mode. The -mlittle-endian option is the
12576 same as -mlittle.
12577
12578 -mbig
12579 -mbig-endian
12580 On System V.4 and embedded PowerPC systems compile code for the
12581 processor in big endian mode. The -mbig-endian option is the same
12582 as -mbig.
12583
12584 -mdynamic-no-pic
12585 On Darwin and Mac OS X systems, compile code so that it is not
12586 relocatable, but that its external references are relocatable. The
12587 resulting code is suitable for applications, but not shared
12588 libraries.
12589
12590 -mprioritize-restricted-insns=priority
12591 This option controls the priority that is assigned to dispatch-slot
12592 restricted instructions during the second scheduling pass. The
12593 argument priority takes the value 0/1/2 to assign
12594 no/highest/second-highest priority to dispatch slot restricted
12595 instructions.
12596
12597 -msched-costly-dep=dependence_type
12598 This option controls which dependences are considered costly by the
12599 target during instruction scheduling. The argument dependence_type
12600 takes one of the following values: no: no dependence is costly,
12601 all: all dependences are costly, true_store_to_load: a true
12602 dependence from store to load is costly, store_to_load: any
12603 dependence from store to load is costly, number: any dependence
12604 which latency >= number is costly.
12605
12606 -minsert-sched-nops=scheme
12607 This option controls which nop insertion scheme will be used during
12608 the second scheduling pass. The argument scheme takes one of the
12609 following values: no: Don't insert nops. pad: Pad with nops any
12610 dispatch group which has vacant issue slots, according to the
12611 scheduler's grouping. regroup_exact: Insert nops to force costly
12612 dependent insns into separate groups. Insert exactly as many nops
12613 as needed to force an insn to a new group, according to the
12614 estimated processor grouping. number: Insert nops to force costly
12615 dependent insns into separate groups. Insert number nops to force
12616 an insn to a new group.
12617
12618 -mcall-sysv
12619 On System V.4 and embedded PowerPC systems compile code using
12620 calling conventions that adheres to the March 1995 draft of the
12621 System V Application Binary Interface, PowerPC processor
12622 supplement. This is the default unless you configured GCC using
12623 powerpc-*-eabiaix.
12624
12625 -mcall-sysv-eabi
12626 -mcall-eabi
12627 Specify both -mcall-sysv and -meabi options.
12628
12629 -mcall-sysv-noeabi
12630 Specify both -mcall-sysv and -mno-eabi options.
12631
12632 -mcall-aixdesc
12633 On System V.4 and embedded PowerPC systems compile code for the AIX
12634 operating system.
12635
12636 -mcall-linux
12637 On System V.4 and embedded PowerPC systems compile code for the
12638 Linux-based GNU system.
12639
12640 -mcall-gnu
12641 On System V.4 and embedded PowerPC systems compile code for the
12642 Hurd-based GNU system.
12643
12644 -mcall-freebsd
12645 On System V.4 and embedded PowerPC systems compile code for the
12646 FreeBSD operating system.
12647
12648 -mcall-netbsd
12649 On System V.4 and embedded PowerPC systems compile code for the
12650 NetBSD operating system.
12651
12652 -mcall-openbsd
12653 On System V.4 and embedded PowerPC systems compile code for the
12654 OpenBSD operating system.
12655
12656 -maix-struct-return
12657 Return all structures in memory (as specified by the AIX ABI).
12658
12659 -msvr4-struct-return
12660 Return structures smaller than 8 bytes in registers (as specified
12661 by the SVR4 ABI).
12662
12663 -mabi=abi-type
12664 Extend the current ABI with a particular extension, or remove such
12665 extension. Valid values are altivec, no-altivec, spe, no-spe,
12666 ibmlongdouble, ieeelongdouble.
12667
12668 -mabi=spe
12669 Extend the current ABI with SPE ABI extensions. This does not
12670 change the default ABI, instead it adds the SPE ABI extensions to
12671 the current ABI.
12672
12673 -mabi=no-spe
12674 Disable Booke SPE ABI extensions for the current ABI.
12675
12676 -mabi=ibmlongdouble
12677 Change the current ABI to use IBM extended precision long double.
12678 This is a PowerPC 32-bit SYSV ABI option.
12679
12680 -mabi=ieeelongdouble
12681 Change the current ABI to use IEEE extended precision long double.
12682 This is a PowerPC 32-bit Linux ABI option.
12683
12684 -mprototype
12685 -mno-prototype
12686 On System V.4 and embedded PowerPC systems assume that all calls to
12687 variable argument functions are properly prototyped. Otherwise,
12688 the compiler must insert an instruction before every non prototyped
12689 call to set or clear bit 6 of the condition code register (CR) to
12690 indicate whether floating point values were passed in the floating
12691 point registers in case the function takes a variable arguments.
12692 With -mprototype, only calls to prototyped variable argument
12693 functions will set or clear the bit.
12694
12695 -msim
12696 On embedded PowerPC systems, assume that the startup module is
12697 called sim-crt0.o and that the standard C libraries are libsim.a
12698 and libc.a. This is the default for powerpc-*-eabisim
12699 configurations.
12700
12701 -mmvme
12702 On embedded PowerPC systems, assume that the startup module is
12703 called crt0.o and the standard C libraries are libmvme.a and
12704 libc.a.
12705
12706 -mads
12707 On embedded PowerPC systems, assume that the startup module is
12708 called crt0.o and the standard C libraries are libads.a and libc.a.
12709
12710 -myellowknife
12711 On embedded PowerPC systems, assume that the startup module is
12712 called crt0.o and the standard C libraries are libyk.a and libc.a.
12713
12714 -mvxworks
12715 On System V.4 and embedded PowerPC systems, specify that you are
12716 compiling for a VxWorks system.
12717
12718 -memb
12719 On embedded PowerPC systems, set the PPC_EMB bit in the ELF flags
12720 header to indicate that eabi extended relocations are used.
12721
12722 -meabi
12723 -mno-eabi
12724 On System V.4 and embedded PowerPC systems do (do not) adhere to
12725 the Embedded Applications Binary Interface (eabi) which is a set of
12726 modifications to the System V.4 specifications. Selecting -meabi
12727 means that the stack is aligned to an 8 byte boundary, a function
12728 "__eabi" is called to from "main" to set up the eabi environment,
12729 and the -msdata option can use both "r2" and "r13" to point to two
12730 separate small data areas. Selecting -mno-eabi means that the
12731 stack is aligned to a 16 byte boundary, do not call an
12732 initialization function from "main", and the -msdata option will
12733 only use "r13" to point to a single small data area. The -meabi
12734 option is on by default if you configured GCC using one of the
12735 powerpc*-*-eabi* options.
12736
12737 -msdata=eabi
12738 On System V.4 and embedded PowerPC systems, put small initialized
12739 "const" global and static data in the .sdata2 section, which is
12740 pointed to by register "r2". Put small initialized non-"const"
12741 global and static data in the .sdata section, which is pointed to
12742 by register "r13". Put small uninitialized global and static data
12743 in the .sbss section, which is adjacent to the .sdata section. The
12744 -msdata=eabi option is incompatible with the -mrelocatable option.
12745 The -msdata=eabi option also sets the -memb option.
12746
12747 -msdata=sysv
12748 On System V.4 and embedded PowerPC systems, put small global and
12749 static data in the .sdata section, which is pointed to by register
12750 "r13". Put small uninitialized global and static data in the .sbss
12751 section, which is adjacent to the .sdata section. The -msdata=sysv
12752 option is incompatible with the -mrelocatable option.
12753
12754 -msdata=default
12755 -msdata
12756 On System V.4 and embedded PowerPC systems, if -meabi is used,
12757 compile code the same as -msdata=eabi, otherwise compile code the
12758 same as -msdata=sysv.
12759
12760 -msdata=data
12761 On System V.4 and embedded PowerPC systems, put small global data
12762 in the .sdata section. Put small uninitialized global data in the
12763 .sbss section. Do not use register "r13" to address small data
12764 however. This is the default behavior unless other -msdata options
12765 are used.
12766
12767 -msdata=none
12768 -mno-sdata
12769 On embedded PowerPC systems, put all initialized global and static
12770 data in the .data section, and all uninitialized data in the .bss
12771 section.
12772
12773 -G num
12774 On embedded PowerPC systems, put global and static items less than
12775 or equal to num bytes into the small data or bss sections instead
12776 of the normal data or bss section. By default, num is 8. The -G
12777 num switch is also passed to the linker. All modules should be
12778 compiled with the same -G num value.
12779
12780 -mregnames
12781 -mno-regnames
12782 On System V.4 and embedded PowerPC systems do (do not) emit
12783 register names in the assembly language output using symbolic
12784 forms.
12785
12786 -mlongcall
12787 -mno-longcall
12788 By default assume that all calls are far away so that a longer more
12789 expensive calling sequence is required. This is required for calls
12790 further than 32 megabytes (33,554,432 bytes) from the current
12791 location. A short call will be generated if the compiler knows the
12792 call cannot be that far away. This setting can be overridden by
12793 the "shortcall" function attribute, or by "#pragma longcall(0)".
12794
12795 Some linkers are capable of detecting out-of-range calls and
12796 generating glue code on the fly. On these systems, long calls are
12797 unnecessary and generate slower code. As of this writing, the AIX
12798 linker can do this, as can the GNU linker for PowerPC/64. It is
12799 planned to add this feature to the GNU linker for 32-bit PowerPC
12800 systems as well.
12801
12802 On Darwin/PPC systems, "#pragma longcall" will generate "jbsr
12803 callee, L42", plus a "branch island" (glue code). The two target
12804 addresses represent the callee and the "branch island". The
12805 Darwin/PPC linker will prefer the first address and generate a "bl
12806 callee" if the PPC "bl" instruction will reach the callee directly;
12807 otherwise, the linker will generate "bl L42" to call the "branch
12808 island". The "branch island" is appended to the body of the
12809 calling function; it computes the full 32-bit address of the callee
12810 and jumps to it.
12811
12812 On Mach-O (Darwin) systems, this option directs the compiler emit
12813 to the glue for every direct call, and the Darwin linker decides
12814 whether to use or discard it.
12815
12816 In the future, we may cause GCC to ignore all longcall
12817 specifications when the linker is known to generate glue.
12818
12819 -mtls-markers
12820 -mno-tls-markers
12821 Mark (do not mark) calls to "__tls_get_addr" with a relocation
12822 specifying the function argument. The relocation allows ld to
12823 reliably associate function call with argument setup instructions
12824 for TLS optimization, which in turn allows gcc to better schedule
12825 the sequence.
12826
12827 -pthread
12828 Adds support for multithreading with the pthreads library. This
12829 option sets flags for both the preprocessor and linker.
12830
12831 RX Options
12832 These command line options are defined for RX targets:
12833
12834 -m64bit-doubles
12835 -m32bit-doubles
12836 Make the "double" data type be 64-bits (-m64bit-doubles) or 32-bits
12837 (-m32bit-doubles) in size. The default is -m32bit-doubles. Note
12838 RX floating point hardware only works on 32-bit values, which is
12839 why the default is -m32bit-doubles.
12840
12841 -fpu
12842 -nofpu
12843 Enables (-fpu) or disables (-nofpu) the use of RX floating point
12844 hardware. The default is enabled for the RX600 series and disabled
12845 for the RX200 series.
12846
12847 Floating point instructions will only be generated for 32-bit
12848 floating point values however, so if the -m64bit-doubles option is
12849 in use then the FPU hardware will not be used for doubles.
12850
12851 Note If the -fpu option is enabled then -funsafe-math-optimizations
12852 is also enabled automatically. This is because the RX FPU
12853 instructions are themselves unsafe.
12854
12855 -mcpu=name
12856 -patch=name
12857 Selects the type of RX CPU to be targeted. Currently three types
12858 are supported, the generic RX600 and RX200 series hardware and the
12859 specific RX610 cpu. The default is RX600.
12860
12861 The only difference between RX600 and RX610 is that the RX610 does
12862 not support the "MVTIPL" instruction.
12863
12864 The RX200 series does not have a hardware floating point unit and
12865 so -nofpu is enabled by default when this type is selected.
12866
12867 -mbig-endian-data
12868 -mlittle-endian-data
12869 Store data (but not code) in the big-endian format. The default is
12870 -mlittle-endian-data, ie to store data in the little endian format.
12871
12872 -msmall-data-limit=N
12873 Specifies the maximum size in bytes of global and static variables
12874 which can be placed into the small data area. Using the small data
12875 area can lead to smaller and faster code, but the size of area is
12876 limited and it is up to the programmer to ensure that the area does
12877 not overflow. Also when the small data area is used one of the
12878 RX's registers ("r13") is reserved for use pointing to this area,
12879 so it is no longer available for use by the compiler. This could
12880 result in slower and/or larger code if variables which once could
12881 have been held in "r13" are now pushed onto the stack.
12882
12883 Note, common variables (variables which have not been initialised)
12884 and constants are not placed into the small data area as they are
12885 assigned to other sections in the output executable.
12886
12887 The default value is zero, which disables this feature. Note, this
12888 feature is not enabled by default with higher optimization levels
12889 (-O2 etc) because of the potentially detrimental effects of
12890 reserving register "r13". It is up to the programmer to experiment
12891 and discover whether this feature is of benefit to their program.
12892
12893 -msim
12894 -mno-sim
12895 Use the simulator runtime. The default is to use the libgloss
12896 board specific runtime.
12897
12898 -mas100-syntax
12899 -mno-as100-syntax
12900 When generating assembler output use a syntax that is compatible
12901 with Renesas's AS100 assembler. This syntax can also be handled by
12902 the GAS assembler but it has some restrictions so generating it is
12903 not the default option.
12904
12905 -mmax-constant-size=N
12906 Specifies the maximum size, in bytes, of a constant that can be
12907 used as an operand in a RX instruction. Although the RX
12908 instruction set does allow constants of up to 4 bytes in length to
12909 be used in instructions, a longer value equates to a longer
12910 instruction. Thus in some circumstances it can be beneficial to
12911 restrict the size of constants that are used in instructions.
12912 Constants that are too big are instead placed into a constant pool
12913 and referenced via register indirection.
12914
12915 The value N can be between 0 and 4. A value of 0 (the default) or
12916 4 means that constants of any size are allowed.
12917
12918 -mrelax
12919 Enable linker relaxation. Linker relaxation is a process whereby
12920 the linker will attempt to reduce the size of a program by finding
12921 shorter versions of various instructions. Disabled by default.
12922
12923 -mint-register=N
12924 Specify the number of registers to reserve for fast interrupt
12925 handler functions. The value N can be between 0 and 4. A value of
12926 1 means that register "r13" will be reserved for the exclusive use
12927 of fast interrupt handlers. A value of 2 reserves "r13" and "r12".
12928 A value of 3 reserves "r13", "r12" and "r11", and a value of 4
12929 reserves "r13" through "r10". A value of 0, the default, does not
12930 reserve any registers.
12931
12932 -msave-acc-in-interrupts
12933 Specifies that interrupt handler functions should preserve the
12934 accumulator register. This is only necessary if normal code might
12935 use the accumulator register, for example because it performs
12936 64-bit multiplications. The default is to ignore the accumulator
12937 as this makes the interrupt handlers faster.
12938
12939 Note: The generic GCC command line -ffixed-reg has special significance
12940 to the RX port when used with the "interrupt" function attribute. This
12941 attribute indicates a function intended to process fast interrupts.
12942 GCC will will ensure that it only uses the registers "r10", "r11",
12943 "r12" and/or "r13" and only provided that the normal use of the
12944 corresponding registers have been restricted via the -ffixed-reg or
12945 -mint-register command line options.
12946
12947 S/390 and zSeries Options
12948 These are the -m options defined for the S/390 and zSeries
12949 architecture.
12950
12951 -mhard-float
12952 -msoft-float
12953 Use (do not use) the hardware floating-point instructions and
12954 registers for floating-point operations. When -msoft-float is
12955 specified, functions in libgcc.a will be used to perform floating-
12956 point operations. When -mhard-float is specified, the compiler
12957 generates IEEE floating-point instructions. This is the default.
12958
12959 -mhard-dfp
12960 -mno-hard-dfp
12961 Use (do not use) the hardware decimal-floating-point instructions
12962 for decimal-floating-point operations. When -mno-hard-dfp is
12963 specified, functions in libgcc.a will be used to perform decimal-
12964 floating-point operations. When -mhard-dfp is specified, the
12965 compiler generates decimal-floating-point hardware instructions.
12966 This is the default for -march=z9-ec or higher.
12967
12968 -mlong-double-64
12969 -mlong-double-128
12970 These switches control the size of "long double" type. A size of
12971 64bit makes the "long double" type equivalent to the "double" type.
12972 This is the default.
12973
12974 -mbackchain
12975 -mno-backchain
12976 Store (do not store) the address of the caller's frame as backchain
12977 pointer into the callee's stack frame. A backchain may be needed
12978 to allow debugging using tools that do not understand DWARF-2 call
12979 frame information. When -mno-packed-stack is in effect, the
12980 backchain pointer is stored at the bottom of the stack frame; when
12981 -mpacked-stack is in effect, the backchain is placed into the
12982 topmost word of the 96/160 byte register save area.
12983
12984 In general, code compiled with -mbackchain is call-compatible with
12985 code compiled with -mmo-backchain; however, use of the backchain
12986 for debugging purposes usually requires that the whole binary is
12987 built with -mbackchain. Note that the combination of -mbackchain,
12988 -mpacked-stack and -mhard-float is not supported. In order to
12989 build a linux kernel use -msoft-float.
12990
12991 The default is to not maintain the backchain.
12992
12993 -mpacked-stack
12994 -mno-packed-stack
12995 Use (do not use) the packed stack layout. When -mno-packed-stack
12996 is specified, the compiler uses the all fields of the 96/160 byte
12997 register save area only for their default purpose; unused fields
12998 still take up stack space. When -mpacked-stack is specified,
12999 register save slots are densely packed at the top of the register
13000 save area; unused space is reused for other purposes, allowing for
13001 more efficient use of the available stack space. However, when
13002 -mbackchain is also in effect, the topmost word of the save area is
13003 always used to store the backchain, and the return address register
13004 is always saved two words below the backchain.
13005
13006 As long as the stack frame backchain is not used, code generated
13007 with -mpacked-stack is call-compatible with code generated with
13008 -mno-packed-stack. Note that some non-FSF releases of GCC 2.95 for
13009 S/390 or zSeries generated code that uses the stack frame backchain
13010 at run time, not just for debugging purposes. Such code is not
13011 call-compatible with code compiled with -mpacked-stack. Also, note
13012 that the combination of -mbackchain, -mpacked-stack and
13013 -mhard-float is not supported. In order to build a linux kernel
13014 use -msoft-float.
13015
13016 The default is to not use the packed stack layout.
13017
13018 -msmall-exec
13019 -mno-small-exec
13020 Generate (or do not generate) code using the "bras" instruction to
13021 do subroutine calls. This only works reliably if the total
13022 executable size does not exceed 64k. The default is to use the
13023 "basr" instruction instead, which does not have this limitation.
13024
13025 -m64
13026 -m31
13027 When -m31 is specified, generate code compliant to the GNU/Linux
13028 for S/390 ABI. When -m64 is specified, generate code compliant to
13029 the GNU/Linux for zSeries ABI. This allows GCC in particular to
13030 generate 64-bit instructions. For the s390 targets, the default is
13031 -m31, while the s390x targets default to -m64.
13032
13033 -mzarch
13034 -mesa
13035 When -mzarch is specified, generate code using the instructions
13036 available on z/Architecture. When -mesa is specified, generate
13037 code using the instructions available on ESA/390. Note that -mesa
13038 is not possible with -m64. When generating code compliant to the
13039 GNU/Linux for S/390 ABI, the default is -mesa. When generating
13040 code compliant to the GNU/Linux for zSeries ABI, the default is
13041 -mzarch.
13042
13043 -mmvcle
13044 -mno-mvcle
13045 Generate (or do not generate) code using the "mvcle" instruction to
13046 perform block moves. When -mno-mvcle is specified, use a "mvc"
13047 loop instead. This is the default unless optimizing for size.
13048
13049 -mdebug
13050 -mno-debug
13051 Print (or do not print) additional debug information when
13052 compiling. The default is to not print debug information.
13053
13054 -march=cpu-type
13055 Generate code that will run on cpu-type, which is the name of a
13056 system representing a certain processor type. Possible values for
13057 cpu-type are g5, g6, z900, z990, z9-109, z9-ec and z10. When
13058 generating code using the instructions available on z/Architecture,
13059 the default is -march=z900. Otherwise, the default is -march=g5.
13060
13061 -mtune=cpu-type
13062 Tune to cpu-type everything applicable about the generated code,
13063 except for the ABI and the set of available instructions. The list
13064 of cpu-type values is the same as for -march. The default is the
13065 value used for -march.
13066
13067 -mtpf-trace
13068 -mno-tpf-trace
13069 Generate code that adds (does not add) in TPF OS specific branches
13070 to trace routines in the operating system. This option is off by
13071 default, even when compiling for the TPF OS.
13072
13073 -mfused-madd
13074 -mno-fused-madd
13075 Generate code that uses (does not use) the floating point multiply
13076 and accumulate instructions. These instructions are generated by
13077 default if hardware floating point is used.
13078
13079 -mwarn-framesize=framesize
13080 Emit a warning if the current function exceeds the given frame
13081 size. Because this is a compile time check it doesn't need to be a
13082 real problem when the program runs. It is intended to identify
13083 functions which most probably cause a stack overflow. It is useful
13084 to be used in an environment with limited stack size e.g. the linux
13085 kernel.
13086
13087 -mwarn-dynamicstack
13088 Emit a warning if the function calls alloca or uses dynamically
13089 sized arrays. This is generally a bad idea with a limited stack
13090 size.
13091
13092 -mstack-guard=stack-guard
13093 -mstack-size=stack-size
13094 If these options are provided the s390 back end emits additional
13095 instructions in the function prologue which trigger a trap if the
13096 stack size is stack-guard bytes above the stack-size (remember that
13097 the stack on s390 grows downward). If the stack-guard option is
13098 omitted the smallest power of 2 larger than the frame size of the
13099 compiled function is chosen. These options are intended to be used
13100 to help debugging stack overflow problems. The additionally
13101 emitted code causes only little overhead and hence can also be used
13102 in production like systems without greater performance degradation.
13103 The given values have to be exact powers of 2 and stack-size has to
13104 be greater than stack-guard without exceeding 64k. In order to be
13105 efficient the extra code makes the assumption that the stack starts
13106 at an address aligned to the value given by stack-size. The stack-
13107 guard option can only be used in conjunction with stack-size.
13108
13109 Score Options
13110 These options are defined for Score implementations:
13111
13112 -meb
13113 Compile code for big endian mode. This is the default.
13114
13115 -mel
13116 Compile code for little endian mode.
13117
13118 -mnhwloop
13119 Disable generate bcnz instruction.
13120
13121 -muls
13122 Enable generate unaligned load and store instruction.
13123
13124 -mmac
13125 Enable the use of multiply-accumulate instructions. Disabled by
13126 default.
13127
13128 -mscore5
13129 Specify the SCORE5 as the target architecture.
13130
13131 -mscore5u
13132 Specify the SCORE5U of the target architecture.
13133
13134 -mscore7
13135 Specify the SCORE7 as the target architecture. This is the default.
13136
13137 -mscore7d
13138 Specify the SCORE7D as the target architecture.
13139
13140 SH Options
13141 These -m options are defined for the SH implementations:
13142
13143 -m1 Generate code for the SH1.
13144
13145 -m2 Generate code for the SH2.
13146
13147 -m2e
13148 Generate code for the SH2e.
13149
13150 -m2a-nofpu
13151 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a
13152 way that the floating-point unit is not used.
13153
13154 -m2a-single-only
13155 Generate code for the SH2a-FPU, in such a way that no double-
13156 precision floating point operations are used.
13157
13158 -m2a-single
13159 Generate code for the SH2a-FPU assuming the floating-point unit is
13160 in single-precision mode by default.
13161
13162 -m2a
13163 Generate code for the SH2a-FPU assuming the floating-point unit is
13164 in double-precision mode by default.
13165
13166 -m3 Generate code for the SH3.
13167
13168 -m3e
13169 Generate code for the SH3e.
13170
13171 -m4-nofpu
13172 Generate code for the SH4 without a floating-point unit.
13173
13174 -m4-single-only
13175 Generate code for the SH4 with a floating-point unit that only
13176 supports single-precision arithmetic.
13177
13178 -m4-single
13179 Generate code for the SH4 assuming the floating-point unit is in
13180 single-precision mode by default.
13181
13182 -m4 Generate code for the SH4.
13183
13184 -m4a-nofpu
13185 Generate code for the SH4al-dsp, or for a SH4a in such a way that
13186 the floating-point unit is not used.
13187
13188 -m4a-single-only
13189 Generate code for the SH4a, in such a way that no double-precision
13190 floating point operations are used.
13191
13192 -m4a-single
13193 Generate code for the SH4a assuming the floating-point unit is in
13194 single-precision mode by default.
13195
13196 -m4a
13197 Generate code for the SH4a.
13198
13199 -m4al
13200 Same as -m4a-nofpu, except that it implicitly passes -dsp to the
13201 assembler. GCC doesn't generate any DSP instructions at the
13202 moment.
13203
13204 -mb Compile code for the processor in big endian mode.
13205
13206 -ml Compile code for the processor in little endian mode.
13207
13208 -mdalign
13209 Align doubles at 64-bit boundaries. Note that this changes the
13210 calling conventions, and thus some functions from the standard C
13211 library will not work unless you recompile it first with -mdalign.
13212
13213 -mrelax
13214 Shorten some address references at link time, when possible; uses
13215 the linker option -relax.
13216
13217 -mbigtable
13218 Use 32-bit offsets in "switch" tables. The default is to use
13219 16-bit offsets.
13220
13221 -mbitops
13222 Enable the use of bit manipulation instructions on SH2A.
13223
13224 -mfmovd
13225 Enable the use of the instruction "fmovd". Check -mdalign for
13226 alignment constraints.
13227
13228 -mhitachi
13229 Comply with the calling conventions defined by Renesas.
13230
13231 -mrenesas
13232 Comply with the calling conventions defined by Renesas.
13233
13234 -mno-renesas
13235 Comply with the calling conventions defined for GCC before the
13236 Renesas conventions were available. This option is the default for
13237 all targets of the SH toolchain except for sh-symbianelf.
13238
13239 -mnomacsave
13240 Mark the "MAC" register as call-clobbered, even if -mhitachi is
13241 given.
13242
13243 -mieee
13244 Increase IEEE-compliance of floating-point code. At the moment,
13245 this is equivalent to -fno-finite-math-only. When generating 16
13246 bit SH opcodes, getting IEEE-conforming results for comparisons of
13247 NANs / infinities incurs extra overhead in every floating point
13248 comparison, therefore the default is set to -ffinite-math-only.
13249
13250 -minline-ic_invalidate
13251 Inline code to invalidate instruction cache entries after setting
13252 up nested function trampolines. This option has no effect if
13253 -musermode is in effect and the selected code generation option
13254 (e.g. -m4) does not allow the use of the icbi instruction. If the
13255 selected code generation option does not allow the use of the icbi
13256 instruction, and -musermode is not in effect, the inlined code will
13257 manipulate the instruction cache address array directly with an
13258 associative write. This not only requires privileged mode, but it
13259 will also fail if the cache line had been mapped via the TLB and
13260 has become unmapped.
13261
13262 -misize
13263 Dump instruction size and location in the assembly code.
13264
13265 -mpadstruct
13266 This option is deprecated. It pads structures to multiple of 4
13267 bytes, which is incompatible with the SH ABI.
13268
13269 -mspace
13270 Optimize for space instead of speed. Implied by -Os.
13271
13272 -mprefergot
13273 When generating position-independent code, emit function calls
13274 using the Global Offset Table instead of the Procedure Linkage
13275 Table.
13276
13277 -musermode
13278 Don't generate privileged mode only code; implies
13279 -mno-inline-ic_invalidate if the inlined code would not work in
13280 user mode. This is the default when the target is "sh-*-linux*".
13281
13282 -multcost=number
13283 Set the cost to assume for a multiply insn.
13284
13285 -mdiv=strategy
13286 Set the division strategy to use for SHmedia code. strategy must
13287 be one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l,
13288 inv:call, inv:call2, inv:fp . "fp" performs the operation in
13289 floating point. This has a very high latency, but needs only a few
13290 instructions, so it might be a good choice if your code has enough
13291 easily exploitable ILP to allow the compiler to schedule the
13292 floating point instructions together with other instructions.
13293 Division by zero causes a floating point exception. "inv" uses
13294 integer operations to calculate the inverse of the divisor, and
13295 then multiplies the dividend with the inverse. This strategy
13296 allows cse and hoisting of the inverse calculation. Division by
13297 zero calculates an unspecified result, but does not trap.
13298 "inv:minlat" is a variant of "inv" where if no cse / hoisting
13299 opportunities have been found, or if the entire operation has been
13300 hoisted to the same place, the last stages of the inverse
13301 calculation are intertwined with the final multiply to reduce the
13302 overall latency, at the expense of using a few more instructions,
13303 and thus offering fewer scheduling opportunities with other code.
13304 "call" calls a library function that usually implements the
13305 inv:minlat strategy. This gives high code density for
13306 m5-*media-nofpu compilations. "call2" uses a different entry point
13307 of the same library function, where it assumes that a pointer to a
13308 lookup table has already been set up, which exposes the pointer
13309 load to cse / code hoisting optimizations. "inv:call", "inv:call2"
13310 and "inv:fp" all use the "inv" algorithm for initial code
13311 generation, but if the code stays unoptimized, revert to the
13312 "call", "call2", or "fp" strategies, respectively. Note that the
13313 potentially-trapping side effect of division by zero is carried by
13314 a separate instruction, so it is possible that all the integer
13315 instructions are hoisted out, but the marker for the side effect
13316 stays where it is. A recombination to fp operations or a call is
13317 not possible in that case. "inv20u" and "inv20l" are variants of
13318 the "inv:minlat" strategy. In the case that the inverse
13319 calculation was nor separated from the multiply, they speed up
13320 division where the dividend fits into 20 bits (plus sign where
13321 applicable), by inserting a test to skip a number of operations in
13322 this case; this test slows down the case of larger dividends.
13323 inv20u assumes the case of a such a small dividend to be unlikely,
13324 and inv20l assumes it to be likely.
13325
13326 -mdivsi3_libfunc=name
13327 Set the name of the library function used for 32 bit signed
13328 division to name. This only affect the name used in the call and
13329 inv:call division strategies, and the compiler will still expect
13330 the same sets of input/output/clobbered registers as if this option
13331 was not present.
13332
13333 -mfixed-range=register-range
13334 Generate code treating the given register range as fixed registers.
13335 A fixed register is one that the register allocator can not use.
13336 This is useful when compiling kernel code. A register range is
13337 specified as two registers separated by a dash. Multiple register
13338 ranges can be specified separated by a comma.
13339
13340 -madjust-unroll
13341 Throttle unrolling to avoid thrashing target registers. This
13342 option only has an effect if the gcc code base supports the
13343 TARGET_ADJUST_UNROLL_MAX target hook.
13344
13345 -mindexed-addressing
13346 Enable the use of the indexed addressing mode for
13347 SHmedia32/SHcompact. This is only safe if the hardware and/or OS
13348 implement 32 bit wrap-around semantics for the indexed addressing
13349 mode. The architecture allows the implementation of processors
13350 with 64 bit MMU, which the OS could use to get 32 bit addressing,
13351 but since no current hardware implementation supports this or any
13352 other way to make the indexed addressing mode safe to use in the 32
13353 bit ABI, the default is -mno-indexed-addressing.
13354
13355 -mgettrcost=number
13356 Set the cost assumed for the gettr instruction to number. The
13357 default is 2 if -mpt-fixed is in effect, 100 otherwise.
13358
13359 -mpt-fixed
13360 Assume pt* instructions won't trap. This will generally generate
13361 better scheduled code, but is unsafe on current hardware. The
13362 current architecture definition says that ptabs and ptrel trap when
13363 the target anded with 3 is 3. This has the unintentional effect of
13364 making it unsafe to schedule ptabs / ptrel before a branch, or
13365 hoist it out of a loop. For example, __do_global_ctors, a part of
13366 libgcc that runs constructors at program startup, calls functions
13367 in a list which is delimited by -1. With the -mpt-fixed option,
13368 the ptabs will be done before testing against -1. That means that
13369 all the constructors will be run a bit quicker, but when the loop
13370 comes to the end of the list, the program crashes because ptabs
13371 loads -1 into a target register. Since this option is unsafe for
13372 any hardware implementing the current architecture specification,
13373 the default is -mno-pt-fixed. Unless the user specifies a specific
13374 cost with -mgettrcost, -mno-pt-fixed also implies -mgettrcost=100;
13375 this deters register allocation using target registers for storing
13376 ordinary integers.
13377
13378 -minvalid-symbols
13379 Assume symbols might be invalid. Ordinary function symbols
13380 generated by the compiler will always be valid to load with
13381 movi/shori/ptabs or movi/shori/ptrel, but with assembler and/or
13382 linker tricks it is possible to generate symbols that will cause
13383 ptabs / ptrel to trap. This option is only meaningful when
13384 -mno-pt-fixed is in effect. It will then prevent cross-basic-block
13385 cse, hoisting and most scheduling of symbol loads. The default is
13386 -mno-invalid-symbols.
13387
13388 SPARC Options
13389 These -m options are supported on the SPARC:
13390
13391 -mno-app-regs
13392 -mapp-regs
13393 Specify -mapp-regs to generate output using the global registers 2
13394 through 4, which the SPARC SVR4 ABI reserves for applications.
13395 This is the default.
13396
13397 To be fully SVR4 ABI compliant at the cost of some performance
13398 loss, specify -mno-app-regs. You should compile libraries and
13399 system software with this option.
13400
13401 -mfpu
13402 -mhard-float
13403 Generate output containing floating point instructions. This is
13404 the default.
13405
13406 -mno-fpu
13407 -msoft-float
13408 Generate output containing library calls for floating point.
13409 Warning: the requisite libraries are not available for all SPARC
13410 targets. Normally the facilities of the machine's usual C compiler
13411 are used, but this cannot be done directly in cross-compilation.
13412 You must make your own arrangements to provide suitable library
13413 functions for cross-compilation. The embedded targets sparc-*-aout
13414 and sparclite-*-* do provide software floating point support.
13415
13416 -msoft-float changes the calling convention in the output file;
13417 therefore, it is only useful if you compile all of a program with
13418 this option. In particular, you need to compile libgcc.a, the
13419 library that comes with GCC, with -msoft-float in order for this to
13420 work.
13421
13422 -mhard-quad-float
13423 Generate output containing quad-word (long double) floating point
13424 instructions.
13425
13426 -msoft-quad-float
13427 Generate output containing library calls for quad-word (long
13428 double) floating point instructions. The functions called are
13429 those specified in the SPARC ABI. This is the default.
13430
13431 As of this writing, there are no SPARC implementations that have
13432 hardware support for the quad-word floating point instructions.
13433 They all invoke a trap handler for one of these instructions, and
13434 then the trap handler emulates the effect of the instruction.
13435 Because of the trap handler overhead, this is much slower than
13436 calling the ABI library routines. Thus the -msoft-quad-float
13437 option is the default.
13438
13439 -mno-unaligned-doubles
13440 -munaligned-doubles
13441 Assume that doubles have 8 byte alignment. This is the default.
13442
13443 With -munaligned-doubles, GCC assumes that doubles have 8 byte
13444 alignment only if they are contained in another type, or if they
13445 have an absolute address. Otherwise, it assumes they have 4 byte
13446 alignment. Specifying this option avoids some rare compatibility
13447 problems with code generated by other compilers. It is not the
13448 default because it results in a performance loss, especially for
13449 floating point code.
13450
13451 -mno-faster-structs
13452 -mfaster-structs
13453 With -mfaster-structs, the compiler assumes that structures should
13454 have 8 byte alignment. This enables the use of pairs of "ldd" and
13455 "std" instructions for copies in structure assignment, in place of
13456 twice as many "ld" and "st" pairs. However, the use of this
13457 changed alignment directly violates the SPARC ABI. Thus, it's
13458 intended only for use on targets where the developer acknowledges
13459 that their resulting code will not be directly in line with the
13460 rules of the ABI.
13461
13462 -mimpure-text
13463 -mimpure-text, used in addition to -shared, tells the compiler to
13464 not pass -z text to the linker when linking a shared object. Using
13465 this option, you can link position-dependent code into a shared
13466 object.
13467
13468 -mimpure-text suppresses the "relocations remain against
13469 allocatable but non-writable sections" linker error message.
13470 However, the necessary relocations will trigger copy-on-write, and
13471 the shared object is not actually shared across processes. Instead
13472 of using -mimpure-text, you should compile all source code with
13473 -fpic or -fPIC.
13474
13475 This option is only available on SunOS and Solaris.
13476
13477 -mcpu=cpu_type
13478 Set the instruction set, register set, and instruction scheduling
13479 parameters for machine type cpu_type. Supported values for
13480 cpu_type are v7, cypress, v8, supersparc, sparclite, f930, f934,
13481 hypersparc, sparclite86x, sparclet, tsc701, v9, ultrasparc,
13482 ultrasparc3, niagara and niagara2.
13483
13484 Default instruction scheduling parameters are used for values that
13485 select an architecture and not an implementation. These are v7,
13486 v8, sparclite, sparclet, v9.
13487
13488 Here is a list of each supported architecture and their supported
13489 implementations.
13490
13491 v7: cypress
13492 v8: supersparc, hypersparc
13493 sparclite: f930, f934, sparclite86x
13494 sparclet: tsc701
13495 v9: ultrasparc, ultrasparc3, niagara, niagara2
13496
13497 By default (unless configured otherwise), GCC generates code for
13498 the V7 variant of the SPARC architecture. With -mcpu=cypress, the
13499 compiler additionally optimizes it for the Cypress CY7C602 chip, as
13500 used in the SPARCStation/SPARCServer 3xx series. This is also
13501 appropriate for the older SPARCStation 1, 2, IPX etc.
13502
13503 With -mcpu=v8, GCC generates code for the V8 variant of the SPARC
13504 architecture. The only difference from V7 code is that the
13505 compiler emits the integer multiply and integer divide instructions
13506 which exist in SPARC-V8 but not in SPARC-V7. With
13507 -mcpu=supersparc, the compiler additionally optimizes it for the
13508 SuperSPARC chip, as used in the SPARCStation 10, 1000 and 2000
13509 series.
13510
13511 With -mcpu=sparclite, GCC generates code for the SPARClite variant
13512 of the SPARC architecture. This adds the integer multiply, integer
13513 divide step and scan ("ffs") instructions which exist in SPARClite
13514 but not in SPARC-V7. With -mcpu=f930, the compiler additionally
13515 optimizes it for the Fujitsu MB86930 chip, which is the original
13516 SPARClite, with no FPU. With -mcpu=f934, the compiler additionally
13517 optimizes it for the Fujitsu MB86934 chip, which is the more recent
13518 SPARClite with FPU.
13519
13520 With -mcpu=sparclet, GCC generates code for the SPARClet variant of
13521 the SPARC architecture. This adds the integer multiply,
13522 multiply/accumulate, integer divide step and scan ("ffs")
13523 instructions which exist in SPARClet but not in SPARC-V7. With
13524 -mcpu=tsc701, the compiler additionally optimizes it for the TEMIC
13525 SPARClet chip.
13526
13527 With -mcpu=v9, GCC generates code for the V9 variant of the SPARC
13528 architecture. This adds 64-bit integer and floating-point move
13529 instructions, 3 additional floating-point condition code registers
13530 and conditional move instructions. With -mcpu=ultrasparc, the
13531 compiler additionally optimizes it for the Sun UltraSPARC I/II/IIi
13532 chips. With -mcpu=ultrasparc3, the compiler additionally optimizes
13533 it for the Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips. With
13534 -mcpu=niagara, the compiler additionally optimizes it for Sun
13535 UltraSPARC T1 chips. With -mcpu=niagara2, the compiler
13536 additionally optimizes it for Sun UltraSPARC T2 chips.
13537
13538 -mtune=cpu_type
13539 Set the instruction scheduling parameters for machine type
13540 cpu_type, but do not set the instruction set or register set that
13541 the option -mcpu=cpu_type would.
13542
13543 The same values for -mcpu=cpu_type can be used for -mtune=cpu_type,
13544 but the only useful values are those that select a particular cpu
13545 implementation. Those are cypress, supersparc, hypersparc, f930,
13546 f934, sparclite86x, tsc701, ultrasparc, ultrasparc3, niagara, and
13547 niagara2.
13548
13549 -mv8plus
13550 -mno-v8plus
13551 With -mv8plus, GCC generates code for the SPARC-V8+ ABI. The
13552 difference from the V8 ABI is that the global and out registers are
13553 considered 64-bit wide. This is enabled by default on Solaris in
13554 32-bit mode for all SPARC-V9 processors.
13555
13556 -mvis
13557 -mno-vis
13558 With -mvis, GCC generates code that takes advantage of the
13559 UltraSPARC Visual Instruction Set extensions. The default is
13560 -mno-vis.
13561
13562 These -m options are supported in addition to the above on SPARC-V9
13563 processors in 64-bit environments:
13564
13565 -mlittle-endian
13566 Generate code for a processor running in little-endian mode. It is
13567 only available for a few configurations and most notably not on
13568 Solaris and Linux.
13569
13570 -m32
13571 -m64
13572 Generate code for a 32-bit or 64-bit environment. The 32-bit
13573 environment sets int, long and pointer to 32 bits. The 64-bit
13574 environment sets int to 32 bits and long and pointer to 64 bits.
13575
13576 -mcmodel=medlow
13577 Generate code for the Medium/Low code model: 64-bit addresses,
13578 programs must be linked in the low 32 bits of memory. Programs can
13579 be statically or dynamically linked.
13580
13581 -mcmodel=medmid
13582 Generate code for the Medium/Middle code model: 64-bit addresses,
13583 programs must be linked in the low 44 bits of memory, the text and
13584 data segments must be less than 2GB in size and the data segment
13585 must be located within 2GB of the text segment.
13586
13587 -mcmodel=medany
13588 Generate code for the Medium/Anywhere code model: 64-bit addresses,
13589 programs may be linked anywhere in memory, the text and data
13590 segments must be less than 2GB in size and the data segment must be
13591 located within 2GB of the text segment.
13592
13593 -mcmodel=embmedany
13594 Generate code for the Medium/Anywhere code model for embedded
13595 systems: 64-bit addresses, the text and data segments must be less
13596 than 2GB in size, both starting anywhere in memory (determined at
13597 link time). The global register %g4 points to the base of the data
13598 segment. Programs are statically linked and PIC is not supported.
13599
13600 -mstack-bias
13601 -mno-stack-bias
13602 With -mstack-bias, GCC assumes that the stack pointer, and frame
13603 pointer if present, are offset by -2047 which must be added back
13604 when making stack frame references. This is the default in 64-bit
13605 mode. Otherwise, assume no such offset is present.
13606
13607 These switches are supported in addition to the above on Solaris:
13608
13609 -threads
13610 Add support for multithreading using the Solaris threads library.
13611 This option sets flags for both the preprocessor and linker. This
13612 option does not affect the thread safety of object code produced by
13613 the compiler or that of libraries supplied with it.
13614
13615 -pthreads
13616 Add support for multithreading using the POSIX threads library.
13617 This option sets flags for both the preprocessor and linker. This
13618 option does not affect the thread safety of object code produced
13619 by the compiler or that of libraries supplied with it.
13620
13621 -pthread
13622 This is a synonym for -pthreads.
13623
13624 SPU Options
13625 These -m options are supported on the SPU:
13626
13627 -mwarn-reloc
13628 -merror-reloc
13629 The loader for SPU does not handle dynamic relocations. By
13630 default, GCC will give an error when it generates code that
13631 requires a dynamic relocation. -mno-error-reloc disables the
13632 error, -mwarn-reloc will generate a warning instead.
13633
13634 -msafe-dma
13635 -munsafe-dma
13636 Instructions which initiate or test completion of DMA must not be
13637 reordered with respect to loads and stores of the memory which is
13638 being accessed. Users typically address this problem using the
13639 volatile keyword, but that can lead to inefficient code in places
13640 where the memory is known to not change. Rather than mark the
13641 memory as volatile we treat the DMA instructions as potentially
13642 effecting all memory. With -munsafe-dma users must use the
13643 volatile keyword to protect memory accesses.
13644
13645 -mbranch-hints
13646 By default, GCC will generate a branch hint instruction to avoid
13647 pipeline stalls for always taken or probably taken branches. A
13648 hint will not be generated closer than 8 instructions away from its
13649 branch. There is little reason to disable them, except for
13650 debugging purposes, or to make an object a little bit smaller.
13651
13652 -msmall-mem
13653 -mlarge-mem
13654 By default, GCC generates code assuming that addresses are never
13655 larger than 18 bits. With -mlarge-mem code is generated that
13656 assumes a full 32 bit address.
13657
13658 -mstdmain
13659 By default, GCC links against startup code that assumes the SPU-
13660 style main function interface (which has an unconventional
13661 parameter list). With -mstdmain, GCC will link your program
13662 against startup code that assumes a C99-style interface to "main",
13663 including a local copy of "argv" strings.
13664
13665 -mfixed-range=register-range
13666 Generate code treating the given register range as fixed registers.
13667 A fixed register is one that the register allocator can not use.
13668 This is useful when compiling kernel code. A register range is
13669 specified as two registers separated by a dash. Multiple register
13670 ranges can be specified separated by a comma.
13671
13672 -mea32
13673 -mea64
13674 Compile code assuming that pointers to the PPU address space
13675 accessed via the "__ea" named address space qualifier are either 32
13676 or 64 bits wide. The default is 32 bits. As this is an ABI
13677 changing option, all object code in an executable must be compiled
13678 with the same setting.
13679
13680 -maddress-space-conversion
13681 -mno-address-space-conversion
13682 Allow/disallow treating the "__ea" address space as superset of the
13683 generic address space. This enables explicit type casts between
13684 "__ea" and generic pointer as well as implicit conversions of
13685 generic pointers to "__ea" pointers. The default is to allow
13686 address space pointer conversions.
13687
13688 -mcache-size=cache-size
13689 This option controls the version of libgcc that the compiler links
13690 to an executable and selects a software-managed cache for accessing
13691 variables in the "__ea" address space with a particular cache size.
13692 Possible options for cache-size are 8, 16, 32, 64 and 128. The
13693 default cache size is 64KB.
13694
13695 -matomic-updates
13696 -mno-atomic-updates
13697 This option controls the version of libgcc that the compiler links
13698 to an executable and selects whether atomic updates to the
13699 software-managed cache of PPU-side variables are used. If you use
13700 atomic updates, changes to a PPU variable from SPU code using the
13701 "__ea" named address space qualifier will not interfere with
13702 changes to other PPU variables residing in the same cache line from
13703 PPU code. If you do not use atomic updates, such interference may
13704 occur; however, writing back cache lines will be more efficient.
13705 The default behavior is to use atomic updates.
13706
13707 -mdual-nops
13708 -mdual-nops=n
13709 By default, GCC will insert nops to increase dual issue when it
13710 expects it to increase performance. n can be a value from 0 to 10.
13711 A smaller n will insert fewer nops. 10 is the default, 0 is the
13712 same as -mno-dual-nops. Disabled with -Os.
13713
13714 -mhint-max-nops=n
13715 Maximum number of nops to insert for a branch hint. A branch hint
13716 must be at least 8 instructions away from the branch it is
13717 effecting. GCC will insert up to n nops to enforce this, otherwise
13718 it will not generate the branch hint.
13719
13720 -mhint-max-distance=n
13721 The encoding of the branch hint instruction limits the hint to be
13722 within 256 instructions of the branch it is effecting. By default,
13723 GCC makes sure it is within 125.
13724
13725 -msafe-hints
13726 Work around a hardware bug which causes the SPU to stall
13727 indefinitely. By default, GCC will insert the "hbrp" instruction
13728 to make sure this stall won't happen.
13729
13730 Options for System V
13731 These additional options are available on System V Release 4 for
13732 compatibility with other compilers on those systems:
13733
13734 -G Create a shared object. It is recommended that -symbolic or
13735 -shared be used instead.
13736
13737 -Qy Identify the versions of each tool used by the compiler, in a
13738 ".ident" assembler directive in the output.
13739
13740 -Qn Refrain from adding ".ident" directives to the output file (this is
13741 the default).
13742
13743 -YP,dirs
13744 Search the directories dirs, and no others, for libraries specified
13745 with -l.
13746
13747 -Ym,dir
13748 Look in the directory dir to find the M4 preprocessor. The
13749 assembler uses this option.
13750
13751 V850 Options
13752 These -m options are defined for V850 implementations:
13753
13754 -mlong-calls
13755 -mno-long-calls
13756 Treat all calls as being far away (near). If calls are assumed to
13757 be far away, the compiler will always load the functions address up
13758 into a register, and call indirect through the pointer.
13759
13760 -mno-ep
13761 -mep
13762 Do not optimize (do optimize) basic blocks that use the same index
13763 pointer 4 or more times to copy pointer into the "ep" register, and
13764 use the shorter "sld" and "sst" instructions. The -mep option is
13765 on by default if you optimize.
13766
13767 -mno-prolog-function
13768 -mprolog-function
13769 Do not use (do use) external functions to save and restore
13770 registers at the prologue and epilogue of a function. The external
13771 functions are slower, but use less code space if more than one
13772 function saves the same number of registers. The -mprolog-function
13773 option is on by default if you optimize.
13774
13775 -mspace
13776 Try to make the code as small as possible. At present, this just
13777 turns on the -mep and -mprolog-function options.
13778
13779 -mtda=n
13780 Put static or global variables whose size is n bytes or less into
13781 the tiny data area that register "ep" points to. The tiny data
13782 area can hold up to 256 bytes in total (128 bytes for byte
13783 references).
13784
13785 -msda=n
13786 Put static or global variables whose size is n bytes or less into
13787 the small data area that register "gp" points to. The small data
13788 area can hold up to 64 kilobytes.
13789
13790 -mzda=n
13791 Put static or global variables whose size is n bytes or less into
13792 the first 32 kilobytes of memory.
13793
13794 -mv850
13795 Specify that the target processor is the V850.
13796
13797 -mbig-switch
13798 Generate code suitable for big switch tables. Use this option only
13799 if the assembler/linker complain about out of range branches within
13800 a switch table.
13801
13802 -mapp-regs
13803 This option will cause r2 and r5 to be used in the code generated
13804 by the compiler. This setting is the default.
13805
13806 -mno-app-regs
13807 This option will cause r2 and r5 to be treated as fixed registers.
13808
13809 -mv850e1
13810 Specify that the target processor is the V850E1. The preprocessor
13811 constants __v850e1__ and __v850e__ will be defined if this option
13812 is used.
13813
13814 -mv850e
13815 Specify that the target processor is the V850E. The preprocessor
13816 constant __v850e__ will be defined if this option is used.
13817
13818 If neither -mv850 nor -mv850e nor -mv850e1 are defined then a
13819 default target processor will be chosen and the relevant __v850*__
13820 preprocessor constant will be defined.
13821
13822 The preprocessor constants __v850 and __v851__ are always defined,
13823 regardless of which processor variant is the target.
13824
13825 -mdisable-callt
13826 This option will suppress generation of the CALLT instruction for
13827 the v850e and v850e1 flavors of the v850 architecture. The default
13828 is -mno-disable-callt which allows the CALLT instruction to be
13829 used.
13830
13831 VAX Options
13832 These -m options are defined for the VAX:
13833
13834 -munix
13835 Do not output certain jump instructions ("aobleq" and so on) that
13836 the Unix assembler for the VAX cannot handle across long ranges.
13837
13838 -mgnu
13839 Do output those jump instructions, on the assumption that you will
13840 assemble with the GNU assembler.
13841
13842 -mg Output code for g-format floating point numbers instead of
13843 d-format.
13844
13845 VxWorks Options
13846 The options in this section are defined for all VxWorks targets.
13847 Options specific to the target hardware are listed with the other
13848 options for that target.
13849
13850 -mrtp
13851 GCC can generate code for both VxWorks kernels and real time
13852 processes (RTPs). This option switches from the former to the
13853 latter. It also defines the preprocessor macro "__RTP__".
13854
13855 -non-static
13856 Link an RTP executable against shared libraries rather than static
13857 libraries. The options -static and -shared can also be used for
13858 RTPs; -static is the default.
13859
13860 -Bstatic
13861 -Bdynamic
13862 These options are passed down to the linker. They are defined for
13863 compatibility with Diab.
13864
13865 -Xbind-lazy
13866 Enable lazy binding of function calls. This option is equivalent
13867 to -Wl,-z,now and is defined for compatibility with Diab.
13868
13869 -Xbind-now
13870 Disable lazy binding of function calls. This option is the default
13871 and is defined for compatibility with Diab.
13872
13873 x86-64 Options
13874 These are listed under
13875
13876 i386 and x86-64 Windows Options
13877 These additional options are available for Windows targets:
13878
13879 -mconsole
13880 This option is available for Cygwin and MinGW targets. It
13881 specifies that a console application is to be generated, by
13882 instructing the linker to set the PE header subsystem type required
13883 for console applications. This is the default behavior for Cygwin
13884 and MinGW targets.
13885
13886 -mcygwin
13887 This option is available for Cygwin targets. It specifies that the
13888 Cygwin internal interface is to be used for predefined preprocessor
13889 macros, C runtime libraries and related linker paths and options.
13890 For Cygwin targets this is the default behavior. This option is
13891 deprecated and will be removed in a future release.
13892
13893 -mno-cygwin
13894 This option is available for Cygwin targets. It specifies that the
13895 MinGW internal interface is to be used instead of Cygwin's, by
13896 setting MinGW-related predefined macros and linker paths and
13897 default library options. This option is deprecated and will be
13898 removed in a future release.
13899
13900 -mdll
13901 This option is available for Cygwin and MinGW targets. It
13902 specifies that a DLL - a dynamic link library - is to be generated,
13903 enabling the selection of the required runtime startup object and
13904 entry point.
13905
13906 -mnop-fun-dllimport
13907 This option is available for Cygwin and MinGW targets. It
13908 specifies that the dllimport attribute should be ignored.
13909
13910 -mthread
13911 This option is available for MinGW targets. It specifies that
13912 MinGW-specific thread support is to be used.
13913
13914 -municode
13915 This option is available for mingw-w64 targets. It specifies that
13916 the UNICODE macro is getting pre-defined and that the unicode
13917 capable runtime startup code is chosen.
13918
13919 -mwin32
13920 This option is available for Cygwin and MinGW targets. It
13921 specifies that the typical Windows pre-defined macros are to be set
13922 in the pre-processor, but does not influence the choice of runtime
13923 library/startup code.
13924
13925 -mwindows
13926 This option is available for Cygwin and MinGW targets. It
13927 specifies that a GUI application is to be generated by instructing
13928 the linker to set the PE header subsystem type appropriately.
13929
13930 -fno-set-stack-executable
13931 This option is available for MinGW targets. It specifies that the
13932 executable flag for stack used by nested functions isn't set. This
13933 is necessary for binaries running in kernel mode of Windows, as
13934 there the user32 API, which is used to set executable privileges,
13935 isn't available.
13936
13937 -mpe-aligned-commons
13938 This option is available for Cygwin and MinGW targets. It
13939 specifies that the GNU extension to the PE file format that permits
13940 the correct alignment of COMMON variables should be used when
13941 generating code. It will be enabled by default if GCC detects that
13942 the target assembler found during configuration supports the
13943 feature.
13944
13945 See also under i386 and x86-64 Options for standard options.
13946
13947 Xstormy16 Options
13948 These options are defined for Xstormy16:
13949
13950 -msim
13951 Choose startup files and linker script suitable for the simulator.
13952
13953 Xtensa Options
13954 These options are supported for Xtensa targets:
13955
13956 -mconst16
13957 -mno-const16
13958 Enable or disable use of "CONST16" instructions for loading
13959 constant values. The "CONST16" instruction is currently not a
13960 standard option from Tensilica. When enabled, "CONST16"
13961 instructions are always used in place of the standard "L32R"
13962 instructions. The use of "CONST16" is enabled by default only if
13963 the "L32R" instruction is not available.
13964
13965 -mfused-madd
13966 -mno-fused-madd
13967 Enable or disable use of fused multiply/add and multiply/subtract
13968 instructions in the floating-point option. This has no effect if
13969 the floating-point option is not also enabled. Disabling fused
13970 multiply/add and multiply/subtract instructions forces the compiler
13971 to use separate instructions for the multiply and add/subtract
13972 operations. This may be desirable in some cases where strict IEEE
13973 754-compliant results are required: the fused multiply add/subtract
13974 instructions do not round the intermediate result, thereby
13975 producing results with more bits of precision than specified by the
13976 IEEE standard. Disabling fused multiply add/subtract instructions
13977 also ensures that the program output is not sensitive to the
13978 compiler's ability to combine multiply and add/subtract operations.
13979
13980 -mserialize-volatile
13981 -mno-serialize-volatile
13982 When this option is enabled, GCC inserts "MEMW" instructions before
13983 "volatile" memory references to guarantee sequential consistency.
13984 The default is -mserialize-volatile. Use -mno-serialize-volatile
13985 to omit the "MEMW" instructions.
13986
13987 -mtext-section-literals
13988 -mno-text-section-literals
13989 Control the treatment of literal pools. The default is
13990 -mno-text-section-literals, which places literals in a separate
13991 section in the output file. This allows the literal pool to be
13992 placed in a data RAM/ROM, and it also allows the linker to combine
13993 literal pools from separate object files to remove redundant
13994 literals and improve code size. With -mtext-section-literals, the
13995 literals are interspersed in the text section in order to keep them
13996 as close as possible to their references. This may be necessary
13997 for large assembly files.
13998
13999 -mtarget-align
14000 -mno-target-align
14001 When this option is enabled, GCC instructs the assembler to
14002 automatically align instructions to reduce branch penalties at the
14003 expense of some code density. The assembler attempts to widen
14004 density instructions to align branch targets and the instructions
14005 following call instructions. If there are not enough preceding
14006 safe density instructions to align a target, no widening will be
14007 performed. The default is -mtarget-align. These options do not
14008 affect the treatment of auto-aligned instructions like "LOOP",
14009 which the assembler will always align, either by widening density
14010 instructions or by inserting no-op instructions.
14011
14012 -mlongcalls
14013 -mno-longcalls
14014 When this option is enabled, GCC instructs the assembler to
14015 translate direct calls to indirect calls unless it can determine
14016 that the target of a direct call is in the range allowed by the
14017 call instruction. This translation typically occurs for calls to
14018 functions in other source files. Specifically, the assembler
14019 translates a direct "CALL" instruction into an "L32R" followed by a
14020 "CALLX" instruction. The default is -mno-longcalls. This option
14021 should be used in programs where the call target can potentially be
14022 out of range. This option is implemented in the assembler, not the
14023 compiler, so the assembly code generated by GCC will still show
14024 direct call instructions---look at the disassembled object code to
14025 see the actual instructions. Note that the assembler will use an
14026 indirect call for every cross-file call, not just those that really
14027 will be out of range.
14028
14029 zSeries Options
14030 These are listed under
14031
14032 Options for Code Generation Conventions
14033 These machine-independent options control the interface conventions
14034 used in code generation.
14035
14036 Most of them have both positive and negative forms; the negative form
14037 of -ffoo would be -fno-foo. In the table below, only one of the forms
14038 is listed---the one which is not the default. You can figure out the
14039 other form by either removing no- or adding it.
14040
14041 -fbounds-check
14042 For front-ends that support it, generate additional code to check
14043 that indices used to access arrays are within the declared range.
14044 This is currently only supported by the Java and Fortran front-
14045 ends, where this option defaults to true and false respectively.
14046
14047 -ftrapv
14048 This option generates traps for signed overflow on addition,
14049 subtraction, multiplication operations.
14050
14051 -fwrapv
14052 This option instructs the compiler to assume that signed arithmetic
14053 overflow of addition, subtraction and multiplication wraps around
14054 using twos-complement representation. This flag enables some
14055 optimizations and disables others. This option is enabled by
14056 default for the Java front-end, as required by the Java language
14057 specification.
14058
14059 -fexceptions
14060 Enable exception handling. Generates extra code needed to
14061 propagate exceptions. For some targets, this implies GCC will
14062 generate frame unwind information for all functions, which can
14063 produce significant data size overhead, although it does not affect
14064 execution. If you do not specify this option, GCC will enable it
14065 by default for languages like C++ which normally require exception
14066 handling, and disable it for languages like C that do not normally
14067 require it. However, you may need to enable this option when
14068 compiling C code that needs to interoperate properly with exception
14069 handlers written in C++. You may also wish to disable this option
14070 if you are compiling older C++ programs that don't use exception
14071 handling.
14072
14073 -fnon-call-exceptions
14074 Generate code that allows trapping instructions to throw
14075 exceptions. Note that this requires platform-specific runtime
14076 support that does not exist everywhere. Moreover, it only allows
14077 trapping instructions to throw exceptions, i.e. memory references
14078 or floating point instructions. It does not allow exceptions to be
14079 thrown from arbitrary signal handlers such as "SIGALRM".
14080
14081 -funwind-tables
14082 Similar to -fexceptions, except that it will just generate any
14083 needed static data, but will not affect the generated code in any
14084 other way. You will normally not enable this option; instead, a
14085 language processor that needs this handling would enable it on your
14086 behalf.
14087
14088 -fasynchronous-unwind-tables
14089 Generate unwind table in dwarf2 format, if supported by target
14090 machine. The table is exact at each instruction boundary, so it
14091 can be used for stack unwinding from asynchronous events (such as
14092 debugger or garbage collector).
14093
14094 -fpcc-struct-return
14095 Return "short" "struct" and "union" values in memory like longer
14096 ones, rather than in registers. This convention is less efficient,
14097 but it has the advantage of allowing intercallability between GCC-
14098 compiled files and files compiled with other compilers,
14099 particularly the Portable C Compiler (pcc).
14100
14101 The precise convention for returning structures in memory depends
14102 on the target configuration macros.
14103
14104 Short structures and unions are those whose size and alignment
14105 match that of some integer type.
14106
14107 Warning: code compiled with the -fpcc-struct-return switch is not
14108 binary compatible with code compiled with the -freg-struct-return
14109 switch. Use it to conform to a non-default application binary
14110 interface.
14111
14112 -freg-struct-return
14113 Return "struct" and "union" values in registers when possible.
14114 This is more efficient for small structures than
14115 -fpcc-struct-return.
14116
14117 If you specify neither -fpcc-struct-return nor -freg-struct-return,
14118 GCC defaults to whichever convention is standard for the target.
14119 If there is no standard convention, GCC defaults to
14120 -fpcc-struct-return, except on targets where GCC is the principal
14121 compiler. In those cases, we can choose the standard, and we chose
14122 the more efficient register return alternative.
14123
14124 Warning: code compiled with the -freg-struct-return switch is not
14125 binary compatible with code compiled with the -fpcc-struct-return
14126 switch. Use it to conform to a non-default application binary
14127 interface.
14128
14129 -fshort-enums
14130 Allocate to an "enum" type only as many bytes as it needs for the
14131 declared range of possible values. Specifically, the "enum" type
14132 will be equivalent to the smallest integer type which has enough
14133 room.
14134
14135 Warning: the -fshort-enums switch causes GCC to generate code that
14136 is not binary compatible with code generated without that switch.
14137 Use it to conform to a non-default application binary interface.
14138
14139 -fshort-double
14140 Use the same size for "double" as for "float".
14141
14142 Warning: the -fshort-double switch causes GCC to generate code that
14143 is not binary compatible with code generated without that switch.
14144 Use it to conform to a non-default application binary interface.
14145
14146 -fshort-wchar
14147 Override the underlying type for wchar_t to be short unsigned int
14148 instead of the default for the target. This option is useful for
14149 building programs to run under WINE.
14150
14151 Warning: the -fshort-wchar switch causes GCC to generate code that
14152 is not binary compatible with code generated without that switch.
14153 Use it to conform to a non-default application binary interface.
14154
14155 -fno-common
14156 In C code, controls the placement of uninitialized global
14157 variables. Unix C compilers have traditionally permitted multiple
14158 definitions of such variables in different compilation units by
14159 placing the variables in a common block. This is the behavior
14160 specified by -fcommon, and is the default for GCC on most targets.
14161 On the other hand, this behavior is not required by ISO C, and on
14162 some targets may carry a speed or code size penalty on variable
14163 references. The -fno-common option specifies that the compiler
14164 should place uninitialized global variables in the data section of
14165 the object file, rather than generating them as common blocks.
14166 This has the effect that if the same variable is declared (without
14167 "extern") in two different compilations, you will get a multiple-
14168 definition error when you link them. In this case, you must
14169 compile with -fcommon instead. Compiling with -fno-common is
14170 useful on targets for which it provides better performance, or if
14171 you wish to verify that the program will work on other systems
14172 which always treat uninitialized variable declarations this way.
14173
14174 -fno-ident
14175 Ignore the #ident directive.
14176
14177 -finhibit-size-directive
14178 Don't output a ".size" assembler directive, or anything else that
14179 would cause trouble if the function is split in the middle, and the
14180 two halves are placed at locations far apart in memory. This
14181 option is used when compiling crtstuff.c; you should not need to
14182 use it for anything else.
14183
14184 -fverbose-asm
14185 Put extra commentary information in the generated assembly code to
14186 make it more readable. This option is generally only of use to
14187 those who actually need to read the generated assembly code
14188 (perhaps while debugging the compiler itself).
14189
14190 -fno-verbose-asm, the default, causes the extra information to be
14191 omitted and is useful when comparing two assembler files.
14192
14193 -frecord-gcc-switches
14194 This switch causes the command line that was used to invoke the
14195 compiler to be recorded into the object file that is being created.
14196 This switch is only implemented on some targets and the exact
14197 format of the recording is target and binary file format dependent,
14198 but it usually takes the form of a section containing ASCII text.
14199 This switch is related to the -fverbose-asm switch, but that switch
14200 only records information in the assembler output file as comments,
14201 so it never reaches the object file.
14202
14203 -fpic
14204 Generate position-independent code (PIC) suitable for use in a
14205 shared library, if supported for the target machine. Such code
14206 accesses all constant addresses through a global offset table
14207 (GOT). The dynamic loader resolves the GOT entries when the
14208 program starts (the dynamic loader is not part of GCC; it is part
14209 of the operating system). If the GOT size for the linked
14210 executable exceeds a machine-specific maximum size, you get an
14211 error message from the linker indicating that -fpic does not work;
14212 in that case, recompile with -fPIC instead. (These maximums are 8k
14213 on the SPARC and 32k on the m68k and RS/6000. The 386 has no such
14214 limit.)
14215
14216 Position-independent code requires special support, and therefore
14217 works only on certain machines. For the 386, GCC supports PIC for
14218 System V but not for the Sun 386i. Code generated for the IBM
14219 RS/6000 is always position-independent.
14220
14221 When this flag is set, the macros "__pic__" and "__PIC__" are
14222 defined to 1.
14223
14224 -fPIC
14225 If supported for the target machine, emit position-independent
14226 code, suitable for dynamic linking and avoiding any limit on the
14227 size of the global offset table. This option makes a difference on
14228 the m68k, PowerPC and SPARC.
14229
14230 Position-independent code requires special support, and therefore
14231 works only on certain machines.
14232
14233 When this flag is set, the macros "__pic__" and "__PIC__" are
14234 defined to 2.
14235
14236 -fpie
14237 -fPIE
14238 These options are similar to -fpic and -fPIC, but generated
14239 position independent code can be only linked into executables.
14240 Usually these options are used when -pie GCC option will be used
14241 during linking.
14242
14243 -fpie and -fPIE both define the macros "__pie__" and "__PIE__".
14244 The macros have the value 1 for -fpie and 2 for -fPIE.
14245
14246 -fno-jump-tables
14247 Do not use jump tables for switch statements even where it would be
14248 more efficient than other code generation strategies. This option
14249 is of use in conjunction with -fpic or -fPIC for building code
14250 which forms part of a dynamic linker and cannot reference the
14251 address of a jump table. On some targets, jump tables do not
14252 require a GOT and this option is not needed.
14253
14254 -ffixed-reg
14255 Treat the register named reg as a fixed register; generated code
14256 should never refer to it (except perhaps as a stack pointer, frame
14257 pointer or in some other fixed role).
14258
14259 reg must be the name of a register. The register names accepted
14260 are machine-specific and are defined in the "REGISTER_NAMES" macro
14261 in the machine description macro file.
14262
14263 This flag does not have a negative form, because it specifies a
14264 three-way choice.
14265
14266 -fcall-used-reg
14267 Treat the register named reg as an allocable register that is
14268 clobbered by function calls. It may be allocated for temporaries
14269 or variables that do not live across a call. Functions compiled
14270 this way will not save and restore the register reg.
14271
14272 It is an error to used this flag with the frame pointer or stack
14273 pointer. Use of this flag for other registers that have fixed
14274 pervasive roles in the machine's execution model will produce
14275 disastrous results.
14276
14277 This flag does not have a negative form, because it specifies a
14278 three-way choice.
14279
14280 -fcall-saved-reg
14281 Treat the register named reg as an allocable register saved by
14282 functions. It may be allocated even for temporaries or variables
14283 that live across a call. Functions compiled this way will save and
14284 restore the register reg if they use it.
14285
14286 It is an error to used this flag with the frame pointer or stack
14287 pointer. Use of this flag for other registers that have fixed
14288 pervasive roles in the machine's execution model will produce
14289 disastrous results.
14290
14291 A different sort of disaster will result from the use of this flag
14292 for a register in which function values may be returned.
14293
14294 This flag does not have a negative form, because it specifies a
14295 three-way choice.
14296
14297 -fpack-struct[=n]
14298 Without a value specified, pack all structure members together
14299 without holes. When a value is specified (which must be a small
14300 power of two), pack structure members according to this value,
14301 representing the maximum alignment (that is, objects with default
14302 alignment requirements larger than this will be output potentially
14303 unaligned at the next fitting location.
14304
14305 Warning: the -fpack-struct switch causes GCC to generate code that
14306 is not binary compatible with code generated without that switch.
14307 Additionally, it makes the code suboptimal. Use it to conform to a
14308 non-default application binary interface.
14309
14310 -finstrument-functions
14311 Generate instrumentation calls for entry and exit to functions.
14312 Just after function entry and just before function exit, the
14313 following profiling functions will be called with the address of
14314 the current function and its call site. (On some platforms,
14315 "__builtin_return_address" does not work beyond the current
14316 function, so the call site information may not be available to the
14317 profiling functions otherwise.)
14318
14319 void __cyg_profile_func_enter (void *this_fn,
14320 void *call_site);
14321 void __cyg_profile_func_exit (void *this_fn,
14322 void *call_site);
14323
14324 The first argument is the address of the start of the current
14325 function, which may be looked up exactly in the symbol table.
14326
14327 This instrumentation is also done for functions expanded inline in
14328 other functions. The profiling calls will indicate where,
14329 conceptually, the inline function is entered and exited. This
14330 means that addressable versions of such functions must be
14331 available. If all your uses of a function are expanded inline,
14332 this may mean an additional expansion of code size. If you use
14333 extern inline in your C code, an addressable version of such
14334 functions must be provided. (This is normally the case anyways,
14335 but if you get lucky and the optimizer always expands the functions
14336 inline, you might have gotten away without providing static
14337 copies.)
14338
14339 A function may be given the attribute "no_instrument_function", in
14340 which case this instrumentation will not be done. This can be
14341 used, for example, for the profiling functions listed above, high-
14342 priority interrupt routines, and any functions from which the
14343 profiling functions cannot safely be called (perhaps signal
14344 handlers, if the profiling routines generate output or allocate
14345 memory).
14346
14347 -finstrument-functions-exclude-file-list=file,file,...
14348 Set the list of functions that are excluded from instrumentation
14349 (see the description of "-finstrument-functions"). If the file
14350 that contains a function definition matches with one of file, then
14351 that function is not instrumented. The match is done on
14352 substrings: if the file parameter is a substring of the file name,
14353 it is considered to be a match.
14354
14355 For example,
14356 "-finstrument-functions-exclude-file-list=/bits/stl,include/sys"
14357 will exclude any inline function defined in files whose pathnames
14358 contain "/bits/stl" or "include/sys".
14359
14360 If, for some reason, you want to include letter ',' in one of sym,
14361 write ','. For example,
14362 "-finstrument-functions-exclude-file-list=',,tmp'" (note the single
14363 quote surrounding the option).
14364
14365 -finstrument-functions-exclude-function-list=sym,sym,...
14366 This is similar to "-finstrument-functions-exclude-file-list", but
14367 this option sets the list of function names to be excluded from
14368 instrumentation. The function name to be matched is its user-
14369 visible name, such as "vector<int> blah(const vector<int> &)", not
14370 the internal mangled name (e.g., "_Z4blahRSt6vectorIiSaIiEE"). The
14371 match is done on substrings: if the sym parameter is a substring of
14372 the function name, it is considered to be a match. For C99 and C++
14373 extended identifiers, the function name must be given in UTF-8, not
14374 using universal character names.
14375
14376 -fstack-check
14377 Generate code to verify that you do not go beyond the boundary of
14378 the stack. You should specify this flag if you are running in an
14379 environment with multiple threads, but only rarely need to specify
14380 it in a single-threaded environment since stack overflow is
14381 automatically detected on nearly all systems if there is only one
14382 stack.
14383
14384 Note that this switch does not actually cause checking to be done;
14385 the operating system or the language runtime must do that. The
14386 switch causes generation of code to ensure that they see the stack
14387 being extended.
14388
14389 You can additionally specify a string parameter: "no" means no
14390 checking, "generic" means force the use of old-style checking,
14391 "specific" means use the best checking method and is equivalent to
14392 bare -fstack-check.
14393
14394 Old-style checking is a generic mechanism that requires no specific
14395 target support in the compiler but comes with the following
14396 drawbacks:
14397
14398 1. Modified allocation strategy for large objects: they will
14399 always be allocated dynamically if their size exceeds a fixed
14400 threshold.
14401
14402 2. Fixed limit on the size of the static frame of functions: when
14403 it is topped by a particular function, stack checking is not
14404 reliable and a warning is issued by the compiler.
14405
14406 3. Inefficiency: because of both the modified allocation strategy
14407 and the generic implementation, the performances of the code
14408 are hampered.
14409
14410 Note that old-style stack checking is also the fallback method for
14411 "specific" if no target support has been added in the compiler.
14412
14413 -fstack-limit-register=reg
14414 -fstack-limit-symbol=sym
14415 -fno-stack-limit
14416 Generate code to ensure that the stack does not grow beyond a
14417 certain value, either the value of a register or the address of a
14418 symbol. If the stack would grow beyond the value, a signal is
14419 raised. For most targets, the signal is raised before the stack
14420 overruns the boundary, so it is possible to catch the signal
14421 without taking special precautions.
14422
14423 For instance, if the stack starts at absolute address 0x80000000
14424 and grows downwards, you can use the flags
14425 -fstack-limit-symbol=__stack_limit and
14426 -Wl,--defsym,__stack_limit=0x7ffe0000 to enforce a stack limit of
14427 128KB. Note that this may only work with the GNU linker.
14428
14429 -fargument-alias
14430 -fargument-noalias
14431 -fargument-noalias-global
14432 -fargument-noalias-anything
14433 Specify the possible relationships among parameters and between
14434 parameters and global data.
14435
14436 -fargument-alias specifies that arguments (parameters) may alias
14437 each other and may alias global storage.-fargument-noalias
14438 specifies that arguments do not alias each other, but may alias
14439 global storage.-fargument-noalias-global specifies that arguments
14440 do not alias each other and do not alias global storage.
14441 -fargument-noalias-anything specifies that arguments do not alias
14442 any other storage.
14443
14444 Each language will automatically use whatever option is required by
14445 the language standard. You should not need to use these options
14446 yourself.
14447
14448 -fleading-underscore
14449 This option and its counterpart, -fno-leading-underscore, forcibly
14450 change the way C symbols are represented in the object file. One
14451 use is to help link with legacy assembly code.
14452
14453 Warning: the -fleading-underscore switch causes GCC to generate
14454 code that is not binary compatible with code generated without that
14455 switch. Use it to conform to a non-default application binary
14456 interface. Not all targets provide complete support for this
14457 switch.
14458
14459 -ftls-model=model
14460 Alter the thread-local storage model to be used. The model
14461 argument should be one of "global-dynamic", "local-dynamic",
14462 "initial-exec" or "local-exec".
14463
14464 The default without -fpic is "initial-exec"; with -fpic the default
14465 is "global-dynamic".
14466
14467 -fvisibility=default|internal|hidden|protected
14468 Set the default ELF image symbol visibility to the specified
14469 option---all symbols will be marked with this unless overridden
14470 within the code. Using this feature can very substantially improve
14471 linking and load times of shared object libraries, produce more
14472 optimized code, provide near-perfect API export and prevent symbol
14473 clashes. It is strongly recommended that you use this in any
14474 shared objects you distribute.
14475
14476 Despite the nomenclature, "default" always means public ie;
14477 available to be linked against from outside the shared object.
14478 "protected" and "internal" are pretty useless in real-world usage
14479 so the only other commonly used option will be "hidden". The
14480 default if -fvisibility isn't specified is "default", i.e., make
14481 every symbol public---this causes the same behavior as previous
14482 versions of GCC.
14483
14484 A good explanation of the benefits offered by ensuring ELF symbols
14485 have the correct visibility is given by "How To Write Shared
14486 Libraries" by Ulrich Drepper (which can be found at
14487 <http://people.redhat.com/~drepper/>)---however a superior solution
14488 made possible by this option to marking things hidden when the
14489 default is public is to make the default hidden and mark things
14490 public. This is the norm with DLL's on Windows and with
14491 -fvisibility=hidden and "__attribute__ ((visibility("default")))"
14492 instead of "__declspec(dllexport)" you get almost identical
14493 semantics with identical syntax. This is a great boon to those
14494 working with cross-platform projects.
14495
14496 For those adding visibility support to existing code, you may find
14497 #pragma GCC visibility of use. This works by you enclosing the
14498 declarations you wish to set visibility for with (for example)
14499 #pragma GCC visibility push(hidden) and #pragma GCC visibility pop.
14500 Bear in mind that symbol visibility should be viewed as part of the
14501 API interface contract and thus all new code should always specify
14502 visibility when it is not the default ie; declarations only for use
14503 within the local DSO should always be marked explicitly as hidden
14504 as so to avoid PLT indirection overheads---making this abundantly
14505 clear also aids readability and self-documentation of the code.
14506 Note that due to ISO C++ specification requirements, operator new
14507 and operator delete must always be of default visibility.
14508
14509 Be aware that headers from outside your project, in particular
14510 system headers and headers from any other library you use, may not
14511 be expecting to be compiled with visibility other than the default.
14512 You may need to explicitly say #pragma GCC visibility push(default)
14513 before including any such headers.
14514
14515 extern declarations are not affected by -fvisibility, so a lot of
14516 code can be recompiled with -fvisibility=hidden with no
14517 modifications. However, this means that calls to extern functions
14518 with no explicit visibility will use the PLT, so it is more
14519 effective to use __attribute ((visibility)) and/or #pragma GCC
14520 visibility to tell the compiler which extern declarations should be
14521 treated as hidden.
14522
14523 Note that -fvisibility does affect C++ vague linkage entities. This
14524 means that, for instance, an exception class that will be thrown
14525 between DSOs must be explicitly marked with default visibility so
14526 that the type_info nodes will be unified between the DSOs.
14527
14528 An overview of these techniques, their benefits and how to use them
14529 is at <http://gcc.gnu.org/wiki/Visibility>.
14530
14532 This section describes several environment variables that affect how
14533 GCC operates. Some of them work by specifying directories or prefixes
14534 to use when searching for various kinds of files. Some are used to
14535 specify other aspects of the compilation environment.
14536
14537 Note that you can also specify places to search using options such as
14538 -B, -I and -L. These take precedence over places specified using
14539 environment variables, which in turn take precedence over those
14540 specified by the configuration of GCC.
14541
14542 LANG
14543 LC_CTYPE
14544 LC_MESSAGES
14545 LC_ALL
14546 These environment variables control the way that GCC uses
14547 localization information that allow GCC to work with different
14548 national conventions. GCC inspects the locale categories LC_CTYPE
14549 and LC_MESSAGES if it has been configured to do so. These locale
14550 categories can be set to any value supported by your installation.
14551 A typical value is en_GB.UTF-8 for English in the United Kingdom
14552 encoded in UTF-8.
14553
14554 The LC_CTYPE environment variable specifies character
14555 classification. GCC uses it to determine the character boundaries
14556 in a string; this is needed for some multibyte encodings that
14557 contain quote and escape characters that would otherwise be
14558 interpreted as a string end or escape.
14559
14560 The LC_MESSAGES environment variable specifies the language to use
14561 in diagnostic messages.
14562
14563 If the LC_ALL environment variable is set, it overrides the value
14564 of LC_CTYPE and LC_MESSAGES; otherwise, LC_CTYPE and LC_MESSAGES
14565 default to the value of the LANG environment variable. If none of
14566 these variables are set, GCC defaults to traditional C English
14567 behavior.
14568
14569 TMPDIR
14570 If TMPDIR is set, it specifies the directory to use for temporary
14571 files. GCC uses temporary files to hold the output of one stage of
14572 compilation which is to be used as input to the next stage: for
14573 example, the output of the preprocessor, which is the input to the
14574 compiler proper.
14575
14576 GCC_EXEC_PREFIX
14577 If GCC_EXEC_PREFIX is set, it specifies a prefix to use in the
14578 names of the subprograms executed by the compiler. No slash is
14579 added when this prefix is combined with the name of a subprogram,
14580 but you can specify a prefix that ends with a slash if you wish.
14581
14582 If GCC_EXEC_PREFIX is not set, GCC will attempt to figure out an
14583 appropriate prefix to use based on the pathname it was invoked
14584 with.
14585
14586 If GCC cannot find the subprogram using the specified prefix, it
14587 tries looking in the usual places for the subprogram.
14588
14589 The default value of GCC_EXEC_PREFIX is prefix/lib/gcc/ where
14590 prefix is the prefix to the installed compiler. In many cases
14591 prefix is the value of "prefix" when you ran the configure script.
14592
14593 Other prefixes specified with -B take precedence over this prefix.
14594
14595 This prefix is also used for finding files such as crt0.o that are
14596 used for linking.
14597
14598 In addition, the prefix is used in an unusual way in finding the
14599 directories to search for header files. For each of the standard
14600 directories whose name normally begins with /usr/local/lib/gcc
14601 (more precisely, with the value of GCC_INCLUDE_DIR), GCC tries
14602 replacing that beginning with the specified prefix to produce an
14603 alternate directory name. Thus, with -Bfoo/, GCC will search
14604 foo/bar where it would normally search /usr/local/lib/bar. These
14605 alternate directories are searched first; the standard directories
14606 come next. If a standard directory begins with the configured
14607 prefix then the value of prefix is replaced by GCC_EXEC_PREFIX when
14608 looking for header files.
14609
14610 COMPILER_PATH
14611 The value of COMPILER_PATH is a colon-separated list of
14612 directories, much like PATH. GCC tries the directories thus
14613 specified when searching for subprograms, if it can't find the
14614 subprograms using GCC_EXEC_PREFIX.
14615
14616 LIBRARY_PATH
14617 The value of LIBRARY_PATH is a colon-separated list of directories,
14618 much like PATH. When configured as a native compiler, GCC tries
14619 the directories thus specified when searching for special linker
14620 files, if it can't find them using GCC_EXEC_PREFIX. Linking using
14621 GCC also uses these directories when searching for ordinary
14622 libraries for the -l option (but directories specified with -L come
14623 first).
14624
14625 LANG
14626 This variable is used to pass locale information to the compiler.
14627 One way in which this information is used is to determine the
14628 character set to be used when character literals, string literals
14629 and comments are parsed in C and C++. When the compiler is
14630 configured to allow multibyte characters, the following values for
14631 LANG are recognized:
14632
14633 C-JIS
14634 Recognize JIS characters.
14635
14636 C-SJIS
14637 Recognize SJIS characters.
14638
14639 C-EUCJP
14640 Recognize EUCJP characters.
14641
14642 If LANG is not defined, or if it has some other value, then the
14643 compiler will use mblen and mbtowc as defined by the default locale
14644 to recognize and translate multibyte characters.
14645
14646 Some additional environments variables affect the behavior of the
14647 preprocessor.
14648
14649 CPATH
14650 C_INCLUDE_PATH
14651 CPLUS_INCLUDE_PATH
14652 OBJC_INCLUDE_PATH
14653 Each variable's value is a list of directories separated by a
14654 special character, much like PATH, in which to look for header
14655 files. The special character, "PATH_SEPARATOR", is target-
14656 dependent and determined at GCC build time. For Microsoft Windows-
14657 based targets it is a semicolon, and for almost all other targets
14658 it is a colon.
14659
14660 CPATH specifies a list of directories to be searched as if
14661 specified with -I, but after any paths given with -I options on the
14662 command line. This environment variable is used regardless of
14663 which language is being preprocessed.
14664
14665 The remaining environment variables apply only when preprocessing
14666 the particular language indicated. Each specifies a list of
14667 directories to be searched as if specified with -isystem, but after
14668 any paths given with -isystem options on the command line.
14669
14670 In all these variables, an empty element instructs the compiler to
14671 search its current working directory. Empty elements can appear at
14672 the beginning or end of a path. For instance, if the value of
14673 CPATH is ":/special/include", that has the same effect as
14674 -I. -I/special/include.
14675
14676 DEPENDENCIES_OUTPUT
14677 If this variable is set, its value specifies how to output
14678 dependencies for Make based on the non-system header files
14679 processed by the compiler. System header files are ignored in the
14680 dependency output.
14681
14682 The value of DEPENDENCIES_OUTPUT can be just a file name, in which
14683 case the Make rules are written to that file, guessing the target
14684 name from the source file name. Or the value can have the form
14685 file target, in which case the rules are written to file file using
14686 target as the target name.
14687
14688 In other words, this environment variable is equivalent to
14689 combining the options -MM and -MF, with an optional -MT switch too.
14690
14691 SUNPRO_DEPENDENCIES
14692 This variable is the same as DEPENDENCIES_OUTPUT (see above),
14693 except that system header files are not ignored, so it implies -M
14694 rather than -MM. However, the dependence on the main input file is
14695 omitted.
14696
14698 For instructions on reporting bugs, see
14699 <http://bugzilla.redhat.com/bugzilla>.
14700
14702 1. On some systems, gcc -shared needs to build supplementary stub code
14703 for constructors to work. On multi-libbed systems, gcc -shared
14704 must select the correct support libraries to link against. Failing
14705 to supply the correct flags may lead to subtle defects. Supplying
14706 them in cases where they are not necessary is innocuous.
14707
14709 gpl(7), gfdl(7), fsf-funding(7), cpp(1), gcov(1), as(1), ld(1), gdb(1),
14710 adb(1), dbx(1), sdb(1) and the Info entries for gcc, cpp, as, ld,
14711 binutils and gdb.
14712
14714 See the Info entry for gcc, or
14715 <http://gcc.gnu.org/onlinedocs/gcc/Contributors.html>, for contributors
14716 to GCC.
14717
14719 Copyright (c) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14720 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
14721 Free Software Foundation, Inc.
14722
14723 Permission is granted to copy, distribute and/or modify this document
14724 under the terms of the GNU Free Documentation License, Version 1.2 or
14725 any later version published by the Free Software Foundation; with the
14726 Invariant Sections being "GNU General Public License" and "Funding Free
14727 Software", the Front-Cover texts being (a) (see below), and with the
14728 Back-Cover Texts being (b) (see below). A copy of the license is
14729 included in the gfdl(7) man page.
14730
14731 (a) The FSF's Front-Cover Text is:
14732
14733 A GNU Manual
14734
14735 (b) The FSF's Back-Cover Text is:
14736
14737 You have freedom to copy and modify this GNU Manual, like GNU
14738 software. Copies published by the Free Software Foundation raise
14739 funds for GNU development.
14740
14741
14742
14743gcc-4.5.1 2010-09-24 GCC(1)